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(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
43 Self::Client::new(config).await
44 }
45 }
46 }
47
48 #[derive(Clone, Debug)]
50 pub(crate) struct RequestBuilder<R: std::default::Default> {
51 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
52 request: R,
53 options: gax::options::RequestOptions,
54 }
55
56 impl<R> RequestBuilder<R>
57 where
58 R: std::default::Default,
59 {
60 pub(crate) fn new(
61 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
62 ) -> Self {
63 Self {
64 stub,
65 request: R::default(),
66 options: gax::options::RequestOptions::default(),
67 }
68 }
69 }
70
71 #[derive(Clone, Debug)]
92 pub struct ListServiceConnectionMaps(
93 RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
94 );
95
96 impl ListServiceConnectionMaps {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
105 mut self,
106 v: V,
107 ) -> Self {
108 self.0.request = v.into();
109 self
110 }
111
112 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
114 self.0.options = v.into();
115 self
116 }
117
118 pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
120 (*self.0.stub)
121 .list_service_connection_maps(self.0.request, self.0.options)
122 .await
123 .map(gax::response::Response::into_body)
124 }
125
126 pub fn by_page(
128 self,
129 ) -> impl gax::paginator::Paginator<
130 crate::model::ListServiceConnectionMapsResponse,
131 gax::error::Error,
132 > {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl gax::paginator::ItemPaginator<
147 crate::model::ListServiceConnectionMapsResponse,
148 gax::error::Error,
149 > {
150 use gax::paginator::Paginator;
151 self.by_page().items()
152 }
153
154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.parent = v.into();
159 self
160 }
161
162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164 self.0.request.page_size = v.into();
165 self
166 }
167
168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.page_token = v.into();
171 self
172 }
173
174 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.filter = v.into();
177 self
178 }
179
180 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
182 self.0.request.order_by = v.into();
183 self
184 }
185 }
186
187 #[doc(hidden)]
188 impl gax::options::internal::RequestBuilder for ListServiceConnectionMaps {
189 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
190 &mut self.0.options
191 }
192 }
193
194 #[derive(Clone, Debug)]
211 pub struct GetServiceConnectionMap(
212 RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
213 );
214
215 impl GetServiceConnectionMap {
216 pub(crate) fn new(
217 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
218 ) -> Self {
219 Self(RequestBuilder::new(stub))
220 }
221
222 pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
224 mut self,
225 v: V,
226 ) -> Self {
227 self.0.request = v.into();
228 self
229 }
230
231 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
233 self.0.options = v.into();
234 self
235 }
236
237 pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
239 (*self.0.stub)
240 .get_service_connection_map(self.0.request, self.0.options)
241 .await
242 .map(gax::response::Response::into_body)
243 }
244
245 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
249 self.0.request.name = v.into();
250 self
251 }
252 }
253
254 #[doc(hidden)]
255 impl gax::options::internal::RequestBuilder for GetServiceConnectionMap {
256 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
257 &mut self.0.options
258 }
259 }
260
261 #[derive(Clone, Debug)]
279 pub struct CreateServiceConnectionMap(
280 RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
281 );
282
283 impl CreateServiceConnectionMap {
284 pub(crate) fn new(
285 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
286 ) -> Self {
287 Self(RequestBuilder::new(stub))
288 }
289
290 pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
292 mut self,
293 v: V,
294 ) -> Self {
295 self.0.request = v.into();
296 self
297 }
298
299 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
301 self.0.options = v.into();
302 self
303 }
304
305 pub async fn send(self) -> Result<longrunning::model::Operation> {
312 (*self.0.stub)
313 .create_service_connection_map(self.0.request, self.0.options)
314 .await
315 .map(gax::response::Response::into_body)
316 }
317
318 pub fn poller(
320 self,
321 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
322 {
323 type Operation = lro::internal::Operation<
324 crate::model::ServiceConnectionMap,
325 crate::model::OperationMetadata,
326 >;
327 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
328 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
329
330 let stub = self.0.stub.clone();
331 let mut options = self.0.options.clone();
332 options.set_retry_policy(gax::retry_policy::NeverRetry);
333 let query = move |name| {
334 let stub = stub.clone();
335 let options = options.clone();
336 async {
337 let op = GetOperation::new(stub)
338 .set_name(name)
339 .with_options(options)
340 .send()
341 .await?;
342 Ok(Operation::new(op))
343 }
344 };
345
346 let start = move || async {
347 let op = self.send().await?;
348 Ok(Operation::new(op))
349 };
350
351 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
352 }
353
354 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
358 self.0.request.parent = v.into();
359 self
360 }
361
362 pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
364 self.0.request.service_connection_map_id = v.into();
365 self
366 }
367
368 pub fn set_service_connection_map<
372 T: Into<std::option::Option<crate::model::ServiceConnectionMap>>,
373 >(
374 mut self,
375 v: T,
376 ) -> Self {
377 self.0.request.service_connection_map = v.into();
378 self
379 }
380
381 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
383 self.0.request.request_id = v.into();
384 self
385 }
386 }
387
388 #[doc(hidden)]
389 impl gax::options::internal::RequestBuilder for CreateServiceConnectionMap {
390 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
391 &mut self.0.options
392 }
393 }
394
395 #[derive(Clone, Debug)]
413 pub struct UpdateServiceConnectionMap(
414 RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
415 );
416
417 impl UpdateServiceConnectionMap {
418 pub(crate) fn new(
419 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
420 ) -> Self {
421 Self(RequestBuilder::new(stub))
422 }
423
424 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
426 mut self,
427 v: V,
428 ) -> Self {
429 self.0.request = v.into();
430 self
431 }
432
433 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
435 self.0.options = v.into();
436 self
437 }
438
439 pub async fn send(self) -> Result<longrunning::model::Operation> {
446 (*self.0.stub)
447 .update_service_connection_map(self.0.request, self.0.options)
448 .await
449 .map(gax::response::Response::into_body)
450 }
451
452 pub fn poller(
454 self,
455 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
456 {
457 type Operation = lro::internal::Operation<
458 crate::model::ServiceConnectionMap,
459 crate::model::OperationMetadata,
460 >;
461 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
462 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
463
464 let stub = self.0.stub.clone();
465 let mut options = self.0.options.clone();
466 options.set_retry_policy(gax::retry_policy::NeverRetry);
467 let query = move |name| {
468 let stub = stub.clone();
469 let options = options.clone();
470 async {
471 let op = GetOperation::new(stub)
472 .set_name(name)
473 .with_options(options)
474 .send()
475 .await?;
476 Ok(Operation::new(op))
477 }
478 };
479
480 let start = move || async {
481 let op = self.send().await?;
482 Ok(Operation::new(op))
483 };
484
485 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
486 }
487
488 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
490 mut self,
491 v: T,
492 ) -> Self {
493 self.0.request.update_mask = v.into();
494 self
495 }
496
497 pub fn set_service_connection_map<
501 T: Into<std::option::Option<crate::model::ServiceConnectionMap>>,
502 >(
503 mut self,
504 v: T,
505 ) -> Self {
506 self.0.request.service_connection_map = v.into();
507 self
508 }
509
510 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
512 self.0.request.request_id = v.into();
513 self
514 }
515 }
516
517 #[doc(hidden)]
518 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionMap {
519 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
520 &mut self.0.options
521 }
522 }
523
524 #[derive(Clone, Debug)]
542 pub struct DeleteServiceConnectionMap(
543 RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
544 );
545
546 impl DeleteServiceConnectionMap {
547 pub(crate) fn new(
548 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
549 ) -> Self {
550 Self(RequestBuilder::new(stub))
551 }
552
553 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
555 mut self,
556 v: V,
557 ) -> Self {
558 self.0.request = v.into();
559 self
560 }
561
562 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
564 self.0.options = v.into();
565 self
566 }
567
568 pub async fn send(self) -> Result<longrunning::model::Operation> {
575 (*self.0.stub)
576 .delete_service_connection_map(self.0.request, self.0.options)
577 .await
578 .map(gax::response::Response::into_body)
579 }
580
581 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
583 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
584 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
585 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
586
587 let stub = self.0.stub.clone();
588 let mut options = self.0.options.clone();
589 options.set_retry_policy(gax::retry_policy::NeverRetry);
590 let query = move |name| {
591 let stub = stub.clone();
592 let options = options.clone();
593 async {
594 let op = GetOperation::new(stub)
595 .set_name(name)
596 .with_options(options)
597 .send()
598 .await?;
599 Ok(Operation::new(op))
600 }
601 };
602
603 let start = move || async {
604 let op = self.send().await?;
605 Ok(Operation::new(op))
606 };
607
608 lro::internal::new_unit_response_poller(
609 polling_error_policy,
610 polling_backoff_policy,
611 start,
612 query,
613 )
614 }
615
616 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
620 self.0.request.name = v.into();
621 self
622 }
623
624 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
626 self.0.request.request_id = v.into();
627 self
628 }
629
630 pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
632 self.0.request.etag = v.into();
633 self
634 }
635 }
636
637 #[doc(hidden)]
638 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionMap {
639 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
640 &mut self.0.options
641 }
642 }
643
644 #[derive(Clone, Debug)]
665 pub struct ListServiceConnectionPolicies(
666 RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
667 );
668
669 impl ListServiceConnectionPolicies {
670 pub(crate) fn new(
671 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
672 ) -> Self {
673 Self(RequestBuilder::new(stub))
674 }
675
676 pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
678 mut self,
679 v: V,
680 ) -> Self {
681 self.0.request = v.into();
682 self
683 }
684
685 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
687 self.0.options = v.into();
688 self
689 }
690
691 pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
693 (*self.0.stub)
694 .list_service_connection_policies(self.0.request, self.0.options)
695 .await
696 .map(gax::response::Response::into_body)
697 }
698
699 pub fn by_page(
701 self,
702 ) -> impl gax::paginator::Paginator<
703 crate::model::ListServiceConnectionPoliciesResponse,
704 gax::error::Error,
705 > {
706 use std::clone::Clone;
707 let token = self.0.request.page_token.clone();
708 let execute = move |token: String| {
709 let mut builder = self.clone();
710 builder.0.request = builder.0.request.set_page_token(token);
711 builder.send()
712 };
713 gax::paginator::internal::new_paginator(token, execute)
714 }
715
716 pub fn by_item(
718 self,
719 ) -> impl gax::paginator::ItemPaginator<
720 crate::model::ListServiceConnectionPoliciesResponse,
721 gax::error::Error,
722 > {
723 use gax::paginator::Paginator;
724 self.by_page().items()
725 }
726
727 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
731 self.0.request.parent = v.into();
732 self
733 }
734
735 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
737 self.0.request.page_size = v.into();
738 self
739 }
740
741 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
743 self.0.request.page_token = v.into();
744 self
745 }
746
747 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
749 self.0.request.filter = v.into();
750 self
751 }
752
753 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
755 self.0.request.order_by = v.into();
756 self
757 }
758 }
759
760 #[doc(hidden)]
761 impl gax::options::internal::RequestBuilder for ListServiceConnectionPolicies {
762 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
763 &mut self.0.options
764 }
765 }
766
767 #[derive(Clone, Debug)]
784 pub struct GetServiceConnectionPolicy(
785 RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
786 );
787
788 impl GetServiceConnectionPolicy {
789 pub(crate) fn new(
790 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
791 ) -> Self {
792 Self(RequestBuilder::new(stub))
793 }
794
795 pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
797 mut self,
798 v: V,
799 ) -> Self {
800 self.0.request = v.into();
801 self
802 }
803
804 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
806 self.0.options = v.into();
807 self
808 }
809
810 pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
812 (*self.0.stub)
813 .get_service_connection_policy(self.0.request, self.0.options)
814 .await
815 .map(gax::response::Response::into_body)
816 }
817
818 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
822 self.0.request.name = v.into();
823 self
824 }
825 }
826
827 #[doc(hidden)]
828 impl gax::options::internal::RequestBuilder for GetServiceConnectionPolicy {
829 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
830 &mut self.0.options
831 }
832 }
833
834 #[derive(Clone, Debug)]
852 pub struct CreateServiceConnectionPolicy(
853 RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
854 );
855
856 impl CreateServiceConnectionPolicy {
857 pub(crate) fn new(
858 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
859 ) -> Self {
860 Self(RequestBuilder::new(stub))
861 }
862
863 pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
865 mut self,
866 v: V,
867 ) -> Self {
868 self.0.request = v.into();
869 self
870 }
871
872 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
874 self.0.options = v.into();
875 self
876 }
877
878 pub async fn send(self) -> Result<longrunning::model::Operation> {
885 (*self.0.stub)
886 .create_service_connection_policy(self.0.request, self.0.options)
887 .await
888 .map(gax::response::Response::into_body)
889 }
890
891 pub fn poller(
893 self,
894 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
895 {
896 type Operation = lro::internal::Operation<
897 crate::model::ServiceConnectionPolicy,
898 crate::model::OperationMetadata,
899 >;
900 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
901 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
902
903 let stub = self.0.stub.clone();
904 let mut options = self.0.options.clone();
905 options.set_retry_policy(gax::retry_policy::NeverRetry);
906 let query = move |name| {
907 let stub = stub.clone();
908 let options = options.clone();
909 async {
910 let op = GetOperation::new(stub)
911 .set_name(name)
912 .with_options(options)
913 .send()
914 .await?;
915 Ok(Operation::new(op))
916 }
917 };
918
919 let start = move || async {
920 let op = self.send().await?;
921 Ok(Operation::new(op))
922 };
923
924 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
925 }
926
927 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
931 self.0.request.parent = v.into();
932 self
933 }
934
935 pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
937 mut self,
938 v: T,
939 ) -> Self {
940 self.0.request.service_connection_policy_id = v.into();
941 self
942 }
943
944 pub fn set_service_connection_policy<
948 T: Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
949 >(
950 mut self,
951 v: T,
952 ) -> Self {
953 self.0.request.service_connection_policy = v.into();
954 self
955 }
956
957 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
959 self.0.request.request_id = v.into();
960 self
961 }
962 }
963
964 #[doc(hidden)]
965 impl gax::options::internal::RequestBuilder for CreateServiceConnectionPolicy {
966 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
967 &mut self.0.options
968 }
969 }
970
971 #[derive(Clone, Debug)]
989 pub struct UpdateServiceConnectionPolicy(
990 RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
991 );
992
993 impl UpdateServiceConnectionPolicy {
994 pub(crate) fn new(
995 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
996 ) -> Self {
997 Self(RequestBuilder::new(stub))
998 }
999
1000 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1002 mut self,
1003 v: V,
1004 ) -> Self {
1005 self.0.request = v.into();
1006 self
1007 }
1008
1009 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1011 self.0.options = v.into();
1012 self
1013 }
1014
1015 pub async fn send(self) -> Result<longrunning::model::Operation> {
1022 (*self.0.stub)
1023 .update_service_connection_policy(self.0.request, self.0.options)
1024 .await
1025 .map(gax::response::Response::into_body)
1026 }
1027
1028 pub fn poller(
1030 self,
1031 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
1032 {
1033 type Operation = lro::internal::Operation<
1034 crate::model::ServiceConnectionPolicy,
1035 crate::model::OperationMetadata,
1036 >;
1037 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1038 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1039
1040 let stub = self.0.stub.clone();
1041 let mut options = self.0.options.clone();
1042 options.set_retry_policy(gax::retry_policy::NeverRetry);
1043 let query = move |name| {
1044 let stub = stub.clone();
1045 let options = options.clone();
1046 async {
1047 let op = GetOperation::new(stub)
1048 .set_name(name)
1049 .with_options(options)
1050 .send()
1051 .await?;
1052 Ok(Operation::new(op))
1053 }
1054 };
1055
1056 let start = move || async {
1057 let op = self.send().await?;
1058 Ok(Operation::new(op))
1059 };
1060
1061 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1062 }
1063
1064 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1066 mut self,
1067 v: T,
1068 ) -> Self {
1069 self.0.request.update_mask = v.into();
1070 self
1071 }
1072
1073 pub fn set_service_connection_policy<
1077 T: Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
1078 >(
1079 mut self,
1080 v: T,
1081 ) -> Self {
1082 self.0.request.service_connection_policy = v.into();
1083 self
1084 }
1085
1086 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1088 self.0.request.request_id = v.into();
1089 self
1090 }
1091 }
1092
1093 #[doc(hidden)]
1094 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionPolicy {
1095 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1096 &mut self.0.options
1097 }
1098 }
1099
1100 #[derive(Clone, Debug)]
1118 pub struct DeleteServiceConnectionPolicy(
1119 RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1120 );
1121
1122 impl DeleteServiceConnectionPolicy {
1123 pub(crate) fn new(
1124 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1125 ) -> Self {
1126 Self(RequestBuilder::new(stub))
1127 }
1128
1129 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1131 mut self,
1132 v: V,
1133 ) -> Self {
1134 self.0.request = v.into();
1135 self
1136 }
1137
1138 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1140 self.0.options = v.into();
1141 self
1142 }
1143
1144 pub async fn send(self) -> Result<longrunning::model::Operation> {
1151 (*self.0.stub)
1152 .delete_service_connection_policy(self.0.request, self.0.options)
1153 .await
1154 .map(gax::response::Response::into_body)
1155 }
1156
1157 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1159 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1160 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1161 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1162
1163 let stub = self.0.stub.clone();
1164 let mut options = self.0.options.clone();
1165 options.set_retry_policy(gax::retry_policy::NeverRetry);
1166 let query = move |name| {
1167 let stub = stub.clone();
1168 let options = options.clone();
1169 async {
1170 let op = GetOperation::new(stub)
1171 .set_name(name)
1172 .with_options(options)
1173 .send()
1174 .await?;
1175 Ok(Operation::new(op))
1176 }
1177 };
1178
1179 let start = move || async {
1180 let op = self.send().await?;
1181 Ok(Operation::new(op))
1182 };
1183
1184 lro::internal::new_unit_response_poller(
1185 polling_error_policy,
1186 polling_backoff_policy,
1187 start,
1188 query,
1189 )
1190 }
1191
1192 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1196 self.0.request.name = v.into();
1197 self
1198 }
1199
1200 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1202 self.0.request.request_id = v.into();
1203 self
1204 }
1205
1206 pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
1208 self.0.request.etag = v.into();
1209 self
1210 }
1211 }
1212
1213 #[doc(hidden)]
1214 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionPolicy {
1215 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1216 &mut self.0.options
1217 }
1218 }
1219
1220 #[derive(Clone, Debug)]
1241 pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1242
1243 impl ListServiceClasses {
1244 pub(crate) fn new(
1245 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1246 ) -> Self {
1247 Self(RequestBuilder::new(stub))
1248 }
1249
1250 pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1252 mut self,
1253 v: V,
1254 ) -> Self {
1255 self.0.request = v.into();
1256 self
1257 }
1258
1259 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1261 self.0.options = v.into();
1262 self
1263 }
1264
1265 pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1267 (*self.0.stub)
1268 .list_service_classes(self.0.request, self.0.options)
1269 .await
1270 .map(gax::response::Response::into_body)
1271 }
1272
1273 pub fn by_page(
1275 self,
1276 ) -> impl gax::paginator::Paginator<crate::model::ListServiceClassesResponse, gax::error::Error>
1277 {
1278 use std::clone::Clone;
1279 let token = self.0.request.page_token.clone();
1280 let execute = move |token: String| {
1281 let mut builder = self.clone();
1282 builder.0.request = builder.0.request.set_page_token(token);
1283 builder.send()
1284 };
1285 gax::paginator::internal::new_paginator(token, execute)
1286 }
1287
1288 pub fn by_item(
1290 self,
1291 ) -> impl gax::paginator::ItemPaginator<
1292 crate::model::ListServiceClassesResponse,
1293 gax::error::Error,
1294 > {
1295 use gax::paginator::Paginator;
1296 self.by_page().items()
1297 }
1298
1299 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1303 self.0.request.parent = v.into();
1304 self
1305 }
1306
1307 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1309 self.0.request.page_size = v.into();
1310 self
1311 }
1312
1313 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1315 self.0.request.page_token = v.into();
1316 self
1317 }
1318
1319 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1321 self.0.request.filter = v.into();
1322 self
1323 }
1324
1325 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327 self.0.request.order_by = v.into();
1328 self
1329 }
1330 }
1331
1332 #[doc(hidden)]
1333 impl gax::options::internal::RequestBuilder for ListServiceClasses {
1334 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1335 &mut self.0.options
1336 }
1337 }
1338
1339 #[derive(Clone, Debug)]
1356 pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1357
1358 impl GetServiceClass {
1359 pub(crate) fn new(
1360 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1361 ) -> Self {
1362 Self(RequestBuilder::new(stub))
1363 }
1364
1365 pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1367 self.0.request = v.into();
1368 self
1369 }
1370
1371 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1373 self.0.options = v.into();
1374 self
1375 }
1376
1377 pub async fn send(self) -> Result<crate::model::ServiceClass> {
1379 (*self.0.stub)
1380 .get_service_class(self.0.request, self.0.options)
1381 .await
1382 .map(gax::response::Response::into_body)
1383 }
1384
1385 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1389 self.0.request.name = v.into();
1390 self
1391 }
1392 }
1393
1394 #[doc(hidden)]
1395 impl gax::options::internal::RequestBuilder for GetServiceClass {
1396 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1397 &mut self.0.options
1398 }
1399 }
1400
1401 #[derive(Clone, Debug)]
1419 pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1420
1421 impl UpdateServiceClass {
1422 pub(crate) fn new(
1423 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1424 ) -> Self {
1425 Self(RequestBuilder::new(stub))
1426 }
1427
1428 pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1430 mut self,
1431 v: V,
1432 ) -> Self {
1433 self.0.request = v.into();
1434 self
1435 }
1436
1437 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1439 self.0.options = v.into();
1440 self
1441 }
1442
1443 pub async fn send(self) -> Result<longrunning::model::Operation> {
1450 (*self.0.stub)
1451 .update_service_class(self.0.request, self.0.options)
1452 .await
1453 .map(gax::response::Response::into_body)
1454 }
1455
1456 pub fn poller(
1458 self,
1459 ) -> impl lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata> {
1460 type Operation = lro::internal::Operation<
1461 crate::model::ServiceClass,
1462 crate::model::OperationMetadata,
1463 >;
1464 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1465 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1466
1467 let stub = self.0.stub.clone();
1468 let mut options = self.0.options.clone();
1469 options.set_retry_policy(gax::retry_policy::NeverRetry);
1470 let query = move |name| {
1471 let stub = stub.clone();
1472 let options = options.clone();
1473 async {
1474 let op = GetOperation::new(stub)
1475 .set_name(name)
1476 .with_options(options)
1477 .send()
1478 .await?;
1479 Ok(Operation::new(op))
1480 }
1481 };
1482
1483 let start = move || async {
1484 let op = self.send().await?;
1485 Ok(Operation::new(op))
1486 };
1487
1488 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1489 }
1490
1491 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1493 mut self,
1494 v: T,
1495 ) -> Self {
1496 self.0.request.update_mask = v.into();
1497 self
1498 }
1499
1500 pub fn set_service_class<T: Into<std::option::Option<crate::model::ServiceClass>>>(
1504 mut self,
1505 v: T,
1506 ) -> Self {
1507 self.0.request.service_class = v.into();
1508 self
1509 }
1510
1511 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1513 self.0.request.request_id = v.into();
1514 self
1515 }
1516 }
1517
1518 #[doc(hidden)]
1519 impl gax::options::internal::RequestBuilder for UpdateServiceClass {
1520 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1521 &mut self.0.options
1522 }
1523 }
1524
1525 #[derive(Clone, Debug)]
1543 pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1544
1545 impl DeleteServiceClass {
1546 pub(crate) fn new(
1547 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1548 ) -> Self {
1549 Self(RequestBuilder::new(stub))
1550 }
1551
1552 pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1554 mut self,
1555 v: V,
1556 ) -> Self {
1557 self.0.request = v.into();
1558 self
1559 }
1560
1561 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1563 self.0.options = v.into();
1564 self
1565 }
1566
1567 pub async fn send(self) -> Result<longrunning::model::Operation> {
1574 (*self.0.stub)
1575 .delete_service_class(self.0.request, self.0.options)
1576 .await
1577 .map(gax::response::Response::into_body)
1578 }
1579
1580 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1582 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1583 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1584 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1585
1586 let stub = self.0.stub.clone();
1587 let mut options = self.0.options.clone();
1588 options.set_retry_policy(gax::retry_policy::NeverRetry);
1589 let query = move |name| {
1590 let stub = stub.clone();
1591 let options = options.clone();
1592 async {
1593 let op = GetOperation::new(stub)
1594 .set_name(name)
1595 .with_options(options)
1596 .send()
1597 .await?;
1598 Ok(Operation::new(op))
1599 }
1600 };
1601
1602 let start = move || async {
1603 let op = self.send().await?;
1604 Ok(Operation::new(op))
1605 };
1606
1607 lro::internal::new_unit_response_poller(
1608 polling_error_policy,
1609 polling_backoff_policy,
1610 start,
1611 query,
1612 )
1613 }
1614
1615 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1619 self.0.request.name = v.into();
1620 self
1621 }
1622
1623 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1625 self.0.request.request_id = v.into();
1626 self
1627 }
1628
1629 pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
1631 self.0.request.etag = v.into();
1632 self
1633 }
1634 }
1635
1636 #[doc(hidden)]
1637 impl gax::options::internal::RequestBuilder for DeleteServiceClass {
1638 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1639 &mut self.0.options
1640 }
1641 }
1642
1643 #[derive(Clone, Debug)]
1660 pub struct GetServiceConnectionToken(
1661 RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1662 );
1663
1664 impl GetServiceConnectionToken {
1665 pub(crate) fn new(
1666 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1667 ) -> Self {
1668 Self(RequestBuilder::new(stub))
1669 }
1670
1671 pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1673 mut self,
1674 v: V,
1675 ) -> Self {
1676 self.0.request = v.into();
1677 self
1678 }
1679
1680 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1682 self.0.options = v.into();
1683 self
1684 }
1685
1686 pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1688 (*self.0.stub)
1689 .get_service_connection_token(self.0.request, self.0.options)
1690 .await
1691 .map(gax::response::Response::into_body)
1692 }
1693
1694 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698 self.0.request.name = v.into();
1699 self
1700 }
1701 }
1702
1703 #[doc(hidden)]
1704 impl gax::options::internal::RequestBuilder for GetServiceConnectionToken {
1705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1706 &mut self.0.options
1707 }
1708 }
1709
1710 #[derive(Clone, Debug)]
1731 pub struct ListServiceConnectionTokens(
1732 RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1733 );
1734
1735 impl ListServiceConnectionTokens {
1736 pub(crate) fn new(
1737 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1738 ) -> Self {
1739 Self(RequestBuilder::new(stub))
1740 }
1741
1742 pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1744 mut self,
1745 v: V,
1746 ) -> Self {
1747 self.0.request = v.into();
1748 self
1749 }
1750
1751 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1753 self.0.options = v.into();
1754 self
1755 }
1756
1757 pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1759 (*self.0.stub)
1760 .list_service_connection_tokens(self.0.request, self.0.options)
1761 .await
1762 .map(gax::response::Response::into_body)
1763 }
1764
1765 pub fn by_page(
1767 self,
1768 ) -> impl gax::paginator::Paginator<
1769 crate::model::ListServiceConnectionTokensResponse,
1770 gax::error::Error,
1771 > {
1772 use std::clone::Clone;
1773 let token = self.0.request.page_token.clone();
1774 let execute = move |token: String| {
1775 let mut builder = self.clone();
1776 builder.0.request = builder.0.request.set_page_token(token);
1777 builder.send()
1778 };
1779 gax::paginator::internal::new_paginator(token, execute)
1780 }
1781
1782 pub fn by_item(
1784 self,
1785 ) -> impl gax::paginator::ItemPaginator<
1786 crate::model::ListServiceConnectionTokensResponse,
1787 gax::error::Error,
1788 > {
1789 use gax::paginator::Paginator;
1790 self.by_page().items()
1791 }
1792
1793 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.0.request.parent = v.into();
1798 self
1799 }
1800
1801 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1803 self.0.request.page_size = v.into();
1804 self
1805 }
1806
1807 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1809 self.0.request.page_token = v.into();
1810 self
1811 }
1812
1813 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1815 self.0.request.filter = v.into();
1816 self
1817 }
1818
1819 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1821 self.0.request.order_by = v.into();
1822 self
1823 }
1824 }
1825
1826 #[doc(hidden)]
1827 impl gax::options::internal::RequestBuilder for ListServiceConnectionTokens {
1828 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1829 &mut self.0.options
1830 }
1831 }
1832
1833 #[derive(Clone, Debug)]
1851 pub struct CreateServiceConnectionToken(
1852 RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
1853 );
1854
1855 impl CreateServiceConnectionToken {
1856 pub(crate) fn new(
1857 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1858 ) -> Self {
1859 Self(RequestBuilder::new(stub))
1860 }
1861
1862 pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
1864 mut self,
1865 v: V,
1866 ) -> Self {
1867 self.0.request = v.into();
1868 self
1869 }
1870
1871 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1873 self.0.options = v.into();
1874 self
1875 }
1876
1877 pub async fn send(self) -> Result<longrunning::model::Operation> {
1884 (*self.0.stub)
1885 .create_service_connection_token(self.0.request, self.0.options)
1886 .await
1887 .map(gax::response::Response::into_body)
1888 }
1889
1890 pub fn poller(
1892 self,
1893 ) -> impl lro::Poller<crate::model::ServiceConnectionToken, crate::model::OperationMetadata>
1894 {
1895 type Operation = lro::internal::Operation<
1896 crate::model::ServiceConnectionToken,
1897 crate::model::OperationMetadata,
1898 >;
1899 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1900 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1901
1902 let stub = self.0.stub.clone();
1903 let mut options = self.0.options.clone();
1904 options.set_retry_policy(gax::retry_policy::NeverRetry);
1905 let query = move |name| {
1906 let stub = stub.clone();
1907 let options = options.clone();
1908 async {
1909 let op = GetOperation::new(stub)
1910 .set_name(name)
1911 .with_options(options)
1912 .send()
1913 .await?;
1914 Ok(Operation::new(op))
1915 }
1916 };
1917
1918 let start = move || async {
1919 let op = self.send().await?;
1920 Ok(Operation::new(op))
1921 };
1922
1923 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1924 }
1925
1926 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1930 self.0.request.parent = v.into();
1931 self
1932 }
1933
1934 pub fn set_service_connection_token_id<T: Into<std::string::String>>(
1936 mut self,
1937 v: T,
1938 ) -> Self {
1939 self.0.request.service_connection_token_id = v.into();
1940 self
1941 }
1942
1943 pub fn set_service_connection_token<
1947 T: Into<std::option::Option<crate::model::ServiceConnectionToken>>,
1948 >(
1949 mut self,
1950 v: T,
1951 ) -> Self {
1952 self.0.request.service_connection_token = v.into();
1953 self
1954 }
1955
1956 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1958 self.0.request.request_id = v.into();
1959 self
1960 }
1961 }
1962
1963 #[doc(hidden)]
1964 impl gax::options::internal::RequestBuilder for CreateServiceConnectionToken {
1965 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1966 &mut self.0.options
1967 }
1968 }
1969
1970 #[derive(Clone, Debug)]
1988 pub struct DeleteServiceConnectionToken(
1989 RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
1990 );
1991
1992 impl DeleteServiceConnectionToken {
1993 pub(crate) fn new(
1994 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1995 ) -> Self {
1996 Self(RequestBuilder::new(stub))
1997 }
1998
1999 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2001 mut self,
2002 v: V,
2003 ) -> Self {
2004 self.0.request = v.into();
2005 self
2006 }
2007
2008 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2010 self.0.options = v.into();
2011 self
2012 }
2013
2014 pub async fn send(self) -> Result<longrunning::model::Operation> {
2021 (*self.0.stub)
2022 .delete_service_connection_token(self.0.request, self.0.options)
2023 .await
2024 .map(gax::response::Response::into_body)
2025 }
2026
2027 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2029 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2030 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2031 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2032
2033 let stub = self.0.stub.clone();
2034 let mut options = self.0.options.clone();
2035 options.set_retry_policy(gax::retry_policy::NeverRetry);
2036 let query = move |name| {
2037 let stub = stub.clone();
2038 let options = options.clone();
2039 async {
2040 let op = GetOperation::new(stub)
2041 .set_name(name)
2042 .with_options(options)
2043 .send()
2044 .await?;
2045 Ok(Operation::new(op))
2046 }
2047 };
2048
2049 let start = move || async {
2050 let op = self.send().await?;
2051 Ok(Operation::new(op))
2052 };
2053
2054 lro::internal::new_unit_response_poller(
2055 polling_error_policy,
2056 polling_backoff_policy,
2057 start,
2058 query,
2059 )
2060 }
2061
2062 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2066 self.0.request.name = v.into();
2067 self
2068 }
2069
2070 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2072 self.0.request.request_id = v.into();
2073 self
2074 }
2075
2076 pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
2078 self.0.request.etag = v.into();
2079 self
2080 }
2081 }
2082
2083 #[doc(hidden)]
2084 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionToken {
2085 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2086 &mut self.0.options
2087 }
2088 }
2089
2090 #[derive(Clone, Debug)]
2111 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2112
2113 impl ListLocations {
2114 pub(crate) fn new(
2115 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2116 ) -> Self {
2117 Self(RequestBuilder::new(stub))
2118 }
2119
2120 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2122 mut self,
2123 v: V,
2124 ) -> Self {
2125 self.0.request = v.into();
2126 self
2127 }
2128
2129 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2131 self.0.options = v.into();
2132 self
2133 }
2134
2135 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2137 (*self.0.stub)
2138 .list_locations(self.0.request, self.0.options)
2139 .await
2140 .map(gax::response::Response::into_body)
2141 }
2142
2143 pub fn by_page(
2145 self,
2146 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2147 {
2148 use std::clone::Clone;
2149 let token = self.0.request.page_token.clone();
2150 let execute = move |token: String| {
2151 let mut builder = self.clone();
2152 builder.0.request = builder.0.request.set_page_token(token);
2153 builder.send()
2154 };
2155 gax::paginator::internal::new_paginator(token, execute)
2156 }
2157
2158 pub fn by_item(
2160 self,
2161 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2162 {
2163 use gax::paginator::Paginator;
2164 self.by_page().items()
2165 }
2166
2167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2169 self.0.request.name = v.into();
2170 self
2171 }
2172
2173 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2175 self.0.request.filter = v.into();
2176 self
2177 }
2178
2179 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2181 self.0.request.page_size = v.into();
2182 self
2183 }
2184
2185 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2187 self.0.request.page_token = v.into();
2188 self
2189 }
2190 }
2191
2192 #[doc(hidden)]
2193 impl gax::options::internal::RequestBuilder for ListLocations {
2194 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2195 &mut self.0.options
2196 }
2197 }
2198
2199 #[derive(Clone, Debug)]
2216 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2217
2218 impl GetLocation {
2219 pub(crate) fn new(
2220 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2221 ) -> Self {
2222 Self(RequestBuilder::new(stub))
2223 }
2224
2225 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2227 self.0.request = v.into();
2228 self
2229 }
2230
2231 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2233 self.0.options = v.into();
2234 self
2235 }
2236
2237 pub async fn send(self) -> Result<location::model::Location> {
2239 (*self.0.stub)
2240 .get_location(self.0.request, self.0.options)
2241 .await
2242 .map(gax::response::Response::into_body)
2243 }
2244
2245 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2247 self.0.request.name = v.into();
2248 self
2249 }
2250 }
2251
2252 #[doc(hidden)]
2253 impl gax::options::internal::RequestBuilder for GetLocation {
2254 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2255 &mut self.0.options
2256 }
2257 }
2258
2259 #[derive(Clone, Debug)]
2276 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2277
2278 impl SetIamPolicy {
2279 pub(crate) fn new(
2280 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2281 ) -> Self {
2282 Self(RequestBuilder::new(stub))
2283 }
2284
2285 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2287 self.0.request = v.into();
2288 self
2289 }
2290
2291 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2293 self.0.options = v.into();
2294 self
2295 }
2296
2297 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2299 (*self.0.stub)
2300 .set_iam_policy(self.0.request, self.0.options)
2301 .await
2302 .map(gax::response::Response::into_body)
2303 }
2304
2305 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2309 self.0.request.resource = v.into();
2310 self
2311 }
2312
2313 pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
2317 mut self,
2318 v: T,
2319 ) -> Self {
2320 self.0.request.policy = v.into();
2321 self
2322 }
2323
2324 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
2326 mut self,
2327 v: T,
2328 ) -> Self {
2329 self.0.request.update_mask = v.into();
2330 self
2331 }
2332 }
2333
2334 #[doc(hidden)]
2335 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2336 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2337 &mut self.0.options
2338 }
2339 }
2340
2341 #[derive(Clone, Debug)]
2358 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2359
2360 impl GetIamPolicy {
2361 pub(crate) fn new(
2362 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2363 ) -> Self {
2364 Self(RequestBuilder::new(stub))
2365 }
2366
2367 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2369 self.0.request = v.into();
2370 self
2371 }
2372
2373 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2375 self.0.options = v.into();
2376 self
2377 }
2378
2379 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2381 (*self.0.stub)
2382 .get_iam_policy(self.0.request, self.0.options)
2383 .await
2384 .map(gax::response::Response::into_body)
2385 }
2386
2387 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2391 self.0.request.resource = v.into();
2392 self
2393 }
2394
2395 pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
2397 mut self,
2398 v: T,
2399 ) -> Self {
2400 self.0.request.options = v.into();
2401 self
2402 }
2403 }
2404
2405 #[doc(hidden)]
2406 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2407 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2408 &mut self.0.options
2409 }
2410 }
2411
2412 #[derive(Clone, Debug)]
2429 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2430
2431 impl TestIamPermissions {
2432 pub(crate) fn new(
2433 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2434 ) -> Self {
2435 Self(RequestBuilder::new(stub))
2436 }
2437
2438 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2440 mut self,
2441 v: V,
2442 ) -> Self {
2443 self.0.request = v.into();
2444 self
2445 }
2446
2447 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2449 self.0.options = v.into();
2450 self
2451 }
2452
2453 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2455 (*self.0.stub)
2456 .test_iam_permissions(self.0.request, self.0.options)
2457 .await
2458 .map(gax::response::Response::into_body)
2459 }
2460
2461 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2465 self.0.request.resource = v.into();
2466 self
2467 }
2468
2469 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2473 where
2474 T: std::iter::IntoIterator<Item = V>,
2475 V: std::convert::Into<std::string::String>,
2476 {
2477 use std::iter::Iterator;
2478 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2479 self
2480 }
2481 }
2482
2483 #[doc(hidden)]
2484 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2485 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2486 &mut self.0.options
2487 }
2488 }
2489
2490 #[derive(Clone, Debug)]
2511 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2512
2513 impl ListOperations {
2514 pub(crate) fn new(
2515 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2516 ) -> Self {
2517 Self(RequestBuilder::new(stub))
2518 }
2519
2520 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2522 mut self,
2523 v: V,
2524 ) -> Self {
2525 self.0.request = v.into();
2526 self
2527 }
2528
2529 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2531 self.0.options = v.into();
2532 self
2533 }
2534
2535 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2537 (*self.0.stub)
2538 .list_operations(self.0.request, self.0.options)
2539 .await
2540 .map(gax::response::Response::into_body)
2541 }
2542
2543 pub fn by_page(
2545 self,
2546 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2547 {
2548 use std::clone::Clone;
2549 let token = self.0.request.page_token.clone();
2550 let execute = move |token: String| {
2551 let mut builder = self.clone();
2552 builder.0.request = builder.0.request.set_page_token(token);
2553 builder.send()
2554 };
2555 gax::paginator::internal::new_paginator(token, execute)
2556 }
2557
2558 pub fn by_item(
2560 self,
2561 ) -> impl gax::paginator::ItemPaginator<
2562 longrunning::model::ListOperationsResponse,
2563 gax::error::Error,
2564 > {
2565 use gax::paginator::Paginator;
2566 self.by_page().items()
2567 }
2568
2569 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2571 self.0.request.name = v.into();
2572 self
2573 }
2574
2575 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2577 self.0.request.filter = v.into();
2578 self
2579 }
2580
2581 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2583 self.0.request.page_size = v.into();
2584 self
2585 }
2586
2587 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2589 self.0.request.page_token = v.into();
2590 self
2591 }
2592 }
2593
2594 #[doc(hidden)]
2595 impl gax::options::internal::RequestBuilder for ListOperations {
2596 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2597 &mut self.0.options
2598 }
2599 }
2600
2601 #[derive(Clone, Debug)]
2618 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2619
2620 impl GetOperation {
2621 pub(crate) fn new(
2622 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2623 ) -> Self {
2624 Self(RequestBuilder::new(stub))
2625 }
2626
2627 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2629 mut self,
2630 v: V,
2631 ) -> Self {
2632 self.0.request = v.into();
2633 self
2634 }
2635
2636 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2638 self.0.options = v.into();
2639 self
2640 }
2641
2642 pub async fn send(self) -> Result<longrunning::model::Operation> {
2644 (*self.0.stub)
2645 .get_operation(self.0.request, self.0.options)
2646 .await
2647 .map(gax::response::Response::into_body)
2648 }
2649
2650 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2652 self.0.request.name = v.into();
2653 self
2654 }
2655 }
2656
2657 #[doc(hidden)]
2658 impl gax::options::internal::RequestBuilder for GetOperation {
2659 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2660 &mut self.0.options
2661 }
2662 }
2663
2664 #[derive(Clone, Debug)]
2681 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2682
2683 impl DeleteOperation {
2684 pub(crate) fn new(
2685 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2686 ) -> Self {
2687 Self(RequestBuilder::new(stub))
2688 }
2689
2690 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2692 mut self,
2693 v: V,
2694 ) -> Self {
2695 self.0.request = v.into();
2696 self
2697 }
2698
2699 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2701 self.0.options = v.into();
2702 self
2703 }
2704
2705 pub async fn send(self) -> Result<()> {
2707 (*self.0.stub)
2708 .delete_operation(self.0.request, self.0.options)
2709 .await
2710 .map(gax::response::Response::into_body)
2711 }
2712
2713 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2715 self.0.request.name = v.into();
2716 self
2717 }
2718 }
2719
2720 #[doc(hidden)]
2721 impl gax::options::internal::RequestBuilder for DeleteOperation {
2722 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2723 &mut self.0.options
2724 }
2725 }
2726
2727 #[derive(Clone, Debug)]
2744 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2745
2746 impl CancelOperation {
2747 pub(crate) fn new(
2748 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2749 ) -> Self {
2750 Self(RequestBuilder::new(stub))
2751 }
2752
2753 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2755 mut self,
2756 v: V,
2757 ) -> Self {
2758 self.0.request = v.into();
2759 self
2760 }
2761
2762 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2764 self.0.options = v.into();
2765 self
2766 }
2767
2768 pub async fn send(self) -> Result<()> {
2770 (*self.0.stub)
2771 .cancel_operation(self.0.request, self.0.options)
2772 .await
2773 .map(gax::response::Response::into_body)
2774 }
2775
2776 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2778 self.0.request.name = v.into();
2779 self
2780 }
2781 }
2782
2783 #[doc(hidden)]
2784 impl gax::options::internal::RequestBuilder for CancelOperation {
2785 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2786 &mut self.0.options
2787 }
2788 }
2789}
2790
2791pub mod hub_service {
2792 use crate::Result;
2793
2794 pub type ClientBuilder =
2808 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2809
2810 pub(crate) mod client {
2811 use super::super::super::client::HubService;
2812 pub struct Factory;
2813 impl gax::client_builder::internal::ClientFactory for Factory {
2814 type Client = HubService;
2815 type Credentials = gaxi::options::Credentials;
2816 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
2817 Self::Client::new(config).await
2818 }
2819 }
2820 }
2821
2822 #[derive(Clone, Debug)]
2824 pub(crate) struct RequestBuilder<R: std::default::Default> {
2825 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
2826 request: R,
2827 options: gax::options::RequestOptions,
2828 }
2829
2830 impl<R> RequestBuilder<R>
2831 where
2832 R: std::default::Default,
2833 {
2834 pub(crate) fn new(
2835 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
2836 ) -> Self {
2837 Self {
2838 stub,
2839 request: R::default(),
2840 options: gax::options::RequestOptions::default(),
2841 }
2842 }
2843 }
2844
2845 #[derive(Clone, Debug)]
2866 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
2867
2868 impl ListHubs {
2869 pub(crate) fn new(
2870 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
2871 ) -> Self {
2872 Self(RequestBuilder::new(stub))
2873 }
2874
2875 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
2877 self.0.request = v.into();
2878 self
2879 }
2880
2881 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2883 self.0.options = v.into();
2884 self
2885 }
2886
2887 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
2889 (*self.0.stub)
2890 .list_hubs(self.0.request, self.0.options)
2891 .await
2892 .map(gax::response::Response::into_body)
2893 }
2894
2895 pub fn by_page(
2897 self,
2898 ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
2899 {
2900 use std::clone::Clone;
2901 let token = self.0.request.page_token.clone();
2902 let execute = move |token: String| {
2903 let mut builder = self.clone();
2904 builder.0.request = builder.0.request.set_page_token(token);
2905 builder.send()
2906 };
2907 gax::paginator::internal::new_paginator(token, execute)
2908 }
2909
2910 pub fn by_item(
2912 self,
2913 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubsResponse, gax::error::Error>
2914 {
2915 use gax::paginator::Paginator;
2916 self.by_page().items()
2917 }
2918
2919 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2923 self.0.request.parent = v.into();
2924 self
2925 }
2926
2927 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2929 self.0.request.page_size = v.into();
2930 self
2931 }
2932
2933 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2935 self.0.request.page_token = v.into();
2936 self
2937 }
2938
2939 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2941 self.0.request.filter = v.into();
2942 self
2943 }
2944
2945 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2947 self.0.request.order_by = v.into();
2948 self
2949 }
2950 }
2951
2952 #[doc(hidden)]
2953 impl gax::options::internal::RequestBuilder for ListHubs {
2954 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2955 &mut self.0.options
2956 }
2957 }
2958
2959 #[derive(Clone, Debug)]
2976 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
2977
2978 impl GetHub {
2979 pub(crate) fn new(
2980 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
2981 ) -> Self {
2982 Self(RequestBuilder::new(stub))
2983 }
2984
2985 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
2987 self.0.request = v.into();
2988 self
2989 }
2990
2991 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2993 self.0.options = v.into();
2994 self
2995 }
2996
2997 pub async fn send(self) -> Result<crate::model::Hub> {
2999 (*self.0.stub)
3000 .get_hub(self.0.request, self.0.options)
3001 .await
3002 .map(gax::response::Response::into_body)
3003 }
3004
3005 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.0.request.name = v.into();
3010 self
3011 }
3012 }
3013
3014 #[doc(hidden)]
3015 impl gax::options::internal::RequestBuilder for GetHub {
3016 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3017 &mut self.0.options
3018 }
3019 }
3020
3021 #[derive(Clone, Debug)]
3039 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
3040
3041 impl CreateHub {
3042 pub(crate) fn new(
3043 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3044 ) -> Self {
3045 Self(RequestBuilder::new(stub))
3046 }
3047
3048 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
3050 self.0.request = v.into();
3051 self
3052 }
3053
3054 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3056 self.0.options = v.into();
3057 self
3058 }
3059
3060 pub async fn send(self) -> Result<longrunning::model::Operation> {
3067 (*self.0.stub)
3068 .create_hub(self.0.request, self.0.options)
3069 .await
3070 .map(gax::response::Response::into_body)
3071 }
3072
3073 pub fn poller(
3075 self,
3076 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
3077 type Operation =
3078 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
3079 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3080 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3081
3082 let stub = self.0.stub.clone();
3083 let mut options = self.0.options.clone();
3084 options.set_retry_policy(gax::retry_policy::NeverRetry);
3085 let query = move |name| {
3086 let stub = stub.clone();
3087 let options = options.clone();
3088 async {
3089 let op = GetOperation::new(stub)
3090 .set_name(name)
3091 .with_options(options)
3092 .send()
3093 .await?;
3094 Ok(Operation::new(op))
3095 }
3096 };
3097
3098 let start = move || async {
3099 let op = self.send().await?;
3100 Ok(Operation::new(op))
3101 };
3102
3103 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3104 }
3105
3106 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3110 self.0.request.parent = v.into();
3111 self
3112 }
3113
3114 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3118 self.0.request.hub_id = v.into();
3119 self
3120 }
3121
3122 pub fn set_hub<T: Into<std::option::Option<crate::model::Hub>>>(mut self, v: T) -> Self {
3126 self.0.request.hub = v.into();
3127 self
3128 }
3129
3130 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3132 self.0.request.request_id = v.into();
3133 self
3134 }
3135 }
3136
3137 #[doc(hidden)]
3138 impl gax::options::internal::RequestBuilder for CreateHub {
3139 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3140 &mut self.0.options
3141 }
3142 }
3143
3144 #[derive(Clone, Debug)]
3162 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
3163
3164 impl UpdateHub {
3165 pub(crate) fn new(
3166 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3167 ) -> Self {
3168 Self(RequestBuilder::new(stub))
3169 }
3170
3171 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
3173 self.0.request = v.into();
3174 self
3175 }
3176
3177 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3179 self.0.options = v.into();
3180 self
3181 }
3182
3183 pub async fn send(self) -> Result<longrunning::model::Operation> {
3190 (*self.0.stub)
3191 .update_hub(self.0.request, self.0.options)
3192 .await
3193 .map(gax::response::Response::into_body)
3194 }
3195
3196 pub fn poller(
3198 self,
3199 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
3200 type Operation =
3201 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
3202 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3203 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3204
3205 let stub = self.0.stub.clone();
3206 let mut options = self.0.options.clone();
3207 options.set_retry_policy(gax::retry_policy::NeverRetry);
3208 let query = move |name| {
3209 let stub = stub.clone();
3210 let options = options.clone();
3211 async {
3212 let op = GetOperation::new(stub)
3213 .set_name(name)
3214 .with_options(options)
3215 .send()
3216 .await?;
3217 Ok(Operation::new(op))
3218 }
3219 };
3220
3221 let start = move || async {
3222 let op = self.send().await?;
3223 Ok(Operation::new(op))
3224 };
3225
3226 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3227 }
3228
3229 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
3231 mut self,
3232 v: T,
3233 ) -> Self {
3234 self.0.request.update_mask = v.into();
3235 self
3236 }
3237
3238 pub fn set_hub<T: Into<std::option::Option<crate::model::Hub>>>(mut self, v: T) -> Self {
3242 self.0.request.hub = v.into();
3243 self
3244 }
3245
3246 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3248 self.0.request.request_id = v.into();
3249 self
3250 }
3251 }
3252
3253 #[doc(hidden)]
3254 impl gax::options::internal::RequestBuilder for UpdateHub {
3255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3256 &mut self.0.options
3257 }
3258 }
3259
3260 #[derive(Clone, Debug)]
3278 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
3279
3280 impl DeleteHub {
3281 pub(crate) fn new(
3282 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3283 ) -> Self {
3284 Self(RequestBuilder::new(stub))
3285 }
3286
3287 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
3289 self.0.request = v.into();
3290 self
3291 }
3292
3293 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3295 self.0.options = v.into();
3296 self
3297 }
3298
3299 pub async fn send(self) -> Result<longrunning::model::Operation> {
3306 (*self.0.stub)
3307 .delete_hub(self.0.request, self.0.options)
3308 .await
3309 .map(gax::response::Response::into_body)
3310 }
3311
3312 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3314 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3315 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3316 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3317
3318 let stub = self.0.stub.clone();
3319 let mut options = self.0.options.clone();
3320 options.set_retry_policy(gax::retry_policy::NeverRetry);
3321 let query = move |name| {
3322 let stub = stub.clone();
3323 let options = options.clone();
3324 async {
3325 let op = GetOperation::new(stub)
3326 .set_name(name)
3327 .with_options(options)
3328 .send()
3329 .await?;
3330 Ok(Operation::new(op))
3331 }
3332 };
3333
3334 let start = move || async {
3335 let op = self.send().await?;
3336 Ok(Operation::new(op))
3337 };
3338
3339 lro::internal::new_unit_response_poller(
3340 polling_error_policy,
3341 polling_backoff_policy,
3342 start,
3343 query,
3344 )
3345 }
3346
3347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3351 self.0.request.name = v.into();
3352 self
3353 }
3354
3355 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3357 self.0.request.request_id = v.into();
3358 self
3359 }
3360 }
3361
3362 #[doc(hidden)]
3363 impl gax::options::internal::RequestBuilder for DeleteHub {
3364 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3365 &mut self.0.options
3366 }
3367 }
3368
3369 #[derive(Clone, Debug)]
3390 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
3391
3392 impl ListHubSpokes {
3393 pub(crate) fn new(
3394 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3395 ) -> Self {
3396 Self(RequestBuilder::new(stub))
3397 }
3398
3399 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
3401 self.0.request = v.into();
3402 self
3403 }
3404
3405 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3407 self.0.options = v.into();
3408 self
3409 }
3410
3411 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
3413 (*self.0.stub)
3414 .list_hub_spokes(self.0.request, self.0.options)
3415 .await
3416 .map(gax::response::Response::into_body)
3417 }
3418
3419 pub fn by_page(
3421 self,
3422 ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
3423 {
3424 use std::clone::Clone;
3425 let token = self.0.request.page_token.clone();
3426 let execute = move |token: String| {
3427 let mut builder = self.clone();
3428 builder.0.request = builder.0.request.set_page_token(token);
3429 builder.send()
3430 };
3431 gax::paginator::internal::new_paginator(token, execute)
3432 }
3433
3434 pub fn by_item(
3436 self,
3437 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubSpokesResponse, gax::error::Error>
3438 {
3439 use gax::paginator::Paginator;
3440 self.by_page().items()
3441 }
3442
3443 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3447 self.0.request.name = v.into();
3448 self
3449 }
3450
3451 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
3453 where
3454 T: std::iter::IntoIterator<Item = V>,
3455 V: std::convert::Into<std::string::String>,
3456 {
3457 use std::iter::Iterator;
3458 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
3459 self
3460 }
3461
3462 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3464 self.0.request.page_size = v.into();
3465 self
3466 }
3467
3468 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3470 self.0.request.page_token = v.into();
3471 self
3472 }
3473
3474 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3476 self.0.request.filter = v.into();
3477 self
3478 }
3479
3480 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3482 self.0.request.order_by = v.into();
3483 self
3484 }
3485
3486 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
3488 mut self,
3489 v: T,
3490 ) -> Self {
3491 self.0.request.view = v.into();
3492 self
3493 }
3494 }
3495
3496 #[doc(hidden)]
3497 impl gax::options::internal::RequestBuilder for ListHubSpokes {
3498 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3499 &mut self.0.options
3500 }
3501 }
3502
3503 #[derive(Clone, Debug)]
3524 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
3525
3526 impl QueryHubStatus {
3527 pub(crate) fn new(
3528 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3529 ) -> Self {
3530 Self(RequestBuilder::new(stub))
3531 }
3532
3533 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
3535 self.0.request = v.into();
3536 self
3537 }
3538
3539 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3541 self.0.options = v.into();
3542 self
3543 }
3544
3545 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
3547 (*self.0.stub)
3548 .query_hub_status(self.0.request, self.0.options)
3549 .await
3550 .map(gax::response::Response::into_body)
3551 }
3552
3553 pub fn by_page(
3555 self,
3556 ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
3557 {
3558 use std::clone::Clone;
3559 let token = self.0.request.page_token.clone();
3560 let execute = move |token: String| {
3561 let mut builder = self.clone();
3562 builder.0.request = builder.0.request.set_page_token(token);
3563 builder.send()
3564 };
3565 gax::paginator::internal::new_paginator(token, execute)
3566 }
3567
3568 pub fn by_item(
3570 self,
3571 ) -> impl gax::paginator::ItemPaginator<crate::model::QueryHubStatusResponse, gax::error::Error>
3572 {
3573 use gax::paginator::Paginator;
3574 self.by_page().items()
3575 }
3576
3577 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3581 self.0.request.name = v.into();
3582 self
3583 }
3584
3585 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3587 self.0.request.page_size = v.into();
3588 self
3589 }
3590
3591 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3593 self.0.request.page_token = v.into();
3594 self
3595 }
3596
3597 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3599 self.0.request.filter = v.into();
3600 self
3601 }
3602
3603 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3605 self.0.request.order_by = v.into();
3606 self
3607 }
3608
3609 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3611 self.0.request.group_by = v.into();
3612 self
3613 }
3614 }
3615
3616 #[doc(hidden)]
3617 impl gax::options::internal::RequestBuilder for QueryHubStatus {
3618 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3619 &mut self.0.options
3620 }
3621 }
3622
3623 #[derive(Clone, Debug)]
3644 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
3645
3646 impl ListSpokes {
3647 pub(crate) fn new(
3648 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3649 ) -> Self {
3650 Self(RequestBuilder::new(stub))
3651 }
3652
3653 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
3655 self.0.request = v.into();
3656 self
3657 }
3658
3659 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3661 self.0.options = v.into();
3662 self
3663 }
3664
3665 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
3667 (*self.0.stub)
3668 .list_spokes(self.0.request, self.0.options)
3669 .await
3670 .map(gax::response::Response::into_body)
3671 }
3672
3673 pub fn by_page(
3675 self,
3676 ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
3677 {
3678 use std::clone::Clone;
3679 let token = self.0.request.page_token.clone();
3680 let execute = move |token: String| {
3681 let mut builder = self.clone();
3682 builder.0.request = builder.0.request.set_page_token(token);
3683 builder.send()
3684 };
3685 gax::paginator::internal::new_paginator(token, execute)
3686 }
3687
3688 pub fn by_item(
3690 self,
3691 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpokesResponse, gax::error::Error>
3692 {
3693 use gax::paginator::Paginator;
3694 self.by_page().items()
3695 }
3696
3697 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3701 self.0.request.parent = v.into();
3702 self
3703 }
3704
3705 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3707 self.0.request.page_size = v.into();
3708 self
3709 }
3710
3711 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3713 self.0.request.page_token = v.into();
3714 self
3715 }
3716
3717 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3719 self.0.request.filter = v.into();
3720 self
3721 }
3722
3723 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3725 self.0.request.order_by = v.into();
3726 self
3727 }
3728 }
3729
3730 #[doc(hidden)]
3731 impl gax::options::internal::RequestBuilder for ListSpokes {
3732 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3733 &mut self.0.options
3734 }
3735 }
3736
3737 #[derive(Clone, Debug)]
3754 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
3755
3756 impl GetSpoke {
3757 pub(crate) fn new(
3758 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3759 ) -> Self {
3760 Self(RequestBuilder::new(stub))
3761 }
3762
3763 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
3765 self.0.request = v.into();
3766 self
3767 }
3768
3769 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3771 self.0.options = v.into();
3772 self
3773 }
3774
3775 pub async fn send(self) -> Result<crate::model::Spoke> {
3777 (*self.0.stub)
3778 .get_spoke(self.0.request, self.0.options)
3779 .await
3780 .map(gax::response::Response::into_body)
3781 }
3782
3783 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3787 self.0.request.name = v.into();
3788 self
3789 }
3790 }
3791
3792 #[doc(hidden)]
3793 impl gax::options::internal::RequestBuilder for GetSpoke {
3794 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3795 &mut self.0.options
3796 }
3797 }
3798
3799 #[derive(Clone, Debug)]
3817 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
3818
3819 impl CreateSpoke {
3820 pub(crate) fn new(
3821 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3822 ) -> Self {
3823 Self(RequestBuilder::new(stub))
3824 }
3825
3826 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
3828 self.0.request = v.into();
3829 self
3830 }
3831
3832 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3834 self.0.options = v.into();
3835 self
3836 }
3837
3838 pub async fn send(self) -> Result<longrunning::model::Operation> {
3845 (*self.0.stub)
3846 .create_spoke(self.0.request, self.0.options)
3847 .await
3848 .map(gax::response::Response::into_body)
3849 }
3850
3851 pub fn poller(
3853 self,
3854 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
3855 type Operation =
3856 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
3857 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3858 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3859
3860 let stub = self.0.stub.clone();
3861 let mut options = self.0.options.clone();
3862 options.set_retry_policy(gax::retry_policy::NeverRetry);
3863 let query = move |name| {
3864 let stub = stub.clone();
3865 let options = options.clone();
3866 async {
3867 let op = GetOperation::new(stub)
3868 .set_name(name)
3869 .with_options(options)
3870 .send()
3871 .await?;
3872 Ok(Operation::new(op))
3873 }
3874 };
3875
3876 let start = move || async {
3877 let op = self.send().await?;
3878 Ok(Operation::new(op))
3879 };
3880
3881 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3882 }
3883
3884 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3888 self.0.request.parent = v.into();
3889 self
3890 }
3891
3892 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3896 self.0.request.spoke_id = v.into();
3897 self
3898 }
3899
3900 pub fn set_spoke<T: Into<std::option::Option<crate::model::Spoke>>>(
3904 mut self,
3905 v: T,
3906 ) -> Self {
3907 self.0.request.spoke = v.into();
3908 self
3909 }
3910
3911 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3913 self.0.request.request_id = v.into();
3914 self
3915 }
3916 }
3917
3918 #[doc(hidden)]
3919 impl gax::options::internal::RequestBuilder for CreateSpoke {
3920 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3921 &mut self.0.options
3922 }
3923 }
3924
3925 #[derive(Clone, Debug)]
3943 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
3944
3945 impl UpdateSpoke {
3946 pub(crate) fn new(
3947 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3948 ) -> Self {
3949 Self(RequestBuilder::new(stub))
3950 }
3951
3952 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
3954 self.0.request = v.into();
3955 self
3956 }
3957
3958 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3960 self.0.options = v.into();
3961 self
3962 }
3963
3964 pub async fn send(self) -> Result<longrunning::model::Operation> {
3971 (*self.0.stub)
3972 .update_spoke(self.0.request, self.0.options)
3973 .await
3974 .map(gax::response::Response::into_body)
3975 }
3976
3977 pub fn poller(
3979 self,
3980 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
3981 type Operation =
3982 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
3983 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3984 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3985
3986 let stub = self.0.stub.clone();
3987 let mut options = self.0.options.clone();
3988 options.set_retry_policy(gax::retry_policy::NeverRetry);
3989 let query = move |name| {
3990 let stub = stub.clone();
3991 let options = options.clone();
3992 async {
3993 let op = GetOperation::new(stub)
3994 .set_name(name)
3995 .with_options(options)
3996 .send()
3997 .await?;
3998 Ok(Operation::new(op))
3999 }
4000 };
4001
4002 let start = move || async {
4003 let op = self.send().await?;
4004 Ok(Operation::new(op))
4005 };
4006
4007 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4008 }
4009
4010 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
4012 mut self,
4013 v: T,
4014 ) -> Self {
4015 self.0.request.update_mask = v.into();
4016 self
4017 }
4018
4019 pub fn set_spoke<T: Into<std::option::Option<crate::model::Spoke>>>(
4023 mut self,
4024 v: T,
4025 ) -> Self {
4026 self.0.request.spoke = v.into();
4027 self
4028 }
4029
4030 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4032 self.0.request.request_id = v.into();
4033 self
4034 }
4035 }
4036
4037 #[doc(hidden)]
4038 impl gax::options::internal::RequestBuilder for UpdateSpoke {
4039 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4040 &mut self.0.options
4041 }
4042 }
4043
4044 #[derive(Clone, Debug)]
4062 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
4063
4064 impl RejectHubSpoke {
4065 pub(crate) fn new(
4066 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4067 ) -> Self {
4068 Self(RequestBuilder::new(stub))
4069 }
4070
4071 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
4073 self.0.request = v.into();
4074 self
4075 }
4076
4077 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4079 self.0.options = v.into();
4080 self
4081 }
4082
4083 pub async fn send(self) -> Result<longrunning::model::Operation> {
4090 (*self.0.stub)
4091 .reject_hub_spoke(self.0.request, self.0.options)
4092 .await
4093 .map(gax::response::Response::into_body)
4094 }
4095
4096 pub fn poller(
4098 self,
4099 ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
4100 {
4101 type Operation = lro::internal::Operation<
4102 crate::model::RejectHubSpokeResponse,
4103 crate::model::OperationMetadata,
4104 >;
4105 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4106 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4107
4108 let stub = self.0.stub.clone();
4109 let mut options = self.0.options.clone();
4110 options.set_retry_policy(gax::retry_policy::NeverRetry);
4111 let query = move |name| {
4112 let stub = stub.clone();
4113 let options = options.clone();
4114 async {
4115 let op = GetOperation::new(stub)
4116 .set_name(name)
4117 .with_options(options)
4118 .send()
4119 .await?;
4120 Ok(Operation::new(op))
4121 }
4122 };
4123
4124 let start = move || async {
4125 let op = self.send().await?;
4126 Ok(Operation::new(op))
4127 };
4128
4129 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4130 }
4131
4132 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4136 self.0.request.name = v.into();
4137 self
4138 }
4139
4140 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4144 self.0.request.spoke_uri = v.into();
4145 self
4146 }
4147
4148 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4150 self.0.request.request_id = v.into();
4151 self
4152 }
4153
4154 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
4156 self.0.request.details = v.into();
4157 self
4158 }
4159 }
4160
4161 #[doc(hidden)]
4162 impl gax::options::internal::RequestBuilder for RejectHubSpoke {
4163 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4164 &mut self.0.options
4165 }
4166 }
4167
4168 #[derive(Clone, Debug)]
4186 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
4187
4188 impl AcceptHubSpoke {
4189 pub(crate) fn new(
4190 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4191 ) -> Self {
4192 Self(RequestBuilder::new(stub))
4193 }
4194
4195 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
4197 self.0.request = v.into();
4198 self
4199 }
4200
4201 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4203 self.0.options = v.into();
4204 self
4205 }
4206
4207 pub async fn send(self) -> Result<longrunning::model::Operation> {
4214 (*self.0.stub)
4215 .accept_hub_spoke(self.0.request, self.0.options)
4216 .await
4217 .map(gax::response::Response::into_body)
4218 }
4219
4220 pub fn poller(
4222 self,
4223 ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
4224 {
4225 type Operation = lro::internal::Operation<
4226 crate::model::AcceptHubSpokeResponse,
4227 crate::model::OperationMetadata,
4228 >;
4229 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4230 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4231
4232 let stub = self.0.stub.clone();
4233 let mut options = self.0.options.clone();
4234 options.set_retry_policy(gax::retry_policy::NeverRetry);
4235 let query = move |name| {
4236 let stub = stub.clone();
4237 let options = options.clone();
4238 async {
4239 let op = GetOperation::new(stub)
4240 .set_name(name)
4241 .with_options(options)
4242 .send()
4243 .await?;
4244 Ok(Operation::new(op))
4245 }
4246 };
4247
4248 let start = move || async {
4249 let op = self.send().await?;
4250 Ok(Operation::new(op))
4251 };
4252
4253 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4254 }
4255
4256 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4260 self.0.request.name = v.into();
4261 self
4262 }
4263
4264 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4268 self.0.request.spoke_uri = v.into();
4269 self
4270 }
4271
4272 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4274 self.0.request.request_id = v.into();
4275 self
4276 }
4277 }
4278
4279 #[doc(hidden)]
4280 impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
4281 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4282 &mut self.0.options
4283 }
4284 }
4285
4286 #[derive(Clone, Debug)]
4304 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
4305
4306 impl AcceptSpokeUpdate {
4307 pub(crate) fn new(
4308 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4309 ) -> Self {
4310 Self(RequestBuilder::new(stub))
4311 }
4312
4313 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
4315 mut self,
4316 v: V,
4317 ) -> Self {
4318 self.0.request = v.into();
4319 self
4320 }
4321
4322 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4324 self.0.options = v.into();
4325 self
4326 }
4327
4328 pub async fn send(self) -> Result<longrunning::model::Operation> {
4335 (*self.0.stub)
4336 .accept_spoke_update(self.0.request, self.0.options)
4337 .await
4338 .map(gax::response::Response::into_body)
4339 }
4340
4341 pub fn poller(
4343 self,
4344 ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
4345 {
4346 type Operation = lro::internal::Operation<
4347 crate::model::AcceptSpokeUpdateResponse,
4348 crate::model::OperationMetadata,
4349 >;
4350 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4351 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4352
4353 let stub = self.0.stub.clone();
4354 let mut options = self.0.options.clone();
4355 options.set_retry_policy(gax::retry_policy::NeverRetry);
4356 let query = move |name| {
4357 let stub = stub.clone();
4358 let options = options.clone();
4359 async {
4360 let op = GetOperation::new(stub)
4361 .set_name(name)
4362 .with_options(options)
4363 .send()
4364 .await?;
4365 Ok(Operation::new(op))
4366 }
4367 };
4368
4369 let start = move || async {
4370 let op = self.send().await?;
4371 Ok(Operation::new(op))
4372 };
4373
4374 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4375 }
4376
4377 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4381 self.0.request.name = v.into();
4382 self
4383 }
4384
4385 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4389 self.0.request.spoke_uri = v.into();
4390 self
4391 }
4392
4393 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4397 self.0.request.spoke_etag = v.into();
4398 self
4399 }
4400
4401 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4403 self.0.request.request_id = v.into();
4404 self
4405 }
4406 }
4407
4408 #[doc(hidden)]
4409 impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
4410 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4411 &mut self.0.options
4412 }
4413 }
4414
4415 #[derive(Clone, Debug)]
4433 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
4434
4435 impl RejectSpokeUpdate {
4436 pub(crate) fn new(
4437 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4438 ) -> Self {
4439 Self(RequestBuilder::new(stub))
4440 }
4441
4442 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
4444 mut self,
4445 v: V,
4446 ) -> Self {
4447 self.0.request = v.into();
4448 self
4449 }
4450
4451 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4453 self.0.options = v.into();
4454 self
4455 }
4456
4457 pub async fn send(self) -> Result<longrunning::model::Operation> {
4464 (*self.0.stub)
4465 .reject_spoke_update(self.0.request, self.0.options)
4466 .await
4467 .map(gax::response::Response::into_body)
4468 }
4469
4470 pub fn poller(
4472 self,
4473 ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
4474 {
4475 type Operation = lro::internal::Operation<
4476 crate::model::RejectSpokeUpdateResponse,
4477 crate::model::OperationMetadata,
4478 >;
4479 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4480 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4481
4482 let stub = self.0.stub.clone();
4483 let mut options = self.0.options.clone();
4484 options.set_retry_policy(gax::retry_policy::NeverRetry);
4485 let query = move |name| {
4486 let stub = stub.clone();
4487 let options = options.clone();
4488 async {
4489 let op = GetOperation::new(stub)
4490 .set_name(name)
4491 .with_options(options)
4492 .send()
4493 .await?;
4494 Ok(Operation::new(op))
4495 }
4496 };
4497
4498 let start = move || async {
4499 let op = self.send().await?;
4500 Ok(Operation::new(op))
4501 };
4502
4503 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4504 }
4505
4506 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510 self.0.request.name = v.into();
4511 self
4512 }
4513
4514 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4518 self.0.request.spoke_uri = v.into();
4519 self
4520 }
4521
4522 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4526 self.0.request.spoke_etag = v.into();
4527 self
4528 }
4529
4530 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
4532 self.0.request.details = v.into();
4533 self
4534 }
4535
4536 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4538 self.0.request.request_id = v.into();
4539 self
4540 }
4541 }
4542
4543 #[doc(hidden)]
4544 impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
4545 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4546 &mut self.0.options
4547 }
4548 }
4549
4550 #[derive(Clone, Debug)]
4568 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
4569
4570 impl DeleteSpoke {
4571 pub(crate) fn new(
4572 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4573 ) -> Self {
4574 Self(RequestBuilder::new(stub))
4575 }
4576
4577 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
4579 self.0.request = v.into();
4580 self
4581 }
4582
4583 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4585 self.0.options = v.into();
4586 self
4587 }
4588
4589 pub async fn send(self) -> Result<longrunning::model::Operation> {
4596 (*self.0.stub)
4597 .delete_spoke(self.0.request, self.0.options)
4598 .await
4599 .map(gax::response::Response::into_body)
4600 }
4601
4602 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4604 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4605 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4606 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4607
4608 let stub = self.0.stub.clone();
4609 let mut options = self.0.options.clone();
4610 options.set_retry_policy(gax::retry_policy::NeverRetry);
4611 let query = move |name| {
4612 let stub = stub.clone();
4613 let options = options.clone();
4614 async {
4615 let op = GetOperation::new(stub)
4616 .set_name(name)
4617 .with_options(options)
4618 .send()
4619 .await?;
4620 Ok(Operation::new(op))
4621 }
4622 };
4623
4624 let start = move || async {
4625 let op = self.send().await?;
4626 Ok(Operation::new(op))
4627 };
4628
4629 lro::internal::new_unit_response_poller(
4630 polling_error_policy,
4631 polling_backoff_policy,
4632 start,
4633 query,
4634 )
4635 }
4636
4637 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4641 self.0.request.name = v.into();
4642 self
4643 }
4644
4645 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4647 self.0.request.request_id = v.into();
4648 self
4649 }
4650 }
4651
4652 #[doc(hidden)]
4653 impl gax::options::internal::RequestBuilder for DeleteSpoke {
4654 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4655 &mut self.0.options
4656 }
4657 }
4658
4659 #[derive(Clone, Debug)]
4676 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
4677
4678 impl GetRouteTable {
4679 pub(crate) fn new(
4680 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4681 ) -> Self {
4682 Self(RequestBuilder::new(stub))
4683 }
4684
4685 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
4687 self.0.request = v.into();
4688 self
4689 }
4690
4691 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4693 self.0.options = v.into();
4694 self
4695 }
4696
4697 pub async fn send(self) -> Result<crate::model::RouteTable> {
4699 (*self.0.stub)
4700 .get_route_table(self.0.request, self.0.options)
4701 .await
4702 .map(gax::response::Response::into_body)
4703 }
4704
4705 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4709 self.0.request.name = v.into();
4710 self
4711 }
4712 }
4713
4714 #[doc(hidden)]
4715 impl gax::options::internal::RequestBuilder for GetRouteTable {
4716 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4717 &mut self.0.options
4718 }
4719 }
4720
4721 #[derive(Clone, Debug)]
4738 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
4739
4740 impl GetRoute {
4741 pub(crate) fn new(
4742 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4743 ) -> Self {
4744 Self(RequestBuilder::new(stub))
4745 }
4746
4747 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
4749 self.0.request = v.into();
4750 self
4751 }
4752
4753 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4755 self.0.options = v.into();
4756 self
4757 }
4758
4759 pub async fn send(self) -> Result<crate::model::Route> {
4761 (*self.0.stub)
4762 .get_route(self.0.request, self.0.options)
4763 .await
4764 .map(gax::response::Response::into_body)
4765 }
4766
4767 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4771 self.0.request.name = v.into();
4772 self
4773 }
4774 }
4775
4776 #[doc(hidden)]
4777 impl gax::options::internal::RequestBuilder for GetRoute {
4778 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4779 &mut self.0.options
4780 }
4781 }
4782
4783 #[derive(Clone, Debug)]
4804 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
4805
4806 impl ListRoutes {
4807 pub(crate) fn new(
4808 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4809 ) -> Self {
4810 Self(RequestBuilder::new(stub))
4811 }
4812
4813 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
4815 self.0.request = v.into();
4816 self
4817 }
4818
4819 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4821 self.0.options = v.into();
4822 self
4823 }
4824
4825 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
4827 (*self.0.stub)
4828 .list_routes(self.0.request, self.0.options)
4829 .await
4830 .map(gax::response::Response::into_body)
4831 }
4832
4833 pub fn by_page(
4835 self,
4836 ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
4837 {
4838 use std::clone::Clone;
4839 let token = self.0.request.page_token.clone();
4840 let execute = move |token: String| {
4841 let mut builder = self.clone();
4842 builder.0.request = builder.0.request.set_page_token(token);
4843 builder.send()
4844 };
4845 gax::paginator::internal::new_paginator(token, execute)
4846 }
4847
4848 pub fn by_item(
4850 self,
4851 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
4852 {
4853 use gax::paginator::Paginator;
4854 self.by_page().items()
4855 }
4856
4857 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4861 self.0.request.parent = v.into();
4862 self
4863 }
4864
4865 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4867 self.0.request.page_size = v.into();
4868 self
4869 }
4870
4871 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4873 self.0.request.page_token = v.into();
4874 self
4875 }
4876
4877 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4879 self.0.request.filter = v.into();
4880 self
4881 }
4882
4883 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4885 self.0.request.order_by = v.into();
4886 self
4887 }
4888 }
4889
4890 #[doc(hidden)]
4891 impl gax::options::internal::RequestBuilder for ListRoutes {
4892 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4893 &mut self.0.options
4894 }
4895 }
4896
4897 #[derive(Clone, Debug)]
4918 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
4919
4920 impl ListRouteTables {
4921 pub(crate) fn new(
4922 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4923 ) -> Self {
4924 Self(RequestBuilder::new(stub))
4925 }
4926
4927 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
4929 self.0.request = v.into();
4930 self
4931 }
4932
4933 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4935 self.0.options = v.into();
4936 self
4937 }
4938
4939 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
4941 (*self.0.stub)
4942 .list_route_tables(self.0.request, self.0.options)
4943 .await
4944 .map(gax::response::Response::into_body)
4945 }
4946
4947 pub fn by_page(
4949 self,
4950 ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
4951 {
4952 use std::clone::Clone;
4953 let token = self.0.request.page_token.clone();
4954 let execute = move |token: String| {
4955 let mut builder = self.clone();
4956 builder.0.request = builder.0.request.set_page_token(token);
4957 builder.send()
4958 };
4959 gax::paginator::internal::new_paginator(token, execute)
4960 }
4961
4962 pub fn by_item(
4964 self,
4965 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRouteTablesResponse, gax::error::Error>
4966 {
4967 use gax::paginator::Paginator;
4968 self.by_page().items()
4969 }
4970
4971 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4975 self.0.request.parent = v.into();
4976 self
4977 }
4978
4979 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4981 self.0.request.page_size = v.into();
4982 self
4983 }
4984
4985 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4987 self.0.request.page_token = v.into();
4988 self
4989 }
4990
4991 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4993 self.0.request.filter = v.into();
4994 self
4995 }
4996
4997 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4999 self.0.request.order_by = v.into();
5000 self
5001 }
5002 }
5003
5004 #[doc(hidden)]
5005 impl gax::options::internal::RequestBuilder for ListRouteTables {
5006 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5007 &mut self.0.options
5008 }
5009 }
5010
5011 #[derive(Clone, Debug)]
5028 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
5029
5030 impl GetGroup {
5031 pub(crate) fn new(
5032 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5033 ) -> Self {
5034 Self(RequestBuilder::new(stub))
5035 }
5036
5037 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
5039 self.0.request = v.into();
5040 self
5041 }
5042
5043 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5045 self.0.options = v.into();
5046 self
5047 }
5048
5049 pub async fn send(self) -> Result<crate::model::Group> {
5051 (*self.0.stub)
5052 .get_group(self.0.request, self.0.options)
5053 .await
5054 .map(gax::response::Response::into_body)
5055 }
5056
5057 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5061 self.0.request.name = v.into();
5062 self
5063 }
5064 }
5065
5066 #[doc(hidden)]
5067 impl gax::options::internal::RequestBuilder for GetGroup {
5068 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5069 &mut self.0.options
5070 }
5071 }
5072
5073 #[derive(Clone, Debug)]
5094 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
5095
5096 impl ListGroups {
5097 pub(crate) fn new(
5098 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5099 ) -> Self {
5100 Self(RequestBuilder::new(stub))
5101 }
5102
5103 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
5105 self.0.request = v.into();
5106 self
5107 }
5108
5109 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5111 self.0.options = v.into();
5112 self
5113 }
5114
5115 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
5117 (*self.0.stub)
5118 .list_groups(self.0.request, self.0.options)
5119 .await
5120 .map(gax::response::Response::into_body)
5121 }
5122
5123 pub fn by_page(
5125 self,
5126 ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
5127 {
5128 use std::clone::Clone;
5129 let token = self.0.request.page_token.clone();
5130 let execute = move |token: String| {
5131 let mut builder = self.clone();
5132 builder.0.request = builder.0.request.set_page_token(token);
5133 builder.send()
5134 };
5135 gax::paginator::internal::new_paginator(token, execute)
5136 }
5137
5138 pub fn by_item(
5140 self,
5141 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGroupsResponse, gax::error::Error>
5142 {
5143 use gax::paginator::Paginator;
5144 self.by_page().items()
5145 }
5146
5147 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5151 self.0.request.parent = v.into();
5152 self
5153 }
5154
5155 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5157 self.0.request.page_size = v.into();
5158 self
5159 }
5160
5161 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5163 self.0.request.page_token = v.into();
5164 self
5165 }
5166
5167 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5169 self.0.request.filter = v.into();
5170 self
5171 }
5172
5173 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5175 self.0.request.order_by = v.into();
5176 self
5177 }
5178 }
5179
5180 #[doc(hidden)]
5181 impl gax::options::internal::RequestBuilder for ListGroups {
5182 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5183 &mut self.0.options
5184 }
5185 }
5186
5187 #[derive(Clone, Debug)]
5205 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
5206
5207 impl UpdateGroup {
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::UpdateGroupRequest>>(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<longrunning::model::Operation> {
5233 (*self.0.stub)
5234 .update_group(self.0.request, self.0.options)
5235 .await
5236 .map(gax::response::Response::into_body)
5237 }
5238
5239 pub fn poller(
5241 self,
5242 ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
5243 type Operation =
5244 lro::internal::Operation<crate::model::Group, crate::model::OperationMetadata>;
5245 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5246 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5247
5248 let stub = self.0.stub.clone();
5249 let mut options = self.0.options.clone();
5250 options.set_retry_policy(gax::retry_policy::NeverRetry);
5251 let query = move |name| {
5252 let stub = stub.clone();
5253 let options = options.clone();
5254 async {
5255 let op = GetOperation::new(stub)
5256 .set_name(name)
5257 .with_options(options)
5258 .send()
5259 .await?;
5260 Ok(Operation::new(op))
5261 }
5262 };
5263
5264 let start = move || async {
5265 let op = self.send().await?;
5266 Ok(Operation::new(op))
5267 };
5268
5269 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5270 }
5271
5272 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
5274 mut self,
5275 v: T,
5276 ) -> Self {
5277 self.0.request.update_mask = v.into();
5278 self
5279 }
5280
5281 pub fn set_group<T: Into<std::option::Option<crate::model::Group>>>(
5285 mut self,
5286 v: T,
5287 ) -> Self {
5288 self.0.request.group = v.into();
5289 self
5290 }
5291
5292 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5294 self.0.request.request_id = v.into();
5295 self
5296 }
5297 }
5298
5299 #[doc(hidden)]
5300 impl gax::options::internal::RequestBuilder for UpdateGroup {
5301 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5302 &mut self.0.options
5303 }
5304 }
5305
5306 #[derive(Clone, Debug)]
5327 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5328
5329 impl ListLocations {
5330 pub(crate) fn new(
5331 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5332 ) -> Self {
5333 Self(RequestBuilder::new(stub))
5334 }
5335
5336 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5338 mut self,
5339 v: V,
5340 ) -> Self {
5341 self.0.request = v.into();
5342 self
5343 }
5344
5345 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5347 self.0.options = v.into();
5348 self
5349 }
5350
5351 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5353 (*self.0.stub)
5354 .list_locations(self.0.request, self.0.options)
5355 .await
5356 .map(gax::response::Response::into_body)
5357 }
5358
5359 pub fn by_page(
5361 self,
5362 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5363 {
5364 use std::clone::Clone;
5365 let token = self.0.request.page_token.clone();
5366 let execute = move |token: String| {
5367 let mut builder = self.clone();
5368 builder.0.request = builder.0.request.set_page_token(token);
5369 builder.send()
5370 };
5371 gax::paginator::internal::new_paginator(token, execute)
5372 }
5373
5374 pub fn by_item(
5376 self,
5377 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5378 {
5379 use gax::paginator::Paginator;
5380 self.by_page().items()
5381 }
5382
5383 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5385 self.0.request.name = v.into();
5386 self
5387 }
5388
5389 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5391 self.0.request.filter = v.into();
5392 self
5393 }
5394
5395 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5397 self.0.request.page_size = v.into();
5398 self
5399 }
5400
5401 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5403 self.0.request.page_token = v.into();
5404 self
5405 }
5406 }
5407
5408 #[doc(hidden)]
5409 impl gax::options::internal::RequestBuilder for ListLocations {
5410 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5411 &mut self.0.options
5412 }
5413 }
5414
5415 #[derive(Clone, Debug)]
5432 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5433
5434 impl GetLocation {
5435 pub(crate) fn new(
5436 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5437 ) -> Self {
5438 Self(RequestBuilder::new(stub))
5439 }
5440
5441 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5443 self.0.request = v.into();
5444 self
5445 }
5446
5447 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5449 self.0.options = v.into();
5450 self
5451 }
5452
5453 pub async fn send(self) -> Result<location::model::Location> {
5455 (*self.0.stub)
5456 .get_location(self.0.request, self.0.options)
5457 .await
5458 .map(gax::response::Response::into_body)
5459 }
5460
5461 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5463 self.0.request.name = v.into();
5464 self
5465 }
5466 }
5467
5468 #[doc(hidden)]
5469 impl gax::options::internal::RequestBuilder for GetLocation {
5470 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5471 &mut self.0.options
5472 }
5473 }
5474
5475 #[derive(Clone, Debug)]
5492 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5493
5494 impl SetIamPolicy {
5495 pub(crate) fn new(
5496 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5497 ) -> Self {
5498 Self(RequestBuilder::new(stub))
5499 }
5500
5501 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5503 self.0.request = v.into();
5504 self
5505 }
5506
5507 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5509 self.0.options = v.into();
5510 self
5511 }
5512
5513 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5515 (*self.0.stub)
5516 .set_iam_policy(self.0.request, self.0.options)
5517 .await
5518 .map(gax::response::Response::into_body)
5519 }
5520
5521 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5525 self.0.request.resource = v.into();
5526 self
5527 }
5528
5529 pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
5533 mut self,
5534 v: T,
5535 ) -> Self {
5536 self.0.request.policy = v.into();
5537 self
5538 }
5539
5540 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
5542 mut self,
5543 v: T,
5544 ) -> Self {
5545 self.0.request.update_mask = v.into();
5546 self
5547 }
5548 }
5549
5550 #[doc(hidden)]
5551 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5552 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5553 &mut self.0.options
5554 }
5555 }
5556
5557 #[derive(Clone, Debug)]
5574 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5575
5576 impl GetIamPolicy {
5577 pub(crate) fn new(
5578 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5579 ) -> Self {
5580 Self(RequestBuilder::new(stub))
5581 }
5582
5583 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5585 self.0.request = v.into();
5586 self
5587 }
5588
5589 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5591 self.0.options = v.into();
5592 self
5593 }
5594
5595 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5597 (*self.0.stub)
5598 .get_iam_policy(self.0.request, self.0.options)
5599 .await
5600 .map(gax::response::Response::into_body)
5601 }
5602
5603 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5607 self.0.request.resource = v.into();
5608 self
5609 }
5610
5611 pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
5613 mut self,
5614 v: T,
5615 ) -> Self {
5616 self.0.request.options = v.into();
5617 self
5618 }
5619 }
5620
5621 #[doc(hidden)]
5622 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5623 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5624 &mut self.0.options
5625 }
5626 }
5627
5628 #[derive(Clone, Debug)]
5645 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5646
5647 impl TestIamPermissions {
5648 pub(crate) fn new(
5649 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5650 ) -> Self {
5651 Self(RequestBuilder::new(stub))
5652 }
5653
5654 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5656 mut self,
5657 v: V,
5658 ) -> Self {
5659 self.0.request = v.into();
5660 self
5661 }
5662
5663 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5665 self.0.options = v.into();
5666 self
5667 }
5668
5669 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5671 (*self.0.stub)
5672 .test_iam_permissions(self.0.request, self.0.options)
5673 .await
5674 .map(gax::response::Response::into_body)
5675 }
5676
5677 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5681 self.0.request.resource = v.into();
5682 self
5683 }
5684
5685 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5689 where
5690 T: std::iter::IntoIterator<Item = V>,
5691 V: std::convert::Into<std::string::String>,
5692 {
5693 use std::iter::Iterator;
5694 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5695 self
5696 }
5697 }
5698
5699 #[doc(hidden)]
5700 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5701 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5702 &mut self.0.options
5703 }
5704 }
5705
5706 #[derive(Clone, Debug)]
5727 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5728
5729 impl ListOperations {
5730 pub(crate) fn new(
5731 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5732 ) -> Self {
5733 Self(RequestBuilder::new(stub))
5734 }
5735
5736 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5738 mut self,
5739 v: V,
5740 ) -> Self {
5741 self.0.request = v.into();
5742 self
5743 }
5744
5745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5747 self.0.options = v.into();
5748 self
5749 }
5750
5751 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5753 (*self.0.stub)
5754 .list_operations(self.0.request, self.0.options)
5755 .await
5756 .map(gax::response::Response::into_body)
5757 }
5758
5759 pub fn by_page(
5761 self,
5762 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5763 {
5764 use std::clone::Clone;
5765 let token = self.0.request.page_token.clone();
5766 let execute = move |token: String| {
5767 let mut builder = self.clone();
5768 builder.0.request = builder.0.request.set_page_token(token);
5769 builder.send()
5770 };
5771 gax::paginator::internal::new_paginator(token, execute)
5772 }
5773
5774 pub fn by_item(
5776 self,
5777 ) -> impl gax::paginator::ItemPaginator<
5778 longrunning::model::ListOperationsResponse,
5779 gax::error::Error,
5780 > {
5781 use gax::paginator::Paginator;
5782 self.by_page().items()
5783 }
5784
5785 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5787 self.0.request.name = v.into();
5788 self
5789 }
5790
5791 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5793 self.0.request.filter = v.into();
5794 self
5795 }
5796
5797 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5799 self.0.request.page_size = v.into();
5800 self
5801 }
5802
5803 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5805 self.0.request.page_token = v.into();
5806 self
5807 }
5808 }
5809
5810 #[doc(hidden)]
5811 impl gax::options::internal::RequestBuilder for ListOperations {
5812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5813 &mut self.0.options
5814 }
5815 }
5816
5817 #[derive(Clone, Debug)]
5834 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5835
5836 impl GetOperation {
5837 pub(crate) fn new(
5838 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5839 ) -> Self {
5840 Self(RequestBuilder::new(stub))
5841 }
5842
5843 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5845 mut self,
5846 v: V,
5847 ) -> Self {
5848 self.0.request = v.into();
5849 self
5850 }
5851
5852 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5854 self.0.options = v.into();
5855 self
5856 }
5857
5858 pub async fn send(self) -> Result<longrunning::model::Operation> {
5860 (*self.0.stub)
5861 .get_operation(self.0.request, self.0.options)
5862 .await
5863 .map(gax::response::Response::into_body)
5864 }
5865
5866 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5868 self.0.request.name = v.into();
5869 self
5870 }
5871 }
5872
5873 #[doc(hidden)]
5874 impl gax::options::internal::RequestBuilder for GetOperation {
5875 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5876 &mut self.0.options
5877 }
5878 }
5879
5880 #[derive(Clone, Debug)]
5897 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5898
5899 impl DeleteOperation {
5900 pub(crate) fn new(
5901 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5902 ) -> Self {
5903 Self(RequestBuilder::new(stub))
5904 }
5905
5906 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5908 mut self,
5909 v: V,
5910 ) -> Self {
5911 self.0.request = v.into();
5912 self
5913 }
5914
5915 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5917 self.0.options = v.into();
5918 self
5919 }
5920
5921 pub async fn send(self) -> Result<()> {
5923 (*self.0.stub)
5924 .delete_operation(self.0.request, self.0.options)
5925 .await
5926 .map(gax::response::Response::into_body)
5927 }
5928
5929 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5931 self.0.request.name = v.into();
5932 self
5933 }
5934 }
5935
5936 #[doc(hidden)]
5937 impl gax::options::internal::RequestBuilder for DeleteOperation {
5938 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5939 &mut self.0.options
5940 }
5941 }
5942
5943 #[derive(Clone, Debug)]
5960 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5961
5962 impl CancelOperation {
5963 pub(crate) fn new(
5964 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5965 ) -> Self {
5966 Self(RequestBuilder::new(stub))
5967 }
5968
5969 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5971 mut self,
5972 v: V,
5973 ) -> Self {
5974 self.0.request = v.into();
5975 self
5976 }
5977
5978 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5980 self.0.options = v.into();
5981 self
5982 }
5983
5984 pub async fn send(self) -> Result<()> {
5986 (*self.0.stub)
5987 .cancel_operation(self.0.request, self.0.options)
5988 .await
5989 .map(gax::response::Response::into_body)
5990 }
5991
5992 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5994 self.0.request.name = v.into();
5995 self
5996 }
5997 }
5998
5999 #[doc(hidden)]
6000 impl gax::options::internal::RequestBuilder for CancelOperation {
6001 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6002 &mut self.0.options
6003 }
6004 }
6005}
6006
6007pub mod policy_based_routing_service {
6008 use crate::Result;
6009
6010 pub type ClientBuilder =
6024 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6025
6026 pub(crate) mod client {
6027 use super::super::super::client::PolicyBasedRoutingService;
6028 pub struct Factory;
6029 impl gax::client_builder::internal::ClientFactory for Factory {
6030 type Client = PolicyBasedRoutingService;
6031 type Credentials = gaxi::options::Credentials;
6032 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
6033 Self::Client::new(config).await
6034 }
6035 }
6036 }
6037
6038 #[derive(Clone, Debug)]
6040 pub(crate) struct RequestBuilder<R: std::default::Default> {
6041 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6042 request: R,
6043 options: gax::options::RequestOptions,
6044 }
6045
6046 impl<R> RequestBuilder<R>
6047 where
6048 R: std::default::Default,
6049 {
6050 pub(crate) fn new(
6051 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6052 ) -> Self {
6053 Self {
6054 stub,
6055 request: R::default(),
6056 options: gax::options::RequestOptions::default(),
6057 }
6058 }
6059 }
6060
6061 #[derive(Clone, Debug)]
6082 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
6083
6084 impl ListPolicyBasedRoutes {
6085 pub(crate) fn new(
6086 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6087 ) -> Self {
6088 Self(RequestBuilder::new(stub))
6089 }
6090
6091 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
6093 mut self,
6094 v: V,
6095 ) -> Self {
6096 self.0.request = v.into();
6097 self
6098 }
6099
6100 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6102 self.0.options = v.into();
6103 self
6104 }
6105
6106 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
6108 (*self.0.stub)
6109 .list_policy_based_routes(self.0.request, self.0.options)
6110 .await
6111 .map(gax::response::Response::into_body)
6112 }
6113
6114 pub fn by_page(
6116 self,
6117 ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
6118 {
6119 use std::clone::Clone;
6120 let token = self.0.request.page_token.clone();
6121 let execute = move |token: String| {
6122 let mut builder = self.clone();
6123 builder.0.request = builder.0.request.set_page_token(token);
6124 builder.send()
6125 };
6126 gax::paginator::internal::new_paginator(token, execute)
6127 }
6128
6129 pub fn by_item(
6131 self,
6132 ) -> impl gax::paginator::ItemPaginator<
6133 crate::model::ListPolicyBasedRoutesResponse,
6134 gax::error::Error,
6135 > {
6136 use gax::paginator::Paginator;
6137 self.by_page().items()
6138 }
6139
6140 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6144 self.0.request.parent = v.into();
6145 self
6146 }
6147
6148 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6150 self.0.request.page_size = v.into();
6151 self
6152 }
6153
6154 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6156 self.0.request.page_token = v.into();
6157 self
6158 }
6159
6160 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6162 self.0.request.filter = v.into();
6163 self
6164 }
6165
6166 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6168 self.0.request.order_by = v.into();
6169 self
6170 }
6171 }
6172
6173 #[doc(hidden)]
6174 impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
6175 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6176 &mut self.0.options
6177 }
6178 }
6179
6180 #[derive(Clone, Debug)]
6197 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
6198
6199 impl GetPolicyBasedRoute {
6200 pub(crate) fn new(
6201 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6202 ) -> Self {
6203 Self(RequestBuilder::new(stub))
6204 }
6205
6206 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
6208 mut self,
6209 v: V,
6210 ) -> Self {
6211 self.0.request = v.into();
6212 self
6213 }
6214
6215 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6217 self.0.options = v.into();
6218 self
6219 }
6220
6221 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
6223 (*self.0.stub)
6224 .get_policy_based_route(self.0.request, self.0.options)
6225 .await
6226 .map(gax::response::Response::into_body)
6227 }
6228
6229 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6233 self.0.request.name = v.into();
6234 self
6235 }
6236 }
6237
6238 #[doc(hidden)]
6239 impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
6240 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6241 &mut self.0.options
6242 }
6243 }
6244
6245 #[derive(Clone, Debug)]
6263 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
6264
6265 impl CreatePolicyBasedRoute {
6266 pub(crate) fn new(
6267 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6268 ) -> Self {
6269 Self(RequestBuilder::new(stub))
6270 }
6271
6272 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
6274 mut self,
6275 v: V,
6276 ) -> Self {
6277 self.0.request = v.into();
6278 self
6279 }
6280
6281 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6283 self.0.options = v.into();
6284 self
6285 }
6286
6287 pub async fn send(self) -> Result<longrunning::model::Operation> {
6294 (*self.0.stub)
6295 .create_policy_based_route(self.0.request, self.0.options)
6296 .await
6297 .map(gax::response::Response::into_body)
6298 }
6299
6300 pub fn poller(
6302 self,
6303 ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
6304 {
6305 type Operation = lro::internal::Operation<
6306 crate::model::PolicyBasedRoute,
6307 crate::model::OperationMetadata,
6308 >;
6309 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6310 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6311
6312 let stub = self.0.stub.clone();
6313 let mut options = self.0.options.clone();
6314 options.set_retry_policy(gax::retry_policy::NeverRetry);
6315 let query = move |name| {
6316 let stub = stub.clone();
6317 let options = options.clone();
6318 async {
6319 let op = GetOperation::new(stub)
6320 .set_name(name)
6321 .with_options(options)
6322 .send()
6323 .await?;
6324 Ok(Operation::new(op))
6325 }
6326 };
6327
6328 let start = move || async {
6329 let op = self.send().await?;
6330 Ok(Operation::new(op))
6331 };
6332
6333 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6334 }
6335
6336 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6340 self.0.request.parent = v.into();
6341 self
6342 }
6343
6344 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6348 self.0.request.policy_based_route_id = v.into();
6349 self
6350 }
6351
6352 pub fn set_policy_based_route<
6356 T: Into<std::option::Option<crate::model::PolicyBasedRoute>>,
6357 >(
6358 mut self,
6359 v: T,
6360 ) -> Self {
6361 self.0.request.policy_based_route = v.into();
6362 self
6363 }
6364
6365 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6367 self.0.request.request_id = v.into();
6368 self
6369 }
6370 }
6371
6372 #[doc(hidden)]
6373 impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
6374 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6375 &mut self.0.options
6376 }
6377 }
6378
6379 #[derive(Clone, Debug)]
6397 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
6398
6399 impl DeletePolicyBasedRoute {
6400 pub(crate) fn new(
6401 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6402 ) -> Self {
6403 Self(RequestBuilder::new(stub))
6404 }
6405
6406 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
6408 mut self,
6409 v: V,
6410 ) -> Self {
6411 self.0.request = v.into();
6412 self
6413 }
6414
6415 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6417 self.0.options = v.into();
6418 self
6419 }
6420
6421 pub async fn send(self) -> Result<longrunning::model::Operation> {
6428 (*self.0.stub)
6429 .delete_policy_based_route(self.0.request, self.0.options)
6430 .await
6431 .map(gax::response::Response::into_body)
6432 }
6433
6434 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
6436 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6437 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6438 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6439
6440 let stub = self.0.stub.clone();
6441 let mut options = self.0.options.clone();
6442 options.set_retry_policy(gax::retry_policy::NeverRetry);
6443 let query = move |name| {
6444 let stub = stub.clone();
6445 let options = options.clone();
6446 async {
6447 let op = GetOperation::new(stub)
6448 .set_name(name)
6449 .with_options(options)
6450 .send()
6451 .await?;
6452 Ok(Operation::new(op))
6453 }
6454 };
6455
6456 let start = move || async {
6457 let op = self.send().await?;
6458 Ok(Operation::new(op))
6459 };
6460
6461 lro::internal::new_unit_response_poller(
6462 polling_error_policy,
6463 polling_backoff_policy,
6464 start,
6465 query,
6466 )
6467 }
6468
6469 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6473 self.0.request.name = v.into();
6474 self
6475 }
6476
6477 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6479 self.0.request.request_id = v.into();
6480 self
6481 }
6482 }
6483
6484 #[doc(hidden)]
6485 impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
6486 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6487 &mut self.0.options
6488 }
6489 }
6490
6491 #[derive(Clone, Debug)]
6512 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
6513
6514 impl ListLocations {
6515 pub(crate) fn new(
6516 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6517 ) -> Self {
6518 Self(RequestBuilder::new(stub))
6519 }
6520
6521 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
6523 mut self,
6524 v: V,
6525 ) -> Self {
6526 self.0.request = v.into();
6527 self
6528 }
6529
6530 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6532 self.0.options = v.into();
6533 self
6534 }
6535
6536 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
6538 (*self.0.stub)
6539 .list_locations(self.0.request, self.0.options)
6540 .await
6541 .map(gax::response::Response::into_body)
6542 }
6543
6544 pub fn by_page(
6546 self,
6547 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
6548 {
6549 use std::clone::Clone;
6550 let token = self.0.request.page_token.clone();
6551 let execute = move |token: String| {
6552 let mut builder = self.clone();
6553 builder.0.request = builder.0.request.set_page_token(token);
6554 builder.send()
6555 };
6556 gax::paginator::internal::new_paginator(token, execute)
6557 }
6558
6559 pub fn by_item(
6561 self,
6562 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
6563 {
6564 use gax::paginator::Paginator;
6565 self.by_page().items()
6566 }
6567
6568 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6570 self.0.request.name = v.into();
6571 self
6572 }
6573
6574 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6576 self.0.request.filter = v.into();
6577 self
6578 }
6579
6580 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6582 self.0.request.page_size = v.into();
6583 self
6584 }
6585
6586 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6588 self.0.request.page_token = v.into();
6589 self
6590 }
6591 }
6592
6593 #[doc(hidden)]
6594 impl gax::options::internal::RequestBuilder for ListLocations {
6595 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6596 &mut self.0.options
6597 }
6598 }
6599
6600 #[derive(Clone, Debug)]
6617 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
6618
6619 impl GetLocation {
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<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6628 self.0.request = v.into();
6629 self
6630 }
6631
6632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6634 self.0.options = v.into();
6635 self
6636 }
6637
6638 pub async fn send(self) -> Result<location::model::Location> {
6640 (*self.0.stub)
6641 .get_location(self.0.request, self.0.options)
6642 .await
6643 .map(gax::response::Response::into_body)
6644 }
6645
6646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6648 self.0.request.name = v.into();
6649 self
6650 }
6651 }
6652
6653 #[doc(hidden)]
6654 impl gax::options::internal::RequestBuilder for GetLocation {
6655 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6656 &mut self.0.options
6657 }
6658 }
6659
6660 #[derive(Clone, Debug)]
6677 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
6678
6679 impl SetIamPolicy {
6680 pub(crate) fn new(
6681 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6682 ) -> Self {
6683 Self(RequestBuilder::new(stub))
6684 }
6685
6686 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
6688 self.0.request = v.into();
6689 self
6690 }
6691
6692 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6694 self.0.options = v.into();
6695 self
6696 }
6697
6698 pub async fn send(self) -> Result<iam_v1::model::Policy> {
6700 (*self.0.stub)
6701 .set_iam_policy(self.0.request, self.0.options)
6702 .await
6703 .map(gax::response::Response::into_body)
6704 }
6705
6706 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6710 self.0.request.resource = v.into();
6711 self
6712 }
6713
6714 pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
6718 mut self,
6719 v: T,
6720 ) -> Self {
6721 self.0.request.policy = v.into();
6722 self
6723 }
6724
6725 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
6727 mut self,
6728 v: T,
6729 ) -> Self {
6730 self.0.request.update_mask = v.into();
6731 self
6732 }
6733 }
6734
6735 #[doc(hidden)]
6736 impl gax::options::internal::RequestBuilder for SetIamPolicy {
6737 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6738 &mut self.0.options
6739 }
6740 }
6741
6742 #[derive(Clone, Debug)]
6759 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
6760
6761 impl GetIamPolicy {
6762 pub(crate) fn new(
6763 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6764 ) -> Self {
6765 Self(RequestBuilder::new(stub))
6766 }
6767
6768 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
6770 self.0.request = v.into();
6771 self
6772 }
6773
6774 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6776 self.0.options = v.into();
6777 self
6778 }
6779
6780 pub async fn send(self) -> Result<iam_v1::model::Policy> {
6782 (*self.0.stub)
6783 .get_iam_policy(self.0.request, self.0.options)
6784 .await
6785 .map(gax::response::Response::into_body)
6786 }
6787
6788 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6792 self.0.request.resource = v.into();
6793 self
6794 }
6795
6796 pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
6798 mut self,
6799 v: T,
6800 ) -> Self {
6801 self.0.request.options = v.into();
6802 self
6803 }
6804 }
6805
6806 #[doc(hidden)]
6807 impl gax::options::internal::RequestBuilder for GetIamPolicy {
6808 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6809 &mut self.0.options
6810 }
6811 }
6812
6813 #[derive(Clone, Debug)]
6830 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
6831
6832 impl TestIamPermissions {
6833 pub(crate) fn new(
6834 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6835 ) -> Self {
6836 Self(RequestBuilder::new(stub))
6837 }
6838
6839 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
6841 mut self,
6842 v: V,
6843 ) -> Self {
6844 self.0.request = v.into();
6845 self
6846 }
6847
6848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6850 self.0.options = v.into();
6851 self
6852 }
6853
6854 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
6856 (*self.0.stub)
6857 .test_iam_permissions(self.0.request, self.0.options)
6858 .await
6859 .map(gax::response::Response::into_body)
6860 }
6861
6862 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6866 self.0.request.resource = v.into();
6867 self
6868 }
6869
6870 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6874 where
6875 T: std::iter::IntoIterator<Item = V>,
6876 V: std::convert::Into<std::string::String>,
6877 {
6878 use std::iter::Iterator;
6879 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6880 self
6881 }
6882 }
6883
6884 #[doc(hidden)]
6885 impl gax::options::internal::RequestBuilder for TestIamPermissions {
6886 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6887 &mut self.0.options
6888 }
6889 }
6890
6891 #[derive(Clone, Debug)]
6912 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6913
6914 impl ListOperations {
6915 pub(crate) fn new(
6916 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
6917 ) -> Self {
6918 Self(RequestBuilder::new(stub))
6919 }
6920
6921 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6923 mut self,
6924 v: V,
6925 ) -> Self {
6926 self.0.request = v.into();
6927 self
6928 }
6929
6930 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6932 self.0.options = v.into();
6933 self
6934 }
6935
6936 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6938 (*self.0.stub)
6939 .list_operations(self.0.request, self.0.options)
6940 .await
6941 .map(gax::response::Response::into_body)
6942 }
6943
6944 pub fn by_page(
6946 self,
6947 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6948 {
6949 use std::clone::Clone;
6950 let token = self.0.request.page_token.clone();
6951 let execute = move |token: String| {
6952 let mut builder = self.clone();
6953 builder.0.request = builder.0.request.set_page_token(token);
6954 builder.send()
6955 };
6956 gax::paginator::internal::new_paginator(token, execute)
6957 }
6958
6959 pub fn by_item(
6961 self,
6962 ) -> impl gax::paginator::ItemPaginator<
6963 longrunning::model::ListOperationsResponse,
6964 gax::error::Error,
6965 > {
6966 use gax::paginator::Paginator;
6967 self.by_page().items()
6968 }
6969
6970 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6972 self.0.request.name = v.into();
6973 self
6974 }
6975
6976 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6978 self.0.request.filter = v.into();
6979 self
6980 }
6981
6982 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6984 self.0.request.page_size = v.into();
6985 self
6986 }
6987
6988 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6990 self.0.request.page_token = v.into();
6991 self
6992 }
6993 }
6994
6995 #[doc(hidden)]
6996 impl gax::options::internal::RequestBuilder for ListOperations {
6997 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6998 &mut self.0.options
6999 }
7000 }
7001
7002 #[derive(Clone, Debug)]
7019 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7020
7021 impl GetOperation {
7022 pub(crate) fn new(
7023 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7024 ) -> Self {
7025 Self(RequestBuilder::new(stub))
7026 }
7027
7028 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7030 mut self,
7031 v: V,
7032 ) -> Self {
7033 self.0.request = v.into();
7034 self
7035 }
7036
7037 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7039 self.0.options = v.into();
7040 self
7041 }
7042
7043 pub async fn send(self) -> Result<longrunning::model::Operation> {
7045 (*self.0.stub)
7046 .get_operation(self.0.request, self.0.options)
7047 .await
7048 .map(gax::response::Response::into_body)
7049 }
7050
7051 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7053 self.0.request.name = v.into();
7054 self
7055 }
7056 }
7057
7058 #[doc(hidden)]
7059 impl gax::options::internal::RequestBuilder for GetOperation {
7060 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7061 &mut self.0.options
7062 }
7063 }
7064
7065 #[derive(Clone, Debug)]
7082 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7083
7084 impl DeleteOperation {
7085 pub(crate) fn new(
7086 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7087 ) -> Self {
7088 Self(RequestBuilder::new(stub))
7089 }
7090
7091 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7093 mut self,
7094 v: V,
7095 ) -> Self {
7096 self.0.request = v.into();
7097 self
7098 }
7099
7100 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7102 self.0.options = v.into();
7103 self
7104 }
7105
7106 pub async fn send(self) -> Result<()> {
7108 (*self.0.stub)
7109 .delete_operation(self.0.request, self.0.options)
7110 .await
7111 .map(gax::response::Response::into_body)
7112 }
7113
7114 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7116 self.0.request.name = v.into();
7117 self
7118 }
7119 }
7120
7121 #[doc(hidden)]
7122 impl gax::options::internal::RequestBuilder for DeleteOperation {
7123 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7124 &mut self.0.options
7125 }
7126 }
7127
7128 #[derive(Clone, Debug)]
7145 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
7146
7147 impl CancelOperation {
7148 pub(crate) fn new(
7149 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7150 ) -> Self {
7151 Self(RequestBuilder::new(stub))
7152 }
7153
7154 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
7156 mut self,
7157 v: V,
7158 ) -> Self {
7159 self.0.request = v.into();
7160 self
7161 }
7162
7163 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7165 self.0.options = v.into();
7166 self
7167 }
7168
7169 pub async fn send(self) -> Result<()> {
7171 (*self.0.stub)
7172 .cancel_operation(self.0.request, self.0.options)
7173 .await
7174 .map(gax::response::Response::into_body)
7175 }
7176
7177 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7179 self.0.request.name = v.into();
7180 self
7181 }
7182 }
7183
7184 #[doc(hidden)]
7185 impl gax::options::internal::RequestBuilder for CancelOperation {
7186 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7187 &mut self.0.options
7188 }
7189 }
7190}