1pub mod cross_network_automation_service {
18 use crate::Result;
19 use std::sync::Arc;
20
21 pub type ClientBuilder =
35 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
36
37 pub(crate) mod client {
38 use super::super::super::client::CrossNetworkAutomationService;
39 pub struct Factory;
40 impl gax::client_builder::internal::ClientFactory for Factory {
41 type Client = CrossNetworkAutomationService;
42 type Credentials = gaxi::options::Credentials;
43 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
44 Self::Client::new(config).await
45 }
46 }
47 }
48
49 #[derive(Clone, Debug)]
51 pub(crate) struct RequestBuilder<R: std::default::Default> {
52 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
53 request: R,
54 options: gax::options::RequestOptions,
55 }
56
57 impl<R> RequestBuilder<R>
58 where
59 R: std::default::Default,
60 {
61 pub(crate) fn new(
62 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
63 ) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: gax::options::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
74 pub struct ListServiceConnectionMaps(
75 RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
76 );
77
78 impl ListServiceConnectionMaps {
79 pub(crate) fn new(
80 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
81 ) -> Self {
82 Self(RequestBuilder::new(stub))
83 }
84
85 pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
87 mut self,
88 v: V,
89 ) -> Self {
90 self.0.request = v.into();
91 self
92 }
93
94 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
96 self.0.options = v.into();
97 self
98 }
99
100 pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
102 (*self.0.stub)
103 .list_service_connection_maps(self.0.request, self.0.options)
104 .await
105 .map(gax::response::Response::into_body)
106 }
107
108 pub async fn paginator(
110 self,
111 ) -> impl gax::paginator::Paginator<
112 crate::model::ListServiceConnectionMapsResponse,
113 gax::error::Error,
114 > {
115 use std::clone::Clone;
116 let token = self.0.request.page_token.clone();
117 let execute = move |token: String| {
118 let mut builder = self.clone();
119 builder.0.request = builder.0.request.set_page_token(token);
120 builder.send()
121 };
122 gax::paginator::internal::new_paginator(token, execute)
123 }
124
125 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
127 self.0.request.parent = v.into();
128 self
129 }
130
131 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
133 self.0.request.page_size = v.into();
134 self
135 }
136
137 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
139 self.0.request.page_token = v.into();
140 self
141 }
142
143 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
145 self.0.request.filter = v.into();
146 self
147 }
148
149 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
151 self.0.request.order_by = v.into();
152 self
153 }
154 }
155
156 #[doc(hidden)]
157 impl gax::options::internal::RequestBuilder for ListServiceConnectionMaps {
158 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
159 &mut self.0.options
160 }
161 }
162
163 #[derive(Clone, Debug)]
165 pub struct GetServiceConnectionMap(
166 RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
167 );
168
169 impl GetServiceConnectionMap {
170 pub(crate) fn new(
171 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
172 ) -> Self {
173 Self(RequestBuilder::new(stub))
174 }
175
176 pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
178 mut self,
179 v: V,
180 ) -> Self {
181 self.0.request = v.into();
182 self
183 }
184
185 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
187 self.0.options = v.into();
188 self
189 }
190
191 pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
193 (*self.0.stub)
194 .get_service_connection_map(self.0.request, self.0.options)
195 .await
196 .map(gax::response::Response::into_body)
197 }
198
199 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
201 self.0.request.name = v.into();
202 self
203 }
204 }
205
206 #[doc(hidden)]
207 impl gax::options::internal::RequestBuilder for GetServiceConnectionMap {
208 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
209 &mut self.0.options
210 }
211 }
212
213 #[derive(Clone, Debug)]
215 pub struct CreateServiceConnectionMap(
216 RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
217 );
218
219 impl CreateServiceConnectionMap {
220 pub(crate) fn new(
221 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
222 ) -> Self {
223 Self(RequestBuilder::new(stub))
224 }
225
226 pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
228 mut self,
229 v: V,
230 ) -> Self {
231 self.0.request = v.into();
232 self
233 }
234
235 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
237 self.0.options = v.into();
238 self
239 }
240
241 pub async fn send(self) -> Result<longrunning::model::Operation> {
248 (*self.0.stub)
249 .create_service_connection_map(self.0.request, self.0.options)
250 .await
251 .map(gax::response::Response::into_body)
252 }
253
254 pub fn poller(
256 self,
257 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
258 {
259 type Operation =
260 lro::Operation<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>;
261 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
262 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
263
264 let stub = self.0.stub.clone();
265 let mut options = self.0.options.clone();
266 options.set_retry_policy(gax::retry_policy::NeverRetry);
267 let query = move |name| {
268 let stub = stub.clone();
269 let options = options.clone();
270 async {
271 let op = GetOperation::new(stub)
272 .set_name(name)
273 .with_options(options)
274 .send()
275 .await?;
276 Ok(Operation::new(op))
277 }
278 };
279
280 let start = move || async {
281 let op = self.send().await?;
282 Ok(Operation::new(op))
283 };
284
285 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
286 }
287
288 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
290 self.0.request.parent = v.into();
291 self
292 }
293
294 pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
296 self.0.request.service_connection_map_id = v.into();
297 self
298 }
299
300 pub fn set_service_connection_map<
302 T: Into<std::option::Option<crate::model::ServiceConnectionMap>>,
303 >(
304 mut self,
305 v: T,
306 ) -> Self {
307 self.0.request.service_connection_map = v.into();
308 self
309 }
310
311 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
313 self.0.request.request_id = v.into();
314 self
315 }
316 }
317
318 #[doc(hidden)]
319 impl gax::options::internal::RequestBuilder for CreateServiceConnectionMap {
320 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
321 &mut self.0.options
322 }
323 }
324
325 #[derive(Clone, Debug)]
327 pub struct UpdateServiceConnectionMap(
328 RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
329 );
330
331 impl UpdateServiceConnectionMap {
332 pub(crate) fn new(
333 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
334 ) -> Self {
335 Self(RequestBuilder::new(stub))
336 }
337
338 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
340 mut self,
341 v: V,
342 ) -> Self {
343 self.0.request = v.into();
344 self
345 }
346
347 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
349 self.0.options = v.into();
350 self
351 }
352
353 pub async fn send(self) -> Result<longrunning::model::Operation> {
360 (*self.0.stub)
361 .update_service_connection_map(self.0.request, self.0.options)
362 .await
363 .map(gax::response::Response::into_body)
364 }
365
366 pub fn poller(
368 self,
369 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
370 {
371 type Operation =
372 lro::Operation<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>;
373 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
374 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
375
376 let stub = self.0.stub.clone();
377 let mut options = self.0.options.clone();
378 options.set_retry_policy(gax::retry_policy::NeverRetry);
379 let query = move |name| {
380 let stub = stub.clone();
381 let options = options.clone();
382 async {
383 let op = GetOperation::new(stub)
384 .set_name(name)
385 .with_options(options)
386 .send()
387 .await?;
388 Ok(Operation::new(op))
389 }
390 };
391
392 let start = move || async {
393 let op = self.send().await?;
394 Ok(Operation::new(op))
395 };
396
397 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
398 }
399
400 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
402 mut self,
403 v: T,
404 ) -> Self {
405 self.0.request.update_mask = v.into();
406 self
407 }
408
409 pub fn set_service_connection_map<
411 T: Into<std::option::Option<crate::model::ServiceConnectionMap>>,
412 >(
413 mut self,
414 v: T,
415 ) -> Self {
416 self.0.request.service_connection_map = v.into();
417 self
418 }
419
420 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
422 self.0.request.request_id = v.into();
423 self
424 }
425 }
426
427 #[doc(hidden)]
428 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionMap {
429 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
430 &mut self.0.options
431 }
432 }
433
434 #[derive(Clone, Debug)]
436 pub struct DeleteServiceConnectionMap(
437 RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
438 );
439
440 impl DeleteServiceConnectionMap {
441 pub(crate) fn new(
442 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
443 ) -> Self {
444 Self(RequestBuilder::new(stub))
445 }
446
447 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
449 mut self,
450 v: V,
451 ) -> Self {
452 self.0.request = v.into();
453 self
454 }
455
456 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
458 self.0.options = v.into();
459 self
460 }
461
462 pub async fn send(self) -> Result<longrunning::model::Operation> {
469 (*self.0.stub)
470 .delete_service_connection_map(self.0.request, self.0.options)
471 .await
472 .map(gax::response::Response::into_body)
473 }
474
475 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
477 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
478 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
479 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
480
481 let stub = self.0.stub.clone();
482 let mut options = self.0.options.clone();
483 options.set_retry_policy(gax::retry_policy::NeverRetry);
484 let query = move |name| {
485 let stub = stub.clone();
486 let options = options.clone();
487 async {
488 let op = GetOperation::new(stub)
489 .set_name(name)
490 .with_options(options)
491 .send()
492 .await?;
493 Ok(Operation::new(op))
494 }
495 };
496
497 let start = move || async {
498 let op = self.send().await?;
499 Ok(Operation::new(op))
500 };
501
502 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
503 }
504
505 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
507 self.0.request.name = v.into();
508 self
509 }
510
511 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
513 self.0.request.request_id = v.into();
514 self
515 }
516
517 pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
519 self.0.request.etag = v.into();
520 self
521 }
522 }
523
524 #[doc(hidden)]
525 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionMap {
526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
527 &mut self.0.options
528 }
529 }
530
531 #[derive(Clone, Debug)]
533 pub struct ListServiceConnectionPolicies(
534 RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
535 );
536
537 impl ListServiceConnectionPolicies {
538 pub(crate) fn new(
539 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
540 ) -> Self {
541 Self(RequestBuilder::new(stub))
542 }
543
544 pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
546 mut self,
547 v: V,
548 ) -> Self {
549 self.0.request = v.into();
550 self
551 }
552
553 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
555 self.0.options = v.into();
556 self
557 }
558
559 pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
561 (*self.0.stub)
562 .list_service_connection_policies(self.0.request, self.0.options)
563 .await
564 .map(gax::response::Response::into_body)
565 }
566
567 pub async fn paginator(
569 self,
570 ) -> impl gax::paginator::Paginator<
571 crate::model::ListServiceConnectionPoliciesResponse,
572 gax::error::Error,
573 > {
574 use std::clone::Clone;
575 let token = self.0.request.page_token.clone();
576 let execute = move |token: String| {
577 let mut builder = self.clone();
578 builder.0.request = builder.0.request.set_page_token(token);
579 builder.send()
580 };
581 gax::paginator::internal::new_paginator(token, execute)
582 }
583
584 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
586 self.0.request.parent = v.into();
587 self
588 }
589
590 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
592 self.0.request.page_size = v.into();
593 self
594 }
595
596 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
598 self.0.request.page_token = v.into();
599 self
600 }
601
602 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
604 self.0.request.filter = v.into();
605 self
606 }
607
608 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
610 self.0.request.order_by = v.into();
611 self
612 }
613 }
614
615 #[doc(hidden)]
616 impl gax::options::internal::RequestBuilder for ListServiceConnectionPolicies {
617 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
618 &mut self.0.options
619 }
620 }
621
622 #[derive(Clone, Debug)]
624 pub struct GetServiceConnectionPolicy(
625 RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
626 );
627
628 impl GetServiceConnectionPolicy {
629 pub(crate) fn new(
630 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
631 ) -> Self {
632 Self(RequestBuilder::new(stub))
633 }
634
635 pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
637 mut self,
638 v: V,
639 ) -> Self {
640 self.0.request = v.into();
641 self
642 }
643
644 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
646 self.0.options = v.into();
647 self
648 }
649
650 pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
652 (*self.0.stub)
653 .get_service_connection_policy(self.0.request, self.0.options)
654 .await
655 .map(gax::response::Response::into_body)
656 }
657
658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
660 self.0.request.name = v.into();
661 self
662 }
663 }
664
665 #[doc(hidden)]
666 impl gax::options::internal::RequestBuilder for GetServiceConnectionPolicy {
667 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
668 &mut self.0.options
669 }
670 }
671
672 #[derive(Clone, Debug)]
674 pub struct CreateServiceConnectionPolicy(
675 RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
676 );
677
678 impl CreateServiceConnectionPolicy {
679 pub(crate) fn new(
680 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
681 ) -> Self {
682 Self(RequestBuilder::new(stub))
683 }
684
685 pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
687 mut self,
688 v: V,
689 ) -> Self {
690 self.0.request = v.into();
691 self
692 }
693
694 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
696 self.0.options = v.into();
697 self
698 }
699
700 pub async fn send(self) -> Result<longrunning::model::Operation> {
707 (*self.0.stub)
708 .create_service_connection_policy(self.0.request, self.0.options)
709 .await
710 .map(gax::response::Response::into_body)
711 }
712
713 pub fn poller(
715 self,
716 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
717 {
718 type Operation = lro::Operation<
719 crate::model::ServiceConnectionPolicy,
720 crate::model::OperationMetadata,
721 >;
722 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
723 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
724
725 let stub = self.0.stub.clone();
726 let mut options = self.0.options.clone();
727 options.set_retry_policy(gax::retry_policy::NeverRetry);
728 let query = move |name| {
729 let stub = stub.clone();
730 let options = options.clone();
731 async {
732 let op = GetOperation::new(stub)
733 .set_name(name)
734 .with_options(options)
735 .send()
736 .await?;
737 Ok(Operation::new(op))
738 }
739 };
740
741 let start = move || async {
742 let op = self.send().await?;
743 Ok(Operation::new(op))
744 };
745
746 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
747 }
748
749 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
751 self.0.request.parent = v.into();
752 self
753 }
754
755 pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
757 mut self,
758 v: T,
759 ) -> Self {
760 self.0.request.service_connection_policy_id = v.into();
761 self
762 }
763
764 pub fn set_service_connection_policy<
766 T: Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
767 >(
768 mut self,
769 v: T,
770 ) -> Self {
771 self.0.request.service_connection_policy = v.into();
772 self
773 }
774
775 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
777 self.0.request.request_id = v.into();
778 self
779 }
780 }
781
782 #[doc(hidden)]
783 impl gax::options::internal::RequestBuilder for CreateServiceConnectionPolicy {
784 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
785 &mut self.0.options
786 }
787 }
788
789 #[derive(Clone, Debug)]
791 pub struct UpdateServiceConnectionPolicy(
792 RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
793 );
794
795 impl UpdateServiceConnectionPolicy {
796 pub(crate) fn new(
797 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
798 ) -> Self {
799 Self(RequestBuilder::new(stub))
800 }
801
802 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
804 mut self,
805 v: V,
806 ) -> Self {
807 self.0.request = v.into();
808 self
809 }
810
811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
813 self.0.options = v.into();
814 self
815 }
816
817 pub async fn send(self) -> Result<longrunning::model::Operation> {
824 (*self.0.stub)
825 .update_service_connection_policy(self.0.request, self.0.options)
826 .await
827 .map(gax::response::Response::into_body)
828 }
829
830 pub fn poller(
832 self,
833 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
834 {
835 type Operation = lro::Operation<
836 crate::model::ServiceConnectionPolicy,
837 crate::model::OperationMetadata,
838 >;
839 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
840 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
841
842 let stub = self.0.stub.clone();
843 let mut options = self.0.options.clone();
844 options.set_retry_policy(gax::retry_policy::NeverRetry);
845 let query = move |name| {
846 let stub = stub.clone();
847 let options = options.clone();
848 async {
849 let op = GetOperation::new(stub)
850 .set_name(name)
851 .with_options(options)
852 .send()
853 .await?;
854 Ok(Operation::new(op))
855 }
856 };
857
858 let start = move || async {
859 let op = self.send().await?;
860 Ok(Operation::new(op))
861 };
862
863 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
864 }
865
866 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
868 mut self,
869 v: T,
870 ) -> Self {
871 self.0.request.update_mask = v.into();
872 self
873 }
874
875 pub fn set_service_connection_policy<
877 T: Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
878 >(
879 mut self,
880 v: T,
881 ) -> Self {
882 self.0.request.service_connection_policy = v.into();
883 self
884 }
885
886 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
888 self.0.request.request_id = v.into();
889 self
890 }
891 }
892
893 #[doc(hidden)]
894 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionPolicy {
895 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
896 &mut self.0.options
897 }
898 }
899
900 #[derive(Clone, Debug)]
902 pub struct DeleteServiceConnectionPolicy(
903 RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
904 );
905
906 impl DeleteServiceConnectionPolicy {
907 pub(crate) fn new(
908 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
909 ) -> Self {
910 Self(RequestBuilder::new(stub))
911 }
912
913 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
915 mut self,
916 v: V,
917 ) -> Self {
918 self.0.request = v.into();
919 self
920 }
921
922 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
924 self.0.options = v.into();
925 self
926 }
927
928 pub async fn send(self) -> Result<longrunning::model::Operation> {
935 (*self.0.stub)
936 .delete_service_connection_policy(self.0.request, self.0.options)
937 .await
938 .map(gax::response::Response::into_body)
939 }
940
941 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
943 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
944 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
945 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
946
947 let stub = self.0.stub.clone();
948 let mut options = self.0.options.clone();
949 options.set_retry_policy(gax::retry_policy::NeverRetry);
950 let query = move |name| {
951 let stub = stub.clone();
952 let options = options.clone();
953 async {
954 let op = GetOperation::new(stub)
955 .set_name(name)
956 .with_options(options)
957 .send()
958 .await?;
959 Ok(Operation::new(op))
960 }
961 };
962
963 let start = move || async {
964 let op = self.send().await?;
965 Ok(Operation::new(op))
966 };
967
968 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
969 }
970
971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
973 self.0.request.name = v.into();
974 self
975 }
976
977 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
979 self.0.request.request_id = v.into();
980 self
981 }
982
983 pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
985 self.0.request.etag = v.into();
986 self
987 }
988 }
989
990 #[doc(hidden)]
991 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionPolicy {
992 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
993 &mut self.0.options
994 }
995 }
996
997 #[derive(Clone, Debug)]
999 pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1000
1001 impl ListServiceClasses {
1002 pub(crate) fn new(
1003 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1004 ) -> Self {
1005 Self(RequestBuilder::new(stub))
1006 }
1007
1008 pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1010 mut self,
1011 v: V,
1012 ) -> Self {
1013 self.0.request = v.into();
1014 self
1015 }
1016
1017 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1019 self.0.options = v.into();
1020 self
1021 }
1022
1023 pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1025 (*self.0.stub)
1026 .list_service_classes(self.0.request, self.0.options)
1027 .await
1028 .map(gax::response::Response::into_body)
1029 }
1030
1031 pub async fn paginator(
1033 self,
1034 ) -> impl gax::paginator::Paginator<crate::model::ListServiceClassesResponse, gax::error::Error>
1035 {
1036 use std::clone::Clone;
1037 let token = self.0.request.page_token.clone();
1038 let execute = move |token: String| {
1039 let mut builder = self.clone();
1040 builder.0.request = builder.0.request.set_page_token(token);
1041 builder.send()
1042 };
1043 gax::paginator::internal::new_paginator(token, execute)
1044 }
1045
1046 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1048 self.0.request.parent = v.into();
1049 self
1050 }
1051
1052 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1054 self.0.request.page_size = v.into();
1055 self
1056 }
1057
1058 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.0.request.page_token = v.into();
1061 self
1062 }
1063
1064 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1066 self.0.request.filter = v.into();
1067 self
1068 }
1069
1070 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.0.request.order_by = v.into();
1073 self
1074 }
1075 }
1076
1077 #[doc(hidden)]
1078 impl gax::options::internal::RequestBuilder for ListServiceClasses {
1079 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1080 &mut self.0.options
1081 }
1082 }
1083
1084 #[derive(Clone, Debug)]
1086 pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1087
1088 impl GetServiceClass {
1089 pub(crate) fn new(
1090 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1091 ) -> Self {
1092 Self(RequestBuilder::new(stub))
1093 }
1094
1095 pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1097 self.0.request = v.into();
1098 self
1099 }
1100
1101 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1103 self.0.options = v.into();
1104 self
1105 }
1106
1107 pub async fn send(self) -> Result<crate::model::ServiceClass> {
1109 (*self.0.stub)
1110 .get_service_class(self.0.request, self.0.options)
1111 .await
1112 .map(gax::response::Response::into_body)
1113 }
1114
1115 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117 self.0.request.name = v.into();
1118 self
1119 }
1120 }
1121
1122 #[doc(hidden)]
1123 impl gax::options::internal::RequestBuilder for GetServiceClass {
1124 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1125 &mut self.0.options
1126 }
1127 }
1128
1129 #[derive(Clone, Debug)]
1131 pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1132
1133 impl UpdateServiceClass {
1134 pub(crate) fn new(
1135 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1136 ) -> Self {
1137 Self(RequestBuilder::new(stub))
1138 }
1139
1140 pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1142 mut self,
1143 v: V,
1144 ) -> Self {
1145 self.0.request = v.into();
1146 self
1147 }
1148
1149 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1151 self.0.options = v.into();
1152 self
1153 }
1154
1155 pub async fn send(self) -> Result<longrunning::model::Operation> {
1162 (*self.0.stub)
1163 .update_service_class(self.0.request, self.0.options)
1164 .await
1165 .map(gax::response::Response::into_body)
1166 }
1167
1168 pub fn poller(
1170 self,
1171 ) -> impl lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata> {
1172 type Operation =
1173 lro::Operation<crate::model::ServiceClass, crate::model::OperationMetadata>;
1174 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1175 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1176
1177 let stub = self.0.stub.clone();
1178 let mut options = self.0.options.clone();
1179 options.set_retry_policy(gax::retry_policy::NeverRetry);
1180 let query = move |name| {
1181 let stub = stub.clone();
1182 let options = options.clone();
1183 async {
1184 let op = GetOperation::new(stub)
1185 .set_name(name)
1186 .with_options(options)
1187 .send()
1188 .await?;
1189 Ok(Operation::new(op))
1190 }
1191 };
1192
1193 let start = move || async {
1194 let op = self.send().await?;
1195 Ok(Operation::new(op))
1196 };
1197
1198 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1199 }
1200
1201 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1203 mut self,
1204 v: T,
1205 ) -> Self {
1206 self.0.request.update_mask = v.into();
1207 self
1208 }
1209
1210 pub fn set_service_class<T: Into<std::option::Option<crate::model::ServiceClass>>>(
1212 mut self,
1213 v: T,
1214 ) -> Self {
1215 self.0.request.service_class = v.into();
1216 self
1217 }
1218
1219 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1221 self.0.request.request_id = v.into();
1222 self
1223 }
1224 }
1225
1226 #[doc(hidden)]
1227 impl gax::options::internal::RequestBuilder for UpdateServiceClass {
1228 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1229 &mut self.0.options
1230 }
1231 }
1232
1233 #[derive(Clone, Debug)]
1235 pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1236
1237 impl DeleteServiceClass {
1238 pub(crate) fn new(
1239 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1240 ) -> Self {
1241 Self(RequestBuilder::new(stub))
1242 }
1243
1244 pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1246 mut self,
1247 v: V,
1248 ) -> Self {
1249 self.0.request = v.into();
1250 self
1251 }
1252
1253 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1255 self.0.options = v.into();
1256 self
1257 }
1258
1259 pub async fn send(self) -> Result<longrunning::model::Operation> {
1266 (*self.0.stub)
1267 .delete_service_class(self.0.request, self.0.options)
1268 .await
1269 .map(gax::response::Response::into_body)
1270 }
1271
1272 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1274 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1275 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1276 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1277
1278 let stub = self.0.stub.clone();
1279 let mut options = self.0.options.clone();
1280 options.set_retry_policy(gax::retry_policy::NeverRetry);
1281 let query = move |name| {
1282 let stub = stub.clone();
1283 let options = options.clone();
1284 async {
1285 let op = GetOperation::new(stub)
1286 .set_name(name)
1287 .with_options(options)
1288 .send()
1289 .await?;
1290 Ok(Operation::new(op))
1291 }
1292 };
1293
1294 let start = move || async {
1295 let op = self.send().await?;
1296 Ok(Operation::new(op))
1297 };
1298
1299 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1300 }
1301
1302 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1304 self.0.request.name = v.into();
1305 self
1306 }
1307
1308 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1310 self.0.request.request_id = v.into();
1311 self
1312 }
1313
1314 pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
1316 self.0.request.etag = v.into();
1317 self
1318 }
1319 }
1320
1321 #[doc(hidden)]
1322 impl gax::options::internal::RequestBuilder for DeleteServiceClass {
1323 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1324 &mut self.0.options
1325 }
1326 }
1327
1328 #[derive(Clone, Debug)]
1330 pub struct GetServiceConnectionToken(
1331 RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1332 );
1333
1334 impl GetServiceConnectionToken {
1335 pub(crate) fn new(
1336 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1337 ) -> Self {
1338 Self(RequestBuilder::new(stub))
1339 }
1340
1341 pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1343 mut self,
1344 v: V,
1345 ) -> Self {
1346 self.0.request = v.into();
1347 self
1348 }
1349
1350 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1352 self.0.options = v.into();
1353 self
1354 }
1355
1356 pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1358 (*self.0.stub)
1359 .get_service_connection_token(self.0.request, self.0.options)
1360 .await
1361 .map(gax::response::Response::into_body)
1362 }
1363
1364 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1366 self.0.request.name = v.into();
1367 self
1368 }
1369 }
1370
1371 #[doc(hidden)]
1372 impl gax::options::internal::RequestBuilder for GetServiceConnectionToken {
1373 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1374 &mut self.0.options
1375 }
1376 }
1377
1378 #[derive(Clone, Debug)]
1380 pub struct ListServiceConnectionTokens(
1381 RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1382 );
1383
1384 impl ListServiceConnectionTokens {
1385 pub(crate) fn new(
1386 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1387 ) -> Self {
1388 Self(RequestBuilder::new(stub))
1389 }
1390
1391 pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1393 mut self,
1394 v: V,
1395 ) -> Self {
1396 self.0.request = v.into();
1397 self
1398 }
1399
1400 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1402 self.0.options = v.into();
1403 self
1404 }
1405
1406 pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1408 (*self.0.stub)
1409 .list_service_connection_tokens(self.0.request, self.0.options)
1410 .await
1411 .map(gax::response::Response::into_body)
1412 }
1413
1414 pub async fn paginator(
1416 self,
1417 ) -> impl gax::paginator::Paginator<
1418 crate::model::ListServiceConnectionTokensResponse,
1419 gax::error::Error,
1420 > {
1421 use std::clone::Clone;
1422 let token = self.0.request.page_token.clone();
1423 let execute = move |token: String| {
1424 let mut builder = self.clone();
1425 builder.0.request = builder.0.request.set_page_token(token);
1426 builder.send()
1427 };
1428 gax::paginator::internal::new_paginator(token, execute)
1429 }
1430
1431 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433 self.0.request.parent = v.into();
1434 self
1435 }
1436
1437 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1439 self.0.request.page_size = v.into();
1440 self
1441 }
1442
1443 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445 self.0.request.page_token = v.into();
1446 self
1447 }
1448
1449 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1451 self.0.request.filter = v.into();
1452 self
1453 }
1454
1455 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1457 self.0.request.order_by = v.into();
1458 self
1459 }
1460 }
1461
1462 #[doc(hidden)]
1463 impl gax::options::internal::RequestBuilder for ListServiceConnectionTokens {
1464 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1465 &mut self.0.options
1466 }
1467 }
1468
1469 #[derive(Clone, Debug)]
1471 pub struct CreateServiceConnectionToken(
1472 RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
1473 );
1474
1475 impl CreateServiceConnectionToken {
1476 pub(crate) fn new(
1477 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1478 ) -> Self {
1479 Self(RequestBuilder::new(stub))
1480 }
1481
1482 pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
1484 mut self,
1485 v: V,
1486 ) -> Self {
1487 self.0.request = v.into();
1488 self
1489 }
1490
1491 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1493 self.0.options = v.into();
1494 self
1495 }
1496
1497 pub async fn send(self) -> Result<longrunning::model::Operation> {
1504 (*self.0.stub)
1505 .create_service_connection_token(self.0.request, self.0.options)
1506 .await
1507 .map(gax::response::Response::into_body)
1508 }
1509
1510 pub fn poller(
1512 self,
1513 ) -> impl lro::Poller<crate::model::ServiceConnectionToken, crate::model::OperationMetadata>
1514 {
1515 type Operation = lro::Operation<
1516 crate::model::ServiceConnectionToken,
1517 crate::model::OperationMetadata,
1518 >;
1519 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1520 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1521
1522 let stub = self.0.stub.clone();
1523 let mut options = self.0.options.clone();
1524 options.set_retry_policy(gax::retry_policy::NeverRetry);
1525 let query = move |name| {
1526 let stub = stub.clone();
1527 let options = options.clone();
1528 async {
1529 let op = GetOperation::new(stub)
1530 .set_name(name)
1531 .with_options(options)
1532 .send()
1533 .await?;
1534 Ok(Operation::new(op))
1535 }
1536 };
1537
1538 let start = move || async {
1539 let op = self.send().await?;
1540 Ok(Operation::new(op))
1541 };
1542
1543 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1544 }
1545
1546 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1548 self.0.request.parent = v.into();
1549 self
1550 }
1551
1552 pub fn set_service_connection_token_id<T: Into<std::string::String>>(
1554 mut self,
1555 v: T,
1556 ) -> Self {
1557 self.0.request.service_connection_token_id = v.into();
1558 self
1559 }
1560
1561 pub fn set_service_connection_token<
1563 T: Into<std::option::Option<crate::model::ServiceConnectionToken>>,
1564 >(
1565 mut self,
1566 v: T,
1567 ) -> Self {
1568 self.0.request.service_connection_token = v.into();
1569 self
1570 }
1571
1572 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1574 self.0.request.request_id = v.into();
1575 self
1576 }
1577 }
1578
1579 #[doc(hidden)]
1580 impl gax::options::internal::RequestBuilder for CreateServiceConnectionToken {
1581 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1582 &mut self.0.options
1583 }
1584 }
1585
1586 #[derive(Clone, Debug)]
1588 pub struct DeleteServiceConnectionToken(
1589 RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
1590 );
1591
1592 impl DeleteServiceConnectionToken {
1593 pub(crate) fn new(
1594 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1595 ) -> Self {
1596 Self(RequestBuilder::new(stub))
1597 }
1598
1599 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
1601 mut self,
1602 v: V,
1603 ) -> Self {
1604 self.0.request = v.into();
1605 self
1606 }
1607
1608 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1610 self.0.options = v.into();
1611 self
1612 }
1613
1614 pub async fn send(self) -> Result<longrunning::model::Operation> {
1621 (*self.0.stub)
1622 .delete_service_connection_token(self.0.request, self.0.options)
1623 .await
1624 .map(gax::response::Response::into_body)
1625 }
1626
1627 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1629 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1630 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1631 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1632
1633 let stub = self.0.stub.clone();
1634 let mut options = self.0.options.clone();
1635 options.set_retry_policy(gax::retry_policy::NeverRetry);
1636 let query = move |name| {
1637 let stub = stub.clone();
1638 let options = options.clone();
1639 async {
1640 let op = GetOperation::new(stub)
1641 .set_name(name)
1642 .with_options(options)
1643 .send()
1644 .await?;
1645 Ok(Operation::new(op))
1646 }
1647 };
1648
1649 let start = move || async {
1650 let op = self.send().await?;
1651 Ok(Operation::new(op))
1652 };
1653
1654 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1655 }
1656
1657 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1659 self.0.request.name = v.into();
1660 self
1661 }
1662
1663 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1665 self.0.request.request_id = v.into();
1666 self
1667 }
1668
1669 pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
1671 self.0.request.etag = v.into();
1672 self
1673 }
1674 }
1675
1676 #[doc(hidden)]
1677 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionToken {
1678 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1679 &mut self.0.options
1680 }
1681 }
1682
1683 #[derive(Clone, Debug)]
1685 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1686
1687 impl ListLocations {
1688 pub(crate) fn new(
1689 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1690 ) -> Self {
1691 Self(RequestBuilder::new(stub))
1692 }
1693
1694 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1696 mut self,
1697 v: V,
1698 ) -> Self {
1699 self.0.request = v.into();
1700 self
1701 }
1702
1703 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1705 self.0.options = v.into();
1706 self
1707 }
1708
1709 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1711 (*self.0.stub)
1712 .list_locations(self.0.request, self.0.options)
1713 .await
1714 .map(gax::response::Response::into_body)
1715 }
1716
1717 pub async fn paginator(
1719 self,
1720 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1721 {
1722 use std::clone::Clone;
1723 let token = self.0.request.page_token.clone();
1724 let execute = move |token: String| {
1725 let mut builder = self.clone();
1726 builder.0.request = builder.0.request.set_page_token(token);
1727 builder.send()
1728 };
1729 gax::paginator::internal::new_paginator(token, execute)
1730 }
1731
1732 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1734 self.0.request.name = v.into();
1735 self
1736 }
1737
1738 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740 self.0.request.filter = v.into();
1741 self
1742 }
1743
1744 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1746 self.0.request.page_size = v.into();
1747 self
1748 }
1749
1750 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1752 self.0.request.page_token = v.into();
1753 self
1754 }
1755 }
1756
1757 #[doc(hidden)]
1758 impl gax::options::internal::RequestBuilder for ListLocations {
1759 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1760 &mut self.0.options
1761 }
1762 }
1763
1764 #[derive(Clone, Debug)]
1766 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1767
1768 impl GetLocation {
1769 pub(crate) fn new(
1770 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1771 ) -> Self {
1772 Self(RequestBuilder::new(stub))
1773 }
1774
1775 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1777 self.0.request = v.into();
1778 self
1779 }
1780
1781 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1783 self.0.options = v.into();
1784 self
1785 }
1786
1787 pub async fn send(self) -> Result<location::model::Location> {
1789 (*self.0.stub)
1790 .get_location(self.0.request, self.0.options)
1791 .await
1792 .map(gax::response::Response::into_body)
1793 }
1794
1795 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.0.request.name = v.into();
1798 self
1799 }
1800 }
1801
1802 #[doc(hidden)]
1803 impl gax::options::internal::RequestBuilder for GetLocation {
1804 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1805 &mut self.0.options
1806 }
1807 }
1808
1809 #[derive(Clone, Debug)]
1811 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1812
1813 impl SetIamPolicy {
1814 pub(crate) fn new(
1815 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1816 ) -> Self {
1817 Self(RequestBuilder::new(stub))
1818 }
1819
1820 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1822 self.0.request = v.into();
1823 self
1824 }
1825
1826 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1828 self.0.options = v.into();
1829 self
1830 }
1831
1832 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1834 (*self.0.stub)
1835 .set_iam_policy(self.0.request, self.0.options)
1836 .await
1837 .map(gax::response::Response::into_body)
1838 }
1839
1840 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1842 self.0.request.resource = v.into();
1843 self
1844 }
1845
1846 pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
1848 mut self,
1849 v: T,
1850 ) -> Self {
1851 self.0.request.policy = v.into();
1852 self
1853 }
1854
1855 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1857 mut self,
1858 v: T,
1859 ) -> Self {
1860 self.0.request.update_mask = v.into();
1861 self
1862 }
1863 }
1864
1865 #[doc(hidden)]
1866 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1867 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1868 &mut self.0.options
1869 }
1870 }
1871
1872 #[derive(Clone, Debug)]
1874 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1875
1876 impl GetIamPolicy {
1877 pub(crate) fn new(
1878 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1879 ) -> Self {
1880 Self(RequestBuilder::new(stub))
1881 }
1882
1883 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1885 self.0.request = v.into();
1886 self
1887 }
1888
1889 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1891 self.0.options = v.into();
1892 self
1893 }
1894
1895 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1897 (*self.0.stub)
1898 .get_iam_policy(self.0.request, self.0.options)
1899 .await
1900 .map(gax::response::Response::into_body)
1901 }
1902
1903 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1905 self.0.request.resource = v.into();
1906 self
1907 }
1908
1909 pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
1911 mut self,
1912 v: T,
1913 ) -> Self {
1914 self.0.request.options = v.into();
1915 self
1916 }
1917 }
1918
1919 #[doc(hidden)]
1920 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1921 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1922 &mut self.0.options
1923 }
1924 }
1925
1926 #[derive(Clone, Debug)]
1928 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1929
1930 impl TestIamPermissions {
1931 pub(crate) fn new(
1932 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1933 ) -> Self {
1934 Self(RequestBuilder::new(stub))
1935 }
1936
1937 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1939 mut self,
1940 v: V,
1941 ) -> Self {
1942 self.0.request = v.into();
1943 self
1944 }
1945
1946 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1948 self.0.options = v.into();
1949 self
1950 }
1951
1952 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1954 (*self.0.stub)
1955 .test_iam_permissions(self.0.request, self.0.options)
1956 .await
1957 .map(gax::response::Response::into_body)
1958 }
1959
1960 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1962 self.0.request.resource = v.into();
1963 self
1964 }
1965
1966 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1968 where
1969 T: std::iter::IntoIterator<Item = V>,
1970 V: std::convert::Into<std::string::String>,
1971 {
1972 use std::iter::Iterator;
1973 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1974 self
1975 }
1976 }
1977
1978 #[doc(hidden)]
1979 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1980 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1981 &mut self.0.options
1982 }
1983 }
1984
1985 #[derive(Clone, Debug)]
1987 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1988
1989 impl ListOperations {
1990 pub(crate) fn new(
1991 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1992 ) -> Self {
1993 Self(RequestBuilder::new(stub))
1994 }
1995
1996 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1998 mut self,
1999 v: V,
2000 ) -> Self {
2001 self.0.request = v.into();
2002 self
2003 }
2004
2005 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2007 self.0.options = v.into();
2008 self
2009 }
2010
2011 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2013 (*self.0.stub)
2014 .list_operations(self.0.request, self.0.options)
2015 .await
2016 .map(gax::response::Response::into_body)
2017 }
2018
2019 pub async fn paginator(
2021 self,
2022 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2023 {
2024 use std::clone::Clone;
2025 let token = self.0.request.page_token.clone();
2026 let execute = move |token: String| {
2027 let mut builder = self.clone();
2028 builder.0.request = builder.0.request.set_page_token(token);
2029 builder.send()
2030 };
2031 gax::paginator::internal::new_paginator(token, execute)
2032 }
2033
2034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2036 self.0.request.name = v.into();
2037 self
2038 }
2039
2040 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.0.request.filter = v.into();
2043 self
2044 }
2045
2046 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2048 self.0.request.page_size = v.into();
2049 self
2050 }
2051
2052 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2054 self.0.request.page_token = v.into();
2055 self
2056 }
2057 }
2058
2059 #[doc(hidden)]
2060 impl gax::options::internal::RequestBuilder for ListOperations {
2061 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2062 &mut self.0.options
2063 }
2064 }
2065
2066 #[derive(Clone, Debug)]
2068 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2069
2070 impl GetOperation {
2071 pub(crate) fn new(
2072 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2073 ) -> Self {
2074 Self(RequestBuilder::new(stub))
2075 }
2076
2077 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2079 mut self,
2080 v: V,
2081 ) -> Self {
2082 self.0.request = v.into();
2083 self
2084 }
2085
2086 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2088 self.0.options = v.into();
2089 self
2090 }
2091
2092 pub async fn send(self) -> Result<longrunning::model::Operation> {
2094 (*self.0.stub)
2095 .get_operation(self.0.request, self.0.options)
2096 .await
2097 .map(gax::response::Response::into_body)
2098 }
2099
2100 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102 self.0.request.name = v.into();
2103 self
2104 }
2105 }
2106
2107 #[doc(hidden)]
2108 impl gax::options::internal::RequestBuilder for GetOperation {
2109 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2110 &mut self.0.options
2111 }
2112 }
2113
2114 #[derive(Clone, Debug)]
2116 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2117
2118 impl DeleteOperation {
2119 pub(crate) fn new(
2120 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2121 ) -> Self {
2122 Self(RequestBuilder::new(stub))
2123 }
2124
2125 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2127 mut self,
2128 v: V,
2129 ) -> Self {
2130 self.0.request = v.into();
2131 self
2132 }
2133
2134 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2136 self.0.options = v.into();
2137 self
2138 }
2139
2140 pub async fn send(self) -> Result<()> {
2142 (*self.0.stub)
2143 .delete_operation(self.0.request, self.0.options)
2144 .await
2145 .map(gax::response::Response::into_body)
2146 }
2147
2148 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2150 self.0.request.name = v.into();
2151 self
2152 }
2153 }
2154
2155 #[doc(hidden)]
2156 impl gax::options::internal::RequestBuilder for DeleteOperation {
2157 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2158 &mut self.0.options
2159 }
2160 }
2161
2162 #[derive(Clone, Debug)]
2164 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2165
2166 impl CancelOperation {
2167 pub(crate) fn new(
2168 stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2169 ) -> Self {
2170 Self(RequestBuilder::new(stub))
2171 }
2172
2173 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2175 mut self,
2176 v: V,
2177 ) -> Self {
2178 self.0.request = v.into();
2179 self
2180 }
2181
2182 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2184 self.0.options = v.into();
2185 self
2186 }
2187
2188 pub async fn send(self) -> Result<()> {
2190 (*self.0.stub)
2191 .cancel_operation(self.0.request, self.0.options)
2192 .await
2193 .map(gax::response::Response::into_body)
2194 }
2195
2196 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2198 self.0.request.name = v.into();
2199 self
2200 }
2201 }
2202
2203 #[doc(hidden)]
2204 impl gax::options::internal::RequestBuilder for CancelOperation {
2205 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2206 &mut self.0.options
2207 }
2208 }
2209}
2210
2211pub mod hub_service {
2212 use crate::Result;
2213 use std::sync::Arc;
2214
2215 pub type ClientBuilder =
2229 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2230
2231 pub(crate) mod client {
2232 use super::super::super::client::HubService;
2233 pub struct Factory;
2234 impl gax::client_builder::internal::ClientFactory for Factory {
2235 type Client = HubService;
2236 type Credentials = gaxi::options::Credentials;
2237 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
2238 Self::Client::new(config).await
2239 }
2240 }
2241 }
2242
2243 #[derive(Clone, Debug)]
2245 pub(crate) struct RequestBuilder<R: std::default::Default> {
2246 stub: Arc<dyn super::super::stub::dynamic::HubService>,
2247 request: R,
2248 options: gax::options::RequestOptions,
2249 }
2250
2251 impl<R> RequestBuilder<R>
2252 where
2253 R: std::default::Default,
2254 {
2255 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2256 Self {
2257 stub,
2258 request: R::default(),
2259 options: gax::options::RequestOptions::default(),
2260 }
2261 }
2262 }
2263
2264 #[derive(Clone, Debug)]
2266 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
2267
2268 impl ListHubs {
2269 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2270 Self(RequestBuilder::new(stub))
2271 }
2272
2273 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
2275 self.0.request = v.into();
2276 self
2277 }
2278
2279 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2281 self.0.options = v.into();
2282 self
2283 }
2284
2285 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
2287 (*self.0.stub)
2288 .list_hubs(self.0.request, self.0.options)
2289 .await
2290 .map(gax::response::Response::into_body)
2291 }
2292
2293 pub async fn paginator(
2295 self,
2296 ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
2297 {
2298 use std::clone::Clone;
2299 let token = self.0.request.page_token.clone();
2300 let execute = move |token: String| {
2301 let mut builder = self.clone();
2302 builder.0.request = builder.0.request.set_page_token(token);
2303 builder.send()
2304 };
2305 gax::paginator::internal::new_paginator(token, execute)
2306 }
2307
2308 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2310 self.0.request.parent = v.into();
2311 self
2312 }
2313
2314 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2316 self.0.request.page_size = v.into();
2317 self
2318 }
2319
2320 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2322 self.0.request.page_token = v.into();
2323 self
2324 }
2325
2326 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328 self.0.request.filter = v.into();
2329 self
2330 }
2331
2332 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2334 self.0.request.order_by = v.into();
2335 self
2336 }
2337 }
2338
2339 #[doc(hidden)]
2340 impl gax::options::internal::RequestBuilder for ListHubs {
2341 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2342 &mut self.0.options
2343 }
2344 }
2345
2346 #[derive(Clone, Debug)]
2348 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
2349
2350 impl GetHub {
2351 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2352 Self(RequestBuilder::new(stub))
2353 }
2354
2355 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
2357 self.0.request = v.into();
2358 self
2359 }
2360
2361 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2363 self.0.options = v.into();
2364 self
2365 }
2366
2367 pub async fn send(self) -> Result<crate::model::Hub> {
2369 (*self.0.stub)
2370 .get_hub(self.0.request, self.0.options)
2371 .await
2372 .map(gax::response::Response::into_body)
2373 }
2374
2375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2377 self.0.request.name = v.into();
2378 self
2379 }
2380 }
2381
2382 #[doc(hidden)]
2383 impl gax::options::internal::RequestBuilder for GetHub {
2384 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2385 &mut self.0.options
2386 }
2387 }
2388
2389 #[derive(Clone, Debug)]
2391 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
2392
2393 impl CreateHub {
2394 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2395 Self(RequestBuilder::new(stub))
2396 }
2397
2398 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
2400 self.0.request = v.into();
2401 self
2402 }
2403
2404 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2406 self.0.options = v.into();
2407 self
2408 }
2409
2410 pub async fn send(self) -> Result<longrunning::model::Operation> {
2417 (*self.0.stub)
2418 .create_hub(self.0.request, self.0.options)
2419 .await
2420 .map(gax::response::Response::into_body)
2421 }
2422
2423 pub fn poller(
2425 self,
2426 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
2427 type Operation = lro::Operation<crate::model::Hub, crate::model::OperationMetadata>;
2428 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2429 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2430
2431 let stub = self.0.stub.clone();
2432 let mut options = self.0.options.clone();
2433 options.set_retry_policy(gax::retry_policy::NeverRetry);
2434 let query = move |name| {
2435 let stub = stub.clone();
2436 let options = options.clone();
2437 async {
2438 let op = GetOperation::new(stub)
2439 .set_name(name)
2440 .with_options(options)
2441 .send()
2442 .await?;
2443 Ok(Operation::new(op))
2444 }
2445 };
2446
2447 let start = move || async {
2448 let op = self.send().await?;
2449 Ok(Operation::new(op))
2450 };
2451
2452 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2453 }
2454
2455 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2457 self.0.request.parent = v.into();
2458 self
2459 }
2460
2461 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2463 self.0.request.hub_id = v.into();
2464 self
2465 }
2466
2467 pub fn set_hub<T: Into<std::option::Option<crate::model::Hub>>>(mut self, v: T) -> Self {
2469 self.0.request.hub = v.into();
2470 self
2471 }
2472
2473 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2475 self.0.request.request_id = v.into();
2476 self
2477 }
2478 }
2479
2480 #[doc(hidden)]
2481 impl gax::options::internal::RequestBuilder for CreateHub {
2482 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2483 &mut self.0.options
2484 }
2485 }
2486
2487 #[derive(Clone, Debug)]
2489 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
2490
2491 impl UpdateHub {
2492 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2493 Self(RequestBuilder::new(stub))
2494 }
2495
2496 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
2498 self.0.request = v.into();
2499 self
2500 }
2501
2502 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2504 self.0.options = v.into();
2505 self
2506 }
2507
2508 pub async fn send(self) -> Result<longrunning::model::Operation> {
2515 (*self.0.stub)
2516 .update_hub(self.0.request, self.0.options)
2517 .await
2518 .map(gax::response::Response::into_body)
2519 }
2520
2521 pub fn poller(
2523 self,
2524 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
2525 type Operation = lro::Operation<crate::model::Hub, crate::model::OperationMetadata>;
2526 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2527 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2528
2529 let stub = self.0.stub.clone();
2530 let mut options = self.0.options.clone();
2531 options.set_retry_policy(gax::retry_policy::NeverRetry);
2532 let query = move |name| {
2533 let stub = stub.clone();
2534 let options = options.clone();
2535 async {
2536 let op = GetOperation::new(stub)
2537 .set_name(name)
2538 .with_options(options)
2539 .send()
2540 .await?;
2541 Ok(Operation::new(op))
2542 }
2543 };
2544
2545 let start = move || async {
2546 let op = self.send().await?;
2547 Ok(Operation::new(op))
2548 };
2549
2550 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2551 }
2552
2553 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
2555 mut self,
2556 v: T,
2557 ) -> Self {
2558 self.0.request.update_mask = v.into();
2559 self
2560 }
2561
2562 pub fn set_hub<T: Into<std::option::Option<crate::model::Hub>>>(mut self, v: T) -> Self {
2564 self.0.request.hub = v.into();
2565 self
2566 }
2567
2568 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2570 self.0.request.request_id = v.into();
2571 self
2572 }
2573 }
2574
2575 #[doc(hidden)]
2576 impl gax::options::internal::RequestBuilder for UpdateHub {
2577 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2578 &mut self.0.options
2579 }
2580 }
2581
2582 #[derive(Clone, Debug)]
2584 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
2585
2586 impl DeleteHub {
2587 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2588 Self(RequestBuilder::new(stub))
2589 }
2590
2591 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
2593 self.0.request = v.into();
2594 self
2595 }
2596
2597 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2599 self.0.options = v.into();
2600 self
2601 }
2602
2603 pub async fn send(self) -> Result<longrunning::model::Operation> {
2610 (*self.0.stub)
2611 .delete_hub(self.0.request, self.0.options)
2612 .await
2613 .map(gax::response::Response::into_body)
2614 }
2615
2616 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
2618 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
2619 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2620 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2621
2622 let stub = self.0.stub.clone();
2623 let mut options = self.0.options.clone();
2624 options.set_retry_policy(gax::retry_policy::NeverRetry);
2625 let query = move |name| {
2626 let stub = stub.clone();
2627 let options = options.clone();
2628 async {
2629 let op = GetOperation::new(stub)
2630 .set_name(name)
2631 .with_options(options)
2632 .send()
2633 .await?;
2634 Ok(Operation::new(op))
2635 }
2636 };
2637
2638 let start = move || async {
2639 let op = self.send().await?;
2640 Ok(Operation::new(op))
2641 };
2642
2643 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2644 }
2645
2646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2648 self.0.request.name = v.into();
2649 self
2650 }
2651
2652 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2654 self.0.request.request_id = v.into();
2655 self
2656 }
2657 }
2658
2659 #[doc(hidden)]
2660 impl gax::options::internal::RequestBuilder for DeleteHub {
2661 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2662 &mut self.0.options
2663 }
2664 }
2665
2666 #[derive(Clone, Debug)]
2668 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
2669
2670 impl ListHubSpokes {
2671 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2672 Self(RequestBuilder::new(stub))
2673 }
2674
2675 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
2677 self.0.request = v.into();
2678 self
2679 }
2680
2681 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2683 self.0.options = v.into();
2684 self
2685 }
2686
2687 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
2689 (*self.0.stub)
2690 .list_hub_spokes(self.0.request, self.0.options)
2691 .await
2692 .map(gax::response::Response::into_body)
2693 }
2694
2695 pub async fn paginator(
2697 self,
2698 ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
2699 {
2700 use std::clone::Clone;
2701 let token = self.0.request.page_token.clone();
2702 let execute = move |token: String| {
2703 let mut builder = self.clone();
2704 builder.0.request = builder.0.request.set_page_token(token);
2705 builder.send()
2706 };
2707 gax::paginator::internal::new_paginator(token, execute)
2708 }
2709
2710 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2712 self.0.request.name = v.into();
2713 self
2714 }
2715
2716 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2718 self.0.request.page_size = v.into();
2719 self
2720 }
2721
2722 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2724 self.0.request.page_token = v.into();
2725 self
2726 }
2727
2728 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2730 self.0.request.filter = v.into();
2731 self
2732 }
2733
2734 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2736 self.0.request.order_by = v.into();
2737 self
2738 }
2739
2740 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
2742 mut self,
2743 v: T,
2744 ) -> Self {
2745 self.0.request.view = v.into();
2746 self
2747 }
2748
2749 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
2751 where
2752 T: std::iter::IntoIterator<Item = V>,
2753 V: std::convert::Into<std::string::String>,
2754 {
2755 use std::iter::Iterator;
2756 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
2757 self
2758 }
2759 }
2760
2761 #[doc(hidden)]
2762 impl gax::options::internal::RequestBuilder for ListHubSpokes {
2763 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2764 &mut self.0.options
2765 }
2766 }
2767
2768 #[derive(Clone, Debug)]
2770 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
2771
2772 impl QueryHubStatus {
2773 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2774 Self(RequestBuilder::new(stub))
2775 }
2776
2777 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
2779 self.0.request = v.into();
2780 self
2781 }
2782
2783 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2785 self.0.options = v.into();
2786 self
2787 }
2788
2789 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
2791 (*self.0.stub)
2792 .query_hub_status(self.0.request, self.0.options)
2793 .await
2794 .map(gax::response::Response::into_body)
2795 }
2796
2797 pub async fn paginator(
2799 self,
2800 ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
2801 {
2802 use std::clone::Clone;
2803 let token = self.0.request.page_token.clone();
2804 let execute = move |token: String| {
2805 let mut builder = self.clone();
2806 builder.0.request = builder.0.request.set_page_token(token);
2807 builder.send()
2808 };
2809 gax::paginator::internal::new_paginator(token, execute)
2810 }
2811
2812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2814 self.0.request.name = v.into();
2815 self
2816 }
2817
2818 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2820 self.0.request.page_size = v.into();
2821 self
2822 }
2823
2824 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826 self.0.request.page_token = v.into();
2827 self
2828 }
2829
2830 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832 self.0.request.filter = v.into();
2833 self
2834 }
2835
2836 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2838 self.0.request.order_by = v.into();
2839 self
2840 }
2841
2842 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2844 self.0.request.group_by = v.into();
2845 self
2846 }
2847 }
2848
2849 #[doc(hidden)]
2850 impl gax::options::internal::RequestBuilder for QueryHubStatus {
2851 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2852 &mut self.0.options
2853 }
2854 }
2855
2856 #[derive(Clone, Debug)]
2858 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
2859
2860 impl ListSpokes {
2861 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2862 Self(RequestBuilder::new(stub))
2863 }
2864
2865 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
2867 self.0.request = v.into();
2868 self
2869 }
2870
2871 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2873 self.0.options = v.into();
2874 self
2875 }
2876
2877 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
2879 (*self.0.stub)
2880 .list_spokes(self.0.request, self.0.options)
2881 .await
2882 .map(gax::response::Response::into_body)
2883 }
2884
2885 pub async fn paginator(
2887 self,
2888 ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
2889 {
2890 use std::clone::Clone;
2891 let token = self.0.request.page_token.clone();
2892 let execute = move |token: String| {
2893 let mut builder = self.clone();
2894 builder.0.request = builder.0.request.set_page_token(token);
2895 builder.send()
2896 };
2897 gax::paginator::internal::new_paginator(token, execute)
2898 }
2899
2900 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2902 self.0.request.parent = v.into();
2903 self
2904 }
2905
2906 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2908 self.0.request.page_size = v.into();
2909 self
2910 }
2911
2912 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2914 self.0.request.page_token = v.into();
2915 self
2916 }
2917
2918 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920 self.0.request.filter = v.into();
2921 self
2922 }
2923
2924 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2926 self.0.request.order_by = v.into();
2927 self
2928 }
2929 }
2930
2931 #[doc(hidden)]
2932 impl gax::options::internal::RequestBuilder for ListSpokes {
2933 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2934 &mut self.0.options
2935 }
2936 }
2937
2938 #[derive(Clone, Debug)]
2940 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
2941
2942 impl GetSpoke {
2943 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2944 Self(RequestBuilder::new(stub))
2945 }
2946
2947 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
2949 self.0.request = v.into();
2950 self
2951 }
2952
2953 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2955 self.0.options = v.into();
2956 self
2957 }
2958
2959 pub async fn send(self) -> Result<crate::model::Spoke> {
2961 (*self.0.stub)
2962 .get_spoke(self.0.request, self.0.options)
2963 .await
2964 .map(gax::response::Response::into_body)
2965 }
2966
2967 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2969 self.0.request.name = v.into();
2970 self
2971 }
2972 }
2973
2974 #[doc(hidden)]
2975 impl gax::options::internal::RequestBuilder for GetSpoke {
2976 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2977 &mut self.0.options
2978 }
2979 }
2980
2981 #[derive(Clone, Debug)]
2983 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
2984
2985 impl CreateSpoke {
2986 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2987 Self(RequestBuilder::new(stub))
2988 }
2989
2990 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
2992 self.0.request = v.into();
2993 self
2994 }
2995
2996 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2998 self.0.options = v.into();
2999 self
3000 }
3001
3002 pub async fn send(self) -> Result<longrunning::model::Operation> {
3009 (*self.0.stub)
3010 .create_spoke(self.0.request, self.0.options)
3011 .await
3012 .map(gax::response::Response::into_body)
3013 }
3014
3015 pub fn poller(
3017 self,
3018 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
3019 type Operation = lro::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
3020 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3021 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3022
3023 let stub = self.0.stub.clone();
3024 let mut options = self.0.options.clone();
3025 options.set_retry_policy(gax::retry_policy::NeverRetry);
3026 let query = move |name| {
3027 let stub = stub.clone();
3028 let options = options.clone();
3029 async {
3030 let op = GetOperation::new(stub)
3031 .set_name(name)
3032 .with_options(options)
3033 .send()
3034 .await?;
3035 Ok(Operation::new(op))
3036 }
3037 };
3038
3039 let start = move || async {
3040 let op = self.send().await?;
3041 Ok(Operation::new(op))
3042 };
3043
3044 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3045 }
3046
3047 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3049 self.0.request.parent = v.into();
3050 self
3051 }
3052
3053 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3055 self.0.request.spoke_id = v.into();
3056 self
3057 }
3058
3059 pub fn set_spoke<T: Into<std::option::Option<crate::model::Spoke>>>(
3061 mut self,
3062 v: T,
3063 ) -> Self {
3064 self.0.request.spoke = v.into();
3065 self
3066 }
3067
3068 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3070 self.0.request.request_id = v.into();
3071 self
3072 }
3073 }
3074
3075 #[doc(hidden)]
3076 impl gax::options::internal::RequestBuilder for CreateSpoke {
3077 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3078 &mut self.0.options
3079 }
3080 }
3081
3082 #[derive(Clone, Debug)]
3084 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
3085
3086 impl UpdateSpoke {
3087 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3088 Self(RequestBuilder::new(stub))
3089 }
3090
3091 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
3093 self.0.request = v.into();
3094 self
3095 }
3096
3097 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3099 self.0.options = v.into();
3100 self
3101 }
3102
3103 pub async fn send(self) -> Result<longrunning::model::Operation> {
3110 (*self.0.stub)
3111 .update_spoke(self.0.request, self.0.options)
3112 .await
3113 .map(gax::response::Response::into_body)
3114 }
3115
3116 pub fn poller(
3118 self,
3119 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
3120 type Operation = lro::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
3121 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3122 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3123
3124 let stub = self.0.stub.clone();
3125 let mut options = self.0.options.clone();
3126 options.set_retry_policy(gax::retry_policy::NeverRetry);
3127 let query = move |name| {
3128 let stub = stub.clone();
3129 let options = options.clone();
3130 async {
3131 let op = GetOperation::new(stub)
3132 .set_name(name)
3133 .with_options(options)
3134 .send()
3135 .await?;
3136 Ok(Operation::new(op))
3137 }
3138 };
3139
3140 let start = move || async {
3141 let op = self.send().await?;
3142 Ok(Operation::new(op))
3143 };
3144
3145 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3146 }
3147
3148 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
3150 mut self,
3151 v: T,
3152 ) -> Self {
3153 self.0.request.update_mask = v.into();
3154 self
3155 }
3156
3157 pub fn set_spoke<T: Into<std::option::Option<crate::model::Spoke>>>(
3159 mut self,
3160 v: T,
3161 ) -> Self {
3162 self.0.request.spoke = v.into();
3163 self
3164 }
3165
3166 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3168 self.0.request.request_id = v.into();
3169 self
3170 }
3171 }
3172
3173 #[doc(hidden)]
3174 impl gax::options::internal::RequestBuilder for UpdateSpoke {
3175 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3176 &mut self.0.options
3177 }
3178 }
3179
3180 #[derive(Clone, Debug)]
3182 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
3183
3184 impl RejectHubSpoke {
3185 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3186 Self(RequestBuilder::new(stub))
3187 }
3188
3189 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
3191 self.0.request = v.into();
3192 self
3193 }
3194
3195 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3197 self.0.options = v.into();
3198 self
3199 }
3200
3201 pub async fn send(self) -> Result<longrunning::model::Operation> {
3208 (*self.0.stub)
3209 .reject_hub_spoke(self.0.request, self.0.options)
3210 .await
3211 .map(gax::response::Response::into_body)
3212 }
3213
3214 pub fn poller(
3216 self,
3217 ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
3218 {
3219 type Operation = lro::Operation<
3220 crate::model::RejectHubSpokeResponse,
3221 crate::model::OperationMetadata,
3222 >;
3223 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3224 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3225
3226 let stub = self.0.stub.clone();
3227 let mut options = self.0.options.clone();
3228 options.set_retry_policy(gax::retry_policy::NeverRetry);
3229 let query = move |name| {
3230 let stub = stub.clone();
3231 let options = options.clone();
3232 async {
3233 let op = GetOperation::new(stub)
3234 .set_name(name)
3235 .with_options(options)
3236 .send()
3237 .await?;
3238 Ok(Operation::new(op))
3239 }
3240 };
3241
3242 let start = move || async {
3243 let op = self.send().await?;
3244 Ok(Operation::new(op))
3245 };
3246
3247 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3248 }
3249
3250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3252 self.0.request.name = v.into();
3253 self
3254 }
3255
3256 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
3258 self.0.request.spoke_uri = v.into();
3259 self
3260 }
3261
3262 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3264 self.0.request.request_id = v.into();
3265 self
3266 }
3267
3268 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
3270 self.0.request.details = v.into();
3271 self
3272 }
3273 }
3274
3275 #[doc(hidden)]
3276 impl gax::options::internal::RequestBuilder for RejectHubSpoke {
3277 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3278 &mut self.0.options
3279 }
3280 }
3281
3282 #[derive(Clone, Debug)]
3284 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
3285
3286 impl AcceptHubSpoke {
3287 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3288 Self(RequestBuilder::new(stub))
3289 }
3290
3291 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
3293 self.0.request = v.into();
3294 self
3295 }
3296
3297 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3299 self.0.options = v.into();
3300 self
3301 }
3302
3303 pub async fn send(self) -> Result<longrunning::model::Operation> {
3310 (*self.0.stub)
3311 .accept_hub_spoke(self.0.request, self.0.options)
3312 .await
3313 .map(gax::response::Response::into_body)
3314 }
3315
3316 pub fn poller(
3318 self,
3319 ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
3320 {
3321 type Operation = lro::Operation<
3322 crate::model::AcceptHubSpokeResponse,
3323 crate::model::OperationMetadata,
3324 >;
3325 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3326 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3327
3328 let stub = self.0.stub.clone();
3329 let mut options = self.0.options.clone();
3330 options.set_retry_policy(gax::retry_policy::NeverRetry);
3331 let query = move |name| {
3332 let stub = stub.clone();
3333 let options = options.clone();
3334 async {
3335 let op = GetOperation::new(stub)
3336 .set_name(name)
3337 .with_options(options)
3338 .send()
3339 .await?;
3340 Ok(Operation::new(op))
3341 }
3342 };
3343
3344 let start = move || async {
3345 let op = self.send().await?;
3346 Ok(Operation::new(op))
3347 };
3348
3349 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3350 }
3351
3352 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3354 self.0.request.name = v.into();
3355 self
3356 }
3357
3358 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
3360 self.0.request.spoke_uri = v.into();
3361 self
3362 }
3363
3364 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3366 self.0.request.request_id = v.into();
3367 self
3368 }
3369 }
3370
3371 #[doc(hidden)]
3372 impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
3373 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3374 &mut self.0.options
3375 }
3376 }
3377
3378 #[derive(Clone, Debug)]
3380 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
3381
3382 impl AcceptSpokeUpdate {
3383 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3384 Self(RequestBuilder::new(stub))
3385 }
3386
3387 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
3389 mut self,
3390 v: V,
3391 ) -> Self {
3392 self.0.request = v.into();
3393 self
3394 }
3395
3396 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3398 self.0.options = v.into();
3399 self
3400 }
3401
3402 pub async fn send(self) -> Result<longrunning::model::Operation> {
3409 (*self.0.stub)
3410 .accept_spoke_update(self.0.request, self.0.options)
3411 .await
3412 .map(gax::response::Response::into_body)
3413 }
3414
3415 pub fn poller(
3417 self,
3418 ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
3419 {
3420 type Operation = lro::Operation<
3421 crate::model::AcceptSpokeUpdateResponse,
3422 crate::model::OperationMetadata,
3423 >;
3424 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3425 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3426
3427 let stub = self.0.stub.clone();
3428 let mut options = self.0.options.clone();
3429 options.set_retry_policy(gax::retry_policy::NeverRetry);
3430 let query = move |name| {
3431 let stub = stub.clone();
3432 let options = options.clone();
3433 async {
3434 let op = GetOperation::new(stub)
3435 .set_name(name)
3436 .with_options(options)
3437 .send()
3438 .await?;
3439 Ok(Operation::new(op))
3440 }
3441 };
3442
3443 let start = move || async {
3444 let op = self.send().await?;
3445 Ok(Operation::new(op))
3446 };
3447
3448 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3449 }
3450
3451 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3453 self.0.request.name = v.into();
3454 self
3455 }
3456
3457 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
3459 self.0.request.spoke_uri = v.into();
3460 self
3461 }
3462
3463 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3465 self.0.request.spoke_etag = v.into();
3466 self
3467 }
3468
3469 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3471 self.0.request.request_id = v.into();
3472 self
3473 }
3474 }
3475
3476 #[doc(hidden)]
3477 impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
3478 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3479 &mut self.0.options
3480 }
3481 }
3482
3483 #[derive(Clone, Debug)]
3485 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
3486
3487 impl RejectSpokeUpdate {
3488 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3489 Self(RequestBuilder::new(stub))
3490 }
3491
3492 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
3494 mut self,
3495 v: V,
3496 ) -> Self {
3497 self.0.request = v.into();
3498 self
3499 }
3500
3501 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3503 self.0.options = v.into();
3504 self
3505 }
3506
3507 pub async fn send(self) -> Result<longrunning::model::Operation> {
3514 (*self.0.stub)
3515 .reject_spoke_update(self.0.request, self.0.options)
3516 .await
3517 .map(gax::response::Response::into_body)
3518 }
3519
3520 pub fn poller(
3522 self,
3523 ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
3524 {
3525 type Operation = lro::Operation<
3526 crate::model::RejectSpokeUpdateResponse,
3527 crate::model::OperationMetadata,
3528 >;
3529 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3530 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3531
3532 let stub = self.0.stub.clone();
3533 let mut options = self.0.options.clone();
3534 options.set_retry_policy(gax::retry_policy::NeverRetry);
3535 let query = move |name| {
3536 let stub = stub.clone();
3537 let options = options.clone();
3538 async {
3539 let op = GetOperation::new(stub)
3540 .set_name(name)
3541 .with_options(options)
3542 .send()
3543 .await?;
3544 Ok(Operation::new(op))
3545 }
3546 };
3547
3548 let start = move || async {
3549 let op = self.send().await?;
3550 Ok(Operation::new(op))
3551 };
3552
3553 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3554 }
3555
3556 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3558 self.0.request.name = v.into();
3559 self
3560 }
3561
3562 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
3564 self.0.request.spoke_uri = v.into();
3565 self
3566 }
3567
3568 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3570 self.0.request.spoke_etag = v.into();
3571 self
3572 }
3573
3574 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
3576 self.0.request.details = v.into();
3577 self
3578 }
3579
3580 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3582 self.0.request.request_id = v.into();
3583 self
3584 }
3585 }
3586
3587 #[doc(hidden)]
3588 impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
3589 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3590 &mut self.0.options
3591 }
3592 }
3593
3594 #[derive(Clone, Debug)]
3596 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
3597
3598 impl DeleteSpoke {
3599 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3600 Self(RequestBuilder::new(stub))
3601 }
3602
3603 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
3605 self.0.request = v.into();
3606 self
3607 }
3608
3609 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3611 self.0.options = v.into();
3612 self
3613 }
3614
3615 pub async fn send(self) -> Result<longrunning::model::Operation> {
3622 (*self.0.stub)
3623 .delete_spoke(self.0.request, self.0.options)
3624 .await
3625 .map(gax::response::Response::into_body)
3626 }
3627
3628 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
3630 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
3631 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3632 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3633
3634 let stub = self.0.stub.clone();
3635 let mut options = self.0.options.clone();
3636 options.set_retry_policy(gax::retry_policy::NeverRetry);
3637 let query = move |name| {
3638 let stub = stub.clone();
3639 let options = options.clone();
3640 async {
3641 let op = GetOperation::new(stub)
3642 .set_name(name)
3643 .with_options(options)
3644 .send()
3645 .await?;
3646 Ok(Operation::new(op))
3647 }
3648 };
3649
3650 let start = move || async {
3651 let op = self.send().await?;
3652 Ok(Operation::new(op))
3653 };
3654
3655 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3656 }
3657
3658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3660 self.0.request.name = v.into();
3661 self
3662 }
3663
3664 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3666 self.0.request.request_id = v.into();
3667 self
3668 }
3669 }
3670
3671 #[doc(hidden)]
3672 impl gax::options::internal::RequestBuilder for DeleteSpoke {
3673 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3674 &mut self.0.options
3675 }
3676 }
3677
3678 #[derive(Clone, Debug)]
3680 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
3681
3682 impl GetRouteTable {
3683 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3684 Self(RequestBuilder::new(stub))
3685 }
3686
3687 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
3689 self.0.request = v.into();
3690 self
3691 }
3692
3693 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3695 self.0.options = v.into();
3696 self
3697 }
3698
3699 pub async fn send(self) -> Result<crate::model::RouteTable> {
3701 (*self.0.stub)
3702 .get_route_table(self.0.request, self.0.options)
3703 .await
3704 .map(gax::response::Response::into_body)
3705 }
3706
3707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3709 self.0.request.name = v.into();
3710 self
3711 }
3712 }
3713
3714 #[doc(hidden)]
3715 impl gax::options::internal::RequestBuilder for GetRouteTable {
3716 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3717 &mut self.0.options
3718 }
3719 }
3720
3721 #[derive(Clone, Debug)]
3723 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
3724
3725 impl GetRoute {
3726 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3727 Self(RequestBuilder::new(stub))
3728 }
3729
3730 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
3732 self.0.request = v.into();
3733 self
3734 }
3735
3736 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3738 self.0.options = v.into();
3739 self
3740 }
3741
3742 pub async fn send(self) -> Result<crate::model::Route> {
3744 (*self.0.stub)
3745 .get_route(self.0.request, self.0.options)
3746 .await
3747 .map(gax::response::Response::into_body)
3748 }
3749
3750 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3752 self.0.request.name = v.into();
3753 self
3754 }
3755 }
3756
3757 #[doc(hidden)]
3758 impl gax::options::internal::RequestBuilder for GetRoute {
3759 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3760 &mut self.0.options
3761 }
3762 }
3763
3764 #[derive(Clone, Debug)]
3766 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
3767
3768 impl ListRoutes {
3769 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3770 Self(RequestBuilder::new(stub))
3771 }
3772
3773 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
3775 self.0.request = v.into();
3776 self
3777 }
3778
3779 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3781 self.0.options = v.into();
3782 self
3783 }
3784
3785 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
3787 (*self.0.stub)
3788 .list_routes(self.0.request, self.0.options)
3789 .await
3790 .map(gax::response::Response::into_body)
3791 }
3792
3793 pub async fn paginator(
3795 self,
3796 ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
3797 {
3798 use std::clone::Clone;
3799 let token = self.0.request.page_token.clone();
3800 let execute = move |token: String| {
3801 let mut builder = self.clone();
3802 builder.0.request = builder.0.request.set_page_token(token);
3803 builder.send()
3804 };
3805 gax::paginator::internal::new_paginator(token, execute)
3806 }
3807
3808 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3810 self.0.request.parent = v.into();
3811 self
3812 }
3813
3814 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3816 self.0.request.page_size = v.into();
3817 self
3818 }
3819
3820 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.0.request.page_token = v.into();
3823 self
3824 }
3825
3826 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3828 self.0.request.filter = v.into();
3829 self
3830 }
3831
3832 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3834 self.0.request.order_by = v.into();
3835 self
3836 }
3837 }
3838
3839 #[doc(hidden)]
3840 impl gax::options::internal::RequestBuilder for ListRoutes {
3841 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3842 &mut self.0.options
3843 }
3844 }
3845
3846 #[derive(Clone, Debug)]
3848 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
3849
3850 impl ListRouteTables {
3851 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3852 Self(RequestBuilder::new(stub))
3853 }
3854
3855 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
3857 self.0.request = v.into();
3858 self
3859 }
3860
3861 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3863 self.0.options = v.into();
3864 self
3865 }
3866
3867 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
3869 (*self.0.stub)
3870 .list_route_tables(self.0.request, self.0.options)
3871 .await
3872 .map(gax::response::Response::into_body)
3873 }
3874
3875 pub async fn paginator(
3877 self,
3878 ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
3879 {
3880 use std::clone::Clone;
3881 let token = self.0.request.page_token.clone();
3882 let execute = move |token: String| {
3883 let mut builder = self.clone();
3884 builder.0.request = builder.0.request.set_page_token(token);
3885 builder.send()
3886 };
3887 gax::paginator::internal::new_paginator(token, execute)
3888 }
3889
3890 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892 self.0.request.parent = v.into();
3893 self
3894 }
3895
3896 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3898 self.0.request.page_size = v.into();
3899 self
3900 }
3901
3902 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3904 self.0.request.page_token = v.into();
3905 self
3906 }
3907
3908 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3910 self.0.request.filter = v.into();
3911 self
3912 }
3913
3914 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3916 self.0.request.order_by = v.into();
3917 self
3918 }
3919 }
3920
3921 #[doc(hidden)]
3922 impl gax::options::internal::RequestBuilder for ListRouteTables {
3923 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3924 &mut self.0.options
3925 }
3926 }
3927
3928 #[derive(Clone, Debug)]
3930 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
3931
3932 impl GetGroup {
3933 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3934 Self(RequestBuilder::new(stub))
3935 }
3936
3937 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
3939 self.0.request = v.into();
3940 self
3941 }
3942
3943 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3945 self.0.options = v.into();
3946 self
3947 }
3948
3949 pub async fn send(self) -> Result<crate::model::Group> {
3951 (*self.0.stub)
3952 .get_group(self.0.request, self.0.options)
3953 .await
3954 .map(gax::response::Response::into_body)
3955 }
3956
3957 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3959 self.0.request.name = v.into();
3960 self
3961 }
3962 }
3963
3964 #[doc(hidden)]
3965 impl gax::options::internal::RequestBuilder for GetGroup {
3966 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3967 &mut self.0.options
3968 }
3969 }
3970
3971 #[derive(Clone, Debug)]
3973 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
3974
3975 impl ListGroups {
3976 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3977 Self(RequestBuilder::new(stub))
3978 }
3979
3980 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
3982 self.0.request = v.into();
3983 self
3984 }
3985
3986 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3988 self.0.options = v.into();
3989 self
3990 }
3991
3992 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
3994 (*self.0.stub)
3995 .list_groups(self.0.request, self.0.options)
3996 .await
3997 .map(gax::response::Response::into_body)
3998 }
3999
4000 pub async fn paginator(
4002 self,
4003 ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
4004 {
4005 use std::clone::Clone;
4006 let token = self.0.request.page_token.clone();
4007 let execute = move |token: String| {
4008 let mut builder = self.clone();
4009 builder.0.request = builder.0.request.set_page_token(token);
4010 builder.send()
4011 };
4012 gax::paginator::internal::new_paginator(token, execute)
4013 }
4014
4015 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4017 self.0.request.parent = v.into();
4018 self
4019 }
4020
4021 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4023 self.0.request.page_size = v.into();
4024 self
4025 }
4026
4027 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4029 self.0.request.page_token = v.into();
4030 self
4031 }
4032
4033 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4035 self.0.request.filter = v.into();
4036 self
4037 }
4038
4039 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4041 self.0.request.order_by = v.into();
4042 self
4043 }
4044 }
4045
4046 #[doc(hidden)]
4047 impl gax::options::internal::RequestBuilder for ListGroups {
4048 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4049 &mut self.0.options
4050 }
4051 }
4052
4053 #[derive(Clone, Debug)]
4055 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
4056
4057 impl UpdateGroup {
4058 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4059 Self(RequestBuilder::new(stub))
4060 }
4061
4062 pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
4064 self.0.request = v.into();
4065 self
4066 }
4067
4068 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4070 self.0.options = v.into();
4071 self
4072 }
4073
4074 pub async fn send(self) -> Result<longrunning::model::Operation> {
4081 (*self.0.stub)
4082 .update_group(self.0.request, self.0.options)
4083 .await
4084 .map(gax::response::Response::into_body)
4085 }
4086
4087 pub fn poller(
4089 self,
4090 ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
4091 type Operation = lro::Operation<crate::model::Group, crate::model::OperationMetadata>;
4092 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4093 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4094
4095 let stub = self.0.stub.clone();
4096 let mut options = self.0.options.clone();
4097 options.set_retry_policy(gax::retry_policy::NeverRetry);
4098 let query = move |name| {
4099 let stub = stub.clone();
4100 let options = options.clone();
4101 async {
4102 let op = GetOperation::new(stub)
4103 .set_name(name)
4104 .with_options(options)
4105 .send()
4106 .await?;
4107 Ok(Operation::new(op))
4108 }
4109 };
4110
4111 let start = move || async {
4112 let op = self.send().await?;
4113 Ok(Operation::new(op))
4114 };
4115
4116 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4117 }
4118
4119 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
4121 mut self,
4122 v: T,
4123 ) -> Self {
4124 self.0.request.update_mask = v.into();
4125 self
4126 }
4127
4128 pub fn set_group<T: Into<std::option::Option<crate::model::Group>>>(
4130 mut self,
4131 v: T,
4132 ) -> Self {
4133 self.0.request.group = v.into();
4134 self
4135 }
4136
4137 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4139 self.0.request.request_id = v.into();
4140 self
4141 }
4142 }
4143
4144 #[doc(hidden)]
4145 impl gax::options::internal::RequestBuilder for UpdateGroup {
4146 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4147 &mut self.0.options
4148 }
4149 }
4150
4151 #[derive(Clone, Debug)]
4153 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4154
4155 impl ListLocations {
4156 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4157 Self(RequestBuilder::new(stub))
4158 }
4159
4160 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4162 mut self,
4163 v: V,
4164 ) -> Self {
4165 self.0.request = v.into();
4166 self
4167 }
4168
4169 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4171 self.0.options = v.into();
4172 self
4173 }
4174
4175 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4177 (*self.0.stub)
4178 .list_locations(self.0.request, self.0.options)
4179 .await
4180 .map(gax::response::Response::into_body)
4181 }
4182
4183 pub async fn paginator(
4185 self,
4186 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4187 {
4188 use std::clone::Clone;
4189 let token = self.0.request.page_token.clone();
4190 let execute = move |token: String| {
4191 let mut builder = self.clone();
4192 builder.0.request = builder.0.request.set_page_token(token);
4193 builder.send()
4194 };
4195 gax::paginator::internal::new_paginator(token, execute)
4196 }
4197
4198 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4200 self.0.request.name = v.into();
4201 self
4202 }
4203
4204 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4206 self.0.request.filter = v.into();
4207 self
4208 }
4209
4210 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4212 self.0.request.page_size = v.into();
4213 self
4214 }
4215
4216 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4218 self.0.request.page_token = v.into();
4219 self
4220 }
4221 }
4222
4223 #[doc(hidden)]
4224 impl gax::options::internal::RequestBuilder for ListLocations {
4225 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4226 &mut self.0.options
4227 }
4228 }
4229
4230 #[derive(Clone, Debug)]
4232 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4233
4234 impl GetLocation {
4235 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4236 Self(RequestBuilder::new(stub))
4237 }
4238
4239 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4241 self.0.request = v.into();
4242 self
4243 }
4244
4245 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4247 self.0.options = v.into();
4248 self
4249 }
4250
4251 pub async fn send(self) -> Result<location::model::Location> {
4253 (*self.0.stub)
4254 .get_location(self.0.request, self.0.options)
4255 .await
4256 .map(gax::response::Response::into_body)
4257 }
4258
4259 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4261 self.0.request.name = v.into();
4262 self
4263 }
4264 }
4265
4266 #[doc(hidden)]
4267 impl gax::options::internal::RequestBuilder for GetLocation {
4268 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4269 &mut self.0.options
4270 }
4271 }
4272
4273 #[derive(Clone, Debug)]
4275 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4276
4277 impl SetIamPolicy {
4278 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4279 Self(RequestBuilder::new(stub))
4280 }
4281
4282 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4284 self.0.request = v.into();
4285 self
4286 }
4287
4288 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4290 self.0.options = v.into();
4291 self
4292 }
4293
4294 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4296 (*self.0.stub)
4297 .set_iam_policy(self.0.request, self.0.options)
4298 .await
4299 .map(gax::response::Response::into_body)
4300 }
4301
4302 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4304 self.0.request.resource = v.into();
4305 self
4306 }
4307
4308 pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
4310 mut self,
4311 v: T,
4312 ) -> Self {
4313 self.0.request.policy = v.into();
4314 self
4315 }
4316
4317 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
4319 mut self,
4320 v: T,
4321 ) -> Self {
4322 self.0.request.update_mask = v.into();
4323 self
4324 }
4325 }
4326
4327 #[doc(hidden)]
4328 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4329 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4330 &mut self.0.options
4331 }
4332 }
4333
4334 #[derive(Clone, Debug)]
4336 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4337
4338 impl GetIamPolicy {
4339 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4340 Self(RequestBuilder::new(stub))
4341 }
4342
4343 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4345 self.0.request = v.into();
4346 self
4347 }
4348
4349 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4351 self.0.options = v.into();
4352 self
4353 }
4354
4355 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4357 (*self.0.stub)
4358 .get_iam_policy(self.0.request, self.0.options)
4359 .await
4360 .map(gax::response::Response::into_body)
4361 }
4362
4363 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4365 self.0.request.resource = v.into();
4366 self
4367 }
4368
4369 pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
4371 mut self,
4372 v: T,
4373 ) -> Self {
4374 self.0.request.options = v.into();
4375 self
4376 }
4377 }
4378
4379 #[doc(hidden)]
4380 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4381 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4382 &mut self.0.options
4383 }
4384 }
4385
4386 #[derive(Clone, Debug)]
4388 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4389
4390 impl TestIamPermissions {
4391 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4392 Self(RequestBuilder::new(stub))
4393 }
4394
4395 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4397 mut self,
4398 v: V,
4399 ) -> Self {
4400 self.0.request = v.into();
4401 self
4402 }
4403
4404 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4406 self.0.options = v.into();
4407 self
4408 }
4409
4410 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4412 (*self.0.stub)
4413 .test_iam_permissions(self.0.request, self.0.options)
4414 .await
4415 .map(gax::response::Response::into_body)
4416 }
4417
4418 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4420 self.0.request.resource = v.into();
4421 self
4422 }
4423
4424 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4426 where
4427 T: std::iter::IntoIterator<Item = V>,
4428 V: std::convert::Into<std::string::String>,
4429 {
4430 use std::iter::Iterator;
4431 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4432 self
4433 }
4434 }
4435
4436 #[doc(hidden)]
4437 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4438 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4439 &mut self.0.options
4440 }
4441 }
4442
4443 #[derive(Clone, Debug)]
4445 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4446
4447 impl ListOperations {
4448 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4449 Self(RequestBuilder::new(stub))
4450 }
4451
4452 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4454 mut self,
4455 v: V,
4456 ) -> Self {
4457 self.0.request = v.into();
4458 self
4459 }
4460
4461 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4463 self.0.options = v.into();
4464 self
4465 }
4466
4467 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4469 (*self.0.stub)
4470 .list_operations(self.0.request, self.0.options)
4471 .await
4472 .map(gax::response::Response::into_body)
4473 }
4474
4475 pub async fn paginator(
4477 self,
4478 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4479 {
4480 use std::clone::Clone;
4481 let token = self.0.request.page_token.clone();
4482 let execute = move |token: String| {
4483 let mut builder = self.clone();
4484 builder.0.request = builder.0.request.set_page_token(token);
4485 builder.send()
4486 };
4487 gax::paginator::internal::new_paginator(token, execute)
4488 }
4489
4490 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4492 self.0.request.name = v.into();
4493 self
4494 }
4495
4496 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4498 self.0.request.filter = v.into();
4499 self
4500 }
4501
4502 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4504 self.0.request.page_size = v.into();
4505 self
4506 }
4507
4508 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510 self.0.request.page_token = v.into();
4511 self
4512 }
4513 }
4514
4515 #[doc(hidden)]
4516 impl gax::options::internal::RequestBuilder for ListOperations {
4517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4518 &mut self.0.options
4519 }
4520 }
4521
4522 #[derive(Clone, Debug)]
4524 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4525
4526 impl GetOperation {
4527 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4528 Self(RequestBuilder::new(stub))
4529 }
4530
4531 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4533 mut self,
4534 v: V,
4535 ) -> Self {
4536 self.0.request = v.into();
4537 self
4538 }
4539
4540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4542 self.0.options = v.into();
4543 self
4544 }
4545
4546 pub async fn send(self) -> Result<longrunning::model::Operation> {
4548 (*self.0.stub)
4549 .get_operation(self.0.request, self.0.options)
4550 .await
4551 .map(gax::response::Response::into_body)
4552 }
4553
4554 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4556 self.0.request.name = v.into();
4557 self
4558 }
4559 }
4560
4561 #[doc(hidden)]
4562 impl gax::options::internal::RequestBuilder for GetOperation {
4563 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4564 &mut self.0.options
4565 }
4566 }
4567
4568 #[derive(Clone, Debug)]
4570 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4571
4572 impl DeleteOperation {
4573 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4574 Self(RequestBuilder::new(stub))
4575 }
4576
4577 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4579 mut self,
4580 v: V,
4581 ) -> Self {
4582 self.0.request = v.into();
4583 self
4584 }
4585
4586 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4588 self.0.options = v.into();
4589 self
4590 }
4591
4592 pub async fn send(self) -> Result<()> {
4594 (*self.0.stub)
4595 .delete_operation(self.0.request, self.0.options)
4596 .await
4597 .map(gax::response::Response::into_body)
4598 }
4599
4600 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4602 self.0.request.name = v.into();
4603 self
4604 }
4605 }
4606
4607 #[doc(hidden)]
4608 impl gax::options::internal::RequestBuilder for DeleteOperation {
4609 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4610 &mut self.0.options
4611 }
4612 }
4613
4614 #[derive(Clone, Debug)]
4616 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4617
4618 impl CancelOperation {
4619 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4620 Self(RequestBuilder::new(stub))
4621 }
4622
4623 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4625 mut self,
4626 v: V,
4627 ) -> Self {
4628 self.0.request = v.into();
4629 self
4630 }
4631
4632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4634 self.0.options = v.into();
4635 self
4636 }
4637
4638 pub async fn send(self) -> Result<()> {
4640 (*self.0.stub)
4641 .cancel_operation(self.0.request, self.0.options)
4642 .await
4643 .map(gax::response::Response::into_body)
4644 }
4645
4646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4648 self.0.request.name = v.into();
4649 self
4650 }
4651 }
4652
4653 #[doc(hidden)]
4654 impl gax::options::internal::RequestBuilder for CancelOperation {
4655 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4656 &mut self.0.options
4657 }
4658 }
4659}
4660
4661pub mod policy_based_routing_service {
4662 use crate::Result;
4663 use std::sync::Arc;
4664
4665 pub type ClientBuilder =
4679 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4680
4681 pub(crate) mod client {
4682 use super::super::super::client::PolicyBasedRoutingService;
4683 pub struct Factory;
4684 impl gax::client_builder::internal::ClientFactory for Factory {
4685 type Client = PolicyBasedRoutingService;
4686 type Credentials = gaxi::options::Credentials;
4687 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
4688 Self::Client::new(config).await
4689 }
4690 }
4691 }
4692
4693 #[derive(Clone, Debug)]
4695 pub(crate) struct RequestBuilder<R: std::default::Default> {
4696 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4697 request: R,
4698 options: gax::options::RequestOptions,
4699 }
4700
4701 impl<R> RequestBuilder<R>
4702 where
4703 R: std::default::Default,
4704 {
4705 pub(crate) fn new(
4706 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4707 ) -> Self {
4708 Self {
4709 stub,
4710 request: R::default(),
4711 options: gax::options::RequestOptions::default(),
4712 }
4713 }
4714 }
4715
4716 #[derive(Clone, Debug)]
4718 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
4719
4720 impl ListPolicyBasedRoutes {
4721 pub(crate) fn new(
4722 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4723 ) -> Self {
4724 Self(RequestBuilder::new(stub))
4725 }
4726
4727 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
4729 mut self,
4730 v: V,
4731 ) -> Self {
4732 self.0.request = v.into();
4733 self
4734 }
4735
4736 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4738 self.0.options = v.into();
4739 self
4740 }
4741
4742 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
4744 (*self.0.stub)
4745 .list_policy_based_routes(self.0.request, self.0.options)
4746 .await
4747 .map(gax::response::Response::into_body)
4748 }
4749
4750 pub async fn paginator(
4752 self,
4753 ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
4754 {
4755 use std::clone::Clone;
4756 let token = self.0.request.page_token.clone();
4757 let execute = move |token: String| {
4758 let mut builder = self.clone();
4759 builder.0.request = builder.0.request.set_page_token(token);
4760 builder.send()
4761 };
4762 gax::paginator::internal::new_paginator(token, execute)
4763 }
4764
4765 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4767 self.0.request.parent = v.into();
4768 self
4769 }
4770
4771 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4773 self.0.request.page_size = v.into();
4774 self
4775 }
4776
4777 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4779 self.0.request.page_token = v.into();
4780 self
4781 }
4782
4783 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4785 self.0.request.filter = v.into();
4786 self
4787 }
4788
4789 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4791 self.0.request.order_by = v.into();
4792 self
4793 }
4794 }
4795
4796 #[doc(hidden)]
4797 impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
4798 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4799 &mut self.0.options
4800 }
4801 }
4802
4803 #[derive(Clone, Debug)]
4805 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
4806
4807 impl GetPolicyBasedRoute {
4808 pub(crate) fn new(
4809 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4810 ) -> Self {
4811 Self(RequestBuilder::new(stub))
4812 }
4813
4814 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
4816 mut self,
4817 v: V,
4818 ) -> Self {
4819 self.0.request = v.into();
4820 self
4821 }
4822
4823 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4825 self.0.options = v.into();
4826 self
4827 }
4828
4829 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
4831 (*self.0.stub)
4832 .get_policy_based_route(self.0.request, self.0.options)
4833 .await
4834 .map(gax::response::Response::into_body)
4835 }
4836
4837 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4839 self.0.request.name = v.into();
4840 self
4841 }
4842 }
4843
4844 #[doc(hidden)]
4845 impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
4846 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4847 &mut self.0.options
4848 }
4849 }
4850
4851 #[derive(Clone, Debug)]
4853 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
4854
4855 impl CreatePolicyBasedRoute {
4856 pub(crate) fn new(
4857 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4858 ) -> Self {
4859 Self(RequestBuilder::new(stub))
4860 }
4861
4862 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
4864 mut self,
4865 v: V,
4866 ) -> Self {
4867 self.0.request = v.into();
4868 self
4869 }
4870
4871 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4873 self.0.options = v.into();
4874 self
4875 }
4876
4877 pub async fn send(self) -> Result<longrunning::model::Operation> {
4884 (*self.0.stub)
4885 .create_policy_based_route(self.0.request, self.0.options)
4886 .await
4887 .map(gax::response::Response::into_body)
4888 }
4889
4890 pub fn poller(
4892 self,
4893 ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
4894 {
4895 type Operation =
4896 lro::Operation<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>;
4897 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4898 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4899
4900 let stub = self.0.stub.clone();
4901 let mut options = self.0.options.clone();
4902 options.set_retry_policy(gax::retry_policy::NeverRetry);
4903 let query = move |name| {
4904 let stub = stub.clone();
4905 let options = options.clone();
4906 async {
4907 let op = GetOperation::new(stub)
4908 .set_name(name)
4909 .with_options(options)
4910 .send()
4911 .await?;
4912 Ok(Operation::new(op))
4913 }
4914 };
4915
4916 let start = move || async {
4917 let op = self.send().await?;
4918 Ok(Operation::new(op))
4919 };
4920
4921 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4922 }
4923
4924 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4926 self.0.request.parent = v.into();
4927 self
4928 }
4929
4930 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4932 self.0.request.policy_based_route_id = v.into();
4933 self
4934 }
4935
4936 pub fn set_policy_based_route<
4938 T: Into<std::option::Option<crate::model::PolicyBasedRoute>>,
4939 >(
4940 mut self,
4941 v: T,
4942 ) -> Self {
4943 self.0.request.policy_based_route = v.into();
4944 self
4945 }
4946
4947 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4949 self.0.request.request_id = v.into();
4950 self
4951 }
4952 }
4953
4954 #[doc(hidden)]
4955 impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
4956 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4957 &mut self.0.options
4958 }
4959 }
4960
4961 #[derive(Clone, Debug)]
4963 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
4964
4965 impl DeletePolicyBasedRoute {
4966 pub(crate) fn new(
4967 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4968 ) -> Self {
4969 Self(RequestBuilder::new(stub))
4970 }
4971
4972 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
4974 mut self,
4975 v: V,
4976 ) -> Self {
4977 self.0.request = v.into();
4978 self
4979 }
4980
4981 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4983 self.0.options = v.into();
4984 self
4985 }
4986
4987 pub async fn send(self) -> Result<longrunning::model::Operation> {
4994 (*self.0.stub)
4995 .delete_policy_based_route(self.0.request, self.0.options)
4996 .await
4997 .map(gax::response::Response::into_body)
4998 }
4999
5000 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
5002 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
5003 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5004 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5005
5006 let stub = self.0.stub.clone();
5007 let mut options = self.0.options.clone();
5008 options.set_retry_policy(gax::retry_policy::NeverRetry);
5009 let query = move |name| {
5010 let stub = stub.clone();
5011 let options = options.clone();
5012 async {
5013 let op = GetOperation::new(stub)
5014 .set_name(name)
5015 .with_options(options)
5016 .send()
5017 .await?;
5018 Ok(Operation::new(op))
5019 }
5020 };
5021
5022 let start = move || async {
5023 let op = self.send().await?;
5024 Ok(Operation::new(op))
5025 };
5026
5027 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5028 }
5029
5030 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5032 self.0.request.name = v.into();
5033 self
5034 }
5035
5036 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5038 self.0.request.request_id = v.into();
5039 self
5040 }
5041 }
5042
5043 #[doc(hidden)]
5044 impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
5045 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5046 &mut self.0.options
5047 }
5048 }
5049
5050 #[derive(Clone, Debug)]
5052 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5053
5054 impl ListLocations {
5055 pub(crate) fn new(
5056 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5057 ) -> Self {
5058 Self(RequestBuilder::new(stub))
5059 }
5060
5061 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5063 mut self,
5064 v: V,
5065 ) -> Self {
5066 self.0.request = v.into();
5067 self
5068 }
5069
5070 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5072 self.0.options = v.into();
5073 self
5074 }
5075
5076 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5078 (*self.0.stub)
5079 .list_locations(self.0.request, self.0.options)
5080 .await
5081 .map(gax::response::Response::into_body)
5082 }
5083
5084 pub async fn paginator(
5086 self,
5087 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5088 {
5089 use std::clone::Clone;
5090 let token = self.0.request.page_token.clone();
5091 let execute = move |token: String| {
5092 let mut builder = self.clone();
5093 builder.0.request = builder.0.request.set_page_token(token);
5094 builder.send()
5095 };
5096 gax::paginator::internal::new_paginator(token, execute)
5097 }
5098
5099 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5101 self.0.request.name = v.into();
5102 self
5103 }
5104
5105 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5107 self.0.request.filter = v.into();
5108 self
5109 }
5110
5111 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5113 self.0.request.page_size = v.into();
5114 self
5115 }
5116
5117 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5119 self.0.request.page_token = v.into();
5120 self
5121 }
5122 }
5123
5124 #[doc(hidden)]
5125 impl gax::options::internal::RequestBuilder for ListLocations {
5126 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5127 &mut self.0.options
5128 }
5129 }
5130
5131 #[derive(Clone, Debug)]
5133 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5134
5135 impl GetLocation {
5136 pub(crate) fn new(
5137 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5138 ) -> Self {
5139 Self(RequestBuilder::new(stub))
5140 }
5141
5142 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5144 self.0.request = v.into();
5145 self
5146 }
5147
5148 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5150 self.0.options = v.into();
5151 self
5152 }
5153
5154 pub async fn send(self) -> Result<location::model::Location> {
5156 (*self.0.stub)
5157 .get_location(self.0.request, self.0.options)
5158 .await
5159 .map(gax::response::Response::into_body)
5160 }
5161
5162 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5164 self.0.request.name = v.into();
5165 self
5166 }
5167 }
5168
5169 #[doc(hidden)]
5170 impl gax::options::internal::RequestBuilder for GetLocation {
5171 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5172 &mut self.0.options
5173 }
5174 }
5175
5176 #[derive(Clone, Debug)]
5178 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5179
5180 impl SetIamPolicy {
5181 pub(crate) fn new(
5182 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5183 ) -> Self {
5184 Self(RequestBuilder::new(stub))
5185 }
5186
5187 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5189 self.0.request = v.into();
5190 self
5191 }
5192
5193 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5195 self.0.options = v.into();
5196 self
5197 }
5198
5199 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5201 (*self.0.stub)
5202 .set_iam_policy(self.0.request, self.0.options)
5203 .await
5204 .map(gax::response::Response::into_body)
5205 }
5206
5207 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5209 self.0.request.resource = v.into();
5210 self
5211 }
5212
5213 pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
5215 mut self,
5216 v: T,
5217 ) -> Self {
5218 self.0.request.policy = v.into();
5219 self
5220 }
5221
5222 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
5224 mut self,
5225 v: T,
5226 ) -> Self {
5227 self.0.request.update_mask = v.into();
5228 self
5229 }
5230 }
5231
5232 #[doc(hidden)]
5233 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5234 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5235 &mut self.0.options
5236 }
5237 }
5238
5239 #[derive(Clone, Debug)]
5241 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5242
5243 impl GetIamPolicy {
5244 pub(crate) fn new(
5245 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5246 ) -> Self {
5247 Self(RequestBuilder::new(stub))
5248 }
5249
5250 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5252 self.0.request = v.into();
5253 self
5254 }
5255
5256 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5258 self.0.options = v.into();
5259 self
5260 }
5261
5262 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5264 (*self.0.stub)
5265 .get_iam_policy(self.0.request, self.0.options)
5266 .await
5267 .map(gax::response::Response::into_body)
5268 }
5269
5270 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5272 self.0.request.resource = v.into();
5273 self
5274 }
5275
5276 pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
5278 mut self,
5279 v: T,
5280 ) -> Self {
5281 self.0.request.options = v.into();
5282 self
5283 }
5284 }
5285
5286 #[doc(hidden)]
5287 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5288 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5289 &mut self.0.options
5290 }
5291 }
5292
5293 #[derive(Clone, Debug)]
5295 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5296
5297 impl TestIamPermissions {
5298 pub(crate) fn new(
5299 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5300 ) -> Self {
5301 Self(RequestBuilder::new(stub))
5302 }
5303
5304 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5306 mut self,
5307 v: V,
5308 ) -> Self {
5309 self.0.request = v.into();
5310 self
5311 }
5312
5313 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5315 self.0.options = v.into();
5316 self
5317 }
5318
5319 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5321 (*self.0.stub)
5322 .test_iam_permissions(self.0.request, self.0.options)
5323 .await
5324 .map(gax::response::Response::into_body)
5325 }
5326
5327 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5329 self.0.request.resource = v.into();
5330 self
5331 }
5332
5333 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5335 where
5336 T: std::iter::IntoIterator<Item = V>,
5337 V: std::convert::Into<std::string::String>,
5338 {
5339 use std::iter::Iterator;
5340 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5341 self
5342 }
5343 }
5344
5345 #[doc(hidden)]
5346 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5347 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5348 &mut self.0.options
5349 }
5350 }
5351
5352 #[derive(Clone, Debug)]
5354 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5355
5356 impl ListOperations {
5357 pub(crate) fn new(
5358 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5359 ) -> Self {
5360 Self(RequestBuilder::new(stub))
5361 }
5362
5363 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5365 mut self,
5366 v: V,
5367 ) -> Self {
5368 self.0.request = v.into();
5369 self
5370 }
5371
5372 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5374 self.0.options = v.into();
5375 self
5376 }
5377
5378 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5380 (*self.0.stub)
5381 .list_operations(self.0.request, self.0.options)
5382 .await
5383 .map(gax::response::Response::into_body)
5384 }
5385
5386 pub async fn paginator(
5388 self,
5389 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5390 {
5391 use std::clone::Clone;
5392 let token = self.0.request.page_token.clone();
5393 let execute = move |token: String| {
5394 let mut builder = self.clone();
5395 builder.0.request = builder.0.request.set_page_token(token);
5396 builder.send()
5397 };
5398 gax::paginator::internal::new_paginator(token, execute)
5399 }
5400
5401 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5403 self.0.request.name = v.into();
5404 self
5405 }
5406
5407 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5409 self.0.request.filter = v.into();
5410 self
5411 }
5412
5413 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5415 self.0.request.page_size = v.into();
5416 self
5417 }
5418
5419 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5421 self.0.request.page_token = v.into();
5422 self
5423 }
5424 }
5425
5426 #[doc(hidden)]
5427 impl gax::options::internal::RequestBuilder for ListOperations {
5428 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5429 &mut self.0.options
5430 }
5431 }
5432
5433 #[derive(Clone, Debug)]
5435 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5436
5437 impl GetOperation {
5438 pub(crate) fn new(
5439 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5440 ) -> Self {
5441 Self(RequestBuilder::new(stub))
5442 }
5443
5444 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5446 mut self,
5447 v: V,
5448 ) -> Self {
5449 self.0.request = v.into();
5450 self
5451 }
5452
5453 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5455 self.0.options = v.into();
5456 self
5457 }
5458
5459 pub async fn send(self) -> Result<longrunning::model::Operation> {
5461 (*self.0.stub)
5462 .get_operation(self.0.request, self.0.options)
5463 .await
5464 .map(gax::response::Response::into_body)
5465 }
5466
5467 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5469 self.0.request.name = v.into();
5470 self
5471 }
5472 }
5473
5474 #[doc(hidden)]
5475 impl gax::options::internal::RequestBuilder for GetOperation {
5476 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5477 &mut self.0.options
5478 }
5479 }
5480
5481 #[derive(Clone, Debug)]
5483 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5484
5485 impl DeleteOperation {
5486 pub(crate) fn new(
5487 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5488 ) -> Self {
5489 Self(RequestBuilder::new(stub))
5490 }
5491
5492 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5494 mut self,
5495 v: V,
5496 ) -> Self {
5497 self.0.request = v.into();
5498 self
5499 }
5500
5501 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5503 self.0.options = v.into();
5504 self
5505 }
5506
5507 pub async fn send(self) -> Result<()> {
5509 (*self.0.stub)
5510 .delete_operation(self.0.request, self.0.options)
5511 .await
5512 .map(gax::response::Response::into_body)
5513 }
5514
5515 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5517 self.0.request.name = v.into();
5518 self
5519 }
5520 }
5521
5522 #[doc(hidden)]
5523 impl gax::options::internal::RequestBuilder for DeleteOperation {
5524 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5525 &mut self.0.options
5526 }
5527 }
5528
5529 #[derive(Clone, Debug)]
5531 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5532
5533 impl CancelOperation {
5534 pub(crate) fn new(
5535 stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5536 ) -> Self {
5537 Self(RequestBuilder::new(stub))
5538 }
5539
5540 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5542 mut self,
5543 v: V,
5544 ) -> Self {
5545 self.0.request = v.into();
5546 self
5547 }
5548
5549 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5551 self.0.options = v.into();
5552 self
5553 }
5554
5555 pub async fn send(self) -> Result<()> {
5557 (*self.0.stub)
5558 .cancel_operation(self.0.request, self.0.options)
5559 .await
5560 .map(gax::response::Response::into_body)
5561 }
5562
5563 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5565 self.0.request.name = v.into();
5566 self
5567 }
5568 }
5569
5570 #[doc(hidden)]
5571 impl gax::options::internal::RequestBuilder for CancelOperation {
5572 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5573 &mut self.0.options
5574 }
5575 }
5576}