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 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2788 self.0.request.return_partial_success = v.into();
2789 self
2790 }
2791 }
2792
2793 #[doc(hidden)]
2794 impl gax::options::internal::RequestBuilder for ListOperations {
2795 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2796 &mut self.0.options
2797 }
2798 }
2799
2800 #[derive(Clone, Debug)]
2818 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2819
2820 impl GetOperation {
2821 pub(crate) fn new(
2822 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2823 ) -> Self {
2824 Self(RequestBuilder::new(stub))
2825 }
2826
2827 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2829 mut self,
2830 v: V,
2831 ) -> Self {
2832 self.0.request = v.into();
2833 self
2834 }
2835
2836 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2838 self.0.options = v.into();
2839 self
2840 }
2841
2842 pub async fn send(self) -> Result<longrunning::model::Operation> {
2844 (*self.0.stub)
2845 .get_operation(self.0.request, self.0.options)
2846 .await
2847 .map(gax::response::Response::into_body)
2848 }
2849
2850 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2852 self.0.request.name = v.into();
2853 self
2854 }
2855 }
2856
2857 #[doc(hidden)]
2858 impl gax::options::internal::RequestBuilder for GetOperation {
2859 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2860 &mut self.0.options
2861 }
2862 }
2863
2864 #[derive(Clone, Debug)]
2882 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2883
2884 impl DeleteOperation {
2885 pub(crate) fn new(
2886 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2887 ) -> Self {
2888 Self(RequestBuilder::new(stub))
2889 }
2890
2891 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2893 mut self,
2894 v: V,
2895 ) -> Self {
2896 self.0.request = v.into();
2897 self
2898 }
2899
2900 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2902 self.0.options = v.into();
2903 self
2904 }
2905
2906 pub async fn send(self) -> Result<()> {
2908 (*self.0.stub)
2909 .delete_operation(self.0.request, self.0.options)
2910 .await
2911 .map(gax::response::Response::into_body)
2912 }
2913
2914 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2916 self.0.request.name = v.into();
2917 self
2918 }
2919 }
2920
2921 #[doc(hidden)]
2922 impl gax::options::internal::RequestBuilder for DeleteOperation {
2923 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2924 &mut self.0.options
2925 }
2926 }
2927
2928 #[derive(Clone, Debug)]
2946 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2947
2948 impl CancelOperation {
2949 pub(crate) fn new(
2950 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2951 ) -> Self {
2952 Self(RequestBuilder::new(stub))
2953 }
2954
2955 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2957 mut self,
2958 v: V,
2959 ) -> Self {
2960 self.0.request = v.into();
2961 self
2962 }
2963
2964 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2966 self.0.options = v.into();
2967 self
2968 }
2969
2970 pub async fn send(self) -> Result<()> {
2972 (*self.0.stub)
2973 .cancel_operation(self.0.request, self.0.options)
2974 .await
2975 .map(gax::response::Response::into_body)
2976 }
2977
2978 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2980 self.0.request.name = v.into();
2981 self
2982 }
2983 }
2984
2985 #[doc(hidden)]
2986 impl gax::options::internal::RequestBuilder for CancelOperation {
2987 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2988 &mut self.0.options
2989 }
2990 }
2991}
2992
2993pub mod data_transfer_service {
2994 use crate::Result;
2995
2996 pub type ClientBuilder =
3010 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3011
3012 pub(crate) mod client {
3013 use super::super::super::client::DataTransferService;
3014 pub struct Factory;
3015 impl gax::client_builder::internal::ClientFactory for Factory {
3016 type Client = DataTransferService;
3017 type Credentials = gaxi::options::Credentials;
3018 async fn build(
3019 self,
3020 config: gaxi::options::ClientConfig,
3021 ) -> gax::client_builder::Result<Self::Client> {
3022 Self::Client::new(config).await
3023 }
3024 }
3025 }
3026
3027 #[derive(Clone, Debug)]
3029 pub(crate) struct RequestBuilder<R: std::default::Default> {
3030 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3031 request: R,
3032 options: gax::options::RequestOptions,
3033 }
3034
3035 impl<R> RequestBuilder<R>
3036 where
3037 R: std::default::Default,
3038 {
3039 pub(crate) fn new(
3040 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3041 ) -> Self {
3042 Self {
3043 stub,
3044 request: R::default(),
3045 options: gax::options::RequestOptions::default(),
3046 }
3047 }
3048 }
3049
3050 #[derive(Clone, Debug)]
3072 pub struct ListMulticloudDataTransferConfigs(
3073 RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3074 );
3075
3076 impl ListMulticloudDataTransferConfigs {
3077 pub(crate) fn new(
3078 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3079 ) -> Self {
3080 Self(RequestBuilder::new(stub))
3081 }
3082
3083 pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3085 mut self,
3086 v: V,
3087 ) -> Self {
3088 self.0.request = v.into();
3089 self
3090 }
3091
3092 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3094 self.0.options = v.into();
3095 self
3096 }
3097
3098 pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3100 (*self.0.stub)
3101 .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3102 .await
3103 .map(gax::response::Response::into_body)
3104 }
3105
3106 pub fn by_page(
3108 self,
3109 ) -> impl gax::paginator::Paginator<
3110 crate::model::ListMulticloudDataTransferConfigsResponse,
3111 gax::error::Error,
3112 > {
3113 use std::clone::Clone;
3114 let token = self.0.request.page_token.clone();
3115 let execute = move |token: String| {
3116 let mut builder = self.clone();
3117 builder.0.request = builder.0.request.set_page_token(token);
3118 builder.send()
3119 };
3120 gax::paginator::internal::new_paginator(token, execute)
3121 }
3122
3123 pub fn by_item(
3125 self,
3126 ) -> impl gax::paginator::ItemPaginator<
3127 crate::model::ListMulticloudDataTransferConfigsResponse,
3128 gax::error::Error,
3129 > {
3130 use gax::paginator::Paginator;
3131 self.by_page().items()
3132 }
3133
3134 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3138 self.0.request.parent = v.into();
3139 self
3140 }
3141
3142 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3144 self.0.request.page_size = v.into();
3145 self
3146 }
3147
3148 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3150 self.0.request.page_token = v.into();
3151 self
3152 }
3153
3154 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3156 self.0.request.filter = v.into();
3157 self
3158 }
3159
3160 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3162 self.0.request.order_by = v.into();
3163 self
3164 }
3165
3166 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3168 self.0.request.return_partial_success = v.into();
3169 self
3170 }
3171 }
3172
3173 #[doc(hidden)]
3174 impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferConfigs {
3175 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3176 &mut self.0.options
3177 }
3178 }
3179
3180 #[derive(Clone, Debug)]
3198 pub struct GetMulticloudDataTransferConfig(
3199 RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3200 );
3201
3202 impl GetMulticloudDataTransferConfig {
3203 pub(crate) fn new(
3204 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3205 ) -> Self {
3206 Self(RequestBuilder::new(stub))
3207 }
3208
3209 pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3211 mut self,
3212 v: V,
3213 ) -> Self {
3214 self.0.request = v.into();
3215 self
3216 }
3217
3218 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3220 self.0.options = v.into();
3221 self
3222 }
3223
3224 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3226 (*self.0.stub)
3227 .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3228 .await
3229 .map(gax::response::Response::into_body)
3230 }
3231
3232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3236 self.0.request.name = v.into();
3237 self
3238 }
3239 }
3240
3241 #[doc(hidden)]
3242 impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferConfig {
3243 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3244 &mut self.0.options
3245 }
3246 }
3247
3248 #[derive(Clone, Debug)]
3267 pub struct CreateMulticloudDataTransferConfig(
3268 RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3269 );
3270
3271 impl CreateMulticloudDataTransferConfig {
3272 pub(crate) fn new(
3273 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3274 ) -> Self {
3275 Self(RequestBuilder::new(stub))
3276 }
3277
3278 pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3280 mut self,
3281 v: V,
3282 ) -> Self {
3283 self.0.request = v.into();
3284 self
3285 }
3286
3287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3289 self.0.options = v.into();
3290 self
3291 }
3292
3293 pub async fn send(self) -> Result<longrunning::model::Operation> {
3300 (*self.0.stub)
3301 .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3302 .await
3303 .map(gax::response::Response::into_body)
3304 }
3305
3306 pub fn poller(
3308 self,
3309 ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3310 {
3311 type Operation = lro::internal::Operation<
3312 crate::model::MulticloudDataTransferConfig,
3313 crate::model::OperationMetadata,
3314 >;
3315 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3316 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3317
3318 let stub = self.0.stub.clone();
3319 let mut options = self.0.options.clone();
3320 options.set_retry_policy(gax::retry_policy::NeverRetry);
3321 let query = move |name| {
3322 let stub = stub.clone();
3323 let options = options.clone();
3324 async {
3325 let op = GetOperation::new(stub)
3326 .set_name(name)
3327 .with_options(options)
3328 .send()
3329 .await?;
3330 Ok(Operation::new(op))
3331 }
3332 };
3333
3334 let start = move || async {
3335 let op = self.send().await?;
3336 Ok(Operation::new(op))
3337 };
3338
3339 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3340 }
3341
3342 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3346 self.0.request.parent = v.into();
3347 self
3348 }
3349
3350 pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3354 mut self,
3355 v: T,
3356 ) -> Self {
3357 self.0.request.multicloud_data_transfer_config_id = v.into();
3358 self
3359 }
3360
3361 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3365 where
3366 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3367 {
3368 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3369 self
3370 }
3371
3372 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3376 mut self,
3377 v: std::option::Option<T>,
3378 ) -> Self
3379 where
3380 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3381 {
3382 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3383 self
3384 }
3385
3386 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3388 self.0.request.request_id = v.into();
3389 self
3390 }
3391 }
3392
3393 #[doc(hidden)]
3394 impl gax::options::internal::RequestBuilder for CreateMulticloudDataTransferConfig {
3395 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3396 &mut self.0.options
3397 }
3398 }
3399
3400 #[derive(Clone, Debug)]
3419 pub struct UpdateMulticloudDataTransferConfig(
3420 RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3421 );
3422
3423 impl UpdateMulticloudDataTransferConfig {
3424 pub(crate) fn new(
3425 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3426 ) -> Self {
3427 Self(RequestBuilder::new(stub))
3428 }
3429
3430 pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3432 mut self,
3433 v: V,
3434 ) -> Self {
3435 self.0.request = v.into();
3436 self
3437 }
3438
3439 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3441 self.0.options = v.into();
3442 self
3443 }
3444
3445 pub async fn send(self) -> Result<longrunning::model::Operation> {
3452 (*self.0.stub)
3453 .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3454 .await
3455 .map(gax::response::Response::into_body)
3456 }
3457
3458 pub fn poller(
3460 self,
3461 ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3462 {
3463 type Operation = lro::internal::Operation<
3464 crate::model::MulticloudDataTransferConfig,
3465 crate::model::OperationMetadata,
3466 >;
3467 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3468 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3469
3470 let stub = self.0.stub.clone();
3471 let mut options = self.0.options.clone();
3472 options.set_retry_policy(gax::retry_policy::NeverRetry);
3473 let query = move |name| {
3474 let stub = stub.clone();
3475 let options = options.clone();
3476 async {
3477 let op = GetOperation::new(stub)
3478 .set_name(name)
3479 .with_options(options)
3480 .send()
3481 .await?;
3482 Ok(Operation::new(op))
3483 }
3484 };
3485
3486 let start = move || async {
3487 let op = self.send().await?;
3488 Ok(Operation::new(op))
3489 };
3490
3491 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3492 }
3493
3494 pub fn set_update_mask<T>(mut self, v: T) -> Self
3496 where
3497 T: std::convert::Into<wkt::FieldMask>,
3498 {
3499 self.0.request.update_mask = std::option::Option::Some(v.into());
3500 self
3501 }
3502
3503 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3505 where
3506 T: std::convert::Into<wkt::FieldMask>,
3507 {
3508 self.0.request.update_mask = v.map(|x| x.into());
3509 self
3510 }
3511
3512 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3516 where
3517 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3518 {
3519 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3520 self
3521 }
3522
3523 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3527 mut self,
3528 v: std::option::Option<T>,
3529 ) -> Self
3530 where
3531 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3532 {
3533 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3534 self
3535 }
3536
3537 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3539 self.0.request.request_id = v.into();
3540 self
3541 }
3542 }
3543
3544 #[doc(hidden)]
3545 impl gax::options::internal::RequestBuilder for UpdateMulticloudDataTransferConfig {
3546 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3547 &mut self.0.options
3548 }
3549 }
3550
3551 #[derive(Clone, Debug)]
3570 pub struct DeleteMulticloudDataTransferConfig(
3571 RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3572 );
3573
3574 impl DeleteMulticloudDataTransferConfig {
3575 pub(crate) fn new(
3576 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3577 ) -> Self {
3578 Self(RequestBuilder::new(stub))
3579 }
3580
3581 pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3583 mut self,
3584 v: V,
3585 ) -> Self {
3586 self.0.request = v.into();
3587 self
3588 }
3589
3590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3592 self.0.options = v.into();
3593 self
3594 }
3595
3596 pub async fn send(self) -> Result<longrunning::model::Operation> {
3603 (*self.0.stub)
3604 .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3605 .await
3606 .map(gax::response::Response::into_body)
3607 }
3608
3609 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3611 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3612 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3613 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3614
3615 let stub = self.0.stub.clone();
3616 let mut options = self.0.options.clone();
3617 options.set_retry_policy(gax::retry_policy::NeverRetry);
3618 let query = move |name| {
3619 let stub = stub.clone();
3620 let options = options.clone();
3621 async {
3622 let op = GetOperation::new(stub)
3623 .set_name(name)
3624 .with_options(options)
3625 .send()
3626 .await?;
3627 Ok(Operation::new(op))
3628 }
3629 };
3630
3631 let start = move || async {
3632 let op = self.send().await?;
3633 Ok(Operation::new(op))
3634 };
3635
3636 lro::internal::new_unit_response_poller(
3637 polling_error_policy,
3638 polling_backoff_policy,
3639 start,
3640 query,
3641 )
3642 }
3643
3644 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.0.request.name = v.into();
3649 self
3650 }
3651
3652 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3654 self.0.request.request_id = v.into();
3655 self
3656 }
3657
3658 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3660 self.0.request.etag = v.into();
3661 self
3662 }
3663 }
3664
3665 #[doc(hidden)]
3666 impl gax::options::internal::RequestBuilder for DeleteMulticloudDataTransferConfig {
3667 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3668 &mut self.0.options
3669 }
3670 }
3671
3672 #[derive(Clone, Debug)]
3694 pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3695
3696 impl ListDestinations {
3697 pub(crate) fn new(
3698 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3699 ) -> Self {
3700 Self(RequestBuilder::new(stub))
3701 }
3702
3703 pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3705 mut self,
3706 v: V,
3707 ) -> Self {
3708 self.0.request = v.into();
3709 self
3710 }
3711
3712 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3714 self.0.options = v.into();
3715 self
3716 }
3717
3718 pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3720 (*self.0.stub)
3721 .list_destinations(self.0.request, self.0.options)
3722 .await
3723 .map(gax::response::Response::into_body)
3724 }
3725
3726 pub fn by_page(
3728 self,
3729 ) -> impl gax::paginator::Paginator<crate::model::ListDestinationsResponse, gax::error::Error>
3730 {
3731 use std::clone::Clone;
3732 let token = self.0.request.page_token.clone();
3733 let execute = move |token: String| {
3734 let mut builder = self.clone();
3735 builder.0.request = builder.0.request.set_page_token(token);
3736 builder.send()
3737 };
3738 gax::paginator::internal::new_paginator(token, execute)
3739 }
3740
3741 pub fn by_item(
3743 self,
3744 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDestinationsResponse, gax::error::Error>
3745 {
3746 use gax::paginator::Paginator;
3747 self.by_page().items()
3748 }
3749
3750 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3754 self.0.request.parent = v.into();
3755 self
3756 }
3757
3758 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3760 self.0.request.page_size = v.into();
3761 self
3762 }
3763
3764 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3766 self.0.request.page_token = v.into();
3767 self
3768 }
3769
3770 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3772 self.0.request.filter = v.into();
3773 self
3774 }
3775
3776 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3778 self.0.request.order_by = v.into();
3779 self
3780 }
3781
3782 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3784 self.0.request.return_partial_success = v.into();
3785 self
3786 }
3787 }
3788
3789 #[doc(hidden)]
3790 impl gax::options::internal::RequestBuilder for ListDestinations {
3791 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3792 &mut self.0.options
3793 }
3794 }
3795
3796 #[derive(Clone, Debug)]
3814 pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3815
3816 impl GetDestination {
3817 pub(crate) fn new(
3818 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3819 ) -> Self {
3820 Self(RequestBuilder::new(stub))
3821 }
3822
3823 pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3825 self.0.request = v.into();
3826 self
3827 }
3828
3829 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3831 self.0.options = v.into();
3832 self
3833 }
3834
3835 pub async fn send(self) -> Result<crate::model::Destination> {
3837 (*self.0.stub)
3838 .get_destination(self.0.request, self.0.options)
3839 .await
3840 .map(gax::response::Response::into_body)
3841 }
3842
3843 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3847 self.0.request.name = v.into();
3848 self
3849 }
3850 }
3851
3852 #[doc(hidden)]
3853 impl gax::options::internal::RequestBuilder for GetDestination {
3854 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3855 &mut self.0.options
3856 }
3857 }
3858
3859 #[derive(Clone, Debug)]
3878 pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3879
3880 impl CreateDestination {
3881 pub(crate) fn new(
3882 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3883 ) -> Self {
3884 Self(RequestBuilder::new(stub))
3885 }
3886
3887 pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3889 mut self,
3890 v: V,
3891 ) -> Self {
3892 self.0.request = v.into();
3893 self
3894 }
3895
3896 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3898 self.0.options = v.into();
3899 self
3900 }
3901
3902 pub async fn send(self) -> Result<longrunning::model::Operation> {
3909 (*self.0.stub)
3910 .create_destination(self.0.request, self.0.options)
3911 .await
3912 .map(gax::response::Response::into_body)
3913 }
3914
3915 pub fn poller(
3917 self,
3918 ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
3919 type Operation = lro::internal::Operation<
3920 crate::model::Destination,
3921 crate::model::OperationMetadata,
3922 >;
3923 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3924 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3925
3926 let stub = self.0.stub.clone();
3927 let mut options = self.0.options.clone();
3928 options.set_retry_policy(gax::retry_policy::NeverRetry);
3929 let query = move |name| {
3930 let stub = stub.clone();
3931 let options = options.clone();
3932 async {
3933 let op = GetOperation::new(stub)
3934 .set_name(name)
3935 .with_options(options)
3936 .send()
3937 .await?;
3938 Ok(Operation::new(op))
3939 }
3940 };
3941
3942 let start = move || async {
3943 let op = self.send().await?;
3944 Ok(Operation::new(op))
3945 };
3946
3947 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3948 }
3949
3950 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3954 self.0.request.parent = v.into();
3955 self
3956 }
3957
3958 pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3962 self.0.request.destination_id = v.into();
3963 self
3964 }
3965
3966 pub fn set_destination<T>(mut self, v: T) -> Self
3970 where
3971 T: std::convert::Into<crate::model::Destination>,
3972 {
3973 self.0.request.destination = std::option::Option::Some(v.into());
3974 self
3975 }
3976
3977 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
3981 where
3982 T: std::convert::Into<crate::model::Destination>,
3983 {
3984 self.0.request.destination = v.map(|x| x.into());
3985 self
3986 }
3987
3988 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3990 self.0.request.request_id = v.into();
3991 self
3992 }
3993 }
3994
3995 #[doc(hidden)]
3996 impl gax::options::internal::RequestBuilder for CreateDestination {
3997 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3998 &mut self.0.options
3999 }
4000 }
4001
4002 #[derive(Clone, Debug)]
4021 pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4022
4023 impl UpdateDestination {
4024 pub(crate) fn new(
4025 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4026 ) -> Self {
4027 Self(RequestBuilder::new(stub))
4028 }
4029
4030 pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4032 mut self,
4033 v: V,
4034 ) -> Self {
4035 self.0.request = v.into();
4036 self
4037 }
4038
4039 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4041 self.0.options = v.into();
4042 self
4043 }
4044
4045 pub async fn send(self) -> Result<longrunning::model::Operation> {
4052 (*self.0.stub)
4053 .update_destination(self.0.request, self.0.options)
4054 .await
4055 .map(gax::response::Response::into_body)
4056 }
4057
4058 pub fn poller(
4060 self,
4061 ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
4062 type Operation = lro::internal::Operation<
4063 crate::model::Destination,
4064 crate::model::OperationMetadata,
4065 >;
4066 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4067 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4068
4069 let stub = self.0.stub.clone();
4070 let mut options = self.0.options.clone();
4071 options.set_retry_policy(gax::retry_policy::NeverRetry);
4072 let query = move |name| {
4073 let stub = stub.clone();
4074 let options = options.clone();
4075 async {
4076 let op = GetOperation::new(stub)
4077 .set_name(name)
4078 .with_options(options)
4079 .send()
4080 .await?;
4081 Ok(Operation::new(op))
4082 }
4083 };
4084
4085 let start = move || async {
4086 let op = self.send().await?;
4087 Ok(Operation::new(op))
4088 };
4089
4090 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4091 }
4092
4093 pub fn set_update_mask<T>(mut self, v: T) -> Self
4095 where
4096 T: std::convert::Into<wkt::FieldMask>,
4097 {
4098 self.0.request.update_mask = std::option::Option::Some(v.into());
4099 self
4100 }
4101
4102 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4104 where
4105 T: std::convert::Into<wkt::FieldMask>,
4106 {
4107 self.0.request.update_mask = v.map(|x| x.into());
4108 self
4109 }
4110
4111 pub fn set_destination<T>(mut self, v: T) -> Self
4115 where
4116 T: std::convert::Into<crate::model::Destination>,
4117 {
4118 self.0.request.destination = std::option::Option::Some(v.into());
4119 self
4120 }
4121
4122 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4126 where
4127 T: std::convert::Into<crate::model::Destination>,
4128 {
4129 self.0.request.destination = v.map(|x| x.into());
4130 self
4131 }
4132
4133 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4135 self.0.request.request_id = v.into();
4136 self
4137 }
4138 }
4139
4140 #[doc(hidden)]
4141 impl gax::options::internal::RequestBuilder for UpdateDestination {
4142 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4143 &mut self.0.options
4144 }
4145 }
4146
4147 #[derive(Clone, Debug)]
4166 pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4167
4168 impl DeleteDestination {
4169 pub(crate) fn new(
4170 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4171 ) -> Self {
4172 Self(RequestBuilder::new(stub))
4173 }
4174
4175 pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4177 mut self,
4178 v: V,
4179 ) -> Self {
4180 self.0.request = v.into();
4181 self
4182 }
4183
4184 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4186 self.0.options = v.into();
4187 self
4188 }
4189
4190 pub async fn send(self) -> Result<longrunning::model::Operation> {
4197 (*self.0.stub)
4198 .delete_destination(self.0.request, self.0.options)
4199 .await
4200 .map(gax::response::Response::into_body)
4201 }
4202
4203 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4205 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4206 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4207 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4208
4209 let stub = self.0.stub.clone();
4210 let mut options = self.0.options.clone();
4211 options.set_retry_policy(gax::retry_policy::NeverRetry);
4212 let query = move |name| {
4213 let stub = stub.clone();
4214 let options = options.clone();
4215 async {
4216 let op = GetOperation::new(stub)
4217 .set_name(name)
4218 .with_options(options)
4219 .send()
4220 .await?;
4221 Ok(Operation::new(op))
4222 }
4223 };
4224
4225 let start = move || async {
4226 let op = self.send().await?;
4227 Ok(Operation::new(op))
4228 };
4229
4230 lro::internal::new_unit_response_poller(
4231 polling_error_policy,
4232 polling_backoff_policy,
4233 start,
4234 query,
4235 )
4236 }
4237
4238 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4242 self.0.request.name = v.into();
4243 self
4244 }
4245
4246 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4248 self.0.request.request_id = v.into();
4249 self
4250 }
4251
4252 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4254 self.0.request.etag = v.into();
4255 self
4256 }
4257 }
4258
4259 #[doc(hidden)]
4260 impl gax::options::internal::RequestBuilder for DeleteDestination {
4261 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4262 &mut self.0.options
4263 }
4264 }
4265
4266 #[derive(Clone, Debug)]
4284 pub struct GetMulticloudDataTransferSupportedService(
4285 RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4286 );
4287
4288 impl GetMulticloudDataTransferSupportedService {
4289 pub(crate) fn new(
4290 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4291 ) -> Self {
4292 Self(RequestBuilder::new(stub))
4293 }
4294
4295 pub fn with_request<
4297 V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4298 >(
4299 mut self,
4300 v: V,
4301 ) -> Self {
4302 self.0.request = v.into();
4303 self
4304 }
4305
4306 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4308 self.0.options = v.into();
4309 self
4310 }
4311
4312 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4314 (*self.0.stub)
4315 .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4316 .await
4317 .map(gax::response::Response::into_body)
4318 }
4319
4320 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4324 self.0.request.name = v.into();
4325 self
4326 }
4327 }
4328
4329 #[doc(hidden)]
4330 impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferSupportedService {
4331 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4332 &mut self.0.options
4333 }
4334 }
4335
4336 #[derive(Clone, Debug)]
4358 pub struct ListMulticloudDataTransferSupportedServices(
4359 RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4360 );
4361
4362 impl ListMulticloudDataTransferSupportedServices {
4363 pub(crate) fn new(
4364 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4365 ) -> Self {
4366 Self(RequestBuilder::new(stub))
4367 }
4368
4369 pub fn with_request<
4371 V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4372 >(
4373 mut self,
4374 v: V,
4375 ) -> Self {
4376 self.0.request = v.into();
4377 self
4378 }
4379
4380 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4382 self.0.options = v.into();
4383 self
4384 }
4385
4386 pub async fn send(
4388 self,
4389 ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4390 (*self.0.stub)
4391 .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4392 .await
4393 .map(gax::response::Response::into_body)
4394 }
4395
4396 pub fn by_page(
4398 self,
4399 ) -> impl gax::paginator::Paginator<
4400 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4401 gax::error::Error,
4402 > {
4403 use std::clone::Clone;
4404 let token = self.0.request.page_token.clone();
4405 let execute = move |token: String| {
4406 let mut builder = self.clone();
4407 builder.0.request = builder.0.request.set_page_token(token);
4408 builder.send()
4409 };
4410 gax::paginator::internal::new_paginator(token, execute)
4411 }
4412
4413 pub fn by_item(
4415 self,
4416 ) -> impl gax::paginator::ItemPaginator<
4417 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4418 gax::error::Error,
4419 > {
4420 use gax::paginator::Paginator;
4421 self.by_page().items()
4422 }
4423
4424 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4428 self.0.request.parent = v.into();
4429 self
4430 }
4431
4432 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4434 self.0.request.page_size = v.into();
4435 self
4436 }
4437
4438 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4440 self.0.request.page_token = v.into();
4441 self
4442 }
4443 }
4444
4445 #[doc(hidden)]
4446 impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4447 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4448 &mut self.0.options
4449 }
4450 }
4451
4452 #[derive(Clone, Debug)]
4474 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4475
4476 impl ListLocations {
4477 pub(crate) fn new(
4478 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4479 ) -> Self {
4480 Self(RequestBuilder::new(stub))
4481 }
4482
4483 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4485 mut self,
4486 v: V,
4487 ) -> Self {
4488 self.0.request = v.into();
4489 self
4490 }
4491
4492 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4494 self.0.options = v.into();
4495 self
4496 }
4497
4498 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4500 (*self.0.stub)
4501 .list_locations(self.0.request, self.0.options)
4502 .await
4503 .map(gax::response::Response::into_body)
4504 }
4505
4506 pub fn by_page(
4508 self,
4509 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4510 {
4511 use std::clone::Clone;
4512 let token = self.0.request.page_token.clone();
4513 let execute = move |token: String| {
4514 let mut builder = self.clone();
4515 builder.0.request = builder.0.request.set_page_token(token);
4516 builder.send()
4517 };
4518 gax::paginator::internal::new_paginator(token, execute)
4519 }
4520
4521 pub fn by_item(
4523 self,
4524 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4525 {
4526 use gax::paginator::Paginator;
4527 self.by_page().items()
4528 }
4529
4530 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4532 self.0.request.name = v.into();
4533 self
4534 }
4535
4536 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4538 self.0.request.filter = v.into();
4539 self
4540 }
4541
4542 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4544 self.0.request.page_size = v.into();
4545 self
4546 }
4547
4548 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4550 self.0.request.page_token = v.into();
4551 self
4552 }
4553 }
4554
4555 #[doc(hidden)]
4556 impl gax::options::internal::RequestBuilder for ListLocations {
4557 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4558 &mut self.0.options
4559 }
4560 }
4561
4562 #[derive(Clone, Debug)]
4580 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4581
4582 impl GetLocation {
4583 pub(crate) fn new(
4584 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4585 ) -> Self {
4586 Self(RequestBuilder::new(stub))
4587 }
4588
4589 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4591 self.0.request = v.into();
4592 self
4593 }
4594
4595 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4597 self.0.options = v.into();
4598 self
4599 }
4600
4601 pub async fn send(self) -> Result<location::model::Location> {
4603 (*self.0.stub)
4604 .get_location(self.0.request, self.0.options)
4605 .await
4606 .map(gax::response::Response::into_body)
4607 }
4608
4609 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4611 self.0.request.name = v.into();
4612 self
4613 }
4614 }
4615
4616 #[doc(hidden)]
4617 impl gax::options::internal::RequestBuilder for GetLocation {
4618 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4619 &mut self.0.options
4620 }
4621 }
4622
4623 #[derive(Clone, Debug)]
4641 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4642
4643 impl SetIamPolicy {
4644 pub(crate) fn new(
4645 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4646 ) -> Self {
4647 Self(RequestBuilder::new(stub))
4648 }
4649
4650 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4652 self.0.request = v.into();
4653 self
4654 }
4655
4656 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4658 self.0.options = v.into();
4659 self
4660 }
4661
4662 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4664 (*self.0.stub)
4665 .set_iam_policy(self.0.request, self.0.options)
4666 .await
4667 .map(gax::response::Response::into_body)
4668 }
4669
4670 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4674 self.0.request.resource = v.into();
4675 self
4676 }
4677
4678 pub fn set_policy<T>(mut self, v: T) -> Self
4682 where
4683 T: std::convert::Into<iam_v1::model::Policy>,
4684 {
4685 self.0.request.policy = std::option::Option::Some(v.into());
4686 self
4687 }
4688
4689 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4693 where
4694 T: std::convert::Into<iam_v1::model::Policy>,
4695 {
4696 self.0.request.policy = v.map(|x| x.into());
4697 self
4698 }
4699
4700 pub fn set_update_mask<T>(mut self, v: T) -> Self
4702 where
4703 T: std::convert::Into<wkt::FieldMask>,
4704 {
4705 self.0.request.update_mask = std::option::Option::Some(v.into());
4706 self
4707 }
4708
4709 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4711 where
4712 T: std::convert::Into<wkt::FieldMask>,
4713 {
4714 self.0.request.update_mask = v.map(|x| x.into());
4715 self
4716 }
4717 }
4718
4719 #[doc(hidden)]
4720 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4721 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4722 &mut self.0.options
4723 }
4724 }
4725
4726 #[derive(Clone, Debug)]
4744 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4745
4746 impl GetIamPolicy {
4747 pub(crate) fn new(
4748 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4749 ) -> Self {
4750 Self(RequestBuilder::new(stub))
4751 }
4752
4753 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4755 self.0.request = v.into();
4756 self
4757 }
4758
4759 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4761 self.0.options = v.into();
4762 self
4763 }
4764
4765 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4767 (*self.0.stub)
4768 .get_iam_policy(self.0.request, self.0.options)
4769 .await
4770 .map(gax::response::Response::into_body)
4771 }
4772
4773 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4777 self.0.request.resource = v.into();
4778 self
4779 }
4780
4781 pub fn set_options<T>(mut self, v: T) -> Self
4783 where
4784 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4785 {
4786 self.0.request.options = std::option::Option::Some(v.into());
4787 self
4788 }
4789
4790 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4792 where
4793 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4794 {
4795 self.0.request.options = v.map(|x| x.into());
4796 self
4797 }
4798 }
4799
4800 #[doc(hidden)]
4801 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4802 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4803 &mut self.0.options
4804 }
4805 }
4806
4807 #[derive(Clone, Debug)]
4825 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4826
4827 impl TestIamPermissions {
4828 pub(crate) fn new(
4829 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4830 ) -> Self {
4831 Self(RequestBuilder::new(stub))
4832 }
4833
4834 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4836 mut self,
4837 v: V,
4838 ) -> Self {
4839 self.0.request = v.into();
4840 self
4841 }
4842
4843 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4845 self.0.options = v.into();
4846 self
4847 }
4848
4849 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4851 (*self.0.stub)
4852 .test_iam_permissions(self.0.request, self.0.options)
4853 .await
4854 .map(gax::response::Response::into_body)
4855 }
4856
4857 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4861 self.0.request.resource = v.into();
4862 self
4863 }
4864
4865 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4869 where
4870 T: std::iter::IntoIterator<Item = V>,
4871 V: std::convert::Into<std::string::String>,
4872 {
4873 use std::iter::Iterator;
4874 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4875 self
4876 }
4877 }
4878
4879 #[doc(hidden)]
4880 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4881 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4882 &mut self.0.options
4883 }
4884 }
4885
4886 #[derive(Clone, Debug)]
4908 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4909
4910 impl ListOperations {
4911 pub(crate) fn new(
4912 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4913 ) -> Self {
4914 Self(RequestBuilder::new(stub))
4915 }
4916
4917 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4919 mut self,
4920 v: V,
4921 ) -> Self {
4922 self.0.request = v.into();
4923 self
4924 }
4925
4926 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4928 self.0.options = v.into();
4929 self
4930 }
4931
4932 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4934 (*self.0.stub)
4935 .list_operations(self.0.request, self.0.options)
4936 .await
4937 .map(gax::response::Response::into_body)
4938 }
4939
4940 pub fn by_page(
4942 self,
4943 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4944 {
4945 use std::clone::Clone;
4946 let token = self.0.request.page_token.clone();
4947 let execute = move |token: String| {
4948 let mut builder = self.clone();
4949 builder.0.request = builder.0.request.set_page_token(token);
4950 builder.send()
4951 };
4952 gax::paginator::internal::new_paginator(token, execute)
4953 }
4954
4955 pub fn by_item(
4957 self,
4958 ) -> impl gax::paginator::ItemPaginator<
4959 longrunning::model::ListOperationsResponse,
4960 gax::error::Error,
4961 > {
4962 use gax::paginator::Paginator;
4963 self.by_page().items()
4964 }
4965
4966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4968 self.0.request.name = v.into();
4969 self
4970 }
4971
4972 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4974 self.0.request.filter = v.into();
4975 self
4976 }
4977
4978 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4980 self.0.request.page_size = v.into();
4981 self
4982 }
4983
4984 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4986 self.0.request.page_token = v.into();
4987 self
4988 }
4989
4990 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4992 self.0.request.return_partial_success = v.into();
4993 self
4994 }
4995 }
4996
4997 #[doc(hidden)]
4998 impl gax::options::internal::RequestBuilder for ListOperations {
4999 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5000 &mut self.0.options
5001 }
5002 }
5003
5004 #[derive(Clone, Debug)]
5022 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5023
5024 impl GetOperation {
5025 pub(crate) fn new(
5026 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5027 ) -> Self {
5028 Self(RequestBuilder::new(stub))
5029 }
5030
5031 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5033 mut self,
5034 v: V,
5035 ) -> Self {
5036 self.0.request = v.into();
5037 self
5038 }
5039
5040 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5042 self.0.options = v.into();
5043 self
5044 }
5045
5046 pub async fn send(self) -> Result<longrunning::model::Operation> {
5048 (*self.0.stub)
5049 .get_operation(self.0.request, self.0.options)
5050 .await
5051 .map(gax::response::Response::into_body)
5052 }
5053
5054 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5056 self.0.request.name = v.into();
5057 self
5058 }
5059 }
5060
5061 #[doc(hidden)]
5062 impl gax::options::internal::RequestBuilder for GetOperation {
5063 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5064 &mut self.0.options
5065 }
5066 }
5067
5068 #[derive(Clone, Debug)]
5086 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5087
5088 impl DeleteOperation {
5089 pub(crate) fn new(
5090 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5091 ) -> Self {
5092 Self(RequestBuilder::new(stub))
5093 }
5094
5095 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5097 mut self,
5098 v: V,
5099 ) -> Self {
5100 self.0.request = v.into();
5101 self
5102 }
5103
5104 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5106 self.0.options = v.into();
5107 self
5108 }
5109
5110 pub async fn send(self) -> Result<()> {
5112 (*self.0.stub)
5113 .delete_operation(self.0.request, self.0.options)
5114 .await
5115 .map(gax::response::Response::into_body)
5116 }
5117
5118 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5120 self.0.request.name = v.into();
5121 self
5122 }
5123 }
5124
5125 #[doc(hidden)]
5126 impl gax::options::internal::RequestBuilder for DeleteOperation {
5127 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5128 &mut self.0.options
5129 }
5130 }
5131
5132 #[derive(Clone, Debug)]
5150 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5151
5152 impl CancelOperation {
5153 pub(crate) fn new(
5154 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5155 ) -> Self {
5156 Self(RequestBuilder::new(stub))
5157 }
5158
5159 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5161 mut self,
5162 v: V,
5163 ) -> Self {
5164 self.0.request = v.into();
5165 self
5166 }
5167
5168 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5170 self.0.options = v.into();
5171 self
5172 }
5173
5174 pub async fn send(self) -> Result<()> {
5176 (*self.0.stub)
5177 .cancel_operation(self.0.request, self.0.options)
5178 .await
5179 .map(gax::response::Response::into_body)
5180 }
5181
5182 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5184 self.0.request.name = v.into();
5185 self
5186 }
5187 }
5188
5189 #[doc(hidden)]
5190 impl gax::options::internal::RequestBuilder for CancelOperation {
5191 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5192 &mut self.0.options
5193 }
5194 }
5195}
5196
5197pub mod hub_service {
5198 use crate::Result;
5199
5200 pub type ClientBuilder =
5214 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5215
5216 pub(crate) mod client {
5217 use super::super::super::client::HubService;
5218 pub struct Factory;
5219 impl gax::client_builder::internal::ClientFactory for Factory {
5220 type Client = HubService;
5221 type Credentials = gaxi::options::Credentials;
5222 async fn build(
5223 self,
5224 config: gaxi::options::ClientConfig,
5225 ) -> gax::client_builder::Result<Self::Client> {
5226 Self::Client::new(config).await
5227 }
5228 }
5229 }
5230
5231 #[derive(Clone, Debug)]
5233 pub(crate) struct RequestBuilder<R: std::default::Default> {
5234 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5235 request: R,
5236 options: gax::options::RequestOptions,
5237 }
5238
5239 impl<R> RequestBuilder<R>
5240 where
5241 R: std::default::Default,
5242 {
5243 pub(crate) fn new(
5244 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5245 ) -> Self {
5246 Self {
5247 stub,
5248 request: R::default(),
5249 options: gax::options::RequestOptions::default(),
5250 }
5251 }
5252 }
5253
5254 #[derive(Clone, Debug)]
5276 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5277
5278 impl ListHubs {
5279 pub(crate) fn new(
5280 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5281 ) -> Self {
5282 Self(RequestBuilder::new(stub))
5283 }
5284
5285 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5287 self.0.request = v.into();
5288 self
5289 }
5290
5291 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5293 self.0.options = v.into();
5294 self
5295 }
5296
5297 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5299 (*self.0.stub)
5300 .list_hubs(self.0.request, self.0.options)
5301 .await
5302 .map(gax::response::Response::into_body)
5303 }
5304
5305 pub fn by_page(
5307 self,
5308 ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
5309 {
5310 use std::clone::Clone;
5311 let token = self.0.request.page_token.clone();
5312 let execute = move |token: String| {
5313 let mut builder = self.clone();
5314 builder.0.request = builder.0.request.set_page_token(token);
5315 builder.send()
5316 };
5317 gax::paginator::internal::new_paginator(token, execute)
5318 }
5319
5320 pub fn by_item(
5322 self,
5323 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubsResponse, gax::error::Error>
5324 {
5325 use gax::paginator::Paginator;
5326 self.by_page().items()
5327 }
5328
5329 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5333 self.0.request.parent = v.into();
5334 self
5335 }
5336
5337 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5339 self.0.request.page_size = v.into();
5340 self
5341 }
5342
5343 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5345 self.0.request.page_token = v.into();
5346 self
5347 }
5348
5349 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5351 self.0.request.filter = v.into();
5352 self
5353 }
5354
5355 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5357 self.0.request.order_by = v.into();
5358 self
5359 }
5360 }
5361
5362 #[doc(hidden)]
5363 impl gax::options::internal::RequestBuilder for ListHubs {
5364 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5365 &mut self.0.options
5366 }
5367 }
5368
5369 #[derive(Clone, Debug)]
5387 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5388
5389 impl GetHub {
5390 pub(crate) fn new(
5391 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5392 ) -> Self {
5393 Self(RequestBuilder::new(stub))
5394 }
5395
5396 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5398 self.0.request = v.into();
5399 self
5400 }
5401
5402 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5404 self.0.options = v.into();
5405 self
5406 }
5407
5408 pub async fn send(self) -> Result<crate::model::Hub> {
5410 (*self.0.stub)
5411 .get_hub(self.0.request, self.0.options)
5412 .await
5413 .map(gax::response::Response::into_body)
5414 }
5415
5416 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5420 self.0.request.name = v.into();
5421 self
5422 }
5423 }
5424
5425 #[doc(hidden)]
5426 impl gax::options::internal::RequestBuilder for GetHub {
5427 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5428 &mut self.0.options
5429 }
5430 }
5431
5432 #[derive(Clone, Debug)]
5451 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5452
5453 impl CreateHub {
5454 pub(crate) fn new(
5455 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5456 ) -> Self {
5457 Self(RequestBuilder::new(stub))
5458 }
5459
5460 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5462 self.0.request = v.into();
5463 self
5464 }
5465
5466 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5468 self.0.options = v.into();
5469 self
5470 }
5471
5472 pub async fn send(self) -> Result<longrunning::model::Operation> {
5479 (*self.0.stub)
5480 .create_hub(self.0.request, self.0.options)
5481 .await
5482 .map(gax::response::Response::into_body)
5483 }
5484
5485 pub fn poller(
5487 self,
5488 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5489 type Operation =
5490 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5491 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5492 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5493
5494 let stub = self.0.stub.clone();
5495 let mut options = self.0.options.clone();
5496 options.set_retry_policy(gax::retry_policy::NeverRetry);
5497 let query = move |name| {
5498 let stub = stub.clone();
5499 let options = options.clone();
5500 async {
5501 let op = GetOperation::new(stub)
5502 .set_name(name)
5503 .with_options(options)
5504 .send()
5505 .await?;
5506 Ok(Operation::new(op))
5507 }
5508 };
5509
5510 let start = move || async {
5511 let op = self.send().await?;
5512 Ok(Operation::new(op))
5513 };
5514
5515 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5516 }
5517
5518 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5522 self.0.request.parent = v.into();
5523 self
5524 }
5525
5526 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5530 self.0.request.hub_id = v.into();
5531 self
5532 }
5533
5534 pub fn set_hub<T>(mut self, v: T) -> Self
5538 where
5539 T: std::convert::Into<crate::model::Hub>,
5540 {
5541 self.0.request.hub = std::option::Option::Some(v.into());
5542 self
5543 }
5544
5545 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5549 where
5550 T: std::convert::Into<crate::model::Hub>,
5551 {
5552 self.0.request.hub = v.map(|x| x.into());
5553 self
5554 }
5555
5556 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5558 self.0.request.request_id = v.into();
5559 self
5560 }
5561 }
5562
5563 #[doc(hidden)]
5564 impl gax::options::internal::RequestBuilder for CreateHub {
5565 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5566 &mut self.0.options
5567 }
5568 }
5569
5570 #[derive(Clone, Debug)]
5589 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5590
5591 impl UpdateHub {
5592 pub(crate) fn new(
5593 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5594 ) -> Self {
5595 Self(RequestBuilder::new(stub))
5596 }
5597
5598 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5600 self.0.request = v.into();
5601 self
5602 }
5603
5604 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5606 self.0.options = v.into();
5607 self
5608 }
5609
5610 pub async fn send(self) -> Result<longrunning::model::Operation> {
5617 (*self.0.stub)
5618 .update_hub(self.0.request, self.0.options)
5619 .await
5620 .map(gax::response::Response::into_body)
5621 }
5622
5623 pub fn poller(
5625 self,
5626 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5627 type Operation =
5628 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5629 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5630 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5631
5632 let stub = self.0.stub.clone();
5633 let mut options = self.0.options.clone();
5634 options.set_retry_policy(gax::retry_policy::NeverRetry);
5635 let query = move |name| {
5636 let stub = stub.clone();
5637 let options = options.clone();
5638 async {
5639 let op = GetOperation::new(stub)
5640 .set_name(name)
5641 .with_options(options)
5642 .send()
5643 .await?;
5644 Ok(Operation::new(op))
5645 }
5646 };
5647
5648 let start = move || async {
5649 let op = self.send().await?;
5650 Ok(Operation::new(op))
5651 };
5652
5653 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5654 }
5655
5656 pub fn set_update_mask<T>(mut self, v: T) -> Self
5658 where
5659 T: std::convert::Into<wkt::FieldMask>,
5660 {
5661 self.0.request.update_mask = std::option::Option::Some(v.into());
5662 self
5663 }
5664
5665 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5667 where
5668 T: std::convert::Into<wkt::FieldMask>,
5669 {
5670 self.0.request.update_mask = v.map(|x| x.into());
5671 self
5672 }
5673
5674 pub fn set_hub<T>(mut self, v: T) -> Self
5678 where
5679 T: std::convert::Into<crate::model::Hub>,
5680 {
5681 self.0.request.hub = std::option::Option::Some(v.into());
5682 self
5683 }
5684
5685 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5689 where
5690 T: std::convert::Into<crate::model::Hub>,
5691 {
5692 self.0.request.hub = v.map(|x| x.into());
5693 self
5694 }
5695
5696 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5698 self.0.request.request_id = v.into();
5699 self
5700 }
5701 }
5702
5703 #[doc(hidden)]
5704 impl gax::options::internal::RequestBuilder for UpdateHub {
5705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5706 &mut self.0.options
5707 }
5708 }
5709
5710 #[derive(Clone, Debug)]
5729 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5730
5731 impl DeleteHub {
5732 pub(crate) fn new(
5733 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5734 ) -> Self {
5735 Self(RequestBuilder::new(stub))
5736 }
5737
5738 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5740 self.0.request = v.into();
5741 self
5742 }
5743
5744 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5746 self.0.options = v.into();
5747 self
5748 }
5749
5750 pub async fn send(self) -> Result<longrunning::model::Operation> {
5757 (*self.0.stub)
5758 .delete_hub(self.0.request, self.0.options)
5759 .await
5760 .map(gax::response::Response::into_body)
5761 }
5762
5763 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5765 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5766 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5767 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5768
5769 let stub = self.0.stub.clone();
5770 let mut options = self.0.options.clone();
5771 options.set_retry_policy(gax::retry_policy::NeverRetry);
5772 let query = move |name| {
5773 let stub = stub.clone();
5774 let options = options.clone();
5775 async {
5776 let op = GetOperation::new(stub)
5777 .set_name(name)
5778 .with_options(options)
5779 .send()
5780 .await?;
5781 Ok(Operation::new(op))
5782 }
5783 };
5784
5785 let start = move || async {
5786 let op = self.send().await?;
5787 Ok(Operation::new(op))
5788 };
5789
5790 lro::internal::new_unit_response_poller(
5791 polling_error_policy,
5792 polling_backoff_policy,
5793 start,
5794 query,
5795 )
5796 }
5797
5798 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5802 self.0.request.name = v.into();
5803 self
5804 }
5805
5806 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5808 self.0.request.request_id = v.into();
5809 self
5810 }
5811 }
5812
5813 #[doc(hidden)]
5814 impl gax::options::internal::RequestBuilder for DeleteHub {
5815 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5816 &mut self.0.options
5817 }
5818 }
5819
5820 #[derive(Clone, Debug)]
5842 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5843
5844 impl ListHubSpokes {
5845 pub(crate) fn new(
5846 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5847 ) -> Self {
5848 Self(RequestBuilder::new(stub))
5849 }
5850
5851 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5853 self.0.request = v.into();
5854 self
5855 }
5856
5857 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5859 self.0.options = v.into();
5860 self
5861 }
5862
5863 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5865 (*self.0.stub)
5866 .list_hub_spokes(self.0.request, self.0.options)
5867 .await
5868 .map(gax::response::Response::into_body)
5869 }
5870
5871 pub fn by_page(
5873 self,
5874 ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5875 {
5876 use std::clone::Clone;
5877 let token = self.0.request.page_token.clone();
5878 let execute = move |token: String| {
5879 let mut builder = self.clone();
5880 builder.0.request = builder.0.request.set_page_token(token);
5881 builder.send()
5882 };
5883 gax::paginator::internal::new_paginator(token, execute)
5884 }
5885
5886 pub fn by_item(
5888 self,
5889 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5890 {
5891 use gax::paginator::Paginator;
5892 self.by_page().items()
5893 }
5894
5895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5899 self.0.request.name = v.into();
5900 self
5901 }
5902
5903 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5905 where
5906 T: std::iter::IntoIterator<Item = V>,
5907 V: std::convert::Into<std::string::String>,
5908 {
5909 use std::iter::Iterator;
5910 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5911 self
5912 }
5913
5914 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5916 self.0.request.page_size = v.into();
5917 self
5918 }
5919
5920 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5922 self.0.request.page_token = v.into();
5923 self
5924 }
5925
5926 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5928 self.0.request.filter = v.into();
5929 self
5930 }
5931
5932 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5934 self.0.request.order_by = v.into();
5935 self
5936 }
5937
5938 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
5940 mut self,
5941 v: T,
5942 ) -> Self {
5943 self.0.request.view = v.into();
5944 self
5945 }
5946 }
5947
5948 #[doc(hidden)]
5949 impl gax::options::internal::RequestBuilder for ListHubSpokes {
5950 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5951 &mut self.0.options
5952 }
5953 }
5954
5955 #[derive(Clone, Debug)]
5977 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
5978
5979 impl QueryHubStatus {
5980 pub(crate) fn new(
5981 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5982 ) -> Self {
5983 Self(RequestBuilder::new(stub))
5984 }
5985
5986 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
5988 self.0.request = v.into();
5989 self
5990 }
5991
5992 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5994 self.0.options = v.into();
5995 self
5996 }
5997
5998 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
6000 (*self.0.stub)
6001 .query_hub_status(self.0.request, self.0.options)
6002 .await
6003 .map(gax::response::Response::into_body)
6004 }
6005
6006 pub fn by_page(
6008 self,
6009 ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
6010 {
6011 use std::clone::Clone;
6012 let token = self.0.request.page_token.clone();
6013 let execute = move |token: String| {
6014 let mut builder = self.clone();
6015 builder.0.request = builder.0.request.set_page_token(token);
6016 builder.send()
6017 };
6018 gax::paginator::internal::new_paginator(token, execute)
6019 }
6020
6021 pub fn by_item(
6023 self,
6024 ) -> impl gax::paginator::ItemPaginator<crate::model::QueryHubStatusResponse, gax::error::Error>
6025 {
6026 use gax::paginator::Paginator;
6027 self.by_page().items()
6028 }
6029
6030 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6034 self.0.request.name = v.into();
6035 self
6036 }
6037
6038 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6040 self.0.request.page_size = v.into();
6041 self
6042 }
6043
6044 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6046 self.0.request.page_token = v.into();
6047 self
6048 }
6049
6050 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6052 self.0.request.filter = v.into();
6053 self
6054 }
6055
6056 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6058 self.0.request.order_by = v.into();
6059 self
6060 }
6061
6062 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6064 self.0.request.group_by = v.into();
6065 self
6066 }
6067 }
6068
6069 #[doc(hidden)]
6070 impl gax::options::internal::RequestBuilder for QueryHubStatus {
6071 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6072 &mut self.0.options
6073 }
6074 }
6075
6076 #[derive(Clone, Debug)]
6098 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6099
6100 impl ListSpokes {
6101 pub(crate) fn new(
6102 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6103 ) -> Self {
6104 Self(RequestBuilder::new(stub))
6105 }
6106
6107 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6109 self.0.request = v.into();
6110 self
6111 }
6112
6113 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6115 self.0.options = v.into();
6116 self
6117 }
6118
6119 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6121 (*self.0.stub)
6122 .list_spokes(self.0.request, self.0.options)
6123 .await
6124 .map(gax::response::Response::into_body)
6125 }
6126
6127 pub fn by_page(
6129 self,
6130 ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
6131 {
6132 use std::clone::Clone;
6133 let token = self.0.request.page_token.clone();
6134 let execute = move |token: String| {
6135 let mut builder = self.clone();
6136 builder.0.request = builder.0.request.set_page_token(token);
6137 builder.send()
6138 };
6139 gax::paginator::internal::new_paginator(token, execute)
6140 }
6141
6142 pub fn by_item(
6144 self,
6145 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpokesResponse, gax::error::Error>
6146 {
6147 use gax::paginator::Paginator;
6148 self.by_page().items()
6149 }
6150
6151 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6155 self.0.request.parent = v.into();
6156 self
6157 }
6158
6159 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6161 self.0.request.page_size = v.into();
6162 self
6163 }
6164
6165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6167 self.0.request.page_token = v.into();
6168 self
6169 }
6170
6171 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6173 self.0.request.filter = v.into();
6174 self
6175 }
6176
6177 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6179 self.0.request.order_by = v.into();
6180 self
6181 }
6182 }
6183
6184 #[doc(hidden)]
6185 impl gax::options::internal::RequestBuilder for ListSpokes {
6186 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6187 &mut self.0.options
6188 }
6189 }
6190
6191 #[derive(Clone, Debug)]
6209 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6210
6211 impl GetSpoke {
6212 pub(crate) fn new(
6213 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6214 ) -> Self {
6215 Self(RequestBuilder::new(stub))
6216 }
6217
6218 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6220 self.0.request = v.into();
6221 self
6222 }
6223
6224 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6226 self.0.options = v.into();
6227 self
6228 }
6229
6230 pub async fn send(self) -> Result<crate::model::Spoke> {
6232 (*self.0.stub)
6233 .get_spoke(self.0.request, self.0.options)
6234 .await
6235 .map(gax::response::Response::into_body)
6236 }
6237
6238 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6242 self.0.request.name = v.into();
6243 self
6244 }
6245 }
6246
6247 #[doc(hidden)]
6248 impl gax::options::internal::RequestBuilder for GetSpoke {
6249 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6250 &mut self.0.options
6251 }
6252 }
6253
6254 #[derive(Clone, Debug)]
6273 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6274
6275 impl CreateSpoke {
6276 pub(crate) fn new(
6277 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6278 ) -> Self {
6279 Self(RequestBuilder::new(stub))
6280 }
6281
6282 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6284 self.0.request = v.into();
6285 self
6286 }
6287
6288 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6290 self.0.options = v.into();
6291 self
6292 }
6293
6294 pub async fn send(self) -> Result<longrunning::model::Operation> {
6301 (*self.0.stub)
6302 .create_spoke(self.0.request, self.0.options)
6303 .await
6304 .map(gax::response::Response::into_body)
6305 }
6306
6307 pub fn poller(
6309 self,
6310 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6311 type Operation =
6312 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6315
6316 let stub = self.0.stub.clone();
6317 let mut options = self.0.options.clone();
6318 options.set_retry_policy(gax::retry_policy::NeverRetry);
6319 let query = move |name| {
6320 let stub = stub.clone();
6321 let options = options.clone();
6322 async {
6323 let op = GetOperation::new(stub)
6324 .set_name(name)
6325 .with_options(options)
6326 .send()
6327 .await?;
6328 Ok(Operation::new(op))
6329 }
6330 };
6331
6332 let start = move || async {
6333 let op = self.send().await?;
6334 Ok(Operation::new(op))
6335 };
6336
6337 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6338 }
6339
6340 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6344 self.0.request.parent = v.into();
6345 self
6346 }
6347
6348 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6352 self.0.request.spoke_id = v.into();
6353 self
6354 }
6355
6356 pub fn set_spoke<T>(mut self, v: T) -> Self
6360 where
6361 T: std::convert::Into<crate::model::Spoke>,
6362 {
6363 self.0.request.spoke = std::option::Option::Some(v.into());
6364 self
6365 }
6366
6367 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6371 where
6372 T: std::convert::Into<crate::model::Spoke>,
6373 {
6374 self.0.request.spoke = v.map(|x| x.into());
6375 self
6376 }
6377
6378 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6380 self.0.request.request_id = v.into();
6381 self
6382 }
6383 }
6384
6385 #[doc(hidden)]
6386 impl gax::options::internal::RequestBuilder for CreateSpoke {
6387 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6388 &mut self.0.options
6389 }
6390 }
6391
6392 #[derive(Clone, Debug)]
6411 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6412
6413 impl UpdateSpoke {
6414 pub(crate) fn new(
6415 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6416 ) -> Self {
6417 Self(RequestBuilder::new(stub))
6418 }
6419
6420 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6422 self.0.request = v.into();
6423 self
6424 }
6425
6426 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6428 self.0.options = v.into();
6429 self
6430 }
6431
6432 pub async fn send(self) -> Result<longrunning::model::Operation> {
6439 (*self.0.stub)
6440 .update_spoke(self.0.request, self.0.options)
6441 .await
6442 .map(gax::response::Response::into_body)
6443 }
6444
6445 pub fn poller(
6447 self,
6448 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6449 type Operation =
6450 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6451 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6452 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6453
6454 let stub = self.0.stub.clone();
6455 let mut options = self.0.options.clone();
6456 options.set_retry_policy(gax::retry_policy::NeverRetry);
6457 let query = move |name| {
6458 let stub = stub.clone();
6459 let options = options.clone();
6460 async {
6461 let op = GetOperation::new(stub)
6462 .set_name(name)
6463 .with_options(options)
6464 .send()
6465 .await?;
6466 Ok(Operation::new(op))
6467 }
6468 };
6469
6470 let start = move || async {
6471 let op = self.send().await?;
6472 Ok(Operation::new(op))
6473 };
6474
6475 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6476 }
6477
6478 pub fn set_update_mask<T>(mut self, v: T) -> Self
6480 where
6481 T: std::convert::Into<wkt::FieldMask>,
6482 {
6483 self.0.request.update_mask = std::option::Option::Some(v.into());
6484 self
6485 }
6486
6487 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6489 where
6490 T: std::convert::Into<wkt::FieldMask>,
6491 {
6492 self.0.request.update_mask = v.map(|x| x.into());
6493 self
6494 }
6495
6496 pub fn set_spoke<T>(mut self, v: T) -> Self
6500 where
6501 T: std::convert::Into<crate::model::Spoke>,
6502 {
6503 self.0.request.spoke = std::option::Option::Some(v.into());
6504 self
6505 }
6506
6507 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6511 where
6512 T: std::convert::Into<crate::model::Spoke>,
6513 {
6514 self.0.request.spoke = v.map(|x| x.into());
6515 self
6516 }
6517
6518 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6520 self.0.request.request_id = v.into();
6521 self
6522 }
6523 }
6524
6525 #[doc(hidden)]
6526 impl gax::options::internal::RequestBuilder for UpdateSpoke {
6527 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6528 &mut self.0.options
6529 }
6530 }
6531
6532 #[derive(Clone, Debug)]
6551 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6552
6553 impl RejectHubSpoke {
6554 pub(crate) fn new(
6555 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6556 ) -> Self {
6557 Self(RequestBuilder::new(stub))
6558 }
6559
6560 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6562 self.0.request = v.into();
6563 self
6564 }
6565
6566 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6568 self.0.options = v.into();
6569 self
6570 }
6571
6572 pub async fn send(self) -> Result<longrunning::model::Operation> {
6579 (*self.0.stub)
6580 .reject_hub_spoke(self.0.request, self.0.options)
6581 .await
6582 .map(gax::response::Response::into_body)
6583 }
6584
6585 pub fn poller(
6587 self,
6588 ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
6589 {
6590 type Operation = lro::internal::Operation<
6591 crate::model::RejectHubSpokeResponse,
6592 crate::model::OperationMetadata,
6593 >;
6594 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6595 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6596
6597 let stub = self.0.stub.clone();
6598 let mut options = self.0.options.clone();
6599 options.set_retry_policy(gax::retry_policy::NeverRetry);
6600 let query = move |name| {
6601 let stub = stub.clone();
6602 let options = options.clone();
6603 async {
6604 let op = GetOperation::new(stub)
6605 .set_name(name)
6606 .with_options(options)
6607 .send()
6608 .await?;
6609 Ok(Operation::new(op))
6610 }
6611 };
6612
6613 let start = move || async {
6614 let op = self.send().await?;
6615 Ok(Operation::new(op))
6616 };
6617
6618 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6619 }
6620
6621 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6625 self.0.request.name = v.into();
6626 self
6627 }
6628
6629 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6633 self.0.request.spoke_uri = v.into();
6634 self
6635 }
6636
6637 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6639 self.0.request.request_id = v.into();
6640 self
6641 }
6642
6643 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6645 self.0.request.details = v.into();
6646 self
6647 }
6648 }
6649
6650 #[doc(hidden)]
6651 impl gax::options::internal::RequestBuilder for RejectHubSpoke {
6652 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6653 &mut self.0.options
6654 }
6655 }
6656
6657 #[derive(Clone, Debug)]
6676 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6677
6678 impl AcceptHubSpoke {
6679 pub(crate) fn new(
6680 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6681 ) -> Self {
6682 Self(RequestBuilder::new(stub))
6683 }
6684
6685 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6687 self.0.request = v.into();
6688 self
6689 }
6690
6691 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6693 self.0.options = v.into();
6694 self
6695 }
6696
6697 pub async fn send(self) -> Result<longrunning::model::Operation> {
6704 (*self.0.stub)
6705 .accept_hub_spoke(self.0.request, self.0.options)
6706 .await
6707 .map(gax::response::Response::into_body)
6708 }
6709
6710 pub fn poller(
6712 self,
6713 ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
6714 {
6715 type Operation = lro::internal::Operation<
6716 crate::model::AcceptHubSpokeResponse,
6717 crate::model::OperationMetadata,
6718 >;
6719 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6720 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6721
6722 let stub = self.0.stub.clone();
6723 let mut options = self.0.options.clone();
6724 options.set_retry_policy(gax::retry_policy::NeverRetry);
6725 let query = move |name| {
6726 let stub = stub.clone();
6727 let options = options.clone();
6728 async {
6729 let op = GetOperation::new(stub)
6730 .set_name(name)
6731 .with_options(options)
6732 .send()
6733 .await?;
6734 Ok(Operation::new(op))
6735 }
6736 };
6737
6738 let start = move || async {
6739 let op = self.send().await?;
6740 Ok(Operation::new(op))
6741 };
6742
6743 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6744 }
6745
6746 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6750 self.0.request.name = v.into();
6751 self
6752 }
6753
6754 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6758 self.0.request.spoke_uri = v.into();
6759 self
6760 }
6761
6762 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6764 self.0.request.request_id = v.into();
6765 self
6766 }
6767 }
6768
6769 #[doc(hidden)]
6770 impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
6771 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6772 &mut self.0.options
6773 }
6774 }
6775
6776 #[derive(Clone, Debug)]
6795 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6796
6797 impl AcceptSpokeUpdate {
6798 pub(crate) fn new(
6799 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6800 ) -> Self {
6801 Self(RequestBuilder::new(stub))
6802 }
6803
6804 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6806 mut self,
6807 v: V,
6808 ) -> Self {
6809 self.0.request = v.into();
6810 self
6811 }
6812
6813 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6815 self.0.options = v.into();
6816 self
6817 }
6818
6819 pub async fn send(self) -> Result<longrunning::model::Operation> {
6826 (*self.0.stub)
6827 .accept_spoke_update(self.0.request, self.0.options)
6828 .await
6829 .map(gax::response::Response::into_body)
6830 }
6831
6832 pub fn poller(
6834 self,
6835 ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
6836 {
6837 type Operation = lro::internal::Operation<
6838 crate::model::AcceptSpokeUpdateResponse,
6839 crate::model::OperationMetadata,
6840 >;
6841 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6842 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6843
6844 let stub = self.0.stub.clone();
6845 let mut options = self.0.options.clone();
6846 options.set_retry_policy(gax::retry_policy::NeverRetry);
6847 let query = move |name| {
6848 let stub = stub.clone();
6849 let options = options.clone();
6850 async {
6851 let op = GetOperation::new(stub)
6852 .set_name(name)
6853 .with_options(options)
6854 .send()
6855 .await?;
6856 Ok(Operation::new(op))
6857 }
6858 };
6859
6860 let start = move || async {
6861 let op = self.send().await?;
6862 Ok(Operation::new(op))
6863 };
6864
6865 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6866 }
6867
6868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6872 self.0.request.name = v.into();
6873 self
6874 }
6875
6876 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6880 self.0.request.spoke_uri = v.into();
6881 self
6882 }
6883
6884 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6888 self.0.request.spoke_etag = v.into();
6889 self
6890 }
6891
6892 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6894 self.0.request.request_id = v.into();
6895 self
6896 }
6897 }
6898
6899 #[doc(hidden)]
6900 impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
6901 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6902 &mut self.0.options
6903 }
6904 }
6905
6906 #[derive(Clone, Debug)]
6925 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
6926
6927 impl RejectSpokeUpdate {
6928 pub(crate) fn new(
6929 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6930 ) -> Self {
6931 Self(RequestBuilder::new(stub))
6932 }
6933
6934 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
6936 mut self,
6937 v: V,
6938 ) -> Self {
6939 self.0.request = v.into();
6940 self
6941 }
6942
6943 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6945 self.0.options = v.into();
6946 self
6947 }
6948
6949 pub async fn send(self) -> Result<longrunning::model::Operation> {
6956 (*self.0.stub)
6957 .reject_spoke_update(self.0.request, self.0.options)
6958 .await
6959 .map(gax::response::Response::into_body)
6960 }
6961
6962 pub fn poller(
6964 self,
6965 ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
6966 {
6967 type Operation = lro::internal::Operation<
6968 crate::model::RejectSpokeUpdateResponse,
6969 crate::model::OperationMetadata,
6970 >;
6971 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6972 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6973
6974 let stub = self.0.stub.clone();
6975 let mut options = self.0.options.clone();
6976 options.set_retry_policy(gax::retry_policy::NeverRetry);
6977 let query = move |name| {
6978 let stub = stub.clone();
6979 let options = options.clone();
6980 async {
6981 let op = GetOperation::new(stub)
6982 .set_name(name)
6983 .with_options(options)
6984 .send()
6985 .await?;
6986 Ok(Operation::new(op))
6987 }
6988 };
6989
6990 let start = move || async {
6991 let op = self.send().await?;
6992 Ok(Operation::new(op))
6993 };
6994
6995 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6996 }
6997
6998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7002 self.0.request.name = v.into();
7003 self
7004 }
7005
7006 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7010 self.0.request.spoke_uri = v.into();
7011 self
7012 }
7013
7014 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7018 self.0.request.spoke_etag = v.into();
7019 self
7020 }
7021
7022 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7024 self.0.request.details = v.into();
7025 self
7026 }
7027
7028 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7030 self.0.request.request_id = v.into();
7031 self
7032 }
7033 }
7034
7035 #[doc(hidden)]
7036 impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
7037 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7038 &mut self.0.options
7039 }
7040 }
7041
7042 #[derive(Clone, Debug)]
7061 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7062
7063 impl DeleteSpoke {
7064 pub(crate) fn new(
7065 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7066 ) -> Self {
7067 Self(RequestBuilder::new(stub))
7068 }
7069
7070 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7072 self.0.request = v.into();
7073 self
7074 }
7075
7076 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7078 self.0.options = v.into();
7079 self
7080 }
7081
7082 pub async fn send(self) -> Result<longrunning::model::Operation> {
7089 (*self.0.stub)
7090 .delete_spoke(self.0.request, self.0.options)
7091 .await
7092 .map(gax::response::Response::into_body)
7093 }
7094
7095 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
7097 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7098 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7099 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7100
7101 let stub = self.0.stub.clone();
7102 let mut options = self.0.options.clone();
7103 options.set_retry_policy(gax::retry_policy::NeverRetry);
7104 let query = move |name| {
7105 let stub = stub.clone();
7106 let options = options.clone();
7107 async {
7108 let op = GetOperation::new(stub)
7109 .set_name(name)
7110 .with_options(options)
7111 .send()
7112 .await?;
7113 Ok(Operation::new(op))
7114 }
7115 };
7116
7117 let start = move || async {
7118 let op = self.send().await?;
7119 Ok(Operation::new(op))
7120 };
7121
7122 lro::internal::new_unit_response_poller(
7123 polling_error_policy,
7124 polling_backoff_policy,
7125 start,
7126 query,
7127 )
7128 }
7129
7130 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7134 self.0.request.name = v.into();
7135 self
7136 }
7137
7138 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7140 self.0.request.request_id = v.into();
7141 self
7142 }
7143 }
7144
7145 #[doc(hidden)]
7146 impl gax::options::internal::RequestBuilder for DeleteSpoke {
7147 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7148 &mut self.0.options
7149 }
7150 }
7151
7152 #[derive(Clone, Debug)]
7170 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7171
7172 impl GetRouteTable {
7173 pub(crate) fn new(
7174 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7175 ) -> Self {
7176 Self(RequestBuilder::new(stub))
7177 }
7178
7179 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7181 self.0.request = v.into();
7182 self
7183 }
7184
7185 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7187 self.0.options = v.into();
7188 self
7189 }
7190
7191 pub async fn send(self) -> Result<crate::model::RouteTable> {
7193 (*self.0.stub)
7194 .get_route_table(self.0.request, self.0.options)
7195 .await
7196 .map(gax::response::Response::into_body)
7197 }
7198
7199 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7203 self.0.request.name = v.into();
7204 self
7205 }
7206 }
7207
7208 #[doc(hidden)]
7209 impl gax::options::internal::RequestBuilder for GetRouteTable {
7210 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7211 &mut self.0.options
7212 }
7213 }
7214
7215 #[derive(Clone, Debug)]
7233 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7234
7235 impl GetRoute {
7236 pub(crate) fn new(
7237 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7238 ) -> Self {
7239 Self(RequestBuilder::new(stub))
7240 }
7241
7242 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7244 self.0.request = v.into();
7245 self
7246 }
7247
7248 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7250 self.0.options = v.into();
7251 self
7252 }
7253
7254 pub async fn send(self) -> Result<crate::model::Route> {
7256 (*self.0.stub)
7257 .get_route(self.0.request, self.0.options)
7258 .await
7259 .map(gax::response::Response::into_body)
7260 }
7261
7262 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7266 self.0.request.name = v.into();
7267 self
7268 }
7269 }
7270
7271 #[doc(hidden)]
7272 impl gax::options::internal::RequestBuilder for GetRoute {
7273 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7274 &mut self.0.options
7275 }
7276 }
7277
7278 #[derive(Clone, Debug)]
7300 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7301
7302 impl ListRoutes {
7303 pub(crate) fn new(
7304 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7305 ) -> Self {
7306 Self(RequestBuilder::new(stub))
7307 }
7308
7309 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7311 self.0.request = v.into();
7312 self
7313 }
7314
7315 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7317 self.0.options = v.into();
7318 self
7319 }
7320
7321 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7323 (*self.0.stub)
7324 .list_routes(self.0.request, self.0.options)
7325 .await
7326 .map(gax::response::Response::into_body)
7327 }
7328
7329 pub fn by_page(
7331 self,
7332 ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
7333 {
7334 use std::clone::Clone;
7335 let token = self.0.request.page_token.clone();
7336 let execute = move |token: String| {
7337 let mut builder = self.clone();
7338 builder.0.request = builder.0.request.set_page_token(token);
7339 builder.send()
7340 };
7341 gax::paginator::internal::new_paginator(token, execute)
7342 }
7343
7344 pub fn by_item(
7346 self,
7347 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
7348 {
7349 use gax::paginator::Paginator;
7350 self.by_page().items()
7351 }
7352
7353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7357 self.0.request.parent = v.into();
7358 self
7359 }
7360
7361 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7363 self.0.request.page_size = v.into();
7364 self
7365 }
7366
7367 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7369 self.0.request.page_token = v.into();
7370 self
7371 }
7372
7373 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7375 self.0.request.filter = v.into();
7376 self
7377 }
7378
7379 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7381 self.0.request.order_by = v.into();
7382 self
7383 }
7384 }
7385
7386 #[doc(hidden)]
7387 impl gax::options::internal::RequestBuilder for ListRoutes {
7388 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7389 &mut self.0.options
7390 }
7391 }
7392
7393 #[derive(Clone, Debug)]
7415 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7416
7417 impl ListRouteTables {
7418 pub(crate) fn new(
7419 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7420 ) -> Self {
7421 Self(RequestBuilder::new(stub))
7422 }
7423
7424 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7426 self.0.request = v.into();
7427 self
7428 }
7429
7430 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7432 self.0.options = v.into();
7433 self
7434 }
7435
7436 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7438 (*self.0.stub)
7439 .list_route_tables(self.0.request, self.0.options)
7440 .await
7441 .map(gax::response::Response::into_body)
7442 }
7443
7444 pub fn by_page(
7446 self,
7447 ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7448 {
7449 use std::clone::Clone;
7450 let token = self.0.request.page_token.clone();
7451 let execute = move |token: String| {
7452 let mut builder = self.clone();
7453 builder.0.request = builder.0.request.set_page_token(token);
7454 builder.send()
7455 };
7456 gax::paginator::internal::new_paginator(token, execute)
7457 }
7458
7459 pub fn by_item(
7461 self,
7462 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7463 {
7464 use gax::paginator::Paginator;
7465 self.by_page().items()
7466 }
7467
7468 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7472 self.0.request.parent = v.into();
7473 self
7474 }
7475
7476 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7478 self.0.request.page_size = v.into();
7479 self
7480 }
7481
7482 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7484 self.0.request.page_token = v.into();
7485 self
7486 }
7487
7488 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7490 self.0.request.filter = v.into();
7491 self
7492 }
7493
7494 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7496 self.0.request.order_by = v.into();
7497 self
7498 }
7499 }
7500
7501 #[doc(hidden)]
7502 impl gax::options::internal::RequestBuilder for ListRouteTables {
7503 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7504 &mut self.0.options
7505 }
7506 }
7507
7508 #[derive(Clone, Debug)]
7526 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7527
7528 impl GetGroup {
7529 pub(crate) fn new(
7530 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7531 ) -> Self {
7532 Self(RequestBuilder::new(stub))
7533 }
7534
7535 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7537 self.0.request = v.into();
7538 self
7539 }
7540
7541 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7543 self.0.options = v.into();
7544 self
7545 }
7546
7547 pub async fn send(self) -> Result<crate::model::Group> {
7549 (*self.0.stub)
7550 .get_group(self.0.request, self.0.options)
7551 .await
7552 .map(gax::response::Response::into_body)
7553 }
7554
7555 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7559 self.0.request.name = v.into();
7560 self
7561 }
7562 }
7563
7564 #[doc(hidden)]
7565 impl gax::options::internal::RequestBuilder for GetGroup {
7566 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7567 &mut self.0.options
7568 }
7569 }
7570
7571 #[derive(Clone, Debug)]
7593 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7594
7595 impl ListGroups {
7596 pub(crate) fn new(
7597 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7598 ) -> Self {
7599 Self(RequestBuilder::new(stub))
7600 }
7601
7602 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7604 self.0.request = v.into();
7605 self
7606 }
7607
7608 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7610 self.0.options = v.into();
7611 self
7612 }
7613
7614 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7616 (*self.0.stub)
7617 .list_groups(self.0.request, self.0.options)
7618 .await
7619 .map(gax::response::Response::into_body)
7620 }
7621
7622 pub fn by_page(
7624 self,
7625 ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
7626 {
7627 use std::clone::Clone;
7628 let token = self.0.request.page_token.clone();
7629 let execute = move |token: String| {
7630 let mut builder = self.clone();
7631 builder.0.request = builder.0.request.set_page_token(token);
7632 builder.send()
7633 };
7634 gax::paginator::internal::new_paginator(token, execute)
7635 }
7636
7637 pub fn by_item(
7639 self,
7640 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGroupsResponse, gax::error::Error>
7641 {
7642 use gax::paginator::Paginator;
7643 self.by_page().items()
7644 }
7645
7646 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7650 self.0.request.parent = v.into();
7651 self
7652 }
7653
7654 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7656 self.0.request.page_size = v.into();
7657 self
7658 }
7659
7660 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7662 self.0.request.page_token = v.into();
7663 self
7664 }
7665
7666 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7668 self.0.request.filter = v.into();
7669 self
7670 }
7671
7672 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7674 self.0.request.order_by = v.into();
7675 self
7676 }
7677 }
7678
7679 #[doc(hidden)]
7680 impl gax::options::internal::RequestBuilder for ListGroups {
7681 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7682 &mut self.0.options
7683 }
7684 }
7685
7686 #[derive(Clone, Debug)]
7705 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7706
7707 impl UpdateGroup {
7708 pub(crate) fn new(
7709 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7710 ) -> Self {
7711 Self(RequestBuilder::new(stub))
7712 }
7713
7714 pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7716 self.0.request = v.into();
7717 self
7718 }
7719
7720 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7722 self.0.options = v.into();
7723 self
7724 }
7725
7726 pub async fn send(self) -> Result<longrunning::model::Operation> {
7733 (*self.0.stub)
7734 .update_group(self.0.request, self.0.options)
7735 .await
7736 .map(gax::response::Response::into_body)
7737 }
7738
7739 pub fn poller(
7741 self,
7742 ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
7743 type Operation =
7744 lro::internal::Operation<crate::model::Group, crate::model::OperationMetadata>;
7745 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7746 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7747
7748 let stub = self.0.stub.clone();
7749 let mut options = self.0.options.clone();
7750 options.set_retry_policy(gax::retry_policy::NeverRetry);
7751 let query = move |name| {
7752 let stub = stub.clone();
7753 let options = options.clone();
7754 async {
7755 let op = GetOperation::new(stub)
7756 .set_name(name)
7757 .with_options(options)
7758 .send()
7759 .await?;
7760 Ok(Operation::new(op))
7761 }
7762 };
7763
7764 let start = move || async {
7765 let op = self.send().await?;
7766 Ok(Operation::new(op))
7767 };
7768
7769 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7770 }
7771
7772 pub fn set_update_mask<T>(mut self, v: T) -> Self
7774 where
7775 T: std::convert::Into<wkt::FieldMask>,
7776 {
7777 self.0.request.update_mask = std::option::Option::Some(v.into());
7778 self
7779 }
7780
7781 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7783 where
7784 T: std::convert::Into<wkt::FieldMask>,
7785 {
7786 self.0.request.update_mask = v.map(|x| x.into());
7787 self
7788 }
7789
7790 pub fn set_group<T>(mut self, v: T) -> Self
7794 where
7795 T: std::convert::Into<crate::model::Group>,
7796 {
7797 self.0.request.group = std::option::Option::Some(v.into());
7798 self
7799 }
7800
7801 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7805 where
7806 T: std::convert::Into<crate::model::Group>,
7807 {
7808 self.0.request.group = v.map(|x| x.into());
7809 self
7810 }
7811
7812 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7814 self.0.request.request_id = v.into();
7815 self
7816 }
7817 }
7818
7819 #[doc(hidden)]
7820 impl gax::options::internal::RequestBuilder for UpdateGroup {
7821 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7822 &mut self.0.options
7823 }
7824 }
7825
7826 #[derive(Clone, Debug)]
7848 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7849
7850 impl ListLocations {
7851 pub(crate) fn new(
7852 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7853 ) -> Self {
7854 Self(RequestBuilder::new(stub))
7855 }
7856
7857 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7859 mut self,
7860 v: V,
7861 ) -> Self {
7862 self.0.request = v.into();
7863 self
7864 }
7865
7866 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7868 self.0.options = v.into();
7869 self
7870 }
7871
7872 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7874 (*self.0.stub)
7875 .list_locations(self.0.request, self.0.options)
7876 .await
7877 .map(gax::response::Response::into_body)
7878 }
7879
7880 pub fn by_page(
7882 self,
7883 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7884 {
7885 use std::clone::Clone;
7886 let token = self.0.request.page_token.clone();
7887 let execute = move |token: String| {
7888 let mut builder = self.clone();
7889 builder.0.request = builder.0.request.set_page_token(token);
7890 builder.send()
7891 };
7892 gax::paginator::internal::new_paginator(token, execute)
7893 }
7894
7895 pub fn by_item(
7897 self,
7898 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7899 {
7900 use gax::paginator::Paginator;
7901 self.by_page().items()
7902 }
7903
7904 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7906 self.0.request.name = v.into();
7907 self
7908 }
7909
7910 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7912 self.0.request.filter = v.into();
7913 self
7914 }
7915
7916 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7918 self.0.request.page_size = v.into();
7919 self
7920 }
7921
7922 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7924 self.0.request.page_token = v.into();
7925 self
7926 }
7927 }
7928
7929 #[doc(hidden)]
7930 impl gax::options::internal::RequestBuilder for ListLocations {
7931 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7932 &mut self.0.options
7933 }
7934 }
7935
7936 #[derive(Clone, Debug)]
7954 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7955
7956 impl GetLocation {
7957 pub(crate) fn new(
7958 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7959 ) -> Self {
7960 Self(RequestBuilder::new(stub))
7961 }
7962
7963 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7965 self.0.request = v.into();
7966 self
7967 }
7968
7969 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7971 self.0.options = v.into();
7972 self
7973 }
7974
7975 pub async fn send(self) -> Result<location::model::Location> {
7977 (*self.0.stub)
7978 .get_location(self.0.request, self.0.options)
7979 .await
7980 .map(gax::response::Response::into_body)
7981 }
7982
7983 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7985 self.0.request.name = v.into();
7986 self
7987 }
7988 }
7989
7990 #[doc(hidden)]
7991 impl gax::options::internal::RequestBuilder for GetLocation {
7992 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7993 &mut self.0.options
7994 }
7995 }
7996
7997 #[derive(Clone, Debug)]
8015 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
8016
8017 impl SetIamPolicy {
8018 pub(crate) fn new(
8019 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8020 ) -> Self {
8021 Self(RequestBuilder::new(stub))
8022 }
8023
8024 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
8026 self.0.request = v.into();
8027 self
8028 }
8029
8030 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8032 self.0.options = v.into();
8033 self
8034 }
8035
8036 pub async fn send(self) -> Result<iam_v1::model::Policy> {
8038 (*self.0.stub)
8039 .set_iam_policy(self.0.request, self.0.options)
8040 .await
8041 .map(gax::response::Response::into_body)
8042 }
8043
8044 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8048 self.0.request.resource = v.into();
8049 self
8050 }
8051
8052 pub fn set_policy<T>(mut self, v: T) -> Self
8056 where
8057 T: std::convert::Into<iam_v1::model::Policy>,
8058 {
8059 self.0.request.policy = std::option::Option::Some(v.into());
8060 self
8061 }
8062
8063 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8067 where
8068 T: std::convert::Into<iam_v1::model::Policy>,
8069 {
8070 self.0.request.policy = v.map(|x| x.into());
8071 self
8072 }
8073
8074 pub fn set_update_mask<T>(mut self, v: T) -> Self
8076 where
8077 T: std::convert::Into<wkt::FieldMask>,
8078 {
8079 self.0.request.update_mask = std::option::Option::Some(v.into());
8080 self
8081 }
8082
8083 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8085 where
8086 T: std::convert::Into<wkt::FieldMask>,
8087 {
8088 self.0.request.update_mask = v.map(|x| x.into());
8089 self
8090 }
8091 }
8092
8093 #[doc(hidden)]
8094 impl gax::options::internal::RequestBuilder for SetIamPolicy {
8095 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8096 &mut self.0.options
8097 }
8098 }
8099
8100 #[derive(Clone, Debug)]
8118 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
8119
8120 impl GetIamPolicy {
8121 pub(crate) fn new(
8122 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8123 ) -> Self {
8124 Self(RequestBuilder::new(stub))
8125 }
8126
8127 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
8129 self.0.request = v.into();
8130 self
8131 }
8132
8133 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8135 self.0.options = v.into();
8136 self
8137 }
8138
8139 pub async fn send(self) -> Result<iam_v1::model::Policy> {
8141 (*self.0.stub)
8142 .get_iam_policy(self.0.request, self.0.options)
8143 .await
8144 .map(gax::response::Response::into_body)
8145 }
8146
8147 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8151 self.0.request.resource = v.into();
8152 self
8153 }
8154
8155 pub fn set_options<T>(mut self, v: T) -> Self
8157 where
8158 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8159 {
8160 self.0.request.options = std::option::Option::Some(v.into());
8161 self
8162 }
8163
8164 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8166 where
8167 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8168 {
8169 self.0.request.options = v.map(|x| x.into());
8170 self
8171 }
8172 }
8173
8174 #[doc(hidden)]
8175 impl gax::options::internal::RequestBuilder for GetIamPolicy {
8176 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8177 &mut self.0.options
8178 }
8179 }
8180
8181 #[derive(Clone, Debug)]
8199 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8200
8201 impl TestIamPermissions {
8202 pub(crate) fn new(
8203 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8204 ) -> Self {
8205 Self(RequestBuilder::new(stub))
8206 }
8207
8208 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8210 mut self,
8211 v: V,
8212 ) -> Self {
8213 self.0.request = v.into();
8214 self
8215 }
8216
8217 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8219 self.0.options = v.into();
8220 self
8221 }
8222
8223 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8225 (*self.0.stub)
8226 .test_iam_permissions(self.0.request, self.0.options)
8227 .await
8228 .map(gax::response::Response::into_body)
8229 }
8230
8231 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8235 self.0.request.resource = v.into();
8236 self
8237 }
8238
8239 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8243 where
8244 T: std::iter::IntoIterator<Item = V>,
8245 V: std::convert::Into<std::string::String>,
8246 {
8247 use std::iter::Iterator;
8248 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8249 self
8250 }
8251 }
8252
8253 #[doc(hidden)]
8254 impl gax::options::internal::RequestBuilder for TestIamPermissions {
8255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8256 &mut self.0.options
8257 }
8258 }
8259
8260 #[derive(Clone, Debug)]
8282 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8283
8284 impl ListOperations {
8285 pub(crate) fn new(
8286 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8287 ) -> Self {
8288 Self(RequestBuilder::new(stub))
8289 }
8290
8291 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8293 mut self,
8294 v: V,
8295 ) -> Self {
8296 self.0.request = v.into();
8297 self
8298 }
8299
8300 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8302 self.0.options = v.into();
8303 self
8304 }
8305
8306 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8308 (*self.0.stub)
8309 .list_operations(self.0.request, self.0.options)
8310 .await
8311 .map(gax::response::Response::into_body)
8312 }
8313
8314 pub fn by_page(
8316 self,
8317 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8318 {
8319 use std::clone::Clone;
8320 let token = self.0.request.page_token.clone();
8321 let execute = move |token: String| {
8322 let mut builder = self.clone();
8323 builder.0.request = builder.0.request.set_page_token(token);
8324 builder.send()
8325 };
8326 gax::paginator::internal::new_paginator(token, execute)
8327 }
8328
8329 pub fn by_item(
8331 self,
8332 ) -> impl gax::paginator::ItemPaginator<
8333 longrunning::model::ListOperationsResponse,
8334 gax::error::Error,
8335 > {
8336 use gax::paginator::Paginator;
8337 self.by_page().items()
8338 }
8339
8340 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8342 self.0.request.name = v.into();
8343 self
8344 }
8345
8346 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8348 self.0.request.filter = v.into();
8349 self
8350 }
8351
8352 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8354 self.0.request.page_size = v.into();
8355 self
8356 }
8357
8358 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8360 self.0.request.page_token = v.into();
8361 self
8362 }
8363
8364 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8366 self.0.request.return_partial_success = v.into();
8367 self
8368 }
8369 }
8370
8371 #[doc(hidden)]
8372 impl gax::options::internal::RequestBuilder for ListOperations {
8373 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8374 &mut self.0.options
8375 }
8376 }
8377
8378 #[derive(Clone, Debug)]
8396 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8397
8398 impl GetOperation {
8399 pub(crate) fn new(
8400 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8401 ) -> Self {
8402 Self(RequestBuilder::new(stub))
8403 }
8404
8405 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8407 mut self,
8408 v: V,
8409 ) -> Self {
8410 self.0.request = v.into();
8411 self
8412 }
8413
8414 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8416 self.0.options = v.into();
8417 self
8418 }
8419
8420 pub async fn send(self) -> Result<longrunning::model::Operation> {
8422 (*self.0.stub)
8423 .get_operation(self.0.request, self.0.options)
8424 .await
8425 .map(gax::response::Response::into_body)
8426 }
8427
8428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8430 self.0.request.name = v.into();
8431 self
8432 }
8433 }
8434
8435 #[doc(hidden)]
8436 impl gax::options::internal::RequestBuilder for GetOperation {
8437 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8438 &mut self.0.options
8439 }
8440 }
8441
8442 #[derive(Clone, Debug)]
8460 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8461
8462 impl DeleteOperation {
8463 pub(crate) fn new(
8464 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8465 ) -> Self {
8466 Self(RequestBuilder::new(stub))
8467 }
8468
8469 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8471 mut self,
8472 v: V,
8473 ) -> Self {
8474 self.0.request = v.into();
8475 self
8476 }
8477
8478 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8480 self.0.options = v.into();
8481 self
8482 }
8483
8484 pub async fn send(self) -> Result<()> {
8486 (*self.0.stub)
8487 .delete_operation(self.0.request, self.0.options)
8488 .await
8489 .map(gax::response::Response::into_body)
8490 }
8491
8492 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8494 self.0.request.name = v.into();
8495 self
8496 }
8497 }
8498
8499 #[doc(hidden)]
8500 impl gax::options::internal::RequestBuilder for DeleteOperation {
8501 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8502 &mut self.0.options
8503 }
8504 }
8505
8506 #[derive(Clone, Debug)]
8524 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8525
8526 impl CancelOperation {
8527 pub(crate) fn new(
8528 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8529 ) -> Self {
8530 Self(RequestBuilder::new(stub))
8531 }
8532
8533 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8535 mut self,
8536 v: V,
8537 ) -> Self {
8538 self.0.request = v.into();
8539 self
8540 }
8541
8542 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8544 self.0.options = v.into();
8545 self
8546 }
8547
8548 pub async fn send(self) -> Result<()> {
8550 (*self.0.stub)
8551 .cancel_operation(self.0.request, self.0.options)
8552 .await
8553 .map(gax::response::Response::into_body)
8554 }
8555
8556 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8558 self.0.request.name = v.into();
8559 self
8560 }
8561 }
8562
8563 #[doc(hidden)]
8564 impl gax::options::internal::RequestBuilder for CancelOperation {
8565 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8566 &mut self.0.options
8567 }
8568 }
8569}
8570
8571pub mod internal_range_service {
8572 use crate::Result;
8573
8574 pub type ClientBuilder =
8588 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8589
8590 pub(crate) mod client {
8591 use super::super::super::client::InternalRangeService;
8592 pub struct Factory;
8593 impl gax::client_builder::internal::ClientFactory for Factory {
8594 type Client = InternalRangeService;
8595 type Credentials = gaxi::options::Credentials;
8596 async fn build(
8597 self,
8598 config: gaxi::options::ClientConfig,
8599 ) -> gax::client_builder::Result<Self::Client> {
8600 Self::Client::new(config).await
8601 }
8602 }
8603 }
8604
8605 #[derive(Clone, Debug)]
8607 pub(crate) struct RequestBuilder<R: std::default::Default> {
8608 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8609 request: R,
8610 options: gax::options::RequestOptions,
8611 }
8612
8613 impl<R> RequestBuilder<R>
8614 where
8615 R: std::default::Default,
8616 {
8617 pub(crate) fn new(
8618 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8619 ) -> Self {
8620 Self {
8621 stub,
8622 request: R::default(),
8623 options: gax::options::RequestOptions::default(),
8624 }
8625 }
8626 }
8627
8628 #[derive(Clone, Debug)]
8650 pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8651
8652 impl ListInternalRanges {
8653 pub(crate) fn new(
8654 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8655 ) -> Self {
8656 Self(RequestBuilder::new(stub))
8657 }
8658
8659 pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8661 mut self,
8662 v: V,
8663 ) -> Self {
8664 self.0.request = v.into();
8665 self
8666 }
8667
8668 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8670 self.0.options = v.into();
8671 self
8672 }
8673
8674 pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8676 (*self.0.stub)
8677 .list_internal_ranges(self.0.request, self.0.options)
8678 .await
8679 .map(gax::response::Response::into_body)
8680 }
8681
8682 pub fn by_page(
8684 self,
8685 ) -> impl gax::paginator::Paginator<crate::model::ListInternalRangesResponse, gax::error::Error>
8686 {
8687 use std::clone::Clone;
8688 let token = self.0.request.page_token.clone();
8689 let execute = move |token: String| {
8690 let mut builder = self.clone();
8691 builder.0.request = builder.0.request.set_page_token(token);
8692 builder.send()
8693 };
8694 gax::paginator::internal::new_paginator(token, execute)
8695 }
8696
8697 pub fn by_item(
8699 self,
8700 ) -> impl gax::paginator::ItemPaginator<
8701 crate::model::ListInternalRangesResponse,
8702 gax::error::Error,
8703 > {
8704 use gax::paginator::Paginator;
8705 self.by_page().items()
8706 }
8707
8708 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712 self.0.request.parent = v.into();
8713 self
8714 }
8715
8716 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8718 self.0.request.page_size = v.into();
8719 self
8720 }
8721
8722 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8724 self.0.request.page_token = v.into();
8725 self
8726 }
8727
8728 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8730 self.0.request.filter = v.into();
8731 self
8732 }
8733
8734 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8736 self.0.request.order_by = v.into();
8737 self
8738 }
8739 }
8740
8741 #[doc(hidden)]
8742 impl gax::options::internal::RequestBuilder for ListInternalRanges {
8743 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8744 &mut self.0.options
8745 }
8746 }
8747
8748 #[derive(Clone, Debug)]
8766 pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8767
8768 impl GetInternalRange {
8769 pub(crate) fn new(
8770 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8771 ) -> Self {
8772 Self(RequestBuilder::new(stub))
8773 }
8774
8775 pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8777 mut self,
8778 v: V,
8779 ) -> Self {
8780 self.0.request = v.into();
8781 self
8782 }
8783
8784 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8786 self.0.options = v.into();
8787 self
8788 }
8789
8790 pub async fn send(self) -> Result<crate::model::InternalRange> {
8792 (*self.0.stub)
8793 .get_internal_range(self.0.request, self.0.options)
8794 .await
8795 .map(gax::response::Response::into_body)
8796 }
8797
8798 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8802 self.0.request.name = v.into();
8803 self
8804 }
8805 }
8806
8807 #[doc(hidden)]
8808 impl gax::options::internal::RequestBuilder for GetInternalRange {
8809 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8810 &mut self.0.options
8811 }
8812 }
8813
8814 #[derive(Clone, Debug)]
8833 pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8834
8835 impl CreateInternalRange {
8836 pub(crate) fn new(
8837 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8838 ) -> Self {
8839 Self(RequestBuilder::new(stub))
8840 }
8841
8842 pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8844 mut self,
8845 v: V,
8846 ) -> Self {
8847 self.0.request = v.into();
8848 self
8849 }
8850
8851 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8853 self.0.options = v.into();
8854 self
8855 }
8856
8857 pub async fn send(self) -> Result<longrunning::model::Operation> {
8864 (*self.0.stub)
8865 .create_internal_range(self.0.request, self.0.options)
8866 .await
8867 .map(gax::response::Response::into_body)
8868 }
8869
8870 pub fn poller(
8872 self,
8873 ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8874 {
8875 type Operation = lro::internal::Operation<
8876 crate::model::InternalRange,
8877 crate::model::OperationMetadata,
8878 >;
8879 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8880 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8881
8882 let stub = self.0.stub.clone();
8883 let mut options = self.0.options.clone();
8884 options.set_retry_policy(gax::retry_policy::NeverRetry);
8885 let query = move |name| {
8886 let stub = stub.clone();
8887 let options = options.clone();
8888 async {
8889 let op = GetOperation::new(stub)
8890 .set_name(name)
8891 .with_options(options)
8892 .send()
8893 .await?;
8894 Ok(Operation::new(op))
8895 }
8896 };
8897
8898 let start = move || async {
8899 let op = self.send().await?;
8900 Ok(Operation::new(op))
8901 };
8902
8903 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8904 }
8905
8906 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8910 self.0.request.parent = v.into();
8911 self
8912 }
8913
8914 pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8916 self.0.request.internal_range_id = v.into();
8917 self
8918 }
8919
8920 pub fn set_internal_range<T>(mut self, v: T) -> Self
8924 where
8925 T: std::convert::Into<crate::model::InternalRange>,
8926 {
8927 self.0.request.internal_range = std::option::Option::Some(v.into());
8928 self
8929 }
8930
8931 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
8935 where
8936 T: std::convert::Into<crate::model::InternalRange>,
8937 {
8938 self.0.request.internal_range = v.map(|x| x.into());
8939 self
8940 }
8941
8942 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8944 self.0.request.request_id = v.into();
8945 self
8946 }
8947 }
8948
8949 #[doc(hidden)]
8950 impl gax::options::internal::RequestBuilder for CreateInternalRange {
8951 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8952 &mut self.0.options
8953 }
8954 }
8955
8956 #[derive(Clone, Debug)]
8975 pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
8976
8977 impl UpdateInternalRange {
8978 pub(crate) fn new(
8979 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8980 ) -> Self {
8981 Self(RequestBuilder::new(stub))
8982 }
8983
8984 pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
8986 mut self,
8987 v: V,
8988 ) -> Self {
8989 self.0.request = v.into();
8990 self
8991 }
8992
8993 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8995 self.0.options = v.into();
8996 self
8997 }
8998
8999 pub async fn send(self) -> Result<longrunning::model::Operation> {
9006 (*self.0.stub)
9007 .update_internal_range(self.0.request, self.0.options)
9008 .await
9009 .map(gax::response::Response::into_body)
9010 }
9011
9012 pub fn poller(
9014 self,
9015 ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9016 {
9017 type Operation = lro::internal::Operation<
9018 crate::model::InternalRange,
9019 crate::model::OperationMetadata,
9020 >;
9021 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9022 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9023
9024 let stub = self.0.stub.clone();
9025 let mut options = self.0.options.clone();
9026 options.set_retry_policy(gax::retry_policy::NeverRetry);
9027 let query = move |name| {
9028 let stub = stub.clone();
9029 let options = options.clone();
9030 async {
9031 let op = GetOperation::new(stub)
9032 .set_name(name)
9033 .with_options(options)
9034 .send()
9035 .await?;
9036 Ok(Operation::new(op))
9037 }
9038 };
9039
9040 let start = move || async {
9041 let op = self.send().await?;
9042 Ok(Operation::new(op))
9043 };
9044
9045 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9046 }
9047
9048 pub fn set_update_mask<T>(mut self, v: T) -> Self
9050 where
9051 T: std::convert::Into<wkt::FieldMask>,
9052 {
9053 self.0.request.update_mask = std::option::Option::Some(v.into());
9054 self
9055 }
9056
9057 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9059 where
9060 T: std::convert::Into<wkt::FieldMask>,
9061 {
9062 self.0.request.update_mask = v.map(|x| x.into());
9063 self
9064 }
9065
9066 pub fn set_internal_range<T>(mut self, v: T) -> Self
9070 where
9071 T: std::convert::Into<crate::model::InternalRange>,
9072 {
9073 self.0.request.internal_range = std::option::Option::Some(v.into());
9074 self
9075 }
9076
9077 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9081 where
9082 T: std::convert::Into<crate::model::InternalRange>,
9083 {
9084 self.0.request.internal_range = v.map(|x| x.into());
9085 self
9086 }
9087
9088 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9090 self.0.request.request_id = v.into();
9091 self
9092 }
9093 }
9094
9095 #[doc(hidden)]
9096 impl gax::options::internal::RequestBuilder for UpdateInternalRange {
9097 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9098 &mut self.0.options
9099 }
9100 }
9101
9102 #[derive(Clone, Debug)]
9121 pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9122
9123 impl DeleteInternalRange {
9124 pub(crate) fn new(
9125 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9126 ) -> Self {
9127 Self(RequestBuilder::new(stub))
9128 }
9129
9130 pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9132 mut self,
9133 v: V,
9134 ) -> Self {
9135 self.0.request = v.into();
9136 self
9137 }
9138
9139 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9141 self.0.options = v.into();
9142 self
9143 }
9144
9145 pub async fn send(self) -> Result<longrunning::model::Operation> {
9152 (*self.0.stub)
9153 .delete_internal_range(self.0.request, self.0.options)
9154 .await
9155 .map(gax::response::Response::into_body)
9156 }
9157
9158 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9160 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9161 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9162 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9163
9164 let stub = self.0.stub.clone();
9165 let mut options = self.0.options.clone();
9166 options.set_retry_policy(gax::retry_policy::NeverRetry);
9167 let query = move |name| {
9168 let stub = stub.clone();
9169 let options = options.clone();
9170 async {
9171 let op = GetOperation::new(stub)
9172 .set_name(name)
9173 .with_options(options)
9174 .send()
9175 .await?;
9176 Ok(Operation::new(op))
9177 }
9178 };
9179
9180 let start = move || async {
9181 let op = self.send().await?;
9182 Ok(Operation::new(op))
9183 };
9184
9185 lro::internal::new_unit_response_poller(
9186 polling_error_policy,
9187 polling_backoff_policy,
9188 start,
9189 query,
9190 )
9191 }
9192
9193 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9197 self.0.request.name = v.into();
9198 self
9199 }
9200
9201 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9203 self.0.request.request_id = v.into();
9204 self
9205 }
9206 }
9207
9208 #[doc(hidden)]
9209 impl gax::options::internal::RequestBuilder for DeleteInternalRange {
9210 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9211 &mut self.0.options
9212 }
9213 }
9214
9215 #[derive(Clone, Debug)]
9237 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9238
9239 impl ListLocations {
9240 pub(crate) fn new(
9241 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9242 ) -> Self {
9243 Self(RequestBuilder::new(stub))
9244 }
9245
9246 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9248 mut self,
9249 v: V,
9250 ) -> Self {
9251 self.0.request = v.into();
9252 self
9253 }
9254
9255 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9257 self.0.options = v.into();
9258 self
9259 }
9260
9261 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9263 (*self.0.stub)
9264 .list_locations(self.0.request, self.0.options)
9265 .await
9266 .map(gax::response::Response::into_body)
9267 }
9268
9269 pub fn by_page(
9271 self,
9272 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9273 {
9274 use std::clone::Clone;
9275 let token = self.0.request.page_token.clone();
9276 let execute = move |token: String| {
9277 let mut builder = self.clone();
9278 builder.0.request = builder.0.request.set_page_token(token);
9279 builder.send()
9280 };
9281 gax::paginator::internal::new_paginator(token, execute)
9282 }
9283
9284 pub fn by_item(
9286 self,
9287 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9288 {
9289 use gax::paginator::Paginator;
9290 self.by_page().items()
9291 }
9292
9293 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9295 self.0.request.name = v.into();
9296 self
9297 }
9298
9299 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9301 self.0.request.filter = v.into();
9302 self
9303 }
9304
9305 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9307 self.0.request.page_size = v.into();
9308 self
9309 }
9310
9311 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9313 self.0.request.page_token = v.into();
9314 self
9315 }
9316 }
9317
9318 #[doc(hidden)]
9319 impl gax::options::internal::RequestBuilder for ListLocations {
9320 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9321 &mut self.0.options
9322 }
9323 }
9324
9325 #[derive(Clone, Debug)]
9343 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
9344
9345 impl GetLocation {
9346 pub(crate) fn new(
9347 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9348 ) -> Self {
9349 Self(RequestBuilder::new(stub))
9350 }
9351
9352 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
9354 self.0.request = v.into();
9355 self
9356 }
9357
9358 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9360 self.0.options = v.into();
9361 self
9362 }
9363
9364 pub async fn send(self) -> Result<location::model::Location> {
9366 (*self.0.stub)
9367 .get_location(self.0.request, self.0.options)
9368 .await
9369 .map(gax::response::Response::into_body)
9370 }
9371
9372 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9374 self.0.request.name = v.into();
9375 self
9376 }
9377 }
9378
9379 #[doc(hidden)]
9380 impl gax::options::internal::RequestBuilder for GetLocation {
9381 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9382 &mut self.0.options
9383 }
9384 }
9385
9386 #[derive(Clone, Debug)]
9404 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
9405
9406 impl SetIamPolicy {
9407 pub(crate) fn new(
9408 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9409 ) -> Self {
9410 Self(RequestBuilder::new(stub))
9411 }
9412
9413 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
9415 self.0.request = v.into();
9416 self
9417 }
9418
9419 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9421 self.0.options = v.into();
9422 self
9423 }
9424
9425 pub async fn send(self) -> Result<iam_v1::model::Policy> {
9427 (*self.0.stub)
9428 .set_iam_policy(self.0.request, self.0.options)
9429 .await
9430 .map(gax::response::Response::into_body)
9431 }
9432
9433 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9437 self.0.request.resource = v.into();
9438 self
9439 }
9440
9441 pub fn set_policy<T>(mut self, v: T) -> Self
9445 where
9446 T: std::convert::Into<iam_v1::model::Policy>,
9447 {
9448 self.0.request.policy = std::option::Option::Some(v.into());
9449 self
9450 }
9451
9452 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9456 where
9457 T: std::convert::Into<iam_v1::model::Policy>,
9458 {
9459 self.0.request.policy = v.map(|x| x.into());
9460 self
9461 }
9462
9463 pub fn set_update_mask<T>(mut self, v: T) -> Self
9465 where
9466 T: std::convert::Into<wkt::FieldMask>,
9467 {
9468 self.0.request.update_mask = std::option::Option::Some(v.into());
9469 self
9470 }
9471
9472 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9474 where
9475 T: std::convert::Into<wkt::FieldMask>,
9476 {
9477 self.0.request.update_mask = v.map(|x| x.into());
9478 self
9479 }
9480 }
9481
9482 #[doc(hidden)]
9483 impl gax::options::internal::RequestBuilder for SetIamPolicy {
9484 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9485 &mut self.0.options
9486 }
9487 }
9488
9489 #[derive(Clone, Debug)]
9507 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
9508
9509 impl GetIamPolicy {
9510 pub(crate) fn new(
9511 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9512 ) -> Self {
9513 Self(RequestBuilder::new(stub))
9514 }
9515
9516 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
9518 self.0.request = v.into();
9519 self
9520 }
9521
9522 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9524 self.0.options = v.into();
9525 self
9526 }
9527
9528 pub async fn send(self) -> Result<iam_v1::model::Policy> {
9530 (*self.0.stub)
9531 .get_iam_policy(self.0.request, self.0.options)
9532 .await
9533 .map(gax::response::Response::into_body)
9534 }
9535
9536 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9540 self.0.request.resource = v.into();
9541 self
9542 }
9543
9544 pub fn set_options<T>(mut self, v: T) -> Self
9546 where
9547 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9548 {
9549 self.0.request.options = std::option::Option::Some(v.into());
9550 self
9551 }
9552
9553 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9555 where
9556 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9557 {
9558 self.0.request.options = v.map(|x| x.into());
9559 self
9560 }
9561 }
9562
9563 #[doc(hidden)]
9564 impl gax::options::internal::RequestBuilder for GetIamPolicy {
9565 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9566 &mut self.0.options
9567 }
9568 }
9569
9570 #[derive(Clone, Debug)]
9588 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
9589
9590 impl TestIamPermissions {
9591 pub(crate) fn new(
9592 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9593 ) -> Self {
9594 Self(RequestBuilder::new(stub))
9595 }
9596
9597 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
9599 mut self,
9600 v: V,
9601 ) -> Self {
9602 self.0.request = v.into();
9603 self
9604 }
9605
9606 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9608 self.0.options = v.into();
9609 self
9610 }
9611
9612 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
9614 (*self.0.stub)
9615 .test_iam_permissions(self.0.request, self.0.options)
9616 .await
9617 .map(gax::response::Response::into_body)
9618 }
9619
9620 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9624 self.0.request.resource = v.into();
9625 self
9626 }
9627
9628 pub fn set_permissions<T, V>(mut self, v: T) -> Self
9632 where
9633 T: std::iter::IntoIterator<Item = V>,
9634 V: std::convert::Into<std::string::String>,
9635 {
9636 use std::iter::Iterator;
9637 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9638 self
9639 }
9640 }
9641
9642 #[doc(hidden)]
9643 impl gax::options::internal::RequestBuilder for TestIamPermissions {
9644 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9645 &mut self.0.options
9646 }
9647 }
9648
9649 #[derive(Clone, Debug)]
9671 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
9672
9673 impl ListOperations {
9674 pub(crate) fn new(
9675 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9676 ) -> Self {
9677 Self(RequestBuilder::new(stub))
9678 }
9679
9680 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
9682 mut self,
9683 v: V,
9684 ) -> Self {
9685 self.0.request = v.into();
9686 self
9687 }
9688
9689 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9691 self.0.options = v.into();
9692 self
9693 }
9694
9695 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
9697 (*self.0.stub)
9698 .list_operations(self.0.request, self.0.options)
9699 .await
9700 .map(gax::response::Response::into_body)
9701 }
9702
9703 pub fn by_page(
9705 self,
9706 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
9707 {
9708 use std::clone::Clone;
9709 let token = self.0.request.page_token.clone();
9710 let execute = move |token: String| {
9711 let mut builder = self.clone();
9712 builder.0.request = builder.0.request.set_page_token(token);
9713 builder.send()
9714 };
9715 gax::paginator::internal::new_paginator(token, execute)
9716 }
9717
9718 pub fn by_item(
9720 self,
9721 ) -> impl gax::paginator::ItemPaginator<
9722 longrunning::model::ListOperationsResponse,
9723 gax::error::Error,
9724 > {
9725 use gax::paginator::Paginator;
9726 self.by_page().items()
9727 }
9728
9729 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9731 self.0.request.name = v.into();
9732 self
9733 }
9734
9735 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9737 self.0.request.filter = v.into();
9738 self
9739 }
9740
9741 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9743 self.0.request.page_size = v.into();
9744 self
9745 }
9746
9747 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9749 self.0.request.page_token = v.into();
9750 self
9751 }
9752
9753 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9755 self.0.request.return_partial_success = v.into();
9756 self
9757 }
9758 }
9759
9760 #[doc(hidden)]
9761 impl gax::options::internal::RequestBuilder for ListOperations {
9762 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9763 &mut self.0.options
9764 }
9765 }
9766
9767 #[derive(Clone, Debug)]
9785 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
9786
9787 impl GetOperation {
9788 pub(crate) fn new(
9789 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9790 ) -> Self {
9791 Self(RequestBuilder::new(stub))
9792 }
9793
9794 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
9796 mut self,
9797 v: V,
9798 ) -> Self {
9799 self.0.request = v.into();
9800 self
9801 }
9802
9803 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9805 self.0.options = v.into();
9806 self
9807 }
9808
9809 pub async fn send(self) -> Result<longrunning::model::Operation> {
9811 (*self.0.stub)
9812 .get_operation(self.0.request, self.0.options)
9813 .await
9814 .map(gax::response::Response::into_body)
9815 }
9816
9817 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9819 self.0.request.name = v.into();
9820 self
9821 }
9822 }
9823
9824 #[doc(hidden)]
9825 impl gax::options::internal::RequestBuilder for GetOperation {
9826 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9827 &mut self.0.options
9828 }
9829 }
9830
9831 #[derive(Clone, Debug)]
9849 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
9850
9851 impl DeleteOperation {
9852 pub(crate) fn new(
9853 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9854 ) -> Self {
9855 Self(RequestBuilder::new(stub))
9856 }
9857
9858 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
9860 mut self,
9861 v: V,
9862 ) -> Self {
9863 self.0.request = v.into();
9864 self
9865 }
9866
9867 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9869 self.0.options = v.into();
9870 self
9871 }
9872
9873 pub async fn send(self) -> Result<()> {
9875 (*self.0.stub)
9876 .delete_operation(self.0.request, self.0.options)
9877 .await
9878 .map(gax::response::Response::into_body)
9879 }
9880
9881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9883 self.0.request.name = v.into();
9884 self
9885 }
9886 }
9887
9888 #[doc(hidden)]
9889 impl gax::options::internal::RequestBuilder for DeleteOperation {
9890 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9891 &mut self.0.options
9892 }
9893 }
9894
9895 #[derive(Clone, Debug)]
9913 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
9914
9915 impl CancelOperation {
9916 pub(crate) fn new(
9917 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9918 ) -> Self {
9919 Self(RequestBuilder::new(stub))
9920 }
9921
9922 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
9924 mut self,
9925 v: V,
9926 ) -> Self {
9927 self.0.request = v.into();
9928 self
9929 }
9930
9931 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9933 self.0.options = v.into();
9934 self
9935 }
9936
9937 pub async fn send(self) -> Result<()> {
9939 (*self.0.stub)
9940 .cancel_operation(self.0.request, self.0.options)
9941 .await
9942 .map(gax::response::Response::into_body)
9943 }
9944
9945 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9947 self.0.request.name = v.into();
9948 self
9949 }
9950 }
9951
9952 #[doc(hidden)]
9953 impl gax::options::internal::RequestBuilder for CancelOperation {
9954 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9955 &mut self.0.options
9956 }
9957 }
9958}
9959
9960pub mod policy_based_routing_service {
9961 use crate::Result;
9962
9963 pub type ClientBuilder =
9977 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9978
9979 pub(crate) mod client {
9980 use super::super::super::client::PolicyBasedRoutingService;
9981 pub struct Factory;
9982 impl gax::client_builder::internal::ClientFactory for Factory {
9983 type Client = PolicyBasedRoutingService;
9984 type Credentials = gaxi::options::Credentials;
9985 async fn build(
9986 self,
9987 config: gaxi::options::ClientConfig,
9988 ) -> gax::client_builder::Result<Self::Client> {
9989 Self::Client::new(config).await
9990 }
9991 }
9992 }
9993
9994 #[derive(Clone, Debug)]
9996 pub(crate) struct RequestBuilder<R: std::default::Default> {
9997 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9998 request: R,
9999 options: gax::options::RequestOptions,
10000 }
10001
10002 impl<R> RequestBuilder<R>
10003 where
10004 R: std::default::Default,
10005 {
10006 pub(crate) fn new(
10007 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10008 ) -> Self {
10009 Self {
10010 stub,
10011 request: R::default(),
10012 options: gax::options::RequestOptions::default(),
10013 }
10014 }
10015 }
10016
10017 #[derive(Clone, Debug)]
10039 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10040
10041 impl ListPolicyBasedRoutes {
10042 pub(crate) fn new(
10043 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10044 ) -> Self {
10045 Self(RequestBuilder::new(stub))
10046 }
10047
10048 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10050 mut self,
10051 v: V,
10052 ) -> Self {
10053 self.0.request = v.into();
10054 self
10055 }
10056
10057 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10059 self.0.options = v.into();
10060 self
10061 }
10062
10063 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10065 (*self.0.stub)
10066 .list_policy_based_routes(self.0.request, self.0.options)
10067 .await
10068 .map(gax::response::Response::into_body)
10069 }
10070
10071 pub fn by_page(
10073 self,
10074 ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
10075 {
10076 use std::clone::Clone;
10077 let token = self.0.request.page_token.clone();
10078 let execute = move |token: String| {
10079 let mut builder = self.clone();
10080 builder.0.request = builder.0.request.set_page_token(token);
10081 builder.send()
10082 };
10083 gax::paginator::internal::new_paginator(token, execute)
10084 }
10085
10086 pub fn by_item(
10088 self,
10089 ) -> impl gax::paginator::ItemPaginator<
10090 crate::model::ListPolicyBasedRoutesResponse,
10091 gax::error::Error,
10092 > {
10093 use gax::paginator::Paginator;
10094 self.by_page().items()
10095 }
10096
10097 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10101 self.0.request.parent = v.into();
10102 self
10103 }
10104
10105 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10107 self.0.request.page_size = v.into();
10108 self
10109 }
10110
10111 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10113 self.0.request.page_token = v.into();
10114 self
10115 }
10116
10117 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10119 self.0.request.filter = v.into();
10120 self
10121 }
10122
10123 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10125 self.0.request.order_by = v.into();
10126 self
10127 }
10128 }
10129
10130 #[doc(hidden)]
10131 impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
10132 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10133 &mut self.0.options
10134 }
10135 }
10136
10137 #[derive(Clone, Debug)]
10155 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10156
10157 impl GetPolicyBasedRoute {
10158 pub(crate) fn new(
10159 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10160 ) -> Self {
10161 Self(RequestBuilder::new(stub))
10162 }
10163
10164 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10166 mut self,
10167 v: V,
10168 ) -> Self {
10169 self.0.request = v.into();
10170 self
10171 }
10172
10173 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10175 self.0.options = v.into();
10176 self
10177 }
10178
10179 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10181 (*self.0.stub)
10182 .get_policy_based_route(self.0.request, self.0.options)
10183 .await
10184 .map(gax::response::Response::into_body)
10185 }
10186
10187 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10191 self.0.request.name = v.into();
10192 self
10193 }
10194 }
10195
10196 #[doc(hidden)]
10197 impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
10198 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10199 &mut self.0.options
10200 }
10201 }
10202
10203 #[derive(Clone, Debug)]
10222 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10223
10224 impl CreatePolicyBasedRoute {
10225 pub(crate) fn new(
10226 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10227 ) -> Self {
10228 Self(RequestBuilder::new(stub))
10229 }
10230
10231 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10233 mut self,
10234 v: V,
10235 ) -> Self {
10236 self.0.request = v.into();
10237 self
10238 }
10239
10240 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10242 self.0.options = v.into();
10243 self
10244 }
10245
10246 pub async fn send(self) -> Result<longrunning::model::Operation> {
10253 (*self.0.stub)
10254 .create_policy_based_route(self.0.request, self.0.options)
10255 .await
10256 .map(gax::response::Response::into_body)
10257 }
10258
10259 pub fn poller(
10261 self,
10262 ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10263 {
10264 type Operation = lro::internal::Operation<
10265 crate::model::PolicyBasedRoute,
10266 crate::model::OperationMetadata,
10267 >;
10268 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10269 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10270
10271 let stub = self.0.stub.clone();
10272 let mut options = self.0.options.clone();
10273 options.set_retry_policy(gax::retry_policy::NeverRetry);
10274 let query = move |name| {
10275 let stub = stub.clone();
10276 let options = options.clone();
10277 async {
10278 let op = GetOperation::new(stub)
10279 .set_name(name)
10280 .with_options(options)
10281 .send()
10282 .await?;
10283 Ok(Operation::new(op))
10284 }
10285 };
10286
10287 let start = move || async {
10288 let op = self.send().await?;
10289 Ok(Operation::new(op))
10290 };
10291
10292 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10293 }
10294
10295 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10299 self.0.request.parent = v.into();
10300 self
10301 }
10302
10303 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10307 self.0.request.policy_based_route_id = v.into();
10308 self
10309 }
10310
10311 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10315 where
10316 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10317 {
10318 self.0.request.policy_based_route = std::option::Option::Some(v.into());
10319 self
10320 }
10321
10322 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10326 where
10327 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10328 {
10329 self.0.request.policy_based_route = v.map(|x| x.into());
10330 self
10331 }
10332
10333 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10335 self.0.request.request_id = v.into();
10336 self
10337 }
10338 }
10339
10340 #[doc(hidden)]
10341 impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
10342 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10343 &mut self.0.options
10344 }
10345 }
10346
10347 #[derive(Clone, Debug)]
10366 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10367
10368 impl DeletePolicyBasedRoute {
10369 pub(crate) fn new(
10370 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10371 ) -> Self {
10372 Self(RequestBuilder::new(stub))
10373 }
10374
10375 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10377 mut self,
10378 v: V,
10379 ) -> Self {
10380 self.0.request = v.into();
10381 self
10382 }
10383
10384 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10386 self.0.options = v.into();
10387 self
10388 }
10389
10390 pub async fn send(self) -> Result<longrunning::model::Operation> {
10397 (*self.0.stub)
10398 .delete_policy_based_route(self.0.request, self.0.options)
10399 .await
10400 .map(gax::response::Response::into_body)
10401 }
10402
10403 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10405 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10406 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10407 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10408
10409 let stub = self.0.stub.clone();
10410 let mut options = self.0.options.clone();
10411 options.set_retry_policy(gax::retry_policy::NeverRetry);
10412 let query = move |name| {
10413 let stub = stub.clone();
10414 let options = options.clone();
10415 async {
10416 let op = GetOperation::new(stub)
10417 .set_name(name)
10418 .with_options(options)
10419 .send()
10420 .await?;
10421 Ok(Operation::new(op))
10422 }
10423 };
10424
10425 let start = move || async {
10426 let op = self.send().await?;
10427 Ok(Operation::new(op))
10428 };
10429
10430 lro::internal::new_unit_response_poller(
10431 polling_error_policy,
10432 polling_backoff_policy,
10433 start,
10434 query,
10435 )
10436 }
10437
10438 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10442 self.0.request.name = v.into();
10443 self
10444 }
10445
10446 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10448 self.0.request.request_id = v.into();
10449 self
10450 }
10451 }
10452
10453 #[doc(hidden)]
10454 impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
10455 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10456 &mut self.0.options
10457 }
10458 }
10459
10460 #[derive(Clone, Debug)]
10482 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10483
10484 impl ListLocations {
10485 pub(crate) fn new(
10486 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10487 ) -> Self {
10488 Self(RequestBuilder::new(stub))
10489 }
10490
10491 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10493 mut self,
10494 v: V,
10495 ) -> Self {
10496 self.0.request = v.into();
10497 self
10498 }
10499
10500 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10502 self.0.options = v.into();
10503 self
10504 }
10505
10506 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10508 (*self.0.stub)
10509 .list_locations(self.0.request, self.0.options)
10510 .await
10511 .map(gax::response::Response::into_body)
10512 }
10513
10514 pub fn by_page(
10516 self,
10517 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10518 {
10519 use std::clone::Clone;
10520 let token = self.0.request.page_token.clone();
10521 let execute = move |token: String| {
10522 let mut builder = self.clone();
10523 builder.0.request = builder.0.request.set_page_token(token);
10524 builder.send()
10525 };
10526 gax::paginator::internal::new_paginator(token, execute)
10527 }
10528
10529 pub fn by_item(
10531 self,
10532 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10533 {
10534 use gax::paginator::Paginator;
10535 self.by_page().items()
10536 }
10537
10538 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10540 self.0.request.name = v.into();
10541 self
10542 }
10543
10544 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10546 self.0.request.filter = v.into();
10547 self
10548 }
10549
10550 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10552 self.0.request.page_size = v.into();
10553 self
10554 }
10555
10556 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10558 self.0.request.page_token = v.into();
10559 self
10560 }
10561 }
10562
10563 #[doc(hidden)]
10564 impl gax::options::internal::RequestBuilder for ListLocations {
10565 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10566 &mut self.0.options
10567 }
10568 }
10569
10570 #[derive(Clone, Debug)]
10588 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10589
10590 impl GetLocation {
10591 pub(crate) fn new(
10592 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10593 ) -> Self {
10594 Self(RequestBuilder::new(stub))
10595 }
10596
10597 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10599 self.0.request = v.into();
10600 self
10601 }
10602
10603 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10605 self.0.options = v.into();
10606 self
10607 }
10608
10609 pub async fn send(self) -> Result<location::model::Location> {
10611 (*self.0.stub)
10612 .get_location(self.0.request, self.0.options)
10613 .await
10614 .map(gax::response::Response::into_body)
10615 }
10616
10617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10619 self.0.request.name = v.into();
10620 self
10621 }
10622 }
10623
10624 #[doc(hidden)]
10625 impl gax::options::internal::RequestBuilder for GetLocation {
10626 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10627 &mut self.0.options
10628 }
10629 }
10630
10631 #[derive(Clone, Debug)]
10649 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
10650
10651 impl SetIamPolicy {
10652 pub(crate) fn new(
10653 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10654 ) -> Self {
10655 Self(RequestBuilder::new(stub))
10656 }
10657
10658 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
10660 self.0.request = v.into();
10661 self
10662 }
10663
10664 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10666 self.0.options = v.into();
10667 self
10668 }
10669
10670 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10672 (*self.0.stub)
10673 .set_iam_policy(self.0.request, self.0.options)
10674 .await
10675 .map(gax::response::Response::into_body)
10676 }
10677
10678 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10682 self.0.request.resource = v.into();
10683 self
10684 }
10685
10686 pub fn set_policy<T>(mut self, v: T) -> Self
10690 where
10691 T: std::convert::Into<iam_v1::model::Policy>,
10692 {
10693 self.0.request.policy = std::option::Option::Some(v.into());
10694 self
10695 }
10696
10697 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10701 where
10702 T: std::convert::Into<iam_v1::model::Policy>,
10703 {
10704 self.0.request.policy = v.map(|x| x.into());
10705 self
10706 }
10707
10708 pub fn set_update_mask<T>(mut self, v: T) -> Self
10710 where
10711 T: std::convert::Into<wkt::FieldMask>,
10712 {
10713 self.0.request.update_mask = std::option::Option::Some(v.into());
10714 self
10715 }
10716
10717 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10719 where
10720 T: std::convert::Into<wkt::FieldMask>,
10721 {
10722 self.0.request.update_mask = v.map(|x| x.into());
10723 self
10724 }
10725 }
10726
10727 #[doc(hidden)]
10728 impl gax::options::internal::RequestBuilder for SetIamPolicy {
10729 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10730 &mut self.0.options
10731 }
10732 }
10733
10734 #[derive(Clone, Debug)]
10752 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
10753
10754 impl GetIamPolicy {
10755 pub(crate) fn new(
10756 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10757 ) -> Self {
10758 Self(RequestBuilder::new(stub))
10759 }
10760
10761 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
10763 self.0.request = v.into();
10764 self
10765 }
10766
10767 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10769 self.0.options = v.into();
10770 self
10771 }
10772
10773 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10775 (*self.0.stub)
10776 .get_iam_policy(self.0.request, self.0.options)
10777 .await
10778 .map(gax::response::Response::into_body)
10779 }
10780
10781 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10785 self.0.request.resource = v.into();
10786 self
10787 }
10788
10789 pub fn set_options<T>(mut self, v: T) -> Self
10791 where
10792 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10793 {
10794 self.0.request.options = std::option::Option::Some(v.into());
10795 self
10796 }
10797
10798 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10800 where
10801 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10802 {
10803 self.0.request.options = v.map(|x| x.into());
10804 self
10805 }
10806 }
10807
10808 #[doc(hidden)]
10809 impl gax::options::internal::RequestBuilder for GetIamPolicy {
10810 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10811 &mut self.0.options
10812 }
10813 }
10814
10815 #[derive(Clone, Debug)]
10833 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
10834
10835 impl TestIamPermissions {
10836 pub(crate) fn new(
10837 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10838 ) -> Self {
10839 Self(RequestBuilder::new(stub))
10840 }
10841
10842 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
10844 mut self,
10845 v: V,
10846 ) -> Self {
10847 self.0.request = v.into();
10848 self
10849 }
10850
10851 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10853 self.0.options = v.into();
10854 self
10855 }
10856
10857 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
10859 (*self.0.stub)
10860 .test_iam_permissions(self.0.request, self.0.options)
10861 .await
10862 .map(gax::response::Response::into_body)
10863 }
10864
10865 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10869 self.0.request.resource = v.into();
10870 self
10871 }
10872
10873 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10877 where
10878 T: std::iter::IntoIterator<Item = V>,
10879 V: std::convert::Into<std::string::String>,
10880 {
10881 use std::iter::Iterator;
10882 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10883 self
10884 }
10885 }
10886
10887 #[doc(hidden)]
10888 impl gax::options::internal::RequestBuilder for TestIamPermissions {
10889 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10890 &mut self.0.options
10891 }
10892 }
10893
10894 #[derive(Clone, Debug)]
10916 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10917
10918 impl ListOperations {
10919 pub(crate) fn new(
10920 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10921 ) -> Self {
10922 Self(RequestBuilder::new(stub))
10923 }
10924
10925 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10927 mut self,
10928 v: V,
10929 ) -> Self {
10930 self.0.request = v.into();
10931 self
10932 }
10933
10934 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10936 self.0.options = v.into();
10937 self
10938 }
10939
10940 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10942 (*self.0.stub)
10943 .list_operations(self.0.request, self.0.options)
10944 .await
10945 .map(gax::response::Response::into_body)
10946 }
10947
10948 pub fn by_page(
10950 self,
10951 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10952 {
10953 use std::clone::Clone;
10954 let token = self.0.request.page_token.clone();
10955 let execute = move |token: String| {
10956 let mut builder = self.clone();
10957 builder.0.request = builder.0.request.set_page_token(token);
10958 builder.send()
10959 };
10960 gax::paginator::internal::new_paginator(token, execute)
10961 }
10962
10963 pub fn by_item(
10965 self,
10966 ) -> impl gax::paginator::ItemPaginator<
10967 longrunning::model::ListOperationsResponse,
10968 gax::error::Error,
10969 > {
10970 use gax::paginator::Paginator;
10971 self.by_page().items()
10972 }
10973
10974 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10976 self.0.request.name = v.into();
10977 self
10978 }
10979
10980 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10982 self.0.request.filter = v.into();
10983 self
10984 }
10985
10986 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10988 self.0.request.page_size = v.into();
10989 self
10990 }
10991
10992 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10994 self.0.request.page_token = v.into();
10995 self
10996 }
10997
10998 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11000 self.0.request.return_partial_success = v.into();
11001 self
11002 }
11003 }
11004
11005 #[doc(hidden)]
11006 impl gax::options::internal::RequestBuilder for ListOperations {
11007 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11008 &mut self.0.options
11009 }
11010 }
11011
11012 #[derive(Clone, Debug)]
11030 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11031
11032 impl GetOperation {
11033 pub(crate) fn new(
11034 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11035 ) -> Self {
11036 Self(RequestBuilder::new(stub))
11037 }
11038
11039 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11041 mut self,
11042 v: V,
11043 ) -> Self {
11044 self.0.request = v.into();
11045 self
11046 }
11047
11048 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11050 self.0.options = v.into();
11051 self
11052 }
11053
11054 pub async fn send(self) -> Result<longrunning::model::Operation> {
11056 (*self.0.stub)
11057 .get_operation(self.0.request, self.0.options)
11058 .await
11059 .map(gax::response::Response::into_body)
11060 }
11061
11062 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11064 self.0.request.name = v.into();
11065 self
11066 }
11067 }
11068
11069 #[doc(hidden)]
11070 impl gax::options::internal::RequestBuilder for GetOperation {
11071 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11072 &mut self.0.options
11073 }
11074 }
11075
11076 #[derive(Clone, Debug)]
11094 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
11095
11096 impl DeleteOperation {
11097 pub(crate) fn new(
11098 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11099 ) -> Self {
11100 Self(RequestBuilder::new(stub))
11101 }
11102
11103 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
11105 mut self,
11106 v: V,
11107 ) -> Self {
11108 self.0.request = v.into();
11109 self
11110 }
11111
11112 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11114 self.0.options = v.into();
11115 self
11116 }
11117
11118 pub async fn send(self) -> Result<()> {
11120 (*self.0.stub)
11121 .delete_operation(self.0.request, self.0.options)
11122 .await
11123 .map(gax::response::Response::into_body)
11124 }
11125
11126 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11128 self.0.request.name = v.into();
11129 self
11130 }
11131 }
11132
11133 #[doc(hidden)]
11134 impl gax::options::internal::RequestBuilder for DeleteOperation {
11135 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11136 &mut self.0.options
11137 }
11138 }
11139
11140 #[derive(Clone, Debug)]
11158 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11159
11160 impl CancelOperation {
11161 pub(crate) fn new(
11162 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11163 ) -> Self {
11164 Self(RequestBuilder::new(stub))
11165 }
11166
11167 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11169 mut self,
11170 v: V,
11171 ) -> Self {
11172 self.0.request = v.into();
11173 self
11174 }
11175
11176 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11178 self.0.options = v.into();
11179 self
11180 }
11181
11182 pub async fn send(self) -> Result<()> {
11184 (*self.0.stub)
11185 .cancel_operation(self.0.request, self.0.options)
11186 .await
11187 .map(gax::response::Response::into_body)
11188 }
11189
11190 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11192 self.0.request.name = v.into();
11193 self
11194 }
11195 }
11196
11197 #[doc(hidden)]
11198 impl gax::options::internal::RequestBuilder for CancelOperation {
11199 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11200 &mut self.0.options
11201 }
11202 }
11203}