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_source<T: Into<Option<crate::model::submit_build_request::Source>>>(
161 mut self,
162 v: T,
163 ) -> Self {
164 self.0.request.source = v.into();
165 self
166 }
167
168 pub fn set_storage_source<
174 T: std::convert::Into<std::boxed::Box<crate::model::StorageSource>>,
175 >(
176 mut self,
177 v: T,
178 ) -> Self {
179 self.0.request = self.0.request.set_storage_source(v);
180 self
181 }
182
183 pub fn set_build_type<T: Into<Option<crate::model::submit_build_request::BuildType>>>(
188 mut self,
189 v: T,
190 ) -> Self {
191 self.0.request.build_type = v.into();
192 self
193 }
194
195 pub fn set_buildpack_build<
201 T: std::convert::Into<
202 std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>,
203 >,
204 >(
205 mut self,
206 v: T,
207 ) -> Self {
208 self.0.request = self.0.request.set_buildpack_build(v);
209 self
210 }
211
212 pub fn set_docker_build<
218 T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::DockerBuild>>,
219 >(
220 mut self,
221 v: T,
222 ) -> Self {
223 self.0.request = self.0.request.set_docker_build(v);
224 self
225 }
226 }
227
228 #[doc(hidden)]
229 impl gax::options::internal::RequestBuilder for SubmitBuild {
230 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
231 &mut self.0.options
232 }
233 }
234
235 #[derive(Clone, Debug)]
257 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
258
259 impl ListOperations {
260 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
261 Self(RequestBuilder::new(stub))
262 }
263
264 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
266 mut self,
267 v: V,
268 ) -> Self {
269 self.0.request = v.into();
270 self
271 }
272
273 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
275 self.0.options = v.into();
276 self
277 }
278
279 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
281 (*self.0.stub)
282 .list_operations(self.0.request, self.0.options)
283 .await
284 .map(gax::response::Response::into_body)
285 }
286
287 pub fn by_page(
289 self,
290 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
291 {
292 use std::clone::Clone;
293 let token = self.0.request.page_token.clone();
294 let execute = move |token: String| {
295 let mut builder = self.clone();
296 builder.0.request = builder.0.request.set_page_token(token);
297 builder.send()
298 };
299 gax::paginator::internal::new_paginator(token, execute)
300 }
301
302 pub fn by_item(
304 self,
305 ) -> impl gax::paginator::ItemPaginator<
306 longrunning::model::ListOperationsResponse,
307 gax::error::Error,
308 > {
309 use gax::paginator::Paginator;
310 self.by_page().items()
311 }
312
313 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
315 self.0.request.name = v.into();
316 self
317 }
318
319 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
321 self.0.request.filter = v.into();
322 self
323 }
324
325 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
327 self.0.request.page_size = v.into();
328 self
329 }
330
331 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
333 self.0.request.page_token = v.into();
334 self
335 }
336 }
337
338 #[doc(hidden)]
339 impl gax::options::internal::RequestBuilder for ListOperations {
340 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
341 &mut self.0.options
342 }
343 }
344
345 #[derive(Clone, Debug)]
363 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
364
365 impl GetOperation {
366 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
367 Self(RequestBuilder::new(stub))
368 }
369
370 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
372 mut self,
373 v: V,
374 ) -> Self {
375 self.0.request = v.into();
376 self
377 }
378
379 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
381 self.0.options = v.into();
382 self
383 }
384
385 pub async fn send(self) -> Result<longrunning::model::Operation> {
387 (*self.0.stub)
388 .get_operation(self.0.request, self.0.options)
389 .await
390 .map(gax::response::Response::into_body)
391 }
392
393 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
395 self.0.request.name = v.into();
396 self
397 }
398 }
399
400 #[doc(hidden)]
401 impl gax::options::internal::RequestBuilder for GetOperation {
402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
403 &mut self.0.options
404 }
405 }
406
407 #[derive(Clone, Debug)]
425 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
426
427 impl DeleteOperation {
428 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
429 Self(RequestBuilder::new(stub))
430 }
431
432 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
434 mut self,
435 v: V,
436 ) -> Self {
437 self.0.request = v.into();
438 self
439 }
440
441 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
443 self.0.options = v.into();
444 self
445 }
446
447 pub async fn send(self) -> Result<()> {
449 (*self.0.stub)
450 .delete_operation(self.0.request, self.0.options)
451 .await
452 .map(gax::response::Response::into_body)
453 }
454
455 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
457 self.0.request.name = v.into();
458 self
459 }
460 }
461
462 #[doc(hidden)]
463 impl gax::options::internal::RequestBuilder for DeleteOperation {
464 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
465 &mut self.0.options
466 }
467 }
468
469 #[derive(Clone, Debug)]
487 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
488
489 impl WaitOperation {
490 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Builds>) -> Self {
491 Self(RequestBuilder::new(stub))
492 }
493
494 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
496 mut self,
497 v: V,
498 ) -> Self {
499 self.0.request = v.into();
500 self
501 }
502
503 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
505 self.0.options = v.into();
506 self
507 }
508
509 pub async fn send(self) -> Result<longrunning::model::Operation> {
511 (*self.0.stub)
512 .wait_operation(self.0.request, self.0.options)
513 .await
514 .map(gax::response::Response::into_body)
515 }
516
517 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
519 self.0.request.name = v.into();
520 self
521 }
522
523 pub fn set_timeout<T>(mut self, v: T) -> Self
525 where
526 T: std::convert::Into<wkt::Duration>,
527 {
528 self.0.request.timeout = std::option::Option::Some(v.into());
529 self
530 }
531
532 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
534 where
535 T: std::convert::Into<wkt::Duration>,
536 {
537 self.0.request.timeout = v.map(|x| x.into());
538 self
539 }
540 }
541
542 #[doc(hidden)]
543 impl gax::options::internal::RequestBuilder for WaitOperation {
544 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
545 &mut self.0.options
546 }
547 }
548}
549
550pub mod executions {
551 use crate::Result;
552
553 pub type ClientBuilder =
567 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
568
569 pub(crate) mod client {
570 use super::super::super::client::Executions;
571 pub struct Factory;
572 impl gax::client_builder::internal::ClientFactory for Factory {
573 type Client = Executions;
574 type Credentials = gaxi::options::Credentials;
575 async fn build(
576 self,
577 config: gaxi::options::ClientConfig,
578 ) -> gax::client_builder::Result<Self::Client> {
579 Self::Client::new(config).await
580 }
581 }
582 }
583
584 #[derive(Clone, Debug)]
586 pub(crate) struct RequestBuilder<R: std::default::Default> {
587 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
588 request: R,
589 options: gax::options::RequestOptions,
590 }
591
592 impl<R> RequestBuilder<R>
593 where
594 R: std::default::Default,
595 {
596 pub(crate) fn new(
597 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
598 ) -> Self {
599 Self {
600 stub,
601 request: R::default(),
602 options: gax::options::RequestOptions::default(),
603 }
604 }
605 }
606
607 #[derive(Clone, Debug)]
625 pub struct GetExecution(RequestBuilder<crate::model::GetExecutionRequest>);
626
627 impl GetExecution {
628 pub(crate) fn new(
629 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
630 ) -> Self {
631 Self(RequestBuilder::new(stub))
632 }
633
634 pub fn with_request<V: Into<crate::model::GetExecutionRequest>>(mut self, v: V) -> Self {
636 self.0.request = v.into();
637 self
638 }
639
640 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
642 self.0.options = v.into();
643 self
644 }
645
646 pub async fn send(self) -> Result<crate::model::Execution> {
648 (*self.0.stub)
649 .get_execution(self.0.request, self.0.options)
650 .await
651 .map(gax::response::Response::into_body)
652 }
653
654 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
658 self.0.request.name = v.into();
659 self
660 }
661 }
662
663 #[doc(hidden)]
664 impl gax::options::internal::RequestBuilder for GetExecution {
665 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
666 &mut self.0.options
667 }
668 }
669
670 #[derive(Clone, Debug)]
692 pub struct ListExecutions(RequestBuilder<crate::model::ListExecutionsRequest>);
693
694 impl ListExecutions {
695 pub(crate) fn new(
696 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
697 ) -> Self {
698 Self(RequestBuilder::new(stub))
699 }
700
701 pub fn with_request<V: Into<crate::model::ListExecutionsRequest>>(mut self, v: V) -> Self {
703 self.0.request = v.into();
704 self
705 }
706
707 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
709 self.0.options = v.into();
710 self
711 }
712
713 pub async fn send(self) -> Result<crate::model::ListExecutionsResponse> {
715 (*self.0.stub)
716 .list_executions(self.0.request, self.0.options)
717 .await
718 .map(gax::response::Response::into_body)
719 }
720
721 pub fn by_page(
723 self,
724 ) -> impl gax::paginator::Paginator<crate::model::ListExecutionsResponse, gax::error::Error>
725 {
726 use std::clone::Clone;
727 let token = self.0.request.page_token.clone();
728 let execute = move |token: String| {
729 let mut builder = self.clone();
730 builder.0.request = builder.0.request.set_page_token(token);
731 builder.send()
732 };
733 gax::paginator::internal::new_paginator(token, execute)
734 }
735
736 pub fn by_item(
738 self,
739 ) -> impl gax::paginator::ItemPaginator<crate::model::ListExecutionsResponse, gax::error::Error>
740 {
741 use gax::paginator::Paginator;
742 self.by_page().items()
743 }
744
745 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
749 self.0.request.parent = v.into();
750 self
751 }
752
753 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
755 self.0.request.page_size = v.into();
756 self
757 }
758
759 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
761 self.0.request.page_token = v.into();
762 self
763 }
764
765 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
767 self.0.request.show_deleted = v.into();
768 self
769 }
770 }
771
772 #[doc(hidden)]
773 impl gax::options::internal::RequestBuilder for ListExecutions {
774 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
775 &mut self.0.options
776 }
777 }
778
779 #[derive(Clone, Debug)]
798 pub struct DeleteExecution(RequestBuilder<crate::model::DeleteExecutionRequest>);
799
800 impl DeleteExecution {
801 pub(crate) fn new(
802 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
803 ) -> Self {
804 Self(RequestBuilder::new(stub))
805 }
806
807 pub fn with_request<V: Into<crate::model::DeleteExecutionRequest>>(mut self, v: V) -> Self {
809 self.0.request = v.into();
810 self
811 }
812
813 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
815 self.0.options = v.into();
816 self
817 }
818
819 pub async fn send(self) -> Result<longrunning::model::Operation> {
826 (*self.0.stub)
827 .delete_execution(self.0.request, self.0.options)
828 .await
829 .map(gax::response::Response::into_body)
830 }
831
832 pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
834 type Operation =
835 lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
836 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
837 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
838
839 let stub = self.0.stub.clone();
840 let mut options = self.0.options.clone();
841 options.set_retry_policy(gax::retry_policy::NeverRetry);
842 let query = move |name| {
843 let stub = stub.clone();
844 let options = options.clone();
845 async {
846 let op = GetOperation::new(stub)
847 .set_name(name)
848 .with_options(options)
849 .send()
850 .await?;
851 Ok(Operation::new(op))
852 }
853 };
854
855 let start = move || async {
856 let op = self.send().await?;
857 Ok(Operation::new(op))
858 };
859
860 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
861 }
862
863 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
867 self.0.request.name = v.into();
868 self
869 }
870
871 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
873 self.0.request.validate_only = v.into();
874 self
875 }
876
877 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
879 self.0.request.etag = v.into();
880 self
881 }
882 }
883
884 #[doc(hidden)]
885 impl gax::options::internal::RequestBuilder for DeleteExecution {
886 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
887 &mut self.0.options
888 }
889 }
890
891 #[derive(Clone, Debug)]
910 pub struct CancelExecution(RequestBuilder<crate::model::CancelExecutionRequest>);
911
912 impl CancelExecution {
913 pub(crate) fn new(
914 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
915 ) -> Self {
916 Self(RequestBuilder::new(stub))
917 }
918
919 pub fn with_request<V: Into<crate::model::CancelExecutionRequest>>(mut self, v: V) -> Self {
921 self.0.request = v.into();
922 self
923 }
924
925 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
927 self.0.options = v.into();
928 self
929 }
930
931 pub async fn send(self) -> Result<longrunning::model::Operation> {
938 (*self.0.stub)
939 .cancel_execution(self.0.request, self.0.options)
940 .await
941 .map(gax::response::Response::into_body)
942 }
943
944 pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
946 type Operation =
947 lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
948 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
949 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
950
951 let stub = self.0.stub.clone();
952 let mut options = self.0.options.clone();
953 options.set_retry_policy(gax::retry_policy::NeverRetry);
954 let query = move |name| {
955 let stub = stub.clone();
956 let options = options.clone();
957 async {
958 let op = GetOperation::new(stub)
959 .set_name(name)
960 .with_options(options)
961 .send()
962 .await?;
963 Ok(Operation::new(op))
964 }
965 };
966
967 let start = move || async {
968 let op = self.send().await?;
969 Ok(Operation::new(op))
970 };
971
972 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
973 }
974
975 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
979 self.0.request.name = v.into();
980 self
981 }
982
983 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
985 self.0.request.validate_only = v.into();
986 self
987 }
988
989 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
991 self.0.request.etag = v.into();
992 self
993 }
994 }
995
996 #[doc(hidden)]
997 impl gax::options::internal::RequestBuilder for CancelExecution {
998 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
999 &mut self.0.options
1000 }
1001 }
1002
1003 #[derive(Clone, Debug)]
1025 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1026
1027 impl ListOperations {
1028 pub(crate) fn new(
1029 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1030 ) -> Self {
1031 Self(RequestBuilder::new(stub))
1032 }
1033
1034 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1036 mut self,
1037 v: V,
1038 ) -> Self {
1039 self.0.request = v.into();
1040 self
1041 }
1042
1043 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1045 self.0.options = v.into();
1046 self
1047 }
1048
1049 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1051 (*self.0.stub)
1052 .list_operations(self.0.request, self.0.options)
1053 .await
1054 .map(gax::response::Response::into_body)
1055 }
1056
1057 pub fn by_page(
1059 self,
1060 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1061 {
1062 use std::clone::Clone;
1063 let token = self.0.request.page_token.clone();
1064 let execute = move |token: String| {
1065 let mut builder = self.clone();
1066 builder.0.request = builder.0.request.set_page_token(token);
1067 builder.send()
1068 };
1069 gax::paginator::internal::new_paginator(token, execute)
1070 }
1071
1072 pub fn by_item(
1074 self,
1075 ) -> impl gax::paginator::ItemPaginator<
1076 longrunning::model::ListOperationsResponse,
1077 gax::error::Error,
1078 > {
1079 use gax::paginator::Paginator;
1080 self.by_page().items()
1081 }
1082
1083 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1085 self.0.request.name = v.into();
1086 self
1087 }
1088
1089 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1091 self.0.request.filter = v.into();
1092 self
1093 }
1094
1095 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1097 self.0.request.page_size = v.into();
1098 self
1099 }
1100
1101 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1103 self.0.request.page_token = v.into();
1104 self
1105 }
1106 }
1107
1108 #[doc(hidden)]
1109 impl gax::options::internal::RequestBuilder for ListOperations {
1110 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1111 &mut self.0.options
1112 }
1113 }
1114
1115 #[derive(Clone, Debug)]
1133 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1134
1135 impl GetOperation {
1136 pub(crate) fn new(
1137 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1138 ) -> Self {
1139 Self(RequestBuilder::new(stub))
1140 }
1141
1142 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1144 mut self,
1145 v: V,
1146 ) -> Self {
1147 self.0.request = v.into();
1148 self
1149 }
1150
1151 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1153 self.0.options = v.into();
1154 self
1155 }
1156
1157 pub async fn send(self) -> Result<longrunning::model::Operation> {
1159 (*self.0.stub)
1160 .get_operation(self.0.request, self.0.options)
1161 .await
1162 .map(gax::response::Response::into_body)
1163 }
1164
1165 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1167 self.0.request.name = v.into();
1168 self
1169 }
1170 }
1171
1172 #[doc(hidden)]
1173 impl gax::options::internal::RequestBuilder for GetOperation {
1174 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1175 &mut self.0.options
1176 }
1177 }
1178
1179 #[derive(Clone, Debug)]
1197 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1198
1199 impl DeleteOperation {
1200 pub(crate) fn new(
1201 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1202 ) -> Self {
1203 Self(RequestBuilder::new(stub))
1204 }
1205
1206 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1208 mut self,
1209 v: V,
1210 ) -> Self {
1211 self.0.request = v.into();
1212 self
1213 }
1214
1215 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1217 self.0.options = v.into();
1218 self
1219 }
1220
1221 pub async fn send(self) -> Result<()> {
1223 (*self.0.stub)
1224 .delete_operation(self.0.request, self.0.options)
1225 .await
1226 .map(gax::response::Response::into_body)
1227 }
1228
1229 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1231 self.0.request.name = v.into();
1232 self
1233 }
1234 }
1235
1236 #[doc(hidden)]
1237 impl gax::options::internal::RequestBuilder for DeleteOperation {
1238 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1239 &mut self.0.options
1240 }
1241 }
1242
1243 #[derive(Clone, Debug)]
1261 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
1262
1263 impl WaitOperation {
1264 pub(crate) fn new(
1265 stub: std::sync::Arc<dyn super::super::stub::dynamic::Executions>,
1266 ) -> Self {
1267 Self(RequestBuilder::new(stub))
1268 }
1269
1270 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
1272 mut self,
1273 v: V,
1274 ) -> Self {
1275 self.0.request = v.into();
1276 self
1277 }
1278
1279 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1281 self.0.options = v.into();
1282 self
1283 }
1284
1285 pub async fn send(self) -> Result<longrunning::model::Operation> {
1287 (*self.0.stub)
1288 .wait_operation(self.0.request, self.0.options)
1289 .await
1290 .map(gax::response::Response::into_body)
1291 }
1292
1293 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1295 self.0.request.name = v.into();
1296 self
1297 }
1298
1299 pub fn set_timeout<T>(mut self, v: T) -> Self
1301 where
1302 T: std::convert::Into<wkt::Duration>,
1303 {
1304 self.0.request.timeout = std::option::Option::Some(v.into());
1305 self
1306 }
1307
1308 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1310 where
1311 T: std::convert::Into<wkt::Duration>,
1312 {
1313 self.0.request.timeout = v.map(|x| x.into());
1314 self
1315 }
1316 }
1317
1318 #[doc(hidden)]
1319 impl gax::options::internal::RequestBuilder for WaitOperation {
1320 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1321 &mut self.0.options
1322 }
1323 }
1324}
1325
1326pub mod jobs {
1327 use crate::Result;
1328
1329 pub type ClientBuilder =
1343 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1344
1345 pub(crate) mod client {
1346 use super::super::super::client::Jobs;
1347 pub struct Factory;
1348 impl gax::client_builder::internal::ClientFactory for Factory {
1349 type Client = Jobs;
1350 type Credentials = gaxi::options::Credentials;
1351 async fn build(
1352 self,
1353 config: gaxi::options::ClientConfig,
1354 ) -> gax::client_builder::Result<Self::Client> {
1355 Self::Client::new(config).await
1356 }
1357 }
1358 }
1359
1360 #[derive(Clone, Debug)]
1362 pub(crate) struct RequestBuilder<R: std::default::Default> {
1363 stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>,
1364 request: R,
1365 options: gax::options::RequestOptions,
1366 }
1367
1368 impl<R> RequestBuilder<R>
1369 where
1370 R: std::default::Default,
1371 {
1372 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1373 Self {
1374 stub,
1375 request: R::default(),
1376 options: gax::options::RequestOptions::default(),
1377 }
1378 }
1379 }
1380
1381 #[derive(Clone, Debug)]
1400 pub struct CreateJob(RequestBuilder<crate::model::CreateJobRequest>);
1401
1402 impl CreateJob {
1403 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1404 Self(RequestBuilder::new(stub))
1405 }
1406
1407 pub fn with_request<V: Into<crate::model::CreateJobRequest>>(mut self, v: V) -> Self {
1409 self.0.request = v.into();
1410 self
1411 }
1412
1413 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1415 self.0.options = v.into();
1416 self
1417 }
1418
1419 pub async fn send(self) -> Result<longrunning::model::Operation> {
1426 (*self.0.stub)
1427 .create_job(self.0.request, self.0.options)
1428 .await
1429 .map(gax::response::Response::into_body)
1430 }
1431
1432 pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1434 type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1435 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1436 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1437
1438 let stub = self.0.stub.clone();
1439 let mut options = self.0.options.clone();
1440 options.set_retry_policy(gax::retry_policy::NeverRetry);
1441 let query = move |name| {
1442 let stub = stub.clone();
1443 let options = options.clone();
1444 async {
1445 let op = GetOperation::new(stub)
1446 .set_name(name)
1447 .with_options(options)
1448 .send()
1449 .await?;
1450 Ok(Operation::new(op))
1451 }
1452 };
1453
1454 let start = move || async {
1455 let op = self.send().await?;
1456 Ok(Operation::new(op))
1457 };
1458
1459 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1460 }
1461
1462 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1466 self.0.request.parent = v.into();
1467 self
1468 }
1469
1470 pub fn set_job<T>(mut self, v: T) -> Self
1474 where
1475 T: std::convert::Into<crate::model::Job>,
1476 {
1477 self.0.request.job = std::option::Option::Some(v.into());
1478 self
1479 }
1480
1481 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
1485 where
1486 T: std::convert::Into<crate::model::Job>,
1487 {
1488 self.0.request.job = v.map(|x| x.into());
1489 self
1490 }
1491
1492 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496 self.0.request.job_id = v.into();
1497 self
1498 }
1499
1500 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1502 self.0.request.validate_only = v.into();
1503 self
1504 }
1505 }
1506
1507 #[doc(hidden)]
1508 impl gax::options::internal::RequestBuilder for CreateJob {
1509 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1510 &mut self.0.options
1511 }
1512 }
1513
1514 #[derive(Clone, Debug)]
1532 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
1533
1534 impl GetJob {
1535 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1536 Self(RequestBuilder::new(stub))
1537 }
1538
1539 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
1541 self.0.request = v.into();
1542 self
1543 }
1544
1545 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1547 self.0.options = v.into();
1548 self
1549 }
1550
1551 pub async fn send(self) -> Result<crate::model::Job> {
1553 (*self.0.stub)
1554 .get_job(self.0.request, self.0.options)
1555 .await
1556 .map(gax::response::Response::into_body)
1557 }
1558
1559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1563 self.0.request.name = v.into();
1564 self
1565 }
1566 }
1567
1568 #[doc(hidden)]
1569 impl gax::options::internal::RequestBuilder for GetJob {
1570 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1571 &mut self.0.options
1572 }
1573 }
1574
1575 #[derive(Clone, Debug)]
1597 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
1598
1599 impl ListJobs {
1600 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1601 Self(RequestBuilder::new(stub))
1602 }
1603
1604 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
1606 self.0.request = v.into();
1607 self
1608 }
1609
1610 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1612 self.0.options = v.into();
1613 self
1614 }
1615
1616 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
1618 (*self.0.stub)
1619 .list_jobs(self.0.request, self.0.options)
1620 .await
1621 .map(gax::response::Response::into_body)
1622 }
1623
1624 pub fn by_page(
1626 self,
1627 ) -> impl gax::paginator::Paginator<crate::model::ListJobsResponse, gax::error::Error>
1628 {
1629 use std::clone::Clone;
1630 let token = self.0.request.page_token.clone();
1631 let execute = move |token: String| {
1632 let mut builder = self.clone();
1633 builder.0.request = builder.0.request.set_page_token(token);
1634 builder.send()
1635 };
1636 gax::paginator::internal::new_paginator(token, execute)
1637 }
1638
1639 pub fn by_item(
1641 self,
1642 ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobsResponse, gax::error::Error>
1643 {
1644 use gax::paginator::Paginator;
1645 self.by_page().items()
1646 }
1647
1648 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1652 self.0.request.parent = v.into();
1653 self
1654 }
1655
1656 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1658 self.0.request.page_size = v.into();
1659 self
1660 }
1661
1662 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1664 self.0.request.page_token = v.into();
1665 self
1666 }
1667
1668 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1670 self.0.request.show_deleted = v.into();
1671 self
1672 }
1673 }
1674
1675 #[doc(hidden)]
1676 impl gax::options::internal::RequestBuilder for ListJobs {
1677 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1678 &mut self.0.options
1679 }
1680 }
1681
1682 #[derive(Clone, Debug)]
1701 pub struct UpdateJob(RequestBuilder<crate::model::UpdateJobRequest>);
1702
1703 impl UpdateJob {
1704 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1705 Self(RequestBuilder::new(stub))
1706 }
1707
1708 pub fn with_request<V: Into<crate::model::UpdateJobRequest>>(mut self, v: V) -> Self {
1710 self.0.request = v.into();
1711 self
1712 }
1713
1714 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1716 self.0.options = v.into();
1717 self
1718 }
1719
1720 pub async fn send(self) -> Result<longrunning::model::Operation> {
1727 (*self.0.stub)
1728 .update_job(self.0.request, self.0.options)
1729 .await
1730 .map(gax::response::Response::into_body)
1731 }
1732
1733 pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1735 type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1736 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1737 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1738
1739 let stub = self.0.stub.clone();
1740 let mut options = self.0.options.clone();
1741 options.set_retry_policy(gax::retry_policy::NeverRetry);
1742 let query = move |name| {
1743 let stub = stub.clone();
1744 let options = options.clone();
1745 async {
1746 let op = GetOperation::new(stub)
1747 .set_name(name)
1748 .with_options(options)
1749 .send()
1750 .await?;
1751 Ok(Operation::new(op))
1752 }
1753 };
1754
1755 let start = move || async {
1756 let op = self.send().await?;
1757 Ok(Operation::new(op))
1758 };
1759
1760 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1761 }
1762
1763 pub fn set_job<T>(mut self, v: T) -> Self
1767 where
1768 T: std::convert::Into<crate::model::Job>,
1769 {
1770 self.0.request.job = std::option::Option::Some(v.into());
1771 self
1772 }
1773
1774 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
1778 where
1779 T: std::convert::Into<crate::model::Job>,
1780 {
1781 self.0.request.job = v.map(|x| x.into());
1782 self
1783 }
1784
1785 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1787 self.0.request.validate_only = v.into();
1788 self
1789 }
1790
1791 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1793 self.0.request.allow_missing = v.into();
1794 self
1795 }
1796 }
1797
1798 #[doc(hidden)]
1799 impl gax::options::internal::RequestBuilder for UpdateJob {
1800 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1801 &mut self.0.options
1802 }
1803 }
1804
1805 #[derive(Clone, Debug)]
1824 pub struct DeleteJob(RequestBuilder<crate::model::DeleteJobRequest>);
1825
1826 impl DeleteJob {
1827 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1828 Self(RequestBuilder::new(stub))
1829 }
1830
1831 pub fn with_request<V: Into<crate::model::DeleteJobRequest>>(mut self, v: V) -> Self {
1833 self.0.request = v.into();
1834 self
1835 }
1836
1837 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1839 self.0.options = v.into();
1840 self
1841 }
1842
1843 pub async fn send(self) -> Result<longrunning::model::Operation> {
1850 (*self.0.stub)
1851 .delete_job(self.0.request, self.0.options)
1852 .await
1853 .map(gax::response::Response::into_body)
1854 }
1855
1856 pub fn poller(self) -> impl lro::Poller<crate::model::Job, crate::model::Job> {
1858 type Operation = lro::internal::Operation<crate::model::Job, crate::model::Job>;
1859 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1860 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1861
1862 let stub = self.0.stub.clone();
1863 let mut options = self.0.options.clone();
1864 options.set_retry_policy(gax::retry_policy::NeverRetry);
1865 let query = move |name| {
1866 let stub = stub.clone();
1867 let options = options.clone();
1868 async {
1869 let op = GetOperation::new(stub)
1870 .set_name(name)
1871 .with_options(options)
1872 .send()
1873 .await?;
1874 Ok(Operation::new(op))
1875 }
1876 };
1877
1878 let start = move || async {
1879 let op = self.send().await?;
1880 Ok(Operation::new(op))
1881 };
1882
1883 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1884 }
1885
1886 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1890 self.0.request.name = v.into();
1891 self
1892 }
1893
1894 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1896 self.0.request.validate_only = v.into();
1897 self
1898 }
1899
1900 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1902 self.0.request.etag = v.into();
1903 self
1904 }
1905 }
1906
1907 #[doc(hidden)]
1908 impl gax::options::internal::RequestBuilder for DeleteJob {
1909 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1910 &mut self.0.options
1911 }
1912 }
1913
1914 #[derive(Clone, Debug)]
1933 pub struct RunJob(RequestBuilder<crate::model::RunJobRequest>);
1934
1935 impl RunJob {
1936 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
1937 Self(RequestBuilder::new(stub))
1938 }
1939
1940 pub fn with_request<V: Into<crate::model::RunJobRequest>>(mut self, v: V) -> Self {
1942 self.0.request = v.into();
1943 self
1944 }
1945
1946 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1948 self.0.options = v.into();
1949 self
1950 }
1951
1952 pub async fn send(self) -> Result<longrunning::model::Operation> {
1959 (*self.0.stub)
1960 .run_job(self.0.request, self.0.options)
1961 .await
1962 .map(gax::response::Response::into_body)
1963 }
1964
1965 pub fn poller(self) -> impl lro::Poller<crate::model::Execution, crate::model::Execution> {
1967 type Operation =
1968 lro::internal::Operation<crate::model::Execution, crate::model::Execution>;
1969 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1970 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1971
1972 let stub = self.0.stub.clone();
1973 let mut options = self.0.options.clone();
1974 options.set_retry_policy(gax::retry_policy::NeverRetry);
1975 let query = move |name| {
1976 let stub = stub.clone();
1977 let options = options.clone();
1978 async {
1979 let op = GetOperation::new(stub)
1980 .set_name(name)
1981 .with_options(options)
1982 .send()
1983 .await?;
1984 Ok(Operation::new(op))
1985 }
1986 };
1987
1988 let start = move || async {
1989 let op = self.send().await?;
1990 Ok(Operation::new(op))
1991 };
1992
1993 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1994 }
1995
1996 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2000 self.0.request.name = v.into();
2001 self
2002 }
2003
2004 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2006 self.0.request.validate_only = v.into();
2007 self
2008 }
2009
2010 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2012 self.0.request.etag = v.into();
2013 self
2014 }
2015
2016 pub fn set_overrides<T>(mut self, v: T) -> Self
2018 where
2019 T: std::convert::Into<crate::model::run_job_request::Overrides>,
2020 {
2021 self.0.request.overrides = std::option::Option::Some(v.into());
2022 self
2023 }
2024
2025 pub fn set_or_clear_overrides<T>(mut self, v: std::option::Option<T>) -> Self
2027 where
2028 T: std::convert::Into<crate::model::run_job_request::Overrides>,
2029 {
2030 self.0.request.overrides = v.map(|x| x.into());
2031 self
2032 }
2033 }
2034
2035 #[doc(hidden)]
2036 impl gax::options::internal::RequestBuilder for RunJob {
2037 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2038 &mut self.0.options
2039 }
2040 }
2041
2042 #[derive(Clone, Debug)]
2060 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2061
2062 impl GetIamPolicy {
2063 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2064 Self(RequestBuilder::new(stub))
2065 }
2066
2067 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2069 self.0.request = v.into();
2070 self
2071 }
2072
2073 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2075 self.0.options = v.into();
2076 self
2077 }
2078
2079 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2081 (*self.0.stub)
2082 .get_iam_policy(self.0.request, self.0.options)
2083 .await
2084 .map(gax::response::Response::into_body)
2085 }
2086
2087 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2091 self.0.request.resource = v.into();
2092 self
2093 }
2094
2095 pub fn set_options<T>(mut self, v: T) -> Self
2097 where
2098 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2099 {
2100 self.0.request.options = std::option::Option::Some(v.into());
2101 self
2102 }
2103
2104 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2106 where
2107 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2108 {
2109 self.0.request.options = v.map(|x| x.into());
2110 self
2111 }
2112 }
2113
2114 #[doc(hidden)]
2115 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2116 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2117 &mut self.0.options
2118 }
2119 }
2120
2121 #[derive(Clone, Debug)]
2139 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2140
2141 impl SetIamPolicy {
2142 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2143 Self(RequestBuilder::new(stub))
2144 }
2145
2146 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2148 self.0.request = v.into();
2149 self
2150 }
2151
2152 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2154 self.0.options = v.into();
2155 self
2156 }
2157
2158 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2160 (*self.0.stub)
2161 .set_iam_policy(self.0.request, self.0.options)
2162 .await
2163 .map(gax::response::Response::into_body)
2164 }
2165
2166 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2170 self.0.request.resource = v.into();
2171 self
2172 }
2173
2174 pub fn set_policy<T>(mut self, v: T) -> Self
2178 where
2179 T: std::convert::Into<iam_v1::model::Policy>,
2180 {
2181 self.0.request.policy = std::option::Option::Some(v.into());
2182 self
2183 }
2184
2185 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2189 where
2190 T: std::convert::Into<iam_v1::model::Policy>,
2191 {
2192 self.0.request.policy = v.map(|x| x.into());
2193 self
2194 }
2195
2196 pub fn set_update_mask<T>(mut self, v: T) -> Self
2198 where
2199 T: std::convert::Into<wkt::FieldMask>,
2200 {
2201 self.0.request.update_mask = std::option::Option::Some(v.into());
2202 self
2203 }
2204
2205 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2207 where
2208 T: std::convert::Into<wkt::FieldMask>,
2209 {
2210 self.0.request.update_mask = v.map(|x| x.into());
2211 self
2212 }
2213 }
2214
2215 #[doc(hidden)]
2216 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2217 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2218 &mut self.0.options
2219 }
2220 }
2221
2222 #[derive(Clone, Debug)]
2240 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2241
2242 impl TestIamPermissions {
2243 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2244 Self(RequestBuilder::new(stub))
2245 }
2246
2247 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2249 mut self,
2250 v: V,
2251 ) -> Self {
2252 self.0.request = v.into();
2253 self
2254 }
2255
2256 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2258 self.0.options = v.into();
2259 self
2260 }
2261
2262 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2264 (*self.0.stub)
2265 .test_iam_permissions(self.0.request, self.0.options)
2266 .await
2267 .map(gax::response::Response::into_body)
2268 }
2269
2270 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2274 self.0.request.resource = v.into();
2275 self
2276 }
2277
2278 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2282 where
2283 T: std::iter::IntoIterator<Item = V>,
2284 V: std::convert::Into<std::string::String>,
2285 {
2286 use std::iter::Iterator;
2287 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2288 self
2289 }
2290 }
2291
2292 #[doc(hidden)]
2293 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2294 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2295 &mut self.0.options
2296 }
2297 }
2298
2299 #[derive(Clone, Debug)]
2321 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2322
2323 impl ListOperations {
2324 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2325 Self(RequestBuilder::new(stub))
2326 }
2327
2328 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2330 mut self,
2331 v: V,
2332 ) -> Self {
2333 self.0.request = v.into();
2334 self
2335 }
2336
2337 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2339 self.0.options = v.into();
2340 self
2341 }
2342
2343 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2345 (*self.0.stub)
2346 .list_operations(self.0.request, self.0.options)
2347 .await
2348 .map(gax::response::Response::into_body)
2349 }
2350
2351 pub fn by_page(
2353 self,
2354 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2355 {
2356 use std::clone::Clone;
2357 let token = self.0.request.page_token.clone();
2358 let execute = move |token: String| {
2359 let mut builder = self.clone();
2360 builder.0.request = builder.0.request.set_page_token(token);
2361 builder.send()
2362 };
2363 gax::paginator::internal::new_paginator(token, execute)
2364 }
2365
2366 pub fn by_item(
2368 self,
2369 ) -> impl gax::paginator::ItemPaginator<
2370 longrunning::model::ListOperationsResponse,
2371 gax::error::Error,
2372 > {
2373 use gax::paginator::Paginator;
2374 self.by_page().items()
2375 }
2376
2377 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2379 self.0.request.name = v.into();
2380 self
2381 }
2382
2383 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2385 self.0.request.filter = v.into();
2386 self
2387 }
2388
2389 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2391 self.0.request.page_size = v.into();
2392 self
2393 }
2394
2395 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2397 self.0.request.page_token = v.into();
2398 self
2399 }
2400 }
2401
2402 #[doc(hidden)]
2403 impl gax::options::internal::RequestBuilder for ListOperations {
2404 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2405 &mut self.0.options
2406 }
2407 }
2408
2409 #[derive(Clone, Debug)]
2427 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2428
2429 impl GetOperation {
2430 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2431 Self(RequestBuilder::new(stub))
2432 }
2433
2434 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2436 mut self,
2437 v: V,
2438 ) -> Self {
2439 self.0.request = v.into();
2440 self
2441 }
2442
2443 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2445 self.0.options = v.into();
2446 self
2447 }
2448
2449 pub async fn send(self) -> Result<longrunning::model::Operation> {
2451 (*self.0.stub)
2452 .get_operation(self.0.request, self.0.options)
2453 .await
2454 .map(gax::response::Response::into_body)
2455 }
2456
2457 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2459 self.0.request.name = v.into();
2460 self
2461 }
2462 }
2463
2464 #[doc(hidden)]
2465 impl gax::options::internal::RequestBuilder for GetOperation {
2466 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2467 &mut self.0.options
2468 }
2469 }
2470
2471 #[derive(Clone, Debug)]
2489 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2490
2491 impl DeleteOperation {
2492 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2493 Self(RequestBuilder::new(stub))
2494 }
2495
2496 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2498 mut self,
2499 v: V,
2500 ) -> Self {
2501 self.0.request = v.into();
2502 self
2503 }
2504
2505 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2507 self.0.options = v.into();
2508 self
2509 }
2510
2511 pub async fn send(self) -> Result<()> {
2513 (*self.0.stub)
2514 .delete_operation(self.0.request, self.0.options)
2515 .await
2516 .map(gax::response::Response::into_body)
2517 }
2518
2519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2521 self.0.request.name = v.into();
2522 self
2523 }
2524 }
2525
2526 #[doc(hidden)]
2527 impl gax::options::internal::RequestBuilder for DeleteOperation {
2528 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2529 &mut self.0.options
2530 }
2531 }
2532
2533 #[derive(Clone, Debug)]
2551 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
2552
2553 impl WaitOperation {
2554 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Jobs>) -> Self {
2555 Self(RequestBuilder::new(stub))
2556 }
2557
2558 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
2560 mut self,
2561 v: V,
2562 ) -> Self {
2563 self.0.request = v.into();
2564 self
2565 }
2566
2567 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2569 self.0.options = v.into();
2570 self
2571 }
2572
2573 pub async fn send(self) -> Result<longrunning::model::Operation> {
2575 (*self.0.stub)
2576 .wait_operation(self.0.request, self.0.options)
2577 .await
2578 .map(gax::response::Response::into_body)
2579 }
2580
2581 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2583 self.0.request.name = v.into();
2584 self
2585 }
2586
2587 pub fn set_timeout<T>(mut self, v: T) -> Self
2589 where
2590 T: std::convert::Into<wkt::Duration>,
2591 {
2592 self.0.request.timeout = std::option::Option::Some(v.into());
2593 self
2594 }
2595
2596 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
2598 where
2599 T: std::convert::Into<wkt::Duration>,
2600 {
2601 self.0.request.timeout = v.map(|x| x.into());
2602 self
2603 }
2604 }
2605
2606 #[doc(hidden)]
2607 impl gax::options::internal::RequestBuilder for WaitOperation {
2608 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2609 &mut self.0.options
2610 }
2611 }
2612}
2613
2614pub mod revisions {
2615 use crate::Result;
2616
2617 pub type ClientBuilder =
2631 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2632
2633 pub(crate) mod client {
2634 use super::super::super::client::Revisions;
2635 pub struct Factory;
2636 impl gax::client_builder::internal::ClientFactory for Factory {
2637 type Client = Revisions;
2638 type Credentials = gaxi::options::Credentials;
2639 async fn build(
2640 self,
2641 config: gaxi::options::ClientConfig,
2642 ) -> gax::client_builder::Result<Self::Client> {
2643 Self::Client::new(config).await
2644 }
2645 }
2646 }
2647
2648 #[derive(Clone, Debug)]
2650 pub(crate) struct RequestBuilder<R: std::default::Default> {
2651 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2652 request: R,
2653 options: gax::options::RequestOptions,
2654 }
2655
2656 impl<R> RequestBuilder<R>
2657 where
2658 R: std::default::Default,
2659 {
2660 pub(crate) fn new(
2661 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2662 ) -> Self {
2663 Self {
2664 stub,
2665 request: R::default(),
2666 options: gax::options::RequestOptions::default(),
2667 }
2668 }
2669 }
2670
2671 #[derive(Clone, Debug)]
2689 pub struct GetRevision(RequestBuilder<crate::model::GetRevisionRequest>);
2690
2691 impl GetRevision {
2692 pub(crate) fn new(
2693 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2694 ) -> Self {
2695 Self(RequestBuilder::new(stub))
2696 }
2697
2698 pub fn with_request<V: Into<crate::model::GetRevisionRequest>>(mut self, v: V) -> Self {
2700 self.0.request = v.into();
2701 self
2702 }
2703
2704 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2706 self.0.options = v.into();
2707 self
2708 }
2709
2710 pub async fn send(self) -> Result<crate::model::Revision> {
2712 (*self.0.stub)
2713 .get_revision(self.0.request, self.0.options)
2714 .await
2715 .map(gax::response::Response::into_body)
2716 }
2717
2718 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2722 self.0.request.name = v.into();
2723 self
2724 }
2725 }
2726
2727 #[doc(hidden)]
2728 impl gax::options::internal::RequestBuilder for GetRevision {
2729 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2730 &mut self.0.options
2731 }
2732 }
2733
2734 #[derive(Clone, Debug)]
2756 pub struct ListRevisions(RequestBuilder<crate::model::ListRevisionsRequest>);
2757
2758 impl ListRevisions {
2759 pub(crate) fn new(
2760 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2761 ) -> Self {
2762 Self(RequestBuilder::new(stub))
2763 }
2764
2765 pub fn with_request<V: Into<crate::model::ListRevisionsRequest>>(mut self, v: V) -> Self {
2767 self.0.request = v.into();
2768 self
2769 }
2770
2771 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2773 self.0.options = v.into();
2774 self
2775 }
2776
2777 pub async fn send(self) -> Result<crate::model::ListRevisionsResponse> {
2779 (*self.0.stub)
2780 .list_revisions(self.0.request, self.0.options)
2781 .await
2782 .map(gax::response::Response::into_body)
2783 }
2784
2785 pub fn by_page(
2787 self,
2788 ) -> impl gax::paginator::Paginator<crate::model::ListRevisionsResponse, gax::error::Error>
2789 {
2790 use std::clone::Clone;
2791 let token = self.0.request.page_token.clone();
2792 let execute = move |token: String| {
2793 let mut builder = self.clone();
2794 builder.0.request = builder.0.request.set_page_token(token);
2795 builder.send()
2796 };
2797 gax::paginator::internal::new_paginator(token, execute)
2798 }
2799
2800 pub fn by_item(
2802 self,
2803 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRevisionsResponse, gax::error::Error>
2804 {
2805 use gax::paginator::Paginator;
2806 self.by_page().items()
2807 }
2808
2809 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2813 self.0.request.parent = v.into();
2814 self
2815 }
2816
2817 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2819 self.0.request.page_size = v.into();
2820 self
2821 }
2822
2823 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2825 self.0.request.page_token = v.into();
2826 self
2827 }
2828
2829 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
2831 self.0.request.show_deleted = v.into();
2832 self
2833 }
2834 }
2835
2836 #[doc(hidden)]
2837 impl gax::options::internal::RequestBuilder for ListRevisions {
2838 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2839 &mut self.0.options
2840 }
2841 }
2842
2843 #[derive(Clone, Debug)]
2862 pub struct DeleteRevision(RequestBuilder<crate::model::DeleteRevisionRequest>);
2863
2864 impl DeleteRevision {
2865 pub(crate) fn new(
2866 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2867 ) -> Self {
2868 Self(RequestBuilder::new(stub))
2869 }
2870
2871 pub fn with_request<V: Into<crate::model::DeleteRevisionRequest>>(mut self, v: V) -> Self {
2873 self.0.request = v.into();
2874 self
2875 }
2876
2877 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2879 self.0.options = v.into();
2880 self
2881 }
2882
2883 pub async fn send(self) -> Result<longrunning::model::Operation> {
2890 (*self.0.stub)
2891 .delete_revision(self.0.request, self.0.options)
2892 .await
2893 .map(gax::response::Response::into_body)
2894 }
2895
2896 pub fn poller(self) -> impl lro::Poller<crate::model::Revision, crate::model::Revision> {
2898 type Operation =
2899 lro::internal::Operation<crate::model::Revision, crate::model::Revision>;
2900 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2901 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2902
2903 let stub = self.0.stub.clone();
2904 let mut options = self.0.options.clone();
2905 options.set_retry_policy(gax::retry_policy::NeverRetry);
2906 let query = move |name| {
2907 let stub = stub.clone();
2908 let options = options.clone();
2909 async {
2910 let op = GetOperation::new(stub)
2911 .set_name(name)
2912 .with_options(options)
2913 .send()
2914 .await?;
2915 Ok(Operation::new(op))
2916 }
2917 };
2918
2919 let start = move || async {
2920 let op = self.send().await?;
2921 Ok(Operation::new(op))
2922 };
2923
2924 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2925 }
2926
2927 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2931 self.0.request.name = v.into();
2932 self
2933 }
2934
2935 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2937 self.0.request.validate_only = v.into();
2938 self
2939 }
2940
2941 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2943 self.0.request.etag = v.into();
2944 self
2945 }
2946 }
2947
2948 #[doc(hidden)]
2949 impl gax::options::internal::RequestBuilder for DeleteRevision {
2950 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2951 &mut self.0.options
2952 }
2953 }
2954
2955 #[derive(Clone, Debug)]
2977 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2978
2979 impl ListOperations {
2980 pub(crate) fn new(
2981 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
2982 ) -> Self {
2983 Self(RequestBuilder::new(stub))
2984 }
2985
2986 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2988 mut self,
2989 v: V,
2990 ) -> Self {
2991 self.0.request = v.into();
2992 self
2993 }
2994
2995 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2997 self.0.options = v.into();
2998 self
2999 }
3000
3001 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3003 (*self.0.stub)
3004 .list_operations(self.0.request, self.0.options)
3005 .await
3006 .map(gax::response::Response::into_body)
3007 }
3008
3009 pub fn by_page(
3011 self,
3012 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3013 {
3014 use std::clone::Clone;
3015 let token = self.0.request.page_token.clone();
3016 let execute = move |token: String| {
3017 let mut builder = self.clone();
3018 builder.0.request = builder.0.request.set_page_token(token);
3019 builder.send()
3020 };
3021 gax::paginator::internal::new_paginator(token, execute)
3022 }
3023
3024 pub fn by_item(
3026 self,
3027 ) -> impl gax::paginator::ItemPaginator<
3028 longrunning::model::ListOperationsResponse,
3029 gax::error::Error,
3030 > {
3031 use gax::paginator::Paginator;
3032 self.by_page().items()
3033 }
3034
3035 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3037 self.0.request.name = v.into();
3038 self
3039 }
3040
3041 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3043 self.0.request.filter = v.into();
3044 self
3045 }
3046
3047 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3049 self.0.request.page_size = v.into();
3050 self
3051 }
3052
3053 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3055 self.0.request.page_token = v.into();
3056 self
3057 }
3058 }
3059
3060 #[doc(hidden)]
3061 impl gax::options::internal::RequestBuilder for ListOperations {
3062 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3063 &mut self.0.options
3064 }
3065 }
3066
3067 #[derive(Clone, Debug)]
3085 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3086
3087 impl GetOperation {
3088 pub(crate) fn new(
3089 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3090 ) -> Self {
3091 Self(RequestBuilder::new(stub))
3092 }
3093
3094 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3096 mut self,
3097 v: V,
3098 ) -> Self {
3099 self.0.request = v.into();
3100 self
3101 }
3102
3103 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3105 self.0.options = v.into();
3106 self
3107 }
3108
3109 pub async fn send(self) -> Result<longrunning::model::Operation> {
3111 (*self.0.stub)
3112 .get_operation(self.0.request, self.0.options)
3113 .await
3114 .map(gax::response::Response::into_body)
3115 }
3116
3117 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3119 self.0.request.name = v.into();
3120 self
3121 }
3122 }
3123
3124 #[doc(hidden)]
3125 impl gax::options::internal::RequestBuilder for GetOperation {
3126 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3127 &mut self.0.options
3128 }
3129 }
3130
3131 #[derive(Clone, Debug)]
3149 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3150
3151 impl DeleteOperation {
3152 pub(crate) fn new(
3153 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3154 ) -> Self {
3155 Self(RequestBuilder::new(stub))
3156 }
3157
3158 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3160 mut self,
3161 v: V,
3162 ) -> Self {
3163 self.0.request = v.into();
3164 self
3165 }
3166
3167 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3169 self.0.options = v.into();
3170 self
3171 }
3172
3173 pub async fn send(self) -> Result<()> {
3175 (*self.0.stub)
3176 .delete_operation(self.0.request, self.0.options)
3177 .await
3178 .map(gax::response::Response::into_body)
3179 }
3180
3181 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3183 self.0.request.name = v.into();
3184 self
3185 }
3186 }
3187
3188 #[doc(hidden)]
3189 impl gax::options::internal::RequestBuilder for DeleteOperation {
3190 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3191 &mut self.0.options
3192 }
3193 }
3194
3195 #[derive(Clone, Debug)]
3213 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
3214
3215 impl WaitOperation {
3216 pub(crate) fn new(
3217 stub: std::sync::Arc<dyn super::super::stub::dynamic::Revisions>,
3218 ) -> Self {
3219 Self(RequestBuilder::new(stub))
3220 }
3221
3222 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
3224 mut self,
3225 v: V,
3226 ) -> Self {
3227 self.0.request = v.into();
3228 self
3229 }
3230
3231 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3233 self.0.options = v.into();
3234 self
3235 }
3236
3237 pub async fn send(self) -> Result<longrunning::model::Operation> {
3239 (*self.0.stub)
3240 .wait_operation(self.0.request, self.0.options)
3241 .await
3242 .map(gax::response::Response::into_body)
3243 }
3244
3245 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3247 self.0.request.name = v.into();
3248 self
3249 }
3250
3251 pub fn set_timeout<T>(mut self, v: T) -> Self
3253 where
3254 T: std::convert::Into<wkt::Duration>,
3255 {
3256 self.0.request.timeout = std::option::Option::Some(v.into());
3257 self
3258 }
3259
3260 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3262 where
3263 T: std::convert::Into<wkt::Duration>,
3264 {
3265 self.0.request.timeout = v.map(|x| x.into());
3266 self
3267 }
3268 }
3269
3270 #[doc(hidden)]
3271 impl gax::options::internal::RequestBuilder for WaitOperation {
3272 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3273 &mut self.0.options
3274 }
3275 }
3276}
3277
3278pub mod services {
3279 use crate::Result;
3280
3281 pub type ClientBuilder =
3295 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3296
3297 pub(crate) mod client {
3298 use super::super::super::client::Services;
3299 pub struct Factory;
3300 impl gax::client_builder::internal::ClientFactory for Factory {
3301 type Client = Services;
3302 type Credentials = gaxi::options::Credentials;
3303 async fn build(
3304 self,
3305 config: gaxi::options::ClientConfig,
3306 ) -> gax::client_builder::Result<Self::Client> {
3307 Self::Client::new(config).await
3308 }
3309 }
3310 }
3311
3312 #[derive(Clone, Debug)]
3314 pub(crate) struct RequestBuilder<R: std::default::Default> {
3315 stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>,
3316 request: R,
3317 options: gax::options::RequestOptions,
3318 }
3319
3320 impl<R> RequestBuilder<R>
3321 where
3322 R: std::default::Default,
3323 {
3324 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3325 Self {
3326 stub,
3327 request: R::default(),
3328 options: gax::options::RequestOptions::default(),
3329 }
3330 }
3331 }
3332
3333 #[derive(Clone, Debug)]
3352 pub struct CreateService(RequestBuilder<crate::model::CreateServiceRequest>);
3353
3354 impl CreateService {
3355 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3356 Self(RequestBuilder::new(stub))
3357 }
3358
3359 pub fn with_request<V: Into<crate::model::CreateServiceRequest>>(mut self, v: V) -> Self {
3361 self.0.request = v.into();
3362 self
3363 }
3364
3365 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3367 self.0.options = v.into();
3368 self
3369 }
3370
3371 pub async fn send(self) -> Result<longrunning::model::Operation> {
3378 (*self.0.stub)
3379 .create_service(self.0.request, self.0.options)
3380 .await
3381 .map(gax::response::Response::into_body)
3382 }
3383
3384 pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3386 type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3387 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3388 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3389
3390 let stub = self.0.stub.clone();
3391 let mut options = self.0.options.clone();
3392 options.set_retry_policy(gax::retry_policy::NeverRetry);
3393 let query = move |name| {
3394 let stub = stub.clone();
3395 let options = options.clone();
3396 async {
3397 let op = GetOperation::new(stub)
3398 .set_name(name)
3399 .with_options(options)
3400 .send()
3401 .await?;
3402 Ok(Operation::new(op))
3403 }
3404 };
3405
3406 let start = move || async {
3407 let op = self.send().await?;
3408 Ok(Operation::new(op))
3409 };
3410
3411 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3412 }
3413
3414 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3418 self.0.request.parent = v.into();
3419 self
3420 }
3421
3422 pub fn set_service<T>(mut self, v: T) -> Self
3426 where
3427 T: std::convert::Into<crate::model::Service>,
3428 {
3429 self.0.request.service = std::option::Option::Some(v.into());
3430 self
3431 }
3432
3433 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3437 where
3438 T: std::convert::Into<crate::model::Service>,
3439 {
3440 self.0.request.service = v.map(|x| x.into());
3441 self
3442 }
3443
3444 pub fn set_service_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.0.request.service_id = v.into();
3449 self
3450 }
3451
3452 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3454 self.0.request.validate_only = v.into();
3455 self
3456 }
3457 }
3458
3459 #[doc(hidden)]
3460 impl gax::options::internal::RequestBuilder for CreateService {
3461 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3462 &mut self.0.options
3463 }
3464 }
3465
3466 #[derive(Clone, Debug)]
3484 pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
3485
3486 impl GetService {
3487 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3488 Self(RequestBuilder::new(stub))
3489 }
3490
3491 pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
3493 self.0.request = v.into();
3494 self
3495 }
3496
3497 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3499 self.0.options = v.into();
3500 self
3501 }
3502
3503 pub async fn send(self) -> Result<crate::model::Service> {
3505 (*self.0.stub)
3506 .get_service(self.0.request, self.0.options)
3507 .await
3508 .map(gax::response::Response::into_body)
3509 }
3510
3511 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3515 self.0.request.name = v.into();
3516 self
3517 }
3518 }
3519
3520 #[doc(hidden)]
3521 impl gax::options::internal::RequestBuilder for GetService {
3522 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3523 &mut self.0.options
3524 }
3525 }
3526
3527 #[derive(Clone, Debug)]
3549 pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
3550
3551 impl ListServices {
3552 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3553 Self(RequestBuilder::new(stub))
3554 }
3555
3556 pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
3558 self.0.request = v.into();
3559 self
3560 }
3561
3562 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3564 self.0.options = v.into();
3565 self
3566 }
3567
3568 pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
3570 (*self.0.stub)
3571 .list_services(self.0.request, self.0.options)
3572 .await
3573 .map(gax::response::Response::into_body)
3574 }
3575
3576 pub fn by_page(
3578 self,
3579 ) -> impl gax::paginator::Paginator<crate::model::ListServicesResponse, gax::error::Error>
3580 {
3581 use std::clone::Clone;
3582 let token = self.0.request.page_token.clone();
3583 let execute = move |token: String| {
3584 let mut builder = self.clone();
3585 builder.0.request = builder.0.request.set_page_token(token);
3586 builder.send()
3587 };
3588 gax::paginator::internal::new_paginator(token, execute)
3589 }
3590
3591 pub fn by_item(
3593 self,
3594 ) -> impl gax::paginator::ItemPaginator<crate::model::ListServicesResponse, gax::error::Error>
3595 {
3596 use gax::paginator::Paginator;
3597 self.by_page().items()
3598 }
3599
3600 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3604 self.0.request.parent = v.into();
3605 self
3606 }
3607
3608 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3610 self.0.request.page_size = v.into();
3611 self
3612 }
3613
3614 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3616 self.0.request.page_token = v.into();
3617 self
3618 }
3619
3620 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
3622 self.0.request.show_deleted = v.into();
3623 self
3624 }
3625 }
3626
3627 #[doc(hidden)]
3628 impl gax::options::internal::RequestBuilder for ListServices {
3629 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3630 &mut self.0.options
3631 }
3632 }
3633
3634 #[derive(Clone, Debug)]
3653 pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
3654
3655 impl UpdateService {
3656 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3657 Self(RequestBuilder::new(stub))
3658 }
3659
3660 pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
3662 self.0.request = v.into();
3663 self
3664 }
3665
3666 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3668 self.0.options = v.into();
3669 self
3670 }
3671
3672 pub async fn send(self) -> Result<longrunning::model::Operation> {
3679 (*self.0.stub)
3680 .update_service(self.0.request, self.0.options)
3681 .await
3682 .map(gax::response::Response::into_body)
3683 }
3684
3685 pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3687 type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3688 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3689 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3690
3691 let stub = self.0.stub.clone();
3692 let mut options = self.0.options.clone();
3693 options.set_retry_policy(gax::retry_policy::NeverRetry);
3694 let query = move |name| {
3695 let stub = stub.clone();
3696 let options = options.clone();
3697 async {
3698 let op = GetOperation::new(stub)
3699 .set_name(name)
3700 .with_options(options)
3701 .send()
3702 .await?;
3703 Ok(Operation::new(op))
3704 }
3705 };
3706
3707 let start = move || async {
3708 let op = self.send().await?;
3709 Ok(Operation::new(op))
3710 };
3711
3712 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3713 }
3714
3715 pub fn set_update_mask<T>(mut self, v: T) -> Self
3717 where
3718 T: std::convert::Into<wkt::FieldMask>,
3719 {
3720 self.0.request.update_mask = std::option::Option::Some(v.into());
3721 self
3722 }
3723
3724 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3726 where
3727 T: std::convert::Into<wkt::FieldMask>,
3728 {
3729 self.0.request.update_mask = v.map(|x| x.into());
3730 self
3731 }
3732
3733 pub fn set_service<T>(mut self, v: T) -> Self
3737 where
3738 T: std::convert::Into<crate::model::Service>,
3739 {
3740 self.0.request.service = std::option::Option::Some(v.into());
3741 self
3742 }
3743
3744 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3748 where
3749 T: std::convert::Into<crate::model::Service>,
3750 {
3751 self.0.request.service = v.map(|x| x.into());
3752 self
3753 }
3754
3755 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3757 self.0.request.validate_only = v.into();
3758 self
3759 }
3760
3761 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
3763 self.0.request.allow_missing = v.into();
3764 self
3765 }
3766 }
3767
3768 #[doc(hidden)]
3769 impl gax::options::internal::RequestBuilder for UpdateService {
3770 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3771 &mut self.0.options
3772 }
3773 }
3774
3775 #[derive(Clone, Debug)]
3794 pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
3795
3796 impl DeleteService {
3797 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3798 Self(RequestBuilder::new(stub))
3799 }
3800
3801 pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
3803 self.0.request = v.into();
3804 self
3805 }
3806
3807 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3809 self.0.options = v.into();
3810 self
3811 }
3812
3813 pub async fn send(self) -> Result<longrunning::model::Operation> {
3820 (*self.0.stub)
3821 .delete_service(self.0.request, self.0.options)
3822 .await
3823 .map(gax::response::Response::into_body)
3824 }
3825
3826 pub fn poller(self) -> impl lro::Poller<crate::model::Service, crate::model::Service> {
3828 type Operation = lro::internal::Operation<crate::model::Service, crate::model::Service>;
3829 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3830 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3831
3832 let stub = self.0.stub.clone();
3833 let mut options = self.0.options.clone();
3834 options.set_retry_policy(gax::retry_policy::NeverRetry);
3835 let query = move |name| {
3836 let stub = stub.clone();
3837 let options = options.clone();
3838 async {
3839 let op = GetOperation::new(stub)
3840 .set_name(name)
3841 .with_options(options)
3842 .send()
3843 .await?;
3844 Ok(Operation::new(op))
3845 }
3846 };
3847
3848 let start = move || async {
3849 let op = self.send().await?;
3850 Ok(Operation::new(op))
3851 };
3852
3853 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3854 }
3855
3856 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3860 self.0.request.name = v.into();
3861 self
3862 }
3863
3864 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3866 self.0.request.validate_only = v.into();
3867 self
3868 }
3869
3870 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3872 self.0.request.etag = v.into();
3873 self
3874 }
3875 }
3876
3877 #[doc(hidden)]
3878 impl gax::options::internal::RequestBuilder for DeleteService {
3879 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3880 &mut self.0.options
3881 }
3882 }
3883
3884 #[derive(Clone, Debug)]
3902 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3903
3904 impl GetIamPolicy {
3905 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3906 Self(RequestBuilder::new(stub))
3907 }
3908
3909 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3911 self.0.request = v.into();
3912 self
3913 }
3914
3915 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3917 self.0.options = v.into();
3918 self
3919 }
3920
3921 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3923 (*self.0.stub)
3924 .get_iam_policy(self.0.request, self.0.options)
3925 .await
3926 .map(gax::response::Response::into_body)
3927 }
3928
3929 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3933 self.0.request.resource = v.into();
3934 self
3935 }
3936
3937 pub fn set_options<T>(mut self, v: T) -> Self
3939 where
3940 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3941 {
3942 self.0.request.options = std::option::Option::Some(v.into());
3943 self
3944 }
3945
3946 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3948 where
3949 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3950 {
3951 self.0.request.options = v.map(|x| x.into());
3952 self
3953 }
3954 }
3955
3956 #[doc(hidden)]
3957 impl gax::options::internal::RequestBuilder for GetIamPolicy {
3958 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3959 &mut self.0.options
3960 }
3961 }
3962
3963 #[derive(Clone, Debug)]
3981 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3982
3983 impl SetIamPolicy {
3984 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
3985 Self(RequestBuilder::new(stub))
3986 }
3987
3988 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3990 self.0.request = v.into();
3991 self
3992 }
3993
3994 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3996 self.0.options = v.into();
3997 self
3998 }
3999
4000 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4002 (*self.0.stub)
4003 .set_iam_policy(self.0.request, self.0.options)
4004 .await
4005 .map(gax::response::Response::into_body)
4006 }
4007
4008 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4012 self.0.request.resource = v.into();
4013 self
4014 }
4015
4016 pub fn set_policy<T>(mut self, v: T) -> Self
4020 where
4021 T: std::convert::Into<iam_v1::model::Policy>,
4022 {
4023 self.0.request.policy = std::option::Option::Some(v.into());
4024 self
4025 }
4026
4027 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4031 where
4032 T: std::convert::Into<iam_v1::model::Policy>,
4033 {
4034 self.0.request.policy = v.map(|x| x.into());
4035 self
4036 }
4037
4038 pub fn set_update_mask<T>(mut self, v: T) -> Self
4040 where
4041 T: std::convert::Into<wkt::FieldMask>,
4042 {
4043 self.0.request.update_mask = std::option::Option::Some(v.into());
4044 self
4045 }
4046
4047 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4049 where
4050 T: std::convert::Into<wkt::FieldMask>,
4051 {
4052 self.0.request.update_mask = v.map(|x| x.into());
4053 self
4054 }
4055 }
4056
4057 #[doc(hidden)]
4058 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4059 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4060 &mut self.0.options
4061 }
4062 }
4063
4064 #[derive(Clone, Debug)]
4082 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4083
4084 impl TestIamPermissions {
4085 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4086 Self(RequestBuilder::new(stub))
4087 }
4088
4089 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4091 mut self,
4092 v: V,
4093 ) -> Self {
4094 self.0.request = v.into();
4095 self
4096 }
4097
4098 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4100 self.0.options = v.into();
4101 self
4102 }
4103
4104 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4106 (*self.0.stub)
4107 .test_iam_permissions(self.0.request, self.0.options)
4108 .await
4109 .map(gax::response::Response::into_body)
4110 }
4111
4112 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4116 self.0.request.resource = v.into();
4117 self
4118 }
4119
4120 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4124 where
4125 T: std::iter::IntoIterator<Item = V>,
4126 V: std::convert::Into<std::string::String>,
4127 {
4128 use std::iter::Iterator;
4129 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4130 self
4131 }
4132 }
4133
4134 #[doc(hidden)]
4135 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4136 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4137 &mut self.0.options
4138 }
4139 }
4140
4141 #[derive(Clone, Debug)]
4163 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4164
4165 impl ListOperations {
4166 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4167 Self(RequestBuilder::new(stub))
4168 }
4169
4170 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4172 mut self,
4173 v: V,
4174 ) -> Self {
4175 self.0.request = v.into();
4176 self
4177 }
4178
4179 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4181 self.0.options = v.into();
4182 self
4183 }
4184
4185 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4187 (*self.0.stub)
4188 .list_operations(self.0.request, self.0.options)
4189 .await
4190 .map(gax::response::Response::into_body)
4191 }
4192
4193 pub fn by_page(
4195 self,
4196 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4197 {
4198 use std::clone::Clone;
4199 let token = self.0.request.page_token.clone();
4200 let execute = move |token: String| {
4201 let mut builder = self.clone();
4202 builder.0.request = builder.0.request.set_page_token(token);
4203 builder.send()
4204 };
4205 gax::paginator::internal::new_paginator(token, execute)
4206 }
4207
4208 pub fn by_item(
4210 self,
4211 ) -> impl gax::paginator::ItemPaginator<
4212 longrunning::model::ListOperationsResponse,
4213 gax::error::Error,
4214 > {
4215 use gax::paginator::Paginator;
4216 self.by_page().items()
4217 }
4218
4219 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4221 self.0.request.name = v.into();
4222 self
4223 }
4224
4225 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4227 self.0.request.filter = v.into();
4228 self
4229 }
4230
4231 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4233 self.0.request.page_size = v.into();
4234 self
4235 }
4236
4237 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4239 self.0.request.page_token = v.into();
4240 self
4241 }
4242 }
4243
4244 #[doc(hidden)]
4245 impl gax::options::internal::RequestBuilder for ListOperations {
4246 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4247 &mut self.0.options
4248 }
4249 }
4250
4251 #[derive(Clone, Debug)]
4269 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4270
4271 impl GetOperation {
4272 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4273 Self(RequestBuilder::new(stub))
4274 }
4275
4276 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4278 mut self,
4279 v: V,
4280 ) -> Self {
4281 self.0.request = v.into();
4282 self
4283 }
4284
4285 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4287 self.0.options = v.into();
4288 self
4289 }
4290
4291 pub async fn send(self) -> Result<longrunning::model::Operation> {
4293 (*self.0.stub)
4294 .get_operation(self.0.request, self.0.options)
4295 .await
4296 .map(gax::response::Response::into_body)
4297 }
4298
4299 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4301 self.0.request.name = v.into();
4302 self
4303 }
4304 }
4305
4306 #[doc(hidden)]
4307 impl gax::options::internal::RequestBuilder for GetOperation {
4308 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4309 &mut self.0.options
4310 }
4311 }
4312
4313 #[derive(Clone, Debug)]
4331 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4332
4333 impl DeleteOperation {
4334 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4335 Self(RequestBuilder::new(stub))
4336 }
4337
4338 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4340 mut self,
4341 v: V,
4342 ) -> Self {
4343 self.0.request = v.into();
4344 self
4345 }
4346
4347 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4349 self.0.options = v.into();
4350 self
4351 }
4352
4353 pub async fn send(self) -> Result<()> {
4355 (*self.0.stub)
4356 .delete_operation(self.0.request, self.0.options)
4357 .await
4358 .map(gax::response::Response::into_body)
4359 }
4360
4361 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4363 self.0.request.name = v.into();
4364 self
4365 }
4366 }
4367
4368 #[doc(hidden)]
4369 impl gax::options::internal::RequestBuilder for DeleteOperation {
4370 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4371 &mut self.0.options
4372 }
4373 }
4374
4375 #[derive(Clone, Debug)]
4393 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
4394
4395 impl WaitOperation {
4396 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Services>) -> Self {
4397 Self(RequestBuilder::new(stub))
4398 }
4399
4400 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
4402 mut self,
4403 v: V,
4404 ) -> Self {
4405 self.0.request = v.into();
4406 self
4407 }
4408
4409 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4411 self.0.options = v.into();
4412 self
4413 }
4414
4415 pub async fn send(self) -> Result<longrunning::model::Operation> {
4417 (*self.0.stub)
4418 .wait_operation(self.0.request, self.0.options)
4419 .await
4420 .map(gax::response::Response::into_body)
4421 }
4422
4423 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4425 self.0.request.name = v.into();
4426 self
4427 }
4428
4429 pub fn set_timeout<T>(mut self, v: T) -> Self
4431 where
4432 T: std::convert::Into<wkt::Duration>,
4433 {
4434 self.0.request.timeout = std::option::Option::Some(v.into());
4435 self
4436 }
4437
4438 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4440 where
4441 T: std::convert::Into<wkt::Duration>,
4442 {
4443 self.0.request.timeout = v.map(|x| x.into());
4444 self
4445 }
4446 }
4447
4448 #[doc(hidden)]
4449 impl gax::options::internal::RequestBuilder for WaitOperation {
4450 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4451 &mut self.0.options
4452 }
4453 }
4454}
4455
4456pub mod tasks {
4457 use crate::Result;
4458
4459 pub type ClientBuilder =
4473 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4474
4475 pub(crate) mod client {
4476 use super::super::super::client::Tasks;
4477 pub struct Factory;
4478 impl gax::client_builder::internal::ClientFactory for Factory {
4479 type Client = Tasks;
4480 type Credentials = gaxi::options::Credentials;
4481 async fn build(
4482 self,
4483 config: gaxi::options::ClientConfig,
4484 ) -> gax::client_builder::Result<Self::Client> {
4485 Self::Client::new(config).await
4486 }
4487 }
4488 }
4489
4490 #[derive(Clone, Debug)]
4492 pub(crate) struct RequestBuilder<R: std::default::Default> {
4493 stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>,
4494 request: R,
4495 options: gax::options::RequestOptions,
4496 }
4497
4498 impl<R> RequestBuilder<R>
4499 where
4500 R: std::default::Default,
4501 {
4502 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4503 Self {
4504 stub,
4505 request: R::default(),
4506 options: gax::options::RequestOptions::default(),
4507 }
4508 }
4509 }
4510
4511 #[derive(Clone, Debug)]
4529 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
4530
4531 impl GetTask {
4532 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4533 Self(RequestBuilder::new(stub))
4534 }
4535
4536 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
4538 self.0.request = v.into();
4539 self
4540 }
4541
4542 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4544 self.0.options = v.into();
4545 self
4546 }
4547
4548 pub async fn send(self) -> Result<crate::model::Task> {
4550 (*self.0.stub)
4551 .get_task(self.0.request, self.0.options)
4552 .await
4553 .map(gax::response::Response::into_body)
4554 }
4555
4556 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4560 self.0.request.name = v.into();
4561 self
4562 }
4563 }
4564
4565 #[doc(hidden)]
4566 impl gax::options::internal::RequestBuilder for GetTask {
4567 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4568 &mut self.0.options
4569 }
4570 }
4571
4572 #[derive(Clone, Debug)]
4594 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
4595
4596 impl ListTasks {
4597 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4598 Self(RequestBuilder::new(stub))
4599 }
4600
4601 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
4603 self.0.request = v.into();
4604 self
4605 }
4606
4607 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4609 self.0.options = v.into();
4610 self
4611 }
4612
4613 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
4615 (*self.0.stub)
4616 .list_tasks(self.0.request, self.0.options)
4617 .await
4618 .map(gax::response::Response::into_body)
4619 }
4620
4621 pub fn by_page(
4623 self,
4624 ) -> impl gax::paginator::Paginator<crate::model::ListTasksResponse, gax::error::Error>
4625 {
4626 use std::clone::Clone;
4627 let token = self.0.request.page_token.clone();
4628 let execute = move |token: String| {
4629 let mut builder = self.clone();
4630 builder.0.request = builder.0.request.set_page_token(token);
4631 builder.send()
4632 };
4633 gax::paginator::internal::new_paginator(token, execute)
4634 }
4635
4636 pub fn by_item(
4638 self,
4639 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTasksResponse, gax::error::Error>
4640 {
4641 use gax::paginator::Paginator;
4642 self.by_page().items()
4643 }
4644
4645 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4649 self.0.request.parent = v.into();
4650 self
4651 }
4652
4653 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4655 self.0.request.page_size = v.into();
4656 self
4657 }
4658
4659 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4661 self.0.request.page_token = v.into();
4662 self
4663 }
4664
4665 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
4667 self.0.request.show_deleted = v.into();
4668 self
4669 }
4670 }
4671
4672 #[doc(hidden)]
4673 impl gax::options::internal::RequestBuilder for ListTasks {
4674 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4675 &mut self.0.options
4676 }
4677 }
4678
4679 #[derive(Clone, Debug)]
4701 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4702
4703 impl ListOperations {
4704 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4705 Self(RequestBuilder::new(stub))
4706 }
4707
4708 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4710 mut self,
4711 v: V,
4712 ) -> Self {
4713 self.0.request = v.into();
4714 self
4715 }
4716
4717 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4719 self.0.options = v.into();
4720 self
4721 }
4722
4723 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4725 (*self.0.stub)
4726 .list_operations(self.0.request, self.0.options)
4727 .await
4728 .map(gax::response::Response::into_body)
4729 }
4730
4731 pub fn by_page(
4733 self,
4734 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4735 {
4736 use std::clone::Clone;
4737 let token = self.0.request.page_token.clone();
4738 let execute = move |token: String| {
4739 let mut builder = self.clone();
4740 builder.0.request = builder.0.request.set_page_token(token);
4741 builder.send()
4742 };
4743 gax::paginator::internal::new_paginator(token, execute)
4744 }
4745
4746 pub fn by_item(
4748 self,
4749 ) -> impl gax::paginator::ItemPaginator<
4750 longrunning::model::ListOperationsResponse,
4751 gax::error::Error,
4752 > {
4753 use gax::paginator::Paginator;
4754 self.by_page().items()
4755 }
4756
4757 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4759 self.0.request.name = v.into();
4760 self
4761 }
4762
4763 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4765 self.0.request.filter = v.into();
4766 self
4767 }
4768
4769 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4771 self.0.request.page_size = v.into();
4772 self
4773 }
4774
4775 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4777 self.0.request.page_token = v.into();
4778 self
4779 }
4780 }
4781
4782 #[doc(hidden)]
4783 impl gax::options::internal::RequestBuilder for ListOperations {
4784 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4785 &mut self.0.options
4786 }
4787 }
4788
4789 #[derive(Clone, Debug)]
4807 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4808
4809 impl GetOperation {
4810 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4811 Self(RequestBuilder::new(stub))
4812 }
4813
4814 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4816 mut self,
4817 v: V,
4818 ) -> Self {
4819 self.0.request = v.into();
4820 self
4821 }
4822
4823 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4825 self.0.options = v.into();
4826 self
4827 }
4828
4829 pub async fn send(self) -> Result<longrunning::model::Operation> {
4831 (*self.0.stub)
4832 .get_operation(self.0.request, self.0.options)
4833 .await
4834 .map(gax::response::Response::into_body)
4835 }
4836
4837 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4839 self.0.request.name = v.into();
4840 self
4841 }
4842 }
4843
4844 #[doc(hidden)]
4845 impl gax::options::internal::RequestBuilder for GetOperation {
4846 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4847 &mut self.0.options
4848 }
4849 }
4850
4851 #[derive(Clone, Debug)]
4869 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4870
4871 impl DeleteOperation {
4872 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4873 Self(RequestBuilder::new(stub))
4874 }
4875
4876 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4878 mut self,
4879 v: V,
4880 ) -> Self {
4881 self.0.request = v.into();
4882 self
4883 }
4884
4885 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4887 self.0.options = v.into();
4888 self
4889 }
4890
4891 pub async fn send(self) -> Result<()> {
4893 (*self.0.stub)
4894 .delete_operation(self.0.request, self.0.options)
4895 .await
4896 .map(gax::response::Response::into_body)
4897 }
4898
4899 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4901 self.0.request.name = v.into();
4902 self
4903 }
4904 }
4905
4906 #[doc(hidden)]
4907 impl gax::options::internal::RequestBuilder for DeleteOperation {
4908 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4909 &mut self.0.options
4910 }
4911 }
4912
4913 #[derive(Clone, Debug)]
4931 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
4932
4933 impl WaitOperation {
4934 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tasks>) -> Self {
4935 Self(RequestBuilder::new(stub))
4936 }
4937
4938 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
4940 mut self,
4941 v: V,
4942 ) -> Self {
4943 self.0.request = v.into();
4944 self
4945 }
4946
4947 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4949 self.0.options = v.into();
4950 self
4951 }
4952
4953 pub async fn send(self) -> Result<longrunning::model::Operation> {
4955 (*self.0.stub)
4956 .wait_operation(self.0.request, self.0.options)
4957 .await
4958 .map(gax::response::Response::into_body)
4959 }
4960
4961 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4963 self.0.request.name = v.into();
4964 self
4965 }
4966
4967 pub fn set_timeout<T>(mut self, v: T) -> Self
4969 where
4970 T: std::convert::Into<wkt::Duration>,
4971 {
4972 self.0.request.timeout = std::option::Option::Some(v.into());
4973 self
4974 }
4975
4976 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4978 where
4979 T: std::convert::Into<wkt::Duration>,
4980 {
4981 self.0.request.timeout = v.map(|x| x.into());
4982 self
4983 }
4984 }
4985
4986 #[doc(hidden)]
4987 impl gax::options::internal::RequestBuilder for WaitOperation {
4988 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4989 &mut self.0.options
4990 }
4991 }
4992}
4993
4994pub mod worker_pools {
4995 use crate::Result;
4996
4997 pub type ClientBuilder =
5011 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5012
5013 pub(crate) mod client {
5014 use super::super::super::client::WorkerPools;
5015 pub struct Factory;
5016 impl gax::client_builder::internal::ClientFactory for Factory {
5017 type Client = WorkerPools;
5018 type Credentials = gaxi::options::Credentials;
5019 async fn build(
5020 self,
5021 config: gaxi::options::ClientConfig,
5022 ) -> gax::client_builder::Result<Self::Client> {
5023 Self::Client::new(config).await
5024 }
5025 }
5026 }
5027
5028 #[derive(Clone, Debug)]
5030 pub(crate) struct RequestBuilder<R: std::default::Default> {
5031 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5032 request: R,
5033 options: gax::options::RequestOptions,
5034 }
5035
5036 impl<R> RequestBuilder<R>
5037 where
5038 R: std::default::Default,
5039 {
5040 pub(crate) fn new(
5041 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5042 ) -> Self {
5043 Self {
5044 stub,
5045 request: R::default(),
5046 options: gax::options::RequestOptions::default(),
5047 }
5048 }
5049 }
5050
5051 #[derive(Clone, Debug)]
5070 pub struct CreateWorkerPool(RequestBuilder<crate::model::CreateWorkerPoolRequest>);
5071
5072 impl CreateWorkerPool {
5073 pub(crate) fn new(
5074 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5075 ) -> Self {
5076 Self(RequestBuilder::new(stub))
5077 }
5078
5079 pub fn with_request<V: Into<crate::model::CreateWorkerPoolRequest>>(
5081 mut self,
5082 v: V,
5083 ) -> Self {
5084 self.0.request = v.into();
5085 self
5086 }
5087
5088 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5090 self.0.options = v.into();
5091 self
5092 }
5093
5094 pub async fn send(self) -> Result<longrunning::model::Operation> {
5101 (*self.0.stub)
5102 .create_worker_pool(self.0.request, self.0.options)
5103 .await
5104 .map(gax::response::Response::into_body)
5105 }
5106
5107 pub fn poller(
5109 self,
5110 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::WorkerPool> {
5111 type Operation =
5112 lro::internal::Operation<crate::model::WorkerPool, crate::model::WorkerPool>;
5113 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5114 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5115
5116 let stub = self.0.stub.clone();
5117 let mut options = self.0.options.clone();
5118 options.set_retry_policy(gax::retry_policy::NeverRetry);
5119 let query = move |name| {
5120 let stub = stub.clone();
5121 let options = options.clone();
5122 async {
5123 let op = GetOperation::new(stub)
5124 .set_name(name)
5125 .with_options(options)
5126 .send()
5127 .await?;
5128 Ok(Operation::new(op))
5129 }
5130 };
5131
5132 let start = move || async {
5133 let op = self.send().await?;
5134 Ok(Operation::new(op))
5135 };
5136
5137 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5138 }
5139
5140 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5144 self.0.request.parent = v.into();
5145 self
5146 }
5147
5148 pub fn set_worker_pool<T>(mut self, v: T) -> Self
5152 where
5153 T: std::convert::Into<crate::model::WorkerPool>,
5154 {
5155 self.0.request.worker_pool = std::option::Option::Some(v.into());
5156 self
5157 }
5158
5159 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
5163 where
5164 T: std::convert::Into<crate::model::WorkerPool>,
5165 {
5166 self.0.request.worker_pool = v.map(|x| x.into());
5167 self
5168 }
5169
5170 pub fn set_worker_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5174 self.0.request.worker_pool_id = v.into();
5175 self
5176 }
5177
5178 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5180 self.0.request.validate_only = v.into();
5181 self
5182 }
5183 }
5184
5185 #[doc(hidden)]
5186 impl gax::options::internal::RequestBuilder for CreateWorkerPool {
5187 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5188 &mut self.0.options
5189 }
5190 }
5191
5192 #[derive(Clone, Debug)]
5210 pub struct GetWorkerPool(RequestBuilder<crate::model::GetWorkerPoolRequest>);
5211
5212 impl GetWorkerPool {
5213 pub(crate) fn new(
5214 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5215 ) -> Self {
5216 Self(RequestBuilder::new(stub))
5217 }
5218
5219 pub fn with_request<V: Into<crate::model::GetWorkerPoolRequest>>(mut self, v: V) -> Self {
5221 self.0.request = v.into();
5222 self
5223 }
5224
5225 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5227 self.0.options = v.into();
5228 self
5229 }
5230
5231 pub async fn send(self) -> Result<crate::model::WorkerPool> {
5233 (*self.0.stub)
5234 .get_worker_pool(self.0.request, self.0.options)
5235 .await
5236 .map(gax::response::Response::into_body)
5237 }
5238
5239 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5243 self.0.request.name = v.into();
5244 self
5245 }
5246 }
5247
5248 #[doc(hidden)]
5249 impl gax::options::internal::RequestBuilder for GetWorkerPool {
5250 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5251 &mut self.0.options
5252 }
5253 }
5254
5255 #[derive(Clone, Debug)]
5277 pub struct ListWorkerPools(RequestBuilder<crate::model::ListWorkerPoolsRequest>);
5278
5279 impl ListWorkerPools {
5280 pub(crate) fn new(
5281 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5282 ) -> Self {
5283 Self(RequestBuilder::new(stub))
5284 }
5285
5286 pub fn with_request<V: Into<crate::model::ListWorkerPoolsRequest>>(mut self, v: V) -> Self {
5288 self.0.request = v.into();
5289 self
5290 }
5291
5292 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5294 self.0.options = v.into();
5295 self
5296 }
5297
5298 pub async fn send(self) -> Result<crate::model::ListWorkerPoolsResponse> {
5300 (*self.0.stub)
5301 .list_worker_pools(self.0.request, self.0.options)
5302 .await
5303 .map(gax::response::Response::into_body)
5304 }
5305
5306 pub fn by_page(
5308 self,
5309 ) -> impl gax::paginator::Paginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
5310 {
5311 use std::clone::Clone;
5312 let token = self.0.request.page_token.clone();
5313 let execute = move |token: String| {
5314 let mut builder = self.clone();
5315 builder.0.request = builder.0.request.set_page_token(token);
5316 builder.send()
5317 };
5318 gax::paginator::internal::new_paginator(token, execute)
5319 }
5320
5321 pub fn by_item(
5323 self,
5324 ) -> impl gax::paginator::ItemPaginator<crate::model::ListWorkerPoolsResponse, gax::error::Error>
5325 {
5326 use gax::paginator::Paginator;
5327 self.by_page().items()
5328 }
5329
5330 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5334 self.0.request.parent = v.into();
5335 self
5336 }
5337
5338 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5340 self.0.request.page_size = v.into();
5341 self
5342 }
5343
5344 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5346 self.0.request.page_token = v.into();
5347 self
5348 }
5349
5350 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
5352 self.0.request.show_deleted = v.into();
5353 self
5354 }
5355 }
5356
5357 #[doc(hidden)]
5358 impl gax::options::internal::RequestBuilder for ListWorkerPools {
5359 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5360 &mut self.0.options
5361 }
5362 }
5363
5364 #[derive(Clone, Debug)]
5383 pub struct UpdateWorkerPool(RequestBuilder<crate::model::UpdateWorkerPoolRequest>);
5384
5385 impl UpdateWorkerPool {
5386 pub(crate) fn new(
5387 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5388 ) -> Self {
5389 Self(RequestBuilder::new(stub))
5390 }
5391
5392 pub fn with_request<V: Into<crate::model::UpdateWorkerPoolRequest>>(
5394 mut self,
5395 v: V,
5396 ) -> Self {
5397 self.0.request = v.into();
5398 self
5399 }
5400
5401 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5403 self.0.options = v.into();
5404 self
5405 }
5406
5407 pub async fn send(self) -> Result<longrunning::model::Operation> {
5414 (*self.0.stub)
5415 .update_worker_pool(self.0.request, self.0.options)
5416 .await
5417 .map(gax::response::Response::into_body)
5418 }
5419
5420 pub fn poller(
5422 self,
5423 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::WorkerPool> {
5424 type Operation =
5425 lro::internal::Operation<crate::model::WorkerPool, crate::model::WorkerPool>;
5426 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5427 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5428
5429 let stub = self.0.stub.clone();
5430 let mut options = self.0.options.clone();
5431 options.set_retry_policy(gax::retry_policy::NeverRetry);
5432 let query = move |name| {
5433 let stub = stub.clone();
5434 let options = options.clone();
5435 async {
5436 let op = GetOperation::new(stub)
5437 .set_name(name)
5438 .with_options(options)
5439 .send()
5440 .await?;
5441 Ok(Operation::new(op))
5442 }
5443 };
5444
5445 let start = move || async {
5446 let op = self.send().await?;
5447 Ok(Operation::new(op))
5448 };
5449
5450 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5451 }
5452
5453 pub fn set_update_mask<T>(mut self, v: T) -> Self
5455 where
5456 T: std::convert::Into<wkt::FieldMask>,
5457 {
5458 self.0.request.update_mask = std::option::Option::Some(v.into());
5459 self
5460 }
5461
5462 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5464 where
5465 T: std::convert::Into<wkt::FieldMask>,
5466 {
5467 self.0.request.update_mask = v.map(|x| x.into());
5468 self
5469 }
5470
5471 pub fn set_worker_pool<T>(mut self, v: T) -> Self
5475 where
5476 T: std::convert::Into<crate::model::WorkerPool>,
5477 {
5478 self.0.request.worker_pool = std::option::Option::Some(v.into());
5479 self
5480 }
5481
5482 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
5486 where
5487 T: std::convert::Into<crate::model::WorkerPool>,
5488 {
5489 self.0.request.worker_pool = v.map(|x| x.into());
5490 self
5491 }
5492
5493 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5495 self.0.request.validate_only = v.into();
5496 self
5497 }
5498
5499 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5501 self.0.request.allow_missing = v.into();
5502 self
5503 }
5504
5505 pub fn set_force_new_revision<T: Into<bool>>(mut self, v: T) -> Self {
5507 self.0.request.force_new_revision = v.into();
5508 self
5509 }
5510 }
5511
5512 #[doc(hidden)]
5513 impl gax::options::internal::RequestBuilder for UpdateWorkerPool {
5514 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5515 &mut self.0.options
5516 }
5517 }
5518
5519 #[derive(Clone, Debug)]
5538 pub struct DeleteWorkerPool(RequestBuilder<crate::model::DeleteWorkerPoolRequest>);
5539
5540 impl DeleteWorkerPool {
5541 pub(crate) fn new(
5542 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5543 ) -> Self {
5544 Self(RequestBuilder::new(stub))
5545 }
5546
5547 pub fn with_request<V: Into<crate::model::DeleteWorkerPoolRequest>>(
5549 mut self,
5550 v: V,
5551 ) -> Self {
5552 self.0.request = v.into();
5553 self
5554 }
5555
5556 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5558 self.0.options = v.into();
5559 self
5560 }
5561
5562 pub async fn send(self) -> Result<longrunning::model::Operation> {
5569 (*self.0.stub)
5570 .delete_worker_pool(self.0.request, self.0.options)
5571 .await
5572 .map(gax::response::Response::into_body)
5573 }
5574
5575 pub fn poller(
5577 self,
5578 ) -> impl lro::Poller<crate::model::WorkerPool, crate::model::WorkerPool> {
5579 type Operation =
5580 lro::internal::Operation<crate::model::WorkerPool, crate::model::WorkerPool>;
5581 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5582 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5583
5584 let stub = self.0.stub.clone();
5585 let mut options = self.0.options.clone();
5586 options.set_retry_policy(gax::retry_policy::NeverRetry);
5587 let query = move |name| {
5588 let stub = stub.clone();
5589 let options = options.clone();
5590 async {
5591 let op = GetOperation::new(stub)
5592 .set_name(name)
5593 .with_options(options)
5594 .send()
5595 .await?;
5596 Ok(Operation::new(op))
5597 }
5598 };
5599
5600 let start = move || async {
5601 let op = self.send().await?;
5602 Ok(Operation::new(op))
5603 };
5604
5605 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5606 }
5607
5608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5612 self.0.request.name = v.into();
5613 self
5614 }
5615
5616 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5618 self.0.request.validate_only = v.into();
5619 self
5620 }
5621
5622 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
5624 self.0.request.etag = v.into();
5625 self
5626 }
5627 }
5628
5629 #[doc(hidden)]
5630 impl gax::options::internal::RequestBuilder for DeleteWorkerPool {
5631 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5632 &mut self.0.options
5633 }
5634 }
5635
5636 #[derive(Clone, Debug)]
5654 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5655
5656 impl GetIamPolicy {
5657 pub(crate) fn new(
5658 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5659 ) -> Self {
5660 Self(RequestBuilder::new(stub))
5661 }
5662
5663 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5665 self.0.request = v.into();
5666 self
5667 }
5668
5669 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5671 self.0.options = v.into();
5672 self
5673 }
5674
5675 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5677 (*self.0.stub)
5678 .get_iam_policy(self.0.request, self.0.options)
5679 .await
5680 .map(gax::response::Response::into_body)
5681 }
5682
5683 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5687 self.0.request.resource = v.into();
5688 self
5689 }
5690
5691 pub fn set_options<T>(mut self, v: T) -> Self
5693 where
5694 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5695 {
5696 self.0.request.options = std::option::Option::Some(v.into());
5697 self
5698 }
5699
5700 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5702 where
5703 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5704 {
5705 self.0.request.options = v.map(|x| x.into());
5706 self
5707 }
5708 }
5709
5710 #[doc(hidden)]
5711 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5712 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5713 &mut self.0.options
5714 }
5715 }
5716
5717 #[derive(Clone, Debug)]
5735 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5736
5737 impl SetIamPolicy {
5738 pub(crate) fn new(
5739 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5740 ) -> Self {
5741 Self(RequestBuilder::new(stub))
5742 }
5743
5744 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5746 self.0.request = v.into();
5747 self
5748 }
5749
5750 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5752 self.0.options = v.into();
5753 self
5754 }
5755
5756 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5758 (*self.0.stub)
5759 .set_iam_policy(self.0.request, self.0.options)
5760 .await
5761 .map(gax::response::Response::into_body)
5762 }
5763
5764 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5768 self.0.request.resource = v.into();
5769 self
5770 }
5771
5772 pub fn set_policy<T>(mut self, v: T) -> Self
5776 where
5777 T: std::convert::Into<iam_v1::model::Policy>,
5778 {
5779 self.0.request.policy = std::option::Option::Some(v.into());
5780 self
5781 }
5782
5783 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5787 where
5788 T: std::convert::Into<iam_v1::model::Policy>,
5789 {
5790 self.0.request.policy = v.map(|x| x.into());
5791 self
5792 }
5793
5794 pub fn set_update_mask<T>(mut self, v: T) -> Self
5796 where
5797 T: std::convert::Into<wkt::FieldMask>,
5798 {
5799 self.0.request.update_mask = std::option::Option::Some(v.into());
5800 self
5801 }
5802
5803 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5805 where
5806 T: std::convert::Into<wkt::FieldMask>,
5807 {
5808 self.0.request.update_mask = v.map(|x| x.into());
5809 self
5810 }
5811 }
5812
5813 #[doc(hidden)]
5814 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5815 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5816 &mut self.0.options
5817 }
5818 }
5819
5820 #[derive(Clone, Debug)]
5838 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5839
5840 impl TestIamPermissions {
5841 pub(crate) fn new(
5842 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5843 ) -> Self {
5844 Self(RequestBuilder::new(stub))
5845 }
5846
5847 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5849 mut self,
5850 v: V,
5851 ) -> Self {
5852 self.0.request = v.into();
5853 self
5854 }
5855
5856 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5858 self.0.options = v.into();
5859 self
5860 }
5861
5862 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5864 (*self.0.stub)
5865 .test_iam_permissions(self.0.request, self.0.options)
5866 .await
5867 .map(gax::response::Response::into_body)
5868 }
5869
5870 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5874 self.0.request.resource = v.into();
5875 self
5876 }
5877
5878 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5882 where
5883 T: std::iter::IntoIterator<Item = V>,
5884 V: std::convert::Into<std::string::String>,
5885 {
5886 use std::iter::Iterator;
5887 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5888 self
5889 }
5890 }
5891
5892 #[doc(hidden)]
5893 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5894 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5895 &mut self.0.options
5896 }
5897 }
5898
5899 #[derive(Clone, Debug)]
5921 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5922
5923 impl ListOperations {
5924 pub(crate) fn new(
5925 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
5926 ) -> Self {
5927 Self(RequestBuilder::new(stub))
5928 }
5929
5930 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5932 mut self,
5933 v: V,
5934 ) -> Self {
5935 self.0.request = v.into();
5936 self
5937 }
5938
5939 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5941 self.0.options = v.into();
5942 self
5943 }
5944
5945 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5947 (*self.0.stub)
5948 .list_operations(self.0.request, self.0.options)
5949 .await
5950 .map(gax::response::Response::into_body)
5951 }
5952
5953 pub fn by_page(
5955 self,
5956 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5957 {
5958 use std::clone::Clone;
5959 let token = self.0.request.page_token.clone();
5960 let execute = move |token: String| {
5961 let mut builder = self.clone();
5962 builder.0.request = builder.0.request.set_page_token(token);
5963 builder.send()
5964 };
5965 gax::paginator::internal::new_paginator(token, execute)
5966 }
5967
5968 pub fn by_item(
5970 self,
5971 ) -> impl gax::paginator::ItemPaginator<
5972 longrunning::model::ListOperationsResponse,
5973 gax::error::Error,
5974 > {
5975 use gax::paginator::Paginator;
5976 self.by_page().items()
5977 }
5978
5979 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5981 self.0.request.name = v.into();
5982 self
5983 }
5984
5985 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5987 self.0.request.filter = v.into();
5988 self
5989 }
5990
5991 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5993 self.0.request.page_size = v.into();
5994 self
5995 }
5996
5997 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5999 self.0.request.page_token = v.into();
6000 self
6001 }
6002 }
6003
6004 #[doc(hidden)]
6005 impl gax::options::internal::RequestBuilder for ListOperations {
6006 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6007 &mut self.0.options
6008 }
6009 }
6010
6011 #[derive(Clone, Debug)]
6029 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6030
6031 impl GetOperation {
6032 pub(crate) fn new(
6033 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
6034 ) -> Self {
6035 Self(RequestBuilder::new(stub))
6036 }
6037
6038 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6040 mut self,
6041 v: V,
6042 ) -> Self {
6043 self.0.request = v.into();
6044 self
6045 }
6046
6047 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6049 self.0.options = v.into();
6050 self
6051 }
6052
6053 pub async fn send(self) -> Result<longrunning::model::Operation> {
6055 (*self.0.stub)
6056 .get_operation(self.0.request, self.0.options)
6057 .await
6058 .map(gax::response::Response::into_body)
6059 }
6060
6061 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6063 self.0.request.name = v.into();
6064 self
6065 }
6066 }
6067
6068 #[doc(hidden)]
6069 impl gax::options::internal::RequestBuilder for GetOperation {
6070 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6071 &mut self.0.options
6072 }
6073 }
6074
6075 #[derive(Clone, Debug)]
6093 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6094
6095 impl DeleteOperation {
6096 pub(crate) fn new(
6097 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
6098 ) -> Self {
6099 Self(RequestBuilder::new(stub))
6100 }
6101
6102 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6104 mut self,
6105 v: V,
6106 ) -> Self {
6107 self.0.request = v.into();
6108 self
6109 }
6110
6111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6113 self.0.options = v.into();
6114 self
6115 }
6116
6117 pub async fn send(self) -> Result<()> {
6119 (*self.0.stub)
6120 .delete_operation(self.0.request, self.0.options)
6121 .await
6122 .map(gax::response::Response::into_body)
6123 }
6124
6125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6127 self.0.request.name = v.into();
6128 self
6129 }
6130 }
6131
6132 #[doc(hidden)]
6133 impl gax::options::internal::RequestBuilder for DeleteOperation {
6134 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6135 &mut self.0.options
6136 }
6137 }
6138
6139 #[derive(Clone, Debug)]
6157 pub struct WaitOperation(RequestBuilder<longrunning::model::WaitOperationRequest>);
6158
6159 impl WaitOperation {
6160 pub(crate) fn new(
6161 stub: std::sync::Arc<dyn super::super::stub::dynamic::WorkerPools>,
6162 ) -> Self {
6163 Self(RequestBuilder::new(stub))
6164 }
6165
6166 pub fn with_request<V: Into<longrunning::model::WaitOperationRequest>>(
6168 mut self,
6169 v: V,
6170 ) -> Self {
6171 self.0.request = v.into();
6172 self
6173 }
6174
6175 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6177 self.0.options = v.into();
6178 self
6179 }
6180
6181 pub async fn send(self) -> Result<longrunning::model::Operation> {
6183 (*self.0.stub)
6184 .wait_operation(self.0.request, self.0.options)
6185 .await
6186 .map(gax::response::Response::into_body)
6187 }
6188
6189 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6191 self.0.request.name = v.into();
6192 self
6193 }
6194
6195 pub fn set_timeout<T>(mut self, v: T) -> Self
6197 where
6198 T: std::convert::Into<wkt::Duration>,
6199 {
6200 self.0.request.timeout = std::option::Option::Some(v.into());
6201 self
6202 }
6203
6204 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
6206 where
6207 T: std::convert::Into<wkt::Duration>,
6208 {
6209 self.0.request.timeout = v.map(|x| x.into());
6210 self
6211 }
6212 }
6213
6214 #[doc(hidden)]
6215 impl gax::options::internal::RequestBuilder for WaitOperation {
6216 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6217 &mut self.0.options
6218 }
6219 }
6220}