1pub mod cross_network_automation_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::CrossNetworkAutomationService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = CrossNetworkAutomationService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListServiceConnectionMaps(
96 RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
97 );
98
99 impl ListServiceConnectionMaps {
100 pub(crate) fn new(
101 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
102 ) -> Self {
103 Self(RequestBuilder::new(stub))
104 }
105
106 pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
108 mut self,
109 v: V,
110 ) -> Self {
111 self.0.request = v.into();
112 self
113 }
114
115 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
117 self.0.options = v.into();
118 self
119 }
120
121 pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
123 (*self.0.stub)
124 .list_service_connection_maps(self.0.request, self.0.options)
125 .await
126 .map(crate::Response::into_body)
127 }
128
129 pub fn by_page(
131 self,
132 ) -> impl google_cloud_gax::paginator::Paginator<
133 crate::model::ListServiceConnectionMapsResponse,
134 crate::Error,
135 > {
136 use std::clone::Clone;
137 let token = self.0.request.page_token.clone();
138 let execute = move |token: String| {
139 let mut builder = self.clone();
140 builder.0.request = builder.0.request.set_page_token(token);
141 builder.send()
142 };
143 google_cloud_gax::paginator::internal::new_paginator(token, execute)
144 }
145
146 pub fn by_item(
148 self,
149 ) -> impl google_cloud_gax::paginator::ItemPaginator<
150 crate::model::ListServiceConnectionMapsResponse,
151 crate::Error,
152 > {
153 use google_cloud_gax::paginator::Paginator;
154 self.by_page().items()
155 }
156
157 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
161 self.0.request.parent = v.into();
162 self
163 }
164
165 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
167 self.0.request.page_size = v.into();
168 self
169 }
170
171 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
173 self.0.request.page_token = v.into();
174 self
175 }
176
177 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
179 self.0.request.filter = v.into();
180 self
181 }
182
183 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
185 self.0.request.order_by = v.into();
186 self
187 }
188 }
189
190 #[doc(hidden)]
191 impl crate::RequestBuilder for ListServiceConnectionMaps {
192 fn request_options(&mut self) -> &mut crate::RequestOptions {
193 &mut self.0.options
194 }
195 }
196
197 #[derive(Clone, Debug)]
214 pub struct GetServiceConnectionMap(
215 RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
216 );
217
218 impl GetServiceConnectionMap {
219 pub(crate) fn new(
220 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
221 ) -> Self {
222 Self(RequestBuilder::new(stub))
223 }
224
225 pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
227 mut self,
228 v: V,
229 ) -> Self {
230 self.0.request = v.into();
231 self
232 }
233
234 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
236 self.0.options = v.into();
237 self
238 }
239
240 pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
242 (*self.0.stub)
243 .get_service_connection_map(self.0.request, self.0.options)
244 .await
245 .map(crate::Response::into_body)
246 }
247
248 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
252 self.0.request.name = v.into();
253 self
254 }
255 }
256
257 #[doc(hidden)]
258 impl crate::RequestBuilder for GetServiceConnectionMap {
259 fn request_options(&mut self) -> &mut crate::RequestOptions {
260 &mut self.0.options
261 }
262 }
263
264 #[derive(Clone, Debug)]
282 pub struct CreateServiceConnectionMap(
283 RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
284 );
285
286 impl CreateServiceConnectionMap {
287 pub(crate) fn new(
288 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
289 ) -> Self {
290 Self(RequestBuilder::new(stub))
291 }
292
293 pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
295 mut self,
296 v: V,
297 ) -> Self {
298 self.0.request = v.into();
299 self
300 }
301
302 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
304 self.0.options = v.into();
305 self
306 }
307
308 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
315 (*self.0.stub)
316 .create_service_connection_map(self.0.request, self.0.options)
317 .await
318 .map(crate::Response::into_body)
319 }
320
321 pub fn poller(
323 self,
324 ) -> impl google_cloud_lro::Poller<
325 crate::model::ServiceConnectionMap,
326 crate::model::OperationMetadata,
327 > {
328 type Operation = google_cloud_lro::internal::Operation<
329 crate::model::ServiceConnectionMap,
330 crate::model::OperationMetadata,
331 >;
332 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
333 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
334 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
335 if let Some(ref mut details) = poller_options.tracing {
336 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::create_service_connection_map::until_done";
337 }
338
339 let stub = self.0.stub.clone();
340 let mut options = self.0.options.clone();
341 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
342 let query = move |name| {
343 let stub = stub.clone();
344 let options = options.clone();
345 async {
346 let op = GetOperation::new(stub)
347 .set_name(name)
348 .with_options(options)
349 .send()
350 .await?;
351 Ok(Operation::new(op))
352 }
353 };
354
355 let start = move || async {
356 let op = self.send().await?;
357 Ok(Operation::new(op))
358 };
359
360 use google_cloud_lro::internal::PollerExt;
361 {
362 google_cloud_lro::internal::new_poller(
363 polling_error_policy,
364 polling_backoff_policy,
365 start,
366 query,
367 )
368 }
369 .with_options(poller_options)
370 }
371
372 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
376 self.0.request.parent = v.into();
377 self
378 }
379
380 pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
382 self.0.request.service_connection_map_id = v.into();
383 self
384 }
385
386 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
390 where
391 T: std::convert::Into<crate::model::ServiceConnectionMap>,
392 {
393 self.0.request.service_connection_map = std::option::Option::Some(v.into());
394 self
395 }
396
397 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
401 where
402 T: std::convert::Into<crate::model::ServiceConnectionMap>,
403 {
404 self.0.request.service_connection_map = v.map(|x| x.into());
405 self
406 }
407
408 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
410 self.0.request.request_id = v.into();
411 self
412 }
413 }
414
415 #[doc(hidden)]
416 impl crate::RequestBuilder for CreateServiceConnectionMap {
417 fn request_options(&mut self) -> &mut crate::RequestOptions {
418 &mut self.0.options
419 }
420 }
421
422 #[derive(Clone, Debug)]
440 pub struct UpdateServiceConnectionMap(
441 RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
442 );
443
444 impl UpdateServiceConnectionMap {
445 pub(crate) fn new(
446 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
447 ) -> Self {
448 Self(RequestBuilder::new(stub))
449 }
450
451 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
453 mut self,
454 v: V,
455 ) -> Self {
456 self.0.request = v.into();
457 self
458 }
459
460 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
462 self.0.options = v.into();
463 self
464 }
465
466 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
473 (*self.0.stub)
474 .update_service_connection_map(self.0.request, self.0.options)
475 .await
476 .map(crate::Response::into_body)
477 }
478
479 pub fn poller(
481 self,
482 ) -> impl google_cloud_lro::Poller<
483 crate::model::ServiceConnectionMap,
484 crate::model::OperationMetadata,
485 > {
486 type Operation = google_cloud_lro::internal::Operation<
487 crate::model::ServiceConnectionMap,
488 crate::model::OperationMetadata,
489 >;
490 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
491 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
492 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
493 if let Some(ref mut details) = poller_options.tracing {
494 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::update_service_connection_map::until_done";
495 }
496
497 let stub = self.0.stub.clone();
498 let mut options = self.0.options.clone();
499 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
500 let query = move |name| {
501 let stub = stub.clone();
502 let options = options.clone();
503 async {
504 let op = GetOperation::new(stub)
505 .set_name(name)
506 .with_options(options)
507 .send()
508 .await?;
509 Ok(Operation::new(op))
510 }
511 };
512
513 let start = move || async {
514 let op = self.send().await?;
515 Ok(Operation::new(op))
516 };
517
518 use google_cloud_lro::internal::PollerExt;
519 {
520 google_cloud_lro::internal::new_poller(
521 polling_error_policy,
522 polling_backoff_policy,
523 start,
524 query,
525 )
526 }
527 .with_options(poller_options)
528 }
529
530 pub fn set_update_mask<T>(mut self, v: T) -> Self
532 where
533 T: std::convert::Into<wkt::FieldMask>,
534 {
535 self.0.request.update_mask = std::option::Option::Some(v.into());
536 self
537 }
538
539 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
541 where
542 T: std::convert::Into<wkt::FieldMask>,
543 {
544 self.0.request.update_mask = v.map(|x| x.into());
545 self
546 }
547
548 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
552 where
553 T: std::convert::Into<crate::model::ServiceConnectionMap>,
554 {
555 self.0.request.service_connection_map = std::option::Option::Some(v.into());
556 self
557 }
558
559 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
563 where
564 T: std::convert::Into<crate::model::ServiceConnectionMap>,
565 {
566 self.0.request.service_connection_map = v.map(|x| x.into());
567 self
568 }
569
570 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
572 self.0.request.request_id = v.into();
573 self
574 }
575 }
576
577 #[doc(hidden)]
578 impl crate::RequestBuilder for UpdateServiceConnectionMap {
579 fn request_options(&mut self) -> &mut crate::RequestOptions {
580 &mut self.0.options
581 }
582 }
583
584 #[derive(Clone, Debug)]
602 pub struct DeleteServiceConnectionMap(
603 RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
604 );
605
606 impl DeleteServiceConnectionMap {
607 pub(crate) fn new(
608 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
609 ) -> Self {
610 Self(RequestBuilder::new(stub))
611 }
612
613 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
615 mut self,
616 v: V,
617 ) -> Self {
618 self.0.request = v.into();
619 self
620 }
621
622 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
624 self.0.options = v.into();
625 self
626 }
627
628 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
635 (*self.0.stub)
636 .delete_service_connection_map(self.0.request, self.0.options)
637 .await
638 .map(crate::Response::into_body)
639 }
640
641 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
643 type Operation =
644 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
645 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
646 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
647 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
648 if let Some(ref mut details) = poller_options.tracing {
649 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::delete_service_connection_map::until_done";
650 }
651
652 let stub = self.0.stub.clone();
653 let mut options = self.0.options.clone();
654 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
655 let query = move |name| {
656 let stub = stub.clone();
657 let options = options.clone();
658 async {
659 let op = GetOperation::new(stub)
660 .set_name(name)
661 .with_options(options)
662 .send()
663 .await?;
664 Ok(Operation::new(op))
665 }
666 };
667
668 let start = move || async {
669 let op = self.send().await?;
670 Ok(Operation::new(op))
671 };
672
673 use google_cloud_lro::internal::PollerExt;
674 {
675 google_cloud_lro::internal::new_unit_response_poller(
676 polling_error_policy,
677 polling_backoff_policy,
678 start,
679 query,
680 )
681 }
682 .with_options(poller_options)
683 }
684
685 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
689 self.0.request.name = v.into();
690 self
691 }
692
693 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
695 self.0.request.request_id = v.into();
696 self
697 }
698
699 pub fn set_etag<T>(mut self, v: T) -> Self
701 where
702 T: std::convert::Into<std::string::String>,
703 {
704 self.0.request.etag = std::option::Option::Some(v.into());
705 self
706 }
707
708 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
710 where
711 T: std::convert::Into<std::string::String>,
712 {
713 self.0.request.etag = v.map(|x| x.into());
714 self
715 }
716 }
717
718 #[doc(hidden)]
719 impl crate::RequestBuilder for DeleteServiceConnectionMap {
720 fn request_options(&mut self) -> &mut crate::RequestOptions {
721 &mut self.0.options
722 }
723 }
724
725 #[derive(Clone, Debug)]
746 pub struct ListServiceConnectionPolicies(
747 RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
748 );
749
750 impl ListServiceConnectionPolicies {
751 pub(crate) fn new(
752 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
753 ) -> Self {
754 Self(RequestBuilder::new(stub))
755 }
756
757 pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
759 mut self,
760 v: V,
761 ) -> Self {
762 self.0.request = v.into();
763 self
764 }
765
766 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
768 self.0.options = v.into();
769 self
770 }
771
772 pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
774 (*self.0.stub)
775 .list_service_connection_policies(self.0.request, self.0.options)
776 .await
777 .map(crate::Response::into_body)
778 }
779
780 pub fn by_page(
782 self,
783 ) -> impl google_cloud_gax::paginator::Paginator<
784 crate::model::ListServiceConnectionPoliciesResponse,
785 crate::Error,
786 > {
787 use std::clone::Clone;
788 let token = self.0.request.page_token.clone();
789 let execute = move |token: String| {
790 let mut builder = self.clone();
791 builder.0.request = builder.0.request.set_page_token(token);
792 builder.send()
793 };
794 google_cloud_gax::paginator::internal::new_paginator(token, execute)
795 }
796
797 pub fn by_item(
799 self,
800 ) -> impl google_cloud_gax::paginator::ItemPaginator<
801 crate::model::ListServiceConnectionPoliciesResponse,
802 crate::Error,
803 > {
804 use google_cloud_gax::paginator::Paginator;
805 self.by_page().items()
806 }
807
808 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
812 self.0.request.parent = v.into();
813 self
814 }
815
816 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
818 self.0.request.page_size = v.into();
819 self
820 }
821
822 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
824 self.0.request.page_token = v.into();
825 self
826 }
827
828 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
830 self.0.request.filter = v.into();
831 self
832 }
833
834 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
836 self.0.request.order_by = v.into();
837 self
838 }
839 }
840
841 #[doc(hidden)]
842 impl crate::RequestBuilder for ListServiceConnectionPolicies {
843 fn request_options(&mut self) -> &mut crate::RequestOptions {
844 &mut self.0.options
845 }
846 }
847
848 #[derive(Clone, Debug)]
865 pub struct GetServiceConnectionPolicy(
866 RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
867 );
868
869 impl GetServiceConnectionPolicy {
870 pub(crate) fn new(
871 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
872 ) -> Self {
873 Self(RequestBuilder::new(stub))
874 }
875
876 pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
878 mut self,
879 v: V,
880 ) -> Self {
881 self.0.request = v.into();
882 self
883 }
884
885 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
887 self.0.options = v.into();
888 self
889 }
890
891 pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
893 (*self.0.stub)
894 .get_service_connection_policy(self.0.request, self.0.options)
895 .await
896 .map(crate::Response::into_body)
897 }
898
899 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
903 self.0.request.name = v.into();
904 self
905 }
906 }
907
908 #[doc(hidden)]
909 impl crate::RequestBuilder for GetServiceConnectionPolicy {
910 fn request_options(&mut self) -> &mut crate::RequestOptions {
911 &mut self.0.options
912 }
913 }
914
915 #[derive(Clone, Debug)]
933 pub struct CreateServiceConnectionPolicy(
934 RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
935 );
936
937 impl CreateServiceConnectionPolicy {
938 pub(crate) fn new(
939 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
940 ) -> Self {
941 Self(RequestBuilder::new(stub))
942 }
943
944 pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
946 mut self,
947 v: V,
948 ) -> Self {
949 self.0.request = v.into();
950 self
951 }
952
953 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
955 self.0.options = v.into();
956 self
957 }
958
959 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
966 (*self.0.stub)
967 .create_service_connection_policy(self.0.request, self.0.options)
968 .await
969 .map(crate::Response::into_body)
970 }
971
972 pub fn poller(
974 self,
975 ) -> impl google_cloud_lro::Poller<
976 crate::model::ServiceConnectionPolicy,
977 crate::model::OperationMetadata,
978 > {
979 type Operation = google_cloud_lro::internal::Operation<
980 crate::model::ServiceConnectionPolicy,
981 crate::model::OperationMetadata,
982 >;
983 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
984 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
985 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
986 if let Some(ref mut details) = poller_options.tracing {
987 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::create_service_connection_policy::until_done";
988 }
989
990 let stub = self.0.stub.clone();
991 let mut options = self.0.options.clone();
992 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
993 let query = move |name| {
994 let stub = stub.clone();
995 let options = options.clone();
996 async {
997 let op = GetOperation::new(stub)
998 .set_name(name)
999 .with_options(options)
1000 .send()
1001 .await?;
1002 Ok(Operation::new(op))
1003 }
1004 };
1005
1006 let start = move || async {
1007 let op = self.send().await?;
1008 Ok(Operation::new(op))
1009 };
1010
1011 use google_cloud_lro::internal::PollerExt;
1012 {
1013 google_cloud_lro::internal::new_poller(
1014 polling_error_policy,
1015 polling_backoff_policy,
1016 start,
1017 query,
1018 )
1019 }
1020 .with_options(poller_options)
1021 }
1022
1023 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1027 self.0.request.parent = v.into();
1028 self
1029 }
1030
1031 pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
1033 mut self,
1034 v: T,
1035 ) -> Self {
1036 self.0.request.service_connection_policy_id = v.into();
1037 self
1038 }
1039
1040 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1044 where
1045 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1046 {
1047 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1048 self
1049 }
1050
1051 pub fn set_or_clear_service_connection_policy<T>(
1055 mut self,
1056 v: std::option::Option<T>,
1057 ) -> Self
1058 where
1059 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1060 {
1061 self.0.request.service_connection_policy = v.map(|x| x.into());
1062 self
1063 }
1064
1065 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1067 self.0.request.request_id = v.into();
1068 self
1069 }
1070 }
1071
1072 #[doc(hidden)]
1073 impl crate::RequestBuilder for CreateServiceConnectionPolicy {
1074 fn request_options(&mut self) -> &mut crate::RequestOptions {
1075 &mut self.0.options
1076 }
1077 }
1078
1079 #[derive(Clone, Debug)]
1097 pub struct UpdateServiceConnectionPolicy(
1098 RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1099 );
1100
1101 impl UpdateServiceConnectionPolicy {
1102 pub(crate) fn new(
1103 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1104 ) -> Self {
1105 Self(RequestBuilder::new(stub))
1106 }
1107
1108 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1110 mut self,
1111 v: V,
1112 ) -> Self {
1113 self.0.request = v.into();
1114 self
1115 }
1116
1117 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1119 self.0.options = v.into();
1120 self
1121 }
1122
1123 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1130 (*self.0.stub)
1131 .update_service_connection_policy(self.0.request, self.0.options)
1132 .await
1133 .map(crate::Response::into_body)
1134 }
1135
1136 pub fn poller(
1138 self,
1139 ) -> impl google_cloud_lro::Poller<
1140 crate::model::ServiceConnectionPolicy,
1141 crate::model::OperationMetadata,
1142 > {
1143 type Operation = google_cloud_lro::internal::Operation<
1144 crate::model::ServiceConnectionPolicy,
1145 crate::model::OperationMetadata,
1146 >;
1147 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1148 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1149 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1150 if let Some(ref mut details) = poller_options.tracing {
1151 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::update_service_connection_policy::until_done";
1152 }
1153
1154 let stub = self.0.stub.clone();
1155 let mut options = self.0.options.clone();
1156 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1157 let query = move |name| {
1158 let stub = stub.clone();
1159 let options = options.clone();
1160 async {
1161 let op = GetOperation::new(stub)
1162 .set_name(name)
1163 .with_options(options)
1164 .send()
1165 .await?;
1166 Ok(Operation::new(op))
1167 }
1168 };
1169
1170 let start = move || async {
1171 let op = self.send().await?;
1172 Ok(Operation::new(op))
1173 };
1174
1175 use google_cloud_lro::internal::PollerExt;
1176 {
1177 google_cloud_lro::internal::new_poller(
1178 polling_error_policy,
1179 polling_backoff_policy,
1180 start,
1181 query,
1182 )
1183 }
1184 .with_options(poller_options)
1185 }
1186
1187 pub fn set_update_mask<T>(mut self, v: T) -> Self
1189 where
1190 T: std::convert::Into<wkt::FieldMask>,
1191 {
1192 self.0.request.update_mask = std::option::Option::Some(v.into());
1193 self
1194 }
1195
1196 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1198 where
1199 T: std::convert::Into<wkt::FieldMask>,
1200 {
1201 self.0.request.update_mask = v.map(|x| x.into());
1202 self
1203 }
1204
1205 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1209 where
1210 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1211 {
1212 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1213 self
1214 }
1215
1216 pub fn set_or_clear_service_connection_policy<T>(
1220 mut self,
1221 v: std::option::Option<T>,
1222 ) -> Self
1223 where
1224 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1225 {
1226 self.0.request.service_connection_policy = v.map(|x| x.into());
1227 self
1228 }
1229
1230 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1232 self.0.request.request_id = v.into();
1233 self
1234 }
1235 }
1236
1237 #[doc(hidden)]
1238 impl crate::RequestBuilder for UpdateServiceConnectionPolicy {
1239 fn request_options(&mut self) -> &mut crate::RequestOptions {
1240 &mut self.0.options
1241 }
1242 }
1243
1244 #[derive(Clone, Debug)]
1262 pub struct DeleteServiceConnectionPolicy(
1263 RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1264 );
1265
1266 impl DeleteServiceConnectionPolicy {
1267 pub(crate) fn new(
1268 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1269 ) -> Self {
1270 Self(RequestBuilder::new(stub))
1271 }
1272
1273 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1275 mut self,
1276 v: V,
1277 ) -> Self {
1278 self.0.request = v.into();
1279 self
1280 }
1281
1282 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1284 self.0.options = v.into();
1285 self
1286 }
1287
1288 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1295 (*self.0.stub)
1296 .delete_service_connection_policy(self.0.request, self.0.options)
1297 .await
1298 .map(crate::Response::into_body)
1299 }
1300
1301 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1303 type Operation =
1304 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1305 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1306 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1307 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1308 if let Some(ref mut details) = poller_options.tracing {
1309 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::delete_service_connection_policy::until_done";
1310 }
1311
1312 let stub = self.0.stub.clone();
1313 let mut options = self.0.options.clone();
1314 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1315 let query = move |name| {
1316 let stub = stub.clone();
1317 let options = options.clone();
1318 async {
1319 let op = GetOperation::new(stub)
1320 .set_name(name)
1321 .with_options(options)
1322 .send()
1323 .await?;
1324 Ok(Operation::new(op))
1325 }
1326 };
1327
1328 let start = move || async {
1329 let op = self.send().await?;
1330 Ok(Operation::new(op))
1331 };
1332
1333 use google_cloud_lro::internal::PollerExt;
1334 {
1335 google_cloud_lro::internal::new_unit_response_poller(
1336 polling_error_policy,
1337 polling_backoff_policy,
1338 start,
1339 query,
1340 )
1341 }
1342 .with_options(poller_options)
1343 }
1344
1345 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1349 self.0.request.name = v.into();
1350 self
1351 }
1352
1353 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355 self.0.request.request_id = v.into();
1356 self
1357 }
1358
1359 pub fn set_etag<T>(mut self, v: T) -> Self
1361 where
1362 T: std::convert::Into<std::string::String>,
1363 {
1364 self.0.request.etag = std::option::Option::Some(v.into());
1365 self
1366 }
1367
1368 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1370 where
1371 T: std::convert::Into<std::string::String>,
1372 {
1373 self.0.request.etag = v.map(|x| x.into());
1374 self
1375 }
1376 }
1377
1378 #[doc(hidden)]
1379 impl crate::RequestBuilder for DeleteServiceConnectionPolicy {
1380 fn request_options(&mut self) -> &mut crate::RequestOptions {
1381 &mut self.0.options
1382 }
1383 }
1384
1385 #[derive(Clone, Debug)]
1406 pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1407
1408 impl ListServiceClasses {
1409 pub(crate) fn new(
1410 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1411 ) -> Self {
1412 Self(RequestBuilder::new(stub))
1413 }
1414
1415 pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1417 mut self,
1418 v: V,
1419 ) -> Self {
1420 self.0.request = v.into();
1421 self
1422 }
1423
1424 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1426 self.0.options = v.into();
1427 self
1428 }
1429
1430 pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1432 (*self.0.stub)
1433 .list_service_classes(self.0.request, self.0.options)
1434 .await
1435 .map(crate::Response::into_body)
1436 }
1437
1438 pub fn by_page(
1440 self,
1441 ) -> impl google_cloud_gax::paginator::Paginator<
1442 crate::model::ListServiceClassesResponse,
1443 crate::Error,
1444 > {
1445 use std::clone::Clone;
1446 let token = self.0.request.page_token.clone();
1447 let execute = move |token: String| {
1448 let mut builder = self.clone();
1449 builder.0.request = builder.0.request.set_page_token(token);
1450 builder.send()
1451 };
1452 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1453 }
1454
1455 pub fn by_item(
1457 self,
1458 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1459 crate::model::ListServiceClassesResponse,
1460 crate::Error,
1461 > {
1462 use google_cloud_gax::paginator::Paginator;
1463 self.by_page().items()
1464 }
1465
1466 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470 self.0.request.parent = v.into();
1471 self
1472 }
1473
1474 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1476 self.0.request.page_size = v.into();
1477 self
1478 }
1479
1480 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1482 self.0.request.page_token = v.into();
1483 self
1484 }
1485
1486 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488 self.0.request.filter = v.into();
1489 self
1490 }
1491
1492 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1494 self.0.request.order_by = v.into();
1495 self
1496 }
1497 }
1498
1499 #[doc(hidden)]
1500 impl crate::RequestBuilder for ListServiceClasses {
1501 fn request_options(&mut self) -> &mut crate::RequestOptions {
1502 &mut self.0.options
1503 }
1504 }
1505
1506 #[derive(Clone, Debug)]
1523 pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1524
1525 impl GetServiceClass {
1526 pub(crate) fn new(
1527 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1528 ) -> Self {
1529 Self(RequestBuilder::new(stub))
1530 }
1531
1532 pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1534 self.0.request = v.into();
1535 self
1536 }
1537
1538 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1540 self.0.options = v.into();
1541 self
1542 }
1543
1544 pub async fn send(self) -> Result<crate::model::ServiceClass> {
1546 (*self.0.stub)
1547 .get_service_class(self.0.request, self.0.options)
1548 .await
1549 .map(crate::Response::into_body)
1550 }
1551
1552 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1556 self.0.request.name = v.into();
1557 self
1558 }
1559 }
1560
1561 #[doc(hidden)]
1562 impl crate::RequestBuilder for GetServiceClass {
1563 fn request_options(&mut self) -> &mut crate::RequestOptions {
1564 &mut self.0.options
1565 }
1566 }
1567
1568 #[derive(Clone, Debug)]
1586 pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1587
1588 impl UpdateServiceClass {
1589 pub(crate) fn new(
1590 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1591 ) -> Self {
1592 Self(RequestBuilder::new(stub))
1593 }
1594
1595 pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1597 mut self,
1598 v: V,
1599 ) -> Self {
1600 self.0.request = v.into();
1601 self
1602 }
1603
1604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1606 self.0.options = v.into();
1607 self
1608 }
1609
1610 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1617 (*self.0.stub)
1618 .update_service_class(self.0.request, self.0.options)
1619 .await
1620 .map(crate::Response::into_body)
1621 }
1622
1623 pub fn poller(
1625 self,
1626 ) -> impl google_cloud_lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata>
1627 {
1628 type Operation = google_cloud_lro::internal::Operation<
1629 crate::model::ServiceClass,
1630 crate::model::OperationMetadata,
1631 >;
1632 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1633 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1634 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1635 if let Some(ref mut details) = poller_options.tracing {
1636 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::update_service_class::until_done";
1637 }
1638
1639 let stub = self.0.stub.clone();
1640 let mut options = self.0.options.clone();
1641 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1642 let query = move |name| {
1643 let stub = stub.clone();
1644 let options = options.clone();
1645 async {
1646 let op = GetOperation::new(stub)
1647 .set_name(name)
1648 .with_options(options)
1649 .send()
1650 .await?;
1651 Ok(Operation::new(op))
1652 }
1653 };
1654
1655 let start = move || async {
1656 let op = self.send().await?;
1657 Ok(Operation::new(op))
1658 };
1659
1660 use google_cloud_lro::internal::PollerExt;
1661 {
1662 google_cloud_lro::internal::new_poller(
1663 polling_error_policy,
1664 polling_backoff_policy,
1665 start,
1666 query,
1667 )
1668 }
1669 .with_options(poller_options)
1670 }
1671
1672 pub fn set_update_mask<T>(mut self, v: T) -> Self
1674 where
1675 T: std::convert::Into<wkt::FieldMask>,
1676 {
1677 self.0.request.update_mask = std::option::Option::Some(v.into());
1678 self
1679 }
1680
1681 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1683 where
1684 T: std::convert::Into<wkt::FieldMask>,
1685 {
1686 self.0.request.update_mask = v.map(|x| x.into());
1687 self
1688 }
1689
1690 pub fn set_service_class<T>(mut self, v: T) -> Self
1694 where
1695 T: std::convert::Into<crate::model::ServiceClass>,
1696 {
1697 self.0.request.service_class = std::option::Option::Some(v.into());
1698 self
1699 }
1700
1701 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1705 where
1706 T: std::convert::Into<crate::model::ServiceClass>,
1707 {
1708 self.0.request.service_class = v.map(|x| x.into());
1709 self
1710 }
1711
1712 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1714 self.0.request.request_id = v.into();
1715 self
1716 }
1717 }
1718
1719 #[doc(hidden)]
1720 impl crate::RequestBuilder for UpdateServiceClass {
1721 fn request_options(&mut self) -> &mut crate::RequestOptions {
1722 &mut self.0.options
1723 }
1724 }
1725
1726 #[derive(Clone, Debug)]
1744 pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1745
1746 impl DeleteServiceClass {
1747 pub(crate) fn new(
1748 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1749 ) -> Self {
1750 Self(RequestBuilder::new(stub))
1751 }
1752
1753 pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1755 mut self,
1756 v: V,
1757 ) -> Self {
1758 self.0.request = v.into();
1759 self
1760 }
1761
1762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1764 self.0.options = v.into();
1765 self
1766 }
1767
1768 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1775 (*self.0.stub)
1776 .delete_service_class(self.0.request, self.0.options)
1777 .await
1778 .map(crate::Response::into_body)
1779 }
1780
1781 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1783 type Operation =
1784 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1785 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1786 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1787 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1788 if let Some(ref mut details) = poller_options.tracing {
1789 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::delete_service_class::until_done";
1790 }
1791
1792 let stub = self.0.stub.clone();
1793 let mut options = self.0.options.clone();
1794 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1795 let query = move |name| {
1796 let stub = stub.clone();
1797 let options = options.clone();
1798 async {
1799 let op = GetOperation::new(stub)
1800 .set_name(name)
1801 .with_options(options)
1802 .send()
1803 .await?;
1804 Ok(Operation::new(op))
1805 }
1806 };
1807
1808 let start = move || async {
1809 let op = self.send().await?;
1810 Ok(Operation::new(op))
1811 };
1812
1813 use google_cloud_lro::internal::PollerExt;
1814 {
1815 google_cloud_lro::internal::new_unit_response_poller(
1816 polling_error_policy,
1817 polling_backoff_policy,
1818 start,
1819 query,
1820 )
1821 }
1822 .with_options(poller_options)
1823 }
1824
1825 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829 self.0.request.name = v.into();
1830 self
1831 }
1832
1833 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1835 self.0.request.request_id = v.into();
1836 self
1837 }
1838
1839 pub fn set_etag<T>(mut self, v: T) -> Self
1841 where
1842 T: std::convert::Into<std::string::String>,
1843 {
1844 self.0.request.etag = std::option::Option::Some(v.into());
1845 self
1846 }
1847
1848 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1850 where
1851 T: std::convert::Into<std::string::String>,
1852 {
1853 self.0.request.etag = v.map(|x| x.into());
1854 self
1855 }
1856 }
1857
1858 #[doc(hidden)]
1859 impl crate::RequestBuilder for DeleteServiceClass {
1860 fn request_options(&mut self) -> &mut crate::RequestOptions {
1861 &mut self.0.options
1862 }
1863 }
1864
1865 #[derive(Clone, Debug)]
1882 pub struct GetServiceConnectionToken(
1883 RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1884 );
1885
1886 impl GetServiceConnectionToken {
1887 pub(crate) fn new(
1888 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1889 ) -> Self {
1890 Self(RequestBuilder::new(stub))
1891 }
1892
1893 pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1895 mut self,
1896 v: V,
1897 ) -> Self {
1898 self.0.request = v.into();
1899 self
1900 }
1901
1902 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1904 self.0.options = v.into();
1905 self
1906 }
1907
1908 pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1910 (*self.0.stub)
1911 .get_service_connection_token(self.0.request, self.0.options)
1912 .await
1913 .map(crate::Response::into_body)
1914 }
1915
1916 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1920 self.0.request.name = v.into();
1921 self
1922 }
1923 }
1924
1925 #[doc(hidden)]
1926 impl crate::RequestBuilder for GetServiceConnectionToken {
1927 fn request_options(&mut self) -> &mut crate::RequestOptions {
1928 &mut self.0.options
1929 }
1930 }
1931
1932 #[derive(Clone, Debug)]
1953 pub struct ListServiceConnectionTokens(
1954 RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1955 );
1956
1957 impl ListServiceConnectionTokens {
1958 pub(crate) fn new(
1959 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1960 ) -> Self {
1961 Self(RequestBuilder::new(stub))
1962 }
1963
1964 pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1966 mut self,
1967 v: V,
1968 ) -> Self {
1969 self.0.request = v.into();
1970 self
1971 }
1972
1973 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1975 self.0.options = v.into();
1976 self
1977 }
1978
1979 pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1981 (*self.0.stub)
1982 .list_service_connection_tokens(self.0.request, self.0.options)
1983 .await
1984 .map(crate::Response::into_body)
1985 }
1986
1987 pub fn by_page(
1989 self,
1990 ) -> impl google_cloud_gax::paginator::Paginator<
1991 crate::model::ListServiceConnectionTokensResponse,
1992 crate::Error,
1993 > {
1994 use std::clone::Clone;
1995 let token = self.0.request.page_token.clone();
1996 let execute = move |token: String| {
1997 let mut builder = self.clone();
1998 builder.0.request = builder.0.request.set_page_token(token);
1999 builder.send()
2000 };
2001 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2002 }
2003
2004 pub fn by_item(
2006 self,
2007 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2008 crate::model::ListServiceConnectionTokensResponse,
2009 crate::Error,
2010 > {
2011 use google_cloud_gax::paginator::Paginator;
2012 self.by_page().items()
2013 }
2014
2015 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2019 self.0.request.parent = v.into();
2020 self
2021 }
2022
2023 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2025 self.0.request.page_size = v.into();
2026 self
2027 }
2028
2029 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2031 self.0.request.page_token = v.into();
2032 self
2033 }
2034
2035 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2037 self.0.request.filter = v.into();
2038 self
2039 }
2040
2041 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2043 self.0.request.order_by = v.into();
2044 self
2045 }
2046 }
2047
2048 #[doc(hidden)]
2049 impl crate::RequestBuilder for ListServiceConnectionTokens {
2050 fn request_options(&mut self) -> &mut crate::RequestOptions {
2051 &mut self.0.options
2052 }
2053 }
2054
2055 #[derive(Clone, Debug)]
2073 pub struct CreateServiceConnectionToken(
2074 RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
2075 );
2076
2077 impl CreateServiceConnectionToken {
2078 pub(crate) fn new(
2079 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2080 ) -> Self {
2081 Self(RequestBuilder::new(stub))
2082 }
2083
2084 pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2086 mut self,
2087 v: V,
2088 ) -> Self {
2089 self.0.request = v.into();
2090 self
2091 }
2092
2093 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2095 self.0.options = v.into();
2096 self
2097 }
2098
2099 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2106 (*self.0.stub)
2107 .create_service_connection_token(self.0.request, self.0.options)
2108 .await
2109 .map(crate::Response::into_body)
2110 }
2111
2112 pub fn poller(
2114 self,
2115 ) -> impl google_cloud_lro::Poller<
2116 crate::model::ServiceConnectionToken,
2117 crate::model::OperationMetadata,
2118 > {
2119 type Operation = google_cloud_lro::internal::Operation<
2120 crate::model::ServiceConnectionToken,
2121 crate::model::OperationMetadata,
2122 >;
2123 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2124 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2125 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2126 if let Some(ref mut details) = poller_options.tracing {
2127 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::create_service_connection_token::until_done";
2128 }
2129
2130 let stub = self.0.stub.clone();
2131 let mut options = self.0.options.clone();
2132 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2133 let query = move |name| {
2134 let stub = stub.clone();
2135 let options = options.clone();
2136 async {
2137 let op = GetOperation::new(stub)
2138 .set_name(name)
2139 .with_options(options)
2140 .send()
2141 .await?;
2142 Ok(Operation::new(op))
2143 }
2144 };
2145
2146 let start = move || async {
2147 let op = self.send().await?;
2148 Ok(Operation::new(op))
2149 };
2150
2151 use google_cloud_lro::internal::PollerExt;
2152 {
2153 google_cloud_lro::internal::new_poller(
2154 polling_error_policy,
2155 polling_backoff_policy,
2156 start,
2157 query,
2158 )
2159 }
2160 .with_options(poller_options)
2161 }
2162
2163 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.0.request.parent = v.into();
2168 self
2169 }
2170
2171 pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2173 mut self,
2174 v: T,
2175 ) -> Self {
2176 self.0.request.service_connection_token_id = v.into();
2177 self
2178 }
2179
2180 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2184 where
2185 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2186 {
2187 self.0.request.service_connection_token = std::option::Option::Some(v.into());
2188 self
2189 }
2190
2191 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2195 where
2196 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2197 {
2198 self.0.request.service_connection_token = v.map(|x| x.into());
2199 self
2200 }
2201
2202 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2204 self.0.request.request_id = v.into();
2205 self
2206 }
2207 }
2208
2209 #[doc(hidden)]
2210 impl crate::RequestBuilder for CreateServiceConnectionToken {
2211 fn request_options(&mut self) -> &mut crate::RequestOptions {
2212 &mut self.0.options
2213 }
2214 }
2215
2216 #[derive(Clone, Debug)]
2234 pub struct DeleteServiceConnectionToken(
2235 RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2236 );
2237
2238 impl DeleteServiceConnectionToken {
2239 pub(crate) fn new(
2240 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2241 ) -> Self {
2242 Self(RequestBuilder::new(stub))
2243 }
2244
2245 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2247 mut self,
2248 v: V,
2249 ) -> Self {
2250 self.0.request = v.into();
2251 self
2252 }
2253
2254 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2256 self.0.options = v.into();
2257 self
2258 }
2259
2260 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2267 (*self.0.stub)
2268 .delete_service_connection_token(self.0.request, self.0.options)
2269 .await
2270 .map(crate::Response::into_body)
2271 }
2272
2273 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2275 type Operation =
2276 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2277 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2278 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2279 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2280 if let Some(ref mut details) = poller_options.tracing {
2281 details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::delete_service_connection_token::until_done";
2282 }
2283
2284 let stub = self.0.stub.clone();
2285 let mut options = self.0.options.clone();
2286 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2287 let query = move |name| {
2288 let stub = stub.clone();
2289 let options = options.clone();
2290 async {
2291 let op = GetOperation::new(stub)
2292 .set_name(name)
2293 .with_options(options)
2294 .send()
2295 .await?;
2296 Ok(Operation::new(op))
2297 }
2298 };
2299
2300 let start = move || async {
2301 let op = self.send().await?;
2302 Ok(Operation::new(op))
2303 };
2304
2305 use google_cloud_lro::internal::PollerExt;
2306 {
2307 google_cloud_lro::internal::new_unit_response_poller(
2308 polling_error_policy,
2309 polling_backoff_policy,
2310 start,
2311 query,
2312 )
2313 }
2314 .with_options(poller_options)
2315 }
2316
2317 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2321 self.0.request.name = v.into();
2322 self
2323 }
2324
2325 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2327 self.0.request.request_id = v.into();
2328 self
2329 }
2330
2331 pub fn set_etag<T>(mut self, v: T) -> Self
2333 where
2334 T: std::convert::Into<std::string::String>,
2335 {
2336 self.0.request.etag = std::option::Option::Some(v.into());
2337 self
2338 }
2339
2340 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2342 where
2343 T: std::convert::Into<std::string::String>,
2344 {
2345 self.0.request.etag = v.map(|x| x.into());
2346 self
2347 }
2348 }
2349
2350 #[doc(hidden)]
2351 impl crate::RequestBuilder for DeleteServiceConnectionToken {
2352 fn request_options(&mut self) -> &mut crate::RequestOptions {
2353 &mut self.0.options
2354 }
2355 }
2356
2357 #[derive(Clone, Debug)]
2378 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2379
2380 impl ListLocations {
2381 pub(crate) fn new(
2382 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2383 ) -> Self {
2384 Self(RequestBuilder::new(stub))
2385 }
2386
2387 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2389 mut self,
2390 v: V,
2391 ) -> Self {
2392 self.0.request = v.into();
2393 self
2394 }
2395
2396 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2398 self.0.options = v.into();
2399 self
2400 }
2401
2402 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2404 (*self.0.stub)
2405 .list_locations(self.0.request, self.0.options)
2406 .await
2407 .map(crate::Response::into_body)
2408 }
2409
2410 pub fn by_page(
2412 self,
2413 ) -> impl google_cloud_gax::paginator::Paginator<
2414 google_cloud_location::model::ListLocationsResponse,
2415 crate::Error,
2416 > {
2417 use std::clone::Clone;
2418 let token = self.0.request.page_token.clone();
2419 let execute = move |token: String| {
2420 let mut builder = self.clone();
2421 builder.0.request = builder.0.request.set_page_token(token);
2422 builder.send()
2423 };
2424 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2425 }
2426
2427 pub fn by_item(
2429 self,
2430 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2431 google_cloud_location::model::ListLocationsResponse,
2432 crate::Error,
2433 > {
2434 use google_cloud_gax::paginator::Paginator;
2435 self.by_page().items()
2436 }
2437
2438 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2440 self.0.request.name = v.into();
2441 self
2442 }
2443
2444 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2446 self.0.request.filter = v.into();
2447 self
2448 }
2449
2450 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2452 self.0.request.page_size = v.into();
2453 self
2454 }
2455
2456 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2458 self.0.request.page_token = v.into();
2459 self
2460 }
2461 }
2462
2463 #[doc(hidden)]
2464 impl crate::RequestBuilder for ListLocations {
2465 fn request_options(&mut self) -> &mut crate::RequestOptions {
2466 &mut self.0.options
2467 }
2468 }
2469
2470 #[derive(Clone, Debug)]
2487 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2488
2489 impl GetLocation {
2490 pub(crate) fn new(
2491 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2492 ) -> Self {
2493 Self(RequestBuilder::new(stub))
2494 }
2495
2496 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2498 mut self,
2499 v: V,
2500 ) -> Self {
2501 self.0.request = v.into();
2502 self
2503 }
2504
2505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2507 self.0.options = v.into();
2508 self
2509 }
2510
2511 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2513 (*self.0.stub)
2514 .get_location(self.0.request, self.0.options)
2515 .await
2516 .map(crate::Response::into_body)
2517 }
2518
2519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2521 self.0.request.name = v.into();
2522 self
2523 }
2524 }
2525
2526 #[doc(hidden)]
2527 impl crate::RequestBuilder for GetLocation {
2528 fn request_options(&mut self) -> &mut crate::RequestOptions {
2529 &mut self.0.options
2530 }
2531 }
2532
2533 #[derive(Clone, Debug)]
2550 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2551
2552 impl SetIamPolicy {
2553 pub(crate) fn new(
2554 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2555 ) -> Self {
2556 Self(RequestBuilder::new(stub))
2557 }
2558
2559 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2561 mut self,
2562 v: V,
2563 ) -> Self {
2564 self.0.request = v.into();
2565 self
2566 }
2567
2568 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2570 self.0.options = v.into();
2571 self
2572 }
2573
2574 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2576 (*self.0.stub)
2577 .set_iam_policy(self.0.request, self.0.options)
2578 .await
2579 .map(crate::Response::into_body)
2580 }
2581
2582 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2586 self.0.request.resource = v.into();
2587 self
2588 }
2589
2590 pub fn set_policy<T>(mut self, v: T) -> Self
2594 where
2595 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2596 {
2597 self.0.request.policy = std::option::Option::Some(v.into());
2598 self
2599 }
2600
2601 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2605 where
2606 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2607 {
2608 self.0.request.policy = v.map(|x| x.into());
2609 self
2610 }
2611
2612 pub fn set_update_mask<T>(mut self, v: T) -> Self
2614 where
2615 T: std::convert::Into<wkt::FieldMask>,
2616 {
2617 self.0.request.update_mask = std::option::Option::Some(v.into());
2618 self
2619 }
2620
2621 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2623 where
2624 T: std::convert::Into<wkt::FieldMask>,
2625 {
2626 self.0.request.update_mask = v.map(|x| x.into());
2627 self
2628 }
2629 }
2630
2631 #[doc(hidden)]
2632 impl crate::RequestBuilder for SetIamPolicy {
2633 fn request_options(&mut self) -> &mut crate::RequestOptions {
2634 &mut self.0.options
2635 }
2636 }
2637
2638 #[derive(Clone, Debug)]
2655 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2656
2657 impl GetIamPolicy {
2658 pub(crate) fn new(
2659 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2660 ) -> Self {
2661 Self(RequestBuilder::new(stub))
2662 }
2663
2664 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2666 mut self,
2667 v: V,
2668 ) -> Self {
2669 self.0.request = v.into();
2670 self
2671 }
2672
2673 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2675 self.0.options = v.into();
2676 self
2677 }
2678
2679 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2681 (*self.0.stub)
2682 .get_iam_policy(self.0.request, self.0.options)
2683 .await
2684 .map(crate::Response::into_body)
2685 }
2686
2687 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2691 self.0.request.resource = v.into();
2692 self
2693 }
2694
2695 pub fn set_options<T>(mut self, v: T) -> Self
2697 where
2698 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2699 {
2700 self.0.request.options = std::option::Option::Some(v.into());
2701 self
2702 }
2703
2704 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2706 where
2707 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2708 {
2709 self.0.request.options = v.map(|x| x.into());
2710 self
2711 }
2712 }
2713
2714 #[doc(hidden)]
2715 impl crate::RequestBuilder for GetIamPolicy {
2716 fn request_options(&mut self) -> &mut crate::RequestOptions {
2717 &mut self.0.options
2718 }
2719 }
2720
2721 #[derive(Clone, Debug)]
2738 pub struct TestIamPermissions(
2739 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2740 );
2741
2742 impl TestIamPermissions {
2743 pub(crate) fn new(
2744 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2745 ) -> Self {
2746 Self(RequestBuilder::new(stub))
2747 }
2748
2749 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2751 mut self,
2752 v: V,
2753 ) -> Self {
2754 self.0.request = v.into();
2755 self
2756 }
2757
2758 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2760 self.0.options = v.into();
2761 self
2762 }
2763
2764 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2766 (*self.0.stub)
2767 .test_iam_permissions(self.0.request, self.0.options)
2768 .await
2769 .map(crate::Response::into_body)
2770 }
2771
2772 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2776 self.0.request.resource = v.into();
2777 self
2778 }
2779
2780 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2784 where
2785 T: std::iter::IntoIterator<Item = V>,
2786 V: std::convert::Into<std::string::String>,
2787 {
2788 use std::iter::Iterator;
2789 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2790 self
2791 }
2792 }
2793
2794 #[doc(hidden)]
2795 impl crate::RequestBuilder for TestIamPermissions {
2796 fn request_options(&mut self) -> &mut crate::RequestOptions {
2797 &mut self.0.options
2798 }
2799 }
2800
2801 #[derive(Clone, Debug)]
2822 pub struct ListOperations(
2823 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2824 );
2825
2826 impl ListOperations {
2827 pub(crate) fn new(
2828 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2829 ) -> Self {
2830 Self(RequestBuilder::new(stub))
2831 }
2832
2833 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2835 mut self,
2836 v: V,
2837 ) -> Self {
2838 self.0.request = v.into();
2839 self
2840 }
2841
2842 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2844 self.0.options = v.into();
2845 self
2846 }
2847
2848 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2850 (*self.0.stub)
2851 .list_operations(self.0.request, self.0.options)
2852 .await
2853 .map(crate::Response::into_body)
2854 }
2855
2856 pub fn by_page(
2858 self,
2859 ) -> impl google_cloud_gax::paginator::Paginator<
2860 google_cloud_longrunning::model::ListOperationsResponse,
2861 crate::Error,
2862 > {
2863 use std::clone::Clone;
2864 let token = self.0.request.page_token.clone();
2865 let execute = move |token: String| {
2866 let mut builder = self.clone();
2867 builder.0.request = builder.0.request.set_page_token(token);
2868 builder.send()
2869 };
2870 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2871 }
2872
2873 pub fn by_item(
2875 self,
2876 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2877 google_cloud_longrunning::model::ListOperationsResponse,
2878 crate::Error,
2879 > {
2880 use google_cloud_gax::paginator::Paginator;
2881 self.by_page().items()
2882 }
2883
2884 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2886 self.0.request.name = v.into();
2887 self
2888 }
2889
2890 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2892 self.0.request.filter = v.into();
2893 self
2894 }
2895
2896 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2898 self.0.request.page_size = v.into();
2899 self
2900 }
2901
2902 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2904 self.0.request.page_token = v.into();
2905 self
2906 }
2907
2908 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2910 self.0.request.return_partial_success = v.into();
2911 self
2912 }
2913 }
2914
2915 #[doc(hidden)]
2916 impl crate::RequestBuilder for ListOperations {
2917 fn request_options(&mut self) -> &mut crate::RequestOptions {
2918 &mut self.0.options
2919 }
2920 }
2921
2922 #[derive(Clone, Debug)]
2939 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2940
2941 impl GetOperation {
2942 pub(crate) fn new(
2943 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2944 ) -> Self {
2945 Self(RequestBuilder::new(stub))
2946 }
2947
2948 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2950 mut self,
2951 v: V,
2952 ) -> Self {
2953 self.0.request = v.into();
2954 self
2955 }
2956
2957 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2959 self.0.options = v.into();
2960 self
2961 }
2962
2963 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2965 (*self.0.stub)
2966 .get_operation(self.0.request, self.0.options)
2967 .await
2968 .map(crate::Response::into_body)
2969 }
2970
2971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2973 self.0.request.name = v.into();
2974 self
2975 }
2976 }
2977
2978 #[doc(hidden)]
2979 impl crate::RequestBuilder for GetOperation {
2980 fn request_options(&mut self) -> &mut crate::RequestOptions {
2981 &mut self.0.options
2982 }
2983 }
2984
2985 #[derive(Clone, Debug)]
3002 pub struct DeleteOperation(
3003 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3004 );
3005
3006 impl DeleteOperation {
3007 pub(crate) fn new(
3008 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
3009 ) -> Self {
3010 Self(RequestBuilder::new(stub))
3011 }
3012
3013 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3015 mut self,
3016 v: V,
3017 ) -> Self {
3018 self.0.request = v.into();
3019 self
3020 }
3021
3022 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3024 self.0.options = v.into();
3025 self
3026 }
3027
3028 pub async fn send(self) -> Result<()> {
3030 (*self.0.stub)
3031 .delete_operation(self.0.request, self.0.options)
3032 .await
3033 .map(crate::Response::into_body)
3034 }
3035
3036 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3038 self.0.request.name = v.into();
3039 self
3040 }
3041 }
3042
3043 #[doc(hidden)]
3044 impl crate::RequestBuilder for DeleteOperation {
3045 fn request_options(&mut self) -> &mut crate::RequestOptions {
3046 &mut self.0.options
3047 }
3048 }
3049
3050 #[derive(Clone, Debug)]
3067 pub struct CancelOperation(
3068 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3069 );
3070
3071 impl CancelOperation {
3072 pub(crate) fn new(
3073 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
3074 ) -> Self {
3075 Self(RequestBuilder::new(stub))
3076 }
3077
3078 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3080 mut self,
3081 v: V,
3082 ) -> Self {
3083 self.0.request = v.into();
3084 self
3085 }
3086
3087 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3089 self.0.options = v.into();
3090 self
3091 }
3092
3093 pub async fn send(self) -> Result<()> {
3095 (*self.0.stub)
3096 .cancel_operation(self.0.request, self.0.options)
3097 .await
3098 .map(crate::Response::into_body)
3099 }
3100
3101 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3103 self.0.request.name = v.into();
3104 self
3105 }
3106 }
3107
3108 #[doc(hidden)]
3109 impl crate::RequestBuilder for CancelOperation {
3110 fn request_options(&mut self) -> &mut crate::RequestOptions {
3111 &mut self.0.options
3112 }
3113 }
3114}
3115
3116pub mod data_transfer_service {
3118 use crate::Result;
3119
3120 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3134
3135 pub(crate) mod client {
3136 use super::super::super::client::DataTransferService;
3137 pub struct Factory;
3138 impl crate::ClientFactory for Factory {
3139 type Client = DataTransferService;
3140 type Credentials = gaxi::options::Credentials;
3141 async fn build(
3142 self,
3143 config: gaxi::options::ClientConfig,
3144 ) -> crate::ClientBuilderResult<Self::Client> {
3145 Self::Client::new(config).await
3146 }
3147 }
3148 }
3149
3150 #[derive(Clone, Debug)]
3152 pub(crate) struct RequestBuilder<R: std::default::Default> {
3153 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3154 request: R,
3155 options: crate::RequestOptions,
3156 }
3157
3158 impl<R> RequestBuilder<R>
3159 where
3160 R: std::default::Default,
3161 {
3162 pub(crate) fn new(
3163 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3164 ) -> Self {
3165 Self {
3166 stub,
3167 request: R::default(),
3168 options: crate::RequestOptions::default(),
3169 }
3170 }
3171 }
3172
3173 #[derive(Clone, Debug)]
3194 pub struct ListMulticloudDataTransferConfigs(
3195 RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3196 );
3197
3198 impl ListMulticloudDataTransferConfigs {
3199 pub(crate) fn new(
3200 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3201 ) -> Self {
3202 Self(RequestBuilder::new(stub))
3203 }
3204
3205 pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3207 mut self,
3208 v: V,
3209 ) -> Self {
3210 self.0.request = v.into();
3211 self
3212 }
3213
3214 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3216 self.0.options = v.into();
3217 self
3218 }
3219
3220 pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3222 (*self.0.stub)
3223 .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3224 .await
3225 .map(crate::Response::into_body)
3226 }
3227
3228 pub fn by_page(
3230 self,
3231 ) -> impl google_cloud_gax::paginator::Paginator<
3232 crate::model::ListMulticloudDataTransferConfigsResponse,
3233 crate::Error,
3234 > {
3235 use std::clone::Clone;
3236 let token = self.0.request.page_token.clone();
3237 let execute = move |token: String| {
3238 let mut builder = self.clone();
3239 builder.0.request = builder.0.request.set_page_token(token);
3240 builder.send()
3241 };
3242 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3243 }
3244
3245 pub fn by_item(
3247 self,
3248 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3249 crate::model::ListMulticloudDataTransferConfigsResponse,
3250 crate::Error,
3251 > {
3252 use google_cloud_gax::paginator::Paginator;
3253 self.by_page().items()
3254 }
3255
3256 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3260 self.0.request.parent = v.into();
3261 self
3262 }
3263
3264 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3266 self.0.request.page_size = v.into();
3267 self
3268 }
3269
3270 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3272 self.0.request.page_token = v.into();
3273 self
3274 }
3275
3276 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3278 self.0.request.filter = v.into();
3279 self
3280 }
3281
3282 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3284 self.0.request.order_by = v.into();
3285 self
3286 }
3287
3288 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3290 self.0.request.return_partial_success = v.into();
3291 self
3292 }
3293 }
3294
3295 #[doc(hidden)]
3296 impl crate::RequestBuilder for ListMulticloudDataTransferConfigs {
3297 fn request_options(&mut self) -> &mut crate::RequestOptions {
3298 &mut self.0.options
3299 }
3300 }
3301
3302 #[derive(Clone, Debug)]
3319 pub struct GetMulticloudDataTransferConfig(
3320 RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3321 );
3322
3323 impl GetMulticloudDataTransferConfig {
3324 pub(crate) fn new(
3325 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3326 ) -> Self {
3327 Self(RequestBuilder::new(stub))
3328 }
3329
3330 pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3332 mut self,
3333 v: V,
3334 ) -> Self {
3335 self.0.request = v.into();
3336 self
3337 }
3338
3339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3341 self.0.options = v.into();
3342 self
3343 }
3344
3345 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3347 (*self.0.stub)
3348 .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3349 .await
3350 .map(crate::Response::into_body)
3351 }
3352
3353 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3357 self.0.request.name = v.into();
3358 self
3359 }
3360 }
3361
3362 #[doc(hidden)]
3363 impl crate::RequestBuilder for GetMulticloudDataTransferConfig {
3364 fn request_options(&mut self) -> &mut crate::RequestOptions {
3365 &mut self.0.options
3366 }
3367 }
3368
3369 #[derive(Clone, Debug)]
3387 pub struct CreateMulticloudDataTransferConfig(
3388 RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3389 );
3390
3391 impl CreateMulticloudDataTransferConfig {
3392 pub(crate) fn new(
3393 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3394 ) -> Self {
3395 Self(RequestBuilder::new(stub))
3396 }
3397
3398 pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3400 mut self,
3401 v: V,
3402 ) -> Self {
3403 self.0.request = v.into();
3404 self
3405 }
3406
3407 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3409 self.0.options = v.into();
3410 self
3411 }
3412
3413 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3420 (*self.0.stub)
3421 .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3422 .await
3423 .map(crate::Response::into_body)
3424 }
3425
3426 pub fn poller(
3428 self,
3429 ) -> impl google_cloud_lro::Poller<
3430 crate::model::MulticloudDataTransferConfig,
3431 crate::model::OperationMetadata,
3432 > {
3433 type Operation = google_cloud_lro::internal::Operation<
3434 crate::model::MulticloudDataTransferConfig,
3435 crate::model::OperationMetadata,
3436 >;
3437 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3438 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3439 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3440 if let Some(ref mut details) = poller_options.tracing {
3441 details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::create_multicloud_data_transfer_config::until_done";
3442 }
3443
3444 let stub = self.0.stub.clone();
3445 let mut options = self.0.options.clone();
3446 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3447 let query = move |name| {
3448 let stub = stub.clone();
3449 let options = options.clone();
3450 async {
3451 let op = GetOperation::new(stub)
3452 .set_name(name)
3453 .with_options(options)
3454 .send()
3455 .await?;
3456 Ok(Operation::new(op))
3457 }
3458 };
3459
3460 let start = move || async {
3461 let op = self.send().await?;
3462 Ok(Operation::new(op))
3463 };
3464
3465 use google_cloud_lro::internal::PollerExt;
3466 {
3467 google_cloud_lro::internal::new_poller(
3468 polling_error_policy,
3469 polling_backoff_policy,
3470 start,
3471 query,
3472 )
3473 }
3474 .with_options(poller_options)
3475 }
3476
3477 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3481 self.0.request.parent = v.into();
3482 self
3483 }
3484
3485 pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3489 mut self,
3490 v: T,
3491 ) -> Self {
3492 self.0.request.multicloud_data_transfer_config_id = v.into();
3493 self
3494 }
3495
3496 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3500 where
3501 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3502 {
3503 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3504 self
3505 }
3506
3507 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3511 mut self,
3512 v: std::option::Option<T>,
3513 ) -> Self
3514 where
3515 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3516 {
3517 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3518 self
3519 }
3520
3521 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3523 self.0.request.request_id = v.into();
3524 self
3525 }
3526 }
3527
3528 #[doc(hidden)]
3529 impl crate::RequestBuilder for CreateMulticloudDataTransferConfig {
3530 fn request_options(&mut self) -> &mut crate::RequestOptions {
3531 &mut self.0.options
3532 }
3533 }
3534
3535 #[derive(Clone, Debug)]
3553 pub struct UpdateMulticloudDataTransferConfig(
3554 RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3555 );
3556
3557 impl UpdateMulticloudDataTransferConfig {
3558 pub(crate) fn new(
3559 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3560 ) -> Self {
3561 Self(RequestBuilder::new(stub))
3562 }
3563
3564 pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3566 mut self,
3567 v: V,
3568 ) -> Self {
3569 self.0.request = v.into();
3570 self
3571 }
3572
3573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3575 self.0.options = v.into();
3576 self
3577 }
3578
3579 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3586 (*self.0.stub)
3587 .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3588 .await
3589 .map(crate::Response::into_body)
3590 }
3591
3592 pub fn poller(
3594 self,
3595 ) -> impl google_cloud_lro::Poller<
3596 crate::model::MulticloudDataTransferConfig,
3597 crate::model::OperationMetadata,
3598 > {
3599 type Operation = google_cloud_lro::internal::Operation<
3600 crate::model::MulticloudDataTransferConfig,
3601 crate::model::OperationMetadata,
3602 >;
3603 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3604 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3605 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3606 if let Some(ref mut details) = poller_options.tracing {
3607 details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::update_multicloud_data_transfer_config::until_done";
3608 }
3609
3610 let stub = self.0.stub.clone();
3611 let mut options = self.0.options.clone();
3612 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3613 let query = move |name| {
3614 let stub = stub.clone();
3615 let options = options.clone();
3616 async {
3617 let op = GetOperation::new(stub)
3618 .set_name(name)
3619 .with_options(options)
3620 .send()
3621 .await?;
3622 Ok(Operation::new(op))
3623 }
3624 };
3625
3626 let start = move || async {
3627 let op = self.send().await?;
3628 Ok(Operation::new(op))
3629 };
3630
3631 use google_cloud_lro::internal::PollerExt;
3632 {
3633 google_cloud_lro::internal::new_poller(
3634 polling_error_policy,
3635 polling_backoff_policy,
3636 start,
3637 query,
3638 )
3639 }
3640 .with_options(poller_options)
3641 }
3642
3643 pub fn set_update_mask<T>(mut self, v: T) -> Self
3645 where
3646 T: std::convert::Into<wkt::FieldMask>,
3647 {
3648 self.0.request.update_mask = std::option::Option::Some(v.into());
3649 self
3650 }
3651
3652 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3654 where
3655 T: std::convert::Into<wkt::FieldMask>,
3656 {
3657 self.0.request.update_mask = v.map(|x| x.into());
3658 self
3659 }
3660
3661 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3665 where
3666 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3667 {
3668 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3669 self
3670 }
3671
3672 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3676 mut self,
3677 v: std::option::Option<T>,
3678 ) -> Self
3679 where
3680 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3681 {
3682 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3683 self
3684 }
3685
3686 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3688 self.0.request.request_id = v.into();
3689 self
3690 }
3691 }
3692
3693 #[doc(hidden)]
3694 impl crate::RequestBuilder for UpdateMulticloudDataTransferConfig {
3695 fn request_options(&mut self) -> &mut crate::RequestOptions {
3696 &mut self.0.options
3697 }
3698 }
3699
3700 #[derive(Clone, Debug)]
3718 pub struct DeleteMulticloudDataTransferConfig(
3719 RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3720 );
3721
3722 impl DeleteMulticloudDataTransferConfig {
3723 pub(crate) fn new(
3724 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3725 ) -> Self {
3726 Self(RequestBuilder::new(stub))
3727 }
3728
3729 pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3731 mut self,
3732 v: V,
3733 ) -> Self {
3734 self.0.request = v.into();
3735 self
3736 }
3737
3738 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3740 self.0.options = v.into();
3741 self
3742 }
3743
3744 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3751 (*self.0.stub)
3752 .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3753 .await
3754 .map(crate::Response::into_body)
3755 }
3756
3757 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3759 type Operation =
3760 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3761 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3762 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3763 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3764 if let Some(ref mut details) = poller_options.tracing {
3765 details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::delete_multicloud_data_transfer_config::until_done";
3766 }
3767
3768 let stub = self.0.stub.clone();
3769 let mut options = self.0.options.clone();
3770 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3771 let query = move |name| {
3772 let stub = stub.clone();
3773 let options = options.clone();
3774 async {
3775 let op = GetOperation::new(stub)
3776 .set_name(name)
3777 .with_options(options)
3778 .send()
3779 .await?;
3780 Ok(Operation::new(op))
3781 }
3782 };
3783
3784 let start = move || async {
3785 let op = self.send().await?;
3786 Ok(Operation::new(op))
3787 };
3788
3789 use google_cloud_lro::internal::PollerExt;
3790 {
3791 google_cloud_lro::internal::new_unit_response_poller(
3792 polling_error_policy,
3793 polling_backoff_policy,
3794 start,
3795 query,
3796 )
3797 }
3798 .with_options(poller_options)
3799 }
3800
3801 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3805 self.0.request.name = v.into();
3806 self
3807 }
3808
3809 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3811 self.0.request.request_id = v.into();
3812 self
3813 }
3814
3815 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3817 self.0.request.etag = v.into();
3818 self
3819 }
3820 }
3821
3822 #[doc(hidden)]
3823 impl crate::RequestBuilder for DeleteMulticloudDataTransferConfig {
3824 fn request_options(&mut self) -> &mut crate::RequestOptions {
3825 &mut self.0.options
3826 }
3827 }
3828
3829 #[derive(Clone, Debug)]
3850 pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3851
3852 impl ListDestinations {
3853 pub(crate) fn new(
3854 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3855 ) -> Self {
3856 Self(RequestBuilder::new(stub))
3857 }
3858
3859 pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3861 mut self,
3862 v: V,
3863 ) -> Self {
3864 self.0.request = v.into();
3865 self
3866 }
3867
3868 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3870 self.0.options = v.into();
3871 self
3872 }
3873
3874 pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3876 (*self.0.stub)
3877 .list_destinations(self.0.request, self.0.options)
3878 .await
3879 .map(crate::Response::into_body)
3880 }
3881
3882 pub fn by_page(
3884 self,
3885 ) -> impl google_cloud_gax::paginator::Paginator<
3886 crate::model::ListDestinationsResponse,
3887 crate::Error,
3888 > {
3889 use std::clone::Clone;
3890 let token = self.0.request.page_token.clone();
3891 let execute = move |token: String| {
3892 let mut builder = self.clone();
3893 builder.0.request = builder.0.request.set_page_token(token);
3894 builder.send()
3895 };
3896 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3897 }
3898
3899 pub fn by_item(
3901 self,
3902 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3903 crate::model::ListDestinationsResponse,
3904 crate::Error,
3905 > {
3906 use google_cloud_gax::paginator::Paginator;
3907 self.by_page().items()
3908 }
3909
3910 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3914 self.0.request.parent = v.into();
3915 self
3916 }
3917
3918 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3920 self.0.request.page_size = v.into();
3921 self
3922 }
3923
3924 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3926 self.0.request.page_token = v.into();
3927 self
3928 }
3929
3930 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3932 self.0.request.filter = v.into();
3933 self
3934 }
3935
3936 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3938 self.0.request.order_by = v.into();
3939 self
3940 }
3941
3942 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3944 self.0.request.return_partial_success = v.into();
3945 self
3946 }
3947 }
3948
3949 #[doc(hidden)]
3950 impl crate::RequestBuilder for ListDestinations {
3951 fn request_options(&mut self) -> &mut crate::RequestOptions {
3952 &mut self.0.options
3953 }
3954 }
3955
3956 #[derive(Clone, Debug)]
3973 pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3974
3975 impl GetDestination {
3976 pub(crate) fn new(
3977 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3978 ) -> Self {
3979 Self(RequestBuilder::new(stub))
3980 }
3981
3982 pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3984 self.0.request = v.into();
3985 self
3986 }
3987
3988 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3990 self.0.options = v.into();
3991 self
3992 }
3993
3994 pub async fn send(self) -> Result<crate::model::Destination> {
3996 (*self.0.stub)
3997 .get_destination(self.0.request, self.0.options)
3998 .await
3999 .map(crate::Response::into_body)
4000 }
4001
4002 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4006 self.0.request.name = v.into();
4007 self
4008 }
4009 }
4010
4011 #[doc(hidden)]
4012 impl crate::RequestBuilder for GetDestination {
4013 fn request_options(&mut self) -> &mut crate::RequestOptions {
4014 &mut self.0.options
4015 }
4016 }
4017
4018 #[derive(Clone, Debug)]
4036 pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
4037
4038 impl CreateDestination {
4039 pub(crate) fn new(
4040 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4041 ) -> Self {
4042 Self(RequestBuilder::new(stub))
4043 }
4044
4045 pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
4047 mut self,
4048 v: V,
4049 ) -> Self {
4050 self.0.request = v.into();
4051 self
4052 }
4053
4054 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4056 self.0.options = v.into();
4057 self
4058 }
4059
4060 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4067 (*self.0.stub)
4068 .create_destination(self.0.request, self.0.options)
4069 .await
4070 .map(crate::Response::into_body)
4071 }
4072
4073 pub fn poller(
4075 self,
4076 ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
4077 {
4078 type Operation = google_cloud_lro::internal::Operation<
4079 crate::model::Destination,
4080 crate::model::OperationMetadata,
4081 >;
4082 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4083 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4084 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4085 if let Some(ref mut details) = poller_options.tracing {
4086 details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::create_destination::until_done";
4087 }
4088
4089 let stub = self.0.stub.clone();
4090 let mut options = self.0.options.clone();
4091 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4092 let query = move |name| {
4093 let stub = stub.clone();
4094 let options = options.clone();
4095 async {
4096 let op = GetOperation::new(stub)
4097 .set_name(name)
4098 .with_options(options)
4099 .send()
4100 .await?;
4101 Ok(Operation::new(op))
4102 }
4103 };
4104
4105 let start = move || async {
4106 let op = self.send().await?;
4107 Ok(Operation::new(op))
4108 };
4109
4110 use google_cloud_lro::internal::PollerExt;
4111 {
4112 google_cloud_lro::internal::new_poller(
4113 polling_error_policy,
4114 polling_backoff_policy,
4115 start,
4116 query,
4117 )
4118 }
4119 .with_options(poller_options)
4120 }
4121
4122 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4126 self.0.request.parent = v.into();
4127 self
4128 }
4129
4130 pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4134 self.0.request.destination_id = v.into();
4135 self
4136 }
4137
4138 pub fn set_destination<T>(mut self, v: T) -> Self
4142 where
4143 T: std::convert::Into<crate::model::Destination>,
4144 {
4145 self.0.request.destination = std::option::Option::Some(v.into());
4146 self
4147 }
4148
4149 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4153 where
4154 T: std::convert::Into<crate::model::Destination>,
4155 {
4156 self.0.request.destination = v.map(|x| x.into());
4157 self
4158 }
4159
4160 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4162 self.0.request.request_id = v.into();
4163 self
4164 }
4165 }
4166
4167 #[doc(hidden)]
4168 impl crate::RequestBuilder for CreateDestination {
4169 fn request_options(&mut self) -> &mut crate::RequestOptions {
4170 &mut self.0.options
4171 }
4172 }
4173
4174 #[derive(Clone, Debug)]
4192 pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4193
4194 impl UpdateDestination {
4195 pub(crate) fn new(
4196 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4197 ) -> Self {
4198 Self(RequestBuilder::new(stub))
4199 }
4200
4201 pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4203 mut self,
4204 v: V,
4205 ) -> Self {
4206 self.0.request = v.into();
4207 self
4208 }
4209
4210 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4212 self.0.options = v.into();
4213 self
4214 }
4215
4216 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4223 (*self.0.stub)
4224 .update_destination(self.0.request, self.0.options)
4225 .await
4226 .map(crate::Response::into_body)
4227 }
4228
4229 pub fn poller(
4231 self,
4232 ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
4233 {
4234 type Operation = google_cloud_lro::internal::Operation<
4235 crate::model::Destination,
4236 crate::model::OperationMetadata,
4237 >;
4238 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4239 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4240 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4241 if let Some(ref mut details) = poller_options.tracing {
4242 details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::update_destination::until_done";
4243 }
4244
4245 let stub = self.0.stub.clone();
4246 let mut options = self.0.options.clone();
4247 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4248 let query = move |name| {
4249 let stub = stub.clone();
4250 let options = options.clone();
4251 async {
4252 let op = GetOperation::new(stub)
4253 .set_name(name)
4254 .with_options(options)
4255 .send()
4256 .await?;
4257 Ok(Operation::new(op))
4258 }
4259 };
4260
4261 let start = move || async {
4262 let op = self.send().await?;
4263 Ok(Operation::new(op))
4264 };
4265
4266 use google_cloud_lro::internal::PollerExt;
4267 {
4268 google_cloud_lro::internal::new_poller(
4269 polling_error_policy,
4270 polling_backoff_policy,
4271 start,
4272 query,
4273 )
4274 }
4275 .with_options(poller_options)
4276 }
4277
4278 pub fn set_update_mask<T>(mut self, v: T) -> Self
4280 where
4281 T: std::convert::Into<wkt::FieldMask>,
4282 {
4283 self.0.request.update_mask = std::option::Option::Some(v.into());
4284 self
4285 }
4286
4287 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4289 where
4290 T: std::convert::Into<wkt::FieldMask>,
4291 {
4292 self.0.request.update_mask = v.map(|x| x.into());
4293 self
4294 }
4295
4296 pub fn set_destination<T>(mut self, v: T) -> Self
4300 where
4301 T: std::convert::Into<crate::model::Destination>,
4302 {
4303 self.0.request.destination = std::option::Option::Some(v.into());
4304 self
4305 }
4306
4307 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4311 where
4312 T: std::convert::Into<crate::model::Destination>,
4313 {
4314 self.0.request.destination = v.map(|x| x.into());
4315 self
4316 }
4317
4318 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4320 self.0.request.request_id = v.into();
4321 self
4322 }
4323 }
4324
4325 #[doc(hidden)]
4326 impl crate::RequestBuilder for UpdateDestination {
4327 fn request_options(&mut self) -> &mut crate::RequestOptions {
4328 &mut self.0.options
4329 }
4330 }
4331
4332 #[derive(Clone, Debug)]
4350 pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4351
4352 impl DeleteDestination {
4353 pub(crate) fn new(
4354 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4355 ) -> Self {
4356 Self(RequestBuilder::new(stub))
4357 }
4358
4359 pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4361 mut self,
4362 v: V,
4363 ) -> Self {
4364 self.0.request = v.into();
4365 self
4366 }
4367
4368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4370 self.0.options = v.into();
4371 self
4372 }
4373
4374 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4381 (*self.0.stub)
4382 .delete_destination(self.0.request, self.0.options)
4383 .await
4384 .map(crate::Response::into_body)
4385 }
4386
4387 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4389 type Operation =
4390 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4391 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4392 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4393 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4394 if let Some(ref mut details) = poller_options.tracing {
4395 details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::delete_destination::until_done";
4396 }
4397
4398 let stub = self.0.stub.clone();
4399 let mut options = self.0.options.clone();
4400 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4401 let query = move |name| {
4402 let stub = stub.clone();
4403 let options = options.clone();
4404 async {
4405 let op = GetOperation::new(stub)
4406 .set_name(name)
4407 .with_options(options)
4408 .send()
4409 .await?;
4410 Ok(Operation::new(op))
4411 }
4412 };
4413
4414 let start = move || async {
4415 let op = self.send().await?;
4416 Ok(Operation::new(op))
4417 };
4418
4419 use google_cloud_lro::internal::PollerExt;
4420 {
4421 google_cloud_lro::internal::new_unit_response_poller(
4422 polling_error_policy,
4423 polling_backoff_policy,
4424 start,
4425 query,
4426 )
4427 }
4428 .with_options(poller_options)
4429 }
4430
4431 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4435 self.0.request.name = v.into();
4436 self
4437 }
4438
4439 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4441 self.0.request.request_id = v.into();
4442 self
4443 }
4444
4445 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4447 self.0.request.etag = v.into();
4448 self
4449 }
4450 }
4451
4452 #[doc(hidden)]
4453 impl crate::RequestBuilder for DeleteDestination {
4454 fn request_options(&mut self) -> &mut crate::RequestOptions {
4455 &mut self.0.options
4456 }
4457 }
4458
4459 #[derive(Clone, Debug)]
4476 pub struct GetMulticloudDataTransferSupportedService(
4477 RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4478 );
4479
4480 impl GetMulticloudDataTransferSupportedService {
4481 pub(crate) fn new(
4482 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4483 ) -> Self {
4484 Self(RequestBuilder::new(stub))
4485 }
4486
4487 pub fn with_request<
4489 V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4490 >(
4491 mut self,
4492 v: V,
4493 ) -> Self {
4494 self.0.request = v.into();
4495 self
4496 }
4497
4498 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4500 self.0.options = v.into();
4501 self
4502 }
4503
4504 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4506 (*self.0.stub)
4507 .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4508 .await
4509 .map(crate::Response::into_body)
4510 }
4511
4512 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4516 self.0.request.name = v.into();
4517 self
4518 }
4519 }
4520
4521 #[doc(hidden)]
4522 impl crate::RequestBuilder for GetMulticloudDataTransferSupportedService {
4523 fn request_options(&mut self) -> &mut crate::RequestOptions {
4524 &mut self.0.options
4525 }
4526 }
4527
4528 #[derive(Clone, Debug)]
4549 pub struct ListMulticloudDataTransferSupportedServices(
4550 RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4551 );
4552
4553 impl ListMulticloudDataTransferSupportedServices {
4554 pub(crate) fn new(
4555 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4556 ) -> Self {
4557 Self(RequestBuilder::new(stub))
4558 }
4559
4560 pub fn with_request<
4562 V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4563 >(
4564 mut self,
4565 v: V,
4566 ) -> Self {
4567 self.0.request = v.into();
4568 self
4569 }
4570
4571 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4573 self.0.options = v.into();
4574 self
4575 }
4576
4577 pub async fn send(
4579 self,
4580 ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4581 (*self.0.stub)
4582 .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4583 .await
4584 .map(crate::Response::into_body)
4585 }
4586
4587 pub fn by_page(
4589 self,
4590 ) -> impl google_cloud_gax::paginator::Paginator<
4591 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4592 crate::Error,
4593 > {
4594 use std::clone::Clone;
4595 let token = self.0.request.page_token.clone();
4596 let execute = move |token: String| {
4597 let mut builder = self.clone();
4598 builder.0.request = builder.0.request.set_page_token(token);
4599 builder.send()
4600 };
4601 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4602 }
4603
4604 pub fn by_item(
4606 self,
4607 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4608 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4609 crate::Error,
4610 > {
4611 use google_cloud_gax::paginator::Paginator;
4612 self.by_page().items()
4613 }
4614
4615 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4619 self.0.request.parent = v.into();
4620 self
4621 }
4622
4623 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4625 self.0.request.page_size = v.into();
4626 self
4627 }
4628
4629 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4631 self.0.request.page_token = v.into();
4632 self
4633 }
4634 }
4635
4636 #[doc(hidden)]
4637 impl crate::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4638 fn request_options(&mut self) -> &mut crate::RequestOptions {
4639 &mut self.0.options
4640 }
4641 }
4642
4643 #[derive(Clone, Debug)]
4664 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4665
4666 impl ListLocations {
4667 pub(crate) fn new(
4668 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4669 ) -> Self {
4670 Self(RequestBuilder::new(stub))
4671 }
4672
4673 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4675 mut self,
4676 v: V,
4677 ) -> Self {
4678 self.0.request = v.into();
4679 self
4680 }
4681
4682 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4684 self.0.options = v.into();
4685 self
4686 }
4687
4688 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4690 (*self.0.stub)
4691 .list_locations(self.0.request, self.0.options)
4692 .await
4693 .map(crate::Response::into_body)
4694 }
4695
4696 pub fn by_page(
4698 self,
4699 ) -> impl google_cloud_gax::paginator::Paginator<
4700 google_cloud_location::model::ListLocationsResponse,
4701 crate::Error,
4702 > {
4703 use std::clone::Clone;
4704 let token = self.0.request.page_token.clone();
4705 let execute = move |token: String| {
4706 let mut builder = self.clone();
4707 builder.0.request = builder.0.request.set_page_token(token);
4708 builder.send()
4709 };
4710 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4711 }
4712
4713 pub fn by_item(
4715 self,
4716 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4717 google_cloud_location::model::ListLocationsResponse,
4718 crate::Error,
4719 > {
4720 use google_cloud_gax::paginator::Paginator;
4721 self.by_page().items()
4722 }
4723
4724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4726 self.0.request.name = v.into();
4727 self
4728 }
4729
4730 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4732 self.0.request.filter = v.into();
4733 self
4734 }
4735
4736 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4738 self.0.request.page_size = v.into();
4739 self
4740 }
4741
4742 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4744 self.0.request.page_token = v.into();
4745 self
4746 }
4747 }
4748
4749 #[doc(hidden)]
4750 impl crate::RequestBuilder for ListLocations {
4751 fn request_options(&mut self) -> &mut crate::RequestOptions {
4752 &mut self.0.options
4753 }
4754 }
4755
4756 #[derive(Clone, Debug)]
4773 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4774
4775 impl GetLocation {
4776 pub(crate) fn new(
4777 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4778 ) -> Self {
4779 Self(RequestBuilder::new(stub))
4780 }
4781
4782 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4784 mut self,
4785 v: V,
4786 ) -> Self {
4787 self.0.request = v.into();
4788 self
4789 }
4790
4791 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4793 self.0.options = v.into();
4794 self
4795 }
4796
4797 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4799 (*self.0.stub)
4800 .get_location(self.0.request, self.0.options)
4801 .await
4802 .map(crate::Response::into_body)
4803 }
4804
4805 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4807 self.0.request.name = v.into();
4808 self
4809 }
4810 }
4811
4812 #[doc(hidden)]
4813 impl crate::RequestBuilder for GetLocation {
4814 fn request_options(&mut self) -> &mut crate::RequestOptions {
4815 &mut self.0.options
4816 }
4817 }
4818
4819 #[derive(Clone, Debug)]
4836 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4837
4838 impl SetIamPolicy {
4839 pub(crate) fn new(
4840 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4841 ) -> Self {
4842 Self(RequestBuilder::new(stub))
4843 }
4844
4845 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4847 mut self,
4848 v: V,
4849 ) -> Self {
4850 self.0.request = v.into();
4851 self
4852 }
4853
4854 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4856 self.0.options = v.into();
4857 self
4858 }
4859
4860 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4862 (*self.0.stub)
4863 .set_iam_policy(self.0.request, self.0.options)
4864 .await
4865 .map(crate::Response::into_body)
4866 }
4867
4868 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4872 self.0.request.resource = v.into();
4873 self
4874 }
4875
4876 pub fn set_policy<T>(mut self, v: T) -> Self
4880 where
4881 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4882 {
4883 self.0.request.policy = std::option::Option::Some(v.into());
4884 self
4885 }
4886
4887 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4891 where
4892 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4893 {
4894 self.0.request.policy = v.map(|x| x.into());
4895 self
4896 }
4897
4898 pub fn set_update_mask<T>(mut self, v: T) -> Self
4900 where
4901 T: std::convert::Into<wkt::FieldMask>,
4902 {
4903 self.0.request.update_mask = std::option::Option::Some(v.into());
4904 self
4905 }
4906
4907 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4909 where
4910 T: std::convert::Into<wkt::FieldMask>,
4911 {
4912 self.0.request.update_mask = v.map(|x| x.into());
4913 self
4914 }
4915 }
4916
4917 #[doc(hidden)]
4918 impl crate::RequestBuilder for SetIamPolicy {
4919 fn request_options(&mut self) -> &mut crate::RequestOptions {
4920 &mut self.0.options
4921 }
4922 }
4923
4924 #[derive(Clone, Debug)]
4941 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4942
4943 impl GetIamPolicy {
4944 pub(crate) fn new(
4945 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4946 ) -> Self {
4947 Self(RequestBuilder::new(stub))
4948 }
4949
4950 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4952 mut self,
4953 v: V,
4954 ) -> Self {
4955 self.0.request = v.into();
4956 self
4957 }
4958
4959 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4961 self.0.options = v.into();
4962 self
4963 }
4964
4965 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4967 (*self.0.stub)
4968 .get_iam_policy(self.0.request, self.0.options)
4969 .await
4970 .map(crate::Response::into_body)
4971 }
4972
4973 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4977 self.0.request.resource = v.into();
4978 self
4979 }
4980
4981 pub fn set_options<T>(mut self, v: T) -> Self
4983 where
4984 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4985 {
4986 self.0.request.options = std::option::Option::Some(v.into());
4987 self
4988 }
4989
4990 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4992 where
4993 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4994 {
4995 self.0.request.options = v.map(|x| x.into());
4996 self
4997 }
4998 }
4999
5000 #[doc(hidden)]
5001 impl crate::RequestBuilder for GetIamPolicy {
5002 fn request_options(&mut self) -> &mut crate::RequestOptions {
5003 &mut self.0.options
5004 }
5005 }
5006
5007 #[derive(Clone, Debug)]
5024 pub struct TestIamPermissions(
5025 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5026 );
5027
5028 impl TestIamPermissions {
5029 pub(crate) fn new(
5030 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5031 ) -> Self {
5032 Self(RequestBuilder::new(stub))
5033 }
5034
5035 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5037 mut self,
5038 v: V,
5039 ) -> Self {
5040 self.0.request = v.into();
5041 self
5042 }
5043
5044 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5046 self.0.options = v.into();
5047 self
5048 }
5049
5050 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
5052 (*self.0.stub)
5053 .test_iam_permissions(self.0.request, self.0.options)
5054 .await
5055 .map(crate::Response::into_body)
5056 }
5057
5058 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5062 self.0.request.resource = v.into();
5063 self
5064 }
5065
5066 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5070 where
5071 T: std::iter::IntoIterator<Item = V>,
5072 V: std::convert::Into<std::string::String>,
5073 {
5074 use std::iter::Iterator;
5075 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5076 self
5077 }
5078 }
5079
5080 #[doc(hidden)]
5081 impl crate::RequestBuilder for TestIamPermissions {
5082 fn request_options(&mut self) -> &mut crate::RequestOptions {
5083 &mut self.0.options
5084 }
5085 }
5086
5087 #[derive(Clone, Debug)]
5108 pub struct ListOperations(
5109 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5110 );
5111
5112 impl ListOperations {
5113 pub(crate) fn new(
5114 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5115 ) -> Self {
5116 Self(RequestBuilder::new(stub))
5117 }
5118
5119 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5121 mut self,
5122 v: V,
5123 ) -> Self {
5124 self.0.request = v.into();
5125 self
5126 }
5127
5128 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5130 self.0.options = v.into();
5131 self
5132 }
5133
5134 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5136 (*self.0.stub)
5137 .list_operations(self.0.request, self.0.options)
5138 .await
5139 .map(crate::Response::into_body)
5140 }
5141
5142 pub fn by_page(
5144 self,
5145 ) -> impl google_cloud_gax::paginator::Paginator<
5146 google_cloud_longrunning::model::ListOperationsResponse,
5147 crate::Error,
5148 > {
5149 use std::clone::Clone;
5150 let token = self.0.request.page_token.clone();
5151 let execute = move |token: String| {
5152 let mut builder = self.clone();
5153 builder.0.request = builder.0.request.set_page_token(token);
5154 builder.send()
5155 };
5156 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5157 }
5158
5159 pub fn by_item(
5161 self,
5162 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5163 google_cloud_longrunning::model::ListOperationsResponse,
5164 crate::Error,
5165 > {
5166 use google_cloud_gax::paginator::Paginator;
5167 self.by_page().items()
5168 }
5169
5170 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5172 self.0.request.name = v.into();
5173 self
5174 }
5175
5176 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5178 self.0.request.filter = v.into();
5179 self
5180 }
5181
5182 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5184 self.0.request.page_size = v.into();
5185 self
5186 }
5187
5188 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5190 self.0.request.page_token = v.into();
5191 self
5192 }
5193
5194 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5196 self.0.request.return_partial_success = v.into();
5197 self
5198 }
5199 }
5200
5201 #[doc(hidden)]
5202 impl crate::RequestBuilder for ListOperations {
5203 fn request_options(&mut self) -> &mut crate::RequestOptions {
5204 &mut self.0.options
5205 }
5206 }
5207
5208 #[derive(Clone, Debug)]
5225 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5226
5227 impl GetOperation {
5228 pub(crate) fn new(
5229 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5230 ) -> Self {
5231 Self(RequestBuilder::new(stub))
5232 }
5233
5234 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5236 mut self,
5237 v: V,
5238 ) -> Self {
5239 self.0.request = v.into();
5240 self
5241 }
5242
5243 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5245 self.0.options = v.into();
5246 self
5247 }
5248
5249 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5251 (*self.0.stub)
5252 .get_operation(self.0.request, self.0.options)
5253 .await
5254 .map(crate::Response::into_body)
5255 }
5256
5257 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5259 self.0.request.name = v.into();
5260 self
5261 }
5262 }
5263
5264 #[doc(hidden)]
5265 impl crate::RequestBuilder for GetOperation {
5266 fn request_options(&mut self) -> &mut crate::RequestOptions {
5267 &mut self.0.options
5268 }
5269 }
5270
5271 #[derive(Clone, Debug)]
5288 pub struct DeleteOperation(
5289 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5290 );
5291
5292 impl DeleteOperation {
5293 pub(crate) fn new(
5294 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5295 ) -> Self {
5296 Self(RequestBuilder::new(stub))
5297 }
5298
5299 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5301 mut self,
5302 v: V,
5303 ) -> Self {
5304 self.0.request = v.into();
5305 self
5306 }
5307
5308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5310 self.0.options = v.into();
5311 self
5312 }
5313
5314 pub async fn send(self) -> Result<()> {
5316 (*self.0.stub)
5317 .delete_operation(self.0.request, self.0.options)
5318 .await
5319 .map(crate::Response::into_body)
5320 }
5321
5322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5324 self.0.request.name = v.into();
5325 self
5326 }
5327 }
5328
5329 #[doc(hidden)]
5330 impl crate::RequestBuilder for DeleteOperation {
5331 fn request_options(&mut self) -> &mut crate::RequestOptions {
5332 &mut self.0.options
5333 }
5334 }
5335
5336 #[derive(Clone, Debug)]
5353 pub struct CancelOperation(
5354 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5355 );
5356
5357 impl CancelOperation {
5358 pub(crate) fn new(
5359 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5360 ) -> Self {
5361 Self(RequestBuilder::new(stub))
5362 }
5363
5364 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5366 mut self,
5367 v: V,
5368 ) -> Self {
5369 self.0.request = v.into();
5370 self
5371 }
5372
5373 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5375 self.0.options = v.into();
5376 self
5377 }
5378
5379 pub async fn send(self) -> Result<()> {
5381 (*self.0.stub)
5382 .cancel_operation(self.0.request, self.0.options)
5383 .await
5384 .map(crate::Response::into_body)
5385 }
5386
5387 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5389 self.0.request.name = v.into();
5390 self
5391 }
5392 }
5393
5394 #[doc(hidden)]
5395 impl crate::RequestBuilder for CancelOperation {
5396 fn request_options(&mut self) -> &mut crate::RequestOptions {
5397 &mut self.0.options
5398 }
5399 }
5400}
5401
5402pub mod hub_service {
5404 use crate::Result;
5405
5406 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5420
5421 pub(crate) mod client {
5422 use super::super::super::client::HubService;
5423 pub struct Factory;
5424 impl crate::ClientFactory for Factory {
5425 type Client = HubService;
5426 type Credentials = gaxi::options::Credentials;
5427 async fn build(
5428 self,
5429 config: gaxi::options::ClientConfig,
5430 ) -> crate::ClientBuilderResult<Self::Client> {
5431 Self::Client::new(config).await
5432 }
5433 }
5434 }
5435
5436 #[derive(Clone, Debug)]
5438 pub(crate) struct RequestBuilder<R: std::default::Default> {
5439 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5440 request: R,
5441 options: crate::RequestOptions,
5442 }
5443
5444 impl<R> RequestBuilder<R>
5445 where
5446 R: std::default::Default,
5447 {
5448 pub(crate) fn new(
5449 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5450 ) -> Self {
5451 Self {
5452 stub,
5453 request: R::default(),
5454 options: crate::RequestOptions::default(),
5455 }
5456 }
5457 }
5458
5459 #[derive(Clone, Debug)]
5480 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5481
5482 impl ListHubs {
5483 pub(crate) fn new(
5484 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5485 ) -> Self {
5486 Self(RequestBuilder::new(stub))
5487 }
5488
5489 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5491 self.0.request = v.into();
5492 self
5493 }
5494
5495 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5497 self.0.options = v.into();
5498 self
5499 }
5500
5501 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5503 (*self.0.stub)
5504 .list_hubs(self.0.request, self.0.options)
5505 .await
5506 .map(crate::Response::into_body)
5507 }
5508
5509 pub fn by_page(
5511 self,
5512 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubsResponse, crate::Error>
5513 {
5514 use std::clone::Clone;
5515 let token = self.0.request.page_token.clone();
5516 let execute = move |token: String| {
5517 let mut builder = self.clone();
5518 builder.0.request = builder.0.request.set_page_token(token);
5519 builder.send()
5520 };
5521 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5522 }
5523
5524 pub fn by_item(
5526 self,
5527 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHubsResponse, crate::Error>
5528 {
5529 use google_cloud_gax::paginator::Paginator;
5530 self.by_page().items()
5531 }
5532
5533 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5537 self.0.request.parent = v.into();
5538 self
5539 }
5540
5541 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5543 self.0.request.page_size = v.into();
5544 self
5545 }
5546
5547 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5549 self.0.request.page_token = v.into();
5550 self
5551 }
5552
5553 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5555 self.0.request.filter = v.into();
5556 self
5557 }
5558
5559 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5561 self.0.request.order_by = v.into();
5562 self
5563 }
5564 }
5565
5566 #[doc(hidden)]
5567 impl crate::RequestBuilder for ListHubs {
5568 fn request_options(&mut self) -> &mut crate::RequestOptions {
5569 &mut self.0.options
5570 }
5571 }
5572
5573 #[derive(Clone, Debug)]
5590 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5591
5592 impl GetHub {
5593 pub(crate) fn new(
5594 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5595 ) -> Self {
5596 Self(RequestBuilder::new(stub))
5597 }
5598
5599 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5601 self.0.request = v.into();
5602 self
5603 }
5604
5605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5607 self.0.options = v.into();
5608 self
5609 }
5610
5611 pub async fn send(self) -> Result<crate::model::Hub> {
5613 (*self.0.stub)
5614 .get_hub(self.0.request, self.0.options)
5615 .await
5616 .map(crate::Response::into_body)
5617 }
5618
5619 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5623 self.0.request.name = v.into();
5624 self
5625 }
5626 }
5627
5628 #[doc(hidden)]
5629 impl crate::RequestBuilder for GetHub {
5630 fn request_options(&mut self) -> &mut crate::RequestOptions {
5631 &mut self.0.options
5632 }
5633 }
5634
5635 #[derive(Clone, Debug)]
5653 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5654
5655 impl CreateHub {
5656 pub(crate) fn new(
5657 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5658 ) -> Self {
5659 Self(RequestBuilder::new(stub))
5660 }
5661
5662 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5664 self.0.request = v.into();
5665 self
5666 }
5667
5668 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5670 self.0.options = v.into();
5671 self
5672 }
5673
5674 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5681 (*self.0.stub)
5682 .create_hub(self.0.request, self.0.options)
5683 .await
5684 .map(crate::Response::into_body)
5685 }
5686
5687 pub fn poller(
5689 self,
5690 ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5691 {
5692 type Operation = google_cloud_lro::internal::Operation<
5693 crate::model::Hub,
5694 crate::model::OperationMetadata,
5695 >;
5696 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5697 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5698 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5699 if let Some(ref mut details) = poller_options.tracing {
5700 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::create_hub::until_done";
5701 }
5702
5703 let stub = self.0.stub.clone();
5704 let mut options = self.0.options.clone();
5705 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5706 let query = move |name| {
5707 let stub = stub.clone();
5708 let options = options.clone();
5709 async {
5710 let op = GetOperation::new(stub)
5711 .set_name(name)
5712 .with_options(options)
5713 .send()
5714 .await?;
5715 Ok(Operation::new(op))
5716 }
5717 };
5718
5719 let start = move || async {
5720 let op = self.send().await?;
5721 Ok(Operation::new(op))
5722 };
5723
5724 use google_cloud_lro::internal::PollerExt;
5725 {
5726 google_cloud_lro::internal::new_poller(
5727 polling_error_policy,
5728 polling_backoff_policy,
5729 start,
5730 query,
5731 )
5732 }
5733 .with_options(poller_options)
5734 }
5735
5736 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5740 self.0.request.parent = v.into();
5741 self
5742 }
5743
5744 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5748 self.0.request.hub_id = v.into();
5749 self
5750 }
5751
5752 pub fn set_hub<T>(mut self, v: T) -> Self
5756 where
5757 T: std::convert::Into<crate::model::Hub>,
5758 {
5759 self.0.request.hub = std::option::Option::Some(v.into());
5760 self
5761 }
5762
5763 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5767 where
5768 T: std::convert::Into<crate::model::Hub>,
5769 {
5770 self.0.request.hub = v.map(|x| x.into());
5771 self
5772 }
5773
5774 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5776 self.0.request.request_id = v.into();
5777 self
5778 }
5779 }
5780
5781 #[doc(hidden)]
5782 impl crate::RequestBuilder for CreateHub {
5783 fn request_options(&mut self) -> &mut crate::RequestOptions {
5784 &mut self.0.options
5785 }
5786 }
5787
5788 #[derive(Clone, Debug)]
5806 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5807
5808 impl UpdateHub {
5809 pub(crate) fn new(
5810 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5811 ) -> Self {
5812 Self(RequestBuilder::new(stub))
5813 }
5814
5815 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5817 self.0.request = v.into();
5818 self
5819 }
5820
5821 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5823 self.0.options = v.into();
5824 self
5825 }
5826
5827 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5834 (*self.0.stub)
5835 .update_hub(self.0.request, self.0.options)
5836 .await
5837 .map(crate::Response::into_body)
5838 }
5839
5840 pub fn poller(
5842 self,
5843 ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5844 {
5845 type Operation = google_cloud_lro::internal::Operation<
5846 crate::model::Hub,
5847 crate::model::OperationMetadata,
5848 >;
5849 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5850 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5851 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5852 if let Some(ref mut details) = poller_options.tracing {
5853 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::update_hub::until_done";
5854 }
5855
5856 let stub = self.0.stub.clone();
5857 let mut options = self.0.options.clone();
5858 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5859 let query = move |name| {
5860 let stub = stub.clone();
5861 let options = options.clone();
5862 async {
5863 let op = GetOperation::new(stub)
5864 .set_name(name)
5865 .with_options(options)
5866 .send()
5867 .await?;
5868 Ok(Operation::new(op))
5869 }
5870 };
5871
5872 let start = move || async {
5873 let op = self.send().await?;
5874 Ok(Operation::new(op))
5875 };
5876
5877 use google_cloud_lro::internal::PollerExt;
5878 {
5879 google_cloud_lro::internal::new_poller(
5880 polling_error_policy,
5881 polling_backoff_policy,
5882 start,
5883 query,
5884 )
5885 }
5886 .with_options(poller_options)
5887 }
5888
5889 pub fn set_update_mask<T>(mut self, v: T) -> Self
5891 where
5892 T: std::convert::Into<wkt::FieldMask>,
5893 {
5894 self.0.request.update_mask = std::option::Option::Some(v.into());
5895 self
5896 }
5897
5898 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5900 where
5901 T: std::convert::Into<wkt::FieldMask>,
5902 {
5903 self.0.request.update_mask = v.map(|x| x.into());
5904 self
5905 }
5906
5907 pub fn set_hub<T>(mut self, v: T) -> Self
5911 where
5912 T: std::convert::Into<crate::model::Hub>,
5913 {
5914 self.0.request.hub = std::option::Option::Some(v.into());
5915 self
5916 }
5917
5918 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5922 where
5923 T: std::convert::Into<crate::model::Hub>,
5924 {
5925 self.0.request.hub = v.map(|x| x.into());
5926 self
5927 }
5928
5929 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5931 self.0.request.request_id = v.into();
5932 self
5933 }
5934 }
5935
5936 #[doc(hidden)]
5937 impl crate::RequestBuilder for UpdateHub {
5938 fn request_options(&mut self) -> &mut crate::RequestOptions {
5939 &mut self.0.options
5940 }
5941 }
5942
5943 #[derive(Clone, Debug)]
5961 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5962
5963 impl DeleteHub {
5964 pub(crate) fn new(
5965 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5966 ) -> Self {
5967 Self(RequestBuilder::new(stub))
5968 }
5969
5970 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5972 self.0.request = v.into();
5973 self
5974 }
5975
5976 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5978 self.0.options = v.into();
5979 self
5980 }
5981
5982 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5989 (*self.0.stub)
5990 .delete_hub(self.0.request, self.0.options)
5991 .await
5992 .map(crate::Response::into_body)
5993 }
5994
5995 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5997 type Operation =
5998 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5999 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6000 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6001 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6002 if let Some(ref mut details) = poller_options.tracing {
6003 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::delete_hub::until_done";
6004 }
6005
6006 let stub = self.0.stub.clone();
6007 let mut options = self.0.options.clone();
6008 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6009 let query = move |name| {
6010 let stub = stub.clone();
6011 let options = options.clone();
6012 async {
6013 let op = GetOperation::new(stub)
6014 .set_name(name)
6015 .with_options(options)
6016 .send()
6017 .await?;
6018 Ok(Operation::new(op))
6019 }
6020 };
6021
6022 let start = move || async {
6023 let op = self.send().await?;
6024 Ok(Operation::new(op))
6025 };
6026
6027 use google_cloud_lro::internal::PollerExt;
6028 {
6029 google_cloud_lro::internal::new_unit_response_poller(
6030 polling_error_policy,
6031 polling_backoff_policy,
6032 start,
6033 query,
6034 )
6035 }
6036 .with_options(poller_options)
6037 }
6038
6039 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6043 self.0.request.name = v.into();
6044 self
6045 }
6046
6047 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6049 self.0.request.request_id = v.into();
6050 self
6051 }
6052 }
6053
6054 #[doc(hidden)]
6055 impl crate::RequestBuilder for DeleteHub {
6056 fn request_options(&mut self) -> &mut crate::RequestOptions {
6057 &mut self.0.options
6058 }
6059 }
6060
6061 #[derive(Clone, Debug)]
6082 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
6083
6084 impl ListHubSpokes {
6085 pub(crate) fn new(
6086 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6087 ) -> Self {
6088 Self(RequestBuilder::new(stub))
6089 }
6090
6091 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
6093 self.0.request = v.into();
6094 self
6095 }
6096
6097 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6099 self.0.options = v.into();
6100 self
6101 }
6102
6103 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
6105 (*self.0.stub)
6106 .list_hub_spokes(self.0.request, self.0.options)
6107 .await
6108 .map(crate::Response::into_body)
6109 }
6110
6111 pub fn by_page(
6113 self,
6114 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubSpokesResponse, crate::Error>
6115 {
6116 use std::clone::Clone;
6117 let token = self.0.request.page_token.clone();
6118 let execute = move |token: String| {
6119 let mut builder = self.clone();
6120 builder.0.request = builder.0.request.set_page_token(token);
6121 builder.send()
6122 };
6123 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6124 }
6125
6126 pub fn by_item(
6128 self,
6129 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6130 crate::model::ListHubSpokesResponse,
6131 crate::Error,
6132 > {
6133 use google_cloud_gax::paginator::Paginator;
6134 self.by_page().items()
6135 }
6136
6137 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6141 self.0.request.name = v.into();
6142 self
6143 }
6144
6145 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
6147 where
6148 T: std::iter::IntoIterator<Item = V>,
6149 V: std::convert::Into<std::string::String>,
6150 {
6151 use std::iter::Iterator;
6152 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
6153 self
6154 }
6155
6156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6158 self.0.request.page_size = v.into();
6159 self
6160 }
6161
6162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6164 self.0.request.page_token = v.into();
6165 self
6166 }
6167
6168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6170 self.0.request.filter = v.into();
6171 self
6172 }
6173
6174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6176 self.0.request.order_by = v.into();
6177 self
6178 }
6179
6180 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
6182 mut self,
6183 v: T,
6184 ) -> Self {
6185 self.0.request.view = v.into();
6186 self
6187 }
6188 }
6189
6190 #[doc(hidden)]
6191 impl crate::RequestBuilder for ListHubSpokes {
6192 fn request_options(&mut self) -> &mut crate::RequestOptions {
6193 &mut self.0.options
6194 }
6195 }
6196
6197 #[derive(Clone, Debug)]
6218 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
6219
6220 impl QueryHubStatus {
6221 pub(crate) fn new(
6222 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6223 ) -> Self {
6224 Self(RequestBuilder::new(stub))
6225 }
6226
6227 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
6229 self.0.request = v.into();
6230 self
6231 }
6232
6233 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6235 self.0.options = v.into();
6236 self
6237 }
6238
6239 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
6241 (*self.0.stub)
6242 .query_hub_status(self.0.request, self.0.options)
6243 .await
6244 .map(crate::Response::into_body)
6245 }
6246
6247 pub fn by_page(
6249 self,
6250 ) -> impl google_cloud_gax::paginator::Paginator<
6251 crate::model::QueryHubStatusResponse,
6252 crate::Error,
6253 > {
6254 use std::clone::Clone;
6255 let token = self.0.request.page_token.clone();
6256 let execute = move |token: String| {
6257 let mut builder = self.clone();
6258 builder.0.request = builder.0.request.set_page_token(token);
6259 builder.send()
6260 };
6261 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6262 }
6263
6264 pub fn by_item(
6266 self,
6267 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6268 crate::model::QueryHubStatusResponse,
6269 crate::Error,
6270 > {
6271 use google_cloud_gax::paginator::Paginator;
6272 self.by_page().items()
6273 }
6274
6275 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6279 self.0.request.name = v.into();
6280 self
6281 }
6282
6283 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6285 self.0.request.page_size = v.into();
6286 self
6287 }
6288
6289 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6291 self.0.request.page_token = v.into();
6292 self
6293 }
6294
6295 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6297 self.0.request.filter = v.into();
6298 self
6299 }
6300
6301 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6303 self.0.request.order_by = v.into();
6304 self
6305 }
6306
6307 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6309 self.0.request.group_by = v.into();
6310 self
6311 }
6312 }
6313
6314 #[doc(hidden)]
6315 impl crate::RequestBuilder for QueryHubStatus {
6316 fn request_options(&mut self) -> &mut crate::RequestOptions {
6317 &mut self.0.options
6318 }
6319 }
6320
6321 #[derive(Clone, Debug)]
6342 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6343
6344 impl ListSpokes {
6345 pub(crate) fn new(
6346 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6347 ) -> Self {
6348 Self(RequestBuilder::new(stub))
6349 }
6350
6351 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6353 self.0.request = v.into();
6354 self
6355 }
6356
6357 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6359 self.0.options = v.into();
6360 self
6361 }
6362
6363 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6365 (*self.0.stub)
6366 .list_spokes(self.0.request, self.0.options)
6367 .await
6368 .map(crate::Response::into_body)
6369 }
6370
6371 pub fn by_page(
6373 self,
6374 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSpokesResponse, crate::Error>
6375 {
6376 use std::clone::Clone;
6377 let token = self.0.request.page_token.clone();
6378 let execute = move |token: String| {
6379 let mut builder = self.clone();
6380 builder.0.request = builder.0.request.set_page_token(token);
6381 builder.send()
6382 };
6383 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6384 }
6385
6386 pub fn by_item(
6388 self,
6389 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6390 crate::model::ListSpokesResponse,
6391 crate::Error,
6392 > {
6393 use google_cloud_gax::paginator::Paginator;
6394 self.by_page().items()
6395 }
6396
6397 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6401 self.0.request.parent = v.into();
6402 self
6403 }
6404
6405 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6407 self.0.request.page_size = v.into();
6408 self
6409 }
6410
6411 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6413 self.0.request.page_token = v.into();
6414 self
6415 }
6416
6417 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6419 self.0.request.filter = v.into();
6420 self
6421 }
6422
6423 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6425 self.0.request.order_by = v.into();
6426 self
6427 }
6428 }
6429
6430 #[doc(hidden)]
6431 impl crate::RequestBuilder for ListSpokes {
6432 fn request_options(&mut self) -> &mut crate::RequestOptions {
6433 &mut self.0.options
6434 }
6435 }
6436
6437 #[derive(Clone, Debug)]
6454 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6455
6456 impl GetSpoke {
6457 pub(crate) fn new(
6458 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6459 ) -> Self {
6460 Self(RequestBuilder::new(stub))
6461 }
6462
6463 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6465 self.0.request = v.into();
6466 self
6467 }
6468
6469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6471 self.0.options = v.into();
6472 self
6473 }
6474
6475 pub async fn send(self) -> Result<crate::model::Spoke> {
6477 (*self.0.stub)
6478 .get_spoke(self.0.request, self.0.options)
6479 .await
6480 .map(crate::Response::into_body)
6481 }
6482
6483 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6487 self.0.request.name = v.into();
6488 self
6489 }
6490 }
6491
6492 #[doc(hidden)]
6493 impl crate::RequestBuilder for GetSpoke {
6494 fn request_options(&mut self) -> &mut crate::RequestOptions {
6495 &mut self.0.options
6496 }
6497 }
6498
6499 #[derive(Clone, Debug)]
6517 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6518
6519 impl CreateSpoke {
6520 pub(crate) fn new(
6521 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6522 ) -> Self {
6523 Self(RequestBuilder::new(stub))
6524 }
6525
6526 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6528 self.0.request = v.into();
6529 self
6530 }
6531
6532 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6534 self.0.options = v.into();
6535 self
6536 }
6537
6538 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6545 (*self.0.stub)
6546 .create_spoke(self.0.request, self.0.options)
6547 .await
6548 .map(crate::Response::into_body)
6549 }
6550
6551 pub fn poller(
6553 self,
6554 ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6555 {
6556 type Operation = google_cloud_lro::internal::Operation<
6557 crate::model::Spoke,
6558 crate::model::OperationMetadata,
6559 >;
6560 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6561 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6562 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6563 if let Some(ref mut details) = poller_options.tracing {
6564 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::create_spoke::until_done";
6565 }
6566
6567 let stub = self.0.stub.clone();
6568 let mut options = self.0.options.clone();
6569 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6570 let query = move |name| {
6571 let stub = stub.clone();
6572 let options = options.clone();
6573 async {
6574 let op = GetOperation::new(stub)
6575 .set_name(name)
6576 .with_options(options)
6577 .send()
6578 .await?;
6579 Ok(Operation::new(op))
6580 }
6581 };
6582
6583 let start = move || async {
6584 let op = self.send().await?;
6585 Ok(Operation::new(op))
6586 };
6587
6588 use google_cloud_lro::internal::PollerExt;
6589 {
6590 google_cloud_lro::internal::new_poller(
6591 polling_error_policy,
6592 polling_backoff_policy,
6593 start,
6594 query,
6595 )
6596 }
6597 .with_options(poller_options)
6598 }
6599
6600 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6604 self.0.request.parent = v.into();
6605 self
6606 }
6607
6608 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6612 self.0.request.spoke_id = v.into();
6613 self
6614 }
6615
6616 pub fn set_spoke<T>(mut self, v: T) -> Self
6620 where
6621 T: std::convert::Into<crate::model::Spoke>,
6622 {
6623 self.0.request.spoke = std::option::Option::Some(v.into());
6624 self
6625 }
6626
6627 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6631 where
6632 T: std::convert::Into<crate::model::Spoke>,
6633 {
6634 self.0.request.spoke = v.map(|x| x.into());
6635 self
6636 }
6637
6638 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6640 self.0.request.request_id = v.into();
6641 self
6642 }
6643 }
6644
6645 #[doc(hidden)]
6646 impl crate::RequestBuilder for CreateSpoke {
6647 fn request_options(&mut self) -> &mut crate::RequestOptions {
6648 &mut self.0.options
6649 }
6650 }
6651
6652 #[derive(Clone, Debug)]
6670 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6671
6672 impl UpdateSpoke {
6673 pub(crate) fn new(
6674 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6675 ) -> Self {
6676 Self(RequestBuilder::new(stub))
6677 }
6678
6679 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6681 self.0.request = v.into();
6682 self
6683 }
6684
6685 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6687 self.0.options = v.into();
6688 self
6689 }
6690
6691 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6698 (*self.0.stub)
6699 .update_spoke(self.0.request, self.0.options)
6700 .await
6701 .map(crate::Response::into_body)
6702 }
6703
6704 pub fn poller(
6706 self,
6707 ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6708 {
6709 type Operation = google_cloud_lro::internal::Operation<
6710 crate::model::Spoke,
6711 crate::model::OperationMetadata,
6712 >;
6713 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6714 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6715 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6716 if let Some(ref mut details) = poller_options.tracing {
6717 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::update_spoke::until_done";
6718 }
6719
6720 let stub = self.0.stub.clone();
6721 let mut options = self.0.options.clone();
6722 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6723 let query = move |name| {
6724 let stub = stub.clone();
6725 let options = options.clone();
6726 async {
6727 let op = GetOperation::new(stub)
6728 .set_name(name)
6729 .with_options(options)
6730 .send()
6731 .await?;
6732 Ok(Operation::new(op))
6733 }
6734 };
6735
6736 let start = move || async {
6737 let op = self.send().await?;
6738 Ok(Operation::new(op))
6739 };
6740
6741 use google_cloud_lro::internal::PollerExt;
6742 {
6743 google_cloud_lro::internal::new_poller(
6744 polling_error_policy,
6745 polling_backoff_policy,
6746 start,
6747 query,
6748 )
6749 }
6750 .with_options(poller_options)
6751 }
6752
6753 pub fn set_update_mask<T>(mut self, v: T) -> Self
6755 where
6756 T: std::convert::Into<wkt::FieldMask>,
6757 {
6758 self.0.request.update_mask = std::option::Option::Some(v.into());
6759 self
6760 }
6761
6762 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6764 where
6765 T: std::convert::Into<wkt::FieldMask>,
6766 {
6767 self.0.request.update_mask = v.map(|x| x.into());
6768 self
6769 }
6770
6771 pub fn set_spoke<T>(mut self, v: T) -> Self
6775 where
6776 T: std::convert::Into<crate::model::Spoke>,
6777 {
6778 self.0.request.spoke = std::option::Option::Some(v.into());
6779 self
6780 }
6781
6782 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6786 where
6787 T: std::convert::Into<crate::model::Spoke>,
6788 {
6789 self.0.request.spoke = v.map(|x| x.into());
6790 self
6791 }
6792
6793 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6795 self.0.request.request_id = v.into();
6796 self
6797 }
6798 }
6799
6800 #[doc(hidden)]
6801 impl crate::RequestBuilder for UpdateSpoke {
6802 fn request_options(&mut self) -> &mut crate::RequestOptions {
6803 &mut self.0.options
6804 }
6805 }
6806
6807 #[derive(Clone, Debug)]
6825 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6826
6827 impl RejectHubSpoke {
6828 pub(crate) fn new(
6829 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6830 ) -> Self {
6831 Self(RequestBuilder::new(stub))
6832 }
6833
6834 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6836 self.0.request = v.into();
6837 self
6838 }
6839
6840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6842 self.0.options = v.into();
6843 self
6844 }
6845
6846 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6853 (*self.0.stub)
6854 .reject_hub_spoke(self.0.request, self.0.options)
6855 .await
6856 .map(crate::Response::into_body)
6857 }
6858
6859 pub fn poller(
6861 self,
6862 ) -> impl google_cloud_lro::Poller<
6863 crate::model::RejectHubSpokeResponse,
6864 crate::model::OperationMetadata,
6865 > {
6866 type Operation = google_cloud_lro::internal::Operation<
6867 crate::model::RejectHubSpokeResponse,
6868 crate::model::OperationMetadata,
6869 >;
6870 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6871 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6872 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6873 if let Some(ref mut details) = poller_options.tracing {
6874 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::reject_hub_spoke::until_done";
6875 }
6876
6877 let stub = self.0.stub.clone();
6878 let mut options = self.0.options.clone();
6879 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6880 let query = move |name| {
6881 let stub = stub.clone();
6882 let options = options.clone();
6883 async {
6884 let op = GetOperation::new(stub)
6885 .set_name(name)
6886 .with_options(options)
6887 .send()
6888 .await?;
6889 Ok(Operation::new(op))
6890 }
6891 };
6892
6893 let start = move || async {
6894 let op = self.send().await?;
6895 Ok(Operation::new(op))
6896 };
6897
6898 use google_cloud_lro::internal::PollerExt;
6899 {
6900 google_cloud_lro::internal::new_poller(
6901 polling_error_policy,
6902 polling_backoff_policy,
6903 start,
6904 query,
6905 )
6906 }
6907 .with_options(poller_options)
6908 }
6909
6910 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6914 self.0.request.name = v.into();
6915 self
6916 }
6917
6918 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6922 self.0.request.spoke_uri = v.into();
6923 self
6924 }
6925
6926 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6928 self.0.request.request_id = v.into();
6929 self
6930 }
6931
6932 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6934 self.0.request.details = v.into();
6935 self
6936 }
6937 }
6938
6939 #[doc(hidden)]
6940 impl crate::RequestBuilder for RejectHubSpoke {
6941 fn request_options(&mut self) -> &mut crate::RequestOptions {
6942 &mut self.0.options
6943 }
6944 }
6945
6946 #[derive(Clone, Debug)]
6964 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6965
6966 impl AcceptHubSpoke {
6967 pub(crate) fn new(
6968 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6969 ) -> Self {
6970 Self(RequestBuilder::new(stub))
6971 }
6972
6973 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6975 self.0.request = v.into();
6976 self
6977 }
6978
6979 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6981 self.0.options = v.into();
6982 self
6983 }
6984
6985 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6992 (*self.0.stub)
6993 .accept_hub_spoke(self.0.request, self.0.options)
6994 .await
6995 .map(crate::Response::into_body)
6996 }
6997
6998 pub fn poller(
7000 self,
7001 ) -> impl google_cloud_lro::Poller<
7002 crate::model::AcceptHubSpokeResponse,
7003 crate::model::OperationMetadata,
7004 > {
7005 type Operation = google_cloud_lro::internal::Operation<
7006 crate::model::AcceptHubSpokeResponse,
7007 crate::model::OperationMetadata,
7008 >;
7009 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7010 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7011 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7012 if let Some(ref mut details) = poller_options.tracing {
7013 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::accept_hub_spoke::until_done";
7014 }
7015
7016 let stub = self.0.stub.clone();
7017 let mut options = self.0.options.clone();
7018 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7019 let query = move |name| {
7020 let stub = stub.clone();
7021 let options = options.clone();
7022 async {
7023 let op = GetOperation::new(stub)
7024 .set_name(name)
7025 .with_options(options)
7026 .send()
7027 .await?;
7028 Ok(Operation::new(op))
7029 }
7030 };
7031
7032 let start = move || async {
7033 let op = self.send().await?;
7034 Ok(Operation::new(op))
7035 };
7036
7037 use google_cloud_lro::internal::PollerExt;
7038 {
7039 google_cloud_lro::internal::new_poller(
7040 polling_error_policy,
7041 polling_backoff_policy,
7042 start,
7043 query,
7044 )
7045 }
7046 .with_options(poller_options)
7047 }
7048
7049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7053 self.0.request.name = v.into();
7054 self
7055 }
7056
7057 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7061 self.0.request.spoke_uri = v.into();
7062 self
7063 }
7064
7065 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7067 self.0.request.request_id = v.into();
7068 self
7069 }
7070 }
7071
7072 #[doc(hidden)]
7073 impl crate::RequestBuilder for AcceptHubSpoke {
7074 fn request_options(&mut self) -> &mut crate::RequestOptions {
7075 &mut self.0.options
7076 }
7077 }
7078
7079 #[derive(Clone, Debug)]
7097 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
7098
7099 impl AcceptSpokeUpdate {
7100 pub(crate) fn new(
7101 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7102 ) -> Self {
7103 Self(RequestBuilder::new(stub))
7104 }
7105
7106 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
7108 mut self,
7109 v: V,
7110 ) -> Self {
7111 self.0.request = v.into();
7112 self
7113 }
7114
7115 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7117 self.0.options = v.into();
7118 self
7119 }
7120
7121 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7128 (*self.0.stub)
7129 .accept_spoke_update(self.0.request, self.0.options)
7130 .await
7131 .map(crate::Response::into_body)
7132 }
7133
7134 pub fn poller(
7136 self,
7137 ) -> impl google_cloud_lro::Poller<
7138 crate::model::AcceptSpokeUpdateResponse,
7139 crate::model::OperationMetadata,
7140 > {
7141 type Operation = google_cloud_lro::internal::Operation<
7142 crate::model::AcceptSpokeUpdateResponse,
7143 crate::model::OperationMetadata,
7144 >;
7145 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7146 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7147 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7148 if let Some(ref mut details) = poller_options.tracing {
7149 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::accept_spoke_update::until_done";
7150 }
7151
7152 let stub = self.0.stub.clone();
7153 let mut options = self.0.options.clone();
7154 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7155 let query = move |name| {
7156 let stub = stub.clone();
7157 let options = options.clone();
7158 async {
7159 let op = GetOperation::new(stub)
7160 .set_name(name)
7161 .with_options(options)
7162 .send()
7163 .await?;
7164 Ok(Operation::new(op))
7165 }
7166 };
7167
7168 let start = move || async {
7169 let op = self.send().await?;
7170 Ok(Operation::new(op))
7171 };
7172
7173 use google_cloud_lro::internal::PollerExt;
7174 {
7175 google_cloud_lro::internal::new_poller(
7176 polling_error_policy,
7177 polling_backoff_policy,
7178 start,
7179 query,
7180 )
7181 }
7182 .with_options(poller_options)
7183 }
7184
7185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7189 self.0.request.name = v.into();
7190 self
7191 }
7192
7193 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7197 self.0.request.spoke_uri = v.into();
7198 self
7199 }
7200
7201 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7205 self.0.request.spoke_etag = v.into();
7206 self
7207 }
7208
7209 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7211 self.0.request.request_id = v.into();
7212 self
7213 }
7214 }
7215
7216 #[doc(hidden)]
7217 impl crate::RequestBuilder for AcceptSpokeUpdate {
7218 fn request_options(&mut self) -> &mut crate::RequestOptions {
7219 &mut self.0.options
7220 }
7221 }
7222
7223 #[derive(Clone, Debug)]
7241 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
7242
7243 impl RejectSpokeUpdate {
7244 pub(crate) fn new(
7245 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7246 ) -> Self {
7247 Self(RequestBuilder::new(stub))
7248 }
7249
7250 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
7252 mut self,
7253 v: V,
7254 ) -> Self {
7255 self.0.request = v.into();
7256 self
7257 }
7258
7259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7261 self.0.options = v.into();
7262 self
7263 }
7264
7265 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7272 (*self.0.stub)
7273 .reject_spoke_update(self.0.request, self.0.options)
7274 .await
7275 .map(crate::Response::into_body)
7276 }
7277
7278 pub fn poller(
7280 self,
7281 ) -> impl google_cloud_lro::Poller<
7282 crate::model::RejectSpokeUpdateResponse,
7283 crate::model::OperationMetadata,
7284 > {
7285 type Operation = google_cloud_lro::internal::Operation<
7286 crate::model::RejectSpokeUpdateResponse,
7287 crate::model::OperationMetadata,
7288 >;
7289 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7290 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7291 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7292 if let Some(ref mut details) = poller_options.tracing {
7293 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::reject_spoke_update::until_done";
7294 }
7295
7296 let stub = self.0.stub.clone();
7297 let mut options = self.0.options.clone();
7298 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7299 let query = move |name| {
7300 let stub = stub.clone();
7301 let options = options.clone();
7302 async {
7303 let op = GetOperation::new(stub)
7304 .set_name(name)
7305 .with_options(options)
7306 .send()
7307 .await?;
7308 Ok(Operation::new(op))
7309 }
7310 };
7311
7312 let start = move || async {
7313 let op = self.send().await?;
7314 Ok(Operation::new(op))
7315 };
7316
7317 use google_cloud_lro::internal::PollerExt;
7318 {
7319 google_cloud_lro::internal::new_poller(
7320 polling_error_policy,
7321 polling_backoff_policy,
7322 start,
7323 query,
7324 )
7325 }
7326 .with_options(poller_options)
7327 }
7328
7329 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7333 self.0.request.name = v.into();
7334 self
7335 }
7336
7337 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7341 self.0.request.spoke_uri = v.into();
7342 self
7343 }
7344
7345 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7349 self.0.request.spoke_etag = v.into();
7350 self
7351 }
7352
7353 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7355 self.0.request.details = v.into();
7356 self
7357 }
7358
7359 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7361 self.0.request.request_id = v.into();
7362 self
7363 }
7364 }
7365
7366 #[doc(hidden)]
7367 impl crate::RequestBuilder for RejectSpokeUpdate {
7368 fn request_options(&mut self) -> &mut crate::RequestOptions {
7369 &mut self.0.options
7370 }
7371 }
7372
7373 #[derive(Clone, Debug)]
7391 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7392
7393 impl DeleteSpoke {
7394 pub(crate) fn new(
7395 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7396 ) -> Self {
7397 Self(RequestBuilder::new(stub))
7398 }
7399
7400 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7402 self.0.request = v.into();
7403 self
7404 }
7405
7406 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7408 self.0.options = v.into();
7409 self
7410 }
7411
7412 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7419 (*self.0.stub)
7420 .delete_spoke(self.0.request, self.0.options)
7421 .await
7422 .map(crate::Response::into_body)
7423 }
7424
7425 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7427 type Operation =
7428 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7429 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7430 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7431 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7432 if let Some(ref mut details) = poller_options.tracing {
7433 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::delete_spoke::until_done";
7434 }
7435
7436 let stub = self.0.stub.clone();
7437 let mut options = self.0.options.clone();
7438 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7439 let query = move |name| {
7440 let stub = stub.clone();
7441 let options = options.clone();
7442 async {
7443 let op = GetOperation::new(stub)
7444 .set_name(name)
7445 .with_options(options)
7446 .send()
7447 .await?;
7448 Ok(Operation::new(op))
7449 }
7450 };
7451
7452 let start = move || async {
7453 let op = self.send().await?;
7454 Ok(Operation::new(op))
7455 };
7456
7457 use google_cloud_lro::internal::PollerExt;
7458 {
7459 google_cloud_lro::internal::new_unit_response_poller(
7460 polling_error_policy,
7461 polling_backoff_policy,
7462 start,
7463 query,
7464 )
7465 }
7466 .with_options(poller_options)
7467 }
7468
7469 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7473 self.0.request.name = v.into();
7474 self
7475 }
7476
7477 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7479 self.0.request.request_id = v.into();
7480 self
7481 }
7482 }
7483
7484 #[doc(hidden)]
7485 impl crate::RequestBuilder for DeleteSpoke {
7486 fn request_options(&mut self) -> &mut crate::RequestOptions {
7487 &mut self.0.options
7488 }
7489 }
7490
7491 #[derive(Clone, Debug)]
7508 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7509
7510 impl GetRouteTable {
7511 pub(crate) fn new(
7512 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7513 ) -> Self {
7514 Self(RequestBuilder::new(stub))
7515 }
7516
7517 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7519 self.0.request = v.into();
7520 self
7521 }
7522
7523 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7525 self.0.options = v.into();
7526 self
7527 }
7528
7529 pub async fn send(self) -> Result<crate::model::RouteTable> {
7531 (*self.0.stub)
7532 .get_route_table(self.0.request, self.0.options)
7533 .await
7534 .map(crate::Response::into_body)
7535 }
7536
7537 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7541 self.0.request.name = v.into();
7542 self
7543 }
7544 }
7545
7546 #[doc(hidden)]
7547 impl crate::RequestBuilder for GetRouteTable {
7548 fn request_options(&mut self) -> &mut crate::RequestOptions {
7549 &mut self.0.options
7550 }
7551 }
7552
7553 #[derive(Clone, Debug)]
7570 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7571
7572 impl GetRoute {
7573 pub(crate) fn new(
7574 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7575 ) -> Self {
7576 Self(RequestBuilder::new(stub))
7577 }
7578
7579 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7581 self.0.request = v.into();
7582 self
7583 }
7584
7585 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7587 self.0.options = v.into();
7588 self
7589 }
7590
7591 pub async fn send(self) -> Result<crate::model::Route> {
7593 (*self.0.stub)
7594 .get_route(self.0.request, self.0.options)
7595 .await
7596 .map(crate::Response::into_body)
7597 }
7598
7599 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7603 self.0.request.name = v.into();
7604 self
7605 }
7606 }
7607
7608 #[doc(hidden)]
7609 impl crate::RequestBuilder for GetRoute {
7610 fn request_options(&mut self) -> &mut crate::RequestOptions {
7611 &mut self.0.options
7612 }
7613 }
7614
7615 #[derive(Clone, Debug)]
7636 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7637
7638 impl ListRoutes {
7639 pub(crate) fn new(
7640 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7641 ) -> Self {
7642 Self(RequestBuilder::new(stub))
7643 }
7644
7645 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7647 self.0.request = v.into();
7648 self
7649 }
7650
7651 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7653 self.0.options = v.into();
7654 self
7655 }
7656
7657 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7659 (*self.0.stub)
7660 .list_routes(self.0.request, self.0.options)
7661 .await
7662 .map(crate::Response::into_body)
7663 }
7664
7665 pub fn by_page(
7667 self,
7668 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutesResponse, crate::Error>
7669 {
7670 use std::clone::Clone;
7671 let token = self.0.request.page_token.clone();
7672 let execute = move |token: String| {
7673 let mut builder = self.clone();
7674 builder.0.request = builder.0.request.set_page_token(token);
7675 builder.send()
7676 };
7677 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7678 }
7679
7680 pub fn by_item(
7682 self,
7683 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7684 crate::model::ListRoutesResponse,
7685 crate::Error,
7686 > {
7687 use google_cloud_gax::paginator::Paginator;
7688 self.by_page().items()
7689 }
7690
7691 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7695 self.0.request.parent = v.into();
7696 self
7697 }
7698
7699 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7701 self.0.request.page_size = v.into();
7702 self
7703 }
7704
7705 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7707 self.0.request.page_token = v.into();
7708 self
7709 }
7710
7711 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7713 self.0.request.filter = v.into();
7714 self
7715 }
7716
7717 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7719 self.0.request.order_by = v.into();
7720 self
7721 }
7722 }
7723
7724 #[doc(hidden)]
7725 impl crate::RequestBuilder for ListRoutes {
7726 fn request_options(&mut self) -> &mut crate::RequestOptions {
7727 &mut self.0.options
7728 }
7729 }
7730
7731 #[derive(Clone, Debug)]
7752 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7753
7754 impl ListRouteTables {
7755 pub(crate) fn new(
7756 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7757 ) -> Self {
7758 Self(RequestBuilder::new(stub))
7759 }
7760
7761 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7763 self.0.request = v.into();
7764 self
7765 }
7766
7767 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7769 self.0.options = v.into();
7770 self
7771 }
7772
7773 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7775 (*self.0.stub)
7776 .list_route_tables(self.0.request, self.0.options)
7777 .await
7778 .map(crate::Response::into_body)
7779 }
7780
7781 pub fn by_page(
7783 self,
7784 ) -> impl google_cloud_gax::paginator::Paginator<
7785 crate::model::ListRouteTablesResponse,
7786 crate::Error,
7787 > {
7788 use std::clone::Clone;
7789 let token = self.0.request.page_token.clone();
7790 let execute = move |token: String| {
7791 let mut builder = self.clone();
7792 builder.0.request = builder.0.request.set_page_token(token);
7793 builder.send()
7794 };
7795 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7796 }
7797
7798 pub fn by_item(
7800 self,
7801 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7802 crate::model::ListRouteTablesResponse,
7803 crate::Error,
7804 > {
7805 use google_cloud_gax::paginator::Paginator;
7806 self.by_page().items()
7807 }
7808
7809 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7813 self.0.request.parent = v.into();
7814 self
7815 }
7816
7817 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7819 self.0.request.page_size = v.into();
7820 self
7821 }
7822
7823 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7825 self.0.request.page_token = v.into();
7826 self
7827 }
7828
7829 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7831 self.0.request.filter = v.into();
7832 self
7833 }
7834
7835 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7837 self.0.request.order_by = v.into();
7838 self
7839 }
7840 }
7841
7842 #[doc(hidden)]
7843 impl crate::RequestBuilder for ListRouteTables {
7844 fn request_options(&mut self) -> &mut crate::RequestOptions {
7845 &mut self.0.options
7846 }
7847 }
7848
7849 #[derive(Clone, Debug)]
7866 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7867
7868 impl GetGroup {
7869 pub(crate) fn new(
7870 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7871 ) -> Self {
7872 Self(RequestBuilder::new(stub))
7873 }
7874
7875 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7877 self.0.request = v.into();
7878 self
7879 }
7880
7881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7883 self.0.options = v.into();
7884 self
7885 }
7886
7887 pub async fn send(self) -> Result<crate::model::Group> {
7889 (*self.0.stub)
7890 .get_group(self.0.request, self.0.options)
7891 .await
7892 .map(crate::Response::into_body)
7893 }
7894
7895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7899 self.0.request.name = v.into();
7900 self
7901 }
7902 }
7903
7904 #[doc(hidden)]
7905 impl crate::RequestBuilder for GetGroup {
7906 fn request_options(&mut self) -> &mut crate::RequestOptions {
7907 &mut self.0.options
7908 }
7909 }
7910
7911 #[derive(Clone, Debug)]
7932 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7933
7934 impl ListGroups {
7935 pub(crate) fn new(
7936 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7937 ) -> Self {
7938 Self(RequestBuilder::new(stub))
7939 }
7940
7941 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7943 self.0.request = v.into();
7944 self
7945 }
7946
7947 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7949 self.0.options = v.into();
7950 self
7951 }
7952
7953 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7955 (*self.0.stub)
7956 .list_groups(self.0.request, self.0.options)
7957 .await
7958 .map(crate::Response::into_body)
7959 }
7960
7961 pub fn by_page(
7963 self,
7964 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListGroupsResponse, crate::Error>
7965 {
7966 use std::clone::Clone;
7967 let token = self.0.request.page_token.clone();
7968 let execute = move |token: String| {
7969 let mut builder = self.clone();
7970 builder.0.request = builder.0.request.set_page_token(token);
7971 builder.send()
7972 };
7973 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7974 }
7975
7976 pub fn by_item(
7978 self,
7979 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7980 crate::model::ListGroupsResponse,
7981 crate::Error,
7982 > {
7983 use google_cloud_gax::paginator::Paginator;
7984 self.by_page().items()
7985 }
7986
7987 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7991 self.0.request.parent = v.into();
7992 self
7993 }
7994
7995 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7997 self.0.request.page_size = v.into();
7998 self
7999 }
8000
8001 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8003 self.0.request.page_token = v.into();
8004 self
8005 }
8006
8007 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8009 self.0.request.filter = v.into();
8010 self
8011 }
8012
8013 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8015 self.0.request.order_by = v.into();
8016 self
8017 }
8018 }
8019
8020 #[doc(hidden)]
8021 impl crate::RequestBuilder for ListGroups {
8022 fn request_options(&mut self) -> &mut crate::RequestOptions {
8023 &mut self.0.options
8024 }
8025 }
8026
8027 #[derive(Clone, Debug)]
8045 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
8046
8047 impl UpdateGroup {
8048 pub(crate) fn new(
8049 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8050 ) -> Self {
8051 Self(RequestBuilder::new(stub))
8052 }
8053
8054 pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
8056 self.0.request = v.into();
8057 self
8058 }
8059
8060 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8062 self.0.options = v.into();
8063 self
8064 }
8065
8066 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8073 (*self.0.stub)
8074 .update_group(self.0.request, self.0.options)
8075 .await
8076 .map(crate::Response::into_body)
8077 }
8078
8079 pub fn poller(
8081 self,
8082 ) -> impl google_cloud_lro::Poller<crate::model::Group, crate::model::OperationMetadata>
8083 {
8084 type Operation = google_cloud_lro::internal::Operation<
8085 crate::model::Group,
8086 crate::model::OperationMetadata,
8087 >;
8088 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8089 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8090 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8091 if let Some(ref mut details) = poller_options.tracing {
8092 details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::update_group::until_done";
8093 }
8094
8095 let stub = self.0.stub.clone();
8096 let mut options = self.0.options.clone();
8097 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8098 let query = move |name| {
8099 let stub = stub.clone();
8100 let options = options.clone();
8101 async {
8102 let op = GetOperation::new(stub)
8103 .set_name(name)
8104 .with_options(options)
8105 .send()
8106 .await?;
8107 Ok(Operation::new(op))
8108 }
8109 };
8110
8111 let start = move || async {
8112 let op = self.send().await?;
8113 Ok(Operation::new(op))
8114 };
8115
8116 use google_cloud_lro::internal::PollerExt;
8117 {
8118 google_cloud_lro::internal::new_poller(
8119 polling_error_policy,
8120 polling_backoff_policy,
8121 start,
8122 query,
8123 )
8124 }
8125 .with_options(poller_options)
8126 }
8127
8128 pub fn set_update_mask<T>(mut self, v: T) -> Self
8130 where
8131 T: std::convert::Into<wkt::FieldMask>,
8132 {
8133 self.0.request.update_mask = std::option::Option::Some(v.into());
8134 self
8135 }
8136
8137 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8139 where
8140 T: std::convert::Into<wkt::FieldMask>,
8141 {
8142 self.0.request.update_mask = v.map(|x| x.into());
8143 self
8144 }
8145
8146 pub fn set_group<T>(mut self, v: T) -> Self
8150 where
8151 T: std::convert::Into<crate::model::Group>,
8152 {
8153 self.0.request.group = std::option::Option::Some(v.into());
8154 self
8155 }
8156
8157 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
8161 where
8162 T: std::convert::Into<crate::model::Group>,
8163 {
8164 self.0.request.group = v.map(|x| x.into());
8165 self
8166 }
8167
8168 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8170 self.0.request.request_id = v.into();
8171 self
8172 }
8173 }
8174
8175 #[doc(hidden)]
8176 impl crate::RequestBuilder for UpdateGroup {
8177 fn request_options(&mut self) -> &mut crate::RequestOptions {
8178 &mut self.0.options
8179 }
8180 }
8181
8182 #[derive(Clone, Debug)]
8203 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8204
8205 impl ListLocations {
8206 pub(crate) fn new(
8207 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8208 ) -> Self {
8209 Self(RequestBuilder::new(stub))
8210 }
8211
8212 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8214 mut self,
8215 v: V,
8216 ) -> Self {
8217 self.0.request = v.into();
8218 self
8219 }
8220
8221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8223 self.0.options = v.into();
8224 self
8225 }
8226
8227 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8229 (*self.0.stub)
8230 .list_locations(self.0.request, self.0.options)
8231 .await
8232 .map(crate::Response::into_body)
8233 }
8234
8235 pub fn by_page(
8237 self,
8238 ) -> impl google_cloud_gax::paginator::Paginator<
8239 google_cloud_location::model::ListLocationsResponse,
8240 crate::Error,
8241 > {
8242 use std::clone::Clone;
8243 let token = self.0.request.page_token.clone();
8244 let execute = move |token: String| {
8245 let mut builder = self.clone();
8246 builder.0.request = builder.0.request.set_page_token(token);
8247 builder.send()
8248 };
8249 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8250 }
8251
8252 pub fn by_item(
8254 self,
8255 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8256 google_cloud_location::model::ListLocationsResponse,
8257 crate::Error,
8258 > {
8259 use google_cloud_gax::paginator::Paginator;
8260 self.by_page().items()
8261 }
8262
8263 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8265 self.0.request.name = v.into();
8266 self
8267 }
8268
8269 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8271 self.0.request.filter = v.into();
8272 self
8273 }
8274
8275 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8277 self.0.request.page_size = v.into();
8278 self
8279 }
8280
8281 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8283 self.0.request.page_token = v.into();
8284 self
8285 }
8286 }
8287
8288 #[doc(hidden)]
8289 impl crate::RequestBuilder for ListLocations {
8290 fn request_options(&mut self) -> &mut crate::RequestOptions {
8291 &mut self.0.options
8292 }
8293 }
8294
8295 #[derive(Clone, Debug)]
8312 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8313
8314 impl GetLocation {
8315 pub(crate) fn new(
8316 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8317 ) -> Self {
8318 Self(RequestBuilder::new(stub))
8319 }
8320
8321 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8323 mut self,
8324 v: V,
8325 ) -> Self {
8326 self.0.request = v.into();
8327 self
8328 }
8329
8330 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8332 self.0.options = v.into();
8333 self
8334 }
8335
8336 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8338 (*self.0.stub)
8339 .get_location(self.0.request, self.0.options)
8340 .await
8341 .map(crate::Response::into_body)
8342 }
8343
8344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8346 self.0.request.name = v.into();
8347 self
8348 }
8349 }
8350
8351 #[doc(hidden)]
8352 impl crate::RequestBuilder for GetLocation {
8353 fn request_options(&mut self) -> &mut crate::RequestOptions {
8354 &mut self.0.options
8355 }
8356 }
8357
8358 #[derive(Clone, Debug)]
8375 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8376
8377 impl SetIamPolicy {
8378 pub(crate) fn new(
8379 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8380 ) -> Self {
8381 Self(RequestBuilder::new(stub))
8382 }
8383
8384 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8386 mut self,
8387 v: V,
8388 ) -> Self {
8389 self.0.request = v.into();
8390 self
8391 }
8392
8393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8395 self.0.options = v.into();
8396 self
8397 }
8398
8399 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8401 (*self.0.stub)
8402 .set_iam_policy(self.0.request, self.0.options)
8403 .await
8404 .map(crate::Response::into_body)
8405 }
8406
8407 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8411 self.0.request.resource = v.into();
8412 self
8413 }
8414
8415 pub fn set_policy<T>(mut self, v: T) -> Self
8419 where
8420 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8421 {
8422 self.0.request.policy = std::option::Option::Some(v.into());
8423 self
8424 }
8425
8426 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8430 where
8431 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8432 {
8433 self.0.request.policy = v.map(|x| x.into());
8434 self
8435 }
8436
8437 pub fn set_update_mask<T>(mut self, v: T) -> Self
8439 where
8440 T: std::convert::Into<wkt::FieldMask>,
8441 {
8442 self.0.request.update_mask = std::option::Option::Some(v.into());
8443 self
8444 }
8445
8446 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8448 where
8449 T: std::convert::Into<wkt::FieldMask>,
8450 {
8451 self.0.request.update_mask = v.map(|x| x.into());
8452 self
8453 }
8454 }
8455
8456 #[doc(hidden)]
8457 impl crate::RequestBuilder for SetIamPolicy {
8458 fn request_options(&mut self) -> &mut crate::RequestOptions {
8459 &mut self.0.options
8460 }
8461 }
8462
8463 #[derive(Clone, Debug)]
8480 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8481
8482 impl GetIamPolicy {
8483 pub(crate) fn new(
8484 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8485 ) -> Self {
8486 Self(RequestBuilder::new(stub))
8487 }
8488
8489 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8491 mut self,
8492 v: V,
8493 ) -> Self {
8494 self.0.request = v.into();
8495 self
8496 }
8497
8498 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8500 self.0.options = v.into();
8501 self
8502 }
8503
8504 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8506 (*self.0.stub)
8507 .get_iam_policy(self.0.request, self.0.options)
8508 .await
8509 .map(crate::Response::into_body)
8510 }
8511
8512 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8516 self.0.request.resource = v.into();
8517 self
8518 }
8519
8520 pub fn set_options<T>(mut self, v: T) -> Self
8522 where
8523 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8524 {
8525 self.0.request.options = std::option::Option::Some(v.into());
8526 self
8527 }
8528
8529 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8531 where
8532 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8533 {
8534 self.0.request.options = v.map(|x| x.into());
8535 self
8536 }
8537 }
8538
8539 #[doc(hidden)]
8540 impl crate::RequestBuilder for GetIamPolicy {
8541 fn request_options(&mut self) -> &mut crate::RequestOptions {
8542 &mut self.0.options
8543 }
8544 }
8545
8546 #[derive(Clone, Debug)]
8563 pub struct TestIamPermissions(
8564 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8565 );
8566
8567 impl TestIamPermissions {
8568 pub(crate) fn new(
8569 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8570 ) -> Self {
8571 Self(RequestBuilder::new(stub))
8572 }
8573
8574 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8576 mut self,
8577 v: V,
8578 ) -> Self {
8579 self.0.request = v.into();
8580 self
8581 }
8582
8583 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8585 self.0.options = v.into();
8586 self
8587 }
8588
8589 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8591 (*self.0.stub)
8592 .test_iam_permissions(self.0.request, self.0.options)
8593 .await
8594 .map(crate::Response::into_body)
8595 }
8596
8597 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8601 self.0.request.resource = v.into();
8602 self
8603 }
8604
8605 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8609 where
8610 T: std::iter::IntoIterator<Item = V>,
8611 V: std::convert::Into<std::string::String>,
8612 {
8613 use std::iter::Iterator;
8614 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8615 self
8616 }
8617 }
8618
8619 #[doc(hidden)]
8620 impl crate::RequestBuilder for TestIamPermissions {
8621 fn request_options(&mut self) -> &mut crate::RequestOptions {
8622 &mut self.0.options
8623 }
8624 }
8625
8626 #[derive(Clone, Debug)]
8647 pub struct ListOperations(
8648 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8649 );
8650
8651 impl ListOperations {
8652 pub(crate) fn new(
8653 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8654 ) -> Self {
8655 Self(RequestBuilder::new(stub))
8656 }
8657
8658 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8660 mut self,
8661 v: V,
8662 ) -> Self {
8663 self.0.request = v.into();
8664 self
8665 }
8666
8667 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8669 self.0.options = v.into();
8670 self
8671 }
8672
8673 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8675 (*self.0.stub)
8676 .list_operations(self.0.request, self.0.options)
8677 .await
8678 .map(crate::Response::into_body)
8679 }
8680
8681 pub fn by_page(
8683 self,
8684 ) -> impl google_cloud_gax::paginator::Paginator<
8685 google_cloud_longrunning::model::ListOperationsResponse,
8686 crate::Error,
8687 > {
8688 use std::clone::Clone;
8689 let token = self.0.request.page_token.clone();
8690 let execute = move |token: String| {
8691 let mut builder = self.clone();
8692 builder.0.request = builder.0.request.set_page_token(token);
8693 builder.send()
8694 };
8695 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8696 }
8697
8698 pub fn by_item(
8700 self,
8701 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8702 google_cloud_longrunning::model::ListOperationsResponse,
8703 crate::Error,
8704 > {
8705 use google_cloud_gax::paginator::Paginator;
8706 self.by_page().items()
8707 }
8708
8709 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8711 self.0.request.name = v.into();
8712 self
8713 }
8714
8715 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8717 self.0.request.filter = v.into();
8718 self
8719 }
8720
8721 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8723 self.0.request.page_size = v.into();
8724 self
8725 }
8726
8727 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8729 self.0.request.page_token = v.into();
8730 self
8731 }
8732
8733 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8735 self.0.request.return_partial_success = v.into();
8736 self
8737 }
8738 }
8739
8740 #[doc(hidden)]
8741 impl crate::RequestBuilder for ListOperations {
8742 fn request_options(&mut self) -> &mut crate::RequestOptions {
8743 &mut self.0.options
8744 }
8745 }
8746
8747 #[derive(Clone, Debug)]
8764 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8765
8766 impl GetOperation {
8767 pub(crate) fn new(
8768 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8769 ) -> Self {
8770 Self(RequestBuilder::new(stub))
8771 }
8772
8773 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8775 mut self,
8776 v: V,
8777 ) -> Self {
8778 self.0.request = v.into();
8779 self
8780 }
8781
8782 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8784 self.0.options = v.into();
8785 self
8786 }
8787
8788 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8790 (*self.0.stub)
8791 .get_operation(self.0.request, self.0.options)
8792 .await
8793 .map(crate::Response::into_body)
8794 }
8795
8796 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8798 self.0.request.name = v.into();
8799 self
8800 }
8801 }
8802
8803 #[doc(hidden)]
8804 impl crate::RequestBuilder for GetOperation {
8805 fn request_options(&mut self) -> &mut crate::RequestOptions {
8806 &mut self.0.options
8807 }
8808 }
8809
8810 #[derive(Clone, Debug)]
8827 pub struct DeleteOperation(
8828 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8829 );
8830
8831 impl DeleteOperation {
8832 pub(crate) fn new(
8833 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8834 ) -> Self {
8835 Self(RequestBuilder::new(stub))
8836 }
8837
8838 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8840 mut self,
8841 v: V,
8842 ) -> Self {
8843 self.0.request = v.into();
8844 self
8845 }
8846
8847 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8849 self.0.options = v.into();
8850 self
8851 }
8852
8853 pub async fn send(self) -> Result<()> {
8855 (*self.0.stub)
8856 .delete_operation(self.0.request, self.0.options)
8857 .await
8858 .map(crate::Response::into_body)
8859 }
8860
8861 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8863 self.0.request.name = v.into();
8864 self
8865 }
8866 }
8867
8868 #[doc(hidden)]
8869 impl crate::RequestBuilder for DeleteOperation {
8870 fn request_options(&mut self) -> &mut crate::RequestOptions {
8871 &mut self.0.options
8872 }
8873 }
8874
8875 #[derive(Clone, Debug)]
8892 pub struct CancelOperation(
8893 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8894 );
8895
8896 impl CancelOperation {
8897 pub(crate) fn new(
8898 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8899 ) -> Self {
8900 Self(RequestBuilder::new(stub))
8901 }
8902
8903 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8905 mut self,
8906 v: V,
8907 ) -> Self {
8908 self.0.request = v.into();
8909 self
8910 }
8911
8912 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8914 self.0.options = v.into();
8915 self
8916 }
8917
8918 pub async fn send(self) -> Result<()> {
8920 (*self.0.stub)
8921 .cancel_operation(self.0.request, self.0.options)
8922 .await
8923 .map(crate::Response::into_body)
8924 }
8925
8926 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8928 self.0.request.name = v.into();
8929 self
8930 }
8931 }
8932
8933 #[doc(hidden)]
8934 impl crate::RequestBuilder for CancelOperation {
8935 fn request_options(&mut self) -> &mut crate::RequestOptions {
8936 &mut self.0.options
8937 }
8938 }
8939}
8940
8941pub mod internal_range_service {
8943 use crate::Result;
8944
8945 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8959
8960 pub(crate) mod client {
8961 use super::super::super::client::InternalRangeService;
8962 pub struct Factory;
8963 impl crate::ClientFactory for Factory {
8964 type Client = InternalRangeService;
8965 type Credentials = gaxi::options::Credentials;
8966 async fn build(
8967 self,
8968 config: gaxi::options::ClientConfig,
8969 ) -> crate::ClientBuilderResult<Self::Client> {
8970 Self::Client::new(config).await
8971 }
8972 }
8973 }
8974
8975 #[derive(Clone, Debug)]
8977 pub(crate) struct RequestBuilder<R: std::default::Default> {
8978 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8979 request: R,
8980 options: crate::RequestOptions,
8981 }
8982
8983 impl<R> RequestBuilder<R>
8984 where
8985 R: std::default::Default,
8986 {
8987 pub(crate) fn new(
8988 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8989 ) -> Self {
8990 Self {
8991 stub,
8992 request: R::default(),
8993 options: crate::RequestOptions::default(),
8994 }
8995 }
8996 }
8997
8998 #[derive(Clone, Debug)]
9019 pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
9020
9021 impl ListInternalRanges {
9022 pub(crate) fn new(
9023 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9024 ) -> Self {
9025 Self(RequestBuilder::new(stub))
9026 }
9027
9028 pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
9030 mut self,
9031 v: V,
9032 ) -> Self {
9033 self.0.request = v.into();
9034 self
9035 }
9036
9037 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9039 self.0.options = v.into();
9040 self
9041 }
9042
9043 pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
9045 (*self.0.stub)
9046 .list_internal_ranges(self.0.request, self.0.options)
9047 .await
9048 .map(crate::Response::into_body)
9049 }
9050
9051 pub fn by_page(
9053 self,
9054 ) -> impl google_cloud_gax::paginator::Paginator<
9055 crate::model::ListInternalRangesResponse,
9056 crate::Error,
9057 > {
9058 use std::clone::Clone;
9059 let token = self.0.request.page_token.clone();
9060 let execute = move |token: String| {
9061 let mut builder = self.clone();
9062 builder.0.request = builder.0.request.set_page_token(token);
9063 builder.send()
9064 };
9065 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9066 }
9067
9068 pub fn by_item(
9070 self,
9071 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9072 crate::model::ListInternalRangesResponse,
9073 crate::Error,
9074 > {
9075 use google_cloud_gax::paginator::Paginator;
9076 self.by_page().items()
9077 }
9078
9079 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9083 self.0.request.parent = v.into();
9084 self
9085 }
9086
9087 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9089 self.0.request.page_size = v.into();
9090 self
9091 }
9092
9093 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9095 self.0.request.page_token = v.into();
9096 self
9097 }
9098
9099 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9101 self.0.request.filter = v.into();
9102 self
9103 }
9104
9105 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9107 self.0.request.order_by = v.into();
9108 self
9109 }
9110 }
9111
9112 #[doc(hidden)]
9113 impl crate::RequestBuilder for ListInternalRanges {
9114 fn request_options(&mut self) -> &mut crate::RequestOptions {
9115 &mut self.0.options
9116 }
9117 }
9118
9119 #[derive(Clone, Debug)]
9136 pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
9137
9138 impl GetInternalRange {
9139 pub(crate) fn new(
9140 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9141 ) -> Self {
9142 Self(RequestBuilder::new(stub))
9143 }
9144
9145 pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
9147 mut self,
9148 v: V,
9149 ) -> Self {
9150 self.0.request = v.into();
9151 self
9152 }
9153
9154 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9156 self.0.options = v.into();
9157 self
9158 }
9159
9160 pub async fn send(self) -> Result<crate::model::InternalRange> {
9162 (*self.0.stub)
9163 .get_internal_range(self.0.request, self.0.options)
9164 .await
9165 .map(crate::Response::into_body)
9166 }
9167
9168 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9172 self.0.request.name = v.into();
9173 self
9174 }
9175 }
9176
9177 #[doc(hidden)]
9178 impl crate::RequestBuilder for GetInternalRange {
9179 fn request_options(&mut self) -> &mut crate::RequestOptions {
9180 &mut self.0.options
9181 }
9182 }
9183
9184 #[derive(Clone, Debug)]
9202 pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
9203
9204 impl CreateInternalRange {
9205 pub(crate) fn new(
9206 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9207 ) -> Self {
9208 Self(RequestBuilder::new(stub))
9209 }
9210
9211 pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
9213 mut self,
9214 v: V,
9215 ) -> Self {
9216 self.0.request = v.into();
9217 self
9218 }
9219
9220 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9222 self.0.options = v.into();
9223 self
9224 }
9225
9226 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9233 (*self.0.stub)
9234 .create_internal_range(self.0.request, self.0.options)
9235 .await
9236 .map(crate::Response::into_body)
9237 }
9238
9239 pub fn poller(
9241 self,
9242 ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9243 {
9244 type Operation = google_cloud_lro::internal::Operation<
9245 crate::model::InternalRange,
9246 crate::model::OperationMetadata,
9247 >;
9248 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9249 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9250 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9251 if let Some(ref mut details) = poller_options.tracing {
9252 details.method_name = "google_cloud_networkconnectivity_v1::client::InternalRangeService::create_internal_range::until_done";
9253 }
9254
9255 let stub = self.0.stub.clone();
9256 let mut options = self.0.options.clone();
9257 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9258 let query = move |name| {
9259 let stub = stub.clone();
9260 let options = options.clone();
9261 async {
9262 let op = GetOperation::new(stub)
9263 .set_name(name)
9264 .with_options(options)
9265 .send()
9266 .await?;
9267 Ok(Operation::new(op))
9268 }
9269 };
9270
9271 let start = move || async {
9272 let op = self.send().await?;
9273 Ok(Operation::new(op))
9274 };
9275
9276 use google_cloud_lro::internal::PollerExt;
9277 {
9278 google_cloud_lro::internal::new_poller(
9279 polling_error_policy,
9280 polling_backoff_policy,
9281 start,
9282 query,
9283 )
9284 }
9285 .with_options(poller_options)
9286 }
9287
9288 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9292 self.0.request.parent = v.into();
9293 self
9294 }
9295
9296 pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9298 self.0.request.internal_range_id = v.into();
9299 self
9300 }
9301
9302 pub fn set_internal_range<T>(mut self, v: T) -> Self
9306 where
9307 T: std::convert::Into<crate::model::InternalRange>,
9308 {
9309 self.0.request.internal_range = std::option::Option::Some(v.into());
9310 self
9311 }
9312
9313 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9317 where
9318 T: std::convert::Into<crate::model::InternalRange>,
9319 {
9320 self.0.request.internal_range = v.map(|x| x.into());
9321 self
9322 }
9323
9324 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9326 self.0.request.request_id = v.into();
9327 self
9328 }
9329 }
9330
9331 #[doc(hidden)]
9332 impl crate::RequestBuilder for CreateInternalRange {
9333 fn request_options(&mut self) -> &mut crate::RequestOptions {
9334 &mut self.0.options
9335 }
9336 }
9337
9338 #[derive(Clone, Debug)]
9356 pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
9357
9358 impl UpdateInternalRange {
9359 pub(crate) fn new(
9360 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9361 ) -> Self {
9362 Self(RequestBuilder::new(stub))
9363 }
9364
9365 pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
9367 mut self,
9368 v: V,
9369 ) -> Self {
9370 self.0.request = v.into();
9371 self
9372 }
9373
9374 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9376 self.0.options = v.into();
9377 self
9378 }
9379
9380 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9387 (*self.0.stub)
9388 .update_internal_range(self.0.request, self.0.options)
9389 .await
9390 .map(crate::Response::into_body)
9391 }
9392
9393 pub fn poller(
9395 self,
9396 ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9397 {
9398 type Operation = google_cloud_lro::internal::Operation<
9399 crate::model::InternalRange,
9400 crate::model::OperationMetadata,
9401 >;
9402 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9403 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9404 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9405 if let Some(ref mut details) = poller_options.tracing {
9406 details.method_name = "google_cloud_networkconnectivity_v1::client::InternalRangeService::update_internal_range::until_done";
9407 }
9408
9409 let stub = self.0.stub.clone();
9410 let mut options = self.0.options.clone();
9411 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9412 let query = move |name| {
9413 let stub = stub.clone();
9414 let options = options.clone();
9415 async {
9416 let op = GetOperation::new(stub)
9417 .set_name(name)
9418 .with_options(options)
9419 .send()
9420 .await?;
9421 Ok(Operation::new(op))
9422 }
9423 };
9424
9425 let start = move || async {
9426 let op = self.send().await?;
9427 Ok(Operation::new(op))
9428 };
9429
9430 use google_cloud_lro::internal::PollerExt;
9431 {
9432 google_cloud_lro::internal::new_poller(
9433 polling_error_policy,
9434 polling_backoff_policy,
9435 start,
9436 query,
9437 )
9438 }
9439 .with_options(poller_options)
9440 }
9441
9442 pub fn set_update_mask<T>(mut self, v: T) -> Self
9444 where
9445 T: std::convert::Into<wkt::FieldMask>,
9446 {
9447 self.0.request.update_mask = std::option::Option::Some(v.into());
9448 self
9449 }
9450
9451 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9453 where
9454 T: std::convert::Into<wkt::FieldMask>,
9455 {
9456 self.0.request.update_mask = v.map(|x| x.into());
9457 self
9458 }
9459
9460 pub fn set_internal_range<T>(mut self, v: T) -> Self
9464 where
9465 T: std::convert::Into<crate::model::InternalRange>,
9466 {
9467 self.0.request.internal_range = std::option::Option::Some(v.into());
9468 self
9469 }
9470
9471 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9475 where
9476 T: std::convert::Into<crate::model::InternalRange>,
9477 {
9478 self.0.request.internal_range = v.map(|x| x.into());
9479 self
9480 }
9481
9482 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9484 self.0.request.request_id = v.into();
9485 self
9486 }
9487 }
9488
9489 #[doc(hidden)]
9490 impl crate::RequestBuilder for UpdateInternalRange {
9491 fn request_options(&mut self) -> &mut crate::RequestOptions {
9492 &mut self.0.options
9493 }
9494 }
9495
9496 #[derive(Clone, Debug)]
9514 pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9515
9516 impl DeleteInternalRange {
9517 pub(crate) fn new(
9518 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9519 ) -> Self {
9520 Self(RequestBuilder::new(stub))
9521 }
9522
9523 pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9525 mut self,
9526 v: V,
9527 ) -> Self {
9528 self.0.request = v.into();
9529 self
9530 }
9531
9532 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9534 self.0.options = v.into();
9535 self
9536 }
9537
9538 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9545 (*self.0.stub)
9546 .delete_internal_range(self.0.request, self.0.options)
9547 .await
9548 .map(crate::Response::into_body)
9549 }
9550
9551 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9553 type Operation =
9554 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9555 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9556 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9557 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9558 if let Some(ref mut details) = poller_options.tracing {
9559 details.method_name = "google_cloud_networkconnectivity_v1::client::InternalRangeService::delete_internal_range::until_done";
9560 }
9561
9562 let stub = self.0.stub.clone();
9563 let mut options = self.0.options.clone();
9564 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9565 let query = move |name| {
9566 let stub = stub.clone();
9567 let options = options.clone();
9568 async {
9569 let op = GetOperation::new(stub)
9570 .set_name(name)
9571 .with_options(options)
9572 .send()
9573 .await?;
9574 Ok(Operation::new(op))
9575 }
9576 };
9577
9578 let start = move || async {
9579 let op = self.send().await?;
9580 Ok(Operation::new(op))
9581 };
9582
9583 use google_cloud_lro::internal::PollerExt;
9584 {
9585 google_cloud_lro::internal::new_unit_response_poller(
9586 polling_error_policy,
9587 polling_backoff_policy,
9588 start,
9589 query,
9590 )
9591 }
9592 .with_options(poller_options)
9593 }
9594
9595 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9599 self.0.request.name = v.into();
9600 self
9601 }
9602
9603 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9605 self.0.request.request_id = v.into();
9606 self
9607 }
9608 }
9609
9610 #[doc(hidden)]
9611 impl crate::RequestBuilder for DeleteInternalRange {
9612 fn request_options(&mut self) -> &mut crate::RequestOptions {
9613 &mut self.0.options
9614 }
9615 }
9616
9617 #[derive(Clone, Debug)]
9638 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9639
9640 impl ListLocations {
9641 pub(crate) fn new(
9642 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9643 ) -> Self {
9644 Self(RequestBuilder::new(stub))
9645 }
9646
9647 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9649 mut self,
9650 v: V,
9651 ) -> Self {
9652 self.0.request = v.into();
9653 self
9654 }
9655
9656 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9658 self.0.options = v.into();
9659 self
9660 }
9661
9662 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9664 (*self.0.stub)
9665 .list_locations(self.0.request, self.0.options)
9666 .await
9667 .map(crate::Response::into_body)
9668 }
9669
9670 pub fn by_page(
9672 self,
9673 ) -> impl google_cloud_gax::paginator::Paginator<
9674 google_cloud_location::model::ListLocationsResponse,
9675 crate::Error,
9676 > {
9677 use std::clone::Clone;
9678 let token = self.0.request.page_token.clone();
9679 let execute = move |token: String| {
9680 let mut builder = self.clone();
9681 builder.0.request = builder.0.request.set_page_token(token);
9682 builder.send()
9683 };
9684 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9685 }
9686
9687 pub fn by_item(
9689 self,
9690 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9691 google_cloud_location::model::ListLocationsResponse,
9692 crate::Error,
9693 > {
9694 use google_cloud_gax::paginator::Paginator;
9695 self.by_page().items()
9696 }
9697
9698 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9700 self.0.request.name = v.into();
9701 self
9702 }
9703
9704 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9706 self.0.request.filter = v.into();
9707 self
9708 }
9709
9710 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9712 self.0.request.page_size = v.into();
9713 self
9714 }
9715
9716 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9718 self.0.request.page_token = v.into();
9719 self
9720 }
9721 }
9722
9723 #[doc(hidden)]
9724 impl crate::RequestBuilder for ListLocations {
9725 fn request_options(&mut self) -> &mut crate::RequestOptions {
9726 &mut self.0.options
9727 }
9728 }
9729
9730 #[derive(Clone, Debug)]
9747 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9748
9749 impl GetLocation {
9750 pub(crate) fn new(
9751 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9752 ) -> Self {
9753 Self(RequestBuilder::new(stub))
9754 }
9755
9756 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9758 mut self,
9759 v: V,
9760 ) -> Self {
9761 self.0.request = v.into();
9762 self
9763 }
9764
9765 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9767 self.0.options = v.into();
9768 self
9769 }
9770
9771 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9773 (*self.0.stub)
9774 .get_location(self.0.request, self.0.options)
9775 .await
9776 .map(crate::Response::into_body)
9777 }
9778
9779 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9781 self.0.request.name = v.into();
9782 self
9783 }
9784 }
9785
9786 #[doc(hidden)]
9787 impl crate::RequestBuilder for GetLocation {
9788 fn request_options(&mut self) -> &mut crate::RequestOptions {
9789 &mut self.0.options
9790 }
9791 }
9792
9793 #[derive(Clone, Debug)]
9810 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9811
9812 impl SetIamPolicy {
9813 pub(crate) fn new(
9814 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9815 ) -> Self {
9816 Self(RequestBuilder::new(stub))
9817 }
9818
9819 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9821 mut self,
9822 v: V,
9823 ) -> Self {
9824 self.0.request = v.into();
9825 self
9826 }
9827
9828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9830 self.0.options = v.into();
9831 self
9832 }
9833
9834 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9836 (*self.0.stub)
9837 .set_iam_policy(self.0.request, self.0.options)
9838 .await
9839 .map(crate::Response::into_body)
9840 }
9841
9842 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9846 self.0.request.resource = v.into();
9847 self
9848 }
9849
9850 pub fn set_policy<T>(mut self, v: T) -> Self
9854 where
9855 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9856 {
9857 self.0.request.policy = std::option::Option::Some(v.into());
9858 self
9859 }
9860
9861 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9865 where
9866 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9867 {
9868 self.0.request.policy = v.map(|x| x.into());
9869 self
9870 }
9871
9872 pub fn set_update_mask<T>(mut self, v: T) -> Self
9874 where
9875 T: std::convert::Into<wkt::FieldMask>,
9876 {
9877 self.0.request.update_mask = std::option::Option::Some(v.into());
9878 self
9879 }
9880
9881 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9883 where
9884 T: std::convert::Into<wkt::FieldMask>,
9885 {
9886 self.0.request.update_mask = v.map(|x| x.into());
9887 self
9888 }
9889 }
9890
9891 #[doc(hidden)]
9892 impl crate::RequestBuilder for SetIamPolicy {
9893 fn request_options(&mut self) -> &mut crate::RequestOptions {
9894 &mut self.0.options
9895 }
9896 }
9897
9898 #[derive(Clone, Debug)]
9915 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9916
9917 impl GetIamPolicy {
9918 pub(crate) fn new(
9919 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9920 ) -> Self {
9921 Self(RequestBuilder::new(stub))
9922 }
9923
9924 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9926 mut self,
9927 v: V,
9928 ) -> Self {
9929 self.0.request = v.into();
9930 self
9931 }
9932
9933 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9935 self.0.options = v.into();
9936 self
9937 }
9938
9939 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9941 (*self.0.stub)
9942 .get_iam_policy(self.0.request, self.0.options)
9943 .await
9944 .map(crate::Response::into_body)
9945 }
9946
9947 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9951 self.0.request.resource = v.into();
9952 self
9953 }
9954
9955 pub fn set_options<T>(mut self, v: T) -> Self
9957 where
9958 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9959 {
9960 self.0.request.options = std::option::Option::Some(v.into());
9961 self
9962 }
9963
9964 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9966 where
9967 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9968 {
9969 self.0.request.options = v.map(|x| x.into());
9970 self
9971 }
9972 }
9973
9974 #[doc(hidden)]
9975 impl crate::RequestBuilder for GetIamPolicy {
9976 fn request_options(&mut self) -> &mut crate::RequestOptions {
9977 &mut self.0.options
9978 }
9979 }
9980
9981 #[derive(Clone, Debug)]
9998 pub struct TestIamPermissions(
9999 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10000 );
10001
10002 impl TestIamPermissions {
10003 pub(crate) fn new(
10004 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10005 ) -> Self {
10006 Self(RequestBuilder::new(stub))
10007 }
10008
10009 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10011 mut self,
10012 v: V,
10013 ) -> Self {
10014 self.0.request = v.into();
10015 self
10016 }
10017
10018 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10020 self.0.options = v.into();
10021 self
10022 }
10023
10024 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10026 (*self.0.stub)
10027 .test_iam_permissions(self.0.request, self.0.options)
10028 .await
10029 .map(crate::Response::into_body)
10030 }
10031
10032 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10036 self.0.request.resource = v.into();
10037 self
10038 }
10039
10040 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10044 where
10045 T: std::iter::IntoIterator<Item = V>,
10046 V: std::convert::Into<std::string::String>,
10047 {
10048 use std::iter::Iterator;
10049 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10050 self
10051 }
10052 }
10053
10054 #[doc(hidden)]
10055 impl crate::RequestBuilder for TestIamPermissions {
10056 fn request_options(&mut self) -> &mut crate::RequestOptions {
10057 &mut self.0.options
10058 }
10059 }
10060
10061 #[derive(Clone, Debug)]
10082 pub struct ListOperations(
10083 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10084 );
10085
10086 impl ListOperations {
10087 pub(crate) fn new(
10088 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10089 ) -> Self {
10090 Self(RequestBuilder::new(stub))
10091 }
10092
10093 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10095 mut self,
10096 v: V,
10097 ) -> Self {
10098 self.0.request = v.into();
10099 self
10100 }
10101
10102 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10104 self.0.options = v.into();
10105 self
10106 }
10107
10108 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10110 (*self.0.stub)
10111 .list_operations(self.0.request, self.0.options)
10112 .await
10113 .map(crate::Response::into_body)
10114 }
10115
10116 pub fn by_page(
10118 self,
10119 ) -> impl google_cloud_gax::paginator::Paginator<
10120 google_cloud_longrunning::model::ListOperationsResponse,
10121 crate::Error,
10122 > {
10123 use std::clone::Clone;
10124 let token = self.0.request.page_token.clone();
10125 let execute = move |token: String| {
10126 let mut builder = self.clone();
10127 builder.0.request = builder.0.request.set_page_token(token);
10128 builder.send()
10129 };
10130 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10131 }
10132
10133 pub fn by_item(
10135 self,
10136 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10137 google_cloud_longrunning::model::ListOperationsResponse,
10138 crate::Error,
10139 > {
10140 use google_cloud_gax::paginator::Paginator;
10141 self.by_page().items()
10142 }
10143
10144 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10146 self.0.request.name = v.into();
10147 self
10148 }
10149
10150 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10152 self.0.request.filter = v.into();
10153 self
10154 }
10155
10156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10158 self.0.request.page_size = v.into();
10159 self
10160 }
10161
10162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10164 self.0.request.page_token = v.into();
10165 self
10166 }
10167
10168 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10170 self.0.request.return_partial_success = v.into();
10171 self
10172 }
10173 }
10174
10175 #[doc(hidden)]
10176 impl crate::RequestBuilder for ListOperations {
10177 fn request_options(&mut self) -> &mut crate::RequestOptions {
10178 &mut self.0.options
10179 }
10180 }
10181
10182 #[derive(Clone, Debug)]
10199 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10200
10201 impl GetOperation {
10202 pub(crate) fn new(
10203 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10204 ) -> Self {
10205 Self(RequestBuilder::new(stub))
10206 }
10207
10208 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10210 mut self,
10211 v: V,
10212 ) -> Self {
10213 self.0.request = v.into();
10214 self
10215 }
10216
10217 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10219 self.0.options = v.into();
10220 self
10221 }
10222
10223 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10225 (*self.0.stub)
10226 .get_operation(self.0.request, self.0.options)
10227 .await
10228 .map(crate::Response::into_body)
10229 }
10230
10231 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10233 self.0.request.name = v.into();
10234 self
10235 }
10236 }
10237
10238 #[doc(hidden)]
10239 impl crate::RequestBuilder for GetOperation {
10240 fn request_options(&mut self) -> &mut crate::RequestOptions {
10241 &mut self.0.options
10242 }
10243 }
10244
10245 #[derive(Clone, Debug)]
10262 pub struct DeleteOperation(
10263 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10264 );
10265
10266 impl DeleteOperation {
10267 pub(crate) fn new(
10268 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10269 ) -> Self {
10270 Self(RequestBuilder::new(stub))
10271 }
10272
10273 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10275 mut self,
10276 v: V,
10277 ) -> Self {
10278 self.0.request = v.into();
10279 self
10280 }
10281
10282 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10284 self.0.options = v.into();
10285 self
10286 }
10287
10288 pub async fn send(self) -> Result<()> {
10290 (*self.0.stub)
10291 .delete_operation(self.0.request, self.0.options)
10292 .await
10293 .map(crate::Response::into_body)
10294 }
10295
10296 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10298 self.0.request.name = v.into();
10299 self
10300 }
10301 }
10302
10303 #[doc(hidden)]
10304 impl crate::RequestBuilder for DeleteOperation {
10305 fn request_options(&mut self) -> &mut crate::RequestOptions {
10306 &mut self.0.options
10307 }
10308 }
10309
10310 #[derive(Clone, Debug)]
10327 pub struct CancelOperation(
10328 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10329 );
10330
10331 impl CancelOperation {
10332 pub(crate) fn new(
10333 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10334 ) -> Self {
10335 Self(RequestBuilder::new(stub))
10336 }
10337
10338 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10340 mut self,
10341 v: V,
10342 ) -> Self {
10343 self.0.request = v.into();
10344 self
10345 }
10346
10347 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10349 self.0.options = v.into();
10350 self
10351 }
10352
10353 pub async fn send(self) -> Result<()> {
10355 (*self.0.stub)
10356 .cancel_operation(self.0.request, self.0.options)
10357 .await
10358 .map(crate::Response::into_body)
10359 }
10360
10361 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10363 self.0.request.name = v.into();
10364 self
10365 }
10366 }
10367
10368 #[doc(hidden)]
10369 impl crate::RequestBuilder for CancelOperation {
10370 fn request_options(&mut self) -> &mut crate::RequestOptions {
10371 &mut self.0.options
10372 }
10373 }
10374}
10375
10376pub mod policy_based_routing_service {
10378 use crate::Result;
10379
10380 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10394
10395 pub(crate) mod client {
10396 use super::super::super::client::PolicyBasedRoutingService;
10397 pub struct Factory;
10398 impl crate::ClientFactory for Factory {
10399 type Client = PolicyBasedRoutingService;
10400 type Credentials = gaxi::options::Credentials;
10401 async fn build(
10402 self,
10403 config: gaxi::options::ClientConfig,
10404 ) -> crate::ClientBuilderResult<Self::Client> {
10405 Self::Client::new(config).await
10406 }
10407 }
10408 }
10409
10410 #[derive(Clone, Debug)]
10412 pub(crate) struct RequestBuilder<R: std::default::Default> {
10413 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10414 request: R,
10415 options: crate::RequestOptions,
10416 }
10417
10418 impl<R> RequestBuilder<R>
10419 where
10420 R: std::default::Default,
10421 {
10422 pub(crate) fn new(
10423 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10424 ) -> Self {
10425 Self {
10426 stub,
10427 request: R::default(),
10428 options: crate::RequestOptions::default(),
10429 }
10430 }
10431 }
10432
10433 #[derive(Clone, Debug)]
10454 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10455
10456 impl ListPolicyBasedRoutes {
10457 pub(crate) fn new(
10458 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10459 ) -> Self {
10460 Self(RequestBuilder::new(stub))
10461 }
10462
10463 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10465 mut self,
10466 v: V,
10467 ) -> Self {
10468 self.0.request = v.into();
10469 self
10470 }
10471
10472 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10474 self.0.options = v.into();
10475 self
10476 }
10477
10478 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10480 (*self.0.stub)
10481 .list_policy_based_routes(self.0.request, self.0.options)
10482 .await
10483 .map(crate::Response::into_body)
10484 }
10485
10486 pub fn by_page(
10488 self,
10489 ) -> impl google_cloud_gax::paginator::Paginator<
10490 crate::model::ListPolicyBasedRoutesResponse,
10491 crate::Error,
10492 > {
10493 use std::clone::Clone;
10494 let token = self.0.request.page_token.clone();
10495 let execute = move |token: String| {
10496 let mut builder = self.clone();
10497 builder.0.request = builder.0.request.set_page_token(token);
10498 builder.send()
10499 };
10500 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10501 }
10502
10503 pub fn by_item(
10505 self,
10506 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10507 crate::model::ListPolicyBasedRoutesResponse,
10508 crate::Error,
10509 > {
10510 use google_cloud_gax::paginator::Paginator;
10511 self.by_page().items()
10512 }
10513
10514 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10518 self.0.request.parent = v.into();
10519 self
10520 }
10521
10522 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10524 self.0.request.page_size = v.into();
10525 self
10526 }
10527
10528 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10530 self.0.request.page_token = v.into();
10531 self
10532 }
10533
10534 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10536 self.0.request.filter = v.into();
10537 self
10538 }
10539
10540 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10542 self.0.request.order_by = v.into();
10543 self
10544 }
10545 }
10546
10547 #[doc(hidden)]
10548 impl crate::RequestBuilder for ListPolicyBasedRoutes {
10549 fn request_options(&mut self) -> &mut crate::RequestOptions {
10550 &mut self.0.options
10551 }
10552 }
10553
10554 #[derive(Clone, Debug)]
10571 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10572
10573 impl GetPolicyBasedRoute {
10574 pub(crate) fn new(
10575 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10576 ) -> Self {
10577 Self(RequestBuilder::new(stub))
10578 }
10579
10580 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10582 mut self,
10583 v: V,
10584 ) -> Self {
10585 self.0.request = v.into();
10586 self
10587 }
10588
10589 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10591 self.0.options = v.into();
10592 self
10593 }
10594
10595 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10597 (*self.0.stub)
10598 .get_policy_based_route(self.0.request, self.0.options)
10599 .await
10600 .map(crate::Response::into_body)
10601 }
10602
10603 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10607 self.0.request.name = v.into();
10608 self
10609 }
10610 }
10611
10612 #[doc(hidden)]
10613 impl crate::RequestBuilder for GetPolicyBasedRoute {
10614 fn request_options(&mut self) -> &mut crate::RequestOptions {
10615 &mut self.0.options
10616 }
10617 }
10618
10619 #[derive(Clone, Debug)]
10637 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10638
10639 impl CreatePolicyBasedRoute {
10640 pub(crate) fn new(
10641 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10642 ) -> Self {
10643 Self(RequestBuilder::new(stub))
10644 }
10645
10646 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10648 mut self,
10649 v: V,
10650 ) -> Self {
10651 self.0.request = v.into();
10652 self
10653 }
10654
10655 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10657 self.0.options = v.into();
10658 self
10659 }
10660
10661 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10668 (*self.0.stub)
10669 .create_policy_based_route(self.0.request, self.0.options)
10670 .await
10671 .map(crate::Response::into_body)
10672 }
10673
10674 pub fn poller(
10676 self,
10677 ) -> impl google_cloud_lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10678 {
10679 type Operation = google_cloud_lro::internal::Operation<
10680 crate::model::PolicyBasedRoute,
10681 crate::model::OperationMetadata,
10682 >;
10683 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10684 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10685 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10686 if let Some(ref mut details) = poller_options.tracing {
10687 details.method_name = "google_cloud_networkconnectivity_v1::client::PolicyBasedRoutingService::create_policy_based_route::until_done";
10688 }
10689
10690 let stub = self.0.stub.clone();
10691 let mut options = self.0.options.clone();
10692 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10693 let query = move |name| {
10694 let stub = stub.clone();
10695 let options = options.clone();
10696 async {
10697 let op = GetOperation::new(stub)
10698 .set_name(name)
10699 .with_options(options)
10700 .send()
10701 .await?;
10702 Ok(Operation::new(op))
10703 }
10704 };
10705
10706 let start = move || async {
10707 let op = self.send().await?;
10708 Ok(Operation::new(op))
10709 };
10710
10711 use google_cloud_lro::internal::PollerExt;
10712 {
10713 google_cloud_lro::internal::new_poller(
10714 polling_error_policy,
10715 polling_backoff_policy,
10716 start,
10717 query,
10718 )
10719 }
10720 .with_options(poller_options)
10721 }
10722
10723 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10727 self.0.request.parent = v.into();
10728 self
10729 }
10730
10731 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10735 self.0.request.policy_based_route_id = v.into();
10736 self
10737 }
10738
10739 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10743 where
10744 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10745 {
10746 self.0.request.policy_based_route = std::option::Option::Some(v.into());
10747 self
10748 }
10749
10750 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10754 where
10755 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10756 {
10757 self.0.request.policy_based_route = v.map(|x| x.into());
10758 self
10759 }
10760
10761 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10763 self.0.request.request_id = v.into();
10764 self
10765 }
10766 }
10767
10768 #[doc(hidden)]
10769 impl crate::RequestBuilder for CreatePolicyBasedRoute {
10770 fn request_options(&mut self) -> &mut crate::RequestOptions {
10771 &mut self.0.options
10772 }
10773 }
10774
10775 #[derive(Clone, Debug)]
10793 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10794
10795 impl DeletePolicyBasedRoute {
10796 pub(crate) fn new(
10797 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10798 ) -> Self {
10799 Self(RequestBuilder::new(stub))
10800 }
10801
10802 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10804 mut self,
10805 v: V,
10806 ) -> Self {
10807 self.0.request = v.into();
10808 self
10809 }
10810
10811 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10813 self.0.options = v.into();
10814 self
10815 }
10816
10817 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10824 (*self.0.stub)
10825 .delete_policy_based_route(self.0.request, self.0.options)
10826 .await
10827 .map(crate::Response::into_body)
10828 }
10829
10830 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10832 type Operation =
10833 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10834 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10835 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10836 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10837 if let Some(ref mut details) = poller_options.tracing {
10838 details.method_name = "google_cloud_networkconnectivity_v1::client::PolicyBasedRoutingService::delete_policy_based_route::until_done";
10839 }
10840
10841 let stub = self.0.stub.clone();
10842 let mut options = self.0.options.clone();
10843 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10844 let query = move |name| {
10845 let stub = stub.clone();
10846 let options = options.clone();
10847 async {
10848 let op = GetOperation::new(stub)
10849 .set_name(name)
10850 .with_options(options)
10851 .send()
10852 .await?;
10853 Ok(Operation::new(op))
10854 }
10855 };
10856
10857 let start = move || async {
10858 let op = self.send().await?;
10859 Ok(Operation::new(op))
10860 };
10861
10862 use google_cloud_lro::internal::PollerExt;
10863 {
10864 google_cloud_lro::internal::new_unit_response_poller(
10865 polling_error_policy,
10866 polling_backoff_policy,
10867 start,
10868 query,
10869 )
10870 }
10871 .with_options(poller_options)
10872 }
10873
10874 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10878 self.0.request.name = v.into();
10879 self
10880 }
10881
10882 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10884 self.0.request.request_id = v.into();
10885 self
10886 }
10887 }
10888
10889 #[doc(hidden)]
10890 impl crate::RequestBuilder for DeletePolicyBasedRoute {
10891 fn request_options(&mut self) -> &mut crate::RequestOptions {
10892 &mut self.0.options
10893 }
10894 }
10895
10896 #[derive(Clone, Debug)]
10917 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10918
10919 impl ListLocations {
10920 pub(crate) fn new(
10921 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10922 ) -> Self {
10923 Self(RequestBuilder::new(stub))
10924 }
10925
10926 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10928 mut self,
10929 v: V,
10930 ) -> Self {
10931 self.0.request = v.into();
10932 self
10933 }
10934
10935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10937 self.0.options = v.into();
10938 self
10939 }
10940
10941 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10943 (*self.0.stub)
10944 .list_locations(self.0.request, self.0.options)
10945 .await
10946 .map(crate::Response::into_body)
10947 }
10948
10949 pub fn by_page(
10951 self,
10952 ) -> impl google_cloud_gax::paginator::Paginator<
10953 google_cloud_location::model::ListLocationsResponse,
10954 crate::Error,
10955 > {
10956 use std::clone::Clone;
10957 let token = self.0.request.page_token.clone();
10958 let execute = move |token: String| {
10959 let mut builder = self.clone();
10960 builder.0.request = builder.0.request.set_page_token(token);
10961 builder.send()
10962 };
10963 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10964 }
10965
10966 pub fn by_item(
10968 self,
10969 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10970 google_cloud_location::model::ListLocationsResponse,
10971 crate::Error,
10972 > {
10973 use google_cloud_gax::paginator::Paginator;
10974 self.by_page().items()
10975 }
10976
10977 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10979 self.0.request.name = v.into();
10980 self
10981 }
10982
10983 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10985 self.0.request.filter = v.into();
10986 self
10987 }
10988
10989 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10991 self.0.request.page_size = v.into();
10992 self
10993 }
10994
10995 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10997 self.0.request.page_token = v.into();
10998 self
10999 }
11000 }
11001
11002 #[doc(hidden)]
11003 impl crate::RequestBuilder for ListLocations {
11004 fn request_options(&mut self) -> &mut crate::RequestOptions {
11005 &mut self.0.options
11006 }
11007 }
11008
11009 #[derive(Clone, Debug)]
11026 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
11027
11028 impl GetLocation {
11029 pub(crate) fn new(
11030 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11031 ) -> Self {
11032 Self(RequestBuilder::new(stub))
11033 }
11034
11035 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
11037 mut self,
11038 v: V,
11039 ) -> Self {
11040 self.0.request = v.into();
11041 self
11042 }
11043
11044 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11046 self.0.options = v.into();
11047 self
11048 }
11049
11050 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
11052 (*self.0.stub)
11053 .get_location(self.0.request, self.0.options)
11054 .await
11055 .map(crate::Response::into_body)
11056 }
11057
11058 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11060 self.0.request.name = v.into();
11061 self
11062 }
11063 }
11064
11065 #[doc(hidden)]
11066 impl crate::RequestBuilder for GetLocation {
11067 fn request_options(&mut self) -> &mut crate::RequestOptions {
11068 &mut self.0.options
11069 }
11070 }
11071
11072 #[derive(Clone, Debug)]
11089 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
11090
11091 impl SetIamPolicy {
11092 pub(crate) fn new(
11093 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11094 ) -> Self {
11095 Self(RequestBuilder::new(stub))
11096 }
11097
11098 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
11100 mut self,
11101 v: V,
11102 ) -> Self {
11103 self.0.request = v.into();
11104 self
11105 }
11106
11107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11109 self.0.options = v.into();
11110 self
11111 }
11112
11113 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
11115 (*self.0.stub)
11116 .set_iam_policy(self.0.request, self.0.options)
11117 .await
11118 .map(crate::Response::into_body)
11119 }
11120
11121 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11125 self.0.request.resource = v.into();
11126 self
11127 }
11128
11129 pub fn set_policy<T>(mut self, v: T) -> Self
11133 where
11134 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
11135 {
11136 self.0.request.policy = std::option::Option::Some(v.into());
11137 self
11138 }
11139
11140 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
11144 where
11145 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
11146 {
11147 self.0.request.policy = v.map(|x| x.into());
11148 self
11149 }
11150
11151 pub fn set_update_mask<T>(mut self, v: T) -> Self
11153 where
11154 T: std::convert::Into<wkt::FieldMask>,
11155 {
11156 self.0.request.update_mask = std::option::Option::Some(v.into());
11157 self
11158 }
11159
11160 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11162 where
11163 T: std::convert::Into<wkt::FieldMask>,
11164 {
11165 self.0.request.update_mask = v.map(|x| x.into());
11166 self
11167 }
11168 }
11169
11170 #[doc(hidden)]
11171 impl crate::RequestBuilder for SetIamPolicy {
11172 fn request_options(&mut self) -> &mut crate::RequestOptions {
11173 &mut self.0.options
11174 }
11175 }
11176
11177 #[derive(Clone, Debug)]
11194 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
11195
11196 impl GetIamPolicy {
11197 pub(crate) fn new(
11198 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11199 ) -> Self {
11200 Self(RequestBuilder::new(stub))
11201 }
11202
11203 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
11205 mut self,
11206 v: V,
11207 ) -> Self {
11208 self.0.request = v.into();
11209 self
11210 }
11211
11212 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11214 self.0.options = v.into();
11215 self
11216 }
11217
11218 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
11220 (*self.0.stub)
11221 .get_iam_policy(self.0.request, self.0.options)
11222 .await
11223 .map(crate::Response::into_body)
11224 }
11225
11226 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11230 self.0.request.resource = v.into();
11231 self
11232 }
11233
11234 pub fn set_options<T>(mut self, v: T) -> Self
11236 where
11237 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
11238 {
11239 self.0.request.options = std::option::Option::Some(v.into());
11240 self
11241 }
11242
11243 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
11245 where
11246 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
11247 {
11248 self.0.request.options = v.map(|x| x.into());
11249 self
11250 }
11251 }
11252
11253 #[doc(hidden)]
11254 impl crate::RequestBuilder for GetIamPolicy {
11255 fn request_options(&mut self) -> &mut crate::RequestOptions {
11256 &mut self.0.options
11257 }
11258 }
11259
11260 #[derive(Clone, Debug)]
11277 pub struct TestIamPermissions(
11278 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
11279 );
11280
11281 impl TestIamPermissions {
11282 pub(crate) fn new(
11283 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11284 ) -> Self {
11285 Self(RequestBuilder::new(stub))
11286 }
11287
11288 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
11290 mut self,
11291 v: V,
11292 ) -> Self {
11293 self.0.request = v.into();
11294 self
11295 }
11296
11297 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11299 self.0.options = v.into();
11300 self
11301 }
11302
11303 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
11305 (*self.0.stub)
11306 .test_iam_permissions(self.0.request, self.0.options)
11307 .await
11308 .map(crate::Response::into_body)
11309 }
11310
11311 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11315 self.0.request.resource = v.into();
11316 self
11317 }
11318
11319 pub fn set_permissions<T, V>(mut self, v: T) -> Self
11323 where
11324 T: std::iter::IntoIterator<Item = V>,
11325 V: std::convert::Into<std::string::String>,
11326 {
11327 use std::iter::Iterator;
11328 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11329 self
11330 }
11331 }
11332
11333 #[doc(hidden)]
11334 impl crate::RequestBuilder for TestIamPermissions {
11335 fn request_options(&mut self) -> &mut crate::RequestOptions {
11336 &mut self.0.options
11337 }
11338 }
11339
11340 #[derive(Clone, Debug)]
11361 pub struct ListOperations(
11362 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11363 );
11364
11365 impl ListOperations {
11366 pub(crate) fn new(
11367 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11368 ) -> Self {
11369 Self(RequestBuilder::new(stub))
11370 }
11371
11372 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11374 mut self,
11375 v: V,
11376 ) -> Self {
11377 self.0.request = v.into();
11378 self
11379 }
11380
11381 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11383 self.0.options = v.into();
11384 self
11385 }
11386
11387 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11389 (*self.0.stub)
11390 .list_operations(self.0.request, self.0.options)
11391 .await
11392 .map(crate::Response::into_body)
11393 }
11394
11395 pub fn by_page(
11397 self,
11398 ) -> impl google_cloud_gax::paginator::Paginator<
11399 google_cloud_longrunning::model::ListOperationsResponse,
11400 crate::Error,
11401 > {
11402 use std::clone::Clone;
11403 let token = self.0.request.page_token.clone();
11404 let execute = move |token: String| {
11405 let mut builder = self.clone();
11406 builder.0.request = builder.0.request.set_page_token(token);
11407 builder.send()
11408 };
11409 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11410 }
11411
11412 pub fn by_item(
11414 self,
11415 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11416 google_cloud_longrunning::model::ListOperationsResponse,
11417 crate::Error,
11418 > {
11419 use google_cloud_gax::paginator::Paginator;
11420 self.by_page().items()
11421 }
11422
11423 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11425 self.0.request.name = v.into();
11426 self
11427 }
11428
11429 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11431 self.0.request.filter = v.into();
11432 self
11433 }
11434
11435 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11437 self.0.request.page_size = v.into();
11438 self
11439 }
11440
11441 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11443 self.0.request.page_token = v.into();
11444 self
11445 }
11446
11447 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11449 self.0.request.return_partial_success = v.into();
11450 self
11451 }
11452 }
11453
11454 #[doc(hidden)]
11455 impl crate::RequestBuilder for ListOperations {
11456 fn request_options(&mut self) -> &mut crate::RequestOptions {
11457 &mut self.0.options
11458 }
11459 }
11460
11461 #[derive(Clone, Debug)]
11478 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11479
11480 impl GetOperation {
11481 pub(crate) fn new(
11482 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11483 ) -> Self {
11484 Self(RequestBuilder::new(stub))
11485 }
11486
11487 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11489 mut self,
11490 v: V,
11491 ) -> Self {
11492 self.0.request = v.into();
11493 self
11494 }
11495
11496 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11498 self.0.options = v.into();
11499 self
11500 }
11501
11502 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11504 (*self.0.stub)
11505 .get_operation(self.0.request, self.0.options)
11506 .await
11507 .map(crate::Response::into_body)
11508 }
11509
11510 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11512 self.0.request.name = v.into();
11513 self
11514 }
11515 }
11516
11517 #[doc(hidden)]
11518 impl crate::RequestBuilder for GetOperation {
11519 fn request_options(&mut self) -> &mut crate::RequestOptions {
11520 &mut self.0.options
11521 }
11522 }
11523
11524 #[derive(Clone, Debug)]
11541 pub struct DeleteOperation(
11542 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11543 );
11544
11545 impl DeleteOperation {
11546 pub(crate) fn new(
11547 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11548 ) -> Self {
11549 Self(RequestBuilder::new(stub))
11550 }
11551
11552 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11554 mut self,
11555 v: V,
11556 ) -> Self {
11557 self.0.request = v.into();
11558 self
11559 }
11560
11561 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11563 self.0.options = v.into();
11564 self
11565 }
11566
11567 pub async fn send(self) -> Result<()> {
11569 (*self.0.stub)
11570 .delete_operation(self.0.request, self.0.options)
11571 .await
11572 .map(crate::Response::into_body)
11573 }
11574
11575 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11577 self.0.request.name = v.into();
11578 self
11579 }
11580 }
11581
11582 #[doc(hidden)]
11583 impl crate::RequestBuilder for DeleteOperation {
11584 fn request_options(&mut self) -> &mut crate::RequestOptions {
11585 &mut self.0.options
11586 }
11587 }
11588
11589 #[derive(Clone, Debug)]
11606 pub struct CancelOperation(
11607 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11608 );
11609
11610 impl CancelOperation {
11611 pub(crate) fn new(
11612 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11613 ) -> Self {
11614 Self(RequestBuilder::new(stub))
11615 }
11616
11617 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11619 mut self,
11620 v: V,
11621 ) -> Self {
11622 self.0.request = v.into();
11623 self
11624 }
11625
11626 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11628 self.0.options = v.into();
11629 self
11630 }
11631
11632 pub async fn send(self) -> Result<()> {
11634 (*self.0.stub)
11635 .cancel_operation(self.0.request, self.0.options)
11636 .await
11637 .map(crate::Response::into_body)
11638 }
11639
11640 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11642 self.0.request.name = v.into();
11643 self
11644 }
11645 }
11646
11647 #[doc(hidden)]
11648 impl crate::RequestBuilder for CancelOperation {
11649 fn request_options(&mut self) -> &mut crate::RequestOptions {
11650 &mut self.0.options
11651 }
11652 }
11653}