1pub mod cross_network_automation_service {
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::CrossNetworkAutomationService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = CrossNetworkAutomationService;
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::CrossNetworkAutomationService>,
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(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListServiceConnectionMaps(
97 RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
98 );
99
100 impl ListServiceConnectionMaps {
101 pub(crate) fn new(
102 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
103 ) -> Self {
104 Self(RequestBuilder::new(stub))
105 }
106
107 pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
109 mut self,
110 v: V,
111 ) -> Self {
112 self.0.request = v.into();
113 self
114 }
115
116 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
118 self.0.options = v.into();
119 self
120 }
121
122 pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
124 (*self.0.stub)
125 .list_service_connection_maps(self.0.request, self.0.options)
126 .await
127 .map(gax::response::Response::into_body)
128 }
129
130 pub fn by_page(
132 self,
133 ) -> impl gax::paginator::Paginator<
134 crate::model::ListServiceConnectionMapsResponse,
135 gax::error::Error,
136 > {
137 use std::clone::Clone;
138 let token = self.0.request.page_token.clone();
139 let execute = move |token: String| {
140 let mut builder = self.clone();
141 builder.0.request = builder.0.request.set_page_token(token);
142 builder.send()
143 };
144 gax::paginator::internal::new_paginator(token, execute)
145 }
146
147 pub fn by_item(
149 self,
150 ) -> impl gax::paginator::ItemPaginator<
151 crate::model::ListServiceConnectionMapsResponse,
152 gax::error::Error,
153 > {
154 use gax::paginator::Paginator;
155 self.by_page().items()
156 }
157
158 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
162 self.0.request.parent = v.into();
163 self
164 }
165
166 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
168 self.0.request.page_size = v.into();
169 self
170 }
171
172 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
174 self.0.request.page_token = v.into();
175 self
176 }
177
178 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
180 self.0.request.filter = v.into();
181 self
182 }
183
184 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
186 self.0.request.order_by = v.into();
187 self
188 }
189 }
190
191 #[doc(hidden)]
192 impl gax::options::internal::RequestBuilder for ListServiceConnectionMaps {
193 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
194 &mut self.0.options
195 }
196 }
197
198 #[derive(Clone, Debug)]
216 pub struct GetServiceConnectionMap(
217 RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
218 );
219
220 impl GetServiceConnectionMap {
221 pub(crate) fn new(
222 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
223 ) -> Self {
224 Self(RequestBuilder::new(stub))
225 }
226
227 pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
229 mut self,
230 v: V,
231 ) -> Self {
232 self.0.request = v.into();
233 self
234 }
235
236 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
238 self.0.options = v.into();
239 self
240 }
241
242 pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
244 (*self.0.stub)
245 .get_service_connection_map(self.0.request, self.0.options)
246 .await
247 .map(gax::response::Response::into_body)
248 }
249
250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
254 self.0.request.name = v.into();
255 self
256 }
257 }
258
259 #[doc(hidden)]
260 impl gax::options::internal::RequestBuilder for GetServiceConnectionMap {
261 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
262 &mut self.0.options
263 }
264 }
265
266 #[derive(Clone, Debug)]
285 pub struct CreateServiceConnectionMap(
286 RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
287 );
288
289 impl CreateServiceConnectionMap {
290 pub(crate) fn new(
291 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
292 ) -> Self {
293 Self(RequestBuilder::new(stub))
294 }
295
296 pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
298 mut self,
299 v: V,
300 ) -> Self {
301 self.0.request = v.into();
302 self
303 }
304
305 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
307 self.0.options = v.into();
308 self
309 }
310
311 pub async fn send(self) -> Result<longrunning::model::Operation> {
318 (*self.0.stub)
319 .create_service_connection_map(self.0.request, self.0.options)
320 .await
321 .map(gax::response::Response::into_body)
322 }
323
324 pub fn poller(
326 self,
327 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
328 {
329 type Operation = lro::internal::Operation<
330 crate::model::ServiceConnectionMap,
331 crate::model::OperationMetadata,
332 >;
333 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
334 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
335
336 let stub = self.0.stub.clone();
337 let mut options = self.0.options.clone();
338 options.set_retry_policy(gax::retry_policy::NeverRetry);
339 let query = move |name| {
340 let stub = stub.clone();
341 let options = options.clone();
342 async {
343 let op = GetOperation::new(stub)
344 .set_name(name)
345 .with_options(options)
346 .send()
347 .await?;
348 Ok(Operation::new(op))
349 }
350 };
351
352 let start = move || async {
353 let op = self.send().await?;
354 Ok(Operation::new(op))
355 };
356
357 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
358 }
359
360 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
364 self.0.request.parent = v.into();
365 self
366 }
367
368 pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
370 self.0.request.service_connection_map_id = v.into();
371 self
372 }
373
374 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
378 where
379 T: std::convert::Into<crate::model::ServiceConnectionMap>,
380 {
381 self.0.request.service_connection_map = std::option::Option::Some(v.into());
382 self
383 }
384
385 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
389 where
390 T: std::convert::Into<crate::model::ServiceConnectionMap>,
391 {
392 self.0.request.service_connection_map = v.map(|x| x.into());
393 self
394 }
395
396 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
398 self.0.request.request_id = v.into();
399 self
400 }
401 }
402
403 #[doc(hidden)]
404 impl gax::options::internal::RequestBuilder for CreateServiceConnectionMap {
405 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
406 &mut self.0.options
407 }
408 }
409
410 #[derive(Clone, Debug)]
429 pub struct UpdateServiceConnectionMap(
430 RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
431 );
432
433 impl UpdateServiceConnectionMap {
434 pub(crate) fn new(
435 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
436 ) -> Self {
437 Self(RequestBuilder::new(stub))
438 }
439
440 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
442 mut self,
443 v: V,
444 ) -> Self {
445 self.0.request = v.into();
446 self
447 }
448
449 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
451 self.0.options = v.into();
452 self
453 }
454
455 pub async fn send(self) -> Result<longrunning::model::Operation> {
462 (*self.0.stub)
463 .update_service_connection_map(self.0.request, self.0.options)
464 .await
465 .map(gax::response::Response::into_body)
466 }
467
468 pub fn poller(
470 self,
471 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
472 {
473 type Operation = lro::internal::Operation<
474 crate::model::ServiceConnectionMap,
475 crate::model::OperationMetadata,
476 >;
477 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
478 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
479
480 let stub = self.0.stub.clone();
481 let mut options = self.0.options.clone();
482 options.set_retry_policy(gax::retry_policy::NeverRetry);
483 let query = move |name| {
484 let stub = stub.clone();
485 let options = options.clone();
486 async {
487 let op = GetOperation::new(stub)
488 .set_name(name)
489 .with_options(options)
490 .send()
491 .await?;
492 Ok(Operation::new(op))
493 }
494 };
495
496 let start = move || async {
497 let op = self.send().await?;
498 Ok(Operation::new(op))
499 };
500
501 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
502 }
503
504 pub fn set_update_mask<T>(mut self, v: T) -> Self
506 where
507 T: std::convert::Into<wkt::FieldMask>,
508 {
509 self.0.request.update_mask = std::option::Option::Some(v.into());
510 self
511 }
512
513 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
515 where
516 T: std::convert::Into<wkt::FieldMask>,
517 {
518 self.0.request.update_mask = v.map(|x| x.into());
519 self
520 }
521
522 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
526 where
527 T: std::convert::Into<crate::model::ServiceConnectionMap>,
528 {
529 self.0.request.service_connection_map = std::option::Option::Some(v.into());
530 self
531 }
532
533 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
537 where
538 T: std::convert::Into<crate::model::ServiceConnectionMap>,
539 {
540 self.0.request.service_connection_map = v.map(|x| x.into());
541 self
542 }
543
544 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
546 self.0.request.request_id = v.into();
547 self
548 }
549 }
550
551 #[doc(hidden)]
552 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionMap {
553 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
554 &mut self.0.options
555 }
556 }
557
558 #[derive(Clone, Debug)]
577 pub struct DeleteServiceConnectionMap(
578 RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
579 );
580
581 impl DeleteServiceConnectionMap {
582 pub(crate) fn new(
583 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
584 ) -> Self {
585 Self(RequestBuilder::new(stub))
586 }
587
588 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
590 mut self,
591 v: V,
592 ) -> Self {
593 self.0.request = v.into();
594 self
595 }
596
597 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
599 self.0.options = v.into();
600 self
601 }
602
603 pub async fn send(self) -> Result<longrunning::model::Operation> {
610 (*self.0.stub)
611 .delete_service_connection_map(self.0.request, self.0.options)
612 .await
613 .map(gax::response::Response::into_body)
614 }
615
616 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
618 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
619 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
620 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
621
622 let stub = self.0.stub.clone();
623 let mut options = self.0.options.clone();
624 options.set_retry_policy(gax::retry_policy::NeverRetry);
625 let query = move |name| {
626 let stub = stub.clone();
627 let options = options.clone();
628 async {
629 let op = GetOperation::new(stub)
630 .set_name(name)
631 .with_options(options)
632 .send()
633 .await?;
634 Ok(Operation::new(op))
635 }
636 };
637
638 let start = move || async {
639 let op = self.send().await?;
640 Ok(Operation::new(op))
641 };
642
643 lro::internal::new_unit_response_poller(
644 polling_error_policy,
645 polling_backoff_policy,
646 start,
647 query,
648 )
649 }
650
651 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
655 self.0.request.name = v.into();
656 self
657 }
658
659 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
661 self.0.request.request_id = v.into();
662 self
663 }
664
665 pub fn set_etag<T>(mut self, v: T) -> Self
667 where
668 T: std::convert::Into<std::string::String>,
669 {
670 self.0.request.etag = std::option::Option::Some(v.into());
671 self
672 }
673
674 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
676 where
677 T: std::convert::Into<std::string::String>,
678 {
679 self.0.request.etag = v.map(|x| x.into());
680 self
681 }
682 }
683
684 #[doc(hidden)]
685 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionMap {
686 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
687 &mut self.0.options
688 }
689 }
690
691 #[derive(Clone, Debug)]
713 pub struct ListServiceConnectionPolicies(
714 RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
715 );
716
717 impl ListServiceConnectionPolicies {
718 pub(crate) fn new(
719 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
720 ) -> Self {
721 Self(RequestBuilder::new(stub))
722 }
723
724 pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
726 mut self,
727 v: V,
728 ) -> Self {
729 self.0.request = v.into();
730 self
731 }
732
733 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
735 self.0.options = v.into();
736 self
737 }
738
739 pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
741 (*self.0.stub)
742 .list_service_connection_policies(self.0.request, self.0.options)
743 .await
744 .map(gax::response::Response::into_body)
745 }
746
747 pub fn by_page(
749 self,
750 ) -> impl gax::paginator::Paginator<
751 crate::model::ListServiceConnectionPoliciesResponse,
752 gax::error::Error,
753 > {
754 use std::clone::Clone;
755 let token = self.0.request.page_token.clone();
756 let execute = move |token: String| {
757 let mut builder = self.clone();
758 builder.0.request = builder.0.request.set_page_token(token);
759 builder.send()
760 };
761 gax::paginator::internal::new_paginator(token, execute)
762 }
763
764 pub fn by_item(
766 self,
767 ) -> impl gax::paginator::ItemPaginator<
768 crate::model::ListServiceConnectionPoliciesResponse,
769 gax::error::Error,
770 > {
771 use gax::paginator::Paginator;
772 self.by_page().items()
773 }
774
775 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
779 self.0.request.parent = v.into();
780 self
781 }
782
783 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
785 self.0.request.page_size = v.into();
786 self
787 }
788
789 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
791 self.0.request.page_token = v.into();
792 self
793 }
794
795 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
797 self.0.request.filter = v.into();
798 self
799 }
800
801 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
803 self.0.request.order_by = v.into();
804 self
805 }
806 }
807
808 #[doc(hidden)]
809 impl gax::options::internal::RequestBuilder for ListServiceConnectionPolicies {
810 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
811 &mut self.0.options
812 }
813 }
814
815 #[derive(Clone, Debug)]
833 pub struct GetServiceConnectionPolicy(
834 RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
835 );
836
837 impl GetServiceConnectionPolicy {
838 pub(crate) fn new(
839 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
840 ) -> Self {
841 Self(RequestBuilder::new(stub))
842 }
843
844 pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
846 mut self,
847 v: V,
848 ) -> Self {
849 self.0.request = v.into();
850 self
851 }
852
853 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
855 self.0.options = v.into();
856 self
857 }
858
859 pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
861 (*self.0.stub)
862 .get_service_connection_policy(self.0.request, self.0.options)
863 .await
864 .map(gax::response::Response::into_body)
865 }
866
867 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
871 self.0.request.name = v.into();
872 self
873 }
874 }
875
876 #[doc(hidden)]
877 impl gax::options::internal::RequestBuilder for GetServiceConnectionPolicy {
878 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
879 &mut self.0.options
880 }
881 }
882
883 #[derive(Clone, Debug)]
902 pub struct CreateServiceConnectionPolicy(
903 RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
904 );
905
906 impl CreateServiceConnectionPolicy {
907 pub(crate) fn new(
908 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
909 ) -> Self {
910 Self(RequestBuilder::new(stub))
911 }
912
913 pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
915 mut self,
916 v: V,
917 ) -> Self {
918 self.0.request = v.into();
919 self
920 }
921
922 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
924 self.0.options = v.into();
925 self
926 }
927
928 pub async fn send(self) -> Result<longrunning::model::Operation> {
935 (*self.0.stub)
936 .create_service_connection_policy(self.0.request, self.0.options)
937 .await
938 .map(gax::response::Response::into_body)
939 }
940
941 pub fn poller(
943 self,
944 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
945 {
946 type Operation = lro::internal::Operation<
947 crate::model::ServiceConnectionPolicy,
948 crate::model::OperationMetadata,
949 >;
950 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
951 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
952
953 let stub = self.0.stub.clone();
954 let mut options = self.0.options.clone();
955 options.set_retry_policy(gax::retry_policy::NeverRetry);
956 let query = move |name| {
957 let stub = stub.clone();
958 let options = options.clone();
959 async {
960 let op = GetOperation::new(stub)
961 .set_name(name)
962 .with_options(options)
963 .send()
964 .await?;
965 Ok(Operation::new(op))
966 }
967 };
968
969 let start = move || async {
970 let op = self.send().await?;
971 Ok(Operation::new(op))
972 };
973
974 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
975 }
976
977 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
981 self.0.request.parent = v.into();
982 self
983 }
984
985 pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
987 mut self,
988 v: T,
989 ) -> Self {
990 self.0.request.service_connection_policy_id = v.into();
991 self
992 }
993
994 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
998 where
999 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1000 {
1001 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1002 self
1003 }
1004
1005 pub fn set_or_clear_service_connection_policy<T>(
1009 mut self,
1010 v: std::option::Option<T>,
1011 ) -> Self
1012 where
1013 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1014 {
1015 self.0.request.service_connection_policy = v.map(|x| x.into());
1016 self
1017 }
1018
1019 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1021 self.0.request.request_id = v.into();
1022 self
1023 }
1024 }
1025
1026 #[doc(hidden)]
1027 impl gax::options::internal::RequestBuilder for CreateServiceConnectionPolicy {
1028 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1029 &mut self.0.options
1030 }
1031 }
1032
1033 #[derive(Clone, Debug)]
1052 pub struct UpdateServiceConnectionPolicy(
1053 RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1054 );
1055
1056 impl UpdateServiceConnectionPolicy {
1057 pub(crate) fn new(
1058 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1059 ) -> Self {
1060 Self(RequestBuilder::new(stub))
1061 }
1062
1063 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1065 mut self,
1066 v: V,
1067 ) -> Self {
1068 self.0.request = v.into();
1069 self
1070 }
1071
1072 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1074 self.0.options = v.into();
1075 self
1076 }
1077
1078 pub async fn send(self) -> Result<longrunning::model::Operation> {
1085 (*self.0.stub)
1086 .update_service_connection_policy(self.0.request, self.0.options)
1087 .await
1088 .map(gax::response::Response::into_body)
1089 }
1090
1091 pub fn poller(
1093 self,
1094 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
1095 {
1096 type Operation = lro::internal::Operation<
1097 crate::model::ServiceConnectionPolicy,
1098 crate::model::OperationMetadata,
1099 >;
1100 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1101 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1102
1103 let stub = self.0.stub.clone();
1104 let mut options = self.0.options.clone();
1105 options.set_retry_policy(gax::retry_policy::NeverRetry);
1106 let query = move |name| {
1107 let stub = stub.clone();
1108 let options = options.clone();
1109 async {
1110 let op = GetOperation::new(stub)
1111 .set_name(name)
1112 .with_options(options)
1113 .send()
1114 .await?;
1115 Ok(Operation::new(op))
1116 }
1117 };
1118
1119 let start = move || async {
1120 let op = self.send().await?;
1121 Ok(Operation::new(op))
1122 };
1123
1124 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1125 }
1126
1127 pub fn set_update_mask<T>(mut self, v: T) -> Self
1129 where
1130 T: std::convert::Into<wkt::FieldMask>,
1131 {
1132 self.0.request.update_mask = std::option::Option::Some(v.into());
1133 self
1134 }
1135
1136 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1138 where
1139 T: std::convert::Into<wkt::FieldMask>,
1140 {
1141 self.0.request.update_mask = v.map(|x| x.into());
1142 self
1143 }
1144
1145 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1149 where
1150 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1151 {
1152 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1153 self
1154 }
1155
1156 pub fn set_or_clear_service_connection_policy<T>(
1160 mut self,
1161 v: std::option::Option<T>,
1162 ) -> Self
1163 where
1164 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1165 {
1166 self.0.request.service_connection_policy = v.map(|x| x.into());
1167 self
1168 }
1169
1170 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1172 self.0.request.request_id = v.into();
1173 self
1174 }
1175 }
1176
1177 #[doc(hidden)]
1178 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionPolicy {
1179 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1180 &mut self.0.options
1181 }
1182 }
1183
1184 #[derive(Clone, Debug)]
1203 pub struct DeleteServiceConnectionPolicy(
1204 RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1205 );
1206
1207 impl DeleteServiceConnectionPolicy {
1208 pub(crate) fn new(
1209 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1210 ) -> Self {
1211 Self(RequestBuilder::new(stub))
1212 }
1213
1214 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1216 mut self,
1217 v: V,
1218 ) -> Self {
1219 self.0.request = v.into();
1220 self
1221 }
1222
1223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1225 self.0.options = v.into();
1226 self
1227 }
1228
1229 pub async fn send(self) -> Result<longrunning::model::Operation> {
1236 (*self.0.stub)
1237 .delete_service_connection_policy(self.0.request, self.0.options)
1238 .await
1239 .map(gax::response::Response::into_body)
1240 }
1241
1242 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1244 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1245 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1246 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1247
1248 let stub = self.0.stub.clone();
1249 let mut options = self.0.options.clone();
1250 options.set_retry_policy(gax::retry_policy::NeverRetry);
1251 let query = move |name| {
1252 let stub = stub.clone();
1253 let options = options.clone();
1254 async {
1255 let op = GetOperation::new(stub)
1256 .set_name(name)
1257 .with_options(options)
1258 .send()
1259 .await?;
1260 Ok(Operation::new(op))
1261 }
1262 };
1263
1264 let start = move || async {
1265 let op = self.send().await?;
1266 Ok(Operation::new(op))
1267 };
1268
1269 lro::internal::new_unit_response_poller(
1270 polling_error_policy,
1271 polling_backoff_policy,
1272 start,
1273 query,
1274 )
1275 }
1276
1277 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281 self.0.request.name = v.into();
1282 self
1283 }
1284
1285 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1287 self.0.request.request_id = v.into();
1288 self
1289 }
1290
1291 pub fn set_etag<T>(mut self, v: T) -> Self
1293 where
1294 T: std::convert::Into<std::string::String>,
1295 {
1296 self.0.request.etag = std::option::Option::Some(v.into());
1297 self
1298 }
1299
1300 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1302 where
1303 T: std::convert::Into<std::string::String>,
1304 {
1305 self.0.request.etag = v.map(|x| x.into());
1306 self
1307 }
1308 }
1309
1310 #[doc(hidden)]
1311 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionPolicy {
1312 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1313 &mut self.0.options
1314 }
1315 }
1316
1317 #[derive(Clone, Debug)]
1339 pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1340
1341 impl ListServiceClasses {
1342 pub(crate) fn new(
1343 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1344 ) -> Self {
1345 Self(RequestBuilder::new(stub))
1346 }
1347
1348 pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1350 mut self,
1351 v: V,
1352 ) -> Self {
1353 self.0.request = v.into();
1354 self
1355 }
1356
1357 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1359 self.0.options = v.into();
1360 self
1361 }
1362
1363 pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1365 (*self.0.stub)
1366 .list_service_classes(self.0.request, self.0.options)
1367 .await
1368 .map(gax::response::Response::into_body)
1369 }
1370
1371 pub fn by_page(
1373 self,
1374 ) -> impl gax::paginator::Paginator<crate::model::ListServiceClassesResponse, gax::error::Error>
1375 {
1376 use std::clone::Clone;
1377 let token = self.0.request.page_token.clone();
1378 let execute = move |token: String| {
1379 let mut builder = self.clone();
1380 builder.0.request = builder.0.request.set_page_token(token);
1381 builder.send()
1382 };
1383 gax::paginator::internal::new_paginator(token, execute)
1384 }
1385
1386 pub fn by_item(
1388 self,
1389 ) -> impl gax::paginator::ItemPaginator<
1390 crate::model::ListServiceClassesResponse,
1391 gax::error::Error,
1392 > {
1393 use gax::paginator::Paginator;
1394 self.by_page().items()
1395 }
1396
1397 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1401 self.0.request.parent = v.into();
1402 self
1403 }
1404
1405 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1407 self.0.request.page_size = v.into();
1408 self
1409 }
1410
1411 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1413 self.0.request.page_token = v.into();
1414 self
1415 }
1416
1417 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1419 self.0.request.filter = v.into();
1420 self
1421 }
1422
1423 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1425 self.0.request.order_by = v.into();
1426 self
1427 }
1428 }
1429
1430 #[doc(hidden)]
1431 impl gax::options::internal::RequestBuilder for ListServiceClasses {
1432 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1433 &mut self.0.options
1434 }
1435 }
1436
1437 #[derive(Clone, Debug)]
1455 pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1456
1457 impl GetServiceClass {
1458 pub(crate) fn new(
1459 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1460 ) -> Self {
1461 Self(RequestBuilder::new(stub))
1462 }
1463
1464 pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1466 self.0.request = v.into();
1467 self
1468 }
1469
1470 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1472 self.0.options = v.into();
1473 self
1474 }
1475
1476 pub async fn send(self) -> Result<crate::model::ServiceClass> {
1478 (*self.0.stub)
1479 .get_service_class(self.0.request, self.0.options)
1480 .await
1481 .map(gax::response::Response::into_body)
1482 }
1483
1484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488 self.0.request.name = v.into();
1489 self
1490 }
1491 }
1492
1493 #[doc(hidden)]
1494 impl gax::options::internal::RequestBuilder for GetServiceClass {
1495 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1496 &mut self.0.options
1497 }
1498 }
1499
1500 #[derive(Clone, Debug)]
1519 pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1520
1521 impl UpdateServiceClass {
1522 pub(crate) fn new(
1523 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1524 ) -> Self {
1525 Self(RequestBuilder::new(stub))
1526 }
1527
1528 pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1530 mut self,
1531 v: V,
1532 ) -> Self {
1533 self.0.request = v.into();
1534 self
1535 }
1536
1537 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1539 self.0.options = v.into();
1540 self
1541 }
1542
1543 pub async fn send(self) -> Result<longrunning::model::Operation> {
1550 (*self.0.stub)
1551 .update_service_class(self.0.request, self.0.options)
1552 .await
1553 .map(gax::response::Response::into_body)
1554 }
1555
1556 pub fn poller(
1558 self,
1559 ) -> impl lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata> {
1560 type Operation = lro::internal::Operation<
1561 crate::model::ServiceClass,
1562 crate::model::OperationMetadata,
1563 >;
1564 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1565 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1566
1567 let stub = self.0.stub.clone();
1568 let mut options = self.0.options.clone();
1569 options.set_retry_policy(gax::retry_policy::NeverRetry);
1570 let query = move |name| {
1571 let stub = stub.clone();
1572 let options = options.clone();
1573 async {
1574 let op = GetOperation::new(stub)
1575 .set_name(name)
1576 .with_options(options)
1577 .send()
1578 .await?;
1579 Ok(Operation::new(op))
1580 }
1581 };
1582
1583 let start = move || async {
1584 let op = self.send().await?;
1585 Ok(Operation::new(op))
1586 };
1587
1588 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1589 }
1590
1591 pub fn set_update_mask<T>(mut self, v: T) -> Self
1593 where
1594 T: std::convert::Into<wkt::FieldMask>,
1595 {
1596 self.0.request.update_mask = std::option::Option::Some(v.into());
1597 self
1598 }
1599
1600 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1602 where
1603 T: std::convert::Into<wkt::FieldMask>,
1604 {
1605 self.0.request.update_mask = v.map(|x| x.into());
1606 self
1607 }
1608
1609 pub fn set_service_class<T>(mut self, v: T) -> Self
1613 where
1614 T: std::convert::Into<crate::model::ServiceClass>,
1615 {
1616 self.0.request.service_class = std::option::Option::Some(v.into());
1617 self
1618 }
1619
1620 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1624 where
1625 T: std::convert::Into<crate::model::ServiceClass>,
1626 {
1627 self.0.request.service_class = v.map(|x| x.into());
1628 self
1629 }
1630
1631 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1633 self.0.request.request_id = v.into();
1634 self
1635 }
1636 }
1637
1638 #[doc(hidden)]
1639 impl gax::options::internal::RequestBuilder for UpdateServiceClass {
1640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1641 &mut self.0.options
1642 }
1643 }
1644
1645 #[derive(Clone, Debug)]
1664 pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1665
1666 impl DeleteServiceClass {
1667 pub(crate) fn new(
1668 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1669 ) -> Self {
1670 Self(RequestBuilder::new(stub))
1671 }
1672
1673 pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1675 mut self,
1676 v: V,
1677 ) -> Self {
1678 self.0.request = v.into();
1679 self
1680 }
1681
1682 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1684 self.0.options = v.into();
1685 self
1686 }
1687
1688 pub async fn send(self) -> Result<longrunning::model::Operation> {
1695 (*self.0.stub)
1696 .delete_service_class(self.0.request, self.0.options)
1697 .await
1698 .map(gax::response::Response::into_body)
1699 }
1700
1701 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1703 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1704 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1705 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1706
1707 let stub = self.0.stub.clone();
1708 let mut options = self.0.options.clone();
1709 options.set_retry_policy(gax::retry_policy::NeverRetry);
1710 let query = move |name| {
1711 let stub = stub.clone();
1712 let options = options.clone();
1713 async {
1714 let op = GetOperation::new(stub)
1715 .set_name(name)
1716 .with_options(options)
1717 .send()
1718 .await?;
1719 Ok(Operation::new(op))
1720 }
1721 };
1722
1723 let start = move || async {
1724 let op = self.send().await?;
1725 Ok(Operation::new(op))
1726 };
1727
1728 lro::internal::new_unit_response_poller(
1729 polling_error_policy,
1730 polling_backoff_policy,
1731 start,
1732 query,
1733 )
1734 }
1735
1736 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740 self.0.request.name = v.into();
1741 self
1742 }
1743
1744 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746 self.0.request.request_id = v.into();
1747 self
1748 }
1749
1750 pub fn set_etag<T>(mut self, v: T) -> Self
1752 where
1753 T: std::convert::Into<std::string::String>,
1754 {
1755 self.0.request.etag = std::option::Option::Some(v.into());
1756 self
1757 }
1758
1759 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1761 where
1762 T: std::convert::Into<std::string::String>,
1763 {
1764 self.0.request.etag = v.map(|x| x.into());
1765 self
1766 }
1767 }
1768
1769 #[doc(hidden)]
1770 impl gax::options::internal::RequestBuilder for DeleteServiceClass {
1771 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1772 &mut self.0.options
1773 }
1774 }
1775
1776 #[derive(Clone, Debug)]
1794 pub struct GetServiceConnectionToken(
1795 RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1796 );
1797
1798 impl GetServiceConnectionToken {
1799 pub(crate) fn new(
1800 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1801 ) -> Self {
1802 Self(RequestBuilder::new(stub))
1803 }
1804
1805 pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1807 mut self,
1808 v: V,
1809 ) -> Self {
1810 self.0.request = v.into();
1811 self
1812 }
1813
1814 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1816 self.0.options = v.into();
1817 self
1818 }
1819
1820 pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1822 (*self.0.stub)
1823 .get_service_connection_token(self.0.request, self.0.options)
1824 .await
1825 .map(gax::response::Response::into_body)
1826 }
1827
1828 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1832 self.0.request.name = v.into();
1833 self
1834 }
1835 }
1836
1837 #[doc(hidden)]
1838 impl gax::options::internal::RequestBuilder for GetServiceConnectionToken {
1839 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1840 &mut self.0.options
1841 }
1842 }
1843
1844 #[derive(Clone, Debug)]
1866 pub struct ListServiceConnectionTokens(
1867 RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1868 );
1869
1870 impl ListServiceConnectionTokens {
1871 pub(crate) fn new(
1872 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1873 ) -> Self {
1874 Self(RequestBuilder::new(stub))
1875 }
1876
1877 pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1879 mut self,
1880 v: V,
1881 ) -> Self {
1882 self.0.request = v.into();
1883 self
1884 }
1885
1886 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1888 self.0.options = v.into();
1889 self
1890 }
1891
1892 pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1894 (*self.0.stub)
1895 .list_service_connection_tokens(self.0.request, self.0.options)
1896 .await
1897 .map(gax::response::Response::into_body)
1898 }
1899
1900 pub fn by_page(
1902 self,
1903 ) -> impl gax::paginator::Paginator<
1904 crate::model::ListServiceConnectionTokensResponse,
1905 gax::error::Error,
1906 > {
1907 use std::clone::Clone;
1908 let token = self.0.request.page_token.clone();
1909 let execute = move |token: String| {
1910 let mut builder = self.clone();
1911 builder.0.request = builder.0.request.set_page_token(token);
1912 builder.send()
1913 };
1914 gax::paginator::internal::new_paginator(token, execute)
1915 }
1916
1917 pub fn by_item(
1919 self,
1920 ) -> impl gax::paginator::ItemPaginator<
1921 crate::model::ListServiceConnectionTokensResponse,
1922 gax::error::Error,
1923 > {
1924 use gax::paginator::Paginator;
1925 self.by_page().items()
1926 }
1927
1928 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1932 self.0.request.parent = v.into();
1933 self
1934 }
1935
1936 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1938 self.0.request.page_size = v.into();
1939 self
1940 }
1941
1942 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.0.request.page_token = v.into();
1945 self
1946 }
1947
1948 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1950 self.0.request.filter = v.into();
1951 self
1952 }
1953
1954 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1956 self.0.request.order_by = v.into();
1957 self
1958 }
1959 }
1960
1961 #[doc(hidden)]
1962 impl gax::options::internal::RequestBuilder for ListServiceConnectionTokens {
1963 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1964 &mut self.0.options
1965 }
1966 }
1967
1968 #[derive(Clone, Debug)]
1987 pub struct CreateServiceConnectionToken(
1988 RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
1989 );
1990
1991 impl CreateServiceConnectionToken {
1992 pub(crate) fn new(
1993 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1994 ) -> Self {
1995 Self(RequestBuilder::new(stub))
1996 }
1997
1998 pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2000 mut self,
2001 v: V,
2002 ) -> Self {
2003 self.0.request = v.into();
2004 self
2005 }
2006
2007 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2009 self.0.options = v.into();
2010 self
2011 }
2012
2013 pub async fn send(self) -> Result<longrunning::model::Operation> {
2020 (*self.0.stub)
2021 .create_service_connection_token(self.0.request, self.0.options)
2022 .await
2023 .map(gax::response::Response::into_body)
2024 }
2025
2026 pub fn poller(
2028 self,
2029 ) -> impl lro::Poller<crate::model::ServiceConnectionToken, crate::model::OperationMetadata>
2030 {
2031 type Operation = lro::internal::Operation<
2032 crate::model::ServiceConnectionToken,
2033 crate::model::OperationMetadata,
2034 >;
2035 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2036 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2037
2038 let stub = self.0.stub.clone();
2039 let mut options = self.0.options.clone();
2040 options.set_retry_policy(gax::retry_policy::NeverRetry);
2041 let query = move |name| {
2042 let stub = stub.clone();
2043 let options = options.clone();
2044 async {
2045 let op = GetOperation::new(stub)
2046 .set_name(name)
2047 .with_options(options)
2048 .send()
2049 .await?;
2050 Ok(Operation::new(op))
2051 }
2052 };
2053
2054 let start = move || async {
2055 let op = self.send().await?;
2056 Ok(Operation::new(op))
2057 };
2058
2059 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2060 }
2061
2062 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2066 self.0.request.parent = v.into();
2067 self
2068 }
2069
2070 pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2072 mut self,
2073 v: T,
2074 ) -> Self {
2075 self.0.request.service_connection_token_id = v.into();
2076 self
2077 }
2078
2079 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2083 where
2084 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2085 {
2086 self.0.request.service_connection_token = std::option::Option::Some(v.into());
2087 self
2088 }
2089
2090 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2094 where
2095 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2096 {
2097 self.0.request.service_connection_token = v.map(|x| x.into());
2098 self
2099 }
2100
2101 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2103 self.0.request.request_id = v.into();
2104 self
2105 }
2106 }
2107
2108 #[doc(hidden)]
2109 impl gax::options::internal::RequestBuilder for CreateServiceConnectionToken {
2110 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2111 &mut self.0.options
2112 }
2113 }
2114
2115 #[derive(Clone, Debug)]
2134 pub struct DeleteServiceConnectionToken(
2135 RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2136 );
2137
2138 impl DeleteServiceConnectionToken {
2139 pub(crate) fn new(
2140 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2141 ) -> Self {
2142 Self(RequestBuilder::new(stub))
2143 }
2144
2145 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2147 mut self,
2148 v: V,
2149 ) -> Self {
2150 self.0.request = v.into();
2151 self
2152 }
2153
2154 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2156 self.0.options = v.into();
2157 self
2158 }
2159
2160 pub async fn send(self) -> Result<longrunning::model::Operation> {
2167 (*self.0.stub)
2168 .delete_service_connection_token(self.0.request, self.0.options)
2169 .await
2170 .map(gax::response::Response::into_body)
2171 }
2172
2173 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2175 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2176 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2177 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2178
2179 let stub = self.0.stub.clone();
2180 let mut options = self.0.options.clone();
2181 options.set_retry_policy(gax::retry_policy::NeverRetry);
2182 let query = move |name| {
2183 let stub = stub.clone();
2184 let options = options.clone();
2185 async {
2186 let op = GetOperation::new(stub)
2187 .set_name(name)
2188 .with_options(options)
2189 .send()
2190 .await?;
2191 Ok(Operation::new(op))
2192 }
2193 };
2194
2195 let start = move || async {
2196 let op = self.send().await?;
2197 Ok(Operation::new(op))
2198 };
2199
2200 lro::internal::new_unit_response_poller(
2201 polling_error_policy,
2202 polling_backoff_policy,
2203 start,
2204 query,
2205 )
2206 }
2207
2208 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2212 self.0.request.name = v.into();
2213 self
2214 }
2215
2216 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2218 self.0.request.request_id = v.into();
2219 self
2220 }
2221
2222 pub fn set_etag<T>(mut self, v: T) -> Self
2224 where
2225 T: std::convert::Into<std::string::String>,
2226 {
2227 self.0.request.etag = std::option::Option::Some(v.into());
2228 self
2229 }
2230
2231 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2233 where
2234 T: std::convert::Into<std::string::String>,
2235 {
2236 self.0.request.etag = v.map(|x| x.into());
2237 self
2238 }
2239 }
2240
2241 #[doc(hidden)]
2242 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionToken {
2243 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2244 &mut self.0.options
2245 }
2246 }
2247
2248 #[derive(Clone, Debug)]
2270 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2271
2272 impl ListLocations {
2273 pub(crate) fn new(
2274 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2275 ) -> Self {
2276 Self(RequestBuilder::new(stub))
2277 }
2278
2279 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2281 mut self,
2282 v: V,
2283 ) -> Self {
2284 self.0.request = v.into();
2285 self
2286 }
2287
2288 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2290 self.0.options = v.into();
2291 self
2292 }
2293
2294 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2296 (*self.0.stub)
2297 .list_locations(self.0.request, self.0.options)
2298 .await
2299 .map(gax::response::Response::into_body)
2300 }
2301
2302 pub fn by_page(
2304 self,
2305 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2306 {
2307 use std::clone::Clone;
2308 let token = self.0.request.page_token.clone();
2309 let execute = move |token: String| {
2310 let mut builder = self.clone();
2311 builder.0.request = builder.0.request.set_page_token(token);
2312 builder.send()
2313 };
2314 gax::paginator::internal::new_paginator(token, execute)
2315 }
2316
2317 pub fn by_item(
2319 self,
2320 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2321 {
2322 use gax::paginator::Paginator;
2323 self.by_page().items()
2324 }
2325
2326 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328 self.0.request.name = v.into();
2329 self
2330 }
2331
2332 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2334 self.0.request.filter = v.into();
2335 self
2336 }
2337
2338 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2340 self.0.request.page_size = v.into();
2341 self
2342 }
2343
2344 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2346 self.0.request.page_token = v.into();
2347 self
2348 }
2349 }
2350
2351 #[doc(hidden)]
2352 impl gax::options::internal::RequestBuilder for ListLocations {
2353 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2354 &mut self.0.options
2355 }
2356 }
2357
2358 #[derive(Clone, Debug)]
2376 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2377
2378 impl GetLocation {
2379 pub(crate) fn new(
2380 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2381 ) -> Self {
2382 Self(RequestBuilder::new(stub))
2383 }
2384
2385 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2387 self.0.request = v.into();
2388 self
2389 }
2390
2391 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2393 self.0.options = v.into();
2394 self
2395 }
2396
2397 pub async fn send(self) -> Result<location::model::Location> {
2399 (*self.0.stub)
2400 .get_location(self.0.request, self.0.options)
2401 .await
2402 .map(gax::response::Response::into_body)
2403 }
2404
2405 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2407 self.0.request.name = v.into();
2408 self
2409 }
2410 }
2411
2412 #[doc(hidden)]
2413 impl gax::options::internal::RequestBuilder for GetLocation {
2414 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2415 &mut self.0.options
2416 }
2417 }
2418
2419 #[derive(Clone, Debug)]
2437 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2438
2439 impl SetIamPolicy {
2440 pub(crate) fn new(
2441 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2442 ) -> Self {
2443 Self(RequestBuilder::new(stub))
2444 }
2445
2446 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2448 self.0.request = v.into();
2449 self
2450 }
2451
2452 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2454 self.0.options = v.into();
2455 self
2456 }
2457
2458 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2460 (*self.0.stub)
2461 .set_iam_policy(self.0.request, self.0.options)
2462 .await
2463 .map(gax::response::Response::into_body)
2464 }
2465
2466 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470 self.0.request.resource = v.into();
2471 self
2472 }
2473
2474 pub fn set_policy<T>(mut self, v: T) -> Self
2478 where
2479 T: std::convert::Into<iam_v1::model::Policy>,
2480 {
2481 self.0.request.policy = std::option::Option::Some(v.into());
2482 self
2483 }
2484
2485 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2489 where
2490 T: std::convert::Into<iam_v1::model::Policy>,
2491 {
2492 self.0.request.policy = v.map(|x| x.into());
2493 self
2494 }
2495
2496 pub fn set_update_mask<T>(mut self, v: T) -> Self
2498 where
2499 T: std::convert::Into<wkt::FieldMask>,
2500 {
2501 self.0.request.update_mask = std::option::Option::Some(v.into());
2502 self
2503 }
2504
2505 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2507 where
2508 T: std::convert::Into<wkt::FieldMask>,
2509 {
2510 self.0.request.update_mask = v.map(|x| x.into());
2511 self
2512 }
2513 }
2514
2515 #[doc(hidden)]
2516 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2518 &mut self.0.options
2519 }
2520 }
2521
2522 #[derive(Clone, Debug)]
2540 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2541
2542 impl GetIamPolicy {
2543 pub(crate) fn new(
2544 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2545 ) -> Self {
2546 Self(RequestBuilder::new(stub))
2547 }
2548
2549 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2551 self.0.request = v.into();
2552 self
2553 }
2554
2555 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2557 self.0.options = v.into();
2558 self
2559 }
2560
2561 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2563 (*self.0.stub)
2564 .get_iam_policy(self.0.request, self.0.options)
2565 .await
2566 .map(gax::response::Response::into_body)
2567 }
2568
2569 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573 self.0.request.resource = v.into();
2574 self
2575 }
2576
2577 pub fn set_options<T>(mut self, v: T) -> Self
2579 where
2580 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2581 {
2582 self.0.request.options = std::option::Option::Some(v.into());
2583 self
2584 }
2585
2586 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2588 where
2589 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2590 {
2591 self.0.request.options = v.map(|x| x.into());
2592 self
2593 }
2594 }
2595
2596 #[doc(hidden)]
2597 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2598 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2599 &mut self.0.options
2600 }
2601 }
2602
2603 #[derive(Clone, Debug)]
2621 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2622
2623 impl TestIamPermissions {
2624 pub(crate) fn new(
2625 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2626 ) -> Self {
2627 Self(RequestBuilder::new(stub))
2628 }
2629
2630 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2632 mut self,
2633 v: V,
2634 ) -> Self {
2635 self.0.request = v.into();
2636 self
2637 }
2638
2639 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2641 self.0.options = v.into();
2642 self
2643 }
2644
2645 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2647 (*self.0.stub)
2648 .test_iam_permissions(self.0.request, self.0.options)
2649 .await
2650 .map(gax::response::Response::into_body)
2651 }
2652
2653 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2657 self.0.request.resource = v.into();
2658 self
2659 }
2660
2661 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2665 where
2666 T: std::iter::IntoIterator<Item = V>,
2667 V: std::convert::Into<std::string::String>,
2668 {
2669 use std::iter::Iterator;
2670 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2671 self
2672 }
2673 }
2674
2675 #[doc(hidden)]
2676 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2677 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2678 &mut self.0.options
2679 }
2680 }
2681
2682 #[derive(Clone, Debug)]
2704 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2705
2706 impl ListOperations {
2707 pub(crate) fn new(
2708 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2709 ) -> Self {
2710 Self(RequestBuilder::new(stub))
2711 }
2712
2713 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2715 mut self,
2716 v: V,
2717 ) -> Self {
2718 self.0.request = v.into();
2719 self
2720 }
2721
2722 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2724 self.0.options = v.into();
2725 self
2726 }
2727
2728 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2730 (*self.0.stub)
2731 .list_operations(self.0.request, self.0.options)
2732 .await
2733 .map(gax::response::Response::into_body)
2734 }
2735
2736 pub fn by_page(
2738 self,
2739 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2740 {
2741 use std::clone::Clone;
2742 let token = self.0.request.page_token.clone();
2743 let execute = move |token: String| {
2744 let mut builder = self.clone();
2745 builder.0.request = builder.0.request.set_page_token(token);
2746 builder.send()
2747 };
2748 gax::paginator::internal::new_paginator(token, execute)
2749 }
2750
2751 pub fn by_item(
2753 self,
2754 ) -> impl gax::paginator::ItemPaginator<
2755 longrunning::model::ListOperationsResponse,
2756 gax::error::Error,
2757 > {
2758 use gax::paginator::Paginator;
2759 self.by_page().items()
2760 }
2761
2762 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2764 self.0.request.name = v.into();
2765 self
2766 }
2767
2768 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2770 self.0.request.filter = v.into();
2771 self
2772 }
2773
2774 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2776 self.0.request.page_size = v.into();
2777 self
2778 }
2779
2780 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2782 self.0.request.page_token = v.into();
2783 self
2784 }
2785 }
2786
2787 #[doc(hidden)]
2788 impl gax::options::internal::RequestBuilder for ListOperations {
2789 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2790 &mut self.0.options
2791 }
2792 }
2793
2794 #[derive(Clone, Debug)]
2812 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2813
2814 impl GetOperation {
2815 pub(crate) fn new(
2816 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2817 ) -> Self {
2818 Self(RequestBuilder::new(stub))
2819 }
2820
2821 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2823 mut self,
2824 v: V,
2825 ) -> Self {
2826 self.0.request = v.into();
2827 self
2828 }
2829
2830 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2832 self.0.options = v.into();
2833 self
2834 }
2835
2836 pub async fn send(self) -> Result<longrunning::model::Operation> {
2838 (*self.0.stub)
2839 .get_operation(self.0.request, self.0.options)
2840 .await
2841 .map(gax::response::Response::into_body)
2842 }
2843
2844 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2846 self.0.request.name = v.into();
2847 self
2848 }
2849 }
2850
2851 #[doc(hidden)]
2852 impl gax::options::internal::RequestBuilder for GetOperation {
2853 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2854 &mut self.0.options
2855 }
2856 }
2857
2858 #[derive(Clone, Debug)]
2876 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2877
2878 impl DeleteOperation {
2879 pub(crate) fn new(
2880 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2881 ) -> Self {
2882 Self(RequestBuilder::new(stub))
2883 }
2884
2885 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2887 mut self,
2888 v: V,
2889 ) -> Self {
2890 self.0.request = v.into();
2891 self
2892 }
2893
2894 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2896 self.0.options = v.into();
2897 self
2898 }
2899
2900 pub async fn send(self) -> Result<()> {
2902 (*self.0.stub)
2903 .delete_operation(self.0.request, self.0.options)
2904 .await
2905 .map(gax::response::Response::into_body)
2906 }
2907
2908 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2910 self.0.request.name = v.into();
2911 self
2912 }
2913 }
2914
2915 #[doc(hidden)]
2916 impl gax::options::internal::RequestBuilder for DeleteOperation {
2917 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2918 &mut self.0.options
2919 }
2920 }
2921
2922 #[derive(Clone, Debug)]
2940 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2941
2942 impl CancelOperation {
2943 pub(crate) fn new(
2944 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2945 ) -> Self {
2946 Self(RequestBuilder::new(stub))
2947 }
2948
2949 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2951 mut self,
2952 v: V,
2953 ) -> Self {
2954 self.0.request = v.into();
2955 self
2956 }
2957
2958 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2960 self.0.options = v.into();
2961 self
2962 }
2963
2964 pub async fn send(self) -> Result<()> {
2966 (*self.0.stub)
2967 .cancel_operation(self.0.request, self.0.options)
2968 .await
2969 .map(gax::response::Response::into_body)
2970 }
2971
2972 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.0.request.name = v.into();
2975 self
2976 }
2977 }
2978
2979 #[doc(hidden)]
2980 impl gax::options::internal::RequestBuilder for CancelOperation {
2981 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2982 &mut self.0.options
2983 }
2984 }
2985}
2986
2987pub mod data_transfer_service {
2988 use crate::Result;
2989
2990 pub type ClientBuilder =
3004 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3005
3006 pub(crate) mod client {
3007 use super::super::super::client::DataTransferService;
3008 pub struct Factory;
3009 impl gax::client_builder::internal::ClientFactory for Factory {
3010 type Client = DataTransferService;
3011 type Credentials = gaxi::options::Credentials;
3012 async fn build(
3013 self,
3014 config: gaxi::options::ClientConfig,
3015 ) -> gax::client_builder::Result<Self::Client> {
3016 Self::Client::new(config).await
3017 }
3018 }
3019 }
3020
3021 #[derive(Clone, Debug)]
3023 pub(crate) struct RequestBuilder<R: std::default::Default> {
3024 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3025 request: R,
3026 options: gax::options::RequestOptions,
3027 }
3028
3029 impl<R> RequestBuilder<R>
3030 where
3031 R: std::default::Default,
3032 {
3033 pub(crate) fn new(
3034 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3035 ) -> Self {
3036 Self {
3037 stub,
3038 request: R::default(),
3039 options: gax::options::RequestOptions::default(),
3040 }
3041 }
3042 }
3043
3044 #[derive(Clone, Debug)]
3066 pub struct ListMulticloudDataTransferConfigs(
3067 RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3068 );
3069
3070 impl ListMulticloudDataTransferConfigs {
3071 pub(crate) fn new(
3072 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3073 ) -> Self {
3074 Self(RequestBuilder::new(stub))
3075 }
3076
3077 pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3079 mut self,
3080 v: V,
3081 ) -> Self {
3082 self.0.request = v.into();
3083 self
3084 }
3085
3086 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3088 self.0.options = v.into();
3089 self
3090 }
3091
3092 pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3094 (*self.0.stub)
3095 .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3096 .await
3097 .map(gax::response::Response::into_body)
3098 }
3099
3100 pub fn by_page(
3102 self,
3103 ) -> impl gax::paginator::Paginator<
3104 crate::model::ListMulticloudDataTransferConfigsResponse,
3105 gax::error::Error,
3106 > {
3107 use std::clone::Clone;
3108 let token = self.0.request.page_token.clone();
3109 let execute = move |token: String| {
3110 let mut builder = self.clone();
3111 builder.0.request = builder.0.request.set_page_token(token);
3112 builder.send()
3113 };
3114 gax::paginator::internal::new_paginator(token, execute)
3115 }
3116
3117 pub fn by_item(
3119 self,
3120 ) -> impl gax::paginator::ItemPaginator<
3121 crate::model::ListMulticloudDataTransferConfigsResponse,
3122 gax::error::Error,
3123 > {
3124 use gax::paginator::Paginator;
3125 self.by_page().items()
3126 }
3127
3128 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3132 self.0.request.parent = v.into();
3133 self
3134 }
3135
3136 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3138 self.0.request.page_size = v.into();
3139 self
3140 }
3141
3142 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3144 self.0.request.page_token = v.into();
3145 self
3146 }
3147
3148 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3150 self.0.request.filter = v.into();
3151 self
3152 }
3153
3154 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3156 self.0.request.order_by = v.into();
3157 self
3158 }
3159
3160 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3162 self.0.request.return_partial_success = v.into();
3163 self
3164 }
3165 }
3166
3167 #[doc(hidden)]
3168 impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferConfigs {
3169 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3170 &mut self.0.options
3171 }
3172 }
3173
3174 #[derive(Clone, Debug)]
3192 pub struct GetMulticloudDataTransferConfig(
3193 RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3194 );
3195
3196 impl GetMulticloudDataTransferConfig {
3197 pub(crate) fn new(
3198 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3199 ) -> Self {
3200 Self(RequestBuilder::new(stub))
3201 }
3202
3203 pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3205 mut self,
3206 v: V,
3207 ) -> Self {
3208 self.0.request = v.into();
3209 self
3210 }
3211
3212 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3214 self.0.options = v.into();
3215 self
3216 }
3217
3218 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3220 (*self.0.stub)
3221 .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3222 .await
3223 .map(gax::response::Response::into_body)
3224 }
3225
3226 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3230 self.0.request.name = v.into();
3231 self
3232 }
3233 }
3234
3235 #[doc(hidden)]
3236 impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferConfig {
3237 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3238 &mut self.0.options
3239 }
3240 }
3241
3242 #[derive(Clone, Debug)]
3261 pub struct CreateMulticloudDataTransferConfig(
3262 RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3263 );
3264
3265 impl CreateMulticloudDataTransferConfig {
3266 pub(crate) fn new(
3267 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3268 ) -> Self {
3269 Self(RequestBuilder::new(stub))
3270 }
3271
3272 pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3274 mut self,
3275 v: V,
3276 ) -> Self {
3277 self.0.request = v.into();
3278 self
3279 }
3280
3281 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3283 self.0.options = v.into();
3284 self
3285 }
3286
3287 pub async fn send(self) -> Result<longrunning::model::Operation> {
3294 (*self.0.stub)
3295 .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3296 .await
3297 .map(gax::response::Response::into_body)
3298 }
3299
3300 pub fn poller(
3302 self,
3303 ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3304 {
3305 type Operation = lro::internal::Operation<
3306 crate::model::MulticloudDataTransferConfig,
3307 crate::model::OperationMetadata,
3308 >;
3309 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3310 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3311
3312 let stub = self.0.stub.clone();
3313 let mut options = self.0.options.clone();
3314 options.set_retry_policy(gax::retry_policy::NeverRetry);
3315 let query = move |name| {
3316 let stub = stub.clone();
3317 let options = options.clone();
3318 async {
3319 let op = GetOperation::new(stub)
3320 .set_name(name)
3321 .with_options(options)
3322 .send()
3323 .await?;
3324 Ok(Operation::new(op))
3325 }
3326 };
3327
3328 let start = move || async {
3329 let op = self.send().await?;
3330 Ok(Operation::new(op))
3331 };
3332
3333 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3334 }
3335
3336 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3340 self.0.request.parent = v.into();
3341 self
3342 }
3343
3344 pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3348 mut self,
3349 v: T,
3350 ) -> Self {
3351 self.0.request.multicloud_data_transfer_config_id = v.into();
3352 self
3353 }
3354
3355 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3359 where
3360 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3361 {
3362 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3363 self
3364 }
3365
3366 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3370 mut self,
3371 v: std::option::Option<T>,
3372 ) -> Self
3373 where
3374 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3375 {
3376 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3377 self
3378 }
3379
3380 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3382 self.0.request.request_id = v.into();
3383 self
3384 }
3385 }
3386
3387 #[doc(hidden)]
3388 impl gax::options::internal::RequestBuilder for CreateMulticloudDataTransferConfig {
3389 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3390 &mut self.0.options
3391 }
3392 }
3393
3394 #[derive(Clone, Debug)]
3413 pub struct UpdateMulticloudDataTransferConfig(
3414 RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3415 );
3416
3417 impl UpdateMulticloudDataTransferConfig {
3418 pub(crate) fn new(
3419 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3420 ) -> Self {
3421 Self(RequestBuilder::new(stub))
3422 }
3423
3424 pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3426 mut self,
3427 v: V,
3428 ) -> Self {
3429 self.0.request = v.into();
3430 self
3431 }
3432
3433 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3435 self.0.options = v.into();
3436 self
3437 }
3438
3439 pub async fn send(self) -> Result<longrunning::model::Operation> {
3446 (*self.0.stub)
3447 .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3448 .await
3449 .map(gax::response::Response::into_body)
3450 }
3451
3452 pub fn poller(
3454 self,
3455 ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3456 {
3457 type Operation = lro::internal::Operation<
3458 crate::model::MulticloudDataTransferConfig,
3459 crate::model::OperationMetadata,
3460 >;
3461 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3462 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3463
3464 let stub = self.0.stub.clone();
3465 let mut options = self.0.options.clone();
3466 options.set_retry_policy(gax::retry_policy::NeverRetry);
3467 let query = move |name| {
3468 let stub = stub.clone();
3469 let options = options.clone();
3470 async {
3471 let op = GetOperation::new(stub)
3472 .set_name(name)
3473 .with_options(options)
3474 .send()
3475 .await?;
3476 Ok(Operation::new(op))
3477 }
3478 };
3479
3480 let start = move || async {
3481 let op = self.send().await?;
3482 Ok(Operation::new(op))
3483 };
3484
3485 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3486 }
3487
3488 pub fn set_update_mask<T>(mut self, v: T) -> Self
3490 where
3491 T: std::convert::Into<wkt::FieldMask>,
3492 {
3493 self.0.request.update_mask = std::option::Option::Some(v.into());
3494 self
3495 }
3496
3497 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3499 where
3500 T: std::convert::Into<wkt::FieldMask>,
3501 {
3502 self.0.request.update_mask = v.map(|x| x.into());
3503 self
3504 }
3505
3506 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3510 where
3511 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3512 {
3513 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3514 self
3515 }
3516
3517 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3521 mut self,
3522 v: std::option::Option<T>,
3523 ) -> Self
3524 where
3525 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3526 {
3527 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3528 self
3529 }
3530
3531 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3533 self.0.request.request_id = v.into();
3534 self
3535 }
3536 }
3537
3538 #[doc(hidden)]
3539 impl gax::options::internal::RequestBuilder for UpdateMulticloudDataTransferConfig {
3540 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3541 &mut self.0.options
3542 }
3543 }
3544
3545 #[derive(Clone, Debug)]
3564 pub struct DeleteMulticloudDataTransferConfig(
3565 RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3566 );
3567
3568 impl DeleteMulticloudDataTransferConfig {
3569 pub(crate) fn new(
3570 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3571 ) -> Self {
3572 Self(RequestBuilder::new(stub))
3573 }
3574
3575 pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3577 mut self,
3578 v: V,
3579 ) -> Self {
3580 self.0.request = v.into();
3581 self
3582 }
3583
3584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3586 self.0.options = v.into();
3587 self
3588 }
3589
3590 pub async fn send(self) -> Result<longrunning::model::Operation> {
3597 (*self.0.stub)
3598 .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3599 .await
3600 .map(gax::response::Response::into_body)
3601 }
3602
3603 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3605 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3606 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3607 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3608
3609 let stub = self.0.stub.clone();
3610 let mut options = self.0.options.clone();
3611 options.set_retry_policy(gax::retry_policy::NeverRetry);
3612 let query = move |name| {
3613 let stub = stub.clone();
3614 let options = options.clone();
3615 async {
3616 let op = GetOperation::new(stub)
3617 .set_name(name)
3618 .with_options(options)
3619 .send()
3620 .await?;
3621 Ok(Operation::new(op))
3622 }
3623 };
3624
3625 let start = move || async {
3626 let op = self.send().await?;
3627 Ok(Operation::new(op))
3628 };
3629
3630 lro::internal::new_unit_response_poller(
3631 polling_error_policy,
3632 polling_backoff_policy,
3633 start,
3634 query,
3635 )
3636 }
3637
3638 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3642 self.0.request.name = v.into();
3643 self
3644 }
3645
3646 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.0.request.request_id = v.into();
3649 self
3650 }
3651
3652 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3654 self.0.request.etag = v.into();
3655 self
3656 }
3657 }
3658
3659 #[doc(hidden)]
3660 impl gax::options::internal::RequestBuilder for DeleteMulticloudDataTransferConfig {
3661 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3662 &mut self.0.options
3663 }
3664 }
3665
3666 #[derive(Clone, Debug)]
3688 pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3689
3690 impl ListDestinations {
3691 pub(crate) fn new(
3692 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3693 ) -> Self {
3694 Self(RequestBuilder::new(stub))
3695 }
3696
3697 pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3699 mut self,
3700 v: V,
3701 ) -> Self {
3702 self.0.request = v.into();
3703 self
3704 }
3705
3706 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3708 self.0.options = v.into();
3709 self
3710 }
3711
3712 pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3714 (*self.0.stub)
3715 .list_destinations(self.0.request, self.0.options)
3716 .await
3717 .map(gax::response::Response::into_body)
3718 }
3719
3720 pub fn by_page(
3722 self,
3723 ) -> impl gax::paginator::Paginator<crate::model::ListDestinationsResponse, gax::error::Error>
3724 {
3725 use std::clone::Clone;
3726 let token = self.0.request.page_token.clone();
3727 let execute = move |token: String| {
3728 let mut builder = self.clone();
3729 builder.0.request = builder.0.request.set_page_token(token);
3730 builder.send()
3731 };
3732 gax::paginator::internal::new_paginator(token, execute)
3733 }
3734
3735 pub fn by_item(
3737 self,
3738 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDestinationsResponse, gax::error::Error>
3739 {
3740 use gax::paginator::Paginator;
3741 self.by_page().items()
3742 }
3743
3744 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3748 self.0.request.parent = v.into();
3749 self
3750 }
3751
3752 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3754 self.0.request.page_size = v.into();
3755 self
3756 }
3757
3758 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3760 self.0.request.page_token = v.into();
3761 self
3762 }
3763
3764 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3766 self.0.request.filter = v.into();
3767 self
3768 }
3769
3770 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3772 self.0.request.order_by = v.into();
3773 self
3774 }
3775
3776 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3778 self.0.request.return_partial_success = v.into();
3779 self
3780 }
3781 }
3782
3783 #[doc(hidden)]
3784 impl gax::options::internal::RequestBuilder for ListDestinations {
3785 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3786 &mut self.0.options
3787 }
3788 }
3789
3790 #[derive(Clone, Debug)]
3808 pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3809
3810 impl GetDestination {
3811 pub(crate) fn new(
3812 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3813 ) -> Self {
3814 Self(RequestBuilder::new(stub))
3815 }
3816
3817 pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3819 self.0.request = v.into();
3820 self
3821 }
3822
3823 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3825 self.0.options = v.into();
3826 self
3827 }
3828
3829 pub async fn send(self) -> Result<crate::model::Destination> {
3831 (*self.0.stub)
3832 .get_destination(self.0.request, self.0.options)
3833 .await
3834 .map(gax::response::Response::into_body)
3835 }
3836
3837 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3841 self.0.request.name = v.into();
3842 self
3843 }
3844 }
3845
3846 #[doc(hidden)]
3847 impl gax::options::internal::RequestBuilder for GetDestination {
3848 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3849 &mut self.0.options
3850 }
3851 }
3852
3853 #[derive(Clone, Debug)]
3872 pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3873
3874 impl CreateDestination {
3875 pub(crate) fn new(
3876 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3877 ) -> Self {
3878 Self(RequestBuilder::new(stub))
3879 }
3880
3881 pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3883 mut self,
3884 v: V,
3885 ) -> Self {
3886 self.0.request = v.into();
3887 self
3888 }
3889
3890 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3892 self.0.options = v.into();
3893 self
3894 }
3895
3896 pub async fn send(self) -> Result<longrunning::model::Operation> {
3903 (*self.0.stub)
3904 .create_destination(self.0.request, self.0.options)
3905 .await
3906 .map(gax::response::Response::into_body)
3907 }
3908
3909 pub fn poller(
3911 self,
3912 ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
3913 type Operation = lro::internal::Operation<
3914 crate::model::Destination,
3915 crate::model::OperationMetadata,
3916 >;
3917 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3918 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3919
3920 let stub = self.0.stub.clone();
3921 let mut options = self.0.options.clone();
3922 options.set_retry_policy(gax::retry_policy::NeverRetry);
3923 let query = move |name| {
3924 let stub = stub.clone();
3925 let options = options.clone();
3926 async {
3927 let op = GetOperation::new(stub)
3928 .set_name(name)
3929 .with_options(options)
3930 .send()
3931 .await?;
3932 Ok(Operation::new(op))
3933 }
3934 };
3935
3936 let start = move || async {
3937 let op = self.send().await?;
3938 Ok(Operation::new(op))
3939 };
3940
3941 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3942 }
3943
3944 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3948 self.0.request.parent = v.into();
3949 self
3950 }
3951
3952 pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3956 self.0.request.destination_id = v.into();
3957 self
3958 }
3959
3960 pub fn set_destination<T>(mut self, v: T) -> Self
3964 where
3965 T: std::convert::Into<crate::model::Destination>,
3966 {
3967 self.0.request.destination = std::option::Option::Some(v.into());
3968 self
3969 }
3970
3971 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
3975 where
3976 T: std::convert::Into<crate::model::Destination>,
3977 {
3978 self.0.request.destination = v.map(|x| x.into());
3979 self
3980 }
3981
3982 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3984 self.0.request.request_id = v.into();
3985 self
3986 }
3987 }
3988
3989 #[doc(hidden)]
3990 impl gax::options::internal::RequestBuilder for CreateDestination {
3991 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3992 &mut self.0.options
3993 }
3994 }
3995
3996 #[derive(Clone, Debug)]
4015 pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4016
4017 impl UpdateDestination {
4018 pub(crate) fn new(
4019 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4020 ) -> Self {
4021 Self(RequestBuilder::new(stub))
4022 }
4023
4024 pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4026 mut self,
4027 v: V,
4028 ) -> Self {
4029 self.0.request = v.into();
4030 self
4031 }
4032
4033 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4035 self.0.options = v.into();
4036 self
4037 }
4038
4039 pub async fn send(self) -> Result<longrunning::model::Operation> {
4046 (*self.0.stub)
4047 .update_destination(self.0.request, self.0.options)
4048 .await
4049 .map(gax::response::Response::into_body)
4050 }
4051
4052 pub fn poller(
4054 self,
4055 ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
4056 type Operation = lro::internal::Operation<
4057 crate::model::Destination,
4058 crate::model::OperationMetadata,
4059 >;
4060 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4061 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4062
4063 let stub = self.0.stub.clone();
4064 let mut options = self.0.options.clone();
4065 options.set_retry_policy(gax::retry_policy::NeverRetry);
4066 let query = move |name| {
4067 let stub = stub.clone();
4068 let options = options.clone();
4069 async {
4070 let op = GetOperation::new(stub)
4071 .set_name(name)
4072 .with_options(options)
4073 .send()
4074 .await?;
4075 Ok(Operation::new(op))
4076 }
4077 };
4078
4079 let start = move || async {
4080 let op = self.send().await?;
4081 Ok(Operation::new(op))
4082 };
4083
4084 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4085 }
4086
4087 pub fn set_update_mask<T>(mut self, v: T) -> Self
4089 where
4090 T: std::convert::Into<wkt::FieldMask>,
4091 {
4092 self.0.request.update_mask = std::option::Option::Some(v.into());
4093 self
4094 }
4095
4096 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4098 where
4099 T: std::convert::Into<wkt::FieldMask>,
4100 {
4101 self.0.request.update_mask = v.map(|x| x.into());
4102 self
4103 }
4104
4105 pub fn set_destination<T>(mut self, v: T) -> Self
4109 where
4110 T: std::convert::Into<crate::model::Destination>,
4111 {
4112 self.0.request.destination = std::option::Option::Some(v.into());
4113 self
4114 }
4115
4116 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4120 where
4121 T: std::convert::Into<crate::model::Destination>,
4122 {
4123 self.0.request.destination = v.map(|x| x.into());
4124 self
4125 }
4126
4127 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4129 self.0.request.request_id = v.into();
4130 self
4131 }
4132 }
4133
4134 #[doc(hidden)]
4135 impl gax::options::internal::RequestBuilder for UpdateDestination {
4136 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4137 &mut self.0.options
4138 }
4139 }
4140
4141 #[derive(Clone, Debug)]
4160 pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4161
4162 impl DeleteDestination {
4163 pub(crate) fn new(
4164 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4165 ) -> Self {
4166 Self(RequestBuilder::new(stub))
4167 }
4168
4169 pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4171 mut self,
4172 v: V,
4173 ) -> Self {
4174 self.0.request = v.into();
4175 self
4176 }
4177
4178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4180 self.0.options = v.into();
4181 self
4182 }
4183
4184 pub async fn send(self) -> Result<longrunning::model::Operation> {
4191 (*self.0.stub)
4192 .delete_destination(self.0.request, self.0.options)
4193 .await
4194 .map(gax::response::Response::into_body)
4195 }
4196
4197 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4199 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4200 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4201 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4202
4203 let stub = self.0.stub.clone();
4204 let mut options = self.0.options.clone();
4205 options.set_retry_policy(gax::retry_policy::NeverRetry);
4206 let query = move |name| {
4207 let stub = stub.clone();
4208 let options = options.clone();
4209 async {
4210 let op = GetOperation::new(stub)
4211 .set_name(name)
4212 .with_options(options)
4213 .send()
4214 .await?;
4215 Ok(Operation::new(op))
4216 }
4217 };
4218
4219 let start = move || async {
4220 let op = self.send().await?;
4221 Ok(Operation::new(op))
4222 };
4223
4224 lro::internal::new_unit_response_poller(
4225 polling_error_policy,
4226 polling_backoff_policy,
4227 start,
4228 query,
4229 )
4230 }
4231
4232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4236 self.0.request.name = v.into();
4237 self
4238 }
4239
4240 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4242 self.0.request.request_id = v.into();
4243 self
4244 }
4245
4246 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4248 self.0.request.etag = v.into();
4249 self
4250 }
4251 }
4252
4253 #[doc(hidden)]
4254 impl gax::options::internal::RequestBuilder for DeleteDestination {
4255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4256 &mut self.0.options
4257 }
4258 }
4259
4260 #[derive(Clone, Debug)]
4278 pub struct GetMulticloudDataTransferSupportedService(
4279 RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4280 );
4281
4282 impl GetMulticloudDataTransferSupportedService {
4283 pub(crate) fn new(
4284 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4285 ) -> Self {
4286 Self(RequestBuilder::new(stub))
4287 }
4288
4289 pub fn with_request<
4291 V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4292 >(
4293 mut self,
4294 v: V,
4295 ) -> Self {
4296 self.0.request = v.into();
4297 self
4298 }
4299
4300 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4302 self.0.options = v.into();
4303 self
4304 }
4305
4306 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4308 (*self.0.stub)
4309 .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4310 .await
4311 .map(gax::response::Response::into_body)
4312 }
4313
4314 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4318 self.0.request.name = v.into();
4319 self
4320 }
4321 }
4322
4323 #[doc(hidden)]
4324 impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferSupportedService {
4325 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4326 &mut self.0.options
4327 }
4328 }
4329
4330 #[derive(Clone, Debug)]
4352 pub struct ListMulticloudDataTransferSupportedServices(
4353 RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4354 );
4355
4356 impl ListMulticloudDataTransferSupportedServices {
4357 pub(crate) fn new(
4358 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4359 ) -> Self {
4360 Self(RequestBuilder::new(stub))
4361 }
4362
4363 pub fn with_request<
4365 V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4366 >(
4367 mut self,
4368 v: V,
4369 ) -> Self {
4370 self.0.request = v.into();
4371 self
4372 }
4373
4374 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4376 self.0.options = v.into();
4377 self
4378 }
4379
4380 pub async fn send(
4382 self,
4383 ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4384 (*self.0.stub)
4385 .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4386 .await
4387 .map(gax::response::Response::into_body)
4388 }
4389
4390 pub fn by_page(
4392 self,
4393 ) -> impl gax::paginator::Paginator<
4394 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4395 gax::error::Error,
4396 > {
4397 use std::clone::Clone;
4398 let token = self.0.request.page_token.clone();
4399 let execute = move |token: String| {
4400 let mut builder = self.clone();
4401 builder.0.request = builder.0.request.set_page_token(token);
4402 builder.send()
4403 };
4404 gax::paginator::internal::new_paginator(token, execute)
4405 }
4406
4407 pub fn by_item(
4409 self,
4410 ) -> impl gax::paginator::ItemPaginator<
4411 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4412 gax::error::Error,
4413 > {
4414 use gax::paginator::Paginator;
4415 self.by_page().items()
4416 }
4417
4418 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4422 self.0.request.parent = v.into();
4423 self
4424 }
4425
4426 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4428 self.0.request.page_size = v.into();
4429 self
4430 }
4431
4432 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4434 self.0.request.page_token = v.into();
4435 self
4436 }
4437 }
4438
4439 #[doc(hidden)]
4440 impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4441 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4442 &mut self.0.options
4443 }
4444 }
4445
4446 #[derive(Clone, Debug)]
4468 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4469
4470 impl ListLocations {
4471 pub(crate) fn new(
4472 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4473 ) -> Self {
4474 Self(RequestBuilder::new(stub))
4475 }
4476
4477 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4479 mut self,
4480 v: V,
4481 ) -> Self {
4482 self.0.request = v.into();
4483 self
4484 }
4485
4486 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4488 self.0.options = v.into();
4489 self
4490 }
4491
4492 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4494 (*self.0.stub)
4495 .list_locations(self.0.request, self.0.options)
4496 .await
4497 .map(gax::response::Response::into_body)
4498 }
4499
4500 pub fn by_page(
4502 self,
4503 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4504 {
4505 use std::clone::Clone;
4506 let token = self.0.request.page_token.clone();
4507 let execute = move |token: String| {
4508 let mut builder = self.clone();
4509 builder.0.request = builder.0.request.set_page_token(token);
4510 builder.send()
4511 };
4512 gax::paginator::internal::new_paginator(token, execute)
4513 }
4514
4515 pub fn by_item(
4517 self,
4518 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4519 {
4520 use gax::paginator::Paginator;
4521 self.by_page().items()
4522 }
4523
4524 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4526 self.0.request.name = v.into();
4527 self
4528 }
4529
4530 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4532 self.0.request.filter = v.into();
4533 self
4534 }
4535
4536 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4538 self.0.request.page_size = v.into();
4539 self
4540 }
4541
4542 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4544 self.0.request.page_token = v.into();
4545 self
4546 }
4547 }
4548
4549 #[doc(hidden)]
4550 impl gax::options::internal::RequestBuilder for ListLocations {
4551 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4552 &mut self.0.options
4553 }
4554 }
4555
4556 #[derive(Clone, Debug)]
4574 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4575
4576 impl GetLocation {
4577 pub(crate) fn new(
4578 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4579 ) -> Self {
4580 Self(RequestBuilder::new(stub))
4581 }
4582
4583 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4585 self.0.request = v.into();
4586 self
4587 }
4588
4589 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4591 self.0.options = v.into();
4592 self
4593 }
4594
4595 pub async fn send(self) -> Result<location::model::Location> {
4597 (*self.0.stub)
4598 .get_location(self.0.request, self.0.options)
4599 .await
4600 .map(gax::response::Response::into_body)
4601 }
4602
4603 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4605 self.0.request.name = v.into();
4606 self
4607 }
4608 }
4609
4610 #[doc(hidden)]
4611 impl gax::options::internal::RequestBuilder for GetLocation {
4612 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4613 &mut self.0.options
4614 }
4615 }
4616
4617 #[derive(Clone, Debug)]
4635 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4636
4637 impl SetIamPolicy {
4638 pub(crate) fn new(
4639 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4640 ) -> Self {
4641 Self(RequestBuilder::new(stub))
4642 }
4643
4644 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4646 self.0.request = v.into();
4647 self
4648 }
4649
4650 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4652 self.0.options = v.into();
4653 self
4654 }
4655
4656 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4658 (*self.0.stub)
4659 .set_iam_policy(self.0.request, self.0.options)
4660 .await
4661 .map(gax::response::Response::into_body)
4662 }
4663
4664 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4668 self.0.request.resource = v.into();
4669 self
4670 }
4671
4672 pub fn set_policy<T>(mut self, v: T) -> Self
4676 where
4677 T: std::convert::Into<iam_v1::model::Policy>,
4678 {
4679 self.0.request.policy = std::option::Option::Some(v.into());
4680 self
4681 }
4682
4683 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4687 where
4688 T: std::convert::Into<iam_v1::model::Policy>,
4689 {
4690 self.0.request.policy = v.map(|x| x.into());
4691 self
4692 }
4693
4694 pub fn set_update_mask<T>(mut self, v: T) -> Self
4696 where
4697 T: std::convert::Into<wkt::FieldMask>,
4698 {
4699 self.0.request.update_mask = std::option::Option::Some(v.into());
4700 self
4701 }
4702
4703 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4705 where
4706 T: std::convert::Into<wkt::FieldMask>,
4707 {
4708 self.0.request.update_mask = v.map(|x| x.into());
4709 self
4710 }
4711 }
4712
4713 #[doc(hidden)]
4714 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4715 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4716 &mut self.0.options
4717 }
4718 }
4719
4720 #[derive(Clone, Debug)]
4738 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4739
4740 impl GetIamPolicy {
4741 pub(crate) fn new(
4742 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4743 ) -> Self {
4744 Self(RequestBuilder::new(stub))
4745 }
4746
4747 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4749 self.0.request = v.into();
4750 self
4751 }
4752
4753 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4755 self.0.options = v.into();
4756 self
4757 }
4758
4759 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4761 (*self.0.stub)
4762 .get_iam_policy(self.0.request, self.0.options)
4763 .await
4764 .map(gax::response::Response::into_body)
4765 }
4766
4767 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4771 self.0.request.resource = v.into();
4772 self
4773 }
4774
4775 pub fn set_options<T>(mut self, v: T) -> Self
4777 where
4778 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4779 {
4780 self.0.request.options = std::option::Option::Some(v.into());
4781 self
4782 }
4783
4784 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4786 where
4787 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4788 {
4789 self.0.request.options = v.map(|x| x.into());
4790 self
4791 }
4792 }
4793
4794 #[doc(hidden)]
4795 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4796 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4797 &mut self.0.options
4798 }
4799 }
4800
4801 #[derive(Clone, Debug)]
4819 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4820
4821 impl TestIamPermissions {
4822 pub(crate) fn new(
4823 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4824 ) -> Self {
4825 Self(RequestBuilder::new(stub))
4826 }
4827
4828 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4830 mut self,
4831 v: V,
4832 ) -> Self {
4833 self.0.request = v.into();
4834 self
4835 }
4836
4837 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4839 self.0.options = v.into();
4840 self
4841 }
4842
4843 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4845 (*self.0.stub)
4846 .test_iam_permissions(self.0.request, self.0.options)
4847 .await
4848 .map(gax::response::Response::into_body)
4849 }
4850
4851 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4855 self.0.request.resource = v.into();
4856 self
4857 }
4858
4859 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4863 where
4864 T: std::iter::IntoIterator<Item = V>,
4865 V: std::convert::Into<std::string::String>,
4866 {
4867 use std::iter::Iterator;
4868 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4869 self
4870 }
4871 }
4872
4873 #[doc(hidden)]
4874 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4875 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4876 &mut self.0.options
4877 }
4878 }
4879
4880 #[derive(Clone, Debug)]
4902 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4903
4904 impl ListOperations {
4905 pub(crate) fn new(
4906 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4907 ) -> Self {
4908 Self(RequestBuilder::new(stub))
4909 }
4910
4911 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4913 mut self,
4914 v: V,
4915 ) -> Self {
4916 self.0.request = v.into();
4917 self
4918 }
4919
4920 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4922 self.0.options = v.into();
4923 self
4924 }
4925
4926 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4928 (*self.0.stub)
4929 .list_operations(self.0.request, self.0.options)
4930 .await
4931 .map(gax::response::Response::into_body)
4932 }
4933
4934 pub fn by_page(
4936 self,
4937 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4938 {
4939 use std::clone::Clone;
4940 let token = self.0.request.page_token.clone();
4941 let execute = move |token: String| {
4942 let mut builder = self.clone();
4943 builder.0.request = builder.0.request.set_page_token(token);
4944 builder.send()
4945 };
4946 gax::paginator::internal::new_paginator(token, execute)
4947 }
4948
4949 pub fn by_item(
4951 self,
4952 ) -> impl gax::paginator::ItemPaginator<
4953 longrunning::model::ListOperationsResponse,
4954 gax::error::Error,
4955 > {
4956 use gax::paginator::Paginator;
4957 self.by_page().items()
4958 }
4959
4960 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4962 self.0.request.name = v.into();
4963 self
4964 }
4965
4966 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4968 self.0.request.filter = v.into();
4969 self
4970 }
4971
4972 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4974 self.0.request.page_size = v.into();
4975 self
4976 }
4977
4978 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4980 self.0.request.page_token = v.into();
4981 self
4982 }
4983 }
4984
4985 #[doc(hidden)]
4986 impl gax::options::internal::RequestBuilder for ListOperations {
4987 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4988 &mut self.0.options
4989 }
4990 }
4991
4992 #[derive(Clone, Debug)]
5010 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5011
5012 impl GetOperation {
5013 pub(crate) fn new(
5014 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5015 ) -> Self {
5016 Self(RequestBuilder::new(stub))
5017 }
5018
5019 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5021 mut self,
5022 v: V,
5023 ) -> Self {
5024 self.0.request = v.into();
5025 self
5026 }
5027
5028 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5030 self.0.options = v.into();
5031 self
5032 }
5033
5034 pub async fn send(self) -> Result<longrunning::model::Operation> {
5036 (*self.0.stub)
5037 .get_operation(self.0.request, self.0.options)
5038 .await
5039 .map(gax::response::Response::into_body)
5040 }
5041
5042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5044 self.0.request.name = v.into();
5045 self
5046 }
5047 }
5048
5049 #[doc(hidden)]
5050 impl gax::options::internal::RequestBuilder for GetOperation {
5051 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5052 &mut self.0.options
5053 }
5054 }
5055
5056 #[derive(Clone, Debug)]
5074 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5075
5076 impl DeleteOperation {
5077 pub(crate) fn new(
5078 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5079 ) -> Self {
5080 Self(RequestBuilder::new(stub))
5081 }
5082
5083 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5085 mut self,
5086 v: V,
5087 ) -> Self {
5088 self.0.request = v.into();
5089 self
5090 }
5091
5092 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5094 self.0.options = v.into();
5095 self
5096 }
5097
5098 pub async fn send(self) -> Result<()> {
5100 (*self.0.stub)
5101 .delete_operation(self.0.request, self.0.options)
5102 .await
5103 .map(gax::response::Response::into_body)
5104 }
5105
5106 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5108 self.0.request.name = v.into();
5109 self
5110 }
5111 }
5112
5113 #[doc(hidden)]
5114 impl gax::options::internal::RequestBuilder for DeleteOperation {
5115 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5116 &mut self.0.options
5117 }
5118 }
5119
5120 #[derive(Clone, Debug)]
5138 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5139
5140 impl CancelOperation {
5141 pub(crate) fn new(
5142 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5143 ) -> Self {
5144 Self(RequestBuilder::new(stub))
5145 }
5146
5147 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5149 mut self,
5150 v: V,
5151 ) -> Self {
5152 self.0.request = v.into();
5153 self
5154 }
5155
5156 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5158 self.0.options = v.into();
5159 self
5160 }
5161
5162 pub async fn send(self) -> Result<()> {
5164 (*self.0.stub)
5165 .cancel_operation(self.0.request, self.0.options)
5166 .await
5167 .map(gax::response::Response::into_body)
5168 }
5169
5170 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5172 self.0.request.name = v.into();
5173 self
5174 }
5175 }
5176
5177 #[doc(hidden)]
5178 impl gax::options::internal::RequestBuilder for CancelOperation {
5179 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5180 &mut self.0.options
5181 }
5182 }
5183}
5184
5185pub mod hub_service {
5186 use crate::Result;
5187
5188 pub type ClientBuilder =
5202 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5203
5204 pub(crate) mod client {
5205 use super::super::super::client::HubService;
5206 pub struct Factory;
5207 impl gax::client_builder::internal::ClientFactory for Factory {
5208 type Client = HubService;
5209 type Credentials = gaxi::options::Credentials;
5210 async fn build(
5211 self,
5212 config: gaxi::options::ClientConfig,
5213 ) -> gax::client_builder::Result<Self::Client> {
5214 Self::Client::new(config).await
5215 }
5216 }
5217 }
5218
5219 #[derive(Clone, Debug)]
5221 pub(crate) struct RequestBuilder<R: std::default::Default> {
5222 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5223 request: R,
5224 options: gax::options::RequestOptions,
5225 }
5226
5227 impl<R> RequestBuilder<R>
5228 where
5229 R: std::default::Default,
5230 {
5231 pub(crate) fn new(
5232 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5233 ) -> Self {
5234 Self {
5235 stub,
5236 request: R::default(),
5237 options: gax::options::RequestOptions::default(),
5238 }
5239 }
5240 }
5241
5242 #[derive(Clone, Debug)]
5264 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5265
5266 impl ListHubs {
5267 pub(crate) fn new(
5268 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5269 ) -> Self {
5270 Self(RequestBuilder::new(stub))
5271 }
5272
5273 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5275 self.0.request = v.into();
5276 self
5277 }
5278
5279 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5281 self.0.options = v.into();
5282 self
5283 }
5284
5285 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5287 (*self.0.stub)
5288 .list_hubs(self.0.request, self.0.options)
5289 .await
5290 .map(gax::response::Response::into_body)
5291 }
5292
5293 pub fn by_page(
5295 self,
5296 ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
5297 {
5298 use std::clone::Clone;
5299 let token = self.0.request.page_token.clone();
5300 let execute = move |token: String| {
5301 let mut builder = self.clone();
5302 builder.0.request = builder.0.request.set_page_token(token);
5303 builder.send()
5304 };
5305 gax::paginator::internal::new_paginator(token, execute)
5306 }
5307
5308 pub fn by_item(
5310 self,
5311 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubsResponse, gax::error::Error>
5312 {
5313 use gax::paginator::Paginator;
5314 self.by_page().items()
5315 }
5316
5317 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5321 self.0.request.parent = v.into();
5322 self
5323 }
5324
5325 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5327 self.0.request.page_size = v.into();
5328 self
5329 }
5330
5331 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5333 self.0.request.page_token = v.into();
5334 self
5335 }
5336
5337 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5339 self.0.request.filter = v.into();
5340 self
5341 }
5342
5343 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5345 self.0.request.order_by = v.into();
5346 self
5347 }
5348 }
5349
5350 #[doc(hidden)]
5351 impl gax::options::internal::RequestBuilder for ListHubs {
5352 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5353 &mut self.0.options
5354 }
5355 }
5356
5357 #[derive(Clone, Debug)]
5375 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5376
5377 impl GetHub {
5378 pub(crate) fn new(
5379 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5380 ) -> Self {
5381 Self(RequestBuilder::new(stub))
5382 }
5383
5384 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5386 self.0.request = v.into();
5387 self
5388 }
5389
5390 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5392 self.0.options = v.into();
5393 self
5394 }
5395
5396 pub async fn send(self) -> Result<crate::model::Hub> {
5398 (*self.0.stub)
5399 .get_hub(self.0.request, self.0.options)
5400 .await
5401 .map(gax::response::Response::into_body)
5402 }
5403
5404 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5408 self.0.request.name = v.into();
5409 self
5410 }
5411 }
5412
5413 #[doc(hidden)]
5414 impl gax::options::internal::RequestBuilder for GetHub {
5415 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5416 &mut self.0.options
5417 }
5418 }
5419
5420 #[derive(Clone, Debug)]
5439 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5440
5441 impl CreateHub {
5442 pub(crate) fn new(
5443 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5444 ) -> Self {
5445 Self(RequestBuilder::new(stub))
5446 }
5447
5448 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5450 self.0.request = v.into();
5451 self
5452 }
5453
5454 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5456 self.0.options = v.into();
5457 self
5458 }
5459
5460 pub async fn send(self) -> Result<longrunning::model::Operation> {
5467 (*self.0.stub)
5468 .create_hub(self.0.request, self.0.options)
5469 .await
5470 .map(gax::response::Response::into_body)
5471 }
5472
5473 pub fn poller(
5475 self,
5476 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5477 type Operation =
5478 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5479 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5480 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5481
5482 let stub = self.0.stub.clone();
5483 let mut options = self.0.options.clone();
5484 options.set_retry_policy(gax::retry_policy::NeverRetry);
5485 let query = move |name| {
5486 let stub = stub.clone();
5487 let options = options.clone();
5488 async {
5489 let op = GetOperation::new(stub)
5490 .set_name(name)
5491 .with_options(options)
5492 .send()
5493 .await?;
5494 Ok(Operation::new(op))
5495 }
5496 };
5497
5498 let start = move || async {
5499 let op = self.send().await?;
5500 Ok(Operation::new(op))
5501 };
5502
5503 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5504 }
5505
5506 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5510 self.0.request.parent = v.into();
5511 self
5512 }
5513
5514 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5518 self.0.request.hub_id = v.into();
5519 self
5520 }
5521
5522 pub fn set_hub<T>(mut self, v: T) -> Self
5526 where
5527 T: std::convert::Into<crate::model::Hub>,
5528 {
5529 self.0.request.hub = std::option::Option::Some(v.into());
5530 self
5531 }
5532
5533 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5537 where
5538 T: std::convert::Into<crate::model::Hub>,
5539 {
5540 self.0.request.hub = v.map(|x| x.into());
5541 self
5542 }
5543
5544 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5546 self.0.request.request_id = v.into();
5547 self
5548 }
5549 }
5550
5551 #[doc(hidden)]
5552 impl gax::options::internal::RequestBuilder for CreateHub {
5553 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5554 &mut self.0.options
5555 }
5556 }
5557
5558 #[derive(Clone, Debug)]
5577 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5578
5579 impl UpdateHub {
5580 pub(crate) fn new(
5581 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5582 ) -> Self {
5583 Self(RequestBuilder::new(stub))
5584 }
5585
5586 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5588 self.0.request = v.into();
5589 self
5590 }
5591
5592 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5594 self.0.options = v.into();
5595 self
5596 }
5597
5598 pub async fn send(self) -> Result<longrunning::model::Operation> {
5605 (*self.0.stub)
5606 .update_hub(self.0.request, self.0.options)
5607 .await
5608 .map(gax::response::Response::into_body)
5609 }
5610
5611 pub fn poller(
5613 self,
5614 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5615 type Operation =
5616 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5617 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5618 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5619
5620 let stub = self.0.stub.clone();
5621 let mut options = self.0.options.clone();
5622 options.set_retry_policy(gax::retry_policy::NeverRetry);
5623 let query = move |name| {
5624 let stub = stub.clone();
5625 let options = options.clone();
5626 async {
5627 let op = GetOperation::new(stub)
5628 .set_name(name)
5629 .with_options(options)
5630 .send()
5631 .await?;
5632 Ok(Operation::new(op))
5633 }
5634 };
5635
5636 let start = move || async {
5637 let op = self.send().await?;
5638 Ok(Operation::new(op))
5639 };
5640
5641 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5642 }
5643
5644 pub fn set_update_mask<T>(mut self, v: T) -> Self
5646 where
5647 T: std::convert::Into<wkt::FieldMask>,
5648 {
5649 self.0.request.update_mask = std::option::Option::Some(v.into());
5650 self
5651 }
5652
5653 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5655 where
5656 T: std::convert::Into<wkt::FieldMask>,
5657 {
5658 self.0.request.update_mask = v.map(|x| x.into());
5659 self
5660 }
5661
5662 pub fn set_hub<T>(mut self, v: T) -> Self
5666 where
5667 T: std::convert::Into<crate::model::Hub>,
5668 {
5669 self.0.request.hub = std::option::Option::Some(v.into());
5670 self
5671 }
5672
5673 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5677 where
5678 T: std::convert::Into<crate::model::Hub>,
5679 {
5680 self.0.request.hub = v.map(|x| x.into());
5681 self
5682 }
5683
5684 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5686 self.0.request.request_id = v.into();
5687 self
5688 }
5689 }
5690
5691 #[doc(hidden)]
5692 impl gax::options::internal::RequestBuilder for UpdateHub {
5693 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5694 &mut self.0.options
5695 }
5696 }
5697
5698 #[derive(Clone, Debug)]
5717 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5718
5719 impl DeleteHub {
5720 pub(crate) fn new(
5721 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5722 ) -> Self {
5723 Self(RequestBuilder::new(stub))
5724 }
5725
5726 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5728 self.0.request = v.into();
5729 self
5730 }
5731
5732 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5734 self.0.options = v.into();
5735 self
5736 }
5737
5738 pub async fn send(self) -> Result<longrunning::model::Operation> {
5745 (*self.0.stub)
5746 .delete_hub(self.0.request, self.0.options)
5747 .await
5748 .map(gax::response::Response::into_body)
5749 }
5750
5751 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5753 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5754 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5755 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5756
5757 let stub = self.0.stub.clone();
5758 let mut options = self.0.options.clone();
5759 options.set_retry_policy(gax::retry_policy::NeverRetry);
5760 let query = move |name| {
5761 let stub = stub.clone();
5762 let options = options.clone();
5763 async {
5764 let op = GetOperation::new(stub)
5765 .set_name(name)
5766 .with_options(options)
5767 .send()
5768 .await?;
5769 Ok(Operation::new(op))
5770 }
5771 };
5772
5773 let start = move || async {
5774 let op = self.send().await?;
5775 Ok(Operation::new(op))
5776 };
5777
5778 lro::internal::new_unit_response_poller(
5779 polling_error_policy,
5780 polling_backoff_policy,
5781 start,
5782 query,
5783 )
5784 }
5785
5786 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5790 self.0.request.name = v.into();
5791 self
5792 }
5793
5794 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5796 self.0.request.request_id = v.into();
5797 self
5798 }
5799 }
5800
5801 #[doc(hidden)]
5802 impl gax::options::internal::RequestBuilder for DeleteHub {
5803 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5804 &mut self.0.options
5805 }
5806 }
5807
5808 #[derive(Clone, Debug)]
5830 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5831
5832 impl ListHubSpokes {
5833 pub(crate) fn new(
5834 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5835 ) -> Self {
5836 Self(RequestBuilder::new(stub))
5837 }
5838
5839 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5841 self.0.request = v.into();
5842 self
5843 }
5844
5845 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5847 self.0.options = v.into();
5848 self
5849 }
5850
5851 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5853 (*self.0.stub)
5854 .list_hub_spokes(self.0.request, self.0.options)
5855 .await
5856 .map(gax::response::Response::into_body)
5857 }
5858
5859 pub fn by_page(
5861 self,
5862 ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5863 {
5864 use std::clone::Clone;
5865 let token = self.0.request.page_token.clone();
5866 let execute = move |token: String| {
5867 let mut builder = self.clone();
5868 builder.0.request = builder.0.request.set_page_token(token);
5869 builder.send()
5870 };
5871 gax::paginator::internal::new_paginator(token, execute)
5872 }
5873
5874 pub fn by_item(
5876 self,
5877 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5878 {
5879 use gax::paginator::Paginator;
5880 self.by_page().items()
5881 }
5882
5883 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5887 self.0.request.name = v.into();
5888 self
5889 }
5890
5891 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5893 where
5894 T: std::iter::IntoIterator<Item = V>,
5895 V: std::convert::Into<std::string::String>,
5896 {
5897 use std::iter::Iterator;
5898 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5899 self
5900 }
5901
5902 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5904 self.0.request.page_size = v.into();
5905 self
5906 }
5907
5908 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5910 self.0.request.page_token = v.into();
5911 self
5912 }
5913
5914 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5916 self.0.request.filter = v.into();
5917 self
5918 }
5919
5920 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5922 self.0.request.order_by = v.into();
5923 self
5924 }
5925
5926 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
5928 mut self,
5929 v: T,
5930 ) -> Self {
5931 self.0.request.view = v.into();
5932 self
5933 }
5934 }
5935
5936 #[doc(hidden)]
5937 impl gax::options::internal::RequestBuilder for ListHubSpokes {
5938 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5939 &mut self.0.options
5940 }
5941 }
5942
5943 #[derive(Clone, Debug)]
5965 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
5966
5967 impl QueryHubStatus {
5968 pub(crate) fn new(
5969 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5970 ) -> Self {
5971 Self(RequestBuilder::new(stub))
5972 }
5973
5974 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
5976 self.0.request = v.into();
5977 self
5978 }
5979
5980 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5982 self.0.options = v.into();
5983 self
5984 }
5985
5986 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
5988 (*self.0.stub)
5989 .query_hub_status(self.0.request, self.0.options)
5990 .await
5991 .map(gax::response::Response::into_body)
5992 }
5993
5994 pub fn by_page(
5996 self,
5997 ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
5998 {
5999 use std::clone::Clone;
6000 let token = self.0.request.page_token.clone();
6001 let execute = move |token: String| {
6002 let mut builder = self.clone();
6003 builder.0.request = builder.0.request.set_page_token(token);
6004 builder.send()
6005 };
6006 gax::paginator::internal::new_paginator(token, execute)
6007 }
6008
6009 pub fn by_item(
6011 self,
6012 ) -> impl gax::paginator::ItemPaginator<crate::model::QueryHubStatusResponse, gax::error::Error>
6013 {
6014 use gax::paginator::Paginator;
6015 self.by_page().items()
6016 }
6017
6018 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6022 self.0.request.name = v.into();
6023 self
6024 }
6025
6026 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6028 self.0.request.page_size = v.into();
6029 self
6030 }
6031
6032 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6034 self.0.request.page_token = v.into();
6035 self
6036 }
6037
6038 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6040 self.0.request.filter = v.into();
6041 self
6042 }
6043
6044 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6046 self.0.request.order_by = v.into();
6047 self
6048 }
6049
6050 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6052 self.0.request.group_by = v.into();
6053 self
6054 }
6055 }
6056
6057 #[doc(hidden)]
6058 impl gax::options::internal::RequestBuilder for QueryHubStatus {
6059 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6060 &mut self.0.options
6061 }
6062 }
6063
6064 #[derive(Clone, Debug)]
6086 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6087
6088 impl ListSpokes {
6089 pub(crate) fn new(
6090 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6091 ) -> Self {
6092 Self(RequestBuilder::new(stub))
6093 }
6094
6095 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6097 self.0.request = v.into();
6098 self
6099 }
6100
6101 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6103 self.0.options = v.into();
6104 self
6105 }
6106
6107 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6109 (*self.0.stub)
6110 .list_spokes(self.0.request, self.0.options)
6111 .await
6112 .map(gax::response::Response::into_body)
6113 }
6114
6115 pub fn by_page(
6117 self,
6118 ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
6119 {
6120 use std::clone::Clone;
6121 let token = self.0.request.page_token.clone();
6122 let execute = move |token: String| {
6123 let mut builder = self.clone();
6124 builder.0.request = builder.0.request.set_page_token(token);
6125 builder.send()
6126 };
6127 gax::paginator::internal::new_paginator(token, execute)
6128 }
6129
6130 pub fn by_item(
6132 self,
6133 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpokesResponse, gax::error::Error>
6134 {
6135 use gax::paginator::Paginator;
6136 self.by_page().items()
6137 }
6138
6139 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6143 self.0.request.parent = v.into();
6144 self
6145 }
6146
6147 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6149 self.0.request.page_size = v.into();
6150 self
6151 }
6152
6153 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6155 self.0.request.page_token = v.into();
6156 self
6157 }
6158
6159 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6161 self.0.request.filter = v.into();
6162 self
6163 }
6164
6165 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6167 self.0.request.order_by = v.into();
6168 self
6169 }
6170 }
6171
6172 #[doc(hidden)]
6173 impl gax::options::internal::RequestBuilder for ListSpokes {
6174 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6175 &mut self.0.options
6176 }
6177 }
6178
6179 #[derive(Clone, Debug)]
6197 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6198
6199 impl GetSpoke {
6200 pub(crate) fn new(
6201 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6202 ) -> Self {
6203 Self(RequestBuilder::new(stub))
6204 }
6205
6206 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6208 self.0.request = v.into();
6209 self
6210 }
6211
6212 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6214 self.0.options = v.into();
6215 self
6216 }
6217
6218 pub async fn send(self) -> Result<crate::model::Spoke> {
6220 (*self.0.stub)
6221 .get_spoke(self.0.request, self.0.options)
6222 .await
6223 .map(gax::response::Response::into_body)
6224 }
6225
6226 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6230 self.0.request.name = v.into();
6231 self
6232 }
6233 }
6234
6235 #[doc(hidden)]
6236 impl gax::options::internal::RequestBuilder for GetSpoke {
6237 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6238 &mut self.0.options
6239 }
6240 }
6241
6242 #[derive(Clone, Debug)]
6261 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6262
6263 impl CreateSpoke {
6264 pub(crate) fn new(
6265 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6266 ) -> Self {
6267 Self(RequestBuilder::new(stub))
6268 }
6269
6270 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6272 self.0.request = v.into();
6273 self
6274 }
6275
6276 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6278 self.0.options = v.into();
6279 self
6280 }
6281
6282 pub async fn send(self) -> Result<longrunning::model::Operation> {
6289 (*self.0.stub)
6290 .create_spoke(self.0.request, self.0.options)
6291 .await
6292 .map(gax::response::Response::into_body)
6293 }
6294
6295 pub fn poller(
6297 self,
6298 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6299 type Operation =
6300 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6301 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6302 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6303
6304 let stub = self.0.stub.clone();
6305 let mut options = self.0.options.clone();
6306 options.set_retry_policy(gax::retry_policy::NeverRetry);
6307 let query = move |name| {
6308 let stub = stub.clone();
6309 let options = options.clone();
6310 async {
6311 let op = GetOperation::new(stub)
6312 .set_name(name)
6313 .with_options(options)
6314 .send()
6315 .await?;
6316 Ok(Operation::new(op))
6317 }
6318 };
6319
6320 let start = move || async {
6321 let op = self.send().await?;
6322 Ok(Operation::new(op))
6323 };
6324
6325 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6326 }
6327
6328 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6332 self.0.request.parent = v.into();
6333 self
6334 }
6335
6336 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6340 self.0.request.spoke_id = v.into();
6341 self
6342 }
6343
6344 pub fn set_spoke<T>(mut self, v: T) -> Self
6348 where
6349 T: std::convert::Into<crate::model::Spoke>,
6350 {
6351 self.0.request.spoke = std::option::Option::Some(v.into());
6352 self
6353 }
6354
6355 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6359 where
6360 T: std::convert::Into<crate::model::Spoke>,
6361 {
6362 self.0.request.spoke = v.map(|x| x.into());
6363 self
6364 }
6365
6366 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6368 self.0.request.request_id = v.into();
6369 self
6370 }
6371 }
6372
6373 #[doc(hidden)]
6374 impl gax::options::internal::RequestBuilder for CreateSpoke {
6375 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6376 &mut self.0.options
6377 }
6378 }
6379
6380 #[derive(Clone, Debug)]
6399 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6400
6401 impl UpdateSpoke {
6402 pub(crate) fn new(
6403 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6404 ) -> Self {
6405 Self(RequestBuilder::new(stub))
6406 }
6407
6408 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6410 self.0.request = v.into();
6411 self
6412 }
6413
6414 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6416 self.0.options = v.into();
6417 self
6418 }
6419
6420 pub async fn send(self) -> Result<longrunning::model::Operation> {
6427 (*self.0.stub)
6428 .update_spoke(self.0.request, self.0.options)
6429 .await
6430 .map(gax::response::Response::into_body)
6431 }
6432
6433 pub fn poller(
6435 self,
6436 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6437 type Operation =
6438 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6439 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6440 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6441
6442 let stub = self.0.stub.clone();
6443 let mut options = self.0.options.clone();
6444 options.set_retry_policy(gax::retry_policy::NeverRetry);
6445 let query = move |name| {
6446 let stub = stub.clone();
6447 let options = options.clone();
6448 async {
6449 let op = GetOperation::new(stub)
6450 .set_name(name)
6451 .with_options(options)
6452 .send()
6453 .await?;
6454 Ok(Operation::new(op))
6455 }
6456 };
6457
6458 let start = move || async {
6459 let op = self.send().await?;
6460 Ok(Operation::new(op))
6461 };
6462
6463 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6464 }
6465
6466 pub fn set_update_mask<T>(mut self, v: T) -> Self
6468 where
6469 T: std::convert::Into<wkt::FieldMask>,
6470 {
6471 self.0.request.update_mask = std::option::Option::Some(v.into());
6472 self
6473 }
6474
6475 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6477 where
6478 T: std::convert::Into<wkt::FieldMask>,
6479 {
6480 self.0.request.update_mask = v.map(|x| x.into());
6481 self
6482 }
6483
6484 pub fn set_spoke<T>(mut self, v: T) -> Self
6488 where
6489 T: std::convert::Into<crate::model::Spoke>,
6490 {
6491 self.0.request.spoke = std::option::Option::Some(v.into());
6492 self
6493 }
6494
6495 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6499 where
6500 T: std::convert::Into<crate::model::Spoke>,
6501 {
6502 self.0.request.spoke = v.map(|x| x.into());
6503 self
6504 }
6505
6506 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6508 self.0.request.request_id = v.into();
6509 self
6510 }
6511 }
6512
6513 #[doc(hidden)]
6514 impl gax::options::internal::RequestBuilder for UpdateSpoke {
6515 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6516 &mut self.0.options
6517 }
6518 }
6519
6520 #[derive(Clone, Debug)]
6539 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6540
6541 impl RejectHubSpoke {
6542 pub(crate) fn new(
6543 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6544 ) -> Self {
6545 Self(RequestBuilder::new(stub))
6546 }
6547
6548 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6550 self.0.request = v.into();
6551 self
6552 }
6553
6554 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6556 self.0.options = v.into();
6557 self
6558 }
6559
6560 pub async fn send(self) -> Result<longrunning::model::Operation> {
6567 (*self.0.stub)
6568 .reject_hub_spoke(self.0.request, self.0.options)
6569 .await
6570 .map(gax::response::Response::into_body)
6571 }
6572
6573 pub fn poller(
6575 self,
6576 ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
6577 {
6578 type Operation = lro::internal::Operation<
6579 crate::model::RejectHubSpokeResponse,
6580 crate::model::OperationMetadata,
6581 >;
6582 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6583 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6584
6585 let stub = self.0.stub.clone();
6586 let mut options = self.0.options.clone();
6587 options.set_retry_policy(gax::retry_policy::NeverRetry);
6588 let query = move |name| {
6589 let stub = stub.clone();
6590 let options = options.clone();
6591 async {
6592 let op = GetOperation::new(stub)
6593 .set_name(name)
6594 .with_options(options)
6595 .send()
6596 .await?;
6597 Ok(Operation::new(op))
6598 }
6599 };
6600
6601 let start = move || async {
6602 let op = self.send().await?;
6603 Ok(Operation::new(op))
6604 };
6605
6606 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6607 }
6608
6609 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6613 self.0.request.name = v.into();
6614 self
6615 }
6616
6617 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6621 self.0.request.spoke_uri = v.into();
6622 self
6623 }
6624
6625 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6627 self.0.request.request_id = v.into();
6628 self
6629 }
6630
6631 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6633 self.0.request.details = v.into();
6634 self
6635 }
6636 }
6637
6638 #[doc(hidden)]
6639 impl gax::options::internal::RequestBuilder for RejectHubSpoke {
6640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6641 &mut self.0.options
6642 }
6643 }
6644
6645 #[derive(Clone, Debug)]
6664 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6665
6666 impl AcceptHubSpoke {
6667 pub(crate) fn new(
6668 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6669 ) -> Self {
6670 Self(RequestBuilder::new(stub))
6671 }
6672
6673 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6675 self.0.request = v.into();
6676 self
6677 }
6678
6679 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6681 self.0.options = v.into();
6682 self
6683 }
6684
6685 pub async fn send(self) -> Result<longrunning::model::Operation> {
6692 (*self.0.stub)
6693 .accept_hub_spoke(self.0.request, self.0.options)
6694 .await
6695 .map(gax::response::Response::into_body)
6696 }
6697
6698 pub fn poller(
6700 self,
6701 ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
6702 {
6703 type Operation = lro::internal::Operation<
6704 crate::model::AcceptHubSpokeResponse,
6705 crate::model::OperationMetadata,
6706 >;
6707 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6708 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6709
6710 let stub = self.0.stub.clone();
6711 let mut options = self.0.options.clone();
6712 options.set_retry_policy(gax::retry_policy::NeverRetry);
6713 let query = move |name| {
6714 let stub = stub.clone();
6715 let options = options.clone();
6716 async {
6717 let op = GetOperation::new(stub)
6718 .set_name(name)
6719 .with_options(options)
6720 .send()
6721 .await?;
6722 Ok(Operation::new(op))
6723 }
6724 };
6725
6726 let start = move || async {
6727 let op = self.send().await?;
6728 Ok(Operation::new(op))
6729 };
6730
6731 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6732 }
6733
6734 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6738 self.0.request.name = v.into();
6739 self
6740 }
6741
6742 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6746 self.0.request.spoke_uri = v.into();
6747 self
6748 }
6749
6750 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6752 self.0.request.request_id = v.into();
6753 self
6754 }
6755 }
6756
6757 #[doc(hidden)]
6758 impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
6759 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6760 &mut self.0.options
6761 }
6762 }
6763
6764 #[derive(Clone, Debug)]
6783 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6784
6785 impl AcceptSpokeUpdate {
6786 pub(crate) fn new(
6787 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6788 ) -> Self {
6789 Self(RequestBuilder::new(stub))
6790 }
6791
6792 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6794 mut self,
6795 v: V,
6796 ) -> Self {
6797 self.0.request = v.into();
6798 self
6799 }
6800
6801 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6803 self.0.options = v.into();
6804 self
6805 }
6806
6807 pub async fn send(self) -> Result<longrunning::model::Operation> {
6814 (*self.0.stub)
6815 .accept_spoke_update(self.0.request, self.0.options)
6816 .await
6817 .map(gax::response::Response::into_body)
6818 }
6819
6820 pub fn poller(
6822 self,
6823 ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
6824 {
6825 type Operation = lro::internal::Operation<
6826 crate::model::AcceptSpokeUpdateResponse,
6827 crate::model::OperationMetadata,
6828 >;
6829 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6830 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6831
6832 let stub = self.0.stub.clone();
6833 let mut options = self.0.options.clone();
6834 options.set_retry_policy(gax::retry_policy::NeverRetry);
6835 let query = move |name| {
6836 let stub = stub.clone();
6837 let options = options.clone();
6838 async {
6839 let op = GetOperation::new(stub)
6840 .set_name(name)
6841 .with_options(options)
6842 .send()
6843 .await?;
6844 Ok(Operation::new(op))
6845 }
6846 };
6847
6848 let start = move || async {
6849 let op = self.send().await?;
6850 Ok(Operation::new(op))
6851 };
6852
6853 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6854 }
6855
6856 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6860 self.0.request.name = v.into();
6861 self
6862 }
6863
6864 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6868 self.0.request.spoke_uri = v.into();
6869 self
6870 }
6871
6872 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6876 self.0.request.spoke_etag = v.into();
6877 self
6878 }
6879
6880 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6882 self.0.request.request_id = v.into();
6883 self
6884 }
6885 }
6886
6887 #[doc(hidden)]
6888 impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
6889 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6890 &mut self.0.options
6891 }
6892 }
6893
6894 #[derive(Clone, Debug)]
6913 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
6914
6915 impl RejectSpokeUpdate {
6916 pub(crate) fn new(
6917 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6918 ) -> Self {
6919 Self(RequestBuilder::new(stub))
6920 }
6921
6922 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
6924 mut self,
6925 v: V,
6926 ) -> Self {
6927 self.0.request = v.into();
6928 self
6929 }
6930
6931 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6933 self.0.options = v.into();
6934 self
6935 }
6936
6937 pub async fn send(self) -> Result<longrunning::model::Operation> {
6944 (*self.0.stub)
6945 .reject_spoke_update(self.0.request, self.0.options)
6946 .await
6947 .map(gax::response::Response::into_body)
6948 }
6949
6950 pub fn poller(
6952 self,
6953 ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
6954 {
6955 type Operation = lro::internal::Operation<
6956 crate::model::RejectSpokeUpdateResponse,
6957 crate::model::OperationMetadata,
6958 >;
6959 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6960 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6961
6962 let stub = self.0.stub.clone();
6963 let mut options = self.0.options.clone();
6964 options.set_retry_policy(gax::retry_policy::NeverRetry);
6965 let query = move |name| {
6966 let stub = stub.clone();
6967 let options = options.clone();
6968 async {
6969 let op = GetOperation::new(stub)
6970 .set_name(name)
6971 .with_options(options)
6972 .send()
6973 .await?;
6974 Ok(Operation::new(op))
6975 }
6976 };
6977
6978 let start = move || async {
6979 let op = self.send().await?;
6980 Ok(Operation::new(op))
6981 };
6982
6983 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6984 }
6985
6986 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6990 self.0.request.name = v.into();
6991 self
6992 }
6993
6994 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6998 self.0.request.spoke_uri = v.into();
6999 self
7000 }
7001
7002 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7006 self.0.request.spoke_etag = v.into();
7007 self
7008 }
7009
7010 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7012 self.0.request.details = v.into();
7013 self
7014 }
7015
7016 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7018 self.0.request.request_id = v.into();
7019 self
7020 }
7021 }
7022
7023 #[doc(hidden)]
7024 impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
7025 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7026 &mut self.0.options
7027 }
7028 }
7029
7030 #[derive(Clone, Debug)]
7049 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7050
7051 impl DeleteSpoke {
7052 pub(crate) fn new(
7053 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7054 ) -> Self {
7055 Self(RequestBuilder::new(stub))
7056 }
7057
7058 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7060 self.0.request = v.into();
7061 self
7062 }
7063
7064 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7066 self.0.options = v.into();
7067 self
7068 }
7069
7070 pub async fn send(self) -> Result<longrunning::model::Operation> {
7077 (*self.0.stub)
7078 .delete_spoke(self.0.request, self.0.options)
7079 .await
7080 .map(gax::response::Response::into_body)
7081 }
7082
7083 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
7085 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7086 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7087 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7088
7089 let stub = self.0.stub.clone();
7090 let mut options = self.0.options.clone();
7091 options.set_retry_policy(gax::retry_policy::NeverRetry);
7092 let query = move |name| {
7093 let stub = stub.clone();
7094 let options = options.clone();
7095 async {
7096 let op = GetOperation::new(stub)
7097 .set_name(name)
7098 .with_options(options)
7099 .send()
7100 .await?;
7101 Ok(Operation::new(op))
7102 }
7103 };
7104
7105 let start = move || async {
7106 let op = self.send().await?;
7107 Ok(Operation::new(op))
7108 };
7109
7110 lro::internal::new_unit_response_poller(
7111 polling_error_policy,
7112 polling_backoff_policy,
7113 start,
7114 query,
7115 )
7116 }
7117
7118 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7122 self.0.request.name = v.into();
7123 self
7124 }
7125
7126 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7128 self.0.request.request_id = v.into();
7129 self
7130 }
7131 }
7132
7133 #[doc(hidden)]
7134 impl gax::options::internal::RequestBuilder for DeleteSpoke {
7135 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7136 &mut self.0.options
7137 }
7138 }
7139
7140 #[derive(Clone, Debug)]
7158 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7159
7160 impl GetRouteTable {
7161 pub(crate) fn new(
7162 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7163 ) -> Self {
7164 Self(RequestBuilder::new(stub))
7165 }
7166
7167 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7169 self.0.request = v.into();
7170 self
7171 }
7172
7173 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7175 self.0.options = v.into();
7176 self
7177 }
7178
7179 pub async fn send(self) -> Result<crate::model::RouteTable> {
7181 (*self.0.stub)
7182 .get_route_table(self.0.request, self.0.options)
7183 .await
7184 .map(gax::response::Response::into_body)
7185 }
7186
7187 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7191 self.0.request.name = v.into();
7192 self
7193 }
7194 }
7195
7196 #[doc(hidden)]
7197 impl gax::options::internal::RequestBuilder for GetRouteTable {
7198 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7199 &mut self.0.options
7200 }
7201 }
7202
7203 #[derive(Clone, Debug)]
7221 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7222
7223 impl GetRoute {
7224 pub(crate) fn new(
7225 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7226 ) -> Self {
7227 Self(RequestBuilder::new(stub))
7228 }
7229
7230 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7232 self.0.request = v.into();
7233 self
7234 }
7235
7236 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7238 self.0.options = v.into();
7239 self
7240 }
7241
7242 pub async fn send(self) -> Result<crate::model::Route> {
7244 (*self.0.stub)
7245 .get_route(self.0.request, self.0.options)
7246 .await
7247 .map(gax::response::Response::into_body)
7248 }
7249
7250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7254 self.0.request.name = v.into();
7255 self
7256 }
7257 }
7258
7259 #[doc(hidden)]
7260 impl gax::options::internal::RequestBuilder for GetRoute {
7261 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7262 &mut self.0.options
7263 }
7264 }
7265
7266 #[derive(Clone, Debug)]
7288 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7289
7290 impl ListRoutes {
7291 pub(crate) fn new(
7292 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7293 ) -> Self {
7294 Self(RequestBuilder::new(stub))
7295 }
7296
7297 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7299 self.0.request = v.into();
7300 self
7301 }
7302
7303 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7305 self.0.options = v.into();
7306 self
7307 }
7308
7309 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7311 (*self.0.stub)
7312 .list_routes(self.0.request, self.0.options)
7313 .await
7314 .map(gax::response::Response::into_body)
7315 }
7316
7317 pub fn by_page(
7319 self,
7320 ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
7321 {
7322 use std::clone::Clone;
7323 let token = self.0.request.page_token.clone();
7324 let execute = move |token: String| {
7325 let mut builder = self.clone();
7326 builder.0.request = builder.0.request.set_page_token(token);
7327 builder.send()
7328 };
7329 gax::paginator::internal::new_paginator(token, execute)
7330 }
7331
7332 pub fn by_item(
7334 self,
7335 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
7336 {
7337 use gax::paginator::Paginator;
7338 self.by_page().items()
7339 }
7340
7341 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7345 self.0.request.parent = v.into();
7346 self
7347 }
7348
7349 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7351 self.0.request.page_size = v.into();
7352 self
7353 }
7354
7355 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7357 self.0.request.page_token = v.into();
7358 self
7359 }
7360
7361 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7363 self.0.request.filter = v.into();
7364 self
7365 }
7366
7367 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7369 self.0.request.order_by = v.into();
7370 self
7371 }
7372 }
7373
7374 #[doc(hidden)]
7375 impl gax::options::internal::RequestBuilder for ListRoutes {
7376 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7377 &mut self.0.options
7378 }
7379 }
7380
7381 #[derive(Clone, Debug)]
7403 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7404
7405 impl ListRouteTables {
7406 pub(crate) fn new(
7407 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7408 ) -> Self {
7409 Self(RequestBuilder::new(stub))
7410 }
7411
7412 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7414 self.0.request = v.into();
7415 self
7416 }
7417
7418 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7420 self.0.options = v.into();
7421 self
7422 }
7423
7424 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7426 (*self.0.stub)
7427 .list_route_tables(self.0.request, self.0.options)
7428 .await
7429 .map(gax::response::Response::into_body)
7430 }
7431
7432 pub fn by_page(
7434 self,
7435 ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7436 {
7437 use std::clone::Clone;
7438 let token = self.0.request.page_token.clone();
7439 let execute = move |token: String| {
7440 let mut builder = self.clone();
7441 builder.0.request = builder.0.request.set_page_token(token);
7442 builder.send()
7443 };
7444 gax::paginator::internal::new_paginator(token, execute)
7445 }
7446
7447 pub fn by_item(
7449 self,
7450 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7451 {
7452 use gax::paginator::Paginator;
7453 self.by_page().items()
7454 }
7455
7456 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7460 self.0.request.parent = v.into();
7461 self
7462 }
7463
7464 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7466 self.0.request.page_size = v.into();
7467 self
7468 }
7469
7470 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7472 self.0.request.page_token = v.into();
7473 self
7474 }
7475
7476 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7478 self.0.request.filter = v.into();
7479 self
7480 }
7481
7482 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7484 self.0.request.order_by = v.into();
7485 self
7486 }
7487 }
7488
7489 #[doc(hidden)]
7490 impl gax::options::internal::RequestBuilder for ListRouteTables {
7491 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7492 &mut self.0.options
7493 }
7494 }
7495
7496 #[derive(Clone, Debug)]
7514 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7515
7516 impl GetGroup {
7517 pub(crate) fn new(
7518 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7519 ) -> Self {
7520 Self(RequestBuilder::new(stub))
7521 }
7522
7523 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7525 self.0.request = v.into();
7526 self
7527 }
7528
7529 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7531 self.0.options = v.into();
7532 self
7533 }
7534
7535 pub async fn send(self) -> Result<crate::model::Group> {
7537 (*self.0.stub)
7538 .get_group(self.0.request, self.0.options)
7539 .await
7540 .map(gax::response::Response::into_body)
7541 }
7542
7543 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7547 self.0.request.name = v.into();
7548 self
7549 }
7550 }
7551
7552 #[doc(hidden)]
7553 impl gax::options::internal::RequestBuilder for GetGroup {
7554 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7555 &mut self.0.options
7556 }
7557 }
7558
7559 #[derive(Clone, Debug)]
7581 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7582
7583 impl ListGroups {
7584 pub(crate) fn new(
7585 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7586 ) -> Self {
7587 Self(RequestBuilder::new(stub))
7588 }
7589
7590 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7592 self.0.request = v.into();
7593 self
7594 }
7595
7596 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7598 self.0.options = v.into();
7599 self
7600 }
7601
7602 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7604 (*self.0.stub)
7605 .list_groups(self.0.request, self.0.options)
7606 .await
7607 .map(gax::response::Response::into_body)
7608 }
7609
7610 pub fn by_page(
7612 self,
7613 ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
7614 {
7615 use std::clone::Clone;
7616 let token = self.0.request.page_token.clone();
7617 let execute = move |token: String| {
7618 let mut builder = self.clone();
7619 builder.0.request = builder.0.request.set_page_token(token);
7620 builder.send()
7621 };
7622 gax::paginator::internal::new_paginator(token, execute)
7623 }
7624
7625 pub fn by_item(
7627 self,
7628 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGroupsResponse, gax::error::Error>
7629 {
7630 use gax::paginator::Paginator;
7631 self.by_page().items()
7632 }
7633
7634 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7638 self.0.request.parent = v.into();
7639 self
7640 }
7641
7642 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7644 self.0.request.page_size = v.into();
7645 self
7646 }
7647
7648 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7650 self.0.request.page_token = v.into();
7651 self
7652 }
7653
7654 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7656 self.0.request.filter = v.into();
7657 self
7658 }
7659
7660 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7662 self.0.request.order_by = v.into();
7663 self
7664 }
7665 }
7666
7667 #[doc(hidden)]
7668 impl gax::options::internal::RequestBuilder for ListGroups {
7669 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7670 &mut self.0.options
7671 }
7672 }
7673
7674 #[derive(Clone, Debug)]
7693 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7694
7695 impl UpdateGroup {
7696 pub(crate) fn new(
7697 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7698 ) -> Self {
7699 Self(RequestBuilder::new(stub))
7700 }
7701
7702 pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7704 self.0.request = v.into();
7705 self
7706 }
7707
7708 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7710 self.0.options = v.into();
7711 self
7712 }
7713
7714 pub async fn send(self) -> Result<longrunning::model::Operation> {
7721 (*self.0.stub)
7722 .update_group(self.0.request, self.0.options)
7723 .await
7724 .map(gax::response::Response::into_body)
7725 }
7726
7727 pub fn poller(
7729 self,
7730 ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
7731 type Operation =
7732 lro::internal::Operation<crate::model::Group, crate::model::OperationMetadata>;
7733 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7734 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7735
7736 let stub = self.0.stub.clone();
7737 let mut options = self.0.options.clone();
7738 options.set_retry_policy(gax::retry_policy::NeverRetry);
7739 let query = move |name| {
7740 let stub = stub.clone();
7741 let options = options.clone();
7742 async {
7743 let op = GetOperation::new(stub)
7744 .set_name(name)
7745 .with_options(options)
7746 .send()
7747 .await?;
7748 Ok(Operation::new(op))
7749 }
7750 };
7751
7752 let start = move || async {
7753 let op = self.send().await?;
7754 Ok(Operation::new(op))
7755 };
7756
7757 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7758 }
7759
7760 pub fn set_update_mask<T>(mut self, v: T) -> Self
7762 where
7763 T: std::convert::Into<wkt::FieldMask>,
7764 {
7765 self.0.request.update_mask = std::option::Option::Some(v.into());
7766 self
7767 }
7768
7769 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7771 where
7772 T: std::convert::Into<wkt::FieldMask>,
7773 {
7774 self.0.request.update_mask = v.map(|x| x.into());
7775 self
7776 }
7777
7778 pub fn set_group<T>(mut self, v: T) -> Self
7782 where
7783 T: std::convert::Into<crate::model::Group>,
7784 {
7785 self.0.request.group = std::option::Option::Some(v.into());
7786 self
7787 }
7788
7789 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7793 where
7794 T: std::convert::Into<crate::model::Group>,
7795 {
7796 self.0.request.group = v.map(|x| x.into());
7797 self
7798 }
7799
7800 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7802 self.0.request.request_id = v.into();
7803 self
7804 }
7805 }
7806
7807 #[doc(hidden)]
7808 impl gax::options::internal::RequestBuilder for UpdateGroup {
7809 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7810 &mut self.0.options
7811 }
7812 }
7813
7814 #[derive(Clone, Debug)]
7836 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7837
7838 impl ListLocations {
7839 pub(crate) fn new(
7840 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7841 ) -> Self {
7842 Self(RequestBuilder::new(stub))
7843 }
7844
7845 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7847 mut self,
7848 v: V,
7849 ) -> Self {
7850 self.0.request = v.into();
7851 self
7852 }
7853
7854 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7856 self.0.options = v.into();
7857 self
7858 }
7859
7860 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7862 (*self.0.stub)
7863 .list_locations(self.0.request, self.0.options)
7864 .await
7865 .map(gax::response::Response::into_body)
7866 }
7867
7868 pub fn by_page(
7870 self,
7871 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7872 {
7873 use std::clone::Clone;
7874 let token = self.0.request.page_token.clone();
7875 let execute = move |token: String| {
7876 let mut builder = self.clone();
7877 builder.0.request = builder.0.request.set_page_token(token);
7878 builder.send()
7879 };
7880 gax::paginator::internal::new_paginator(token, execute)
7881 }
7882
7883 pub fn by_item(
7885 self,
7886 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7887 {
7888 use gax::paginator::Paginator;
7889 self.by_page().items()
7890 }
7891
7892 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7894 self.0.request.name = v.into();
7895 self
7896 }
7897
7898 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7900 self.0.request.filter = v.into();
7901 self
7902 }
7903
7904 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7906 self.0.request.page_size = v.into();
7907 self
7908 }
7909
7910 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7912 self.0.request.page_token = v.into();
7913 self
7914 }
7915 }
7916
7917 #[doc(hidden)]
7918 impl gax::options::internal::RequestBuilder for ListLocations {
7919 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7920 &mut self.0.options
7921 }
7922 }
7923
7924 #[derive(Clone, Debug)]
7942 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7943
7944 impl GetLocation {
7945 pub(crate) fn new(
7946 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7947 ) -> Self {
7948 Self(RequestBuilder::new(stub))
7949 }
7950
7951 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7953 self.0.request = v.into();
7954 self
7955 }
7956
7957 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7959 self.0.options = v.into();
7960 self
7961 }
7962
7963 pub async fn send(self) -> Result<location::model::Location> {
7965 (*self.0.stub)
7966 .get_location(self.0.request, self.0.options)
7967 .await
7968 .map(gax::response::Response::into_body)
7969 }
7970
7971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7973 self.0.request.name = v.into();
7974 self
7975 }
7976 }
7977
7978 #[doc(hidden)]
7979 impl gax::options::internal::RequestBuilder for GetLocation {
7980 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7981 &mut self.0.options
7982 }
7983 }
7984
7985 #[derive(Clone, Debug)]
8003 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
8004
8005 impl SetIamPolicy {
8006 pub(crate) fn new(
8007 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8008 ) -> Self {
8009 Self(RequestBuilder::new(stub))
8010 }
8011
8012 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
8014 self.0.request = v.into();
8015 self
8016 }
8017
8018 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8020 self.0.options = v.into();
8021 self
8022 }
8023
8024 pub async fn send(self) -> Result<iam_v1::model::Policy> {
8026 (*self.0.stub)
8027 .set_iam_policy(self.0.request, self.0.options)
8028 .await
8029 .map(gax::response::Response::into_body)
8030 }
8031
8032 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8036 self.0.request.resource = v.into();
8037 self
8038 }
8039
8040 pub fn set_policy<T>(mut self, v: T) -> Self
8044 where
8045 T: std::convert::Into<iam_v1::model::Policy>,
8046 {
8047 self.0.request.policy = std::option::Option::Some(v.into());
8048 self
8049 }
8050
8051 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8055 where
8056 T: std::convert::Into<iam_v1::model::Policy>,
8057 {
8058 self.0.request.policy = v.map(|x| x.into());
8059 self
8060 }
8061
8062 pub fn set_update_mask<T>(mut self, v: T) -> Self
8064 where
8065 T: std::convert::Into<wkt::FieldMask>,
8066 {
8067 self.0.request.update_mask = std::option::Option::Some(v.into());
8068 self
8069 }
8070
8071 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8073 where
8074 T: std::convert::Into<wkt::FieldMask>,
8075 {
8076 self.0.request.update_mask = v.map(|x| x.into());
8077 self
8078 }
8079 }
8080
8081 #[doc(hidden)]
8082 impl gax::options::internal::RequestBuilder for SetIamPolicy {
8083 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8084 &mut self.0.options
8085 }
8086 }
8087
8088 #[derive(Clone, Debug)]
8106 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
8107
8108 impl GetIamPolicy {
8109 pub(crate) fn new(
8110 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8111 ) -> Self {
8112 Self(RequestBuilder::new(stub))
8113 }
8114
8115 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
8117 self.0.request = v.into();
8118 self
8119 }
8120
8121 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8123 self.0.options = v.into();
8124 self
8125 }
8126
8127 pub async fn send(self) -> Result<iam_v1::model::Policy> {
8129 (*self.0.stub)
8130 .get_iam_policy(self.0.request, self.0.options)
8131 .await
8132 .map(gax::response::Response::into_body)
8133 }
8134
8135 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8139 self.0.request.resource = v.into();
8140 self
8141 }
8142
8143 pub fn set_options<T>(mut self, v: T) -> Self
8145 where
8146 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8147 {
8148 self.0.request.options = std::option::Option::Some(v.into());
8149 self
8150 }
8151
8152 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8154 where
8155 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8156 {
8157 self.0.request.options = v.map(|x| x.into());
8158 self
8159 }
8160 }
8161
8162 #[doc(hidden)]
8163 impl gax::options::internal::RequestBuilder for GetIamPolicy {
8164 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8165 &mut self.0.options
8166 }
8167 }
8168
8169 #[derive(Clone, Debug)]
8187 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8188
8189 impl TestIamPermissions {
8190 pub(crate) fn new(
8191 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8192 ) -> Self {
8193 Self(RequestBuilder::new(stub))
8194 }
8195
8196 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8198 mut self,
8199 v: V,
8200 ) -> Self {
8201 self.0.request = v.into();
8202 self
8203 }
8204
8205 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8207 self.0.options = v.into();
8208 self
8209 }
8210
8211 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8213 (*self.0.stub)
8214 .test_iam_permissions(self.0.request, self.0.options)
8215 .await
8216 .map(gax::response::Response::into_body)
8217 }
8218
8219 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8223 self.0.request.resource = v.into();
8224 self
8225 }
8226
8227 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8231 where
8232 T: std::iter::IntoIterator<Item = V>,
8233 V: std::convert::Into<std::string::String>,
8234 {
8235 use std::iter::Iterator;
8236 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8237 self
8238 }
8239 }
8240
8241 #[doc(hidden)]
8242 impl gax::options::internal::RequestBuilder for TestIamPermissions {
8243 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8244 &mut self.0.options
8245 }
8246 }
8247
8248 #[derive(Clone, Debug)]
8270 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8271
8272 impl ListOperations {
8273 pub(crate) fn new(
8274 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8275 ) -> Self {
8276 Self(RequestBuilder::new(stub))
8277 }
8278
8279 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8281 mut self,
8282 v: V,
8283 ) -> Self {
8284 self.0.request = v.into();
8285 self
8286 }
8287
8288 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8290 self.0.options = v.into();
8291 self
8292 }
8293
8294 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8296 (*self.0.stub)
8297 .list_operations(self.0.request, self.0.options)
8298 .await
8299 .map(gax::response::Response::into_body)
8300 }
8301
8302 pub fn by_page(
8304 self,
8305 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8306 {
8307 use std::clone::Clone;
8308 let token = self.0.request.page_token.clone();
8309 let execute = move |token: String| {
8310 let mut builder = self.clone();
8311 builder.0.request = builder.0.request.set_page_token(token);
8312 builder.send()
8313 };
8314 gax::paginator::internal::new_paginator(token, execute)
8315 }
8316
8317 pub fn by_item(
8319 self,
8320 ) -> impl gax::paginator::ItemPaginator<
8321 longrunning::model::ListOperationsResponse,
8322 gax::error::Error,
8323 > {
8324 use gax::paginator::Paginator;
8325 self.by_page().items()
8326 }
8327
8328 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8330 self.0.request.name = v.into();
8331 self
8332 }
8333
8334 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8336 self.0.request.filter = v.into();
8337 self
8338 }
8339
8340 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8342 self.0.request.page_size = v.into();
8343 self
8344 }
8345
8346 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8348 self.0.request.page_token = v.into();
8349 self
8350 }
8351 }
8352
8353 #[doc(hidden)]
8354 impl gax::options::internal::RequestBuilder for ListOperations {
8355 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8356 &mut self.0.options
8357 }
8358 }
8359
8360 #[derive(Clone, Debug)]
8378 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8379
8380 impl GetOperation {
8381 pub(crate) fn new(
8382 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8383 ) -> Self {
8384 Self(RequestBuilder::new(stub))
8385 }
8386
8387 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8389 mut self,
8390 v: V,
8391 ) -> Self {
8392 self.0.request = v.into();
8393 self
8394 }
8395
8396 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8398 self.0.options = v.into();
8399 self
8400 }
8401
8402 pub async fn send(self) -> Result<longrunning::model::Operation> {
8404 (*self.0.stub)
8405 .get_operation(self.0.request, self.0.options)
8406 .await
8407 .map(gax::response::Response::into_body)
8408 }
8409
8410 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8412 self.0.request.name = v.into();
8413 self
8414 }
8415 }
8416
8417 #[doc(hidden)]
8418 impl gax::options::internal::RequestBuilder for GetOperation {
8419 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8420 &mut self.0.options
8421 }
8422 }
8423
8424 #[derive(Clone, Debug)]
8442 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8443
8444 impl DeleteOperation {
8445 pub(crate) fn new(
8446 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8447 ) -> Self {
8448 Self(RequestBuilder::new(stub))
8449 }
8450
8451 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8453 mut self,
8454 v: V,
8455 ) -> Self {
8456 self.0.request = v.into();
8457 self
8458 }
8459
8460 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8462 self.0.options = v.into();
8463 self
8464 }
8465
8466 pub async fn send(self) -> Result<()> {
8468 (*self.0.stub)
8469 .delete_operation(self.0.request, self.0.options)
8470 .await
8471 .map(gax::response::Response::into_body)
8472 }
8473
8474 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8476 self.0.request.name = v.into();
8477 self
8478 }
8479 }
8480
8481 #[doc(hidden)]
8482 impl gax::options::internal::RequestBuilder for DeleteOperation {
8483 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8484 &mut self.0.options
8485 }
8486 }
8487
8488 #[derive(Clone, Debug)]
8506 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8507
8508 impl CancelOperation {
8509 pub(crate) fn new(
8510 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8511 ) -> Self {
8512 Self(RequestBuilder::new(stub))
8513 }
8514
8515 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8517 mut self,
8518 v: V,
8519 ) -> Self {
8520 self.0.request = v.into();
8521 self
8522 }
8523
8524 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8526 self.0.options = v.into();
8527 self
8528 }
8529
8530 pub async fn send(self) -> Result<()> {
8532 (*self.0.stub)
8533 .cancel_operation(self.0.request, self.0.options)
8534 .await
8535 .map(gax::response::Response::into_body)
8536 }
8537
8538 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8540 self.0.request.name = v.into();
8541 self
8542 }
8543 }
8544
8545 #[doc(hidden)]
8546 impl gax::options::internal::RequestBuilder for CancelOperation {
8547 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8548 &mut self.0.options
8549 }
8550 }
8551}
8552
8553pub mod internal_range_service {
8554 use crate::Result;
8555
8556 pub type ClientBuilder =
8570 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8571
8572 pub(crate) mod client {
8573 use super::super::super::client::InternalRangeService;
8574 pub struct Factory;
8575 impl gax::client_builder::internal::ClientFactory for Factory {
8576 type Client = InternalRangeService;
8577 type Credentials = gaxi::options::Credentials;
8578 async fn build(
8579 self,
8580 config: gaxi::options::ClientConfig,
8581 ) -> gax::client_builder::Result<Self::Client> {
8582 Self::Client::new(config).await
8583 }
8584 }
8585 }
8586
8587 #[derive(Clone, Debug)]
8589 pub(crate) struct RequestBuilder<R: std::default::Default> {
8590 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8591 request: R,
8592 options: gax::options::RequestOptions,
8593 }
8594
8595 impl<R> RequestBuilder<R>
8596 where
8597 R: std::default::Default,
8598 {
8599 pub(crate) fn new(
8600 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8601 ) -> Self {
8602 Self {
8603 stub,
8604 request: R::default(),
8605 options: gax::options::RequestOptions::default(),
8606 }
8607 }
8608 }
8609
8610 #[derive(Clone, Debug)]
8632 pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8633
8634 impl ListInternalRanges {
8635 pub(crate) fn new(
8636 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8637 ) -> Self {
8638 Self(RequestBuilder::new(stub))
8639 }
8640
8641 pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8643 mut self,
8644 v: V,
8645 ) -> Self {
8646 self.0.request = v.into();
8647 self
8648 }
8649
8650 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8652 self.0.options = v.into();
8653 self
8654 }
8655
8656 pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8658 (*self.0.stub)
8659 .list_internal_ranges(self.0.request, self.0.options)
8660 .await
8661 .map(gax::response::Response::into_body)
8662 }
8663
8664 pub fn by_page(
8666 self,
8667 ) -> impl gax::paginator::Paginator<crate::model::ListInternalRangesResponse, gax::error::Error>
8668 {
8669 use std::clone::Clone;
8670 let token = self.0.request.page_token.clone();
8671 let execute = move |token: String| {
8672 let mut builder = self.clone();
8673 builder.0.request = builder.0.request.set_page_token(token);
8674 builder.send()
8675 };
8676 gax::paginator::internal::new_paginator(token, execute)
8677 }
8678
8679 pub fn by_item(
8681 self,
8682 ) -> impl gax::paginator::ItemPaginator<
8683 crate::model::ListInternalRangesResponse,
8684 gax::error::Error,
8685 > {
8686 use gax::paginator::Paginator;
8687 self.by_page().items()
8688 }
8689
8690 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8694 self.0.request.parent = v.into();
8695 self
8696 }
8697
8698 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8700 self.0.request.page_size = v.into();
8701 self
8702 }
8703
8704 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8706 self.0.request.page_token = v.into();
8707 self
8708 }
8709
8710 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712 self.0.request.filter = v.into();
8713 self
8714 }
8715
8716 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8718 self.0.request.order_by = v.into();
8719 self
8720 }
8721 }
8722
8723 #[doc(hidden)]
8724 impl gax::options::internal::RequestBuilder for ListInternalRanges {
8725 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8726 &mut self.0.options
8727 }
8728 }
8729
8730 #[derive(Clone, Debug)]
8748 pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8749
8750 impl GetInternalRange {
8751 pub(crate) fn new(
8752 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8753 ) -> Self {
8754 Self(RequestBuilder::new(stub))
8755 }
8756
8757 pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8759 mut self,
8760 v: V,
8761 ) -> Self {
8762 self.0.request = v.into();
8763 self
8764 }
8765
8766 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8768 self.0.options = v.into();
8769 self
8770 }
8771
8772 pub async fn send(self) -> Result<crate::model::InternalRange> {
8774 (*self.0.stub)
8775 .get_internal_range(self.0.request, self.0.options)
8776 .await
8777 .map(gax::response::Response::into_body)
8778 }
8779
8780 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8784 self.0.request.name = v.into();
8785 self
8786 }
8787 }
8788
8789 #[doc(hidden)]
8790 impl gax::options::internal::RequestBuilder for GetInternalRange {
8791 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8792 &mut self.0.options
8793 }
8794 }
8795
8796 #[derive(Clone, Debug)]
8815 pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8816
8817 impl CreateInternalRange {
8818 pub(crate) fn new(
8819 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8820 ) -> Self {
8821 Self(RequestBuilder::new(stub))
8822 }
8823
8824 pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8826 mut self,
8827 v: V,
8828 ) -> Self {
8829 self.0.request = v.into();
8830 self
8831 }
8832
8833 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8835 self.0.options = v.into();
8836 self
8837 }
8838
8839 pub async fn send(self) -> Result<longrunning::model::Operation> {
8846 (*self.0.stub)
8847 .create_internal_range(self.0.request, self.0.options)
8848 .await
8849 .map(gax::response::Response::into_body)
8850 }
8851
8852 pub fn poller(
8854 self,
8855 ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8856 {
8857 type Operation = lro::internal::Operation<
8858 crate::model::InternalRange,
8859 crate::model::OperationMetadata,
8860 >;
8861 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8862 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8863
8864 let stub = self.0.stub.clone();
8865 let mut options = self.0.options.clone();
8866 options.set_retry_policy(gax::retry_policy::NeverRetry);
8867 let query = move |name| {
8868 let stub = stub.clone();
8869 let options = options.clone();
8870 async {
8871 let op = GetOperation::new(stub)
8872 .set_name(name)
8873 .with_options(options)
8874 .send()
8875 .await?;
8876 Ok(Operation::new(op))
8877 }
8878 };
8879
8880 let start = move || async {
8881 let op = self.send().await?;
8882 Ok(Operation::new(op))
8883 };
8884
8885 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8886 }
8887
8888 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8892 self.0.request.parent = v.into();
8893 self
8894 }
8895
8896 pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8898 self.0.request.internal_range_id = v.into();
8899 self
8900 }
8901
8902 pub fn set_internal_range<T>(mut self, v: T) -> Self
8906 where
8907 T: std::convert::Into<crate::model::InternalRange>,
8908 {
8909 self.0.request.internal_range = std::option::Option::Some(v.into());
8910 self
8911 }
8912
8913 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
8917 where
8918 T: std::convert::Into<crate::model::InternalRange>,
8919 {
8920 self.0.request.internal_range = v.map(|x| x.into());
8921 self
8922 }
8923
8924 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8926 self.0.request.request_id = v.into();
8927 self
8928 }
8929 }
8930
8931 #[doc(hidden)]
8932 impl gax::options::internal::RequestBuilder for CreateInternalRange {
8933 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8934 &mut self.0.options
8935 }
8936 }
8937
8938 #[derive(Clone, Debug)]
8957 pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
8958
8959 impl UpdateInternalRange {
8960 pub(crate) fn new(
8961 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8962 ) -> Self {
8963 Self(RequestBuilder::new(stub))
8964 }
8965
8966 pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
8968 mut self,
8969 v: V,
8970 ) -> Self {
8971 self.0.request = v.into();
8972 self
8973 }
8974
8975 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8977 self.0.options = v.into();
8978 self
8979 }
8980
8981 pub async fn send(self) -> Result<longrunning::model::Operation> {
8988 (*self.0.stub)
8989 .update_internal_range(self.0.request, self.0.options)
8990 .await
8991 .map(gax::response::Response::into_body)
8992 }
8993
8994 pub fn poller(
8996 self,
8997 ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8998 {
8999 type Operation = lro::internal::Operation<
9000 crate::model::InternalRange,
9001 crate::model::OperationMetadata,
9002 >;
9003 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9004 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9005
9006 let stub = self.0.stub.clone();
9007 let mut options = self.0.options.clone();
9008 options.set_retry_policy(gax::retry_policy::NeverRetry);
9009 let query = move |name| {
9010 let stub = stub.clone();
9011 let options = options.clone();
9012 async {
9013 let op = GetOperation::new(stub)
9014 .set_name(name)
9015 .with_options(options)
9016 .send()
9017 .await?;
9018 Ok(Operation::new(op))
9019 }
9020 };
9021
9022 let start = move || async {
9023 let op = self.send().await?;
9024 Ok(Operation::new(op))
9025 };
9026
9027 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9028 }
9029
9030 pub fn set_update_mask<T>(mut self, v: T) -> Self
9032 where
9033 T: std::convert::Into<wkt::FieldMask>,
9034 {
9035 self.0.request.update_mask = std::option::Option::Some(v.into());
9036 self
9037 }
9038
9039 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9041 where
9042 T: std::convert::Into<wkt::FieldMask>,
9043 {
9044 self.0.request.update_mask = v.map(|x| x.into());
9045 self
9046 }
9047
9048 pub fn set_internal_range<T>(mut self, v: T) -> Self
9052 where
9053 T: std::convert::Into<crate::model::InternalRange>,
9054 {
9055 self.0.request.internal_range = std::option::Option::Some(v.into());
9056 self
9057 }
9058
9059 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9063 where
9064 T: std::convert::Into<crate::model::InternalRange>,
9065 {
9066 self.0.request.internal_range = v.map(|x| x.into());
9067 self
9068 }
9069
9070 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9072 self.0.request.request_id = v.into();
9073 self
9074 }
9075 }
9076
9077 #[doc(hidden)]
9078 impl gax::options::internal::RequestBuilder for UpdateInternalRange {
9079 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9080 &mut self.0.options
9081 }
9082 }
9083
9084 #[derive(Clone, Debug)]
9103 pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9104
9105 impl DeleteInternalRange {
9106 pub(crate) fn new(
9107 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9108 ) -> Self {
9109 Self(RequestBuilder::new(stub))
9110 }
9111
9112 pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9114 mut self,
9115 v: V,
9116 ) -> Self {
9117 self.0.request = v.into();
9118 self
9119 }
9120
9121 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9123 self.0.options = v.into();
9124 self
9125 }
9126
9127 pub async fn send(self) -> Result<longrunning::model::Operation> {
9134 (*self.0.stub)
9135 .delete_internal_range(self.0.request, self.0.options)
9136 .await
9137 .map(gax::response::Response::into_body)
9138 }
9139
9140 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9142 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9143 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9144 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9145
9146 let stub = self.0.stub.clone();
9147 let mut options = self.0.options.clone();
9148 options.set_retry_policy(gax::retry_policy::NeverRetry);
9149 let query = move |name| {
9150 let stub = stub.clone();
9151 let options = options.clone();
9152 async {
9153 let op = GetOperation::new(stub)
9154 .set_name(name)
9155 .with_options(options)
9156 .send()
9157 .await?;
9158 Ok(Operation::new(op))
9159 }
9160 };
9161
9162 let start = move || async {
9163 let op = self.send().await?;
9164 Ok(Operation::new(op))
9165 };
9166
9167 lro::internal::new_unit_response_poller(
9168 polling_error_policy,
9169 polling_backoff_policy,
9170 start,
9171 query,
9172 )
9173 }
9174
9175 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9179 self.0.request.name = v.into();
9180 self
9181 }
9182
9183 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9185 self.0.request.request_id = v.into();
9186 self
9187 }
9188 }
9189
9190 #[doc(hidden)]
9191 impl gax::options::internal::RequestBuilder for DeleteInternalRange {
9192 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9193 &mut self.0.options
9194 }
9195 }
9196
9197 #[derive(Clone, Debug)]
9219 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9220
9221 impl ListLocations {
9222 pub(crate) fn new(
9223 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9224 ) -> Self {
9225 Self(RequestBuilder::new(stub))
9226 }
9227
9228 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9230 mut self,
9231 v: V,
9232 ) -> Self {
9233 self.0.request = v.into();
9234 self
9235 }
9236
9237 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9239 self.0.options = v.into();
9240 self
9241 }
9242
9243 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9245 (*self.0.stub)
9246 .list_locations(self.0.request, self.0.options)
9247 .await
9248 .map(gax::response::Response::into_body)
9249 }
9250
9251 pub fn by_page(
9253 self,
9254 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9255 {
9256 use std::clone::Clone;
9257 let token = self.0.request.page_token.clone();
9258 let execute = move |token: String| {
9259 let mut builder = self.clone();
9260 builder.0.request = builder.0.request.set_page_token(token);
9261 builder.send()
9262 };
9263 gax::paginator::internal::new_paginator(token, execute)
9264 }
9265
9266 pub fn by_item(
9268 self,
9269 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9270 {
9271 use gax::paginator::Paginator;
9272 self.by_page().items()
9273 }
9274
9275 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9277 self.0.request.name = v.into();
9278 self
9279 }
9280
9281 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9283 self.0.request.filter = v.into();
9284 self
9285 }
9286
9287 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9289 self.0.request.page_size = v.into();
9290 self
9291 }
9292
9293 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9295 self.0.request.page_token = v.into();
9296 self
9297 }
9298 }
9299
9300 #[doc(hidden)]
9301 impl gax::options::internal::RequestBuilder for ListLocations {
9302 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9303 &mut self.0.options
9304 }
9305 }
9306
9307 #[derive(Clone, Debug)]
9325 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
9326
9327 impl GetLocation {
9328 pub(crate) fn new(
9329 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9330 ) -> Self {
9331 Self(RequestBuilder::new(stub))
9332 }
9333
9334 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
9336 self.0.request = v.into();
9337 self
9338 }
9339
9340 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9342 self.0.options = v.into();
9343 self
9344 }
9345
9346 pub async fn send(self) -> Result<location::model::Location> {
9348 (*self.0.stub)
9349 .get_location(self.0.request, self.0.options)
9350 .await
9351 .map(gax::response::Response::into_body)
9352 }
9353
9354 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9356 self.0.request.name = v.into();
9357 self
9358 }
9359 }
9360
9361 #[doc(hidden)]
9362 impl gax::options::internal::RequestBuilder for GetLocation {
9363 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9364 &mut self.0.options
9365 }
9366 }
9367
9368 #[derive(Clone, Debug)]
9386 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
9387
9388 impl SetIamPolicy {
9389 pub(crate) fn new(
9390 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9391 ) -> Self {
9392 Self(RequestBuilder::new(stub))
9393 }
9394
9395 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
9397 self.0.request = v.into();
9398 self
9399 }
9400
9401 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9403 self.0.options = v.into();
9404 self
9405 }
9406
9407 pub async fn send(self) -> Result<iam_v1::model::Policy> {
9409 (*self.0.stub)
9410 .set_iam_policy(self.0.request, self.0.options)
9411 .await
9412 .map(gax::response::Response::into_body)
9413 }
9414
9415 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9419 self.0.request.resource = v.into();
9420 self
9421 }
9422
9423 pub fn set_policy<T>(mut self, v: T) -> Self
9427 where
9428 T: std::convert::Into<iam_v1::model::Policy>,
9429 {
9430 self.0.request.policy = std::option::Option::Some(v.into());
9431 self
9432 }
9433
9434 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9438 where
9439 T: std::convert::Into<iam_v1::model::Policy>,
9440 {
9441 self.0.request.policy = v.map(|x| x.into());
9442 self
9443 }
9444
9445 pub fn set_update_mask<T>(mut self, v: T) -> Self
9447 where
9448 T: std::convert::Into<wkt::FieldMask>,
9449 {
9450 self.0.request.update_mask = std::option::Option::Some(v.into());
9451 self
9452 }
9453
9454 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9456 where
9457 T: std::convert::Into<wkt::FieldMask>,
9458 {
9459 self.0.request.update_mask = v.map(|x| x.into());
9460 self
9461 }
9462 }
9463
9464 #[doc(hidden)]
9465 impl gax::options::internal::RequestBuilder for SetIamPolicy {
9466 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9467 &mut self.0.options
9468 }
9469 }
9470
9471 #[derive(Clone, Debug)]
9489 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
9490
9491 impl GetIamPolicy {
9492 pub(crate) fn new(
9493 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9494 ) -> Self {
9495 Self(RequestBuilder::new(stub))
9496 }
9497
9498 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
9500 self.0.request = v.into();
9501 self
9502 }
9503
9504 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9506 self.0.options = v.into();
9507 self
9508 }
9509
9510 pub async fn send(self) -> Result<iam_v1::model::Policy> {
9512 (*self.0.stub)
9513 .get_iam_policy(self.0.request, self.0.options)
9514 .await
9515 .map(gax::response::Response::into_body)
9516 }
9517
9518 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9522 self.0.request.resource = v.into();
9523 self
9524 }
9525
9526 pub fn set_options<T>(mut self, v: T) -> Self
9528 where
9529 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9530 {
9531 self.0.request.options = std::option::Option::Some(v.into());
9532 self
9533 }
9534
9535 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9537 where
9538 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9539 {
9540 self.0.request.options = v.map(|x| x.into());
9541 self
9542 }
9543 }
9544
9545 #[doc(hidden)]
9546 impl gax::options::internal::RequestBuilder for GetIamPolicy {
9547 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9548 &mut self.0.options
9549 }
9550 }
9551
9552 #[derive(Clone, Debug)]
9570 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
9571
9572 impl TestIamPermissions {
9573 pub(crate) fn new(
9574 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9575 ) -> Self {
9576 Self(RequestBuilder::new(stub))
9577 }
9578
9579 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
9581 mut self,
9582 v: V,
9583 ) -> Self {
9584 self.0.request = v.into();
9585 self
9586 }
9587
9588 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9590 self.0.options = v.into();
9591 self
9592 }
9593
9594 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
9596 (*self.0.stub)
9597 .test_iam_permissions(self.0.request, self.0.options)
9598 .await
9599 .map(gax::response::Response::into_body)
9600 }
9601
9602 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9606 self.0.request.resource = v.into();
9607 self
9608 }
9609
9610 pub fn set_permissions<T, V>(mut self, v: T) -> Self
9614 where
9615 T: std::iter::IntoIterator<Item = V>,
9616 V: std::convert::Into<std::string::String>,
9617 {
9618 use std::iter::Iterator;
9619 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9620 self
9621 }
9622 }
9623
9624 #[doc(hidden)]
9625 impl gax::options::internal::RequestBuilder for TestIamPermissions {
9626 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9627 &mut self.0.options
9628 }
9629 }
9630
9631 #[derive(Clone, Debug)]
9653 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
9654
9655 impl ListOperations {
9656 pub(crate) fn new(
9657 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9658 ) -> Self {
9659 Self(RequestBuilder::new(stub))
9660 }
9661
9662 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
9664 mut self,
9665 v: V,
9666 ) -> Self {
9667 self.0.request = v.into();
9668 self
9669 }
9670
9671 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9673 self.0.options = v.into();
9674 self
9675 }
9676
9677 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
9679 (*self.0.stub)
9680 .list_operations(self.0.request, self.0.options)
9681 .await
9682 .map(gax::response::Response::into_body)
9683 }
9684
9685 pub fn by_page(
9687 self,
9688 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
9689 {
9690 use std::clone::Clone;
9691 let token = self.0.request.page_token.clone();
9692 let execute = move |token: String| {
9693 let mut builder = self.clone();
9694 builder.0.request = builder.0.request.set_page_token(token);
9695 builder.send()
9696 };
9697 gax::paginator::internal::new_paginator(token, execute)
9698 }
9699
9700 pub fn by_item(
9702 self,
9703 ) -> impl gax::paginator::ItemPaginator<
9704 longrunning::model::ListOperationsResponse,
9705 gax::error::Error,
9706 > {
9707 use gax::paginator::Paginator;
9708 self.by_page().items()
9709 }
9710
9711 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9713 self.0.request.name = v.into();
9714 self
9715 }
9716
9717 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9719 self.0.request.filter = v.into();
9720 self
9721 }
9722
9723 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9725 self.0.request.page_size = v.into();
9726 self
9727 }
9728
9729 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9731 self.0.request.page_token = v.into();
9732 self
9733 }
9734 }
9735
9736 #[doc(hidden)]
9737 impl gax::options::internal::RequestBuilder for ListOperations {
9738 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9739 &mut self.0.options
9740 }
9741 }
9742
9743 #[derive(Clone, Debug)]
9761 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
9762
9763 impl GetOperation {
9764 pub(crate) fn new(
9765 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9766 ) -> Self {
9767 Self(RequestBuilder::new(stub))
9768 }
9769
9770 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
9772 mut self,
9773 v: V,
9774 ) -> Self {
9775 self.0.request = v.into();
9776 self
9777 }
9778
9779 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9781 self.0.options = v.into();
9782 self
9783 }
9784
9785 pub async fn send(self) -> Result<longrunning::model::Operation> {
9787 (*self.0.stub)
9788 .get_operation(self.0.request, self.0.options)
9789 .await
9790 .map(gax::response::Response::into_body)
9791 }
9792
9793 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9795 self.0.request.name = v.into();
9796 self
9797 }
9798 }
9799
9800 #[doc(hidden)]
9801 impl gax::options::internal::RequestBuilder for GetOperation {
9802 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9803 &mut self.0.options
9804 }
9805 }
9806
9807 #[derive(Clone, Debug)]
9825 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
9826
9827 impl DeleteOperation {
9828 pub(crate) fn new(
9829 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9830 ) -> Self {
9831 Self(RequestBuilder::new(stub))
9832 }
9833
9834 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
9836 mut self,
9837 v: V,
9838 ) -> Self {
9839 self.0.request = v.into();
9840 self
9841 }
9842
9843 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9845 self.0.options = v.into();
9846 self
9847 }
9848
9849 pub async fn send(self) -> Result<()> {
9851 (*self.0.stub)
9852 .delete_operation(self.0.request, self.0.options)
9853 .await
9854 .map(gax::response::Response::into_body)
9855 }
9856
9857 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9859 self.0.request.name = v.into();
9860 self
9861 }
9862 }
9863
9864 #[doc(hidden)]
9865 impl gax::options::internal::RequestBuilder for DeleteOperation {
9866 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9867 &mut self.0.options
9868 }
9869 }
9870
9871 #[derive(Clone, Debug)]
9889 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
9890
9891 impl CancelOperation {
9892 pub(crate) fn new(
9893 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9894 ) -> Self {
9895 Self(RequestBuilder::new(stub))
9896 }
9897
9898 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
9900 mut self,
9901 v: V,
9902 ) -> Self {
9903 self.0.request = v.into();
9904 self
9905 }
9906
9907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9909 self.0.options = v.into();
9910 self
9911 }
9912
9913 pub async fn send(self) -> Result<()> {
9915 (*self.0.stub)
9916 .cancel_operation(self.0.request, self.0.options)
9917 .await
9918 .map(gax::response::Response::into_body)
9919 }
9920
9921 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9923 self.0.request.name = v.into();
9924 self
9925 }
9926 }
9927
9928 #[doc(hidden)]
9929 impl gax::options::internal::RequestBuilder for CancelOperation {
9930 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9931 &mut self.0.options
9932 }
9933 }
9934}
9935
9936pub mod policy_based_routing_service {
9937 use crate::Result;
9938
9939 pub type ClientBuilder =
9953 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9954
9955 pub(crate) mod client {
9956 use super::super::super::client::PolicyBasedRoutingService;
9957 pub struct Factory;
9958 impl gax::client_builder::internal::ClientFactory for Factory {
9959 type Client = PolicyBasedRoutingService;
9960 type Credentials = gaxi::options::Credentials;
9961 async fn build(
9962 self,
9963 config: gaxi::options::ClientConfig,
9964 ) -> gax::client_builder::Result<Self::Client> {
9965 Self::Client::new(config).await
9966 }
9967 }
9968 }
9969
9970 #[derive(Clone, Debug)]
9972 pub(crate) struct RequestBuilder<R: std::default::Default> {
9973 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9974 request: R,
9975 options: gax::options::RequestOptions,
9976 }
9977
9978 impl<R> RequestBuilder<R>
9979 where
9980 R: std::default::Default,
9981 {
9982 pub(crate) fn new(
9983 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9984 ) -> Self {
9985 Self {
9986 stub,
9987 request: R::default(),
9988 options: gax::options::RequestOptions::default(),
9989 }
9990 }
9991 }
9992
9993 #[derive(Clone, Debug)]
10015 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10016
10017 impl ListPolicyBasedRoutes {
10018 pub(crate) fn new(
10019 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10020 ) -> Self {
10021 Self(RequestBuilder::new(stub))
10022 }
10023
10024 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10026 mut self,
10027 v: V,
10028 ) -> Self {
10029 self.0.request = v.into();
10030 self
10031 }
10032
10033 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10035 self.0.options = v.into();
10036 self
10037 }
10038
10039 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10041 (*self.0.stub)
10042 .list_policy_based_routes(self.0.request, self.0.options)
10043 .await
10044 .map(gax::response::Response::into_body)
10045 }
10046
10047 pub fn by_page(
10049 self,
10050 ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
10051 {
10052 use std::clone::Clone;
10053 let token = self.0.request.page_token.clone();
10054 let execute = move |token: String| {
10055 let mut builder = self.clone();
10056 builder.0.request = builder.0.request.set_page_token(token);
10057 builder.send()
10058 };
10059 gax::paginator::internal::new_paginator(token, execute)
10060 }
10061
10062 pub fn by_item(
10064 self,
10065 ) -> impl gax::paginator::ItemPaginator<
10066 crate::model::ListPolicyBasedRoutesResponse,
10067 gax::error::Error,
10068 > {
10069 use gax::paginator::Paginator;
10070 self.by_page().items()
10071 }
10072
10073 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10077 self.0.request.parent = v.into();
10078 self
10079 }
10080
10081 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10083 self.0.request.page_size = v.into();
10084 self
10085 }
10086
10087 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10089 self.0.request.page_token = v.into();
10090 self
10091 }
10092
10093 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10095 self.0.request.filter = v.into();
10096 self
10097 }
10098
10099 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10101 self.0.request.order_by = v.into();
10102 self
10103 }
10104 }
10105
10106 #[doc(hidden)]
10107 impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
10108 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10109 &mut self.0.options
10110 }
10111 }
10112
10113 #[derive(Clone, Debug)]
10131 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10132
10133 impl GetPolicyBasedRoute {
10134 pub(crate) fn new(
10135 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10136 ) -> Self {
10137 Self(RequestBuilder::new(stub))
10138 }
10139
10140 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10142 mut self,
10143 v: V,
10144 ) -> Self {
10145 self.0.request = v.into();
10146 self
10147 }
10148
10149 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10151 self.0.options = v.into();
10152 self
10153 }
10154
10155 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10157 (*self.0.stub)
10158 .get_policy_based_route(self.0.request, self.0.options)
10159 .await
10160 .map(gax::response::Response::into_body)
10161 }
10162
10163 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10167 self.0.request.name = v.into();
10168 self
10169 }
10170 }
10171
10172 #[doc(hidden)]
10173 impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
10174 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10175 &mut self.0.options
10176 }
10177 }
10178
10179 #[derive(Clone, Debug)]
10198 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10199
10200 impl CreatePolicyBasedRoute {
10201 pub(crate) fn new(
10202 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10203 ) -> Self {
10204 Self(RequestBuilder::new(stub))
10205 }
10206
10207 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10209 mut self,
10210 v: V,
10211 ) -> Self {
10212 self.0.request = v.into();
10213 self
10214 }
10215
10216 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10218 self.0.options = v.into();
10219 self
10220 }
10221
10222 pub async fn send(self) -> Result<longrunning::model::Operation> {
10229 (*self.0.stub)
10230 .create_policy_based_route(self.0.request, self.0.options)
10231 .await
10232 .map(gax::response::Response::into_body)
10233 }
10234
10235 pub fn poller(
10237 self,
10238 ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10239 {
10240 type Operation = lro::internal::Operation<
10241 crate::model::PolicyBasedRoute,
10242 crate::model::OperationMetadata,
10243 >;
10244 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10245 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10246
10247 let stub = self.0.stub.clone();
10248 let mut options = self.0.options.clone();
10249 options.set_retry_policy(gax::retry_policy::NeverRetry);
10250 let query = move |name| {
10251 let stub = stub.clone();
10252 let options = options.clone();
10253 async {
10254 let op = GetOperation::new(stub)
10255 .set_name(name)
10256 .with_options(options)
10257 .send()
10258 .await?;
10259 Ok(Operation::new(op))
10260 }
10261 };
10262
10263 let start = move || async {
10264 let op = self.send().await?;
10265 Ok(Operation::new(op))
10266 };
10267
10268 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10269 }
10270
10271 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10275 self.0.request.parent = v.into();
10276 self
10277 }
10278
10279 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10283 self.0.request.policy_based_route_id = v.into();
10284 self
10285 }
10286
10287 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10291 where
10292 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10293 {
10294 self.0.request.policy_based_route = std::option::Option::Some(v.into());
10295 self
10296 }
10297
10298 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10302 where
10303 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10304 {
10305 self.0.request.policy_based_route = v.map(|x| x.into());
10306 self
10307 }
10308
10309 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10311 self.0.request.request_id = v.into();
10312 self
10313 }
10314 }
10315
10316 #[doc(hidden)]
10317 impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
10318 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10319 &mut self.0.options
10320 }
10321 }
10322
10323 #[derive(Clone, Debug)]
10342 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10343
10344 impl DeletePolicyBasedRoute {
10345 pub(crate) fn new(
10346 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10347 ) -> Self {
10348 Self(RequestBuilder::new(stub))
10349 }
10350
10351 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10353 mut self,
10354 v: V,
10355 ) -> Self {
10356 self.0.request = v.into();
10357 self
10358 }
10359
10360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10362 self.0.options = v.into();
10363 self
10364 }
10365
10366 pub async fn send(self) -> Result<longrunning::model::Operation> {
10373 (*self.0.stub)
10374 .delete_policy_based_route(self.0.request, self.0.options)
10375 .await
10376 .map(gax::response::Response::into_body)
10377 }
10378
10379 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10381 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10382 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10383 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10384
10385 let stub = self.0.stub.clone();
10386 let mut options = self.0.options.clone();
10387 options.set_retry_policy(gax::retry_policy::NeverRetry);
10388 let query = move |name| {
10389 let stub = stub.clone();
10390 let options = options.clone();
10391 async {
10392 let op = GetOperation::new(stub)
10393 .set_name(name)
10394 .with_options(options)
10395 .send()
10396 .await?;
10397 Ok(Operation::new(op))
10398 }
10399 };
10400
10401 let start = move || async {
10402 let op = self.send().await?;
10403 Ok(Operation::new(op))
10404 };
10405
10406 lro::internal::new_unit_response_poller(
10407 polling_error_policy,
10408 polling_backoff_policy,
10409 start,
10410 query,
10411 )
10412 }
10413
10414 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10418 self.0.request.name = v.into();
10419 self
10420 }
10421
10422 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10424 self.0.request.request_id = v.into();
10425 self
10426 }
10427 }
10428
10429 #[doc(hidden)]
10430 impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
10431 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10432 &mut self.0.options
10433 }
10434 }
10435
10436 #[derive(Clone, Debug)]
10458 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10459
10460 impl ListLocations {
10461 pub(crate) fn new(
10462 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10463 ) -> Self {
10464 Self(RequestBuilder::new(stub))
10465 }
10466
10467 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10469 mut self,
10470 v: V,
10471 ) -> Self {
10472 self.0.request = v.into();
10473 self
10474 }
10475
10476 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10478 self.0.options = v.into();
10479 self
10480 }
10481
10482 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10484 (*self.0.stub)
10485 .list_locations(self.0.request, self.0.options)
10486 .await
10487 .map(gax::response::Response::into_body)
10488 }
10489
10490 pub fn by_page(
10492 self,
10493 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10494 {
10495 use std::clone::Clone;
10496 let token = self.0.request.page_token.clone();
10497 let execute = move |token: String| {
10498 let mut builder = self.clone();
10499 builder.0.request = builder.0.request.set_page_token(token);
10500 builder.send()
10501 };
10502 gax::paginator::internal::new_paginator(token, execute)
10503 }
10504
10505 pub fn by_item(
10507 self,
10508 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10509 {
10510 use gax::paginator::Paginator;
10511 self.by_page().items()
10512 }
10513
10514 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10516 self.0.request.name = v.into();
10517 self
10518 }
10519
10520 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10522 self.0.request.filter = v.into();
10523 self
10524 }
10525
10526 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10528 self.0.request.page_size = v.into();
10529 self
10530 }
10531
10532 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10534 self.0.request.page_token = v.into();
10535 self
10536 }
10537 }
10538
10539 #[doc(hidden)]
10540 impl gax::options::internal::RequestBuilder for ListLocations {
10541 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10542 &mut self.0.options
10543 }
10544 }
10545
10546 #[derive(Clone, Debug)]
10564 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10565
10566 impl GetLocation {
10567 pub(crate) fn new(
10568 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10569 ) -> Self {
10570 Self(RequestBuilder::new(stub))
10571 }
10572
10573 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10575 self.0.request = v.into();
10576 self
10577 }
10578
10579 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10581 self.0.options = v.into();
10582 self
10583 }
10584
10585 pub async fn send(self) -> Result<location::model::Location> {
10587 (*self.0.stub)
10588 .get_location(self.0.request, self.0.options)
10589 .await
10590 .map(gax::response::Response::into_body)
10591 }
10592
10593 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10595 self.0.request.name = v.into();
10596 self
10597 }
10598 }
10599
10600 #[doc(hidden)]
10601 impl gax::options::internal::RequestBuilder for GetLocation {
10602 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10603 &mut self.0.options
10604 }
10605 }
10606
10607 #[derive(Clone, Debug)]
10625 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
10626
10627 impl SetIamPolicy {
10628 pub(crate) fn new(
10629 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10630 ) -> Self {
10631 Self(RequestBuilder::new(stub))
10632 }
10633
10634 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
10636 self.0.request = v.into();
10637 self
10638 }
10639
10640 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10642 self.0.options = v.into();
10643 self
10644 }
10645
10646 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10648 (*self.0.stub)
10649 .set_iam_policy(self.0.request, self.0.options)
10650 .await
10651 .map(gax::response::Response::into_body)
10652 }
10653
10654 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10658 self.0.request.resource = v.into();
10659 self
10660 }
10661
10662 pub fn set_policy<T>(mut self, v: T) -> Self
10666 where
10667 T: std::convert::Into<iam_v1::model::Policy>,
10668 {
10669 self.0.request.policy = std::option::Option::Some(v.into());
10670 self
10671 }
10672
10673 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10677 where
10678 T: std::convert::Into<iam_v1::model::Policy>,
10679 {
10680 self.0.request.policy = v.map(|x| x.into());
10681 self
10682 }
10683
10684 pub fn set_update_mask<T>(mut self, v: T) -> Self
10686 where
10687 T: std::convert::Into<wkt::FieldMask>,
10688 {
10689 self.0.request.update_mask = std::option::Option::Some(v.into());
10690 self
10691 }
10692
10693 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10695 where
10696 T: std::convert::Into<wkt::FieldMask>,
10697 {
10698 self.0.request.update_mask = v.map(|x| x.into());
10699 self
10700 }
10701 }
10702
10703 #[doc(hidden)]
10704 impl gax::options::internal::RequestBuilder for SetIamPolicy {
10705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10706 &mut self.0.options
10707 }
10708 }
10709
10710 #[derive(Clone, Debug)]
10728 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
10729
10730 impl GetIamPolicy {
10731 pub(crate) fn new(
10732 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10733 ) -> Self {
10734 Self(RequestBuilder::new(stub))
10735 }
10736
10737 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
10739 self.0.request = v.into();
10740 self
10741 }
10742
10743 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10745 self.0.options = v.into();
10746 self
10747 }
10748
10749 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10751 (*self.0.stub)
10752 .get_iam_policy(self.0.request, self.0.options)
10753 .await
10754 .map(gax::response::Response::into_body)
10755 }
10756
10757 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10761 self.0.request.resource = v.into();
10762 self
10763 }
10764
10765 pub fn set_options<T>(mut self, v: T) -> Self
10767 where
10768 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10769 {
10770 self.0.request.options = std::option::Option::Some(v.into());
10771 self
10772 }
10773
10774 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10776 where
10777 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10778 {
10779 self.0.request.options = v.map(|x| x.into());
10780 self
10781 }
10782 }
10783
10784 #[doc(hidden)]
10785 impl gax::options::internal::RequestBuilder for GetIamPolicy {
10786 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10787 &mut self.0.options
10788 }
10789 }
10790
10791 #[derive(Clone, Debug)]
10809 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
10810
10811 impl TestIamPermissions {
10812 pub(crate) fn new(
10813 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10814 ) -> Self {
10815 Self(RequestBuilder::new(stub))
10816 }
10817
10818 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
10820 mut self,
10821 v: V,
10822 ) -> Self {
10823 self.0.request = v.into();
10824 self
10825 }
10826
10827 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10829 self.0.options = v.into();
10830 self
10831 }
10832
10833 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
10835 (*self.0.stub)
10836 .test_iam_permissions(self.0.request, self.0.options)
10837 .await
10838 .map(gax::response::Response::into_body)
10839 }
10840
10841 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10845 self.0.request.resource = v.into();
10846 self
10847 }
10848
10849 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10853 where
10854 T: std::iter::IntoIterator<Item = V>,
10855 V: std::convert::Into<std::string::String>,
10856 {
10857 use std::iter::Iterator;
10858 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10859 self
10860 }
10861 }
10862
10863 #[doc(hidden)]
10864 impl gax::options::internal::RequestBuilder for TestIamPermissions {
10865 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10866 &mut self.0.options
10867 }
10868 }
10869
10870 #[derive(Clone, Debug)]
10892 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10893
10894 impl ListOperations {
10895 pub(crate) fn new(
10896 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10897 ) -> Self {
10898 Self(RequestBuilder::new(stub))
10899 }
10900
10901 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10903 mut self,
10904 v: V,
10905 ) -> Self {
10906 self.0.request = v.into();
10907 self
10908 }
10909
10910 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10912 self.0.options = v.into();
10913 self
10914 }
10915
10916 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10918 (*self.0.stub)
10919 .list_operations(self.0.request, self.0.options)
10920 .await
10921 .map(gax::response::Response::into_body)
10922 }
10923
10924 pub fn by_page(
10926 self,
10927 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10928 {
10929 use std::clone::Clone;
10930 let token = self.0.request.page_token.clone();
10931 let execute = move |token: String| {
10932 let mut builder = self.clone();
10933 builder.0.request = builder.0.request.set_page_token(token);
10934 builder.send()
10935 };
10936 gax::paginator::internal::new_paginator(token, execute)
10937 }
10938
10939 pub fn by_item(
10941 self,
10942 ) -> impl gax::paginator::ItemPaginator<
10943 longrunning::model::ListOperationsResponse,
10944 gax::error::Error,
10945 > {
10946 use gax::paginator::Paginator;
10947 self.by_page().items()
10948 }
10949
10950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10952 self.0.request.name = v.into();
10953 self
10954 }
10955
10956 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10958 self.0.request.filter = v.into();
10959 self
10960 }
10961
10962 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10964 self.0.request.page_size = v.into();
10965 self
10966 }
10967
10968 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10970 self.0.request.page_token = v.into();
10971 self
10972 }
10973 }
10974
10975 #[doc(hidden)]
10976 impl gax::options::internal::RequestBuilder for ListOperations {
10977 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10978 &mut self.0.options
10979 }
10980 }
10981
10982 #[derive(Clone, Debug)]
11000 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11001
11002 impl GetOperation {
11003 pub(crate) fn new(
11004 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11005 ) -> Self {
11006 Self(RequestBuilder::new(stub))
11007 }
11008
11009 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11011 mut self,
11012 v: V,
11013 ) -> Self {
11014 self.0.request = v.into();
11015 self
11016 }
11017
11018 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11020 self.0.options = v.into();
11021 self
11022 }
11023
11024 pub async fn send(self) -> Result<longrunning::model::Operation> {
11026 (*self.0.stub)
11027 .get_operation(self.0.request, self.0.options)
11028 .await
11029 .map(gax::response::Response::into_body)
11030 }
11031
11032 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11034 self.0.request.name = v.into();
11035 self
11036 }
11037 }
11038
11039 #[doc(hidden)]
11040 impl gax::options::internal::RequestBuilder for GetOperation {
11041 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11042 &mut self.0.options
11043 }
11044 }
11045
11046 #[derive(Clone, Debug)]
11064 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
11065
11066 impl DeleteOperation {
11067 pub(crate) fn new(
11068 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11069 ) -> Self {
11070 Self(RequestBuilder::new(stub))
11071 }
11072
11073 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
11075 mut self,
11076 v: V,
11077 ) -> Self {
11078 self.0.request = v.into();
11079 self
11080 }
11081
11082 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11084 self.0.options = v.into();
11085 self
11086 }
11087
11088 pub async fn send(self) -> Result<()> {
11090 (*self.0.stub)
11091 .delete_operation(self.0.request, self.0.options)
11092 .await
11093 .map(gax::response::Response::into_body)
11094 }
11095
11096 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11098 self.0.request.name = v.into();
11099 self
11100 }
11101 }
11102
11103 #[doc(hidden)]
11104 impl gax::options::internal::RequestBuilder for DeleteOperation {
11105 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11106 &mut self.0.options
11107 }
11108 }
11109
11110 #[derive(Clone, Debug)]
11128 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11129
11130 impl CancelOperation {
11131 pub(crate) fn new(
11132 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11133 ) -> Self {
11134 Self(RequestBuilder::new(stub))
11135 }
11136
11137 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11139 mut self,
11140 v: V,
11141 ) -> Self {
11142 self.0.request = v.into();
11143 self
11144 }
11145
11146 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11148 self.0.options = v.into();
11149 self
11150 }
11151
11152 pub async fn send(self) -> Result<()> {
11154 (*self.0.stub)
11155 .cancel_operation(self.0.request, self.0.options)
11156 .await
11157 .map(gax::response::Response::into_body)
11158 }
11159
11160 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11162 self.0.request.name = v.into();
11163 self
11164 }
11165 }
11166
11167 #[doc(hidden)]
11168 impl gax::options::internal::RequestBuilder for CancelOperation {
11169 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11170 &mut self.0.options
11171 }
11172 }
11173}