1pub mod cross_network_automation_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::CrossNetworkAutomationService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = CrossNetworkAutomationService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListServiceConnectionMaps(
97 RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
98 );
99
100 impl ListServiceConnectionMaps {
101 pub(crate) fn new(
102 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
103 ) -> Self {
104 Self(RequestBuilder::new(stub))
105 }
106
107 pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
109 mut self,
110 v: V,
111 ) -> Self {
112 self.0.request = v.into();
113 self
114 }
115
116 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
118 self.0.options = v.into();
119 self
120 }
121
122 pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
124 (*self.0.stub)
125 .list_service_connection_maps(self.0.request, self.0.options)
126 .await
127 .map(gax::response::Response::into_body)
128 }
129
130 pub fn by_page(
132 self,
133 ) -> impl gax::paginator::Paginator<
134 crate::model::ListServiceConnectionMapsResponse,
135 gax::error::Error,
136 > {
137 use std::clone::Clone;
138 let token = self.0.request.page_token.clone();
139 let execute = move |token: String| {
140 let mut builder = self.clone();
141 builder.0.request = builder.0.request.set_page_token(token);
142 builder.send()
143 };
144 gax::paginator::internal::new_paginator(token, execute)
145 }
146
147 pub fn by_item(
149 self,
150 ) -> impl gax::paginator::ItemPaginator<
151 crate::model::ListServiceConnectionMapsResponse,
152 gax::error::Error,
153 > {
154 use gax::paginator::Paginator;
155 self.by_page().items()
156 }
157
158 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
162 self.0.request.parent = v.into();
163 self
164 }
165
166 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
168 self.0.request.page_size = v.into();
169 self
170 }
171
172 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
174 self.0.request.page_token = v.into();
175 self
176 }
177
178 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
180 self.0.request.filter = v.into();
181 self
182 }
183
184 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
186 self.0.request.order_by = v.into();
187 self
188 }
189 }
190
191 #[doc(hidden)]
192 impl gax::options::internal::RequestBuilder for ListServiceConnectionMaps {
193 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
194 &mut self.0.options
195 }
196 }
197
198 #[derive(Clone, Debug)]
216 pub struct GetServiceConnectionMap(
217 RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
218 );
219
220 impl GetServiceConnectionMap {
221 pub(crate) fn new(
222 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
223 ) -> Self {
224 Self(RequestBuilder::new(stub))
225 }
226
227 pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
229 mut self,
230 v: V,
231 ) -> Self {
232 self.0.request = v.into();
233 self
234 }
235
236 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
238 self.0.options = v.into();
239 self
240 }
241
242 pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
244 (*self.0.stub)
245 .get_service_connection_map(self.0.request, self.0.options)
246 .await
247 .map(gax::response::Response::into_body)
248 }
249
250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
254 self.0.request.name = v.into();
255 self
256 }
257 }
258
259 #[doc(hidden)]
260 impl gax::options::internal::RequestBuilder for GetServiceConnectionMap {
261 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
262 &mut self.0.options
263 }
264 }
265
266 #[derive(Clone, Debug)]
285 pub struct CreateServiceConnectionMap(
286 RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
287 );
288
289 impl CreateServiceConnectionMap {
290 pub(crate) fn new(
291 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
292 ) -> Self {
293 Self(RequestBuilder::new(stub))
294 }
295
296 pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
298 mut self,
299 v: V,
300 ) -> Self {
301 self.0.request = v.into();
302 self
303 }
304
305 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
307 self.0.options = v.into();
308 self
309 }
310
311 pub async fn send(self) -> Result<longrunning::model::Operation> {
318 (*self.0.stub)
319 .create_service_connection_map(self.0.request, self.0.options)
320 .await
321 .map(gax::response::Response::into_body)
322 }
323
324 pub fn poller(
326 self,
327 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
328 {
329 type Operation = lro::internal::Operation<
330 crate::model::ServiceConnectionMap,
331 crate::model::OperationMetadata,
332 >;
333 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
334 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
335
336 let stub = self.0.stub.clone();
337 let mut options = self.0.options.clone();
338 options.set_retry_policy(gax::retry_policy::NeverRetry);
339 let query = move |name| {
340 let stub = stub.clone();
341 let options = options.clone();
342 async {
343 let op = GetOperation::new(stub)
344 .set_name(name)
345 .with_options(options)
346 .send()
347 .await?;
348 Ok(Operation::new(op))
349 }
350 };
351
352 let start = move || async {
353 let op = self.send().await?;
354 Ok(Operation::new(op))
355 };
356
357 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
358 }
359
360 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
364 self.0.request.parent = v.into();
365 self
366 }
367
368 pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
370 self.0.request.service_connection_map_id = v.into();
371 self
372 }
373
374 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
378 where
379 T: std::convert::Into<crate::model::ServiceConnectionMap>,
380 {
381 self.0.request.service_connection_map = std::option::Option::Some(v.into());
382 self
383 }
384
385 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
389 where
390 T: std::convert::Into<crate::model::ServiceConnectionMap>,
391 {
392 self.0.request.service_connection_map = v.map(|x| x.into());
393 self
394 }
395
396 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
398 self.0.request.request_id = v.into();
399 self
400 }
401 }
402
403 #[doc(hidden)]
404 impl gax::options::internal::RequestBuilder for CreateServiceConnectionMap {
405 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
406 &mut self.0.options
407 }
408 }
409
410 #[derive(Clone, Debug)]
429 pub struct UpdateServiceConnectionMap(
430 RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
431 );
432
433 impl UpdateServiceConnectionMap {
434 pub(crate) fn new(
435 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
436 ) -> Self {
437 Self(RequestBuilder::new(stub))
438 }
439
440 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
442 mut self,
443 v: V,
444 ) -> Self {
445 self.0.request = v.into();
446 self
447 }
448
449 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
451 self.0.options = v.into();
452 self
453 }
454
455 pub async fn send(self) -> Result<longrunning::model::Operation> {
462 (*self.0.stub)
463 .update_service_connection_map(self.0.request, self.0.options)
464 .await
465 .map(gax::response::Response::into_body)
466 }
467
468 pub fn poller(
470 self,
471 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
472 {
473 type Operation = lro::internal::Operation<
474 crate::model::ServiceConnectionMap,
475 crate::model::OperationMetadata,
476 >;
477 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
478 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
479
480 let stub = self.0.stub.clone();
481 let mut options = self.0.options.clone();
482 options.set_retry_policy(gax::retry_policy::NeverRetry);
483 let query = move |name| {
484 let stub = stub.clone();
485 let options = options.clone();
486 async {
487 let op = GetOperation::new(stub)
488 .set_name(name)
489 .with_options(options)
490 .send()
491 .await?;
492 Ok(Operation::new(op))
493 }
494 };
495
496 let start = move || async {
497 let op = self.send().await?;
498 Ok(Operation::new(op))
499 };
500
501 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
502 }
503
504 pub fn set_update_mask<T>(mut self, v: T) -> Self
506 where
507 T: std::convert::Into<wkt::FieldMask>,
508 {
509 self.0.request.update_mask = std::option::Option::Some(v.into());
510 self
511 }
512
513 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
515 where
516 T: std::convert::Into<wkt::FieldMask>,
517 {
518 self.0.request.update_mask = v.map(|x| x.into());
519 self
520 }
521
522 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
526 where
527 T: std::convert::Into<crate::model::ServiceConnectionMap>,
528 {
529 self.0.request.service_connection_map = std::option::Option::Some(v.into());
530 self
531 }
532
533 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
537 where
538 T: std::convert::Into<crate::model::ServiceConnectionMap>,
539 {
540 self.0.request.service_connection_map = v.map(|x| x.into());
541 self
542 }
543
544 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
546 self.0.request.request_id = v.into();
547 self
548 }
549 }
550
551 #[doc(hidden)]
552 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionMap {
553 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
554 &mut self.0.options
555 }
556 }
557
558 #[derive(Clone, Debug)]
577 pub struct DeleteServiceConnectionMap(
578 RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
579 );
580
581 impl DeleteServiceConnectionMap {
582 pub(crate) fn new(
583 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
584 ) -> Self {
585 Self(RequestBuilder::new(stub))
586 }
587
588 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
590 mut self,
591 v: V,
592 ) -> Self {
593 self.0.request = v.into();
594 self
595 }
596
597 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
599 self.0.options = v.into();
600 self
601 }
602
603 pub async fn send(self) -> Result<longrunning::model::Operation> {
610 (*self.0.stub)
611 .delete_service_connection_map(self.0.request, self.0.options)
612 .await
613 .map(gax::response::Response::into_body)
614 }
615
616 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
618 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
619 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
620 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
621
622 let stub = self.0.stub.clone();
623 let mut options = self.0.options.clone();
624 options.set_retry_policy(gax::retry_policy::NeverRetry);
625 let query = move |name| {
626 let stub = stub.clone();
627 let options = options.clone();
628 async {
629 let op = GetOperation::new(stub)
630 .set_name(name)
631 .with_options(options)
632 .send()
633 .await?;
634 Ok(Operation::new(op))
635 }
636 };
637
638 let start = move || async {
639 let op = self.send().await?;
640 Ok(Operation::new(op))
641 };
642
643 lro::internal::new_unit_response_poller(
644 polling_error_policy,
645 polling_backoff_policy,
646 start,
647 query,
648 )
649 }
650
651 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
655 self.0.request.name = v.into();
656 self
657 }
658
659 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
661 self.0.request.request_id = v.into();
662 self
663 }
664
665 pub fn set_etag<T>(mut self, v: T) -> Self
667 where
668 T: std::convert::Into<std::string::String>,
669 {
670 self.0.request.etag = std::option::Option::Some(v.into());
671 self
672 }
673
674 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
676 where
677 T: std::convert::Into<std::string::String>,
678 {
679 self.0.request.etag = v.map(|x| x.into());
680 self
681 }
682 }
683
684 #[doc(hidden)]
685 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionMap {
686 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
687 &mut self.0.options
688 }
689 }
690
691 #[derive(Clone, Debug)]
713 pub struct ListServiceConnectionPolicies(
714 RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
715 );
716
717 impl ListServiceConnectionPolicies {
718 pub(crate) fn new(
719 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
720 ) -> Self {
721 Self(RequestBuilder::new(stub))
722 }
723
724 pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
726 mut self,
727 v: V,
728 ) -> Self {
729 self.0.request = v.into();
730 self
731 }
732
733 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
735 self.0.options = v.into();
736 self
737 }
738
739 pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
741 (*self.0.stub)
742 .list_service_connection_policies(self.0.request, self.0.options)
743 .await
744 .map(gax::response::Response::into_body)
745 }
746
747 pub fn by_page(
749 self,
750 ) -> impl gax::paginator::Paginator<
751 crate::model::ListServiceConnectionPoliciesResponse,
752 gax::error::Error,
753 > {
754 use std::clone::Clone;
755 let token = self.0.request.page_token.clone();
756 let execute = move |token: String| {
757 let mut builder = self.clone();
758 builder.0.request = builder.0.request.set_page_token(token);
759 builder.send()
760 };
761 gax::paginator::internal::new_paginator(token, execute)
762 }
763
764 pub fn by_item(
766 self,
767 ) -> impl gax::paginator::ItemPaginator<
768 crate::model::ListServiceConnectionPoliciesResponse,
769 gax::error::Error,
770 > {
771 use gax::paginator::Paginator;
772 self.by_page().items()
773 }
774
775 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
779 self.0.request.parent = v.into();
780 self
781 }
782
783 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
785 self.0.request.page_size = v.into();
786 self
787 }
788
789 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
791 self.0.request.page_token = v.into();
792 self
793 }
794
795 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
797 self.0.request.filter = v.into();
798 self
799 }
800
801 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
803 self.0.request.order_by = v.into();
804 self
805 }
806 }
807
808 #[doc(hidden)]
809 impl gax::options::internal::RequestBuilder for ListServiceConnectionPolicies {
810 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
811 &mut self.0.options
812 }
813 }
814
815 #[derive(Clone, Debug)]
833 pub struct GetServiceConnectionPolicy(
834 RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
835 );
836
837 impl GetServiceConnectionPolicy {
838 pub(crate) fn new(
839 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
840 ) -> Self {
841 Self(RequestBuilder::new(stub))
842 }
843
844 pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
846 mut self,
847 v: V,
848 ) -> Self {
849 self.0.request = v.into();
850 self
851 }
852
853 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
855 self.0.options = v.into();
856 self
857 }
858
859 pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
861 (*self.0.stub)
862 .get_service_connection_policy(self.0.request, self.0.options)
863 .await
864 .map(gax::response::Response::into_body)
865 }
866
867 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
871 self.0.request.name = v.into();
872 self
873 }
874 }
875
876 #[doc(hidden)]
877 impl gax::options::internal::RequestBuilder for GetServiceConnectionPolicy {
878 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
879 &mut self.0.options
880 }
881 }
882
883 #[derive(Clone, Debug)]
902 pub struct CreateServiceConnectionPolicy(
903 RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
904 );
905
906 impl CreateServiceConnectionPolicy {
907 pub(crate) fn new(
908 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
909 ) -> Self {
910 Self(RequestBuilder::new(stub))
911 }
912
913 pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
915 mut self,
916 v: V,
917 ) -> Self {
918 self.0.request = v.into();
919 self
920 }
921
922 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
924 self.0.options = v.into();
925 self
926 }
927
928 pub async fn send(self) -> Result<longrunning::model::Operation> {
935 (*self.0.stub)
936 .create_service_connection_policy(self.0.request, self.0.options)
937 .await
938 .map(gax::response::Response::into_body)
939 }
940
941 pub fn poller(
943 self,
944 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
945 {
946 type Operation = lro::internal::Operation<
947 crate::model::ServiceConnectionPolicy,
948 crate::model::OperationMetadata,
949 >;
950 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
951 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
952
953 let stub = self.0.stub.clone();
954 let mut options = self.0.options.clone();
955 options.set_retry_policy(gax::retry_policy::NeverRetry);
956 let query = move |name| {
957 let stub = stub.clone();
958 let options = options.clone();
959 async {
960 let op = GetOperation::new(stub)
961 .set_name(name)
962 .with_options(options)
963 .send()
964 .await?;
965 Ok(Operation::new(op))
966 }
967 };
968
969 let start = move || async {
970 let op = self.send().await?;
971 Ok(Operation::new(op))
972 };
973
974 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
975 }
976
977 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
981 self.0.request.parent = v.into();
982 self
983 }
984
985 pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
987 mut self,
988 v: T,
989 ) -> Self {
990 self.0.request.service_connection_policy_id = v.into();
991 self
992 }
993
994 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
998 where
999 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1000 {
1001 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1002 self
1003 }
1004
1005 pub fn set_or_clear_service_connection_policy<T>(
1009 mut self,
1010 v: std::option::Option<T>,
1011 ) -> Self
1012 where
1013 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1014 {
1015 self.0.request.service_connection_policy = v.map(|x| x.into());
1016 self
1017 }
1018
1019 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1021 self.0.request.request_id = v.into();
1022 self
1023 }
1024 }
1025
1026 #[doc(hidden)]
1027 impl gax::options::internal::RequestBuilder for CreateServiceConnectionPolicy {
1028 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1029 &mut self.0.options
1030 }
1031 }
1032
1033 #[derive(Clone, Debug)]
1052 pub struct UpdateServiceConnectionPolicy(
1053 RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1054 );
1055
1056 impl UpdateServiceConnectionPolicy {
1057 pub(crate) fn new(
1058 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1059 ) -> Self {
1060 Self(RequestBuilder::new(stub))
1061 }
1062
1063 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1065 mut self,
1066 v: V,
1067 ) -> Self {
1068 self.0.request = v.into();
1069 self
1070 }
1071
1072 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1074 self.0.options = v.into();
1075 self
1076 }
1077
1078 pub async fn send(self) -> Result<longrunning::model::Operation> {
1085 (*self.0.stub)
1086 .update_service_connection_policy(self.0.request, self.0.options)
1087 .await
1088 .map(gax::response::Response::into_body)
1089 }
1090
1091 pub fn poller(
1093 self,
1094 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
1095 {
1096 type Operation = lro::internal::Operation<
1097 crate::model::ServiceConnectionPolicy,
1098 crate::model::OperationMetadata,
1099 >;
1100 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1101 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1102
1103 let stub = self.0.stub.clone();
1104 let mut options = self.0.options.clone();
1105 options.set_retry_policy(gax::retry_policy::NeverRetry);
1106 let query = move |name| {
1107 let stub = stub.clone();
1108 let options = options.clone();
1109 async {
1110 let op = GetOperation::new(stub)
1111 .set_name(name)
1112 .with_options(options)
1113 .send()
1114 .await?;
1115 Ok(Operation::new(op))
1116 }
1117 };
1118
1119 let start = move || async {
1120 let op = self.send().await?;
1121 Ok(Operation::new(op))
1122 };
1123
1124 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1125 }
1126
1127 pub fn set_update_mask<T>(mut self, v: T) -> Self
1129 where
1130 T: std::convert::Into<wkt::FieldMask>,
1131 {
1132 self.0.request.update_mask = std::option::Option::Some(v.into());
1133 self
1134 }
1135
1136 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1138 where
1139 T: std::convert::Into<wkt::FieldMask>,
1140 {
1141 self.0.request.update_mask = v.map(|x| x.into());
1142 self
1143 }
1144
1145 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1149 where
1150 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1151 {
1152 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1153 self
1154 }
1155
1156 pub fn set_or_clear_service_connection_policy<T>(
1160 mut self,
1161 v: std::option::Option<T>,
1162 ) -> Self
1163 where
1164 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1165 {
1166 self.0.request.service_connection_policy = v.map(|x| x.into());
1167 self
1168 }
1169
1170 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1172 self.0.request.request_id = v.into();
1173 self
1174 }
1175 }
1176
1177 #[doc(hidden)]
1178 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionPolicy {
1179 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1180 &mut self.0.options
1181 }
1182 }
1183
1184 #[derive(Clone, Debug)]
1203 pub struct DeleteServiceConnectionPolicy(
1204 RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1205 );
1206
1207 impl DeleteServiceConnectionPolicy {
1208 pub(crate) fn new(
1209 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1210 ) -> Self {
1211 Self(RequestBuilder::new(stub))
1212 }
1213
1214 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1216 mut self,
1217 v: V,
1218 ) -> Self {
1219 self.0.request = v.into();
1220 self
1221 }
1222
1223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1225 self.0.options = v.into();
1226 self
1227 }
1228
1229 pub async fn send(self) -> Result<longrunning::model::Operation> {
1236 (*self.0.stub)
1237 .delete_service_connection_policy(self.0.request, self.0.options)
1238 .await
1239 .map(gax::response::Response::into_body)
1240 }
1241
1242 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1244 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1245 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1246 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1247
1248 let stub = self.0.stub.clone();
1249 let mut options = self.0.options.clone();
1250 options.set_retry_policy(gax::retry_policy::NeverRetry);
1251 let query = move |name| {
1252 let stub = stub.clone();
1253 let options = options.clone();
1254 async {
1255 let op = GetOperation::new(stub)
1256 .set_name(name)
1257 .with_options(options)
1258 .send()
1259 .await?;
1260 Ok(Operation::new(op))
1261 }
1262 };
1263
1264 let start = move || async {
1265 let op = self.send().await?;
1266 Ok(Operation::new(op))
1267 };
1268
1269 lro::internal::new_unit_response_poller(
1270 polling_error_policy,
1271 polling_backoff_policy,
1272 start,
1273 query,
1274 )
1275 }
1276
1277 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281 self.0.request.name = v.into();
1282 self
1283 }
1284
1285 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1287 self.0.request.request_id = v.into();
1288 self
1289 }
1290
1291 pub fn set_etag<T>(mut self, v: T) -> Self
1293 where
1294 T: std::convert::Into<std::string::String>,
1295 {
1296 self.0.request.etag = std::option::Option::Some(v.into());
1297 self
1298 }
1299
1300 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1302 where
1303 T: std::convert::Into<std::string::String>,
1304 {
1305 self.0.request.etag = v.map(|x| x.into());
1306 self
1307 }
1308 }
1309
1310 #[doc(hidden)]
1311 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionPolicy {
1312 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1313 &mut self.0.options
1314 }
1315 }
1316
1317 #[derive(Clone, Debug)]
1339 pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1340
1341 impl ListServiceClasses {
1342 pub(crate) fn new(
1343 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1344 ) -> Self {
1345 Self(RequestBuilder::new(stub))
1346 }
1347
1348 pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1350 mut self,
1351 v: V,
1352 ) -> Self {
1353 self.0.request = v.into();
1354 self
1355 }
1356
1357 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1359 self.0.options = v.into();
1360 self
1361 }
1362
1363 pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1365 (*self.0.stub)
1366 .list_service_classes(self.0.request, self.0.options)
1367 .await
1368 .map(gax::response::Response::into_body)
1369 }
1370
1371 pub fn by_page(
1373 self,
1374 ) -> impl gax::paginator::Paginator<crate::model::ListServiceClassesResponse, gax::error::Error>
1375 {
1376 use std::clone::Clone;
1377 let token = self.0.request.page_token.clone();
1378 let execute = move |token: String| {
1379 let mut builder = self.clone();
1380 builder.0.request = builder.0.request.set_page_token(token);
1381 builder.send()
1382 };
1383 gax::paginator::internal::new_paginator(token, execute)
1384 }
1385
1386 pub fn by_item(
1388 self,
1389 ) -> impl gax::paginator::ItemPaginator<
1390 crate::model::ListServiceClassesResponse,
1391 gax::error::Error,
1392 > {
1393 use gax::paginator::Paginator;
1394 self.by_page().items()
1395 }
1396
1397 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1401 self.0.request.parent = v.into();
1402 self
1403 }
1404
1405 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1407 self.0.request.page_size = v.into();
1408 self
1409 }
1410
1411 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1413 self.0.request.page_token = v.into();
1414 self
1415 }
1416
1417 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1419 self.0.request.filter = v.into();
1420 self
1421 }
1422
1423 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1425 self.0.request.order_by = v.into();
1426 self
1427 }
1428 }
1429
1430 #[doc(hidden)]
1431 impl gax::options::internal::RequestBuilder for ListServiceClasses {
1432 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1433 &mut self.0.options
1434 }
1435 }
1436
1437 #[derive(Clone, Debug)]
1455 pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1456
1457 impl GetServiceClass {
1458 pub(crate) fn new(
1459 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1460 ) -> Self {
1461 Self(RequestBuilder::new(stub))
1462 }
1463
1464 pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1466 self.0.request = v.into();
1467 self
1468 }
1469
1470 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1472 self.0.options = v.into();
1473 self
1474 }
1475
1476 pub async fn send(self) -> Result<crate::model::ServiceClass> {
1478 (*self.0.stub)
1479 .get_service_class(self.0.request, self.0.options)
1480 .await
1481 .map(gax::response::Response::into_body)
1482 }
1483
1484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488 self.0.request.name = v.into();
1489 self
1490 }
1491 }
1492
1493 #[doc(hidden)]
1494 impl gax::options::internal::RequestBuilder for GetServiceClass {
1495 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1496 &mut self.0.options
1497 }
1498 }
1499
1500 #[derive(Clone, Debug)]
1519 pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1520
1521 impl UpdateServiceClass {
1522 pub(crate) fn new(
1523 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1524 ) -> Self {
1525 Self(RequestBuilder::new(stub))
1526 }
1527
1528 pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1530 mut self,
1531 v: V,
1532 ) -> Self {
1533 self.0.request = v.into();
1534 self
1535 }
1536
1537 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1539 self.0.options = v.into();
1540 self
1541 }
1542
1543 pub async fn send(self) -> Result<longrunning::model::Operation> {
1550 (*self.0.stub)
1551 .update_service_class(self.0.request, self.0.options)
1552 .await
1553 .map(gax::response::Response::into_body)
1554 }
1555
1556 pub fn poller(
1558 self,
1559 ) -> impl lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata> {
1560 type Operation = lro::internal::Operation<
1561 crate::model::ServiceClass,
1562 crate::model::OperationMetadata,
1563 >;
1564 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1565 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1566
1567 let stub = self.0.stub.clone();
1568 let mut options = self.0.options.clone();
1569 options.set_retry_policy(gax::retry_policy::NeverRetry);
1570 let query = move |name| {
1571 let stub = stub.clone();
1572 let options = options.clone();
1573 async {
1574 let op = GetOperation::new(stub)
1575 .set_name(name)
1576 .with_options(options)
1577 .send()
1578 .await?;
1579 Ok(Operation::new(op))
1580 }
1581 };
1582
1583 let start = move || async {
1584 let op = self.send().await?;
1585 Ok(Operation::new(op))
1586 };
1587
1588 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1589 }
1590
1591 pub fn set_update_mask<T>(mut self, v: T) -> Self
1593 where
1594 T: std::convert::Into<wkt::FieldMask>,
1595 {
1596 self.0.request.update_mask = std::option::Option::Some(v.into());
1597 self
1598 }
1599
1600 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1602 where
1603 T: std::convert::Into<wkt::FieldMask>,
1604 {
1605 self.0.request.update_mask = v.map(|x| x.into());
1606 self
1607 }
1608
1609 pub fn set_service_class<T>(mut self, v: T) -> Self
1613 where
1614 T: std::convert::Into<crate::model::ServiceClass>,
1615 {
1616 self.0.request.service_class = std::option::Option::Some(v.into());
1617 self
1618 }
1619
1620 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1624 where
1625 T: std::convert::Into<crate::model::ServiceClass>,
1626 {
1627 self.0.request.service_class = v.map(|x| x.into());
1628 self
1629 }
1630
1631 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1633 self.0.request.request_id = v.into();
1634 self
1635 }
1636 }
1637
1638 #[doc(hidden)]
1639 impl gax::options::internal::RequestBuilder for UpdateServiceClass {
1640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1641 &mut self.0.options
1642 }
1643 }
1644
1645 #[derive(Clone, Debug)]
1664 pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1665
1666 impl DeleteServiceClass {
1667 pub(crate) fn new(
1668 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1669 ) -> Self {
1670 Self(RequestBuilder::new(stub))
1671 }
1672
1673 pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1675 mut self,
1676 v: V,
1677 ) -> Self {
1678 self.0.request = v.into();
1679 self
1680 }
1681
1682 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1684 self.0.options = v.into();
1685 self
1686 }
1687
1688 pub async fn send(self) -> Result<longrunning::model::Operation> {
1695 (*self.0.stub)
1696 .delete_service_class(self.0.request, self.0.options)
1697 .await
1698 .map(gax::response::Response::into_body)
1699 }
1700
1701 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1703 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1704 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1705 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1706
1707 let stub = self.0.stub.clone();
1708 let mut options = self.0.options.clone();
1709 options.set_retry_policy(gax::retry_policy::NeverRetry);
1710 let query = move |name| {
1711 let stub = stub.clone();
1712 let options = options.clone();
1713 async {
1714 let op = GetOperation::new(stub)
1715 .set_name(name)
1716 .with_options(options)
1717 .send()
1718 .await?;
1719 Ok(Operation::new(op))
1720 }
1721 };
1722
1723 let start = move || async {
1724 let op = self.send().await?;
1725 Ok(Operation::new(op))
1726 };
1727
1728 lro::internal::new_unit_response_poller(
1729 polling_error_policy,
1730 polling_backoff_policy,
1731 start,
1732 query,
1733 )
1734 }
1735
1736 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740 self.0.request.name = v.into();
1741 self
1742 }
1743
1744 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746 self.0.request.request_id = v.into();
1747 self
1748 }
1749
1750 pub fn set_etag<T>(mut self, v: T) -> Self
1752 where
1753 T: std::convert::Into<std::string::String>,
1754 {
1755 self.0.request.etag = std::option::Option::Some(v.into());
1756 self
1757 }
1758
1759 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1761 where
1762 T: std::convert::Into<std::string::String>,
1763 {
1764 self.0.request.etag = v.map(|x| x.into());
1765 self
1766 }
1767 }
1768
1769 #[doc(hidden)]
1770 impl gax::options::internal::RequestBuilder for DeleteServiceClass {
1771 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1772 &mut self.0.options
1773 }
1774 }
1775
1776 #[derive(Clone, Debug)]
1794 pub struct GetServiceConnectionToken(
1795 RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1796 );
1797
1798 impl GetServiceConnectionToken {
1799 pub(crate) fn new(
1800 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1801 ) -> Self {
1802 Self(RequestBuilder::new(stub))
1803 }
1804
1805 pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1807 mut self,
1808 v: V,
1809 ) -> Self {
1810 self.0.request = v.into();
1811 self
1812 }
1813
1814 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1816 self.0.options = v.into();
1817 self
1818 }
1819
1820 pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1822 (*self.0.stub)
1823 .get_service_connection_token(self.0.request, self.0.options)
1824 .await
1825 .map(gax::response::Response::into_body)
1826 }
1827
1828 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1832 self.0.request.name = v.into();
1833 self
1834 }
1835 }
1836
1837 #[doc(hidden)]
1838 impl gax::options::internal::RequestBuilder for GetServiceConnectionToken {
1839 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1840 &mut self.0.options
1841 }
1842 }
1843
1844 #[derive(Clone, Debug)]
1866 pub struct ListServiceConnectionTokens(
1867 RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1868 );
1869
1870 impl ListServiceConnectionTokens {
1871 pub(crate) fn new(
1872 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1873 ) -> Self {
1874 Self(RequestBuilder::new(stub))
1875 }
1876
1877 pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1879 mut self,
1880 v: V,
1881 ) -> Self {
1882 self.0.request = v.into();
1883 self
1884 }
1885
1886 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1888 self.0.options = v.into();
1889 self
1890 }
1891
1892 pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1894 (*self.0.stub)
1895 .list_service_connection_tokens(self.0.request, self.0.options)
1896 .await
1897 .map(gax::response::Response::into_body)
1898 }
1899
1900 pub fn by_page(
1902 self,
1903 ) -> impl gax::paginator::Paginator<
1904 crate::model::ListServiceConnectionTokensResponse,
1905 gax::error::Error,
1906 > {
1907 use std::clone::Clone;
1908 let token = self.0.request.page_token.clone();
1909 let execute = move |token: String| {
1910 let mut builder = self.clone();
1911 builder.0.request = builder.0.request.set_page_token(token);
1912 builder.send()
1913 };
1914 gax::paginator::internal::new_paginator(token, execute)
1915 }
1916
1917 pub fn by_item(
1919 self,
1920 ) -> impl gax::paginator::ItemPaginator<
1921 crate::model::ListServiceConnectionTokensResponse,
1922 gax::error::Error,
1923 > {
1924 use gax::paginator::Paginator;
1925 self.by_page().items()
1926 }
1927
1928 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1932 self.0.request.parent = v.into();
1933 self
1934 }
1935
1936 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1938 self.0.request.page_size = v.into();
1939 self
1940 }
1941
1942 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.0.request.page_token = v.into();
1945 self
1946 }
1947
1948 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1950 self.0.request.filter = v.into();
1951 self
1952 }
1953
1954 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1956 self.0.request.order_by = v.into();
1957 self
1958 }
1959 }
1960
1961 #[doc(hidden)]
1962 impl gax::options::internal::RequestBuilder for ListServiceConnectionTokens {
1963 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1964 &mut self.0.options
1965 }
1966 }
1967
1968 #[derive(Clone, Debug)]
1987 pub struct CreateServiceConnectionToken(
1988 RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
1989 );
1990
1991 impl CreateServiceConnectionToken {
1992 pub(crate) fn new(
1993 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1994 ) -> Self {
1995 Self(RequestBuilder::new(stub))
1996 }
1997
1998 pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2000 mut self,
2001 v: V,
2002 ) -> Self {
2003 self.0.request = v.into();
2004 self
2005 }
2006
2007 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2009 self.0.options = v.into();
2010 self
2011 }
2012
2013 pub async fn send(self) -> Result<longrunning::model::Operation> {
2020 (*self.0.stub)
2021 .create_service_connection_token(self.0.request, self.0.options)
2022 .await
2023 .map(gax::response::Response::into_body)
2024 }
2025
2026 pub fn poller(
2028 self,
2029 ) -> impl lro::Poller<crate::model::ServiceConnectionToken, crate::model::OperationMetadata>
2030 {
2031 type Operation = lro::internal::Operation<
2032 crate::model::ServiceConnectionToken,
2033 crate::model::OperationMetadata,
2034 >;
2035 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2036 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2037
2038 let stub = self.0.stub.clone();
2039 let mut options = self.0.options.clone();
2040 options.set_retry_policy(gax::retry_policy::NeverRetry);
2041 let query = move |name| {
2042 let stub = stub.clone();
2043 let options = options.clone();
2044 async {
2045 let op = GetOperation::new(stub)
2046 .set_name(name)
2047 .with_options(options)
2048 .send()
2049 .await?;
2050 Ok(Operation::new(op))
2051 }
2052 };
2053
2054 let start = move || async {
2055 let op = self.send().await?;
2056 Ok(Operation::new(op))
2057 };
2058
2059 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2060 }
2061
2062 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2066 self.0.request.parent = v.into();
2067 self
2068 }
2069
2070 pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2072 mut self,
2073 v: T,
2074 ) -> Self {
2075 self.0.request.service_connection_token_id = v.into();
2076 self
2077 }
2078
2079 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2083 where
2084 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2085 {
2086 self.0.request.service_connection_token = std::option::Option::Some(v.into());
2087 self
2088 }
2089
2090 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2094 where
2095 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2096 {
2097 self.0.request.service_connection_token = v.map(|x| x.into());
2098 self
2099 }
2100
2101 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2103 self.0.request.request_id = v.into();
2104 self
2105 }
2106 }
2107
2108 #[doc(hidden)]
2109 impl gax::options::internal::RequestBuilder for CreateServiceConnectionToken {
2110 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2111 &mut self.0.options
2112 }
2113 }
2114
2115 #[derive(Clone, Debug)]
2134 pub struct DeleteServiceConnectionToken(
2135 RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2136 );
2137
2138 impl DeleteServiceConnectionToken {
2139 pub(crate) fn new(
2140 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2141 ) -> Self {
2142 Self(RequestBuilder::new(stub))
2143 }
2144
2145 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2147 mut self,
2148 v: V,
2149 ) -> Self {
2150 self.0.request = v.into();
2151 self
2152 }
2153
2154 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2156 self.0.options = v.into();
2157 self
2158 }
2159
2160 pub async fn send(self) -> Result<longrunning::model::Operation> {
2167 (*self.0.stub)
2168 .delete_service_connection_token(self.0.request, self.0.options)
2169 .await
2170 .map(gax::response::Response::into_body)
2171 }
2172
2173 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2175 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2176 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2177 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2178
2179 let stub = self.0.stub.clone();
2180 let mut options = self.0.options.clone();
2181 options.set_retry_policy(gax::retry_policy::NeverRetry);
2182 let query = move |name| {
2183 let stub = stub.clone();
2184 let options = options.clone();
2185 async {
2186 let op = GetOperation::new(stub)
2187 .set_name(name)
2188 .with_options(options)
2189 .send()
2190 .await?;
2191 Ok(Operation::new(op))
2192 }
2193 };
2194
2195 let start = move || async {
2196 let op = self.send().await?;
2197 Ok(Operation::new(op))
2198 };
2199
2200 lro::internal::new_unit_response_poller(
2201 polling_error_policy,
2202 polling_backoff_policy,
2203 start,
2204 query,
2205 )
2206 }
2207
2208 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2212 self.0.request.name = v.into();
2213 self
2214 }
2215
2216 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2218 self.0.request.request_id = v.into();
2219 self
2220 }
2221
2222 pub fn set_etag<T>(mut self, v: T) -> Self
2224 where
2225 T: std::convert::Into<std::string::String>,
2226 {
2227 self.0.request.etag = std::option::Option::Some(v.into());
2228 self
2229 }
2230
2231 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2233 where
2234 T: std::convert::Into<std::string::String>,
2235 {
2236 self.0.request.etag = v.map(|x| x.into());
2237 self
2238 }
2239 }
2240
2241 #[doc(hidden)]
2242 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionToken {
2243 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2244 &mut self.0.options
2245 }
2246 }
2247
2248 #[derive(Clone, Debug)]
2270 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2271
2272 impl ListLocations {
2273 pub(crate) fn new(
2274 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2275 ) -> Self {
2276 Self(RequestBuilder::new(stub))
2277 }
2278
2279 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2281 mut self,
2282 v: V,
2283 ) -> Self {
2284 self.0.request = v.into();
2285 self
2286 }
2287
2288 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2290 self.0.options = v.into();
2291 self
2292 }
2293
2294 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2296 (*self.0.stub)
2297 .list_locations(self.0.request, self.0.options)
2298 .await
2299 .map(gax::response::Response::into_body)
2300 }
2301
2302 pub fn by_page(
2304 self,
2305 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2306 {
2307 use std::clone::Clone;
2308 let token = self.0.request.page_token.clone();
2309 let execute = move |token: String| {
2310 let mut builder = self.clone();
2311 builder.0.request = builder.0.request.set_page_token(token);
2312 builder.send()
2313 };
2314 gax::paginator::internal::new_paginator(token, execute)
2315 }
2316
2317 pub fn by_item(
2319 self,
2320 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2321 {
2322 use gax::paginator::Paginator;
2323 self.by_page().items()
2324 }
2325
2326 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328 self.0.request.name = v.into();
2329 self
2330 }
2331
2332 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2334 self.0.request.filter = v.into();
2335 self
2336 }
2337
2338 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2340 self.0.request.page_size = v.into();
2341 self
2342 }
2343
2344 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2346 self.0.request.page_token = v.into();
2347 self
2348 }
2349 }
2350
2351 #[doc(hidden)]
2352 impl gax::options::internal::RequestBuilder for ListLocations {
2353 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2354 &mut self.0.options
2355 }
2356 }
2357
2358 #[derive(Clone, Debug)]
2376 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2377
2378 impl GetLocation {
2379 pub(crate) fn new(
2380 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2381 ) -> Self {
2382 Self(RequestBuilder::new(stub))
2383 }
2384
2385 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2387 self.0.request = v.into();
2388 self
2389 }
2390
2391 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2393 self.0.options = v.into();
2394 self
2395 }
2396
2397 pub async fn send(self) -> Result<location::model::Location> {
2399 (*self.0.stub)
2400 .get_location(self.0.request, self.0.options)
2401 .await
2402 .map(gax::response::Response::into_body)
2403 }
2404
2405 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2407 self.0.request.name = v.into();
2408 self
2409 }
2410 }
2411
2412 #[doc(hidden)]
2413 impl gax::options::internal::RequestBuilder for GetLocation {
2414 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2415 &mut self.0.options
2416 }
2417 }
2418
2419 #[derive(Clone, Debug)]
2437 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2438
2439 impl SetIamPolicy {
2440 pub(crate) fn new(
2441 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2442 ) -> Self {
2443 Self(RequestBuilder::new(stub))
2444 }
2445
2446 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2448 self.0.request = v.into();
2449 self
2450 }
2451
2452 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2454 self.0.options = v.into();
2455 self
2456 }
2457
2458 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2460 (*self.0.stub)
2461 .set_iam_policy(self.0.request, self.0.options)
2462 .await
2463 .map(gax::response::Response::into_body)
2464 }
2465
2466 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470 self.0.request.resource = v.into();
2471 self
2472 }
2473
2474 pub fn set_policy<T>(mut self, v: T) -> Self
2478 where
2479 T: std::convert::Into<iam_v1::model::Policy>,
2480 {
2481 self.0.request.policy = std::option::Option::Some(v.into());
2482 self
2483 }
2484
2485 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2489 where
2490 T: std::convert::Into<iam_v1::model::Policy>,
2491 {
2492 self.0.request.policy = v.map(|x| x.into());
2493 self
2494 }
2495
2496 pub fn set_update_mask<T>(mut self, v: T) -> Self
2498 where
2499 T: std::convert::Into<wkt::FieldMask>,
2500 {
2501 self.0.request.update_mask = std::option::Option::Some(v.into());
2502 self
2503 }
2504
2505 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2507 where
2508 T: std::convert::Into<wkt::FieldMask>,
2509 {
2510 self.0.request.update_mask = v.map(|x| x.into());
2511 self
2512 }
2513 }
2514
2515 #[doc(hidden)]
2516 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2518 &mut self.0.options
2519 }
2520 }
2521
2522 #[derive(Clone, Debug)]
2540 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2541
2542 impl GetIamPolicy {
2543 pub(crate) fn new(
2544 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2545 ) -> Self {
2546 Self(RequestBuilder::new(stub))
2547 }
2548
2549 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2551 self.0.request = v.into();
2552 self
2553 }
2554
2555 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2557 self.0.options = v.into();
2558 self
2559 }
2560
2561 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2563 (*self.0.stub)
2564 .get_iam_policy(self.0.request, self.0.options)
2565 .await
2566 .map(gax::response::Response::into_body)
2567 }
2568
2569 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573 self.0.request.resource = v.into();
2574 self
2575 }
2576
2577 pub fn set_options<T>(mut self, v: T) -> Self
2579 where
2580 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2581 {
2582 self.0.request.options = std::option::Option::Some(v.into());
2583 self
2584 }
2585
2586 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2588 where
2589 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2590 {
2591 self.0.request.options = v.map(|x| x.into());
2592 self
2593 }
2594 }
2595
2596 #[doc(hidden)]
2597 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2598 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2599 &mut self.0.options
2600 }
2601 }
2602
2603 #[derive(Clone, Debug)]
2621 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2622
2623 impl TestIamPermissions {
2624 pub(crate) fn new(
2625 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2626 ) -> Self {
2627 Self(RequestBuilder::new(stub))
2628 }
2629
2630 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2632 mut self,
2633 v: V,
2634 ) -> Self {
2635 self.0.request = v.into();
2636 self
2637 }
2638
2639 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2641 self.0.options = v.into();
2642 self
2643 }
2644
2645 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2647 (*self.0.stub)
2648 .test_iam_permissions(self.0.request, self.0.options)
2649 .await
2650 .map(gax::response::Response::into_body)
2651 }
2652
2653 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2657 self.0.request.resource = v.into();
2658 self
2659 }
2660
2661 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2665 where
2666 T: std::iter::IntoIterator<Item = V>,
2667 V: std::convert::Into<std::string::String>,
2668 {
2669 use std::iter::Iterator;
2670 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2671 self
2672 }
2673 }
2674
2675 #[doc(hidden)]
2676 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2677 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2678 &mut self.0.options
2679 }
2680 }
2681
2682 #[derive(Clone, Debug)]
2704 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2705
2706 impl ListOperations {
2707 pub(crate) fn new(
2708 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2709 ) -> Self {
2710 Self(RequestBuilder::new(stub))
2711 }
2712
2713 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2715 mut self,
2716 v: V,
2717 ) -> Self {
2718 self.0.request = v.into();
2719 self
2720 }
2721
2722 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2724 self.0.options = v.into();
2725 self
2726 }
2727
2728 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2730 (*self.0.stub)
2731 .list_operations(self.0.request, self.0.options)
2732 .await
2733 .map(gax::response::Response::into_body)
2734 }
2735
2736 pub fn by_page(
2738 self,
2739 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2740 {
2741 use std::clone::Clone;
2742 let token = self.0.request.page_token.clone();
2743 let execute = move |token: String| {
2744 let mut builder = self.clone();
2745 builder.0.request = builder.0.request.set_page_token(token);
2746 builder.send()
2747 };
2748 gax::paginator::internal::new_paginator(token, execute)
2749 }
2750
2751 pub fn by_item(
2753 self,
2754 ) -> impl gax::paginator::ItemPaginator<
2755 longrunning::model::ListOperationsResponse,
2756 gax::error::Error,
2757 > {
2758 use gax::paginator::Paginator;
2759 self.by_page().items()
2760 }
2761
2762 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2764 self.0.request.name = v.into();
2765 self
2766 }
2767
2768 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2770 self.0.request.filter = v.into();
2771 self
2772 }
2773
2774 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2776 self.0.request.page_size = v.into();
2777 self
2778 }
2779
2780 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2782 self.0.request.page_token = v.into();
2783 self
2784 }
2785 }
2786
2787 #[doc(hidden)]
2788 impl gax::options::internal::RequestBuilder for ListOperations {
2789 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2790 &mut self.0.options
2791 }
2792 }
2793
2794 #[derive(Clone, Debug)]
2812 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2813
2814 impl GetOperation {
2815 pub(crate) fn new(
2816 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2817 ) -> Self {
2818 Self(RequestBuilder::new(stub))
2819 }
2820
2821 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2823 mut self,
2824 v: V,
2825 ) -> Self {
2826 self.0.request = v.into();
2827 self
2828 }
2829
2830 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2832 self.0.options = v.into();
2833 self
2834 }
2835
2836 pub async fn send(self) -> Result<longrunning::model::Operation> {
2838 (*self.0.stub)
2839 .get_operation(self.0.request, self.0.options)
2840 .await
2841 .map(gax::response::Response::into_body)
2842 }
2843
2844 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2846 self.0.request.name = v.into();
2847 self
2848 }
2849 }
2850
2851 #[doc(hidden)]
2852 impl gax::options::internal::RequestBuilder for GetOperation {
2853 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2854 &mut self.0.options
2855 }
2856 }
2857
2858 #[derive(Clone, Debug)]
2876 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2877
2878 impl DeleteOperation {
2879 pub(crate) fn new(
2880 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2881 ) -> Self {
2882 Self(RequestBuilder::new(stub))
2883 }
2884
2885 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2887 mut self,
2888 v: V,
2889 ) -> Self {
2890 self.0.request = v.into();
2891 self
2892 }
2893
2894 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2896 self.0.options = v.into();
2897 self
2898 }
2899
2900 pub async fn send(self) -> Result<()> {
2902 (*self.0.stub)
2903 .delete_operation(self.0.request, self.0.options)
2904 .await
2905 .map(gax::response::Response::into_body)
2906 }
2907
2908 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2910 self.0.request.name = v.into();
2911 self
2912 }
2913 }
2914
2915 #[doc(hidden)]
2916 impl gax::options::internal::RequestBuilder for DeleteOperation {
2917 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2918 &mut self.0.options
2919 }
2920 }
2921
2922 #[derive(Clone, Debug)]
2940 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2941
2942 impl CancelOperation {
2943 pub(crate) fn new(
2944 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2945 ) -> Self {
2946 Self(RequestBuilder::new(stub))
2947 }
2948
2949 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2951 mut self,
2952 v: V,
2953 ) -> Self {
2954 self.0.request = v.into();
2955 self
2956 }
2957
2958 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2960 self.0.options = v.into();
2961 self
2962 }
2963
2964 pub async fn send(self) -> Result<()> {
2966 (*self.0.stub)
2967 .cancel_operation(self.0.request, self.0.options)
2968 .await
2969 .map(gax::response::Response::into_body)
2970 }
2971
2972 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.0.request.name = v.into();
2975 self
2976 }
2977 }
2978
2979 #[doc(hidden)]
2980 impl gax::options::internal::RequestBuilder for CancelOperation {
2981 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2982 &mut self.0.options
2983 }
2984 }
2985}
2986
2987pub mod hub_service {
2988 use crate::Result;
2989
2990 pub type ClientBuilder =
3004 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3005
3006 pub(crate) mod client {
3007 use super::super::super::client::HubService;
3008 pub struct Factory;
3009 impl gax::client_builder::internal::ClientFactory for Factory {
3010 type Client = HubService;
3011 type Credentials = gaxi::options::Credentials;
3012 async fn build(
3013 self,
3014 config: gaxi::options::ClientConfig,
3015 ) -> gax::client_builder::Result<Self::Client> {
3016 Self::Client::new(config).await
3017 }
3018 }
3019 }
3020
3021 #[derive(Clone, Debug)]
3023 pub(crate) struct RequestBuilder<R: std::default::Default> {
3024 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3025 request: R,
3026 options: gax::options::RequestOptions,
3027 }
3028
3029 impl<R> RequestBuilder<R>
3030 where
3031 R: std::default::Default,
3032 {
3033 pub(crate) fn new(
3034 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3035 ) -> Self {
3036 Self {
3037 stub,
3038 request: R::default(),
3039 options: gax::options::RequestOptions::default(),
3040 }
3041 }
3042 }
3043
3044 #[derive(Clone, Debug)]
3066 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
3067
3068 impl ListHubs {
3069 pub(crate) fn new(
3070 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3071 ) -> Self {
3072 Self(RequestBuilder::new(stub))
3073 }
3074
3075 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
3077 self.0.request = v.into();
3078 self
3079 }
3080
3081 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3083 self.0.options = v.into();
3084 self
3085 }
3086
3087 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
3089 (*self.0.stub)
3090 .list_hubs(self.0.request, self.0.options)
3091 .await
3092 .map(gax::response::Response::into_body)
3093 }
3094
3095 pub fn by_page(
3097 self,
3098 ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
3099 {
3100 use std::clone::Clone;
3101 let token = self.0.request.page_token.clone();
3102 let execute = move |token: String| {
3103 let mut builder = self.clone();
3104 builder.0.request = builder.0.request.set_page_token(token);
3105 builder.send()
3106 };
3107 gax::paginator::internal::new_paginator(token, execute)
3108 }
3109
3110 pub fn by_item(
3112 self,
3113 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubsResponse, gax::error::Error>
3114 {
3115 use gax::paginator::Paginator;
3116 self.by_page().items()
3117 }
3118
3119 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3123 self.0.request.parent = v.into();
3124 self
3125 }
3126
3127 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3129 self.0.request.page_size = v.into();
3130 self
3131 }
3132
3133 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3135 self.0.request.page_token = v.into();
3136 self
3137 }
3138
3139 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3141 self.0.request.filter = v.into();
3142 self
3143 }
3144
3145 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3147 self.0.request.order_by = v.into();
3148 self
3149 }
3150 }
3151
3152 #[doc(hidden)]
3153 impl gax::options::internal::RequestBuilder for ListHubs {
3154 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3155 &mut self.0.options
3156 }
3157 }
3158
3159 #[derive(Clone, Debug)]
3177 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
3178
3179 impl GetHub {
3180 pub(crate) fn new(
3181 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3182 ) -> Self {
3183 Self(RequestBuilder::new(stub))
3184 }
3185
3186 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
3188 self.0.request = v.into();
3189 self
3190 }
3191
3192 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3194 self.0.options = v.into();
3195 self
3196 }
3197
3198 pub async fn send(self) -> Result<crate::model::Hub> {
3200 (*self.0.stub)
3201 .get_hub(self.0.request, self.0.options)
3202 .await
3203 .map(gax::response::Response::into_body)
3204 }
3205
3206 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3210 self.0.request.name = v.into();
3211 self
3212 }
3213 }
3214
3215 #[doc(hidden)]
3216 impl gax::options::internal::RequestBuilder for GetHub {
3217 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3218 &mut self.0.options
3219 }
3220 }
3221
3222 #[derive(Clone, Debug)]
3241 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
3242
3243 impl CreateHub {
3244 pub(crate) fn new(
3245 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3246 ) -> Self {
3247 Self(RequestBuilder::new(stub))
3248 }
3249
3250 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
3252 self.0.request = v.into();
3253 self
3254 }
3255
3256 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3258 self.0.options = v.into();
3259 self
3260 }
3261
3262 pub async fn send(self) -> Result<longrunning::model::Operation> {
3269 (*self.0.stub)
3270 .create_hub(self.0.request, self.0.options)
3271 .await
3272 .map(gax::response::Response::into_body)
3273 }
3274
3275 pub fn poller(
3277 self,
3278 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
3279 type Operation =
3280 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
3281 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3282 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3283
3284 let stub = self.0.stub.clone();
3285 let mut options = self.0.options.clone();
3286 options.set_retry_policy(gax::retry_policy::NeverRetry);
3287 let query = move |name| {
3288 let stub = stub.clone();
3289 let options = options.clone();
3290 async {
3291 let op = GetOperation::new(stub)
3292 .set_name(name)
3293 .with_options(options)
3294 .send()
3295 .await?;
3296 Ok(Operation::new(op))
3297 }
3298 };
3299
3300 let start = move || async {
3301 let op = self.send().await?;
3302 Ok(Operation::new(op))
3303 };
3304
3305 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3306 }
3307
3308 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3312 self.0.request.parent = v.into();
3313 self
3314 }
3315
3316 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3320 self.0.request.hub_id = v.into();
3321 self
3322 }
3323
3324 pub fn set_hub<T>(mut self, v: T) -> Self
3328 where
3329 T: std::convert::Into<crate::model::Hub>,
3330 {
3331 self.0.request.hub = std::option::Option::Some(v.into());
3332 self
3333 }
3334
3335 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
3339 where
3340 T: std::convert::Into<crate::model::Hub>,
3341 {
3342 self.0.request.hub = v.map(|x| x.into());
3343 self
3344 }
3345
3346 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3348 self.0.request.request_id = v.into();
3349 self
3350 }
3351 }
3352
3353 #[doc(hidden)]
3354 impl gax::options::internal::RequestBuilder for CreateHub {
3355 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3356 &mut self.0.options
3357 }
3358 }
3359
3360 #[derive(Clone, Debug)]
3379 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
3380
3381 impl UpdateHub {
3382 pub(crate) fn new(
3383 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3384 ) -> Self {
3385 Self(RequestBuilder::new(stub))
3386 }
3387
3388 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
3390 self.0.request = v.into();
3391 self
3392 }
3393
3394 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3396 self.0.options = v.into();
3397 self
3398 }
3399
3400 pub async fn send(self) -> Result<longrunning::model::Operation> {
3407 (*self.0.stub)
3408 .update_hub(self.0.request, self.0.options)
3409 .await
3410 .map(gax::response::Response::into_body)
3411 }
3412
3413 pub fn poller(
3415 self,
3416 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
3417 type Operation =
3418 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
3419 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3420 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3421
3422 let stub = self.0.stub.clone();
3423 let mut options = self.0.options.clone();
3424 options.set_retry_policy(gax::retry_policy::NeverRetry);
3425 let query = move |name| {
3426 let stub = stub.clone();
3427 let options = options.clone();
3428 async {
3429 let op = GetOperation::new(stub)
3430 .set_name(name)
3431 .with_options(options)
3432 .send()
3433 .await?;
3434 Ok(Operation::new(op))
3435 }
3436 };
3437
3438 let start = move || async {
3439 let op = self.send().await?;
3440 Ok(Operation::new(op))
3441 };
3442
3443 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3444 }
3445
3446 pub fn set_update_mask<T>(mut self, v: T) -> Self
3448 where
3449 T: std::convert::Into<wkt::FieldMask>,
3450 {
3451 self.0.request.update_mask = std::option::Option::Some(v.into());
3452 self
3453 }
3454
3455 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3457 where
3458 T: std::convert::Into<wkt::FieldMask>,
3459 {
3460 self.0.request.update_mask = v.map(|x| x.into());
3461 self
3462 }
3463
3464 pub fn set_hub<T>(mut self, v: T) -> Self
3468 where
3469 T: std::convert::Into<crate::model::Hub>,
3470 {
3471 self.0.request.hub = std::option::Option::Some(v.into());
3472 self
3473 }
3474
3475 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
3479 where
3480 T: std::convert::Into<crate::model::Hub>,
3481 {
3482 self.0.request.hub = v.map(|x| x.into());
3483 self
3484 }
3485
3486 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3488 self.0.request.request_id = v.into();
3489 self
3490 }
3491 }
3492
3493 #[doc(hidden)]
3494 impl gax::options::internal::RequestBuilder for UpdateHub {
3495 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3496 &mut self.0.options
3497 }
3498 }
3499
3500 #[derive(Clone, Debug)]
3519 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
3520
3521 impl DeleteHub {
3522 pub(crate) fn new(
3523 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3524 ) -> Self {
3525 Self(RequestBuilder::new(stub))
3526 }
3527
3528 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
3530 self.0.request = v.into();
3531 self
3532 }
3533
3534 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3536 self.0.options = v.into();
3537 self
3538 }
3539
3540 pub async fn send(self) -> Result<longrunning::model::Operation> {
3547 (*self.0.stub)
3548 .delete_hub(self.0.request, self.0.options)
3549 .await
3550 .map(gax::response::Response::into_body)
3551 }
3552
3553 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3555 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3556 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3557 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3558
3559 let stub = self.0.stub.clone();
3560 let mut options = self.0.options.clone();
3561 options.set_retry_policy(gax::retry_policy::NeverRetry);
3562 let query = move |name| {
3563 let stub = stub.clone();
3564 let options = options.clone();
3565 async {
3566 let op = GetOperation::new(stub)
3567 .set_name(name)
3568 .with_options(options)
3569 .send()
3570 .await?;
3571 Ok(Operation::new(op))
3572 }
3573 };
3574
3575 let start = move || async {
3576 let op = self.send().await?;
3577 Ok(Operation::new(op))
3578 };
3579
3580 lro::internal::new_unit_response_poller(
3581 polling_error_policy,
3582 polling_backoff_policy,
3583 start,
3584 query,
3585 )
3586 }
3587
3588 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3592 self.0.request.name = v.into();
3593 self
3594 }
3595
3596 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3598 self.0.request.request_id = v.into();
3599 self
3600 }
3601 }
3602
3603 #[doc(hidden)]
3604 impl gax::options::internal::RequestBuilder for DeleteHub {
3605 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3606 &mut self.0.options
3607 }
3608 }
3609
3610 #[derive(Clone, Debug)]
3632 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
3633
3634 impl ListHubSpokes {
3635 pub(crate) fn new(
3636 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3637 ) -> Self {
3638 Self(RequestBuilder::new(stub))
3639 }
3640
3641 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
3643 self.0.request = v.into();
3644 self
3645 }
3646
3647 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3649 self.0.options = v.into();
3650 self
3651 }
3652
3653 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
3655 (*self.0.stub)
3656 .list_hub_spokes(self.0.request, self.0.options)
3657 .await
3658 .map(gax::response::Response::into_body)
3659 }
3660
3661 pub fn by_page(
3663 self,
3664 ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
3665 {
3666 use std::clone::Clone;
3667 let token = self.0.request.page_token.clone();
3668 let execute = move |token: String| {
3669 let mut builder = self.clone();
3670 builder.0.request = builder.0.request.set_page_token(token);
3671 builder.send()
3672 };
3673 gax::paginator::internal::new_paginator(token, execute)
3674 }
3675
3676 pub fn by_item(
3678 self,
3679 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubSpokesResponse, gax::error::Error>
3680 {
3681 use gax::paginator::Paginator;
3682 self.by_page().items()
3683 }
3684
3685 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3689 self.0.request.name = v.into();
3690 self
3691 }
3692
3693 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
3695 where
3696 T: std::iter::IntoIterator<Item = V>,
3697 V: std::convert::Into<std::string::String>,
3698 {
3699 use std::iter::Iterator;
3700 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
3701 self
3702 }
3703
3704 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3706 self.0.request.page_size = v.into();
3707 self
3708 }
3709
3710 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3712 self.0.request.page_token = v.into();
3713 self
3714 }
3715
3716 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3718 self.0.request.filter = v.into();
3719 self
3720 }
3721
3722 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3724 self.0.request.order_by = v.into();
3725 self
3726 }
3727
3728 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
3730 mut self,
3731 v: T,
3732 ) -> Self {
3733 self.0.request.view = v.into();
3734 self
3735 }
3736 }
3737
3738 #[doc(hidden)]
3739 impl gax::options::internal::RequestBuilder for ListHubSpokes {
3740 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3741 &mut self.0.options
3742 }
3743 }
3744
3745 #[derive(Clone, Debug)]
3767 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
3768
3769 impl QueryHubStatus {
3770 pub(crate) fn new(
3771 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3772 ) -> Self {
3773 Self(RequestBuilder::new(stub))
3774 }
3775
3776 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
3778 self.0.request = v.into();
3779 self
3780 }
3781
3782 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3784 self.0.options = v.into();
3785 self
3786 }
3787
3788 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
3790 (*self.0.stub)
3791 .query_hub_status(self.0.request, self.0.options)
3792 .await
3793 .map(gax::response::Response::into_body)
3794 }
3795
3796 pub fn by_page(
3798 self,
3799 ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
3800 {
3801 use std::clone::Clone;
3802 let token = self.0.request.page_token.clone();
3803 let execute = move |token: String| {
3804 let mut builder = self.clone();
3805 builder.0.request = builder.0.request.set_page_token(token);
3806 builder.send()
3807 };
3808 gax::paginator::internal::new_paginator(token, execute)
3809 }
3810
3811 pub fn by_item(
3813 self,
3814 ) -> impl gax::paginator::ItemPaginator<crate::model::QueryHubStatusResponse, gax::error::Error>
3815 {
3816 use gax::paginator::Paginator;
3817 self.by_page().items()
3818 }
3819
3820 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3824 self.0.request.name = v.into();
3825 self
3826 }
3827
3828 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3830 self.0.request.page_size = v.into();
3831 self
3832 }
3833
3834 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3836 self.0.request.page_token = v.into();
3837 self
3838 }
3839
3840 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3842 self.0.request.filter = v.into();
3843 self
3844 }
3845
3846 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3848 self.0.request.order_by = v.into();
3849 self
3850 }
3851
3852 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3854 self.0.request.group_by = v.into();
3855 self
3856 }
3857 }
3858
3859 #[doc(hidden)]
3860 impl gax::options::internal::RequestBuilder for QueryHubStatus {
3861 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3862 &mut self.0.options
3863 }
3864 }
3865
3866 #[derive(Clone, Debug)]
3888 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
3889
3890 impl ListSpokes {
3891 pub(crate) fn new(
3892 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3893 ) -> Self {
3894 Self(RequestBuilder::new(stub))
3895 }
3896
3897 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
3899 self.0.request = v.into();
3900 self
3901 }
3902
3903 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3905 self.0.options = v.into();
3906 self
3907 }
3908
3909 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
3911 (*self.0.stub)
3912 .list_spokes(self.0.request, self.0.options)
3913 .await
3914 .map(gax::response::Response::into_body)
3915 }
3916
3917 pub fn by_page(
3919 self,
3920 ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
3921 {
3922 use std::clone::Clone;
3923 let token = self.0.request.page_token.clone();
3924 let execute = move |token: String| {
3925 let mut builder = self.clone();
3926 builder.0.request = builder.0.request.set_page_token(token);
3927 builder.send()
3928 };
3929 gax::paginator::internal::new_paginator(token, execute)
3930 }
3931
3932 pub fn by_item(
3934 self,
3935 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpokesResponse, gax::error::Error>
3936 {
3937 use gax::paginator::Paginator;
3938 self.by_page().items()
3939 }
3940
3941 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3945 self.0.request.parent = v.into();
3946 self
3947 }
3948
3949 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3951 self.0.request.page_size = v.into();
3952 self
3953 }
3954
3955 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3957 self.0.request.page_token = v.into();
3958 self
3959 }
3960
3961 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3963 self.0.request.filter = v.into();
3964 self
3965 }
3966
3967 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3969 self.0.request.order_by = v.into();
3970 self
3971 }
3972 }
3973
3974 #[doc(hidden)]
3975 impl gax::options::internal::RequestBuilder for ListSpokes {
3976 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3977 &mut self.0.options
3978 }
3979 }
3980
3981 #[derive(Clone, Debug)]
3999 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
4000
4001 impl GetSpoke {
4002 pub(crate) fn new(
4003 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4004 ) -> Self {
4005 Self(RequestBuilder::new(stub))
4006 }
4007
4008 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
4010 self.0.request = v.into();
4011 self
4012 }
4013
4014 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4016 self.0.options = v.into();
4017 self
4018 }
4019
4020 pub async fn send(self) -> Result<crate::model::Spoke> {
4022 (*self.0.stub)
4023 .get_spoke(self.0.request, self.0.options)
4024 .await
4025 .map(gax::response::Response::into_body)
4026 }
4027
4028 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4032 self.0.request.name = v.into();
4033 self
4034 }
4035 }
4036
4037 #[doc(hidden)]
4038 impl gax::options::internal::RequestBuilder for GetSpoke {
4039 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4040 &mut self.0.options
4041 }
4042 }
4043
4044 #[derive(Clone, Debug)]
4063 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
4064
4065 impl CreateSpoke {
4066 pub(crate) fn new(
4067 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4068 ) -> Self {
4069 Self(RequestBuilder::new(stub))
4070 }
4071
4072 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
4074 self.0.request = v.into();
4075 self
4076 }
4077
4078 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4080 self.0.options = v.into();
4081 self
4082 }
4083
4084 pub async fn send(self) -> Result<longrunning::model::Operation> {
4091 (*self.0.stub)
4092 .create_spoke(self.0.request, self.0.options)
4093 .await
4094 .map(gax::response::Response::into_body)
4095 }
4096
4097 pub fn poller(
4099 self,
4100 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
4101 type Operation =
4102 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
4103 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4104 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4105
4106 let stub = self.0.stub.clone();
4107 let mut options = self.0.options.clone();
4108 options.set_retry_policy(gax::retry_policy::NeverRetry);
4109 let query = move |name| {
4110 let stub = stub.clone();
4111 let options = options.clone();
4112 async {
4113 let op = GetOperation::new(stub)
4114 .set_name(name)
4115 .with_options(options)
4116 .send()
4117 .await?;
4118 Ok(Operation::new(op))
4119 }
4120 };
4121
4122 let start = move || async {
4123 let op = self.send().await?;
4124 Ok(Operation::new(op))
4125 };
4126
4127 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4128 }
4129
4130 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4134 self.0.request.parent = v.into();
4135 self
4136 }
4137
4138 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4142 self.0.request.spoke_id = v.into();
4143 self
4144 }
4145
4146 pub fn set_spoke<T>(mut self, v: T) -> Self
4150 where
4151 T: std::convert::Into<crate::model::Spoke>,
4152 {
4153 self.0.request.spoke = std::option::Option::Some(v.into());
4154 self
4155 }
4156
4157 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
4161 where
4162 T: std::convert::Into<crate::model::Spoke>,
4163 {
4164 self.0.request.spoke = v.map(|x| x.into());
4165 self
4166 }
4167
4168 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4170 self.0.request.request_id = v.into();
4171 self
4172 }
4173 }
4174
4175 #[doc(hidden)]
4176 impl gax::options::internal::RequestBuilder for CreateSpoke {
4177 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4178 &mut self.0.options
4179 }
4180 }
4181
4182 #[derive(Clone, Debug)]
4201 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
4202
4203 impl UpdateSpoke {
4204 pub(crate) fn new(
4205 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4206 ) -> Self {
4207 Self(RequestBuilder::new(stub))
4208 }
4209
4210 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
4212 self.0.request = v.into();
4213 self
4214 }
4215
4216 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4218 self.0.options = v.into();
4219 self
4220 }
4221
4222 pub async fn send(self) -> Result<longrunning::model::Operation> {
4229 (*self.0.stub)
4230 .update_spoke(self.0.request, self.0.options)
4231 .await
4232 .map(gax::response::Response::into_body)
4233 }
4234
4235 pub fn poller(
4237 self,
4238 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
4239 type Operation =
4240 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
4241 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4242 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4243
4244 let stub = self.0.stub.clone();
4245 let mut options = self.0.options.clone();
4246 options.set_retry_policy(gax::retry_policy::NeverRetry);
4247 let query = move |name| {
4248 let stub = stub.clone();
4249 let options = options.clone();
4250 async {
4251 let op = GetOperation::new(stub)
4252 .set_name(name)
4253 .with_options(options)
4254 .send()
4255 .await?;
4256 Ok(Operation::new(op))
4257 }
4258 };
4259
4260 let start = move || async {
4261 let op = self.send().await?;
4262 Ok(Operation::new(op))
4263 };
4264
4265 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4266 }
4267
4268 pub fn set_update_mask<T>(mut self, v: T) -> Self
4270 where
4271 T: std::convert::Into<wkt::FieldMask>,
4272 {
4273 self.0.request.update_mask = std::option::Option::Some(v.into());
4274 self
4275 }
4276
4277 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4279 where
4280 T: std::convert::Into<wkt::FieldMask>,
4281 {
4282 self.0.request.update_mask = v.map(|x| x.into());
4283 self
4284 }
4285
4286 pub fn set_spoke<T>(mut self, v: T) -> Self
4290 where
4291 T: std::convert::Into<crate::model::Spoke>,
4292 {
4293 self.0.request.spoke = std::option::Option::Some(v.into());
4294 self
4295 }
4296
4297 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
4301 where
4302 T: std::convert::Into<crate::model::Spoke>,
4303 {
4304 self.0.request.spoke = v.map(|x| x.into());
4305 self
4306 }
4307
4308 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4310 self.0.request.request_id = v.into();
4311 self
4312 }
4313 }
4314
4315 #[doc(hidden)]
4316 impl gax::options::internal::RequestBuilder for UpdateSpoke {
4317 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4318 &mut self.0.options
4319 }
4320 }
4321
4322 #[derive(Clone, Debug)]
4341 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
4342
4343 impl RejectHubSpoke {
4344 pub(crate) fn new(
4345 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4346 ) -> Self {
4347 Self(RequestBuilder::new(stub))
4348 }
4349
4350 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
4352 self.0.request = v.into();
4353 self
4354 }
4355
4356 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4358 self.0.options = v.into();
4359 self
4360 }
4361
4362 pub async fn send(self) -> Result<longrunning::model::Operation> {
4369 (*self.0.stub)
4370 .reject_hub_spoke(self.0.request, self.0.options)
4371 .await
4372 .map(gax::response::Response::into_body)
4373 }
4374
4375 pub fn poller(
4377 self,
4378 ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
4379 {
4380 type Operation = lro::internal::Operation<
4381 crate::model::RejectHubSpokeResponse,
4382 crate::model::OperationMetadata,
4383 >;
4384 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4385 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4386
4387 let stub = self.0.stub.clone();
4388 let mut options = self.0.options.clone();
4389 options.set_retry_policy(gax::retry_policy::NeverRetry);
4390 let query = move |name| {
4391 let stub = stub.clone();
4392 let options = options.clone();
4393 async {
4394 let op = GetOperation::new(stub)
4395 .set_name(name)
4396 .with_options(options)
4397 .send()
4398 .await?;
4399 Ok(Operation::new(op))
4400 }
4401 };
4402
4403 let start = move || async {
4404 let op = self.send().await?;
4405 Ok(Operation::new(op))
4406 };
4407
4408 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4409 }
4410
4411 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4415 self.0.request.name = v.into();
4416 self
4417 }
4418
4419 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4423 self.0.request.spoke_uri = v.into();
4424 self
4425 }
4426
4427 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4429 self.0.request.request_id = v.into();
4430 self
4431 }
4432
4433 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
4435 self.0.request.details = v.into();
4436 self
4437 }
4438 }
4439
4440 #[doc(hidden)]
4441 impl gax::options::internal::RequestBuilder for RejectHubSpoke {
4442 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4443 &mut self.0.options
4444 }
4445 }
4446
4447 #[derive(Clone, Debug)]
4466 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
4467
4468 impl AcceptHubSpoke {
4469 pub(crate) fn new(
4470 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4471 ) -> Self {
4472 Self(RequestBuilder::new(stub))
4473 }
4474
4475 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
4477 self.0.request = v.into();
4478 self
4479 }
4480
4481 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4483 self.0.options = v.into();
4484 self
4485 }
4486
4487 pub async fn send(self) -> Result<longrunning::model::Operation> {
4494 (*self.0.stub)
4495 .accept_hub_spoke(self.0.request, self.0.options)
4496 .await
4497 .map(gax::response::Response::into_body)
4498 }
4499
4500 pub fn poller(
4502 self,
4503 ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
4504 {
4505 type Operation = lro::internal::Operation<
4506 crate::model::AcceptHubSpokeResponse,
4507 crate::model::OperationMetadata,
4508 >;
4509 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4510 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4511
4512 let stub = self.0.stub.clone();
4513 let mut options = self.0.options.clone();
4514 options.set_retry_policy(gax::retry_policy::NeverRetry);
4515 let query = move |name| {
4516 let stub = stub.clone();
4517 let options = options.clone();
4518 async {
4519 let op = GetOperation::new(stub)
4520 .set_name(name)
4521 .with_options(options)
4522 .send()
4523 .await?;
4524 Ok(Operation::new(op))
4525 }
4526 };
4527
4528 let start = move || async {
4529 let op = self.send().await?;
4530 Ok(Operation::new(op))
4531 };
4532
4533 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4534 }
4535
4536 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4540 self.0.request.name = v.into();
4541 self
4542 }
4543
4544 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4548 self.0.request.spoke_uri = v.into();
4549 self
4550 }
4551
4552 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4554 self.0.request.request_id = v.into();
4555 self
4556 }
4557 }
4558
4559 #[doc(hidden)]
4560 impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
4561 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4562 &mut self.0.options
4563 }
4564 }
4565
4566 #[derive(Clone, Debug)]
4585 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
4586
4587 impl AcceptSpokeUpdate {
4588 pub(crate) fn new(
4589 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4590 ) -> Self {
4591 Self(RequestBuilder::new(stub))
4592 }
4593
4594 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
4596 mut self,
4597 v: V,
4598 ) -> Self {
4599 self.0.request = v.into();
4600 self
4601 }
4602
4603 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4605 self.0.options = v.into();
4606 self
4607 }
4608
4609 pub async fn send(self) -> Result<longrunning::model::Operation> {
4616 (*self.0.stub)
4617 .accept_spoke_update(self.0.request, self.0.options)
4618 .await
4619 .map(gax::response::Response::into_body)
4620 }
4621
4622 pub fn poller(
4624 self,
4625 ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
4626 {
4627 type Operation = lro::internal::Operation<
4628 crate::model::AcceptSpokeUpdateResponse,
4629 crate::model::OperationMetadata,
4630 >;
4631 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4632 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4633
4634 let stub = self.0.stub.clone();
4635 let mut options = self.0.options.clone();
4636 options.set_retry_policy(gax::retry_policy::NeverRetry);
4637 let query = move |name| {
4638 let stub = stub.clone();
4639 let options = options.clone();
4640 async {
4641 let op = GetOperation::new(stub)
4642 .set_name(name)
4643 .with_options(options)
4644 .send()
4645 .await?;
4646 Ok(Operation::new(op))
4647 }
4648 };
4649
4650 let start = move || async {
4651 let op = self.send().await?;
4652 Ok(Operation::new(op))
4653 };
4654
4655 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4656 }
4657
4658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4662 self.0.request.name = v.into();
4663 self
4664 }
4665
4666 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4670 self.0.request.spoke_uri = v.into();
4671 self
4672 }
4673
4674 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4678 self.0.request.spoke_etag = v.into();
4679 self
4680 }
4681
4682 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4684 self.0.request.request_id = v.into();
4685 self
4686 }
4687 }
4688
4689 #[doc(hidden)]
4690 impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
4691 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4692 &mut self.0.options
4693 }
4694 }
4695
4696 #[derive(Clone, Debug)]
4715 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
4716
4717 impl RejectSpokeUpdate {
4718 pub(crate) fn new(
4719 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4720 ) -> Self {
4721 Self(RequestBuilder::new(stub))
4722 }
4723
4724 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
4726 mut self,
4727 v: V,
4728 ) -> Self {
4729 self.0.request = v.into();
4730 self
4731 }
4732
4733 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4735 self.0.options = v.into();
4736 self
4737 }
4738
4739 pub async fn send(self) -> Result<longrunning::model::Operation> {
4746 (*self.0.stub)
4747 .reject_spoke_update(self.0.request, self.0.options)
4748 .await
4749 .map(gax::response::Response::into_body)
4750 }
4751
4752 pub fn poller(
4754 self,
4755 ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
4756 {
4757 type Operation = lro::internal::Operation<
4758 crate::model::RejectSpokeUpdateResponse,
4759 crate::model::OperationMetadata,
4760 >;
4761 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4762 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4763
4764 let stub = self.0.stub.clone();
4765 let mut options = self.0.options.clone();
4766 options.set_retry_policy(gax::retry_policy::NeverRetry);
4767 let query = move |name| {
4768 let stub = stub.clone();
4769 let options = options.clone();
4770 async {
4771 let op = GetOperation::new(stub)
4772 .set_name(name)
4773 .with_options(options)
4774 .send()
4775 .await?;
4776 Ok(Operation::new(op))
4777 }
4778 };
4779
4780 let start = move || async {
4781 let op = self.send().await?;
4782 Ok(Operation::new(op))
4783 };
4784
4785 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4786 }
4787
4788 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4792 self.0.request.name = v.into();
4793 self
4794 }
4795
4796 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4800 self.0.request.spoke_uri = v.into();
4801 self
4802 }
4803
4804 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4808 self.0.request.spoke_etag = v.into();
4809 self
4810 }
4811
4812 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
4814 self.0.request.details = v.into();
4815 self
4816 }
4817
4818 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4820 self.0.request.request_id = v.into();
4821 self
4822 }
4823 }
4824
4825 #[doc(hidden)]
4826 impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
4827 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4828 &mut self.0.options
4829 }
4830 }
4831
4832 #[derive(Clone, Debug)]
4851 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
4852
4853 impl DeleteSpoke {
4854 pub(crate) fn new(
4855 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4856 ) -> Self {
4857 Self(RequestBuilder::new(stub))
4858 }
4859
4860 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
4862 self.0.request = v.into();
4863 self
4864 }
4865
4866 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4868 self.0.options = v.into();
4869 self
4870 }
4871
4872 pub async fn send(self) -> Result<longrunning::model::Operation> {
4879 (*self.0.stub)
4880 .delete_spoke(self.0.request, self.0.options)
4881 .await
4882 .map(gax::response::Response::into_body)
4883 }
4884
4885 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4887 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4888 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4889 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4890
4891 let stub = self.0.stub.clone();
4892 let mut options = self.0.options.clone();
4893 options.set_retry_policy(gax::retry_policy::NeverRetry);
4894 let query = move |name| {
4895 let stub = stub.clone();
4896 let options = options.clone();
4897 async {
4898 let op = GetOperation::new(stub)
4899 .set_name(name)
4900 .with_options(options)
4901 .send()
4902 .await?;
4903 Ok(Operation::new(op))
4904 }
4905 };
4906
4907 let start = move || async {
4908 let op = self.send().await?;
4909 Ok(Operation::new(op))
4910 };
4911
4912 lro::internal::new_unit_response_poller(
4913 polling_error_policy,
4914 polling_backoff_policy,
4915 start,
4916 query,
4917 )
4918 }
4919
4920 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4924 self.0.request.name = v.into();
4925 self
4926 }
4927
4928 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4930 self.0.request.request_id = v.into();
4931 self
4932 }
4933 }
4934
4935 #[doc(hidden)]
4936 impl gax::options::internal::RequestBuilder for DeleteSpoke {
4937 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4938 &mut self.0.options
4939 }
4940 }
4941
4942 #[derive(Clone, Debug)]
4960 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
4961
4962 impl GetRouteTable {
4963 pub(crate) fn new(
4964 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4965 ) -> Self {
4966 Self(RequestBuilder::new(stub))
4967 }
4968
4969 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
4971 self.0.request = v.into();
4972 self
4973 }
4974
4975 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4977 self.0.options = v.into();
4978 self
4979 }
4980
4981 pub async fn send(self) -> Result<crate::model::RouteTable> {
4983 (*self.0.stub)
4984 .get_route_table(self.0.request, self.0.options)
4985 .await
4986 .map(gax::response::Response::into_body)
4987 }
4988
4989 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4993 self.0.request.name = v.into();
4994 self
4995 }
4996 }
4997
4998 #[doc(hidden)]
4999 impl gax::options::internal::RequestBuilder for GetRouteTable {
5000 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5001 &mut self.0.options
5002 }
5003 }
5004
5005 #[derive(Clone, Debug)]
5023 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
5024
5025 impl GetRoute {
5026 pub(crate) fn new(
5027 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5028 ) -> Self {
5029 Self(RequestBuilder::new(stub))
5030 }
5031
5032 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
5034 self.0.request = v.into();
5035 self
5036 }
5037
5038 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5040 self.0.options = v.into();
5041 self
5042 }
5043
5044 pub async fn send(self) -> Result<crate::model::Route> {
5046 (*self.0.stub)
5047 .get_route(self.0.request, self.0.options)
5048 .await
5049 .map(gax::response::Response::into_body)
5050 }
5051
5052 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 GetRoute {
5063 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5064 &mut self.0.options
5065 }
5066 }
5067
5068 #[derive(Clone, Debug)]
5090 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
5091
5092 impl ListRoutes {
5093 pub(crate) fn new(
5094 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5095 ) -> Self {
5096 Self(RequestBuilder::new(stub))
5097 }
5098
5099 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
5101 self.0.request = v.into();
5102 self
5103 }
5104
5105 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5107 self.0.options = v.into();
5108 self
5109 }
5110
5111 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
5113 (*self.0.stub)
5114 .list_routes(self.0.request, self.0.options)
5115 .await
5116 .map(gax::response::Response::into_body)
5117 }
5118
5119 pub fn by_page(
5121 self,
5122 ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
5123 {
5124 use std::clone::Clone;
5125 let token = self.0.request.page_token.clone();
5126 let execute = move |token: String| {
5127 let mut builder = self.clone();
5128 builder.0.request = builder.0.request.set_page_token(token);
5129 builder.send()
5130 };
5131 gax::paginator::internal::new_paginator(token, execute)
5132 }
5133
5134 pub fn by_item(
5136 self,
5137 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
5138 {
5139 use gax::paginator::Paginator;
5140 self.by_page().items()
5141 }
5142
5143 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5147 self.0.request.parent = v.into();
5148 self
5149 }
5150
5151 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5153 self.0.request.page_size = v.into();
5154 self
5155 }
5156
5157 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5159 self.0.request.page_token = v.into();
5160 self
5161 }
5162
5163 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5165 self.0.request.filter = v.into();
5166 self
5167 }
5168
5169 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5171 self.0.request.order_by = v.into();
5172 self
5173 }
5174 }
5175
5176 #[doc(hidden)]
5177 impl gax::options::internal::RequestBuilder for ListRoutes {
5178 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5179 &mut self.0.options
5180 }
5181 }
5182
5183 #[derive(Clone, Debug)]
5205 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
5206
5207 impl ListRouteTables {
5208 pub(crate) fn new(
5209 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5210 ) -> Self {
5211 Self(RequestBuilder::new(stub))
5212 }
5213
5214 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
5216 self.0.request = v.into();
5217 self
5218 }
5219
5220 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5222 self.0.options = v.into();
5223 self
5224 }
5225
5226 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
5228 (*self.0.stub)
5229 .list_route_tables(self.0.request, self.0.options)
5230 .await
5231 .map(gax::response::Response::into_body)
5232 }
5233
5234 pub fn by_page(
5236 self,
5237 ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
5238 {
5239 use std::clone::Clone;
5240 let token = self.0.request.page_token.clone();
5241 let execute = move |token: String| {
5242 let mut builder = self.clone();
5243 builder.0.request = builder.0.request.set_page_token(token);
5244 builder.send()
5245 };
5246 gax::paginator::internal::new_paginator(token, execute)
5247 }
5248
5249 pub fn by_item(
5251 self,
5252 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRouteTablesResponse, gax::error::Error>
5253 {
5254 use gax::paginator::Paginator;
5255 self.by_page().items()
5256 }
5257
5258 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5262 self.0.request.parent = v.into();
5263 self
5264 }
5265
5266 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5268 self.0.request.page_size = v.into();
5269 self
5270 }
5271
5272 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5274 self.0.request.page_token = v.into();
5275 self
5276 }
5277
5278 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5280 self.0.request.filter = v.into();
5281 self
5282 }
5283
5284 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5286 self.0.request.order_by = v.into();
5287 self
5288 }
5289 }
5290
5291 #[doc(hidden)]
5292 impl gax::options::internal::RequestBuilder for ListRouteTables {
5293 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5294 &mut self.0.options
5295 }
5296 }
5297
5298 #[derive(Clone, Debug)]
5316 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
5317
5318 impl GetGroup {
5319 pub(crate) fn new(
5320 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5321 ) -> Self {
5322 Self(RequestBuilder::new(stub))
5323 }
5324
5325 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
5327 self.0.request = v.into();
5328 self
5329 }
5330
5331 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5333 self.0.options = v.into();
5334 self
5335 }
5336
5337 pub async fn send(self) -> Result<crate::model::Group> {
5339 (*self.0.stub)
5340 .get_group(self.0.request, self.0.options)
5341 .await
5342 .map(gax::response::Response::into_body)
5343 }
5344
5345 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5349 self.0.request.name = v.into();
5350 self
5351 }
5352 }
5353
5354 #[doc(hidden)]
5355 impl gax::options::internal::RequestBuilder for GetGroup {
5356 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5357 &mut self.0.options
5358 }
5359 }
5360
5361 #[derive(Clone, Debug)]
5383 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
5384
5385 impl ListGroups {
5386 pub(crate) fn new(
5387 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5388 ) -> Self {
5389 Self(RequestBuilder::new(stub))
5390 }
5391
5392 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
5394 self.0.request = v.into();
5395 self
5396 }
5397
5398 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5400 self.0.options = v.into();
5401 self
5402 }
5403
5404 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
5406 (*self.0.stub)
5407 .list_groups(self.0.request, self.0.options)
5408 .await
5409 .map(gax::response::Response::into_body)
5410 }
5411
5412 pub fn by_page(
5414 self,
5415 ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
5416 {
5417 use std::clone::Clone;
5418 let token = self.0.request.page_token.clone();
5419 let execute = move |token: String| {
5420 let mut builder = self.clone();
5421 builder.0.request = builder.0.request.set_page_token(token);
5422 builder.send()
5423 };
5424 gax::paginator::internal::new_paginator(token, execute)
5425 }
5426
5427 pub fn by_item(
5429 self,
5430 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGroupsResponse, gax::error::Error>
5431 {
5432 use gax::paginator::Paginator;
5433 self.by_page().items()
5434 }
5435
5436 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5440 self.0.request.parent = v.into();
5441 self
5442 }
5443
5444 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5446 self.0.request.page_size = v.into();
5447 self
5448 }
5449
5450 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5452 self.0.request.page_token = v.into();
5453 self
5454 }
5455
5456 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5458 self.0.request.filter = v.into();
5459 self
5460 }
5461
5462 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5464 self.0.request.order_by = v.into();
5465 self
5466 }
5467 }
5468
5469 #[doc(hidden)]
5470 impl gax::options::internal::RequestBuilder for ListGroups {
5471 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5472 &mut self.0.options
5473 }
5474 }
5475
5476 #[derive(Clone, Debug)]
5495 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
5496
5497 impl UpdateGroup {
5498 pub(crate) fn new(
5499 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5500 ) -> Self {
5501 Self(RequestBuilder::new(stub))
5502 }
5503
5504 pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
5506 self.0.request = v.into();
5507 self
5508 }
5509
5510 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5512 self.0.options = v.into();
5513 self
5514 }
5515
5516 pub async fn send(self) -> Result<longrunning::model::Operation> {
5523 (*self.0.stub)
5524 .update_group(self.0.request, self.0.options)
5525 .await
5526 .map(gax::response::Response::into_body)
5527 }
5528
5529 pub fn poller(
5531 self,
5532 ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
5533 type Operation =
5534 lro::internal::Operation<crate::model::Group, crate::model::OperationMetadata>;
5535 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5536 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5537
5538 let stub = self.0.stub.clone();
5539 let mut options = self.0.options.clone();
5540 options.set_retry_policy(gax::retry_policy::NeverRetry);
5541 let query = move |name| {
5542 let stub = stub.clone();
5543 let options = options.clone();
5544 async {
5545 let op = GetOperation::new(stub)
5546 .set_name(name)
5547 .with_options(options)
5548 .send()
5549 .await?;
5550 Ok(Operation::new(op))
5551 }
5552 };
5553
5554 let start = move || async {
5555 let op = self.send().await?;
5556 Ok(Operation::new(op))
5557 };
5558
5559 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5560 }
5561
5562 pub fn set_update_mask<T>(mut self, v: T) -> Self
5564 where
5565 T: std::convert::Into<wkt::FieldMask>,
5566 {
5567 self.0.request.update_mask = std::option::Option::Some(v.into());
5568 self
5569 }
5570
5571 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5573 where
5574 T: std::convert::Into<wkt::FieldMask>,
5575 {
5576 self.0.request.update_mask = v.map(|x| x.into());
5577 self
5578 }
5579
5580 pub fn set_group<T>(mut self, v: T) -> Self
5584 where
5585 T: std::convert::Into<crate::model::Group>,
5586 {
5587 self.0.request.group = std::option::Option::Some(v.into());
5588 self
5589 }
5590
5591 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
5595 where
5596 T: std::convert::Into<crate::model::Group>,
5597 {
5598 self.0.request.group = v.map(|x| x.into());
5599 self
5600 }
5601
5602 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5604 self.0.request.request_id = v.into();
5605 self
5606 }
5607 }
5608
5609 #[doc(hidden)]
5610 impl gax::options::internal::RequestBuilder for UpdateGroup {
5611 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5612 &mut self.0.options
5613 }
5614 }
5615
5616 #[derive(Clone, Debug)]
5638 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5639
5640 impl ListLocations {
5641 pub(crate) fn new(
5642 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5643 ) -> Self {
5644 Self(RequestBuilder::new(stub))
5645 }
5646
5647 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5649 mut self,
5650 v: V,
5651 ) -> Self {
5652 self.0.request = v.into();
5653 self
5654 }
5655
5656 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5658 self.0.options = v.into();
5659 self
5660 }
5661
5662 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5664 (*self.0.stub)
5665 .list_locations(self.0.request, self.0.options)
5666 .await
5667 .map(gax::response::Response::into_body)
5668 }
5669
5670 pub fn by_page(
5672 self,
5673 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5674 {
5675 use std::clone::Clone;
5676 let token = self.0.request.page_token.clone();
5677 let execute = move |token: String| {
5678 let mut builder = self.clone();
5679 builder.0.request = builder.0.request.set_page_token(token);
5680 builder.send()
5681 };
5682 gax::paginator::internal::new_paginator(token, execute)
5683 }
5684
5685 pub fn by_item(
5687 self,
5688 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5689 {
5690 use gax::paginator::Paginator;
5691 self.by_page().items()
5692 }
5693
5694 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5696 self.0.request.name = v.into();
5697 self
5698 }
5699
5700 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5702 self.0.request.filter = v.into();
5703 self
5704 }
5705
5706 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5708 self.0.request.page_size = v.into();
5709 self
5710 }
5711
5712 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5714 self.0.request.page_token = v.into();
5715 self
5716 }
5717 }
5718
5719 #[doc(hidden)]
5720 impl gax::options::internal::RequestBuilder for ListLocations {
5721 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5722 &mut self.0.options
5723 }
5724 }
5725
5726 #[derive(Clone, Debug)]
5744 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5745
5746 impl GetLocation {
5747 pub(crate) fn new(
5748 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5749 ) -> Self {
5750 Self(RequestBuilder::new(stub))
5751 }
5752
5753 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5755 self.0.request = v.into();
5756 self
5757 }
5758
5759 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5761 self.0.options = v.into();
5762 self
5763 }
5764
5765 pub async fn send(self) -> Result<location::model::Location> {
5767 (*self.0.stub)
5768 .get_location(self.0.request, self.0.options)
5769 .await
5770 .map(gax::response::Response::into_body)
5771 }
5772
5773 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5775 self.0.request.name = v.into();
5776 self
5777 }
5778 }
5779
5780 #[doc(hidden)]
5781 impl gax::options::internal::RequestBuilder for GetLocation {
5782 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5783 &mut self.0.options
5784 }
5785 }
5786
5787 #[derive(Clone, Debug)]
5805 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5806
5807 impl SetIamPolicy {
5808 pub(crate) fn new(
5809 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5810 ) -> Self {
5811 Self(RequestBuilder::new(stub))
5812 }
5813
5814 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5816 self.0.request = v.into();
5817 self
5818 }
5819
5820 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5822 self.0.options = v.into();
5823 self
5824 }
5825
5826 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5828 (*self.0.stub)
5829 .set_iam_policy(self.0.request, self.0.options)
5830 .await
5831 .map(gax::response::Response::into_body)
5832 }
5833
5834 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5838 self.0.request.resource = v.into();
5839 self
5840 }
5841
5842 pub fn set_policy<T>(mut self, v: T) -> Self
5846 where
5847 T: std::convert::Into<iam_v1::model::Policy>,
5848 {
5849 self.0.request.policy = std::option::Option::Some(v.into());
5850 self
5851 }
5852
5853 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5857 where
5858 T: std::convert::Into<iam_v1::model::Policy>,
5859 {
5860 self.0.request.policy = v.map(|x| x.into());
5861 self
5862 }
5863
5864 pub fn set_update_mask<T>(mut self, v: T) -> Self
5866 where
5867 T: std::convert::Into<wkt::FieldMask>,
5868 {
5869 self.0.request.update_mask = std::option::Option::Some(v.into());
5870 self
5871 }
5872
5873 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5875 where
5876 T: std::convert::Into<wkt::FieldMask>,
5877 {
5878 self.0.request.update_mask = v.map(|x| x.into());
5879 self
5880 }
5881 }
5882
5883 #[doc(hidden)]
5884 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5885 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5886 &mut self.0.options
5887 }
5888 }
5889
5890 #[derive(Clone, Debug)]
5908 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5909
5910 impl GetIamPolicy {
5911 pub(crate) fn new(
5912 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5913 ) -> Self {
5914 Self(RequestBuilder::new(stub))
5915 }
5916
5917 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5919 self.0.request = v.into();
5920 self
5921 }
5922
5923 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5925 self.0.options = v.into();
5926 self
5927 }
5928
5929 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5931 (*self.0.stub)
5932 .get_iam_policy(self.0.request, self.0.options)
5933 .await
5934 .map(gax::response::Response::into_body)
5935 }
5936
5937 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5941 self.0.request.resource = v.into();
5942 self
5943 }
5944
5945 pub fn set_options<T>(mut self, v: T) -> Self
5947 where
5948 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5949 {
5950 self.0.request.options = std::option::Option::Some(v.into());
5951 self
5952 }
5953
5954 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5956 where
5957 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5958 {
5959 self.0.request.options = v.map(|x| x.into());
5960 self
5961 }
5962 }
5963
5964 #[doc(hidden)]
5965 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5966 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5967 &mut self.0.options
5968 }
5969 }
5970
5971 #[derive(Clone, Debug)]
5989 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5990
5991 impl TestIamPermissions {
5992 pub(crate) fn new(
5993 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5994 ) -> Self {
5995 Self(RequestBuilder::new(stub))
5996 }
5997
5998 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
6000 mut self,
6001 v: V,
6002 ) -> Self {
6003 self.0.request = v.into();
6004 self
6005 }
6006
6007 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6009 self.0.options = v.into();
6010 self
6011 }
6012
6013 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
6015 (*self.0.stub)
6016 .test_iam_permissions(self.0.request, self.0.options)
6017 .await
6018 .map(gax::response::Response::into_body)
6019 }
6020
6021 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6025 self.0.request.resource = v.into();
6026 self
6027 }
6028
6029 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6033 where
6034 T: std::iter::IntoIterator<Item = V>,
6035 V: std::convert::Into<std::string::String>,
6036 {
6037 use std::iter::Iterator;
6038 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6039 self
6040 }
6041 }
6042
6043 #[doc(hidden)]
6044 impl gax::options::internal::RequestBuilder for TestIamPermissions {
6045 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6046 &mut self.0.options
6047 }
6048 }
6049
6050 #[derive(Clone, Debug)]
6072 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6073
6074 impl ListOperations {
6075 pub(crate) fn new(
6076 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6077 ) -> Self {
6078 Self(RequestBuilder::new(stub))
6079 }
6080
6081 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6083 mut self,
6084 v: V,
6085 ) -> Self {
6086 self.0.request = v.into();
6087 self
6088 }
6089
6090 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6092 self.0.options = v.into();
6093 self
6094 }
6095
6096 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6098 (*self.0.stub)
6099 .list_operations(self.0.request, self.0.options)
6100 .await
6101 .map(gax::response::Response::into_body)
6102 }
6103
6104 pub fn by_page(
6106 self,
6107 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6108 {
6109 use std::clone::Clone;
6110 let token = self.0.request.page_token.clone();
6111 let execute = move |token: String| {
6112 let mut builder = self.clone();
6113 builder.0.request = builder.0.request.set_page_token(token);
6114 builder.send()
6115 };
6116 gax::paginator::internal::new_paginator(token, execute)
6117 }
6118
6119 pub fn by_item(
6121 self,
6122 ) -> impl gax::paginator::ItemPaginator<
6123 longrunning::model::ListOperationsResponse,
6124 gax::error::Error,
6125 > {
6126 use gax::paginator::Paginator;
6127 self.by_page().items()
6128 }
6129
6130 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6132 self.0.request.name = v.into();
6133 self
6134 }
6135
6136 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6138 self.0.request.filter = v.into();
6139 self
6140 }
6141
6142 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6144 self.0.request.page_size = v.into();
6145 self
6146 }
6147
6148 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6150 self.0.request.page_token = v.into();
6151 self
6152 }
6153 }
6154
6155 #[doc(hidden)]
6156 impl gax::options::internal::RequestBuilder for ListOperations {
6157 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6158 &mut self.0.options
6159 }
6160 }
6161
6162 #[derive(Clone, Debug)]
6180 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6181
6182 impl GetOperation {
6183 pub(crate) fn new(
6184 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6185 ) -> Self {
6186 Self(RequestBuilder::new(stub))
6187 }
6188
6189 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6191 mut self,
6192 v: V,
6193 ) -> Self {
6194 self.0.request = v.into();
6195 self
6196 }
6197
6198 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6200 self.0.options = v.into();
6201 self
6202 }
6203
6204 pub async fn send(self) -> Result<longrunning::model::Operation> {
6206 (*self.0.stub)
6207 .get_operation(self.0.request, self.0.options)
6208 .await
6209 .map(gax::response::Response::into_body)
6210 }
6211
6212 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6214 self.0.request.name = v.into();
6215 self
6216 }
6217 }
6218
6219 #[doc(hidden)]
6220 impl gax::options::internal::RequestBuilder for GetOperation {
6221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6222 &mut self.0.options
6223 }
6224 }
6225
6226 #[derive(Clone, Debug)]
6244 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6245
6246 impl DeleteOperation {
6247 pub(crate) fn new(
6248 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6249 ) -> Self {
6250 Self(RequestBuilder::new(stub))
6251 }
6252
6253 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6255 mut self,
6256 v: V,
6257 ) -> Self {
6258 self.0.request = v.into();
6259 self
6260 }
6261
6262 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6264 self.0.options = v.into();
6265 self
6266 }
6267
6268 pub async fn send(self) -> Result<()> {
6270 (*self.0.stub)
6271 .delete_operation(self.0.request, self.0.options)
6272 .await
6273 .map(gax::response::Response::into_body)
6274 }
6275
6276 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6278 self.0.request.name = v.into();
6279 self
6280 }
6281 }
6282
6283 #[doc(hidden)]
6284 impl gax::options::internal::RequestBuilder for DeleteOperation {
6285 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6286 &mut self.0.options
6287 }
6288 }
6289
6290 #[derive(Clone, Debug)]
6308 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6309
6310 impl CancelOperation {
6311 pub(crate) fn new(
6312 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6313 ) -> Self {
6314 Self(RequestBuilder::new(stub))
6315 }
6316
6317 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6319 mut self,
6320 v: V,
6321 ) -> Self {
6322 self.0.request = v.into();
6323 self
6324 }
6325
6326 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6328 self.0.options = v.into();
6329 self
6330 }
6331
6332 pub async fn send(self) -> Result<()> {
6334 (*self.0.stub)
6335 .cancel_operation(self.0.request, self.0.options)
6336 .await
6337 .map(gax::response::Response::into_body)
6338 }
6339
6340 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6342 self.0.request.name = v.into();
6343 self
6344 }
6345 }
6346
6347 #[doc(hidden)]
6348 impl gax::options::internal::RequestBuilder for CancelOperation {
6349 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6350 &mut self.0.options
6351 }
6352 }
6353}
6354
6355pub mod policy_based_routing_service {
6356 use crate::Result;
6357
6358 pub type ClientBuilder =
6372 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6373
6374 pub(crate) mod client {
6375 use super::super::super::client::PolicyBasedRoutingService;
6376 pub struct Factory;
6377 impl gax::client_builder::internal::ClientFactory for Factory {
6378 type Client = PolicyBasedRoutingService;
6379 type Credentials = gaxi::options::Credentials;
6380 async fn build(
6381 self,
6382 config: gaxi::options::ClientConfig,
6383 ) -> gax::client_builder::Result<Self::Client> {
6384 Self::Client::new(config).await
6385 }
6386 }
6387 }
6388
6389 #[derive(Clone, Debug)]
6391 pub(crate) struct RequestBuilder<R: std::default::Default> {
6392 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6393 request: R,
6394 options: gax::options::RequestOptions,
6395 }
6396
6397 impl<R> RequestBuilder<R>
6398 where
6399 R: std::default::Default,
6400 {
6401 pub(crate) fn new(
6402 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6403 ) -> Self {
6404 Self {
6405 stub,
6406 request: R::default(),
6407 options: gax::options::RequestOptions::default(),
6408 }
6409 }
6410 }
6411
6412 #[derive(Clone, Debug)]
6434 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
6435
6436 impl ListPolicyBasedRoutes {
6437 pub(crate) fn new(
6438 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6439 ) -> Self {
6440 Self(RequestBuilder::new(stub))
6441 }
6442
6443 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
6445 mut self,
6446 v: V,
6447 ) -> Self {
6448 self.0.request = v.into();
6449 self
6450 }
6451
6452 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6454 self.0.options = v.into();
6455 self
6456 }
6457
6458 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
6460 (*self.0.stub)
6461 .list_policy_based_routes(self.0.request, self.0.options)
6462 .await
6463 .map(gax::response::Response::into_body)
6464 }
6465
6466 pub fn by_page(
6468 self,
6469 ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
6470 {
6471 use std::clone::Clone;
6472 let token = self.0.request.page_token.clone();
6473 let execute = move |token: String| {
6474 let mut builder = self.clone();
6475 builder.0.request = builder.0.request.set_page_token(token);
6476 builder.send()
6477 };
6478 gax::paginator::internal::new_paginator(token, execute)
6479 }
6480
6481 pub fn by_item(
6483 self,
6484 ) -> impl gax::paginator::ItemPaginator<
6485 crate::model::ListPolicyBasedRoutesResponse,
6486 gax::error::Error,
6487 > {
6488 use gax::paginator::Paginator;
6489 self.by_page().items()
6490 }
6491
6492 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6496 self.0.request.parent = v.into();
6497 self
6498 }
6499
6500 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6502 self.0.request.page_size = v.into();
6503 self
6504 }
6505
6506 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6508 self.0.request.page_token = v.into();
6509 self
6510 }
6511
6512 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6514 self.0.request.filter = v.into();
6515 self
6516 }
6517
6518 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6520 self.0.request.order_by = v.into();
6521 self
6522 }
6523 }
6524
6525 #[doc(hidden)]
6526 impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
6527 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6528 &mut self.0.options
6529 }
6530 }
6531
6532 #[derive(Clone, Debug)]
6550 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
6551
6552 impl GetPolicyBasedRoute {
6553 pub(crate) fn new(
6554 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6555 ) -> Self {
6556 Self(RequestBuilder::new(stub))
6557 }
6558
6559 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
6561 mut self,
6562 v: V,
6563 ) -> Self {
6564 self.0.request = v.into();
6565 self
6566 }
6567
6568 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6570 self.0.options = v.into();
6571 self
6572 }
6573
6574 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
6576 (*self.0.stub)
6577 .get_policy_based_route(self.0.request, self.0.options)
6578 .await
6579 .map(gax::response::Response::into_body)
6580 }
6581
6582 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6586 self.0.request.name = v.into();
6587 self
6588 }
6589 }
6590
6591 #[doc(hidden)]
6592 impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
6593 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6594 &mut self.0.options
6595 }
6596 }
6597
6598 #[derive(Clone, Debug)]
6617 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
6618
6619 impl CreatePolicyBasedRoute {
6620 pub(crate) fn new(
6621 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6622 ) -> Self {
6623 Self(RequestBuilder::new(stub))
6624 }
6625
6626 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
6628 mut self,
6629 v: V,
6630 ) -> Self {
6631 self.0.request = v.into();
6632 self
6633 }
6634
6635 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6637 self.0.options = v.into();
6638 self
6639 }
6640
6641 pub async fn send(self) -> Result<longrunning::model::Operation> {
6648 (*self.0.stub)
6649 .create_policy_based_route(self.0.request, self.0.options)
6650 .await
6651 .map(gax::response::Response::into_body)
6652 }
6653
6654 pub fn poller(
6656 self,
6657 ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
6658 {
6659 type Operation = lro::internal::Operation<
6660 crate::model::PolicyBasedRoute,
6661 crate::model::OperationMetadata,
6662 >;
6663 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6664 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6665
6666 let stub = self.0.stub.clone();
6667 let mut options = self.0.options.clone();
6668 options.set_retry_policy(gax::retry_policy::NeverRetry);
6669 let query = move |name| {
6670 let stub = stub.clone();
6671 let options = options.clone();
6672 async {
6673 let op = GetOperation::new(stub)
6674 .set_name(name)
6675 .with_options(options)
6676 .send()
6677 .await?;
6678 Ok(Operation::new(op))
6679 }
6680 };
6681
6682 let start = move || async {
6683 let op = self.send().await?;
6684 Ok(Operation::new(op))
6685 };
6686
6687 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6688 }
6689
6690 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6694 self.0.request.parent = v.into();
6695 self
6696 }
6697
6698 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6702 self.0.request.policy_based_route_id = v.into();
6703 self
6704 }
6705
6706 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
6710 where
6711 T: std::convert::Into<crate::model::PolicyBasedRoute>,
6712 {
6713 self.0.request.policy_based_route = std::option::Option::Some(v.into());
6714 self
6715 }
6716
6717 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
6721 where
6722 T: std::convert::Into<crate::model::PolicyBasedRoute>,
6723 {
6724 self.0.request.policy_based_route = v.map(|x| x.into());
6725 self
6726 }
6727
6728 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6730 self.0.request.request_id = v.into();
6731 self
6732 }
6733 }
6734
6735 #[doc(hidden)]
6736 impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
6737 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6738 &mut self.0.options
6739 }
6740 }
6741
6742 #[derive(Clone, Debug)]
6761 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
6762
6763 impl DeletePolicyBasedRoute {
6764 pub(crate) fn new(
6765 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6766 ) -> Self {
6767 Self(RequestBuilder::new(stub))
6768 }
6769
6770 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
6772 mut self,
6773 v: V,
6774 ) -> Self {
6775 self.0.request = v.into();
6776 self
6777 }
6778
6779 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6781 self.0.options = v.into();
6782 self
6783 }
6784
6785 pub async fn send(self) -> Result<longrunning::model::Operation> {
6792 (*self.0.stub)
6793 .delete_policy_based_route(self.0.request, self.0.options)
6794 .await
6795 .map(gax::response::Response::into_body)
6796 }
6797
6798 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
6800 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6801 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6802 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6803
6804 let stub = self.0.stub.clone();
6805 let mut options = self.0.options.clone();
6806 options.set_retry_policy(gax::retry_policy::NeverRetry);
6807 let query = move |name| {
6808 let stub = stub.clone();
6809 let options = options.clone();
6810 async {
6811 let op = GetOperation::new(stub)
6812 .set_name(name)
6813 .with_options(options)
6814 .send()
6815 .await?;
6816 Ok(Operation::new(op))
6817 }
6818 };
6819
6820 let start = move || async {
6821 let op = self.send().await?;
6822 Ok(Operation::new(op))
6823 };
6824
6825 lro::internal::new_unit_response_poller(
6826 polling_error_policy,
6827 polling_backoff_policy,
6828 start,
6829 query,
6830 )
6831 }
6832
6833 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6837 self.0.request.name = v.into();
6838 self
6839 }
6840
6841 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6843 self.0.request.request_id = v.into();
6844 self
6845 }
6846 }
6847
6848 #[doc(hidden)]
6849 impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
6850 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6851 &mut self.0.options
6852 }
6853 }
6854
6855 #[derive(Clone, Debug)]
6877 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
6878
6879 impl ListLocations {
6880 pub(crate) fn new(
6881 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6882 ) -> Self {
6883 Self(RequestBuilder::new(stub))
6884 }
6885
6886 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
6888 mut self,
6889 v: V,
6890 ) -> Self {
6891 self.0.request = v.into();
6892 self
6893 }
6894
6895 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6897 self.0.options = v.into();
6898 self
6899 }
6900
6901 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
6903 (*self.0.stub)
6904 .list_locations(self.0.request, self.0.options)
6905 .await
6906 .map(gax::response::Response::into_body)
6907 }
6908
6909 pub fn by_page(
6911 self,
6912 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
6913 {
6914 use std::clone::Clone;
6915 let token = self.0.request.page_token.clone();
6916 let execute = move |token: String| {
6917 let mut builder = self.clone();
6918 builder.0.request = builder.0.request.set_page_token(token);
6919 builder.send()
6920 };
6921 gax::paginator::internal::new_paginator(token, execute)
6922 }
6923
6924 pub fn by_item(
6926 self,
6927 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
6928 {
6929 use gax::paginator::Paginator;
6930 self.by_page().items()
6931 }
6932
6933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6935 self.0.request.name = v.into();
6936 self
6937 }
6938
6939 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6941 self.0.request.filter = v.into();
6942 self
6943 }
6944
6945 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6947 self.0.request.page_size = v.into();
6948 self
6949 }
6950
6951 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6953 self.0.request.page_token = v.into();
6954 self
6955 }
6956 }
6957
6958 #[doc(hidden)]
6959 impl gax::options::internal::RequestBuilder for ListLocations {
6960 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6961 &mut self.0.options
6962 }
6963 }
6964
6965 #[derive(Clone, Debug)]
6983 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
6984
6985 impl GetLocation {
6986 pub(crate) fn new(
6987 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6988 ) -> Self {
6989 Self(RequestBuilder::new(stub))
6990 }
6991
6992 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6994 self.0.request = v.into();
6995 self
6996 }
6997
6998 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7000 self.0.options = v.into();
7001 self
7002 }
7003
7004 pub async fn send(self) -> Result<location::model::Location> {
7006 (*self.0.stub)
7007 .get_location(self.0.request, self.0.options)
7008 .await
7009 .map(gax::response::Response::into_body)
7010 }
7011
7012 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7014 self.0.request.name = v.into();
7015 self
7016 }
7017 }
7018
7019 #[doc(hidden)]
7020 impl gax::options::internal::RequestBuilder for GetLocation {
7021 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7022 &mut self.0.options
7023 }
7024 }
7025
7026 #[derive(Clone, Debug)]
7044 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
7045
7046 impl SetIamPolicy {
7047 pub(crate) fn new(
7048 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7049 ) -> Self {
7050 Self(RequestBuilder::new(stub))
7051 }
7052
7053 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
7055 self.0.request = v.into();
7056 self
7057 }
7058
7059 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7061 self.0.options = v.into();
7062 self
7063 }
7064
7065 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7067 (*self.0.stub)
7068 .set_iam_policy(self.0.request, self.0.options)
7069 .await
7070 .map(gax::response::Response::into_body)
7071 }
7072
7073 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7077 self.0.request.resource = v.into();
7078 self
7079 }
7080
7081 pub fn set_policy<T>(mut self, v: T) -> Self
7085 where
7086 T: std::convert::Into<iam_v1::model::Policy>,
7087 {
7088 self.0.request.policy = std::option::Option::Some(v.into());
7089 self
7090 }
7091
7092 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7096 where
7097 T: std::convert::Into<iam_v1::model::Policy>,
7098 {
7099 self.0.request.policy = v.map(|x| x.into());
7100 self
7101 }
7102
7103 pub fn set_update_mask<T>(mut self, v: T) -> Self
7105 where
7106 T: std::convert::Into<wkt::FieldMask>,
7107 {
7108 self.0.request.update_mask = std::option::Option::Some(v.into());
7109 self
7110 }
7111
7112 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7114 where
7115 T: std::convert::Into<wkt::FieldMask>,
7116 {
7117 self.0.request.update_mask = v.map(|x| x.into());
7118 self
7119 }
7120 }
7121
7122 #[doc(hidden)]
7123 impl gax::options::internal::RequestBuilder for SetIamPolicy {
7124 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7125 &mut self.0.options
7126 }
7127 }
7128
7129 #[derive(Clone, Debug)]
7147 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
7148
7149 impl GetIamPolicy {
7150 pub(crate) fn new(
7151 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7152 ) -> Self {
7153 Self(RequestBuilder::new(stub))
7154 }
7155
7156 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
7158 self.0.request = v.into();
7159 self
7160 }
7161
7162 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7164 self.0.options = v.into();
7165 self
7166 }
7167
7168 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7170 (*self.0.stub)
7171 .get_iam_policy(self.0.request, self.0.options)
7172 .await
7173 .map(gax::response::Response::into_body)
7174 }
7175
7176 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7180 self.0.request.resource = v.into();
7181 self
7182 }
7183
7184 pub fn set_options<T>(mut self, v: T) -> Self
7186 where
7187 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7188 {
7189 self.0.request.options = std::option::Option::Some(v.into());
7190 self
7191 }
7192
7193 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7195 where
7196 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7197 {
7198 self.0.request.options = v.map(|x| x.into());
7199 self
7200 }
7201 }
7202
7203 #[doc(hidden)]
7204 impl gax::options::internal::RequestBuilder for GetIamPolicy {
7205 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7206 &mut self.0.options
7207 }
7208 }
7209
7210 #[derive(Clone, Debug)]
7228 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
7229
7230 impl TestIamPermissions {
7231 pub(crate) fn new(
7232 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7233 ) -> Self {
7234 Self(RequestBuilder::new(stub))
7235 }
7236
7237 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
7239 mut self,
7240 v: V,
7241 ) -> Self {
7242 self.0.request = v.into();
7243 self
7244 }
7245
7246 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7248 self.0.options = v.into();
7249 self
7250 }
7251
7252 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
7254 (*self.0.stub)
7255 .test_iam_permissions(self.0.request, self.0.options)
7256 .await
7257 .map(gax::response::Response::into_body)
7258 }
7259
7260 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7264 self.0.request.resource = v.into();
7265 self
7266 }
7267
7268 pub fn set_permissions<T, V>(mut self, v: T) -> Self
7272 where
7273 T: std::iter::IntoIterator<Item = V>,
7274 V: std::convert::Into<std::string::String>,
7275 {
7276 use std::iter::Iterator;
7277 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7278 self
7279 }
7280 }
7281
7282 #[doc(hidden)]
7283 impl gax::options::internal::RequestBuilder for TestIamPermissions {
7284 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7285 &mut self.0.options
7286 }
7287 }
7288
7289 #[derive(Clone, Debug)]
7311 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7312
7313 impl ListOperations {
7314 pub(crate) fn new(
7315 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7316 ) -> Self {
7317 Self(RequestBuilder::new(stub))
7318 }
7319
7320 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7322 mut self,
7323 v: V,
7324 ) -> Self {
7325 self.0.request = v.into();
7326 self
7327 }
7328
7329 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7331 self.0.options = v.into();
7332 self
7333 }
7334
7335 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7337 (*self.0.stub)
7338 .list_operations(self.0.request, self.0.options)
7339 .await
7340 .map(gax::response::Response::into_body)
7341 }
7342
7343 pub fn by_page(
7345 self,
7346 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7347 {
7348 use std::clone::Clone;
7349 let token = self.0.request.page_token.clone();
7350 let execute = move |token: String| {
7351 let mut builder = self.clone();
7352 builder.0.request = builder.0.request.set_page_token(token);
7353 builder.send()
7354 };
7355 gax::paginator::internal::new_paginator(token, execute)
7356 }
7357
7358 pub fn by_item(
7360 self,
7361 ) -> impl gax::paginator::ItemPaginator<
7362 longrunning::model::ListOperationsResponse,
7363 gax::error::Error,
7364 > {
7365 use gax::paginator::Paginator;
7366 self.by_page().items()
7367 }
7368
7369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7371 self.0.request.name = v.into();
7372 self
7373 }
7374
7375 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7377 self.0.request.filter = v.into();
7378 self
7379 }
7380
7381 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7383 self.0.request.page_size = v.into();
7384 self
7385 }
7386
7387 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7389 self.0.request.page_token = v.into();
7390 self
7391 }
7392 }
7393
7394 #[doc(hidden)]
7395 impl gax::options::internal::RequestBuilder for ListOperations {
7396 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7397 &mut self.0.options
7398 }
7399 }
7400
7401 #[derive(Clone, Debug)]
7419 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7420
7421 impl GetOperation {
7422 pub(crate) fn new(
7423 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7424 ) -> Self {
7425 Self(RequestBuilder::new(stub))
7426 }
7427
7428 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7430 mut self,
7431 v: V,
7432 ) -> Self {
7433 self.0.request = v.into();
7434 self
7435 }
7436
7437 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7439 self.0.options = v.into();
7440 self
7441 }
7442
7443 pub async fn send(self) -> Result<longrunning::model::Operation> {
7445 (*self.0.stub)
7446 .get_operation(self.0.request, self.0.options)
7447 .await
7448 .map(gax::response::Response::into_body)
7449 }
7450
7451 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7453 self.0.request.name = v.into();
7454 self
7455 }
7456 }
7457
7458 #[doc(hidden)]
7459 impl gax::options::internal::RequestBuilder for GetOperation {
7460 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7461 &mut self.0.options
7462 }
7463 }
7464
7465 #[derive(Clone, Debug)]
7483 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7484
7485 impl DeleteOperation {
7486 pub(crate) fn new(
7487 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7488 ) -> Self {
7489 Self(RequestBuilder::new(stub))
7490 }
7491
7492 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7494 mut self,
7495 v: V,
7496 ) -> Self {
7497 self.0.request = v.into();
7498 self
7499 }
7500
7501 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7503 self.0.options = v.into();
7504 self
7505 }
7506
7507 pub async fn send(self) -> Result<()> {
7509 (*self.0.stub)
7510 .delete_operation(self.0.request, self.0.options)
7511 .await
7512 .map(gax::response::Response::into_body)
7513 }
7514
7515 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7517 self.0.request.name = v.into();
7518 self
7519 }
7520 }
7521
7522 #[doc(hidden)]
7523 impl gax::options::internal::RequestBuilder for DeleteOperation {
7524 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7525 &mut self.0.options
7526 }
7527 }
7528
7529 #[derive(Clone, Debug)]
7547 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
7548
7549 impl CancelOperation {
7550 pub(crate) fn new(
7551 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7552 ) -> Self {
7553 Self(RequestBuilder::new(stub))
7554 }
7555
7556 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
7558 mut self,
7559 v: V,
7560 ) -> Self {
7561 self.0.request = v.into();
7562 self
7563 }
7564
7565 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7567 self.0.options = v.into();
7568 self
7569 }
7570
7571 pub async fn send(self) -> Result<()> {
7573 (*self.0.stub)
7574 .cancel_operation(self.0.request, self.0.options)
7575 .await
7576 .map(gax::response::Response::into_body)
7577 }
7578
7579 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7581 self.0.request.name = v.into();
7582 self
7583 }
7584 }
7585
7586 #[doc(hidden)]
7587 impl gax::options::internal::RequestBuilder for CancelOperation {
7588 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7589 &mut self.0.options
7590 }
7591 }
7592}