1pub mod cross_network_automation_service {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::CrossNetworkAutomationService;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = CrossNetworkAutomationService;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListServiceConnectionMaps(
95 RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
96 );
97
98 impl ListServiceConnectionMaps {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
107 mut self,
108 v: V,
109 ) -> Self {
110 self.0.request = v.into();
111 self
112 }
113
114 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
116 self.0.options = v.into();
117 self
118 }
119
120 pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
122 (*self.0.stub)
123 .list_service_connection_maps(self.0.request, self.0.options)
124 .await
125 .map(crate::Response::into_body)
126 }
127
128 pub fn by_page(
130 self,
131 ) -> impl google_cloud_gax::paginator::Paginator<
132 crate::model::ListServiceConnectionMapsResponse,
133 crate::Error,
134 > {
135 use std::clone::Clone;
136 let token = self.0.request.page_token.clone();
137 let execute = move |token: String| {
138 let mut builder = self.clone();
139 builder.0.request = builder.0.request.set_page_token(token);
140 builder.send()
141 };
142 google_cloud_gax::paginator::internal::new_paginator(token, execute)
143 }
144
145 pub fn by_item(
147 self,
148 ) -> impl google_cloud_gax::paginator::ItemPaginator<
149 crate::model::ListServiceConnectionMapsResponse,
150 crate::Error,
151 > {
152 use google_cloud_gax::paginator::Paginator;
153 self.by_page().items()
154 }
155
156 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
160 self.0.request.parent = v.into();
161 self
162 }
163
164 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
166 self.0.request.page_size = v.into();
167 self
168 }
169
170 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.page_token = v.into();
173 self
174 }
175
176 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.filter = v.into();
179 self
180 }
181
182 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
184 self.0.request.order_by = v.into();
185 self
186 }
187 }
188
189 #[doc(hidden)]
190 impl crate::RequestBuilder for ListServiceConnectionMaps {
191 fn request_options(&mut self) -> &mut crate::RequestOptions {
192 &mut self.0.options
193 }
194 }
195
196 #[derive(Clone, Debug)]
213 pub struct GetServiceConnectionMap(
214 RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
215 );
216
217 impl GetServiceConnectionMap {
218 pub(crate) fn new(
219 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
220 ) -> Self {
221 Self(RequestBuilder::new(stub))
222 }
223
224 pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
226 mut self,
227 v: V,
228 ) -> Self {
229 self.0.request = v.into();
230 self
231 }
232
233 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
235 self.0.options = v.into();
236 self
237 }
238
239 pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
241 (*self.0.stub)
242 .get_service_connection_map(self.0.request, self.0.options)
243 .await
244 .map(crate::Response::into_body)
245 }
246
247 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
251 self.0.request.name = v.into();
252 self
253 }
254 }
255
256 #[doc(hidden)]
257 impl crate::RequestBuilder for GetServiceConnectionMap {
258 fn request_options(&mut self) -> &mut crate::RequestOptions {
259 &mut self.0.options
260 }
261 }
262
263 #[derive(Clone, Debug)]
281 pub struct CreateServiceConnectionMap(
282 RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
283 );
284
285 impl CreateServiceConnectionMap {
286 pub(crate) fn new(
287 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
288 ) -> Self {
289 Self(RequestBuilder::new(stub))
290 }
291
292 pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
294 mut self,
295 v: V,
296 ) -> Self {
297 self.0.request = v.into();
298 self
299 }
300
301 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
303 self.0.options = v.into();
304 self
305 }
306
307 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
314 (*self.0.stub)
315 .create_service_connection_map(self.0.request, self.0.options)
316 .await
317 .map(crate::Response::into_body)
318 }
319
320 pub fn poller(
322 self,
323 ) -> impl google_cloud_lro::Poller<
324 crate::model::ServiceConnectionMap,
325 crate::model::OperationMetadata,
326 > {
327 type Operation = google_cloud_lro::internal::Operation<
328 crate::model::ServiceConnectionMap,
329 crate::model::OperationMetadata,
330 >;
331 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
332 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
333
334 let stub = self.0.stub.clone();
335 let mut options = self.0.options.clone();
336 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
337 let query = move |name| {
338 let stub = stub.clone();
339 let options = options.clone();
340 async {
341 let op = GetOperation::new(stub)
342 .set_name(name)
343 .with_options(options)
344 .send()
345 .await?;
346 Ok(Operation::new(op))
347 }
348 };
349
350 let start = move || async {
351 let op = self.send().await?;
352 Ok(Operation::new(op))
353 };
354
355 google_cloud_lro::internal::new_poller(
356 polling_error_policy,
357 polling_backoff_policy,
358 start,
359 query,
360 )
361 }
362
363 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
367 self.0.request.parent = v.into();
368 self
369 }
370
371 pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
373 self.0.request.service_connection_map_id = v.into();
374 self
375 }
376
377 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
381 where
382 T: std::convert::Into<crate::model::ServiceConnectionMap>,
383 {
384 self.0.request.service_connection_map = std::option::Option::Some(v.into());
385 self
386 }
387
388 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
392 where
393 T: std::convert::Into<crate::model::ServiceConnectionMap>,
394 {
395 self.0.request.service_connection_map = v.map(|x| x.into());
396 self
397 }
398
399 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
401 self.0.request.request_id = v.into();
402 self
403 }
404 }
405
406 #[doc(hidden)]
407 impl crate::RequestBuilder for CreateServiceConnectionMap {
408 fn request_options(&mut self) -> &mut crate::RequestOptions {
409 &mut self.0.options
410 }
411 }
412
413 #[derive(Clone, Debug)]
431 pub struct UpdateServiceConnectionMap(
432 RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
433 );
434
435 impl UpdateServiceConnectionMap {
436 pub(crate) fn new(
437 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
438 ) -> Self {
439 Self(RequestBuilder::new(stub))
440 }
441
442 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
444 mut self,
445 v: V,
446 ) -> Self {
447 self.0.request = v.into();
448 self
449 }
450
451 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
453 self.0.options = v.into();
454 self
455 }
456
457 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
464 (*self.0.stub)
465 .update_service_connection_map(self.0.request, self.0.options)
466 .await
467 .map(crate::Response::into_body)
468 }
469
470 pub fn poller(
472 self,
473 ) -> impl google_cloud_lro::Poller<
474 crate::model::ServiceConnectionMap,
475 crate::model::OperationMetadata,
476 > {
477 type Operation = google_cloud_lro::internal::Operation<
478 crate::model::ServiceConnectionMap,
479 crate::model::OperationMetadata,
480 >;
481 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
482 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
483
484 let stub = self.0.stub.clone();
485 let mut options = self.0.options.clone();
486 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
487 let query = move |name| {
488 let stub = stub.clone();
489 let options = options.clone();
490 async {
491 let op = GetOperation::new(stub)
492 .set_name(name)
493 .with_options(options)
494 .send()
495 .await?;
496 Ok(Operation::new(op))
497 }
498 };
499
500 let start = move || async {
501 let op = self.send().await?;
502 Ok(Operation::new(op))
503 };
504
505 google_cloud_lro::internal::new_poller(
506 polling_error_policy,
507 polling_backoff_policy,
508 start,
509 query,
510 )
511 }
512
513 pub fn set_update_mask<T>(mut self, v: T) -> Self
515 where
516 T: std::convert::Into<wkt::FieldMask>,
517 {
518 self.0.request.update_mask = std::option::Option::Some(v.into());
519 self
520 }
521
522 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
524 where
525 T: std::convert::Into<wkt::FieldMask>,
526 {
527 self.0.request.update_mask = v.map(|x| x.into());
528 self
529 }
530
531 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
535 where
536 T: std::convert::Into<crate::model::ServiceConnectionMap>,
537 {
538 self.0.request.service_connection_map = std::option::Option::Some(v.into());
539 self
540 }
541
542 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
546 where
547 T: std::convert::Into<crate::model::ServiceConnectionMap>,
548 {
549 self.0.request.service_connection_map = v.map(|x| x.into());
550 self
551 }
552
553 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
555 self.0.request.request_id = v.into();
556 self
557 }
558 }
559
560 #[doc(hidden)]
561 impl crate::RequestBuilder for UpdateServiceConnectionMap {
562 fn request_options(&mut self) -> &mut crate::RequestOptions {
563 &mut self.0.options
564 }
565 }
566
567 #[derive(Clone, Debug)]
585 pub struct DeleteServiceConnectionMap(
586 RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
587 );
588
589 impl DeleteServiceConnectionMap {
590 pub(crate) fn new(
591 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
592 ) -> Self {
593 Self(RequestBuilder::new(stub))
594 }
595
596 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
598 mut self,
599 v: V,
600 ) -> Self {
601 self.0.request = v.into();
602 self
603 }
604
605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
607 self.0.options = v.into();
608 self
609 }
610
611 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
618 (*self.0.stub)
619 .delete_service_connection_map(self.0.request, self.0.options)
620 .await
621 .map(crate::Response::into_body)
622 }
623
624 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
626 type Operation =
627 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
628 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
629 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
630
631 let stub = self.0.stub.clone();
632 let mut options = self.0.options.clone();
633 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
634 let query = move |name| {
635 let stub = stub.clone();
636 let options = options.clone();
637 async {
638 let op = GetOperation::new(stub)
639 .set_name(name)
640 .with_options(options)
641 .send()
642 .await?;
643 Ok(Operation::new(op))
644 }
645 };
646
647 let start = move || async {
648 let op = self.send().await?;
649 Ok(Operation::new(op))
650 };
651
652 google_cloud_lro::internal::new_unit_response_poller(
653 polling_error_policy,
654 polling_backoff_policy,
655 start,
656 query,
657 )
658 }
659
660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
664 self.0.request.name = v.into();
665 self
666 }
667
668 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
670 self.0.request.request_id = v.into();
671 self
672 }
673
674 pub fn set_etag<T>(mut self, v: T) -> Self
676 where
677 T: std::convert::Into<std::string::String>,
678 {
679 self.0.request.etag = std::option::Option::Some(v.into());
680 self
681 }
682
683 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
685 where
686 T: std::convert::Into<std::string::String>,
687 {
688 self.0.request.etag = v.map(|x| x.into());
689 self
690 }
691 }
692
693 #[doc(hidden)]
694 impl crate::RequestBuilder for DeleteServiceConnectionMap {
695 fn request_options(&mut self) -> &mut crate::RequestOptions {
696 &mut self.0.options
697 }
698 }
699
700 #[derive(Clone, Debug)]
721 pub struct ListServiceConnectionPolicies(
722 RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
723 );
724
725 impl ListServiceConnectionPolicies {
726 pub(crate) fn new(
727 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
728 ) -> Self {
729 Self(RequestBuilder::new(stub))
730 }
731
732 pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
734 mut self,
735 v: V,
736 ) -> Self {
737 self.0.request = v.into();
738 self
739 }
740
741 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
743 self.0.options = v.into();
744 self
745 }
746
747 pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
749 (*self.0.stub)
750 .list_service_connection_policies(self.0.request, self.0.options)
751 .await
752 .map(crate::Response::into_body)
753 }
754
755 pub fn by_page(
757 self,
758 ) -> impl google_cloud_gax::paginator::Paginator<
759 crate::model::ListServiceConnectionPoliciesResponse,
760 crate::Error,
761 > {
762 use std::clone::Clone;
763 let token = self.0.request.page_token.clone();
764 let execute = move |token: String| {
765 let mut builder = self.clone();
766 builder.0.request = builder.0.request.set_page_token(token);
767 builder.send()
768 };
769 google_cloud_gax::paginator::internal::new_paginator(token, execute)
770 }
771
772 pub fn by_item(
774 self,
775 ) -> impl google_cloud_gax::paginator::ItemPaginator<
776 crate::model::ListServiceConnectionPoliciesResponse,
777 crate::Error,
778 > {
779 use google_cloud_gax::paginator::Paginator;
780 self.by_page().items()
781 }
782
783 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
787 self.0.request.parent = v.into();
788 self
789 }
790
791 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
793 self.0.request.page_size = v.into();
794 self
795 }
796
797 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
799 self.0.request.page_token = v.into();
800 self
801 }
802
803 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
805 self.0.request.filter = v.into();
806 self
807 }
808
809 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
811 self.0.request.order_by = v.into();
812 self
813 }
814 }
815
816 #[doc(hidden)]
817 impl crate::RequestBuilder for ListServiceConnectionPolicies {
818 fn request_options(&mut self) -> &mut crate::RequestOptions {
819 &mut self.0.options
820 }
821 }
822
823 #[derive(Clone, Debug)]
840 pub struct GetServiceConnectionPolicy(
841 RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
842 );
843
844 impl GetServiceConnectionPolicy {
845 pub(crate) fn new(
846 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
847 ) -> Self {
848 Self(RequestBuilder::new(stub))
849 }
850
851 pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
853 mut self,
854 v: V,
855 ) -> Self {
856 self.0.request = v.into();
857 self
858 }
859
860 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
862 self.0.options = v.into();
863 self
864 }
865
866 pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
868 (*self.0.stub)
869 .get_service_connection_policy(self.0.request, self.0.options)
870 .await
871 .map(crate::Response::into_body)
872 }
873
874 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
878 self.0.request.name = v.into();
879 self
880 }
881 }
882
883 #[doc(hidden)]
884 impl crate::RequestBuilder for GetServiceConnectionPolicy {
885 fn request_options(&mut self) -> &mut crate::RequestOptions {
886 &mut self.0.options
887 }
888 }
889
890 #[derive(Clone, Debug)]
908 pub struct CreateServiceConnectionPolicy(
909 RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
910 );
911
912 impl CreateServiceConnectionPolicy {
913 pub(crate) fn new(
914 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
915 ) -> Self {
916 Self(RequestBuilder::new(stub))
917 }
918
919 pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
921 mut self,
922 v: V,
923 ) -> Self {
924 self.0.request = v.into();
925 self
926 }
927
928 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
930 self.0.options = v.into();
931 self
932 }
933
934 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
941 (*self.0.stub)
942 .create_service_connection_policy(self.0.request, self.0.options)
943 .await
944 .map(crate::Response::into_body)
945 }
946
947 pub fn poller(
949 self,
950 ) -> impl google_cloud_lro::Poller<
951 crate::model::ServiceConnectionPolicy,
952 crate::model::OperationMetadata,
953 > {
954 type Operation = google_cloud_lro::internal::Operation<
955 crate::model::ServiceConnectionPolicy,
956 crate::model::OperationMetadata,
957 >;
958 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
959 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
960
961 let stub = self.0.stub.clone();
962 let mut options = self.0.options.clone();
963 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
964 let query = move |name| {
965 let stub = stub.clone();
966 let options = options.clone();
967 async {
968 let op = GetOperation::new(stub)
969 .set_name(name)
970 .with_options(options)
971 .send()
972 .await?;
973 Ok(Operation::new(op))
974 }
975 };
976
977 let start = move || async {
978 let op = self.send().await?;
979 Ok(Operation::new(op))
980 };
981
982 google_cloud_lro::internal::new_poller(
983 polling_error_policy,
984 polling_backoff_policy,
985 start,
986 query,
987 )
988 }
989
990 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
994 self.0.request.parent = v.into();
995 self
996 }
997
998 pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
1000 mut self,
1001 v: T,
1002 ) -> Self {
1003 self.0.request.service_connection_policy_id = v.into();
1004 self
1005 }
1006
1007 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1011 where
1012 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1013 {
1014 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1015 self
1016 }
1017
1018 pub fn set_or_clear_service_connection_policy<T>(
1022 mut self,
1023 v: std::option::Option<T>,
1024 ) -> Self
1025 where
1026 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1027 {
1028 self.0.request.service_connection_policy = v.map(|x| x.into());
1029 self
1030 }
1031
1032 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1034 self.0.request.request_id = v.into();
1035 self
1036 }
1037 }
1038
1039 #[doc(hidden)]
1040 impl crate::RequestBuilder for CreateServiceConnectionPolicy {
1041 fn request_options(&mut self) -> &mut crate::RequestOptions {
1042 &mut self.0.options
1043 }
1044 }
1045
1046 #[derive(Clone, Debug)]
1064 pub struct UpdateServiceConnectionPolicy(
1065 RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1066 );
1067
1068 impl UpdateServiceConnectionPolicy {
1069 pub(crate) fn new(
1070 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1071 ) -> Self {
1072 Self(RequestBuilder::new(stub))
1073 }
1074
1075 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1077 mut self,
1078 v: V,
1079 ) -> Self {
1080 self.0.request = v.into();
1081 self
1082 }
1083
1084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1086 self.0.options = v.into();
1087 self
1088 }
1089
1090 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1097 (*self.0.stub)
1098 .update_service_connection_policy(self.0.request, self.0.options)
1099 .await
1100 .map(crate::Response::into_body)
1101 }
1102
1103 pub fn poller(
1105 self,
1106 ) -> impl google_cloud_lro::Poller<
1107 crate::model::ServiceConnectionPolicy,
1108 crate::model::OperationMetadata,
1109 > {
1110 type Operation = google_cloud_lro::internal::Operation<
1111 crate::model::ServiceConnectionPolicy,
1112 crate::model::OperationMetadata,
1113 >;
1114 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1115 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1116
1117 let stub = self.0.stub.clone();
1118 let mut options = self.0.options.clone();
1119 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1120 let query = move |name| {
1121 let stub = stub.clone();
1122 let options = options.clone();
1123 async {
1124 let op = GetOperation::new(stub)
1125 .set_name(name)
1126 .with_options(options)
1127 .send()
1128 .await?;
1129 Ok(Operation::new(op))
1130 }
1131 };
1132
1133 let start = move || async {
1134 let op = self.send().await?;
1135 Ok(Operation::new(op))
1136 };
1137
1138 google_cloud_lro::internal::new_poller(
1139 polling_error_policy,
1140 polling_backoff_policy,
1141 start,
1142 query,
1143 )
1144 }
1145
1146 pub fn set_update_mask<T>(mut self, v: T) -> Self
1148 where
1149 T: std::convert::Into<wkt::FieldMask>,
1150 {
1151 self.0.request.update_mask = std::option::Option::Some(v.into());
1152 self
1153 }
1154
1155 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1157 where
1158 T: std::convert::Into<wkt::FieldMask>,
1159 {
1160 self.0.request.update_mask = v.map(|x| x.into());
1161 self
1162 }
1163
1164 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1168 where
1169 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1170 {
1171 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1172 self
1173 }
1174
1175 pub fn set_or_clear_service_connection_policy<T>(
1179 mut self,
1180 v: std::option::Option<T>,
1181 ) -> Self
1182 where
1183 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1184 {
1185 self.0.request.service_connection_policy = v.map(|x| x.into());
1186 self
1187 }
1188
1189 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1191 self.0.request.request_id = v.into();
1192 self
1193 }
1194 }
1195
1196 #[doc(hidden)]
1197 impl crate::RequestBuilder for UpdateServiceConnectionPolicy {
1198 fn request_options(&mut self) -> &mut crate::RequestOptions {
1199 &mut self.0.options
1200 }
1201 }
1202
1203 #[derive(Clone, Debug)]
1221 pub struct DeleteServiceConnectionPolicy(
1222 RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1223 );
1224
1225 impl DeleteServiceConnectionPolicy {
1226 pub(crate) fn new(
1227 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1228 ) -> Self {
1229 Self(RequestBuilder::new(stub))
1230 }
1231
1232 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1234 mut self,
1235 v: V,
1236 ) -> Self {
1237 self.0.request = v.into();
1238 self
1239 }
1240
1241 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1243 self.0.options = v.into();
1244 self
1245 }
1246
1247 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1254 (*self.0.stub)
1255 .delete_service_connection_policy(self.0.request, self.0.options)
1256 .await
1257 .map(crate::Response::into_body)
1258 }
1259
1260 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1262 type Operation =
1263 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1264 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1265 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1266
1267 let stub = self.0.stub.clone();
1268 let mut options = self.0.options.clone();
1269 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1270 let query = move |name| {
1271 let stub = stub.clone();
1272 let options = options.clone();
1273 async {
1274 let op = GetOperation::new(stub)
1275 .set_name(name)
1276 .with_options(options)
1277 .send()
1278 .await?;
1279 Ok(Operation::new(op))
1280 }
1281 };
1282
1283 let start = move || async {
1284 let op = self.send().await?;
1285 Ok(Operation::new(op))
1286 };
1287
1288 google_cloud_lro::internal::new_unit_response_poller(
1289 polling_error_policy,
1290 polling_backoff_policy,
1291 start,
1292 query,
1293 )
1294 }
1295
1296 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1300 self.0.request.name = v.into();
1301 self
1302 }
1303
1304 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1306 self.0.request.request_id = v.into();
1307 self
1308 }
1309
1310 pub fn set_etag<T>(mut self, v: T) -> Self
1312 where
1313 T: std::convert::Into<std::string::String>,
1314 {
1315 self.0.request.etag = std::option::Option::Some(v.into());
1316 self
1317 }
1318
1319 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1321 where
1322 T: std::convert::Into<std::string::String>,
1323 {
1324 self.0.request.etag = v.map(|x| x.into());
1325 self
1326 }
1327 }
1328
1329 #[doc(hidden)]
1330 impl crate::RequestBuilder for DeleteServiceConnectionPolicy {
1331 fn request_options(&mut self) -> &mut crate::RequestOptions {
1332 &mut self.0.options
1333 }
1334 }
1335
1336 #[derive(Clone, Debug)]
1357 pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1358
1359 impl ListServiceClasses {
1360 pub(crate) fn new(
1361 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1362 ) -> Self {
1363 Self(RequestBuilder::new(stub))
1364 }
1365
1366 pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1368 mut self,
1369 v: V,
1370 ) -> Self {
1371 self.0.request = v.into();
1372 self
1373 }
1374
1375 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1377 self.0.options = v.into();
1378 self
1379 }
1380
1381 pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1383 (*self.0.stub)
1384 .list_service_classes(self.0.request, self.0.options)
1385 .await
1386 .map(crate::Response::into_body)
1387 }
1388
1389 pub fn by_page(
1391 self,
1392 ) -> impl google_cloud_gax::paginator::Paginator<
1393 crate::model::ListServiceClassesResponse,
1394 crate::Error,
1395 > {
1396 use std::clone::Clone;
1397 let token = self.0.request.page_token.clone();
1398 let execute = move |token: String| {
1399 let mut builder = self.clone();
1400 builder.0.request = builder.0.request.set_page_token(token);
1401 builder.send()
1402 };
1403 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1404 }
1405
1406 pub fn by_item(
1408 self,
1409 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1410 crate::model::ListServiceClassesResponse,
1411 crate::Error,
1412 > {
1413 use google_cloud_gax::paginator::Paginator;
1414 self.by_page().items()
1415 }
1416
1417 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1421 self.0.request.parent = v.into();
1422 self
1423 }
1424
1425 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1427 self.0.request.page_size = v.into();
1428 self
1429 }
1430
1431 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433 self.0.request.page_token = v.into();
1434 self
1435 }
1436
1437 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1439 self.0.request.filter = v.into();
1440 self
1441 }
1442
1443 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445 self.0.request.order_by = v.into();
1446 self
1447 }
1448 }
1449
1450 #[doc(hidden)]
1451 impl crate::RequestBuilder for ListServiceClasses {
1452 fn request_options(&mut self) -> &mut crate::RequestOptions {
1453 &mut self.0.options
1454 }
1455 }
1456
1457 #[derive(Clone, Debug)]
1474 pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1475
1476 impl GetServiceClass {
1477 pub(crate) fn new(
1478 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1479 ) -> Self {
1480 Self(RequestBuilder::new(stub))
1481 }
1482
1483 pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1485 self.0.request = v.into();
1486 self
1487 }
1488
1489 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1491 self.0.options = v.into();
1492 self
1493 }
1494
1495 pub async fn send(self) -> Result<crate::model::ServiceClass> {
1497 (*self.0.stub)
1498 .get_service_class(self.0.request, self.0.options)
1499 .await
1500 .map(crate::Response::into_body)
1501 }
1502
1503 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1507 self.0.request.name = v.into();
1508 self
1509 }
1510 }
1511
1512 #[doc(hidden)]
1513 impl crate::RequestBuilder for GetServiceClass {
1514 fn request_options(&mut self) -> &mut crate::RequestOptions {
1515 &mut self.0.options
1516 }
1517 }
1518
1519 #[derive(Clone, Debug)]
1537 pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1538
1539 impl UpdateServiceClass {
1540 pub(crate) fn new(
1541 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1542 ) -> Self {
1543 Self(RequestBuilder::new(stub))
1544 }
1545
1546 pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1548 mut self,
1549 v: V,
1550 ) -> Self {
1551 self.0.request = v.into();
1552 self
1553 }
1554
1555 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1557 self.0.options = v.into();
1558 self
1559 }
1560
1561 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1568 (*self.0.stub)
1569 .update_service_class(self.0.request, self.0.options)
1570 .await
1571 .map(crate::Response::into_body)
1572 }
1573
1574 pub fn poller(
1576 self,
1577 ) -> impl google_cloud_lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata>
1578 {
1579 type Operation = google_cloud_lro::internal::Operation<
1580 crate::model::ServiceClass,
1581 crate::model::OperationMetadata,
1582 >;
1583 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1584 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1585
1586 let stub = self.0.stub.clone();
1587 let mut options = self.0.options.clone();
1588 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1589 let query = move |name| {
1590 let stub = stub.clone();
1591 let options = options.clone();
1592 async {
1593 let op = GetOperation::new(stub)
1594 .set_name(name)
1595 .with_options(options)
1596 .send()
1597 .await?;
1598 Ok(Operation::new(op))
1599 }
1600 };
1601
1602 let start = move || async {
1603 let op = self.send().await?;
1604 Ok(Operation::new(op))
1605 };
1606
1607 google_cloud_lro::internal::new_poller(
1608 polling_error_policy,
1609 polling_backoff_policy,
1610 start,
1611 query,
1612 )
1613 }
1614
1615 pub fn set_update_mask<T>(mut self, v: T) -> Self
1617 where
1618 T: std::convert::Into<wkt::FieldMask>,
1619 {
1620 self.0.request.update_mask = std::option::Option::Some(v.into());
1621 self
1622 }
1623
1624 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1626 where
1627 T: std::convert::Into<wkt::FieldMask>,
1628 {
1629 self.0.request.update_mask = v.map(|x| x.into());
1630 self
1631 }
1632
1633 pub fn set_service_class<T>(mut self, v: T) -> Self
1637 where
1638 T: std::convert::Into<crate::model::ServiceClass>,
1639 {
1640 self.0.request.service_class = std::option::Option::Some(v.into());
1641 self
1642 }
1643
1644 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1648 where
1649 T: std::convert::Into<crate::model::ServiceClass>,
1650 {
1651 self.0.request.service_class = v.map(|x| x.into());
1652 self
1653 }
1654
1655 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.0.request.request_id = v.into();
1658 self
1659 }
1660 }
1661
1662 #[doc(hidden)]
1663 impl crate::RequestBuilder for UpdateServiceClass {
1664 fn request_options(&mut self) -> &mut crate::RequestOptions {
1665 &mut self.0.options
1666 }
1667 }
1668
1669 #[derive(Clone, Debug)]
1687 pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1688
1689 impl DeleteServiceClass {
1690 pub(crate) fn new(
1691 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1692 ) -> Self {
1693 Self(RequestBuilder::new(stub))
1694 }
1695
1696 pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1698 mut self,
1699 v: V,
1700 ) -> Self {
1701 self.0.request = v.into();
1702 self
1703 }
1704
1705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1707 self.0.options = v.into();
1708 self
1709 }
1710
1711 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1718 (*self.0.stub)
1719 .delete_service_class(self.0.request, self.0.options)
1720 .await
1721 .map(crate::Response::into_body)
1722 }
1723
1724 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1726 type Operation =
1727 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1728 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1729 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1730
1731 let stub = self.0.stub.clone();
1732 let mut options = self.0.options.clone();
1733 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1734 let query = move |name| {
1735 let stub = stub.clone();
1736 let options = options.clone();
1737 async {
1738 let op = GetOperation::new(stub)
1739 .set_name(name)
1740 .with_options(options)
1741 .send()
1742 .await?;
1743 Ok(Operation::new(op))
1744 }
1745 };
1746
1747 let start = move || async {
1748 let op = self.send().await?;
1749 Ok(Operation::new(op))
1750 };
1751
1752 google_cloud_lro::internal::new_unit_response_poller(
1753 polling_error_policy,
1754 polling_backoff_policy,
1755 start,
1756 query,
1757 )
1758 }
1759
1760 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1764 self.0.request.name = v.into();
1765 self
1766 }
1767
1768 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1770 self.0.request.request_id = v.into();
1771 self
1772 }
1773
1774 pub fn set_etag<T>(mut self, v: T) -> Self
1776 where
1777 T: std::convert::Into<std::string::String>,
1778 {
1779 self.0.request.etag = std::option::Option::Some(v.into());
1780 self
1781 }
1782
1783 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1785 where
1786 T: std::convert::Into<std::string::String>,
1787 {
1788 self.0.request.etag = v.map(|x| x.into());
1789 self
1790 }
1791 }
1792
1793 #[doc(hidden)]
1794 impl crate::RequestBuilder for DeleteServiceClass {
1795 fn request_options(&mut self) -> &mut crate::RequestOptions {
1796 &mut self.0.options
1797 }
1798 }
1799
1800 #[derive(Clone, Debug)]
1817 pub struct GetServiceConnectionToken(
1818 RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1819 );
1820
1821 impl GetServiceConnectionToken {
1822 pub(crate) fn new(
1823 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1824 ) -> Self {
1825 Self(RequestBuilder::new(stub))
1826 }
1827
1828 pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1830 mut self,
1831 v: V,
1832 ) -> Self {
1833 self.0.request = v.into();
1834 self
1835 }
1836
1837 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1839 self.0.options = v.into();
1840 self
1841 }
1842
1843 pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1845 (*self.0.stub)
1846 .get_service_connection_token(self.0.request, self.0.options)
1847 .await
1848 .map(crate::Response::into_body)
1849 }
1850
1851 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1855 self.0.request.name = v.into();
1856 self
1857 }
1858 }
1859
1860 #[doc(hidden)]
1861 impl crate::RequestBuilder for GetServiceConnectionToken {
1862 fn request_options(&mut self) -> &mut crate::RequestOptions {
1863 &mut self.0.options
1864 }
1865 }
1866
1867 #[derive(Clone, Debug)]
1888 pub struct ListServiceConnectionTokens(
1889 RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1890 );
1891
1892 impl ListServiceConnectionTokens {
1893 pub(crate) fn new(
1894 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1895 ) -> Self {
1896 Self(RequestBuilder::new(stub))
1897 }
1898
1899 pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1901 mut self,
1902 v: V,
1903 ) -> Self {
1904 self.0.request = v.into();
1905 self
1906 }
1907
1908 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1910 self.0.options = v.into();
1911 self
1912 }
1913
1914 pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1916 (*self.0.stub)
1917 .list_service_connection_tokens(self.0.request, self.0.options)
1918 .await
1919 .map(crate::Response::into_body)
1920 }
1921
1922 pub fn by_page(
1924 self,
1925 ) -> impl google_cloud_gax::paginator::Paginator<
1926 crate::model::ListServiceConnectionTokensResponse,
1927 crate::Error,
1928 > {
1929 use std::clone::Clone;
1930 let token = self.0.request.page_token.clone();
1931 let execute = move |token: String| {
1932 let mut builder = self.clone();
1933 builder.0.request = builder.0.request.set_page_token(token);
1934 builder.send()
1935 };
1936 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1937 }
1938
1939 pub fn by_item(
1941 self,
1942 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1943 crate::model::ListServiceConnectionTokensResponse,
1944 crate::Error,
1945 > {
1946 use google_cloud_gax::paginator::Paginator;
1947 self.by_page().items()
1948 }
1949
1950 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1954 self.0.request.parent = v.into();
1955 self
1956 }
1957
1958 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1960 self.0.request.page_size = v.into();
1961 self
1962 }
1963
1964 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1966 self.0.request.page_token = v.into();
1967 self
1968 }
1969
1970 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1972 self.0.request.filter = v.into();
1973 self
1974 }
1975
1976 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1978 self.0.request.order_by = v.into();
1979 self
1980 }
1981 }
1982
1983 #[doc(hidden)]
1984 impl crate::RequestBuilder for ListServiceConnectionTokens {
1985 fn request_options(&mut self) -> &mut crate::RequestOptions {
1986 &mut self.0.options
1987 }
1988 }
1989
1990 #[derive(Clone, Debug)]
2008 pub struct CreateServiceConnectionToken(
2009 RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
2010 );
2011
2012 impl CreateServiceConnectionToken {
2013 pub(crate) fn new(
2014 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2015 ) -> Self {
2016 Self(RequestBuilder::new(stub))
2017 }
2018
2019 pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2021 mut self,
2022 v: V,
2023 ) -> Self {
2024 self.0.request = v.into();
2025 self
2026 }
2027
2028 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2030 self.0.options = v.into();
2031 self
2032 }
2033
2034 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2041 (*self.0.stub)
2042 .create_service_connection_token(self.0.request, self.0.options)
2043 .await
2044 .map(crate::Response::into_body)
2045 }
2046
2047 pub fn poller(
2049 self,
2050 ) -> impl google_cloud_lro::Poller<
2051 crate::model::ServiceConnectionToken,
2052 crate::model::OperationMetadata,
2053 > {
2054 type Operation = google_cloud_lro::internal::Operation<
2055 crate::model::ServiceConnectionToken,
2056 crate::model::OperationMetadata,
2057 >;
2058 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2059 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2060
2061 let stub = self.0.stub.clone();
2062 let mut options = self.0.options.clone();
2063 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2064 let query = move |name| {
2065 let stub = stub.clone();
2066 let options = options.clone();
2067 async {
2068 let op = GetOperation::new(stub)
2069 .set_name(name)
2070 .with_options(options)
2071 .send()
2072 .await?;
2073 Ok(Operation::new(op))
2074 }
2075 };
2076
2077 let start = move || async {
2078 let op = self.send().await?;
2079 Ok(Operation::new(op))
2080 };
2081
2082 google_cloud_lro::internal::new_poller(
2083 polling_error_policy,
2084 polling_backoff_policy,
2085 start,
2086 query,
2087 )
2088 }
2089
2090 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2094 self.0.request.parent = v.into();
2095 self
2096 }
2097
2098 pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2100 mut self,
2101 v: T,
2102 ) -> Self {
2103 self.0.request.service_connection_token_id = v.into();
2104 self
2105 }
2106
2107 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2111 where
2112 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2113 {
2114 self.0.request.service_connection_token = std::option::Option::Some(v.into());
2115 self
2116 }
2117
2118 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2122 where
2123 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2124 {
2125 self.0.request.service_connection_token = v.map(|x| x.into());
2126 self
2127 }
2128
2129 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2131 self.0.request.request_id = v.into();
2132 self
2133 }
2134 }
2135
2136 #[doc(hidden)]
2137 impl crate::RequestBuilder for CreateServiceConnectionToken {
2138 fn request_options(&mut self) -> &mut crate::RequestOptions {
2139 &mut self.0.options
2140 }
2141 }
2142
2143 #[derive(Clone, Debug)]
2161 pub struct DeleteServiceConnectionToken(
2162 RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2163 );
2164
2165 impl DeleteServiceConnectionToken {
2166 pub(crate) fn new(
2167 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2168 ) -> Self {
2169 Self(RequestBuilder::new(stub))
2170 }
2171
2172 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2174 mut self,
2175 v: V,
2176 ) -> Self {
2177 self.0.request = v.into();
2178 self
2179 }
2180
2181 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2183 self.0.options = v.into();
2184 self
2185 }
2186
2187 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2194 (*self.0.stub)
2195 .delete_service_connection_token(self.0.request, self.0.options)
2196 .await
2197 .map(crate::Response::into_body)
2198 }
2199
2200 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2202 type Operation =
2203 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2204 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2205 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2206
2207 let stub = self.0.stub.clone();
2208 let mut options = self.0.options.clone();
2209 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2210 let query = move |name| {
2211 let stub = stub.clone();
2212 let options = options.clone();
2213 async {
2214 let op = GetOperation::new(stub)
2215 .set_name(name)
2216 .with_options(options)
2217 .send()
2218 .await?;
2219 Ok(Operation::new(op))
2220 }
2221 };
2222
2223 let start = move || async {
2224 let op = self.send().await?;
2225 Ok(Operation::new(op))
2226 };
2227
2228 google_cloud_lro::internal::new_unit_response_poller(
2229 polling_error_policy,
2230 polling_backoff_policy,
2231 start,
2232 query,
2233 )
2234 }
2235
2236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2240 self.0.request.name = v.into();
2241 self
2242 }
2243
2244 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2246 self.0.request.request_id = v.into();
2247 self
2248 }
2249
2250 pub fn set_etag<T>(mut self, v: T) -> Self
2252 where
2253 T: std::convert::Into<std::string::String>,
2254 {
2255 self.0.request.etag = std::option::Option::Some(v.into());
2256 self
2257 }
2258
2259 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2261 where
2262 T: std::convert::Into<std::string::String>,
2263 {
2264 self.0.request.etag = v.map(|x| x.into());
2265 self
2266 }
2267 }
2268
2269 #[doc(hidden)]
2270 impl crate::RequestBuilder for DeleteServiceConnectionToken {
2271 fn request_options(&mut self) -> &mut crate::RequestOptions {
2272 &mut self.0.options
2273 }
2274 }
2275
2276 #[derive(Clone, Debug)]
2297 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2298
2299 impl ListLocations {
2300 pub(crate) fn new(
2301 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2302 ) -> Self {
2303 Self(RequestBuilder::new(stub))
2304 }
2305
2306 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2308 mut self,
2309 v: V,
2310 ) -> Self {
2311 self.0.request = v.into();
2312 self
2313 }
2314
2315 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2317 self.0.options = v.into();
2318 self
2319 }
2320
2321 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2323 (*self.0.stub)
2324 .list_locations(self.0.request, self.0.options)
2325 .await
2326 .map(crate::Response::into_body)
2327 }
2328
2329 pub fn by_page(
2331 self,
2332 ) -> impl google_cloud_gax::paginator::Paginator<
2333 google_cloud_location::model::ListLocationsResponse,
2334 crate::Error,
2335 > {
2336 use std::clone::Clone;
2337 let token = self.0.request.page_token.clone();
2338 let execute = move |token: String| {
2339 let mut builder = self.clone();
2340 builder.0.request = builder.0.request.set_page_token(token);
2341 builder.send()
2342 };
2343 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2344 }
2345
2346 pub fn by_item(
2348 self,
2349 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2350 google_cloud_location::model::ListLocationsResponse,
2351 crate::Error,
2352 > {
2353 use google_cloud_gax::paginator::Paginator;
2354 self.by_page().items()
2355 }
2356
2357 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2359 self.0.request.name = v.into();
2360 self
2361 }
2362
2363 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2365 self.0.request.filter = v.into();
2366 self
2367 }
2368
2369 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2371 self.0.request.page_size = v.into();
2372 self
2373 }
2374
2375 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2377 self.0.request.page_token = v.into();
2378 self
2379 }
2380 }
2381
2382 #[doc(hidden)]
2383 impl crate::RequestBuilder for ListLocations {
2384 fn request_options(&mut self) -> &mut crate::RequestOptions {
2385 &mut self.0.options
2386 }
2387 }
2388
2389 #[derive(Clone, Debug)]
2406 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2407
2408 impl GetLocation {
2409 pub(crate) fn new(
2410 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2411 ) -> Self {
2412 Self(RequestBuilder::new(stub))
2413 }
2414
2415 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2417 mut self,
2418 v: V,
2419 ) -> Self {
2420 self.0.request = v.into();
2421 self
2422 }
2423
2424 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2426 self.0.options = v.into();
2427 self
2428 }
2429
2430 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2432 (*self.0.stub)
2433 .get_location(self.0.request, self.0.options)
2434 .await
2435 .map(crate::Response::into_body)
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
2445 #[doc(hidden)]
2446 impl crate::RequestBuilder for GetLocation {
2447 fn request_options(&mut self) -> &mut crate::RequestOptions {
2448 &mut self.0.options
2449 }
2450 }
2451
2452 #[derive(Clone, Debug)]
2469 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2470
2471 impl SetIamPolicy {
2472 pub(crate) fn new(
2473 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2474 ) -> Self {
2475 Self(RequestBuilder::new(stub))
2476 }
2477
2478 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2480 mut self,
2481 v: V,
2482 ) -> Self {
2483 self.0.request = v.into();
2484 self
2485 }
2486
2487 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2489 self.0.options = v.into();
2490 self
2491 }
2492
2493 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2495 (*self.0.stub)
2496 .set_iam_policy(self.0.request, self.0.options)
2497 .await
2498 .map(crate::Response::into_body)
2499 }
2500
2501 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2505 self.0.request.resource = v.into();
2506 self
2507 }
2508
2509 pub fn set_policy<T>(mut self, v: T) -> Self
2513 where
2514 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2515 {
2516 self.0.request.policy = std::option::Option::Some(v.into());
2517 self
2518 }
2519
2520 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2524 where
2525 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2526 {
2527 self.0.request.policy = v.map(|x| x.into());
2528 self
2529 }
2530
2531 pub fn set_update_mask<T>(mut self, v: T) -> Self
2533 where
2534 T: std::convert::Into<wkt::FieldMask>,
2535 {
2536 self.0.request.update_mask = std::option::Option::Some(v.into());
2537 self
2538 }
2539
2540 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2542 where
2543 T: std::convert::Into<wkt::FieldMask>,
2544 {
2545 self.0.request.update_mask = v.map(|x| x.into());
2546 self
2547 }
2548 }
2549
2550 #[doc(hidden)]
2551 impl crate::RequestBuilder for SetIamPolicy {
2552 fn request_options(&mut self) -> &mut crate::RequestOptions {
2553 &mut self.0.options
2554 }
2555 }
2556
2557 #[derive(Clone, Debug)]
2574 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2575
2576 impl GetIamPolicy {
2577 pub(crate) fn new(
2578 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2579 ) -> Self {
2580 Self(RequestBuilder::new(stub))
2581 }
2582
2583 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2585 mut self,
2586 v: V,
2587 ) -> Self {
2588 self.0.request = v.into();
2589 self
2590 }
2591
2592 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2594 self.0.options = v.into();
2595 self
2596 }
2597
2598 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2600 (*self.0.stub)
2601 .get_iam_policy(self.0.request, self.0.options)
2602 .await
2603 .map(crate::Response::into_body)
2604 }
2605
2606 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2610 self.0.request.resource = v.into();
2611 self
2612 }
2613
2614 pub fn set_options<T>(mut self, v: T) -> Self
2616 where
2617 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2618 {
2619 self.0.request.options = std::option::Option::Some(v.into());
2620 self
2621 }
2622
2623 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2625 where
2626 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2627 {
2628 self.0.request.options = v.map(|x| x.into());
2629 self
2630 }
2631 }
2632
2633 #[doc(hidden)]
2634 impl crate::RequestBuilder for GetIamPolicy {
2635 fn request_options(&mut self) -> &mut crate::RequestOptions {
2636 &mut self.0.options
2637 }
2638 }
2639
2640 #[derive(Clone, Debug)]
2657 pub struct TestIamPermissions(
2658 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2659 );
2660
2661 impl TestIamPermissions {
2662 pub(crate) fn new(
2663 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2664 ) -> Self {
2665 Self(RequestBuilder::new(stub))
2666 }
2667
2668 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2670 mut self,
2671 v: V,
2672 ) -> Self {
2673 self.0.request = v.into();
2674 self
2675 }
2676
2677 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2679 self.0.options = v.into();
2680 self
2681 }
2682
2683 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2685 (*self.0.stub)
2686 .test_iam_permissions(self.0.request, self.0.options)
2687 .await
2688 .map(crate::Response::into_body)
2689 }
2690
2691 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2695 self.0.request.resource = v.into();
2696 self
2697 }
2698
2699 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2703 where
2704 T: std::iter::IntoIterator<Item = V>,
2705 V: std::convert::Into<std::string::String>,
2706 {
2707 use std::iter::Iterator;
2708 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2709 self
2710 }
2711 }
2712
2713 #[doc(hidden)]
2714 impl crate::RequestBuilder for TestIamPermissions {
2715 fn request_options(&mut self) -> &mut crate::RequestOptions {
2716 &mut self.0.options
2717 }
2718 }
2719
2720 #[derive(Clone, Debug)]
2741 pub struct ListOperations(
2742 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2743 );
2744
2745 impl ListOperations {
2746 pub(crate) fn new(
2747 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2748 ) -> Self {
2749 Self(RequestBuilder::new(stub))
2750 }
2751
2752 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2754 mut self,
2755 v: V,
2756 ) -> Self {
2757 self.0.request = v.into();
2758 self
2759 }
2760
2761 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2763 self.0.options = v.into();
2764 self
2765 }
2766
2767 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2769 (*self.0.stub)
2770 .list_operations(self.0.request, self.0.options)
2771 .await
2772 .map(crate::Response::into_body)
2773 }
2774
2775 pub fn by_page(
2777 self,
2778 ) -> impl google_cloud_gax::paginator::Paginator<
2779 google_cloud_longrunning::model::ListOperationsResponse,
2780 crate::Error,
2781 > {
2782 use std::clone::Clone;
2783 let token = self.0.request.page_token.clone();
2784 let execute = move |token: String| {
2785 let mut builder = self.clone();
2786 builder.0.request = builder.0.request.set_page_token(token);
2787 builder.send()
2788 };
2789 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2790 }
2791
2792 pub fn by_item(
2794 self,
2795 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2796 google_cloud_longrunning::model::ListOperationsResponse,
2797 crate::Error,
2798 > {
2799 use google_cloud_gax::paginator::Paginator;
2800 self.by_page().items()
2801 }
2802
2803 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2805 self.0.request.name = v.into();
2806 self
2807 }
2808
2809 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2811 self.0.request.filter = v.into();
2812 self
2813 }
2814
2815 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2817 self.0.request.page_size = v.into();
2818 self
2819 }
2820
2821 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2823 self.0.request.page_token = v.into();
2824 self
2825 }
2826
2827 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2829 self.0.request.return_partial_success = v.into();
2830 self
2831 }
2832 }
2833
2834 #[doc(hidden)]
2835 impl crate::RequestBuilder for ListOperations {
2836 fn request_options(&mut self) -> &mut crate::RequestOptions {
2837 &mut self.0.options
2838 }
2839 }
2840
2841 #[derive(Clone, Debug)]
2858 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2859
2860 impl GetOperation {
2861 pub(crate) fn new(
2862 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2863 ) -> Self {
2864 Self(RequestBuilder::new(stub))
2865 }
2866
2867 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2869 mut self,
2870 v: V,
2871 ) -> Self {
2872 self.0.request = v.into();
2873 self
2874 }
2875
2876 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2878 self.0.options = v.into();
2879 self
2880 }
2881
2882 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2884 (*self.0.stub)
2885 .get_operation(self.0.request, self.0.options)
2886 .await
2887 .map(crate::Response::into_body)
2888 }
2889
2890 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2892 self.0.request.name = v.into();
2893 self
2894 }
2895 }
2896
2897 #[doc(hidden)]
2898 impl crate::RequestBuilder for GetOperation {
2899 fn request_options(&mut self) -> &mut crate::RequestOptions {
2900 &mut self.0.options
2901 }
2902 }
2903
2904 #[derive(Clone, Debug)]
2921 pub struct DeleteOperation(
2922 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2923 );
2924
2925 impl DeleteOperation {
2926 pub(crate) fn new(
2927 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2928 ) -> Self {
2929 Self(RequestBuilder::new(stub))
2930 }
2931
2932 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2934 mut self,
2935 v: V,
2936 ) -> Self {
2937 self.0.request = v.into();
2938 self
2939 }
2940
2941 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2943 self.0.options = v.into();
2944 self
2945 }
2946
2947 pub async fn send(self) -> Result<()> {
2949 (*self.0.stub)
2950 .delete_operation(self.0.request, self.0.options)
2951 .await
2952 .map(crate::Response::into_body)
2953 }
2954
2955 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2957 self.0.request.name = v.into();
2958 self
2959 }
2960 }
2961
2962 #[doc(hidden)]
2963 impl crate::RequestBuilder for DeleteOperation {
2964 fn request_options(&mut self) -> &mut crate::RequestOptions {
2965 &mut self.0.options
2966 }
2967 }
2968
2969 #[derive(Clone, Debug)]
2986 pub struct CancelOperation(
2987 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2988 );
2989
2990 impl CancelOperation {
2991 pub(crate) fn new(
2992 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2993 ) -> Self {
2994 Self(RequestBuilder::new(stub))
2995 }
2996
2997 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2999 mut self,
3000 v: V,
3001 ) -> Self {
3002 self.0.request = v.into();
3003 self
3004 }
3005
3006 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3008 self.0.options = v.into();
3009 self
3010 }
3011
3012 pub async fn send(self) -> Result<()> {
3014 (*self.0.stub)
3015 .cancel_operation(self.0.request, self.0.options)
3016 .await
3017 .map(crate::Response::into_body)
3018 }
3019
3020 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3022 self.0.request.name = v.into();
3023 self
3024 }
3025 }
3026
3027 #[doc(hidden)]
3028 impl crate::RequestBuilder for CancelOperation {
3029 fn request_options(&mut self) -> &mut crate::RequestOptions {
3030 &mut self.0.options
3031 }
3032 }
3033}
3034
3035pub mod data_transfer_service {
3036 use crate::Result;
3037
3038 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3052
3053 pub(crate) mod client {
3054 use super::super::super::client::DataTransferService;
3055 pub struct Factory;
3056 impl crate::ClientFactory for Factory {
3057 type Client = DataTransferService;
3058 type Credentials = gaxi::options::Credentials;
3059 async fn build(
3060 self,
3061 config: gaxi::options::ClientConfig,
3062 ) -> crate::ClientBuilderResult<Self::Client> {
3063 Self::Client::new(config).await
3064 }
3065 }
3066 }
3067
3068 #[derive(Clone, Debug)]
3070 pub(crate) struct RequestBuilder<R: std::default::Default> {
3071 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3072 request: R,
3073 options: crate::RequestOptions,
3074 }
3075
3076 impl<R> RequestBuilder<R>
3077 where
3078 R: std::default::Default,
3079 {
3080 pub(crate) fn new(
3081 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3082 ) -> Self {
3083 Self {
3084 stub,
3085 request: R::default(),
3086 options: crate::RequestOptions::default(),
3087 }
3088 }
3089 }
3090
3091 #[derive(Clone, Debug)]
3112 pub struct ListMulticloudDataTransferConfigs(
3113 RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3114 );
3115
3116 impl ListMulticloudDataTransferConfigs {
3117 pub(crate) fn new(
3118 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3119 ) -> Self {
3120 Self(RequestBuilder::new(stub))
3121 }
3122
3123 pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3125 mut self,
3126 v: V,
3127 ) -> Self {
3128 self.0.request = v.into();
3129 self
3130 }
3131
3132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3134 self.0.options = v.into();
3135 self
3136 }
3137
3138 pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3140 (*self.0.stub)
3141 .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3142 .await
3143 .map(crate::Response::into_body)
3144 }
3145
3146 pub fn by_page(
3148 self,
3149 ) -> impl google_cloud_gax::paginator::Paginator<
3150 crate::model::ListMulticloudDataTransferConfigsResponse,
3151 crate::Error,
3152 > {
3153 use std::clone::Clone;
3154 let token = self.0.request.page_token.clone();
3155 let execute = move |token: String| {
3156 let mut builder = self.clone();
3157 builder.0.request = builder.0.request.set_page_token(token);
3158 builder.send()
3159 };
3160 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3161 }
3162
3163 pub fn by_item(
3165 self,
3166 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3167 crate::model::ListMulticloudDataTransferConfigsResponse,
3168 crate::Error,
3169 > {
3170 use google_cloud_gax::paginator::Paginator;
3171 self.by_page().items()
3172 }
3173
3174 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3178 self.0.request.parent = v.into();
3179 self
3180 }
3181
3182 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3184 self.0.request.page_size = v.into();
3185 self
3186 }
3187
3188 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3190 self.0.request.page_token = v.into();
3191 self
3192 }
3193
3194 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3196 self.0.request.filter = v.into();
3197 self
3198 }
3199
3200 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3202 self.0.request.order_by = v.into();
3203 self
3204 }
3205
3206 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3208 self.0.request.return_partial_success = v.into();
3209 self
3210 }
3211 }
3212
3213 #[doc(hidden)]
3214 impl crate::RequestBuilder for ListMulticloudDataTransferConfigs {
3215 fn request_options(&mut self) -> &mut crate::RequestOptions {
3216 &mut self.0.options
3217 }
3218 }
3219
3220 #[derive(Clone, Debug)]
3237 pub struct GetMulticloudDataTransferConfig(
3238 RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3239 );
3240
3241 impl GetMulticloudDataTransferConfig {
3242 pub(crate) fn new(
3243 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3244 ) -> Self {
3245 Self(RequestBuilder::new(stub))
3246 }
3247
3248 pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3250 mut self,
3251 v: V,
3252 ) -> Self {
3253 self.0.request = v.into();
3254 self
3255 }
3256
3257 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3259 self.0.options = v.into();
3260 self
3261 }
3262
3263 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3265 (*self.0.stub)
3266 .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3267 .await
3268 .map(crate::Response::into_body)
3269 }
3270
3271 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3275 self.0.request.name = v.into();
3276 self
3277 }
3278 }
3279
3280 #[doc(hidden)]
3281 impl crate::RequestBuilder for GetMulticloudDataTransferConfig {
3282 fn request_options(&mut self) -> &mut crate::RequestOptions {
3283 &mut self.0.options
3284 }
3285 }
3286
3287 #[derive(Clone, Debug)]
3305 pub struct CreateMulticloudDataTransferConfig(
3306 RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3307 );
3308
3309 impl CreateMulticloudDataTransferConfig {
3310 pub(crate) fn new(
3311 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3312 ) -> Self {
3313 Self(RequestBuilder::new(stub))
3314 }
3315
3316 pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3318 mut self,
3319 v: V,
3320 ) -> Self {
3321 self.0.request = v.into();
3322 self
3323 }
3324
3325 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3327 self.0.options = v.into();
3328 self
3329 }
3330
3331 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3338 (*self.0.stub)
3339 .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3340 .await
3341 .map(crate::Response::into_body)
3342 }
3343
3344 pub fn poller(
3346 self,
3347 ) -> impl google_cloud_lro::Poller<
3348 crate::model::MulticloudDataTransferConfig,
3349 crate::model::OperationMetadata,
3350 > {
3351 type Operation = google_cloud_lro::internal::Operation<
3352 crate::model::MulticloudDataTransferConfig,
3353 crate::model::OperationMetadata,
3354 >;
3355 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3356 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3357
3358 let stub = self.0.stub.clone();
3359 let mut options = self.0.options.clone();
3360 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3361 let query = move |name| {
3362 let stub = stub.clone();
3363 let options = options.clone();
3364 async {
3365 let op = GetOperation::new(stub)
3366 .set_name(name)
3367 .with_options(options)
3368 .send()
3369 .await?;
3370 Ok(Operation::new(op))
3371 }
3372 };
3373
3374 let start = move || async {
3375 let op = self.send().await?;
3376 Ok(Operation::new(op))
3377 };
3378
3379 google_cloud_lro::internal::new_poller(
3380 polling_error_policy,
3381 polling_backoff_policy,
3382 start,
3383 query,
3384 )
3385 }
3386
3387 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3391 self.0.request.parent = v.into();
3392 self
3393 }
3394
3395 pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3399 mut self,
3400 v: T,
3401 ) -> Self {
3402 self.0.request.multicloud_data_transfer_config_id = v.into();
3403 self
3404 }
3405
3406 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3410 where
3411 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3412 {
3413 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3414 self
3415 }
3416
3417 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3421 mut self,
3422 v: std::option::Option<T>,
3423 ) -> Self
3424 where
3425 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3426 {
3427 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3428 self
3429 }
3430
3431 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3433 self.0.request.request_id = v.into();
3434 self
3435 }
3436 }
3437
3438 #[doc(hidden)]
3439 impl crate::RequestBuilder for CreateMulticloudDataTransferConfig {
3440 fn request_options(&mut self) -> &mut crate::RequestOptions {
3441 &mut self.0.options
3442 }
3443 }
3444
3445 #[derive(Clone, Debug)]
3463 pub struct UpdateMulticloudDataTransferConfig(
3464 RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3465 );
3466
3467 impl UpdateMulticloudDataTransferConfig {
3468 pub(crate) fn new(
3469 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3470 ) -> Self {
3471 Self(RequestBuilder::new(stub))
3472 }
3473
3474 pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3476 mut self,
3477 v: V,
3478 ) -> Self {
3479 self.0.request = v.into();
3480 self
3481 }
3482
3483 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3485 self.0.options = v.into();
3486 self
3487 }
3488
3489 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3496 (*self.0.stub)
3497 .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3498 .await
3499 .map(crate::Response::into_body)
3500 }
3501
3502 pub fn poller(
3504 self,
3505 ) -> impl google_cloud_lro::Poller<
3506 crate::model::MulticloudDataTransferConfig,
3507 crate::model::OperationMetadata,
3508 > {
3509 type Operation = google_cloud_lro::internal::Operation<
3510 crate::model::MulticloudDataTransferConfig,
3511 crate::model::OperationMetadata,
3512 >;
3513 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3514 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3515
3516 let stub = self.0.stub.clone();
3517 let mut options = self.0.options.clone();
3518 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3519 let query = move |name| {
3520 let stub = stub.clone();
3521 let options = options.clone();
3522 async {
3523 let op = GetOperation::new(stub)
3524 .set_name(name)
3525 .with_options(options)
3526 .send()
3527 .await?;
3528 Ok(Operation::new(op))
3529 }
3530 };
3531
3532 let start = move || async {
3533 let op = self.send().await?;
3534 Ok(Operation::new(op))
3535 };
3536
3537 google_cloud_lro::internal::new_poller(
3538 polling_error_policy,
3539 polling_backoff_policy,
3540 start,
3541 query,
3542 )
3543 }
3544
3545 pub fn set_update_mask<T>(mut self, v: T) -> Self
3547 where
3548 T: std::convert::Into<wkt::FieldMask>,
3549 {
3550 self.0.request.update_mask = std::option::Option::Some(v.into());
3551 self
3552 }
3553
3554 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3556 where
3557 T: std::convert::Into<wkt::FieldMask>,
3558 {
3559 self.0.request.update_mask = v.map(|x| x.into());
3560 self
3561 }
3562
3563 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3567 where
3568 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3569 {
3570 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3571 self
3572 }
3573
3574 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3578 mut self,
3579 v: std::option::Option<T>,
3580 ) -> Self
3581 where
3582 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3583 {
3584 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3585 self
3586 }
3587
3588 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3590 self.0.request.request_id = v.into();
3591 self
3592 }
3593 }
3594
3595 #[doc(hidden)]
3596 impl crate::RequestBuilder for UpdateMulticloudDataTransferConfig {
3597 fn request_options(&mut self) -> &mut crate::RequestOptions {
3598 &mut self.0.options
3599 }
3600 }
3601
3602 #[derive(Clone, Debug)]
3620 pub struct DeleteMulticloudDataTransferConfig(
3621 RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3622 );
3623
3624 impl DeleteMulticloudDataTransferConfig {
3625 pub(crate) fn new(
3626 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3627 ) -> Self {
3628 Self(RequestBuilder::new(stub))
3629 }
3630
3631 pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3633 mut self,
3634 v: V,
3635 ) -> Self {
3636 self.0.request = v.into();
3637 self
3638 }
3639
3640 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3642 self.0.options = v.into();
3643 self
3644 }
3645
3646 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3653 (*self.0.stub)
3654 .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3655 .await
3656 .map(crate::Response::into_body)
3657 }
3658
3659 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3661 type Operation =
3662 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3663 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3664 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3665
3666 let stub = self.0.stub.clone();
3667 let mut options = self.0.options.clone();
3668 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3669 let query = move |name| {
3670 let stub = stub.clone();
3671 let options = options.clone();
3672 async {
3673 let op = GetOperation::new(stub)
3674 .set_name(name)
3675 .with_options(options)
3676 .send()
3677 .await?;
3678 Ok(Operation::new(op))
3679 }
3680 };
3681
3682 let start = move || async {
3683 let op = self.send().await?;
3684 Ok(Operation::new(op))
3685 };
3686
3687 google_cloud_lro::internal::new_unit_response_poller(
3688 polling_error_policy,
3689 polling_backoff_policy,
3690 start,
3691 query,
3692 )
3693 }
3694
3695 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3699 self.0.request.name = v.into();
3700 self
3701 }
3702
3703 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3705 self.0.request.request_id = v.into();
3706 self
3707 }
3708
3709 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3711 self.0.request.etag = v.into();
3712 self
3713 }
3714 }
3715
3716 #[doc(hidden)]
3717 impl crate::RequestBuilder for DeleteMulticloudDataTransferConfig {
3718 fn request_options(&mut self) -> &mut crate::RequestOptions {
3719 &mut self.0.options
3720 }
3721 }
3722
3723 #[derive(Clone, Debug)]
3744 pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3745
3746 impl ListDestinations {
3747 pub(crate) fn new(
3748 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3749 ) -> Self {
3750 Self(RequestBuilder::new(stub))
3751 }
3752
3753 pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3755 mut self,
3756 v: V,
3757 ) -> Self {
3758 self.0.request = v.into();
3759 self
3760 }
3761
3762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3764 self.0.options = v.into();
3765 self
3766 }
3767
3768 pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3770 (*self.0.stub)
3771 .list_destinations(self.0.request, self.0.options)
3772 .await
3773 .map(crate::Response::into_body)
3774 }
3775
3776 pub fn by_page(
3778 self,
3779 ) -> impl google_cloud_gax::paginator::Paginator<
3780 crate::model::ListDestinationsResponse,
3781 crate::Error,
3782 > {
3783 use std::clone::Clone;
3784 let token = self.0.request.page_token.clone();
3785 let execute = move |token: String| {
3786 let mut builder = self.clone();
3787 builder.0.request = builder.0.request.set_page_token(token);
3788 builder.send()
3789 };
3790 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3791 }
3792
3793 pub fn by_item(
3795 self,
3796 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3797 crate::model::ListDestinationsResponse,
3798 crate::Error,
3799 > {
3800 use google_cloud_gax::paginator::Paginator;
3801 self.by_page().items()
3802 }
3803
3804 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3808 self.0.request.parent = v.into();
3809 self
3810 }
3811
3812 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3814 self.0.request.page_size = v.into();
3815 self
3816 }
3817
3818 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3820 self.0.request.page_token = v.into();
3821 self
3822 }
3823
3824 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3826 self.0.request.filter = v.into();
3827 self
3828 }
3829
3830 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3832 self.0.request.order_by = v.into();
3833 self
3834 }
3835
3836 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3838 self.0.request.return_partial_success = v.into();
3839 self
3840 }
3841 }
3842
3843 #[doc(hidden)]
3844 impl crate::RequestBuilder for ListDestinations {
3845 fn request_options(&mut self) -> &mut crate::RequestOptions {
3846 &mut self.0.options
3847 }
3848 }
3849
3850 #[derive(Clone, Debug)]
3867 pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3868
3869 impl GetDestination {
3870 pub(crate) fn new(
3871 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3872 ) -> Self {
3873 Self(RequestBuilder::new(stub))
3874 }
3875
3876 pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3878 self.0.request = v.into();
3879 self
3880 }
3881
3882 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3884 self.0.options = v.into();
3885 self
3886 }
3887
3888 pub async fn send(self) -> Result<crate::model::Destination> {
3890 (*self.0.stub)
3891 .get_destination(self.0.request, self.0.options)
3892 .await
3893 .map(crate::Response::into_body)
3894 }
3895
3896 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3900 self.0.request.name = v.into();
3901 self
3902 }
3903 }
3904
3905 #[doc(hidden)]
3906 impl crate::RequestBuilder for GetDestination {
3907 fn request_options(&mut self) -> &mut crate::RequestOptions {
3908 &mut self.0.options
3909 }
3910 }
3911
3912 #[derive(Clone, Debug)]
3930 pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3931
3932 impl CreateDestination {
3933 pub(crate) fn new(
3934 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3935 ) -> Self {
3936 Self(RequestBuilder::new(stub))
3937 }
3938
3939 pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3941 mut self,
3942 v: V,
3943 ) -> Self {
3944 self.0.request = v.into();
3945 self
3946 }
3947
3948 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3950 self.0.options = v.into();
3951 self
3952 }
3953
3954 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3961 (*self.0.stub)
3962 .create_destination(self.0.request, self.0.options)
3963 .await
3964 .map(crate::Response::into_body)
3965 }
3966
3967 pub fn poller(
3969 self,
3970 ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
3971 {
3972 type Operation = google_cloud_lro::internal::Operation<
3973 crate::model::Destination,
3974 crate::model::OperationMetadata,
3975 >;
3976 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3977 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3978
3979 let stub = self.0.stub.clone();
3980 let mut options = self.0.options.clone();
3981 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3982 let query = move |name| {
3983 let stub = stub.clone();
3984 let options = options.clone();
3985 async {
3986 let op = GetOperation::new(stub)
3987 .set_name(name)
3988 .with_options(options)
3989 .send()
3990 .await?;
3991 Ok(Operation::new(op))
3992 }
3993 };
3994
3995 let start = move || async {
3996 let op = self.send().await?;
3997 Ok(Operation::new(op))
3998 };
3999
4000 google_cloud_lro::internal::new_poller(
4001 polling_error_policy,
4002 polling_backoff_policy,
4003 start,
4004 query,
4005 )
4006 }
4007
4008 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4012 self.0.request.parent = v.into();
4013 self
4014 }
4015
4016 pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4020 self.0.request.destination_id = v.into();
4021 self
4022 }
4023
4024 pub fn set_destination<T>(mut self, v: T) -> Self
4028 where
4029 T: std::convert::Into<crate::model::Destination>,
4030 {
4031 self.0.request.destination = std::option::Option::Some(v.into());
4032 self
4033 }
4034
4035 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4039 where
4040 T: std::convert::Into<crate::model::Destination>,
4041 {
4042 self.0.request.destination = v.map(|x| x.into());
4043 self
4044 }
4045
4046 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4048 self.0.request.request_id = v.into();
4049 self
4050 }
4051 }
4052
4053 #[doc(hidden)]
4054 impl crate::RequestBuilder for CreateDestination {
4055 fn request_options(&mut self) -> &mut crate::RequestOptions {
4056 &mut self.0.options
4057 }
4058 }
4059
4060 #[derive(Clone, Debug)]
4078 pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4079
4080 impl UpdateDestination {
4081 pub(crate) fn new(
4082 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4083 ) -> Self {
4084 Self(RequestBuilder::new(stub))
4085 }
4086
4087 pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4089 mut self,
4090 v: V,
4091 ) -> Self {
4092 self.0.request = v.into();
4093 self
4094 }
4095
4096 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4098 self.0.options = v.into();
4099 self
4100 }
4101
4102 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4109 (*self.0.stub)
4110 .update_destination(self.0.request, self.0.options)
4111 .await
4112 .map(crate::Response::into_body)
4113 }
4114
4115 pub fn poller(
4117 self,
4118 ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
4119 {
4120 type Operation = google_cloud_lro::internal::Operation<
4121 crate::model::Destination,
4122 crate::model::OperationMetadata,
4123 >;
4124 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4125 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4126
4127 let stub = self.0.stub.clone();
4128 let mut options = self.0.options.clone();
4129 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4130 let query = move |name| {
4131 let stub = stub.clone();
4132 let options = options.clone();
4133 async {
4134 let op = GetOperation::new(stub)
4135 .set_name(name)
4136 .with_options(options)
4137 .send()
4138 .await?;
4139 Ok(Operation::new(op))
4140 }
4141 };
4142
4143 let start = move || async {
4144 let op = self.send().await?;
4145 Ok(Operation::new(op))
4146 };
4147
4148 google_cloud_lro::internal::new_poller(
4149 polling_error_policy,
4150 polling_backoff_policy,
4151 start,
4152 query,
4153 )
4154 }
4155
4156 pub fn set_update_mask<T>(mut self, v: T) -> Self
4158 where
4159 T: std::convert::Into<wkt::FieldMask>,
4160 {
4161 self.0.request.update_mask = std::option::Option::Some(v.into());
4162 self
4163 }
4164
4165 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4167 where
4168 T: std::convert::Into<wkt::FieldMask>,
4169 {
4170 self.0.request.update_mask = v.map(|x| x.into());
4171 self
4172 }
4173
4174 pub fn set_destination<T>(mut self, v: T) -> Self
4178 where
4179 T: std::convert::Into<crate::model::Destination>,
4180 {
4181 self.0.request.destination = std::option::Option::Some(v.into());
4182 self
4183 }
4184
4185 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4189 where
4190 T: std::convert::Into<crate::model::Destination>,
4191 {
4192 self.0.request.destination = v.map(|x| x.into());
4193 self
4194 }
4195
4196 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4198 self.0.request.request_id = v.into();
4199 self
4200 }
4201 }
4202
4203 #[doc(hidden)]
4204 impl crate::RequestBuilder for UpdateDestination {
4205 fn request_options(&mut self) -> &mut crate::RequestOptions {
4206 &mut self.0.options
4207 }
4208 }
4209
4210 #[derive(Clone, Debug)]
4228 pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4229
4230 impl DeleteDestination {
4231 pub(crate) fn new(
4232 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4233 ) -> Self {
4234 Self(RequestBuilder::new(stub))
4235 }
4236
4237 pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4239 mut self,
4240 v: V,
4241 ) -> Self {
4242 self.0.request = v.into();
4243 self
4244 }
4245
4246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4248 self.0.options = v.into();
4249 self
4250 }
4251
4252 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4259 (*self.0.stub)
4260 .delete_destination(self.0.request, self.0.options)
4261 .await
4262 .map(crate::Response::into_body)
4263 }
4264
4265 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4267 type Operation =
4268 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4269 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4270 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4271
4272 let stub = self.0.stub.clone();
4273 let mut options = self.0.options.clone();
4274 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4275 let query = move |name| {
4276 let stub = stub.clone();
4277 let options = options.clone();
4278 async {
4279 let op = GetOperation::new(stub)
4280 .set_name(name)
4281 .with_options(options)
4282 .send()
4283 .await?;
4284 Ok(Operation::new(op))
4285 }
4286 };
4287
4288 let start = move || async {
4289 let op = self.send().await?;
4290 Ok(Operation::new(op))
4291 };
4292
4293 google_cloud_lro::internal::new_unit_response_poller(
4294 polling_error_policy,
4295 polling_backoff_policy,
4296 start,
4297 query,
4298 )
4299 }
4300
4301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4305 self.0.request.name = v.into();
4306 self
4307 }
4308
4309 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4311 self.0.request.request_id = v.into();
4312 self
4313 }
4314
4315 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4317 self.0.request.etag = v.into();
4318 self
4319 }
4320 }
4321
4322 #[doc(hidden)]
4323 impl crate::RequestBuilder for DeleteDestination {
4324 fn request_options(&mut self) -> &mut crate::RequestOptions {
4325 &mut self.0.options
4326 }
4327 }
4328
4329 #[derive(Clone, Debug)]
4346 pub struct GetMulticloudDataTransferSupportedService(
4347 RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4348 );
4349
4350 impl GetMulticloudDataTransferSupportedService {
4351 pub(crate) fn new(
4352 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4353 ) -> Self {
4354 Self(RequestBuilder::new(stub))
4355 }
4356
4357 pub fn with_request<
4359 V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4360 >(
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<crate::model::MulticloudDataTransferSupportedService> {
4376 (*self.0.stub)
4377 .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4378 .await
4379 .map(crate::Response::into_body)
4380 }
4381
4382 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4386 self.0.request.name = v.into();
4387 self
4388 }
4389 }
4390
4391 #[doc(hidden)]
4392 impl crate::RequestBuilder for GetMulticloudDataTransferSupportedService {
4393 fn request_options(&mut self) -> &mut crate::RequestOptions {
4394 &mut self.0.options
4395 }
4396 }
4397
4398 #[derive(Clone, Debug)]
4419 pub struct ListMulticloudDataTransferSupportedServices(
4420 RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4421 );
4422
4423 impl ListMulticloudDataTransferSupportedServices {
4424 pub(crate) fn new(
4425 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4426 ) -> Self {
4427 Self(RequestBuilder::new(stub))
4428 }
4429
4430 pub fn with_request<
4432 V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4433 >(
4434 mut self,
4435 v: V,
4436 ) -> Self {
4437 self.0.request = v.into();
4438 self
4439 }
4440
4441 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4443 self.0.options = v.into();
4444 self
4445 }
4446
4447 pub async fn send(
4449 self,
4450 ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4451 (*self.0.stub)
4452 .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4453 .await
4454 .map(crate::Response::into_body)
4455 }
4456
4457 pub fn by_page(
4459 self,
4460 ) -> impl google_cloud_gax::paginator::Paginator<
4461 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4462 crate::Error,
4463 > {
4464 use std::clone::Clone;
4465 let token = self.0.request.page_token.clone();
4466 let execute = move |token: String| {
4467 let mut builder = self.clone();
4468 builder.0.request = builder.0.request.set_page_token(token);
4469 builder.send()
4470 };
4471 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4472 }
4473
4474 pub fn by_item(
4476 self,
4477 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4478 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4479 crate::Error,
4480 > {
4481 use google_cloud_gax::paginator::Paginator;
4482 self.by_page().items()
4483 }
4484
4485 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4489 self.0.request.parent = v.into();
4490 self
4491 }
4492
4493 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4495 self.0.request.page_size = v.into();
4496 self
4497 }
4498
4499 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4501 self.0.request.page_token = v.into();
4502 self
4503 }
4504 }
4505
4506 #[doc(hidden)]
4507 impl crate::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4508 fn request_options(&mut self) -> &mut crate::RequestOptions {
4509 &mut self.0.options
4510 }
4511 }
4512
4513 #[derive(Clone, Debug)]
4534 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4535
4536 impl ListLocations {
4537 pub(crate) fn new(
4538 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4539 ) -> Self {
4540 Self(RequestBuilder::new(stub))
4541 }
4542
4543 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4545 mut self,
4546 v: V,
4547 ) -> Self {
4548 self.0.request = v.into();
4549 self
4550 }
4551
4552 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4554 self.0.options = v.into();
4555 self
4556 }
4557
4558 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4560 (*self.0.stub)
4561 .list_locations(self.0.request, self.0.options)
4562 .await
4563 .map(crate::Response::into_body)
4564 }
4565
4566 pub fn by_page(
4568 self,
4569 ) -> impl google_cloud_gax::paginator::Paginator<
4570 google_cloud_location::model::ListLocationsResponse,
4571 crate::Error,
4572 > {
4573 use std::clone::Clone;
4574 let token = self.0.request.page_token.clone();
4575 let execute = move |token: String| {
4576 let mut builder = self.clone();
4577 builder.0.request = builder.0.request.set_page_token(token);
4578 builder.send()
4579 };
4580 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4581 }
4582
4583 pub fn by_item(
4585 self,
4586 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4587 google_cloud_location::model::ListLocationsResponse,
4588 crate::Error,
4589 > {
4590 use google_cloud_gax::paginator::Paginator;
4591 self.by_page().items()
4592 }
4593
4594 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4596 self.0.request.name = v.into();
4597 self
4598 }
4599
4600 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4602 self.0.request.filter = v.into();
4603 self
4604 }
4605
4606 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4608 self.0.request.page_size = v.into();
4609 self
4610 }
4611
4612 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4614 self.0.request.page_token = v.into();
4615 self
4616 }
4617 }
4618
4619 #[doc(hidden)]
4620 impl crate::RequestBuilder for ListLocations {
4621 fn request_options(&mut self) -> &mut crate::RequestOptions {
4622 &mut self.0.options
4623 }
4624 }
4625
4626 #[derive(Clone, Debug)]
4643 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4644
4645 impl GetLocation {
4646 pub(crate) fn new(
4647 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4648 ) -> Self {
4649 Self(RequestBuilder::new(stub))
4650 }
4651
4652 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4654 mut self,
4655 v: V,
4656 ) -> Self {
4657 self.0.request = v.into();
4658 self
4659 }
4660
4661 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4663 self.0.options = v.into();
4664 self
4665 }
4666
4667 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4669 (*self.0.stub)
4670 .get_location(self.0.request, self.0.options)
4671 .await
4672 .map(crate::Response::into_body)
4673 }
4674
4675 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4677 self.0.request.name = v.into();
4678 self
4679 }
4680 }
4681
4682 #[doc(hidden)]
4683 impl crate::RequestBuilder for GetLocation {
4684 fn request_options(&mut self) -> &mut crate::RequestOptions {
4685 &mut self.0.options
4686 }
4687 }
4688
4689 #[derive(Clone, Debug)]
4706 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4707
4708 impl SetIamPolicy {
4709 pub(crate) fn new(
4710 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4711 ) -> Self {
4712 Self(RequestBuilder::new(stub))
4713 }
4714
4715 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4717 mut self,
4718 v: V,
4719 ) -> Self {
4720 self.0.request = v.into();
4721 self
4722 }
4723
4724 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4726 self.0.options = v.into();
4727 self
4728 }
4729
4730 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4732 (*self.0.stub)
4733 .set_iam_policy(self.0.request, self.0.options)
4734 .await
4735 .map(crate::Response::into_body)
4736 }
4737
4738 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4742 self.0.request.resource = v.into();
4743 self
4744 }
4745
4746 pub fn set_policy<T>(mut self, v: T) -> Self
4750 where
4751 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4752 {
4753 self.0.request.policy = std::option::Option::Some(v.into());
4754 self
4755 }
4756
4757 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4761 where
4762 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4763 {
4764 self.0.request.policy = v.map(|x| x.into());
4765 self
4766 }
4767
4768 pub fn set_update_mask<T>(mut self, v: T) -> Self
4770 where
4771 T: std::convert::Into<wkt::FieldMask>,
4772 {
4773 self.0.request.update_mask = std::option::Option::Some(v.into());
4774 self
4775 }
4776
4777 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4779 where
4780 T: std::convert::Into<wkt::FieldMask>,
4781 {
4782 self.0.request.update_mask = v.map(|x| x.into());
4783 self
4784 }
4785 }
4786
4787 #[doc(hidden)]
4788 impl crate::RequestBuilder for SetIamPolicy {
4789 fn request_options(&mut self) -> &mut crate::RequestOptions {
4790 &mut self.0.options
4791 }
4792 }
4793
4794 #[derive(Clone, Debug)]
4811 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4812
4813 impl GetIamPolicy {
4814 pub(crate) fn new(
4815 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4816 ) -> Self {
4817 Self(RequestBuilder::new(stub))
4818 }
4819
4820 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4822 mut self,
4823 v: V,
4824 ) -> Self {
4825 self.0.request = v.into();
4826 self
4827 }
4828
4829 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4831 self.0.options = v.into();
4832 self
4833 }
4834
4835 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4837 (*self.0.stub)
4838 .get_iam_policy(self.0.request, self.0.options)
4839 .await
4840 .map(crate::Response::into_body)
4841 }
4842
4843 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4847 self.0.request.resource = v.into();
4848 self
4849 }
4850
4851 pub fn set_options<T>(mut self, v: T) -> Self
4853 where
4854 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4855 {
4856 self.0.request.options = std::option::Option::Some(v.into());
4857 self
4858 }
4859
4860 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4862 where
4863 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4864 {
4865 self.0.request.options = v.map(|x| x.into());
4866 self
4867 }
4868 }
4869
4870 #[doc(hidden)]
4871 impl crate::RequestBuilder for GetIamPolicy {
4872 fn request_options(&mut self) -> &mut crate::RequestOptions {
4873 &mut self.0.options
4874 }
4875 }
4876
4877 #[derive(Clone, Debug)]
4894 pub struct TestIamPermissions(
4895 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4896 );
4897
4898 impl TestIamPermissions {
4899 pub(crate) fn new(
4900 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4901 ) -> Self {
4902 Self(RequestBuilder::new(stub))
4903 }
4904
4905 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4907 mut self,
4908 v: V,
4909 ) -> Self {
4910 self.0.request = v.into();
4911 self
4912 }
4913
4914 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4916 self.0.options = v.into();
4917 self
4918 }
4919
4920 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4922 (*self.0.stub)
4923 .test_iam_permissions(self.0.request, self.0.options)
4924 .await
4925 .map(crate::Response::into_body)
4926 }
4927
4928 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4932 self.0.request.resource = v.into();
4933 self
4934 }
4935
4936 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4940 where
4941 T: std::iter::IntoIterator<Item = V>,
4942 V: std::convert::Into<std::string::String>,
4943 {
4944 use std::iter::Iterator;
4945 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4946 self
4947 }
4948 }
4949
4950 #[doc(hidden)]
4951 impl crate::RequestBuilder for TestIamPermissions {
4952 fn request_options(&mut self) -> &mut crate::RequestOptions {
4953 &mut self.0.options
4954 }
4955 }
4956
4957 #[derive(Clone, Debug)]
4978 pub struct ListOperations(
4979 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4980 );
4981
4982 impl ListOperations {
4983 pub(crate) fn new(
4984 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4985 ) -> Self {
4986 Self(RequestBuilder::new(stub))
4987 }
4988
4989 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4991 mut self,
4992 v: V,
4993 ) -> Self {
4994 self.0.request = v.into();
4995 self
4996 }
4997
4998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5000 self.0.options = v.into();
5001 self
5002 }
5003
5004 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5006 (*self.0.stub)
5007 .list_operations(self.0.request, self.0.options)
5008 .await
5009 .map(crate::Response::into_body)
5010 }
5011
5012 pub fn by_page(
5014 self,
5015 ) -> impl google_cloud_gax::paginator::Paginator<
5016 google_cloud_longrunning::model::ListOperationsResponse,
5017 crate::Error,
5018 > {
5019 use std::clone::Clone;
5020 let token = self.0.request.page_token.clone();
5021 let execute = move |token: String| {
5022 let mut builder = self.clone();
5023 builder.0.request = builder.0.request.set_page_token(token);
5024 builder.send()
5025 };
5026 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5027 }
5028
5029 pub fn by_item(
5031 self,
5032 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5033 google_cloud_longrunning::model::ListOperationsResponse,
5034 crate::Error,
5035 > {
5036 use google_cloud_gax::paginator::Paginator;
5037 self.by_page().items()
5038 }
5039
5040 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5042 self.0.request.name = v.into();
5043 self
5044 }
5045
5046 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5048 self.0.request.filter = v.into();
5049 self
5050 }
5051
5052 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5054 self.0.request.page_size = v.into();
5055 self
5056 }
5057
5058 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5060 self.0.request.page_token = v.into();
5061 self
5062 }
5063
5064 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5066 self.0.request.return_partial_success = v.into();
5067 self
5068 }
5069 }
5070
5071 #[doc(hidden)]
5072 impl crate::RequestBuilder for ListOperations {
5073 fn request_options(&mut self) -> &mut crate::RequestOptions {
5074 &mut self.0.options
5075 }
5076 }
5077
5078 #[derive(Clone, Debug)]
5095 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5096
5097 impl GetOperation {
5098 pub(crate) fn new(
5099 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5100 ) -> Self {
5101 Self(RequestBuilder::new(stub))
5102 }
5103
5104 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5106 mut self,
5107 v: V,
5108 ) -> Self {
5109 self.0.request = v.into();
5110 self
5111 }
5112
5113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5115 self.0.options = v.into();
5116 self
5117 }
5118
5119 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5121 (*self.0.stub)
5122 .get_operation(self.0.request, self.0.options)
5123 .await
5124 .map(crate::Response::into_body)
5125 }
5126
5127 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5129 self.0.request.name = v.into();
5130 self
5131 }
5132 }
5133
5134 #[doc(hidden)]
5135 impl crate::RequestBuilder for GetOperation {
5136 fn request_options(&mut self) -> &mut crate::RequestOptions {
5137 &mut self.0.options
5138 }
5139 }
5140
5141 #[derive(Clone, Debug)]
5158 pub struct DeleteOperation(
5159 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5160 );
5161
5162 impl DeleteOperation {
5163 pub(crate) fn new(
5164 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5165 ) -> Self {
5166 Self(RequestBuilder::new(stub))
5167 }
5168
5169 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5171 mut self,
5172 v: V,
5173 ) -> Self {
5174 self.0.request = v.into();
5175 self
5176 }
5177
5178 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5180 self.0.options = v.into();
5181 self
5182 }
5183
5184 pub async fn send(self) -> Result<()> {
5186 (*self.0.stub)
5187 .delete_operation(self.0.request, self.0.options)
5188 .await
5189 .map(crate::Response::into_body)
5190 }
5191
5192 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5194 self.0.request.name = v.into();
5195 self
5196 }
5197 }
5198
5199 #[doc(hidden)]
5200 impl crate::RequestBuilder for DeleteOperation {
5201 fn request_options(&mut self) -> &mut crate::RequestOptions {
5202 &mut self.0.options
5203 }
5204 }
5205
5206 #[derive(Clone, Debug)]
5223 pub struct CancelOperation(
5224 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5225 );
5226
5227 impl CancelOperation {
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::CancelOperationRequest>>(
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<()> {
5251 (*self.0.stub)
5252 .cancel_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 CancelOperation {
5266 fn request_options(&mut self) -> &mut crate::RequestOptions {
5267 &mut self.0.options
5268 }
5269 }
5270}
5271
5272pub mod hub_service {
5273 use crate::Result;
5274
5275 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5289
5290 pub(crate) mod client {
5291 use super::super::super::client::HubService;
5292 pub struct Factory;
5293 impl crate::ClientFactory for Factory {
5294 type Client = HubService;
5295 type Credentials = gaxi::options::Credentials;
5296 async fn build(
5297 self,
5298 config: gaxi::options::ClientConfig,
5299 ) -> crate::ClientBuilderResult<Self::Client> {
5300 Self::Client::new(config).await
5301 }
5302 }
5303 }
5304
5305 #[derive(Clone, Debug)]
5307 pub(crate) struct RequestBuilder<R: std::default::Default> {
5308 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5309 request: R,
5310 options: crate::RequestOptions,
5311 }
5312
5313 impl<R> RequestBuilder<R>
5314 where
5315 R: std::default::Default,
5316 {
5317 pub(crate) fn new(
5318 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5319 ) -> Self {
5320 Self {
5321 stub,
5322 request: R::default(),
5323 options: crate::RequestOptions::default(),
5324 }
5325 }
5326 }
5327
5328 #[derive(Clone, Debug)]
5349 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5350
5351 impl ListHubs {
5352 pub(crate) fn new(
5353 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5354 ) -> Self {
5355 Self(RequestBuilder::new(stub))
5356 }
5357
5358 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5360 self.0.request = v.into();
5361 self
5362 }
5363
5364 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5366 self.0.options = v.into();
5367 self
5368 }
5369
5370 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5372 (*self.0.stub)
5373 .list_hubs(self.0.request, self.0.options)
5374 .await
5375 .map(crate::Response::into_body)
5376 }
5377
5378 pub fn by_page(
5380 self,
5381 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubsResponse, crate::Error>
5382 {
5383 use std::clone::Clone;
5384 let token = self.0.request.page_token.clone();
5385 let execute = move |token: String| {
5386 let mut builder = self.clone();
5387 builder.0.request = builder.0.request.set_page_token(token);
5388 builder.send()
5389 };
5390 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5391 }
5392
5393 pub fn by_item(
5395 self,
5396 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHubsResponse, crate::Error>
5397 {
5398 use google_cloud_gax::paginator::Paginator;
5399 self.by_page().items()
5400 }
5401
5402 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5406 self.0.request.parent = v.into();
5407 self
5408 }
5409
5410 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5412 self.0.request.page_size = v.into();
5413 self
5414 }
5415
5416 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5418 self.0.request.page_token = v.into();
5419 self
5420 }
5421
5422 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5424 self.0.request.filter = v.into();
5425 self
5426 }
5427
5428 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5430 self.0.request.order_by = v.into();
5431 self
5432 }
5433 }
5434
5435 #[doc(hidden)]
5436 impl crate::RequestBuilder for ListHubs {
5437 fn request_options(&mut self) -> &mut crate::RequestOptions {
5438 &mut self.0.options
5439 }
5440 }
5441
5442 #[derive(Clone, Debug)]
5459 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5460
5461 impl GetHub {
5462 pub(crate) fn new(
5463 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5464 ) -> Self {
5465 Self(RequestBuilder::new(stub))
5466 }
5467
5468 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5470 self.0.request = v.into();
5471 self
5472 }
5473
5474 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5476 self.0.options = v.into();
5477 self
5478 }
5479
5480 pub async fn send(self) -> Result<crate::model::Hub> {
5482 (*self.0.stub)
5483 .get_hub(self.0.request, self.0.options)
5484 .await
5485 .map(crate::Response::into_body)
5486 }
5487
5488 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5492 self.0.request.name = v.into();
5493 self
5494 }
5495 }
5496
5497 #[doc(hidden)]
5498 impl crate::RequestBuilder for GetHub {
5499 fn request_options(&mut self) -> &mut crate::RequestOptions {
5500 &mut self.0.options
5501 }
5502 }
5503
5504 #[derive(Clone, Debug)]
5522 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5523
5524 impl CreateHub {
5525 pub(crate) fn new(
5526 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5527 ) -> Self {
5528 Self(RequestBuilder::new(stub))
5529 }
5530
5531 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5533 self.0.request = v.into();
5534 self
5535 }
5536
5537 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5539 self.0.options = v.into();
5540 self
5541 }
5542
5543 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5550 (*self.0.stub)
5551 .create_hub(self.0.request, self.0.options)
5552 .await
5553 .map(crate::Response::into_body)
5554 }
5555
5556 pub fn poller(
5558 self,
5559 ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5560 {
5561 type Operation = google_cloud_lro::internal::Operation<
5562 crate::model::Hub,
5563 crate::model::OperationMetadata,
5564 >;
5565 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5566 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5567
5568 let stub = self.0.stub.clone();
5569 let mut options = self.0.options.clone();
5570 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5571 let query = move |name| {
5572 let stub = stub.clone();
5573 let options = options.clone();
5574 async {
5575 let op = GetOperation::new(stub)
5576 .set_name(name)
5577 .with_options(options)
5578 .send()
5579 .await?;
5580 Ok(Operation::new(op))
5581 }
5582 };
5583
5584 let start = move || async {
5585 let op = self.send().await?;
5586 Ok(Operation::new(op))
5587 };
5588
5589 google_cloud_lro::internal::new_poller(
5590 polling_error_policy,
5591 polling_backoff_policy,
5592 start,
5593 query,
5594 )
5595 }
5596
5597 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5601 self.0.request.parent = v.into();
5602 self
5603 }
5604
5605 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5609 self.0.request.hub_id = v.into();
5610 self
5611 }
5612
5613 pub fn set_hub<T>(mut self, v: T) -> Self
5617 where
5618 T: std::convert::Into<crate::model::Hub>,
5619 {
5620 self.0.request.hub = std::option::Option::Some(v.into());
5621 self
5622 }
5623
5624 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5628 where
5629 T: std::convert::Into<crate::model::Hub>,
5630 {
5631 self.0.request.hub = v.map(|x| x.into());
5632 self
5633 }
5634
5635 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5637 self.0.request.request_id = v.into();
5638 self
5639 }
5640 }
5641
5642 #[doc(hidden)]
5643 impl crate::RequestBuilder for CreateHub {
5644 fn request_options(&mut self) -> &mut crate::RequestOptions {
5645 &mut self.0.options
5646 }
5647 }
5648
5649 #[derive(Clone, Debug)]
5667 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5668
5669 impl UpdateHub {
5670 pub(crate) fn new(
5671 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5672 ) -> Self {
5673 Self(RequestBuilder::new(stub))
5674 }
5675
5676 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5678 self.0.request = v.into();
5679 self
5680 }
5681
5682 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5684 self.0.options = v.into();
5685 self
5686 }
5687
5688 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5695 (*self.0.stub)
5696 .update_hub(self.0.request, self.0.options)
5697 .await
5698 .map(crate::Response::into_body)
5699 }
5700
5701 pub fn poller(
5703 self,
5704 ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5705 {
5706 type Operation = google_cloud_lro::internal::Operation<
5707 crate::model::Hub,
5708 crate::model::OperationMetadata,
5709 >;
5710 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5711 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5712
5713 let stub = self.0.stub.clone();
5714 let mut options = self.0.options.clone();
5715 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5716 let query = move |name| {
5717 let stub = stub.clone();
5718 let options = options.clone();
5719 async {
5720 let op = GetOperation::new(stub)
5721 .set_name(name)
5722 .with_options(options)
5723 .send()
5724 .await?;
5725 Ok(Operation::new(op))
5726 }
5727 };
5728
5729 let start = move || async {
5730 let op = self.send().await?;
5731 Ok(Operation::new(op))
5732 };
5733
5734 google_cloud_lro::internal::new_poller(
5735 polling_error_policy,
5736 polling_backoff_policy,
5737 start,
5738 query,
5739 )
5740 }
5741
5742 pub fn set_update_mask<T>(mut self, v: T) -> Self
5744 where
5745 T: std::convert::Into<wkt::FieldMask>,
5746 {
5747 self.0.request.update_mask = std::option::Option::Some(v.into());
5748 self
5749 }
5750
5751 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5753 where
5754 T: std::convert::Into<wkt::FieldMask>,
5755 {
5756 self.0.request.update_mask = v.map(|x| x.into());
5757 self
5758 }
5759
5760 pub fn set_hub<T>(mut self, v: T) -> Self
5764 where
5765 T: std::convert::Into<crate::model::Hub>,
5766 {
5767 self.0.request.hub = std::option::Option::Some(v.into());
5768 self
5769 }
5770
5771 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5775 where
5776 T: std::convert::Into<crate::model::Hub>,
5777 {
5778 self.0.request.hub = v.map(|x| x.into());
5779 self
5780 }
5781
5782 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5784 self.0.request.request_id = v.into();
5785 self
5786 }
5787 }
5788
5789 #[doc(hidden)]
5790 impl crate::RequestBuilder for UpdateHub {
5791 fn request_options(&mut self) -> &mut crate::RequestOptions {
5792 &mut self.0.options
5793 }
5794 }
5795
5796 #[derive(Clone, Debug)]
5814 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5815
5816 impl DeleteHub {
5817 pub(crate) fn new(
5818 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5819 ) -> Self {
5820 Self(RequestBuilder::new(stub))
5821 }
5822
5823 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5825 self.0.request = v.into();
5826 self
5827 }
5828
5829 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5831 self.0.options = v.into();
5832 self
5833 }
5834
5835 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5842 (*self.0.stub)
5843 .delete_hub(self.0.request, self.0.options)
5844 .await
5845 .map(crate::Response::into_body)
5846 }
5847
5848 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5850 type Operation =
5851 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5852 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5853 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5854
5855 let stub = self.0.stub.clone();
5856 let mut options = self.0.options.clone();
5857 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5858 let query = move |name| {
5859 let stub = stub.clone();
5860 let options = options.clone();
5861 async {
5862 let op = GetOperation::new(stub)
5863 .set_name(name)
5864 .with_options(options)
5865 .send()
5866 .await?;
5867 Ok(Operation::new(op))
5868 }
5869 };
5870
5871 let start = move || async {
5872 let op = self.send().await?;
5873 Ok(Operation::new(op))
5874 };
5875
5876 google_cloud_lro::internal::new_unit_response_poller(
5877 polling_error_policy,
5878 polling_backoff_policy,
5879 start,
5880 query,
5881 )
5882 }
5883
5884 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5888 self.0.request.name = v.into();
5889 self
5890 }
5891
5892 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5894 self.0.request.request_id = v.into();
5895 self
5896 }
5897 }
5898
5899 #[doc(hidden)]
5900 impl crate::RequestBuilder for DeleteHub {
5901 fn request_options(&mut self) -> &mut crate::RequestOptions {
5902 &mut self.0.options
5903 }
5904 }
5905
5906 #[derive(Clone, Debug)]
5927 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5928
5929 impl ListHubSpokes {
5930 pub(crate) fn new(
5931 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5932 ) -> Self {
5933 Self(RequestBuilder::new(stub))
5934 }
5935
5936 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5938 self.0.request = v.into();
5939 self
5940 }
5941
5942 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5944 self.0.options = v.into();
5945 self
5946 }
5947
5948 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5950 (*self.0.stub)
5951 .list_hub_spokes(self.0.request, self.0.options)
5952 .await
5953 .map(crate::Response::into_body)
5954 }
5955
5956 pub fn by_page(
5958 self,
5959 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubSpokesResponse, crate::Error>
5960 {
5961 use std::clone::Clone;
5962 let token = self.0.request.page_token.clone();
5963 let execute = move |token: String| {
5964 let mut builder = self.clone();
5965 builder.0.request = builder.0.request.set_page_token(token);
5966 builder.send()
5967 };
5968 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5969 }
5970
5971 pub fn by_item(
5973 self,
5974 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5975 crate::model::ListHubSpokesResponse,
5976 crate::Error,
5977 > {
5978 use google_cloud_gax::paginator::Paginator;
5979 self.by_page().items()
5980 }
5981
5982 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5986 self.0.request.name = v.into();
5987 self
5988 }
5989
5990 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5992 where
5993 T: std::iter::IntoIterator<Item = V>,
5994 V: std::convert::Into<std::string::String>,
5995 {
5996 use std::iter::Iterator;
5997 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5998 self
5999 }
6000
6001 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6003 self.0.request.page_size = v.into();
6004 self
6005 }
6006
6007 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6009 self.0.request.page_token = v.into();
6010 self
6011 }
6012
6013 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6015 self.0.request.filter = v.into();
6016 self
6017 }
6018
6019 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6021 self.0.request.order_by = v.into();
6022 self
6023 }
6024
6025 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
6027 mut self,
6028 v: T,
6029 ) -> Self {
6030 self.0.request.view = v.into();
6031 self
6032 }
6033 }
6034
6035 #[doc(hidden)]
6036 impl crate::RequestBuilder for ListHubSpokes {
6037 fn request_options(&mut self) -> &mut crate::RequestOptions {
6038 &mut self.0.options
6039 }
6040 }
6041
6042 #[derive(Clone, Debug)]
6063 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
6064
6065 impl QueryHubStatus {
6066 pub(crate) fn new(
6067 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6068 ) -> Self {
6069 Self(RequestBuilder::new(stub))
6070 }
6071
6072 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
6074 self.0.request = v.into();
6075 self
6076 }
6077
6078 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6080 self.0.options = v.into();
6081 self
6082 }
6083
6084 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
6086 (*self.0.stub)
6087 .query_hub_status(self.0.request, self.0.options)
6088 .await
6089 .map(crate::Response::into_body)
6090 }
6091
6092 pub fn by_page(
6094 self,
6095 ) -> impl google_cloud_gax::paginator::Paginator<
6096 crate::model::QueryHubStatusResponse,
6097 crate::Error,
6098 > {
6099 use std::clone::Clone;
6100 let token = self.0.request.page_token.clone();
6101 let execute = move |token: String| {
6102 let mut builder = self.clone();
6103 builder.0.request = builder.0.request.set_page_token(token);
6104 builder.send()
6105 };
6106 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6107 }
6108
6109 pub fn by_item(
6111 self,
6112 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6113 crate::model::QueryHubStatusResponse,
6114 crate::Error,
6115 > {
6116 use google_cloud_gax::paginator::Paginator;
6117 self.by_page().items()
6118 }
6119
6120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6124 self.0.request.name = v.into();
6125 self
6126 }
6127
6128 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6130 self.0.request.page_size = v.into();
6131 self
6132 }
6133
6134 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6136 self.0.request.page_token = v.into();
6137 self
6138 }
6139
6140 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6142 self.0.request.filter = v.into();
6143 self
6144 }
6145
6146 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6148 self.0.request.order_by = v.into();
6149 self
6150 }
6151
6152 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6154 self.0.request.group_by = v.into();
6155 self
6156 }
6157 }
6158
6159 #[doc(hidden)]
6160 impl crate::RequestBuilder for QueryHubStatus {
6161 fn request_options(&mut self) -> &mut crate::RequestOptions {
6162 &mut self.0.options
6163 }
6164 }
6165
6166 #[derive(Clone, Debug)]
6187 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6188
6189 impl ListSpokes {
6190 pub(crate) fn new(
6191 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6192 ) -> Self {
6193 Self(RequestBuilder::new(stub))
6194 }
6195
6196 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6198 self.0.request = v.into();
6199 self
6200 }
6201
6202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6204 self.0.options = v.into();
6205 self
6206 }
6207
6208 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6210 (*self.0.stub)
6211 .list_spokes(self.0.request, self.0.options)
6212 .await
6213 .map(crate::Response::into_body)
6214 }
6215
6216 pub fn by_page(
6218 self,
6219 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSpokesResponse, crate::Error>
6220 {
6221 use std::clone::Clone;
6222 let token = self.0.request.page_token.clone();
6223 let execute = move |token: String| {
6224 let mut builder = self.clone();
6225 builder.0.request = builder.0.request.set_page_token(token);
6226 builder.send()
6227 };
6228 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6229 }
6230
6231 pub fn by_item(
6233 self,
6234 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6235 crate::model::ListSpokesResponse,
6236 crate::Error,
6237 > {
6238 use google_cloud_gax::paginator::Paginator;
6239 self.by_page().items()
6240 }
6241
6242 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6246 self.0.request.parent = v.into();
6247 self
6248 }
6249
6250 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6252 self.0.request.page_size = v.into();
6253 self
6254 }
6255
6256 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6258 self.0.request.page_token = v.into();
6259 self
6260 }
6261
6262 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6264 self.0.request.filter = v.into();
6265 self
6266 }
6267
6268 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6270 self.0.request.order_by = v.into();
6271 self
6272 }
6273 }
6274
6275 #[doc(hidden)]
6276 impl crate::RequestBuilder for ListSpokes {
6277 fn request_options(&mut self) -> &mut crate::RequestOptions {
6278 &mut self.0.options
6279 }
6280 }
6281
6282 #[derive(Clone, Debug)]
6299 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6300
6301 impl GetSpoke {
6302 pub(crate) fn new(
6303 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6304 ) -> Self {
6305 Self(RequestBuilder::new(stub))
6306 }
6307
6308 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6310 self.0.request = v.into();
6311 self
6312 }
6313
6314 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6316 self.0.options = v.into();
6317 self
6318 }
6319
6320 pub async fn send(self) -> Result<crate::model::Spoke> {
6322 (*self.0.stub)
6323 .get_spoke(self.0.request, self.0.options)
6324 .await
6325 .map(crate::Response::into_body)
6326 }
6327
6328 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6332 self.0.request.name = v.into();
6333 self
6334 }
6335 }
6336
6337 #[doc(hidden)]
6338 impl crate::RequestBuilder for GetSpoke {
6339 fn request_options(&mut self) -> &mut crate::RequestOptions {
6340 &mut self.0.options
6341 }
6342 }
6343
6344 #[derive(Clone, Debug)]
6362 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6363
6364 impl CreateSpoke {
6365 pub(crate) fn new(
6366 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6367 ) -> Self {
6368 Self(RequestBuilder::new(stub))
6369 }
6370
6371 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6373 self.0.request = v.into();
6374 self
6375 }
6376
6377 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6379 self.0.options = v.into();
6380 self
6381 }
6382
6383 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6390 (*self.0.stub)
6391 .create_spoke(self.0.request, self.0.options)
6392 .await
6393 .map(crate::Response::into_body)
6394 }
6395
6396 pub fn poller(
6398 self,
6399 ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6400 {
6401 type Operation = google_cloud_lro::internal::Operation<
6402 crate::model::Spoke,
6403 crate::model::OperationMetadata,
6404 >;
6405 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6406 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6407
6408 let stub = self.0.stub.clone();
6409 let mut options = self.0.options.clone();
6410 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6411 let query = move |name| {
6412 let stub = stub.clone();
6413 let options = options.clone();
6414 async {
6415 let op = GetOperation::new(stub)
6416 .set_name(name)
6417 .with_options(options)
6418 .send()
6419 .await?;
6420 Ok(Operation::new(op))
6421 }
6422 };
6423
6424 let start = move || async {
6425 let op = self.send().await?;
6426 Ok(Operation::new(op))
6427 };
6428
6429 google_cloud_lro::internal::new_poller(
6430 polling_error_policy,
6431 polling_backoff_policy,
6432 start,
6433 query,
6434 )
6435 }
6436
6437 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6441 self.0.request.parent = v.into();
6442 self
6443 }
6444
6445 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6449 self.0.request.spoke_id = v.into();
6450 self
6451 }
6452
6453 pub fn set_spoke<T>(mut self, v: T) -> Self
6457 where
6458 T: std::convert::Into<crate::model::Spoke>,
6459 {
6460 self.0.request.spoke = std::option::Option::Some(v.into());
6461 self
6462 }
6463
6464 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6468 where
6469 T: std::convert::Into<crate::model::Spoke>,
6470 {
6471 self.0.request.spoke = v.map(|x| x.into());
6472 self
6473 }
6474
6475 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6477 self.0.request.request_id = v.into();
6478 self
6479 }
6480 }
6481
6482 #[doc(hidden)]
6483 impl crate::RequestBuilder for CreateSpoke {
6484 fn request_options(&mut self) -> &mut crate::RequestOptions {
6485 &mut self.0.options
6486 }
6487 }
6488
6489 #[derive(Clone, Debug)]
6507 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6508
6509 impl UpdateSpoke {
6510 pub(crate) fn new(
6511 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6512 ) -> Self {
6513 Self(RequestBuilder::new(stub))
6514 }
6515
6516 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6518 self.0.request = v.into();
6519 self
6520 }
6521
6522 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6524 self.0.options = v.into();
6525 self
6526 }
6527
6528 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6535 (*self.0.stub)
6536 .update_spoke(self.0.request, self.0.options)
6537 .await
6538 .map(crate::Response::into_body)
6539 }
6540
6541 pub fn poller(
6543 self,
6544 ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6545 {
6546 type Operation = google_cloud_lro::internal::Operation<
6547 crate::model::Spoke,
6548 crate::model::OperationMetadata,
6549 >;
6550 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6551 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6552
6553 let stub = self.0.stub.clone();
6554 let mut options = self.0.options.clone();
6555 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6556 let query = move |name| {
6557 let stub = stub.clone();
6558 let options = options.clone();
6559 async {
6560 let op = GetOperation::new(stub)
6561 .set_name(name)
6562 .with_options(options)
6563 .send()
6564 .await?;
6565 Ok(Operation::new(op))
6566 }
6567 };
6568
6569 let start = move || async {
6570 let op = self.send().await?;
6571 Ok(Operation::new(op))
6572 };
6573
6574 google_cloud_lro::internal::new_poller(
6575 polling_error_policy,
6576 polling_backoff_policy,
6577 start,
6578 query,
6579 )
6580 }
6581
6582 pub fn set_update_mask<T>(mut self, v: T) -> Self
6584 where
6585 T: std::convert::Into<wkt::FieldMask>,
6586 {
6587 self.0.request.update_mask = std::option::Option::Some(v.into());
6588 self
6589 }
6590
6591 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6593 where
6594 T: std::convert::Into<wkt::FieldMask>,
6595 {
6596 self.0.request.update_mask = v.map(|x| x.into());
6597 self
6598 }
6599
6600 pub fn set_spoke<T>(mut self, v: T) -> Self
6604 where
6605 T: std::convert::Into<crate::model::Spoke>,
6606 {
6607 self.0.request.spoke = std::option::Option::Some(v.into());
6608 self
6609 }
6610
6611 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6615 where
6616 T: std::convert::Into<crate::model::Spoke>,
6617 {
6618 self.0.request.spoke = v.map(|x| x.into());
6619 self
6620 }
6621
6622 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6624 self.0.request.request_id = v.into();
6625 self
6626 }
6627 }
6628
6629 #[doc(hidden)]
6630 impl crate::RequestBuilder for UpdateSpoke {
6631 fn request_options(&mut self) -> &mut crate::RequestOptions {
6632 &mut self.0.options
6633 }
6634 }
6635
6636 #[derive(Clone, Debug)]
6654 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6655
6656 impl RejectHubSpoke {
6657 pub(crate) fn new(
6658 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6659 ) -> Self {
6660 Self(RequestBuilder::new(stub))
6661 }
6662
6663 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6665 self.0.request = v.into();
6666 self
6667 }
6668
6669 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6671 self.0.options = v.into();
6672 self
6673 }
6674
6675 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6682 (*self.0.stub)
6683 .reject_hub_spoke(self.0.request, self.0.options)
6684 .await
6685 .map(crate::Response::into_body)
6686 }
6687
6688 pub fn poller(
6690 self,
6691 ) -> impl google_cloud_lro::Poller<
6692 crate::model::RejectHubSpokeResponse,
6693 crate::model::OperationMetadata,
6694 > {
6695 type Operation = google_cloud_lro::internal::Operation<
6696 crate::model::RejectHubSpokeResponse,
6697 crate::model::OperationMetadata,
6698 >;
6699 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6700 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6701
6702 let stub = self.0.stub.clone();
6703 let mut options = self.0.options.clone();
6704 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6705 let query = move |name| {
6706 let stub = stub.clone();
6707 let options = options.clone();
6708 async {
6709 let op = GetOperation::new(stub)
6710 .set_name(name)
6711 .with_options(options)
6712 .send()
6713 .await?;
6714 Ok(Operation::new(op))
6715 }
6716 };
6717
6718 let start = move || async {
6719 let op = self.send().await?;
6720 Ok(Operation::new(op))
6721 };
6722
6723 google_cloud_lro::internal::new_poller(
6724 polling_error_policy,
6725 polling_backoff_policy,
6726 start,
6727 query,
6728 )
6729 }
6730
6731 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6735 self.0.request.name = v.into();
6736 self
6737 }
6738
6739 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6743 self.0.request.spoke_uri = v.into();
6744 self
6745 }
6746
6747 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6749 self.0.request.request_id = v.into();
6750 self
6751 }
6752
6753 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6755 self.0.request.details = v.into();
6756 self
6757 }
6758 }
6759
6760 #[doc(hidden)]
6761 impl crate::RequestBuilder for RejectHubSpoke {
6762 fn request_options(&mut self) -> &mut crate::RequestOptions {
6763 &mut self.0.options
6764 }
6765 }
6766
6767 #[derive(Clone, Debug)]
6785 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6786
6787 impl AcceptHubSpoke {
6788 pub(crate) fn new(
6789 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6790 ) -> Self {
6791 Self(RequestBuilder::new(stub))
6792 }
6793
6794 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6796 self.0.request = v.into();
6797 self
6798 }
6799
6800 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6802 self.0.options = v.into();
6803 self
6804 }
6805
6806 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6813 (*self.0.stub)
6814 .accept_hub_spoke(self.0.request, self.0.options)
6815 .await
6816 .map(crate::Response::into_body)
6817 }
6818
6819 pub fn poller(
6821 self,
6822 ) -> impl google_cloud_lro::Poller<
6823 crate::model::AcceptHubSpokeResponse,
6824 crate::model::OperationMetadata,
6825 > {
6826 type Operation = google_cloud_lro::internal::Operation<
6827 crate::model::AcceptHubSpokeResponse,
6828 crate::model::OperationMetadata,
6829 >;
6830 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6831 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6832
6833 let stub = self.0.stub.clone();
6834 let mut options = self.0.options.clone();
6835 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6836 let query = move |name| {
6837 let stub = stub.clone();
6838 let options = options.clone();
6839 async {
6840 let op = GetOperation::new(stub)
6841 .set_name(name)
6842 .with_options(options)
6843 .send()
6844 .await?;
6845 Ok(Operation::new(op))
6846 }
6847 };
6848
6849 let start = move || async {
6850 let op = self.send().await?;
6851 Ok(Operation::new(op))
6852 };
6853
6854 google_cloud_lro::internal::new_poller(
6855 polling_error_policy,
6856 polling_backoff_policy,
6857 start,
6858 query,
6859 )
6860 }
6861
6862 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6866 self.0.request.name = v.into();
6867 self
6868 }
6869
6870 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6874 self.0.request.spoke_uri = v.into();
6875 self
6876 }
6877
6878 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6880 self.0.request.request_id = v.into();
6881 self
6882 }
6883 }
6884
6885 #[doc(hidden)]
6886 impl crate::RequestBuilder for AcceptHubSpoke {
6887 fn request_options(&mut self) -> &mut crate::RequestOptions {
6888 &mut self.0.options
6889 }
6890 }
6891
6892 #[derive(Clone, Debug)]
6910 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6911
6912 impl AcceptSpokeUpdate {
6913 pub(crate) fn new(
6914 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6915 ) -> Self {
6916 Self(RequestBuilder::new(stub))
6917 }
6918
6919 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6921 mut self,
6922 v: V,
6923 ) -> Self {
6924 self.0.request = v.into();
6925 self
6926 }
6927
6928 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6930 self.0.options = v.into();
6931 self
6932 }
6933
6934 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6941 (*self.0.stub)
6942 .accept_spoke_update(self.0.request, self.0.options)
6943 .await
6944 .map(crate::Response::into_body)
6945 }
6946
6947 pub fn poller(
6949 self,
6950 ) -> impl google_cloud_lro::Poller<
6951 crate::model::AcceptSpokeUpdateResponse,
6952 crate::model::OperationMetadata,
6953 > {
6954 type Operation = google_cloud_lro::internal::Operation<
6955 crate::model::AcceptSpokeUpdateResponse,
6956 crate::model::OperationMetadata,
6957 >;
6958 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6959 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6960
6961 let stub = self.0.stub.clone();
6962 let mut options = self.0.options.clone();
6963 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6964 let query = move |name| {
6965 let stub = stub.clone();
6966 let options = options.clone();
6967 async {
6968 let op = GetOperation::new(stub)
6969 .set_name(name)
6970 .with_options(options)
6971 .send()
6972 .await?;
6973 Ok(Operation::new(op))
6974 }
6975 };
6976
6977 let start = move || async {
6978 let op = self.send().await?;
6979 Ok(Operation::new(op))
6980 };
6981
6982 google_cloud_lro::internal::new_poller(
6983 polling_error_policy,
6984 polling_backoff_policy,
6985 start,
6986 query,
6987 )
6988 }
6989
6990 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6994 self.0.request.name = v.into();
6995 self
6996 }
6997
6998 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7002 self.0.request.spoke_uri = v.into();
7003 self
7004 }
7005
7006 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7010 self.0.request.spoke_etag = v.into();
7011 self
7012 }
7013
7014 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7016 self.0.request.request_id = v.into();
7017 self
7018 }
7019 }
7020
7021 #[doc(hidden)]
7022 impl crate::RequestBuilder for AcceptSpokeUpdate {
7023 fn request_options(&mut self) -> &mut crate::RequestOptions {
7024 &mut self.0.options
7025 }
7026 }
7027
7028 #[derive(Clone, Debug)]
7046 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
7047
7048 impl RejectSpokeUpdate {
7049 pub(crate) fn new(
7050 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7051 ) -> Self {
7052 Self(RequestBuilder::new(stub))
7053 }
7054
7055 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
7057 mut self,
7058 v: V,
7059 ) -> Self {
7060 self.0.request = v.into();
7061 self
7062 }
7063
7064 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7066 self.0.options = v.into();
7067 self
7068 }
7069
7070 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7077 (*self.0.stub)
7078 .reject_spoke_update(self.0.request, self.0.options)
7079 .await
7080 .map(crate::Response::into_body)
7081 }
7082
7083 pub fn poller(
7085 self,
7086 ) -> impl google_cloud_lro::Poller<
7087 crate::model::RejectSpokeUpdateResponse,
7088 crate::model::OperationMetadata,
7089 > {
7090 type Operation = google_cloud_lro::internal::Operation<
7091 crate::model::RejectSpokeUpdateResponse,
7092 crate::model::OperationMetadata,
7093 >;
7094 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7095 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7096
7097 let stub = self.0.stub.clone();
7098 let mut options = self.0.options.clone();
7099 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7100 let query = move |name| {
7101 let stub = stub.clone();
7102 let options = options.clone();
7103 async {
7104 let op = GetOperation::new(stub)
7105 .set_name(name)
7106 .with_options(options)
7107 .send()
7108 .await?;
7109 Ok(Operation::new(op))
7110 }
7111 };
7112
7113 let start = move || async {
7114 let op = self.send().await?;
7115 Ok(Operation::new(op))
7116 };
7117
7118 google_cloud_lro::internal::new_poller(
7119 polling_error_policy,
7120 polling_backoff_policy,
7121 start,
7122 query,
7123 )
7124 }
7125
7126 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7130 self.0.request.name = v.into();
7131 self
7132 }
7133
7134 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7138 self.0.request.spoke_uri = v.into();
7139 self
7140 }
7141
7142 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7146 self.0.request.spoke_etag = v.into();
7147 self
7148 }
7149
7150 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7152 self.0.request.details = v.into();
7153 self
7154 }
7155
7156 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7158 self.0.request.request_id = v.into();
7159 self
7160 }
7161 }
7162
7163 #[doc(hidden)]
7164 impl crate::RequestBuilder for RejectSpokeUpdate {
7165 fn request_options(&mut self) -> &mut crate::RequestOptions {
7166 &mut self.0.options
7167 }
7168 }
7169
7170 #[derive(Clone, Debug)]
7188 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7189
7190 impl DeleteSpoke {
7191 pub(crate) fn new(
7192 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7193 ) -> Self {
7194 Self(RequestBuilder::new(stub))
7195 }
7196
7197 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7199 self.0.request = v.into();
7200 self
7201 }
7202
7203 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7205 self.0.options = v.into();
7206 self
7207 }
7208
7209 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7216 (*self.0.stub)
7217 .delete_spoke(self.0.request, self.0.options)
7218 .await
7219 .map(crate::Response::into_body)
7220 }
7221
7222 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7224 type Operation =
7225 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7226 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7227 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7228
7229 let stub = self.0.stub.clone();
7230 let mut options = self.0.options.clone();
7231 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7232 let query = move |name| {
7233 let stub = stub.clone();
7234 let options = options.clone();
7235 async {
7236 let op = GetOperation::new(stub)
7237 .set_name(name)
7238 .with_options(options)
7239 .send()
7240 .await?;
7241 Ok(Operation::new(op))
7242 }
7243 };
7244
7245 let start = move || async {
7246 let op = self.send().await?;
7247 Ok(Operation::new(op))
7248 };
7249
7250 google_cloud_lro::internal::new_unit_response_poller(
7251 polling_error_policy,
7252 polling_backoff_policy,
7253 start,
7254 query,
7255 )
7256 }
7257
7258 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7262 self.0.request.name = v.into();
7263 self
7264 }
7265
7266 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7268 self.0.request.request_id = v.into();
7269 self
7270 }
7271 }
7272
7273 #[doc(hidden)]
7274 impl crate::RequestBuilder for DeleteSpoke {
7275 fn request_options(&mut self) -> &mut crate::RequestOptions {
7276 &mut self.0.options
7277 }
7278 }
7279
7280 #[derive(Clone, Debug)]
7297 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7298
7299 impl GetRouteTable {
7300 pub(crate) fn new(
7301 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7302 ) -> Self {
7303 Self(RequestBuilder::new(stub))
7304 }
7305
7306 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7308 self.0.request = v.into();
7309 self
7310 }
7311
7312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7314 self.0.options = v.into();
7315 self
7316 }
7317
7318 pub async fn send(self) -> Result<crate::model::RouteTable> {
7320 (*self.0.stub)
7321 .get_route_table(self.0.request, self.0.options)
7322 .await
7323 .map(crate::Response::into_body)
7324 }
7325
7326 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7330 self.0.request.name = v.into();
7331 self
7332 }
7333 }
7334
7335 #[doc(hidden)]
7336 impl crate::RequestBuilder for GetRouteTable {
7337 fn request_options(&mut self) -> &mut crate::RequestOptions {
7338 &mut self.0.options
7339 }
7340 }
7341
7342 #[derive(Clone, Debug)]
7359 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7360
7361 impl GetRoute {
7362 pub(crate) fn new(
7363 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7364 ) -> Self {
7365 Self(RequestBuilder::new(stub))
7366 }
7367
7368 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7370 self.0.request = v.into();
7371 self
7372 }
7373
7374 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7376 self.0.options = v.into();
7377 self
7378 }
7379
7380 pub async fn send(self) -> Result<crate::model::Route> {
7382 (*self.0.stub)
7383 .get_route(self.0.request, self.0.options)
7384 .await
7385 .map(crate::Response::into_body)
7386 }
7387
7388 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7392 self.0.request.name = v.into();
7393 self
7394 }
7395 }
7396
7397 #[doc(hidden)]
7398 impl crate::RequestBuilder for GetRoute {
7399 fn request_options(&mut self) -> &mut crate::RequestOptions {
7400 &mut self.0.options
7401 }
7402 }
7403
7404 #[derive(Clone, Debug)]
7425 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7426
7427 impl ListRoutes {
7428 pub(crate) fn new(
7429 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7430 ) -> Self {
7431 Self(RequestBuilder::new(stub))
7432 }
7433
7434 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7436 self.0.request = v.into();
7437 self
7438 }
7439
7440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7442 self.0.options = v.into();
7443 self
7444 }
7445
7446 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7448 (*self.0.stub)
7449 .list_routes(self.0.request, self.0.options)
7450 .await
7451 .map(crate::Response::into_body)
7452 }
7453
7454 pub fn by_page(
7456 self,
7457 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutesResponse, crate::Error>
7458 {
7459 use std::clone::Clone;
7460 let token = self.0.request.page_token.clone();
7461 let execute = move |token: String| {
7462 let mut builder = self.clone();
7463 builder.0.request = builder.0.request.set_page_token(token);
7464 builder.send()
7465 };
7466 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7467 }
7468
7469 pub fn by_item(
7471 self,
7472 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7473 crate::model::ListRoutesResponse,
7474 crate::Error,
7475 > {
7476 use google_cloud_gax::paginator::Paginator;
7477 self.by_page().items()
7478 }
7479
7480 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7484 self.0.request.parent = v.into();
7485 self
7486 }
7487
7488 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7490 self.0.request.page_size = v.into();
7491 self
7492 }
7493
7494 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7496 self.0.request.page_token = v.into();
7497 self
7498 }
7499
7500 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7502 self.0.request.filter = v.into();
7503 self
7504 }
7505
7506 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7508 self.0.request.order_by = v.into();
7509 self
7510 }
7511 }
7512
7513 #[doc(hidden)]
7514 impl crate::RequestBuilder for ListRoutes {
7515 fn request_options(&mut self) -> &mut crate::RequestOptions {
7516 &mut self.0.options
7517 }
7518 }
7519
7520 #[derive(Clone, Debug)]
7541 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7542
7543 impl ListRouteTables {
7544 pub(crate) fn new(
7545 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7546 ) -> Self {
7547 Self(RequestBuilder::new(stub))
7548 }
7549
7550 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7552 self.0.request = v.into();
7553 self
7554 }
7555
7556 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7558 self.0.options = v.into();
7559 self
7560 }
7561
7562 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7564 (*self.0.stub)
7565 .list_route_tables(self.0.request, self.0.options)
7566 .await
7567 .map(crate::Response::into_body)
7568 }
7569
7570 pub fn by_page(
7572 self,
7573 ) -> impl google_cloud_gax::paginator::Paginator<
7574 crate::model::ListRouteTablesResponse,
7575 crate::Error,
7576 > {
7577 use std::clone::Clone;
7578 let token = self.0.request.page_token.clone();
7579 let execute = move |token: String| {
7580 let mut builder = self.clone();
7581 builder.0.request = builder.0.request.set_page_token(token);
7582 builder.send()
7583 };
7584 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7585 }
7586
7587 pub fn by_item(
7589 self,
7590 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7591 crate::model::ListRouteTablesResponse,
7592 crate::Error,
7593 > {
7594 use google_cloud_gax::paginator::Paginator;
7595 self.by_page().items()
7596 }
7597
7598 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7602 self.0.request.parent = v.into();
7603 self
7604 }
7605
7606 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7608 self.0.request.page_size = v.into();
7609 self
7610 }
7611
7612 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7614 self.0.request.page_token = v.into();
7615 self
7616 }
7617
7618 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7620 self.0.request.filter = v.into();
7621 self
7622 }
7623
7624 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7626 self.0.request.order_by = v.into();
7627 self
7628 }
7629 }
7630
7631 #[doc(hidden)]
7632 impl crate::RequestBuilder for ListRouteTables {
7633 fn request_options(&mut self) -> &mut crate::RequestOptions {
7634 &mut self.0.options
7635 }
7636 }
7637
7638 #[derive(Clone, Debug)]
7655 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7656
7657 impl GetGroup {
7658 pub(crate) fn new(
7659 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7660 ) -> Self {
7661 Self(RequestBuilder::new(stub))
7662 }
7663
7664 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7666 self.0.request = v.into();
7667 self
7668 }
7669
7670 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7672 self.0.options = v.into();
7673 self
7674 }
7675
7676 pub async fn send(self) -> Result<crate::model::Group> {
7678 (*self.0.stub)
7679 .get_group(self.0.request, self.0.options)
7680 .await
7681 .map(crate::Response::into_body)
7682 }
7683
7684 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7688 self.0.request.name = v.into();
7689 self
7690 }
7691 }
7692
7693 #[doc(hidden)]
7694 impl crate::RequestBuilder for GetGroup {
7695 fn request_options(&mut self) -> &mut crate::RequestOptions {
7696 &mut self.0.options
7697 }
7698 }
7699
7700 #[derive(Clone, Debug)]
7721 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7722
7723 impl ListGroups {
7724 pub(crate) fn new(
7725 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7726 ) -> Self {
7727 Self(RequestBuilder::new(stub))
7728 }
7729
7730 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7732 self.0.request = v.into();
7733 self
7734 }
7735
7736 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7738 self.0.options = v.into();
7739 self
7740 }
7741
7742 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7744 (*self.0.stub)
7745 .list_groups(self.0.request, self.0.options)
7746 .await
7747 .map(crate::Response::into_body)
7748 }
7749
7750 pub fn by_page(
7752 self,
7753 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListGroupsResponse, crate::Error>
7754 {
7755 use std::clone::Clone;
7756 let token = self.0.request.page_token.clone();
7757 let execute = move |token: String| {
7758 let mut builder = self.clone();
7759 builder.0.request = builder.0.request.set_page_token(token);
7760 builder.send()
7761 };
7762 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7763 }
7764
7765 pub fn by_item(
7767 self,
7768 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7769 crate::model::ListGroupsResponse,
7770 crate::Error,
7771 > {
7772 use google_cloud_gax::paginator::Paginator;
7773 self.by_page().items()
7774 }
7775
7776 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7780 self.0.request.parent = v.into();
7781 self
7782 }
7783
7784 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7786 self.0.request.page_size = v.into();
7787 self
7788 }
7789
7790 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7792 self.0.request.page_token = v.into();
7793 self
7794 }
7795
7796 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7798 self.0.request.filter = v.into();
7799 self
7800 }
7801
7802 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7804 self.0.request.order_by = v.into();
7805 self
7806 }
7807 }
7808
7809 #[doc(hidden)]
7810 impl crate::RequestBuilder for ListGroups {
7811 fn request_options(&mut self) -> &mut crate::RequestOptions {
7812 &mut self.0.options
7813 }
7814 }
7815
7816 #[derive(Clone, Debug)]
7834 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7835
7836 impl UpdateGroup {
7837 pub(crate) fn new(
7838 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7839 ) -> Self {
7840 Self(RequestBuilder::new(stub))
7841 }
7842
7843 pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7845 self.0.request = v.into();
7846 self
7847 }
7848
7849 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7851 self.0.options = v.into();
7852 self
7853 }
7854
7855 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7862 (*self.0.stub)
7863 .update_group(self.0.request, self.0.options)
7864 .await
7865 .map(crate::Response::into_body)
7866 }
7867
7868 pub fn poller(
7870 self,
7871 ) -> impl google_cloud_lro::Poller<crate::model::Group, crate::model::OperationMetadata>
7872 {
7873 type Operation = google_cloud_lro::internal::Operation<
7874 crate::model::Group,
7875 crate::model::OperationMetadata,
7876 >;
7877 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7878 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7879
7880 let stub = self.0.stub.clone();
7881 let mut options = self.0.options.clone();
7882 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7883 let query = move |name| {
7884 let stub = stub.clone();
7885 let options = options.clone();
7886 async {
7887 let op = GetOperation::new(stub)
7888 .set_name(name)
7889 .with_options(options)
7890 .send()
7891 .await?;
7892 Ok(Operation::new(op))
7893 }
7894 };
7895
7896 let start = move || async {
7897 let op = self.send().await?;
7898 Ok(Operation::new(op))
7899 };
7900
7901 google_cloud_lro::internal::new_poller(
7902 polling_error_policy,
7903 polling_backoff_policy,
7904 start,
7905 query,
7906 )
7907 }
7908
7909 pub fn set_update_mask<T>(mut self, v: T) -> Self
7911 where
7912 T: std::convert::Into<wkt::FieldMask>,
7913 {
7914 self.0.request.update_mask = std::option::Option::Some(v.into());
7915 self
7916 }
7917
7918 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7920 where
7921 T: std::convert::Into<wkt::FieldMask>,
7922 {
7923 self.0.request.update_mask = v.map(|x| x.into());
7924 self
7925 }
7926
7927 pub fn set_group<T>(mut self, v: T) -> Self
7931 where
7932 T: std::convert::Into<crate::model::Group>,
7933 {
7934 self.0.request.group = std::option::Option::Some(v.into());
7935 self
7936 }
7937
7938 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7942 where
7943 T: std::convert::Into<crate::model::Group>,
7944 {
7945 self.0.request.group = v.map(|x| x.into());
7946 self
7947 }
7948
7949 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7951 self.0.request.request_id = v.into();
7952 self
7953 }
7954 }
7955
7956 #[doc(hidden)]
7957 impl crate::RequestBuilder for UpdateGroup {
7958 fn request_options(&mut self) -> &mut crate::RequestOptions {
7959 &mut self.0.options
7960 }
7961 }
7962
7963 #[derive(Clone, Debug)]
7984 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7985
7986 impl ListLocations {
7987 pub(crate) fn new(
7988 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7989 ) -> Self {
7990 Self(RequestBuilder::new(stub))
7991 }
7992
7993 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7995 mut self,
7996 v: V,
7997 ) -> Self {
7998 self.0.request = v.into();
7999 self
8000 }
8001
8002 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8004 self.0.options = v.into();
8005 self
8006 }
8007
8008 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8010 (*self.0.stub)
8011 .list_locations(self.0.request, self.0.options)
8012 .await
8013 .map(crate::Response::into_body)
8014 }
8015
8016 pub fn by_page(
8018 self,
8019 ) -> impl google_cloud_gax::paginator::Paginator<
8020 google_cloud_location::model::ListLocationsResponse,
8021 crate::Error,
8022 > {
8023 use std::clone::Clone;
8024 let token = self.0.request.page_token.clone();
8025 let execute = move |token: String| {
8026 let mut builder = self.clone();
8027 builder.0.request = builder.0.request.set_page_token(token);
8028 builder.send()
8029 };
8030 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8031 }
8032
8033 pub fn by_item(
8035 self,
8036 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8037 google_cloud_location::model::ListLocationsResponse,
8038 crate::Error,
8039 > {
8040 use google_cloud_gax::paginator::Paginator;
8041 self.by_page().items()
8042 }
8043
8044 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8046 self.0.request.name = v.into();
8047 self
8048 }
8049
8050 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8052 self.0.request.filter = v.into();
8053 self
8054 }
8055
8056 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8058 self.0.request.page_size = v.into();
8059 self
8060 }
8061
8062 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8064 self.0.request.page_token = v.into();
8065 self
8066 }
8067 }
8068
8069 #[doc(hidden)]
8070 impl crate::RequestBuilder for ListLocations {
8071 fn request_options(&mut self) -> &mut crate::RequestOptions {
8072 &mut self.0.options
8073 }
8074 }
8075
8076 #[derive(Clone, Debug)]
8093 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8094
8095 impl GetLocation {
8096 pub(crate) fn new(
8097 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8098 ) -> Self {
8099 Self(RequestBuilder::new(stub))
8100 }
8101
8102 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8104 mut self,
8105 v: V,
8106 ) -> Self {
8107 self.0.request = v.into();
8108 self
8109 }
8110
8111 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8113 self.0.options = v.into();
8114 self
8115 }
8116
8117 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8119 (*self.0.stub)
8120 .get_location(self.0.request, self.0.options)
8121 .await
8122 .map(crate::Response::into_body)
8123 }
8124
8125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8127 self.0.request.name = v.into();
8128 self
8129 }
8130 }
8131
8132 #[doc(hidden)]
8133 impl crate::RequestBuilder for GetLocation {
8134 fn request_options(&mut self) -> &mut crate::RequestOptions {
8135 &mut self.0.options
8136 }
8137 }
8138
8139 #[derive(Clone, Debug)]
8156 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8157
8158 impl SetIamPolicy {
8159 pub(crate) fn new(
8160 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8161 ) -> Self {
8162 Self(RequestBuilder::new(stub))
8163 }
8164
8165 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8167 mut self,
8168 v: V,
8169 ) -> Self {
8170 self.0.request = v.into();
8171 self
8172 }
8173
8174 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8176 self.0.options = v.into();
8177 self
8178 }
8179
8180 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8182 (*self.0.stub)
8183 .set_iam_policy(self.0.request, self.0.options)
8184 .await
8185 .map(crate::Response::into_body)
8186 }
8187
8188 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8192 self.0.request.resource = v.into();
8193 self
8194 }
8195
8196 pub fn set_policy<T>(mut self, v: T) -> Self
8200 where
8201 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8202 {
8203 self.0.request.policy = std::option::Option::Some(v.into());
8204 self
8205 }
8206
8207 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8211 where
8212 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8213 {
8214 self.0.request.policy = v.map(|x| x.into());
8215 self
8216 }
8217
8218 pub fn set_update_mask<T>(mut self, v: T) -> Self
8220 where
8221 T: std::convert::Into<wkt::FieldMask>,
8222 {
8223 self.0.request.update_mask = std::option::Option::Some(v.into());
8224 self
8225 }
8226
8227 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8229 where
8230 T: std::convert::Into<wkt::FieldMask>,
8231 {
8232 self.0.request.update_mask = v.map(|x| x.into());
8233 self
8234 }
8235 }
8236
8237 #[doc(hidden)]
8238 impl crate::RequestBuilder for SetIamPolicy {
8239 fn request_options(&mut self) -> &mut crate::RequestOptions {
8240 &mut self.0.options
8241 }
8242 }
8243
8244 #[derive(Clone, Debug)]
8261 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8262
8263 impl GetIamPolicy {
8264 pub(crate) fn new(
8265 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8266 ) -> Self {
8267 Self(RequestBuilder::new(stub))
8268 }
8269
8270 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8272 mut self,
8273 v: V,
8274 ) -> Self {
8275 self.0.request = v.into();
8276 self
8277 }
8278
8279 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8281 self.0.options = v.into();
8282 self
8283 }
8284
8285 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8287 (*self.0.stub)
8288 .get_iam_policy(self.0.request, self.0.options)
8289 .await
8290 .map(crate::Response::into_body)
8291 }
8292
8293 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8297 self.0.request.resource = v.into();
8298 self
8299 }
8300
8301 pub fn set_options<T>(mut self, v: T) -> Self
8303 where
8304 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8305 {
8306 self.0.request.options = std::option::Option::Some(v.into());
8307 self
8308 }
8309
8310 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8312 where
8313 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8314 {
8315 self.0.request.options = v.map(|x| x.into());
8316 self
8317 }
8318 }
8319
8320 #[doc(hidden)]
8321 impl crate::RequestBuilder for GetIamPolicy {
8322 fn request_options(&mut self) -> &mut crate::RequestOptions {
8323 &mut self.0.options
8324 }
8325 }
8326
8327 #[derive(Clone, Debug)]
8344 pub struct TestIamPermissions(
8345 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8346 );
8347
8348 impl TestIamPermissions {
8349 pub(crate) fn new(
8350 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8351 ) -> Self {
8352 Self(RequestBuilder::new(stub))
8353 }
8354
8355 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8357 mut self,
8358 v: V,
8359 ) -> Self {
8360 self.0.request = v.into();
8361 self
8362 }
8363
8364 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8366 self.0.options = v.into();
8367 self
8368 }
8369
8370 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8372 (*self.0.stub)
8373 .test_iam_permissions(self.0.request, self.0.options)
8374 .await
8375 .map(crate::Response::into_body)
8376 }
8377
8378 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8382 self.0.request.resource = v.into();
8383 self
8384 }
8385
8386 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8390 where
8391 T: std::iter::IntoIterator<Item = V>,
8392 V: std::convert::Into<std::string::String>,
8393 {
8394 use std::iter::Iterator;
8395 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8396 self
8397 }
8398 }
8399
8400 #[doc(hidden)]
8401 impl crate::RequestBuilder for TestIamPermissions {
8402 fn request_options(&mut self) -> &mut crate::RequestOptions {
8403 &mut self.0.options
8404 }
8405 }
8406
8407 #[derive(Clone, Debug)]
8428 pub struct ListOperations(
8429 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8430 );
8431
8432 impl ListOperations {
8433 pub(crate) fn new(
8434 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8435 ) -> Self {
8436 Self(RequestBuilder::new(stub))
8437 }
8438
8439 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8441 mut self,
8442 v: V,
8443 ) -> Self {
8444 self.0.request = v.into();
8445 self
8446 }
8447
8448 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8450 self.0.options = v.into();
8451 self
8452 }
8453
8454 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8456 (*self.0.stub)
8457 .list_operations(self.0.request, self.0.options)
8458 .await
8459 .map(crate::Response::into_body)
8460 }
8461
8462 pub fn by_page(
8464 self,
8465 ) -> impl google_cloud_gax::paginator::Paginator<
8466 google_cloud_longrunning::model::ListOperationsResponse,
8467 crate::Error,
8468 > {
8469 use std::clone::Clone;
8470 let token = self.0.request.page_token.clone();
8471 let execute = move |token: String| {
8472 let mut builder = self.clone();
8473 builder.0.request = builder.0.request.set_page_token(token);
8474 builder.send()
8475 };
8476 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8477 }
8478
8479 pub fn by_item(
8481 self,
8482 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8483 google_cloud_longrunning::model::ListOperationsResponse,
8484 crate::Error,
8485 > {
8486 use google_cloud_gax::paginator::Paginator;
8487 self.by_page().items()
8488 }
8489
8490 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8492 self.0.request.name = v.into();
8493 self
8494 }
8495
8496 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8498 self.0.request.filter = v.into();
8499 self
8500 }
8501
8502 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8504 self.0.request.page_size = v.into();
8505 self
8506 }
8507
8508 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8510 self.0.request.page_token = v.into();
8511 self
8512 }
8513
8514 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8516 self.0.request.return_partial_success = v.into();
8517 self
8518 }
8519 }
8520
8521 #[doc(hidden)]
8522 impl crate::RequestBuilder for ListOperations {
8523 fn request_options(&mut self) -> &mut crate::RequestOptions {
8524 &mut self.0.options
8525 }
8526 }
8527
8528 #[derive(Clone, Debug)]
8545 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8546
8547 impl GetOperation {
8548 pub(crate) fn new(
8549 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8550 ) -> Self {
8551 Self(RequestBuilder::new(stub))
8552 }
8553
8554 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8556 mut self,
8557 v: V,
8558 ) -> Self {
8559 self.0.request = v.into();
8560 self
8561 }
8562
8563 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8565 self.0.options = v.into();
8566 self
8567 }
8568
8569 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8571 (*self.0.stub)
8572 .get_operation(self.0.request, self.0.options)
8573 .await
8574 .map(crate::Response::into_body)
8575 }
8576
8577 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8579 self.0.request.name = v.into();
8580 self
8581 }
8582 }
8583
8584 #[doc(hidden)]
8585 impl crate::RequestBuilder for GetOperation {
8586 fn request_options(&mut self) -> &mut crate::RequestOptions {
8587 &mut self.0.options
8588 }
8589 }
8590
8591 #[derive(Clone, Debug)]
8608 pub struct DeleteOperation(
8609 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8610 );
8611
8612 impl DeleteOperation {
8613 pub(crate) fn new(
8614 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8615 ) -> Self {
8616 Self(RequestBuilder::new(stub))
8617 }
8618
8619 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8621 mut self,
8622 v: V,
8623 ) -> Self {
8624 self.0.request = v.into();
8625 self
8626 }
8627
8628 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8630 self.0.options = v.into();
8631 self
8632 }
8633
8634 pub async fn send(self) -> Result<()> {
8636 (*self.0.stub)
8637 .delete_operation(self.0.request, self.0.options)
8638 .await
8639 .map(crate::Response::into_body)
8640 }
8641
8642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8644 self.0.request.name = v.into();
8645 self
8646 }
8647 }
8648
8649 #[doc(hidden)]
8650 impl crate::RequestBuilder for DeleteOperation {
8651 fn request_options(&mut self) -> &mut crate::RequestOptions {
8652 &mut self.0.options
8653 }
8654 }
8655
8656 #[derive(Clone, Debug)]
8673 pub struct CancelOperation(
8674 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8675 );
8676
8677 impl CancelOperation {
8678 pub(crate) fn new(
8679 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8680 ) -> Self {
8681 Self(RequestBuilder::new(stub))
8682 }
8683
8684 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8686 mut self,
8687 v: V,
8688 ) -> Self {
8689 self.0.request = v.into();
8690 self
8691 }
8692
8693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8695 self.0.options = v.into();
8696 self
8697 }
8698
8699 pub async fn send(self) -> Result<()> {
8701 (*self.0.stub)
8702 .cancel_operation(self.0.request, self.0.options)
8703 .await
8704 .map(crate::Response::into_body)
8705 }
8706
8707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8709 self.0.request.name = v.into();
8710 self
8711 }
8712 }
8713
8714 #[doc(hidden)]
8715 impl crate::RequestBuilder for CancelOperation {
8716 fn request_options(&mut self) -> &mut crate::RequestOptions {
8717 &mut self.0.options
8718 }
8719 }
8720}
8721
8722pub mod internal_range_service {
8723 use crate::Result;
8724
8725 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8739
8740 pub(crate) mod client {
8741 use super::super::super::client::InternalRangeService;
8742 pub struct Factory;
8743 impl crate::ClientFactory for Factory {
8744 type Client = InternalRangeService;
8745 type Credentials = gaxi::options::Credentials;
8746 async fn build(
8747 self,
8748 config: gaxi::options::ClientConfig,
8749 ) -> crate::ClientBuilderResult<Self::Client> {
8750 Self::Client::new(config).await
8751 }
8752 }
8753 }
8754
8755 #[derive(Clone, Debug)]
8757 pub(crate) struct RequestBuilder<R: std::default::Default> {
8758 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8759 request: R,
8760 options: crate::RequestOptions,
8761 }
8762
8763 impl<R> RequestBuilder<R>
8764 where
8765 R: std::default::Default,
8766 {
8767 pub(crate) fn new(
8768 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8769 ) -> Self {
8770 Self {
8771 stub,
8772 request: R::default(),
8773 options: crate::RequestOptions::default(),
8774 }
8775 }
8776 }
8777
8778 #[derive(Clone, Debug)]
8799 pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8800
8801 impl ListInternalRanges {
8802 pub(crate) fn new(
8803 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8804 ) -> Self {
8805 Self(RequestBuilder::new(stub))
8806 }
8807
8808 pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8810 mut self,
8811 v: V,
8812 ) -> Self {
8813 self.0.request = v.into();
8814 self
8815 }
8816
8817 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8819 self.0.options = v.into();
8820 self
8821 }
8822
8823 pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8825 (*self.0.stub)
8826 .list_internal_ranges(self.0.request, self.0.options)
8827 .await
8828 .map(crate::Response::into_body)
8829 }
8830
8831 pub fn by_page(
8833 self,
8834 ) -> impl google_cloud_gax::paginator::Paginator<
8835 crate::model::ListInternalRangesResponse,
8836 crate::Error,
8837 > {
8838 use std::clone::Clone;
8839 let token = self.0.request.page_token.clone();
8840 let execute = move |token: String| {
8841 let mut builder = self.clone();
8842 builder.0.request = builder.0.request.set_page_token(token);
8843 builder.send()
8844 };
8845 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8846 }
8847
8848 pub fn by_item(
8850 self,
8851 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8852 crate::model::ListInternalRangesResponse,
8853 crate::Error,
8854 > {
8855 use google_cloud_gax::paginator::Paginator;
8856 self.by_page().items()
8857 }
8858
8859 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8863 self.0.request.parent = v.into();
8864 self
8865 }
8866
8867 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8869 self.0.request.page_size = v.into();
8870 self
8871 }
8872
8873 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8875 self.0.request.page_token = v.into();
8876 self
8877 }
8878
8879 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8881 self.0.request.filter = v.into();
8882 self
8883 }
8884
8885 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8887 self.0.request.order_by = v.into();
8888 self
8889 }
8890 }
8891
8892 #[doc(hidden)]
8893 impl crate::RequestBuilder for ListInternalRanges {
8894 fn request_options(&mut self) -> &mut crate::RequestOptions {
8895 &mut self.0.options
8896 }
8897 }
8898
8899 #[derive(Clone, Debug)]
8916 pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8917
8918 impl GetInternalRange {
8919 pub(crate) fn new(
8920 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8921 ) -> Self {
8922 Self(RequestBuilder::new(stub))
8923 }
8924
8925 pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8927 mut self,
8928 v: V,
8929 ) -> Self {
8930 self.0.request = v.into();
8931 self
8932 }
8933
8934 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8936 self.0.options = v.into();
8937 self
8938 }
8939
8940 pub async fn send(self) -> Result<crate::model::InternalRange> {
8942 (*self.0.stub)
8943 .get_internal_range(self.0.request, self.0.options)
8944 .await
8945 .map(crate::Response::into_body)
8946 }
8947
8948 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8952 self.0.request.name = v.into();
8953 self
8954 }
8955 }
8956
8957 #[doc(hidden)]
8958 impl crate::RequestBuilder for GetInternalRange {
8959 fn request_options(&mut self) -> &mut crate::RequestOptions {
8960 &mut self.0.options
8961 }
8962 }
8963
8964 #[derive(Clone, Debug)]
8982 pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8983
8984 impl CreateInternalRange {
8985 pub(crate) fn new(
8986 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8987 ) -> Self {
8988 Self(RequestBuilder::new(stub))
8989 }
8990
8991 pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8993 mut self,
8994 v: V,
8995 ) -> Self {
8996 self.0.request = v.into();
8997 self
8998 }
8999
9000 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9002 self.0.options = v.into();
9003 self
9004 }
9005
9006 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9013 (*self.0.stub)
9014 .create_internal_range(self.0.request, self.0.options)
9015 .await
9016 .map(crate::Response::into_body)
9017 }
9018
9019 pub fn poller(
9021 self,
9022 ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9023 {
9024 type Operation = google_cloud_lro::internal::Operation<
9025 crate::model::InternalRange,
9026 crate::model::OperationMetadata,
9027 >;
9028 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9029 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9030
9031 let stub = self.0.stub.clone();
9032 let mut options = self.0.options.clone();
9033 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9034 let query = move |name| {
9035 let stub = stub.clone();
9036 let options = options.clone();
9037 async {
9038 let op = GetOperation::new(stub)
9039 .set_name(name)
9040 .with_options(options)
9041 .send()
9042 .await?;
9043 Ok(Operation::new(op))
9044 }
9045 };
9046
9047 let start = move || async {
9048 let op = self.send().await?;
9049 Ok(Operation::new(op))
9050 };
9051
9052 google_cloud_lro::internal::new_poller(
9053 polling_error_policy,
9054 polling_backoff_policy,
9055 start,
9056 query,
9057 )
9058 }
9059
9060 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9064 self.0.request.parent = v.into();
9065 self
9066 }
9067
9068 pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9070 self.0.request.internal_range_id = v.into();
9071 self
9072 }
9073
9074 pub fn set_internal_range<T>(mut self, v: T) -> Self
9078 where
9079 T: std::convert::Into<crate::model::InternalRange>,
9080 {
9081 self.0.request.internal_range = std::option::Option::Some(v.into());
9082 self
9083 }
9084
9085 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9089 where
9090 T: std::convert::Into<crate::model::InternalRange>,
9091 {
9092 self.0.request.internal_range = v.map(|x| x.into());
9093 self
9094 }
9095
9096 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9098 self.0.request.request_id = v.into();
9099 self
9100 }
9101 }
9102
9103 #[doc(hidden)]
9104 impl crate::RequestBuilder for CreateInternalRange {
9105 fn request_options(&mut self) -> &mut crate::RequestOptions {
9106 &mut self.0.options
9107 }
9108 }
9109
9110 #[derive(Clone, Debug)]
9128 pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
9129
9130 impl UpdateInternalRange {
9131 pub(crate) fn new(
9132 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9133 ) -> Self {
9134 Self(RequestBuilder::new(stub))
9135 }
9136
9137 pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
9139 mut self,
9140 v: V,
9141 ) -> Self {
9142 self.0.request = v.into();
9143 self
9144 }
9145
9146 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9148 self.0.options = v.into();
9149 self
9150 }
9151
9152 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9159 (*self.0.stub)
9160 .update_internal_range(self.0.request, self.0.options)
9161 .await
9162 .map(crate::Response::into_body)
9163 }
9164
9165 pub fn poller(
9167 self,
9168 ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9169 {
9170 type Operation = google_cloud_lro::internal::Operation<
9171 crate::model::InternalRange,
9172 crate::model::OperationMetadata,
9173 >;
9174 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9175 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9176
9177 let stub = self.0.stub.clone();
9178 let mut options = self.0.options.clone();
9179 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9180 let query = move |name| {
9181 let stub = stub.clone();
9182 let options = options.clone();
9183 async {
9184 let op = GetOperation::new(stub)
9185 .set_name(name)
9186 .with_options(options)
9187 .send()
9188 .await?;
9189 Ok(Operation::new(op))
9190 }
9191 };
9192
9193 let start = move || async {
9194 let op = self.send().await?;
9195 Ok(Operation::new(op))
9196 };
9197
9198 google_cloud_lro::internal::new_poller(
9199 polling_error_policy,
9200 polling_backoff_policy,
9201 start,
9202 query,
9203 )
9204 }
9205
9206 pub fn set_update_mask<T>(mut self, v: T) -> Self
9208 where
9209 T: std::convert::Into<wkt::FieldMask>,
9210 {
9211 self.0.request.update_mask = std::option::Option::Some(v.into());
9212 self
9213 }
9214
9215 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9217 where
9218 T: std::convert::Into<wkt::FieldMask>,
9219 {
9220 self.0.request.update_mask = v.map(|x| x.into());
9221 self
9222 }
9223
9224 pub fn set_internal_range<T>(mut self, v: T) -> Self
9228 where
9229 T: std::convert::Into<crate::model::InternalRange>,
9230 {
9231 self.0.request.internal_range = std::option::Option::Some(v.into());
9232 self
9233 }
9234
9235 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9239 where
9240 T: std::convert::Into<crate::model::InternalRange>,
9241 {
9242 self.0.request.internal_range = v.map(|x| x.into());
9243 self
9244 }
9245
9246 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9248 self.0.request.request_id = v.into();
9249 self
9250 }
9251 }
9252
9253 #[doc(hidden)]
9254 impl crate::RequestBuilder for UpdateInternalRange {
9255 fn request_options(&mut self) -> &mut crate::RequestOptions {
9256 &mut self.0.options
9257 }
9258 }
9259
9260 #[derive(Clone, Debug)]
9278 pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9279
9280 impl DeleteInternalRange {
9281 pub(crate) fn new(
9282 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9283 ) -> Self {
9284 Self(RequestBuilder::new(stub))
9285 }
9286
9287 pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9289 mut self,
9290 v: V,
9291 ) -> Self {
9292 self.0.request = v.into();
9293 self
9294 }
9295
9296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9298 self.0.options = v.into();
9299 self
9300 }
9301
9302 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9309 (*self.0.stub)
9310 .delete_internal_range(self.0.request, self.0.options)
9311 .await
9312 .map(crate::Response::into_body)
9313 }
9314
9315 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9317 type Operation =
9318 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9319 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9320 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9321
9322 let stub = self.0.stub.clone();
9323 let mut options = self.0.options.clone();
9324 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9325 let query = move |name| {
9326 let stub = stub.clone();
9327 let options = options.clone();
9328 async {
9329 let op = GetOperation::new(stub)
9330 .set_name(name)
9331 .with_options(options)
9332 .send()
9333 .await?;
9334 Ok(Operation::new(op))
9335 }
9336 };
9337
9338 let start = move || async {
9339 let op = self.send().await?;
9340 Ok(Operation::new(op))
9341 };
9342
9343 google_cloud_lro::internal::new_unit_response_poller(
9344 polling_error_policy,
9345 polling_backoff_policy,
9346 start,
9347 query,
9348 )
9349 }
9350
9351 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9355 self.0.request.name = v.into();
9356 self
9357 }
9358
9359 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9361 self.0.request.request_id = v.into();
9362 self
9363 }
9364 }
9365
9366 #[doc(hidden)]
9367 impl crate::RequestBuilder for DeleteInternalRange {
9368 fn request_options(&mut self) -> &mut crate::RequestOptions {
9369 &mut self.0.options
9370 }
9371 }
9372
9373 #[derive(Clone, Debug)]
9394 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9395
9396 impl ListLocations {
9397 pub(crate) fn new(
9398 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9399 ) -> Self {
9400 Self(RequestBuilder::new(stub))
9401 }
9402
9403 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9405 mut self,
9406 v: V,
9407 ) -> Self {
9408 self.0.request = v.into();
9409 self
9410 }
9411
9412 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9414 self.0.options = v.into();
9415 self
9416 }
9417
9418 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9420 (*self.0.stub)
9421 .list_locations(self.0.request, self.0.options)
9422 .await
9423 .map(crate::Response::into_body)
9424 }
9425
9426 pub fn by_page(
9428 self,
9429 ) -> impl google_cloud_gax::paginator::Paginator<
9430 google_cloud_location::model::ListLocationsResponse,
9431 crate::Error,
9432 > {
9433 use std::clone::Clone;
9434 let token = self.0.request.page_token.clone();
9435 let execute = move |token: String| {
9436 let mut builder = self.clone();
9437 builder.0.request = builder.0.request.set_page_token(token);
9438 builder.send()
9439 };
9440 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9441 }
9442
9443 pub fn by_item(
9445 self,
9446 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9447 google_cloud_location::model::ListLocationsResponse,
9448 crate::Error,
9449 > {
9450 use google_cloud_gax::paginator::Paginator;
9451 self.by_page().items()
9452 }
9453
9454 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9456 self.0.request.name = v.into();
9457 self
9458 }
9459
9460 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9462 self.0.request.filter = v.into();
9463 self
9464 }
9465
9466 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9468 self.0.request.page_size = v.into();
9469 self
9470 }
9471
9472 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9474 self.0.request.page_token = v.into();
9475 self
9476 }
9477 }
9478
9479 #[doc(hidden)]
9480 impl crate::RequestBuilder for ListLocations {
9481 fn request_options(&mut self) -> &mut crate::RequestOptions {
9482 &mut self.0.options
9483 }
9484 }
9485
9486 #[derive(Clone, Debug)]
9503 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9504
9505 impl GetLocation {
9506 pub(crate) fn new(
9507 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9508 ) -> Self {
9509 Self(RequestBuilder::new(stub))
9510 }
9511
9512 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9514 mut self,
9515 v: V,
9516 ) -> Self {
9517 self.0.request = v.into();
9518 self
9519 }
9520
9521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9523 self.0.options = v.into();
9524 self
9525 }
9526
9527 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9529 (*self.0.stub)
9530 .get_location(self.0.request, self.0.options)
9531 .await
9532 .map(crate::Response::into_body)
9533 }
9534
9535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9537 self.0.request.name = v.into();
9538 self
9539 }
9540 }
9541
9542 #[doc(hidden)]
9543 impl crate::RequestBuilder for GetLocation {
9544 fn request_options(&mut self) -> &mut crate::RequestOptions {
9545 &mut self.0.options
9546 }
9547 }
9548
9549 #[derive(Clone, Debug)]
9566 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9567
9568 impl SetIamPolicy {
9569 pub(crate) fn new(
9570 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9571 ) -> Self {
9572 Self(RequestBuilder::new(stub))
9573 }
9574
9575 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9577 mut self,
9578 v: V,
9579 ) -> Self {
9580 self.0.request = v.into();
9581 self
9582 }
9583
9584 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9586 self.0.options = v.into();
9587 self
9588 }
9589
9590 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9592 (*self.0.stub)
9593 .set_iam_policy(self.0.request, self.0.options)
9594 .await
9595 .map(crate::Response::into_body)
9596 }
9597
9598 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9602 self.0.request.resource = v.into();
9603 self
9604 }
9605
9606 pub fn set_policy<T>(mut self, v: T) -> Self
9610 where
9611 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9612 {
9613 self.0.request.policy = std::option::Option::Some(v.into());
9614 self
9615 }
9616
9617 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9621 where
9622 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9623 {
9624 self.0.request.policy = v.map(|x| x.into());
9625 self
9626 }
9627
9628 pub fn set_update_mask<T>(mut self, v: T) -> Self
9630 where
9631 T: std::convert::Into<wkt::FieldMask>,
9632 {
9633 self.0.request.update_mask = std::option::Option::Some(v.into());
9634 self
9635 }
9636
9637 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9639 where
9640 T: std::convert::Into<wkt::FieldMask>,
9641 {
9642 self.0.request.update_mask = v.map(|x| x.into());
9643 self
9644 }
9645 }
9646
9647 #[doc(hidden)]
9648 impl crate::RequestBuilder for SetIamPolicy {
9649 fn request_options(&mut self) -> &mut crate::RequestOptions {
9650 &mut self.0.options
9651 }
9652 }
9653
9654 #[derive(Clone, Debug)]
9671 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9672
9673 impl GetIamPolicy {
9674 pub(crate) fn new(
9675 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9676 ) -> Self {
9677 Self(RequestBuilder::new(stub))
9678 }
9679
9680 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9682 mut self,
9683 v: V,
9684 ) -> Self {
9685 self.0.request = v.into();
9686 self
9687 }
9688
9689 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9691 self.0.options = v.into();
9692 self
9693 }
9694
9695 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9697 (*self.0.stub)
9698 .get_iam_policy(self.0.request, self.0.options)
9699 .await
9700 .map(crate::Response::into_body)
9701 }
9702
9703 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9707 self.0.request.resource = v.into();
9708 self
9709 }
9710
9711 pub fn set_options<T>(mut self, v: T) -> Self
9713 where
9714 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9715 {
9716 self.0.request.options = std::option::Option::Some(v.into());
9717 self
9718 }
9719
9720 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9722 where
9723 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9724 {
9725 self.0.request.options = v.map(|x| x.into());
9726 self
9727 }
9728 }
9729
9730 #[doc(hidden)]
9731 impl crate::RequestBuilder for GetIamPolicy {
9732 fn request_options(&mut self) -> &mut crate::RequestOptions {
9733 &mut self.0.options
9734 }
9735 }
9736
9737 #[derive(Clone, Debug)]
9754 pub struct TestIamPermissions(
9755 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
9756 );
9757
9758 impl TestIamPermissions {
9759 pub(crate) fn new(
9760 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9761 ) -> Self {
9762 Self(RequestBuilder::new(stub))
9763 }
9764
9765 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
9767 mut self,
9768 v: V,
9769 ) -> Self {
9770 self.0.request = v.into();
9771 self
9772 }
9773
9774 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9776 self.0.options = v.into();
9777 self
9778 }
9779
9780 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
9782 (*self.0.stub)
9783 .test_iam_permissions(self.0.request, self.0.options)
9784 .await
9785 .map(crate::Response::into_body)
9786 }
9787
9788 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9792 self.0.request.resource = v.into();
9793 self
9794 }
9795
9796 pub fn set_permissions<T, V>(mut self, v: T) -> Self
9800 where
9801 T: std::iter::IntoIterator<Item = V>,
9802 V: std::convert::Into<std::string::String>,
9803 {
9804 use std::iter::Iterator;
9805 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9806 self
9807 }
9808 }
9809
9810 #[doc(hidden)]
9811 impl crate::RequestBuilder for TestIamPermissions {
9812 fn request_options(&mut self) -> &mut crate::RequestOptions {
9813 &mut self.0.options
9814 }
9815 }
9816
9817 #[derive(Clone, Debug)]
9838 pub struct ListOperations(
9839 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9840 );
9841
9842 impl ListOperations {
9843 pub(crate) fn new(
9844 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9845 ) -> Self {
9846 Self(RequestBuilder::new(stub))
9847 }
9848
9849 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9851 mut self,
9852 v: V,
9853 ) -> Self {
9854 self.0.request = v.into();
9855 self
9856 }
9857
9858 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9860 self.0.options = v.into();
9861 self
9862 }
9863
9864 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9866 (*self.0.stub)
9867 .list_operations(self.0.request, self.0.options)
9868 .await
9869 .map(crate::Response::into_body)
9870 }
9871
9872 pub fn by_page(
9874 self,
9875 ) -> impl google_cloud_gax::paginator::Paginator<
9876 google_cloud_longrunning::model::ListOperationsResponse,
9877 crate::Error,
9878 > {
9879 use std::clone::Clone;
9880 let token = self.0.request.page_token.clone();
9881 let execute = move |token: String| {
9882 let mut builder = self.clone();
9883 builder.0.request = builder.0.request.set_page_token(token);
9884 builder.send()
9885 };
9886 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9887 }
9888
9889 pub fn by_item(
9891 self,
9892 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9893 google_cloud_longrunning::model::ListOperationsResponse,
9894 crate::Error,
9895 > {
9896 use google_cloud_gax::paginator::Paginator;
9897 self.by_page().items()
9898 }
9899
9900 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9902 self.0.request.name = v.into();
9903 self
9904 }
9905
9906 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9908 self.0.request.filter = v.into();
9909 self
9910 }
9911
9912 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9914 self.0.request.page_size = v.into();
9915 self
9916 }
9917
9918 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9920 self.0.request.page_token = v.into();
9921 self
9922 }
9923
9924 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9926 self.0.request.return_partial_success = v.into();
9927 self
9928 }
9929 }
9930
9931 #[doc(hidden)]
9932 impl crate::RequestBuilder for ListOperations {
9933 fn request_options(&mut self) -> &mut crate::RequestOptions {
9934 &mut self.0.options
9935 }
9936 }
9937
9938 #[derive(Clone, Debug)]
9955 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9956
9957 impl GetOperation {
9958 pub(crate) fn new(
9959 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9960 ) -> Self {
9961 Self(RequestBuilder::new(stub))
9962 }
9963
9964 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9966 mut self,
9967 v: V,
9968 ) -> Self {
9969 self.0.request = v.into();
9970 self
9971 }
9972
9973 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9975 self.0.options = v.into();
9976 self
9977 }
9978
9979 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9981 (*self.0.stub)
9982 .get_operation(self.0.request, self.0.options)
9983 .await
9984 .map(crate::Response::into_body)
9985 }
9986
9987 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9989 self.0.request.name = v.into();
9990 self
9991 }
9992 }
9993
9994 #[doc(hidden)]
9995 impl crate::RequestBuilder for GetOperation {
9996 fn request_options(&mut self) -> &mut crate::RequestOptions {
9997 &mut self.0.options
9998 }
9999 }
10000
10001 #[derive(Clone, Debug)]
10018 pub struct DeleteOperation(
10019 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10020 );
10021
10022 impl DeleteOperation {
10023 pub(crate) fn new(
10024 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10025 ) -> Self {
10026 Self(RequestBuilder::new(stub))
10027 }
10028
10029 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10031 mut self,
10032 v: V,
10033 ) -> Self {
10034 self.0.request = v.into();
10035 self
10036 }
10037
10038 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10040 self.0.options = v.into();
10041 self
10042 }
10043
10044 pub async fn send(self) -> Result<()> {
10046 (*self.0.stub)
10047 .delete_operation(self.0.request, self.0.options)
10048 .await
10049 .map(crate::Response::into_body)
10050 }
10051
10052 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10054 self.0.request.name = v.into();
10055 self
10056 }
10057 }
10058
10059 #[doc(hidden)]
10060 impl crate::RequestBuilder for DeleteOperation {
10061 fn request_options(&mut self) -> &mut crate::RequestOptions {
10062 &mut self.0.options
10063 }
10064 }
10065
10066 #[derive(Clone, Debug)]
10083 pub struct CancelOperation(
10084 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10085 );
10086
10087 impl CancelOperation {
10088 pub(crate) fn new(
10089 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10090 ) -> Self {
10091 Self(RequestBuilder::new(stub))
10092 }
10093
10094 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10096 mut self,
10097 v: V,
10098 ) -> Self {
10099 self.0.request = v.into();
10100 self
10101 }
10102
10103 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10105 self.0.options = v.into();
10106 self
10107 }
10108
10109 pub async fn send(self) -> Result<()> {
10111 (*self.0.stub)
10112 .cancel_operation(self.0.request, self.0.options)
10113 .await
10114 .map(crate::Response::into_body)
10115 }
10116
10117 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10119 self.0.request.name = v.into();
10120 self
10121 }
10122 }
10123
10124 #[doc(hidden)]
10125 impl crate::RequestBuilder for CancelOperation {
10126 fn request_options(&mut self) -> &mut crate::RequestOptions {
10127 &mut self.0.options
10128 }
10129 }
10130}
10131
10132pub mod policy_based_routing_service {
10133 use crate::Result;
10134
10135 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10149
10150 pub(crate) mod client {
10151 use super::super::super::client::PolicyBasedRoutingService;
10152 pub struct Factory;
10153 impl crate::ClientFactory for Factory {
10154 type Client = PolicyBasedRoutingService;
10155 type Credentials = gaxi::options::Credentials;
10156 async fn build(
10157 self,
10158 config: gaxi::options::ClientConfig,
10159 ) -> crate::ClientBuilderResult<Self::Client> {
10160 Self::Client::new(config).await
10161 }
10162 }
10163 }
10164
10165 #[derive(Clone, Debug)]
10167 pub(crate) struct RequestBuilder<R: std::default::Default> {
10168 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10169 request: R,
10170 options: crate::RequestOptions,
10171 }
10172
10173 impl<R> RequestBuilder<R>
10174 where
10175 R: std::default::Default,
10176 {
10177 pub(crate) fn new(
10178 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10179 ) -> Self {
10180 Self {
10181 stub,
10182 request: R::default(),
10183 options: crate::RequestOptions::default(),
10184 }
10185 }
10186 }
10187
10188 #[derive(Clone, Debug)]
10209 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10210
10211 impl ListPolicyBasedRoutes {
10212 pub(crate) fn new(
10213 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10214 ) -> Self {
10215 Self(RequestBuilder::new(stub))
10216 }
10217
10218 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10220 mut self,
10221 v: V,
10222 ) -> Self {
10223 self.0.request = v.into();
10224 self
10225 }
10226
10227 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10229 self.0.options = v.into();
10230 self
10231 }
10232
10233 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10235 (*self.0.stub)
10236 .list_policy_based_routes(self.0.request, self.0.options)
10237 .await
10238 .map(crate::Response::into_body)
10239 }
10240
10241 pub fn by_page(
10243 self,
10244 ) -> impl google_cloud_gax::paginator::Paginator<
10245 crate::model::ListPolicyBasedRoutesResponse,
10246 crate::Error,
10247 > {
10248 use std::clone::Clone;
10249 let token = self.0.request.page_token.clone();
10250 let execute = move |token: String| {
10251 let mut builder = self.clone();
10252 builder.0.request = builder.0.request.set_page_token(token);
10253 builder.send()
10254 };
10255 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10256 }
10257
10258 pub fn by_item(
10260 self,
10261 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10262 crate::model::ListPolicyBasedRoutesResponse,
10263 crate::Error,
10264 > {
10265 use google_cloud_gax::paginator::Paginator;
10266 self.by_page().items()
10267 }
10268
10269 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10273 self.0.request.parent = v.into();
10274 self
10275 }
10276
10277 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10279 self.0.request.page_size = v.into();
10280 self
10281 }
10282
10283 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10285 self.0.request.page_token = v.into();
10286 self
10287 }
10288
10289 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10291 self.0.request.filter = v.into();
10292 self
10293 }
10294
10295 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10297 self.0.request.order_by = v.into();
10298 self
10299 }
10300 }
10301
10302 #[doc(hidden)]
10303 impl crate::RequestBuilder for ListPolicyBasedRoutes {
10304 fn request_options(&mut self) -> &mut crate::RequestOptions {
10305 &mut self.0.options
10306 }
10307 }
10308
10309 #[derive(Clone, Debug)]
10326 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10327
10328 impl GetPolicyBasedRoute {
10329 pub(crate) fn new(
10330 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10331 ) -> Self {
10332 Self(RequestBuilder::new(stub))
10333 }
10334
10335 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10337 mut self,
10338 v: V,
10339 ) -> Self {
10340 self.0.request = v.into();
10341 self
10342 }
10343
10344 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10346 self.0.options = v.into();
10347 self
10348 }
10349
10350 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10352 (*self.0.stub)
10353 .get_policy_based_route(self.0.request, self.0.options)
10354 .await
10355 .map(crate::Response::into_body)
10356 }
10357
10358 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10362 self.0.request.name = v.into();
10363 self
10364 }
10365 }
10366
10367 #[doc(hidden)]
10368 impl crate::RequestBuilder for GetPolicyBasedRoute {
10369 fn request_options(&mut self) -> &mut crate::RequestOptions {
10370 &mut self.0.options
10371 }
10372 }
10373
10374 #[derive(Clone, Debug)]
10392 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10393
10394 impl CreatePolicyBasedRoute {
10395 pub(crate) fn new(
10396 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10397 ) -> Self {
10398 Self(RequestBuilder::new(stub))
10399 }
10400
10401 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10403 mut self,
10404 v: V,
10405 ) -> Self {
10406 self.0.request = v.into();
10407 self
10408 }
10409
10410 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10412 self.0.options = v.into();
10413 self
10414 }
10415
10416 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10423 (*self.0.stub)
10424 .create_policy_based_route(self.0.request, self.0.options)
10425 .await
10426 .map(crate::Response::into_body)
10427 }
10428
10429 pub fn poller(
10431 self,
10432 ) -> impl google_cloud_lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10433 {
10434 type Operation = google_cloud_lro::internal::Operation<
10435 crate::model::PolicyBasedRoute,
10436 crate::model::OperationMetadata,
10437 >;
10438 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10439 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10440
10441 let stub = self.0.stub.clone();
10442 let mut options = self.0.options.clone();
10443 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10444 let query = move |name| {
10445 let stub = stub.clone();
10446 let options = options.clone();
10447 async {
10448 let op = GetOperation::new(stub)
10449 .set_name(name)
10450 .with_options(options)
10451 .send()
10452 .await?;
10453 Ok(Operation::new(op))
10454 }
10455 };
10456
10457 let start = move || async {
10458 let op = self.send().await?;
10459 Ok(Operation::new(op))
10460 };
10461
10462 google_cloud_lro::internal::new_poller(
10463 polling_error_policy,
10464 polling_backoff_policy,
10465 start,
10466 query,
10467 )
10468 }
10469
10470 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10474 self.0.request.parent = v.into();
10475 self
10476 }
10477
10478 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10482 self.0.request.policy_based_route_id = v.into();
10483 self
10484 }
10485
10486 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10490 where
10491 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10492 {
10493 self.0.request.policy_based_route = std::option::Option::Some(v.into());
10494 self
10495 }
10496
10497 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10501 where
10502 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10503 {
10504 self.0.request.policy_based_route = v.map(|x| x.into());
10505 self
10506 }
10507
10508 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10510 self.0.request.request_id = v.into();
10511 self
10512 }
10513 }
10514
10515 #[doc(hidden)]
10516 impl crate::RequestBuilder for CreatePolicyBasedRoute {
10517 fn request_options(&mut self) -> &mut crate::RequestOptions {
10518 &mut self.0.options
10519 }
10520 }
10521
10522 #[derive(Clone, Debug)]
10540 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10541
10542 impl DeletePolicyBasedRoute {
10543 pub(crate) fn new(
10544 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10545 ) -> Self {
10546 Self(RequestBuilder::new(stub))
10547 }
10548
10549 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10551 mut self,
10552 v: V,
10553 ) -> Self {
10554 self.0.request = v.into();
10555 self
10556 }
10557
10558 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10560 self.0.options = v.into();
10561 self
10562 }
10563
10564 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10571 (*self.0.stub)
10572 .delete_policy_based_route(self.0.request, self.0.options)
10573 .await
10574 .map(crate::Response::into_body)
10575 }
10576
10577 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10579 type Operation =
10580 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10581 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10582 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10583
10584 let stub = self.0.stub.clone();
10585 let mut options = self.0.options.clone();
10586 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10587 let query = move |name| {
10588 let stub = stub.clone();
10589 let options = options.clone();
10590 async {
10591 let op = GetOperation::new(stub)
10592 .set_name(name)
10593 .with_options(options)
10594 .send()
10595 .await?;
10596 Ok(Operation::new(op))
10597 }
10598 };
10599
10600 let start = move || async {
10601 let op = self.send().await?;
10602 Ok(Operation::new(op))
10603 };
10604
10605 google_cloud_lro::internal::new_unit_response_poller(
10606 polling_error_policy,
10607 polling_backoff_policy,
10608 start,
10609 query,
10610 )
10611 }
10612
10613 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10617 self.0.request.name = v.into();
10618 self
10619 }
10620
10621 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10623 self.0.request.request_id = v.into();
10624 self
10625 }
10626 }
10627
10628 #[doc(hidden)]
10629 impl crate::RequestBuilder for DeletePolicyBasedRoute {
10630 fn request_options(&mut self) -> &mut crate::RequestOptions {
10631 &mut self.0.options
10632 }
10633 }
10634
10635 #[derive(Clone, Debug)]
10656 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10657
10658 impl ListLocations {
10659 pub(crate) fn new(
10660 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10661 ) -> Self {
10662 Self(RequestBuilder::new(stub))
10663 }
10664
10665 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10667 mut self,
10668 v: V,
10669 ) -> Self {
10670 self.0.request = v.into();
10671 self
10672 }
10673
10674 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10676 self.0.options = v.into();
10677 self
10678 }
10679
10680 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10682 (*self.0.stub)
10683 .list_locations(self.0.request, self.0.options)
10684 .await
10685 .map(crate::Response::into_body)
10686 }
10687
10688 pub fn by_page(
10690 self,
10691 ) -> impl google_cloud_gax::paginator::Paginator<
10692 google_cloud_location::model::ListLocationsResponse,
10693 crate::Error,
10694 > {
10695 use std::clone::Clone;
10696 let token = self.0.request.page_token.clone();
10697 let execute = move |token: String| {
10698 let mut builder = self.clone();
10699 builder.0.request = builder.0.request.set_page_token(token);
10700 builder.send()
10701 };
10702 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10703 }
10704
10705 pub fn by_item(
10707 self,
10708 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10709 google_cloud_location::model::ListLocationsResponse,
10710 crate::Error,
10711 > {
10712 use google_cloud_gax::paginator::Paginator;
10713 self.by_page().items()
10714 }
10715
10716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10718 self.0.request.name = v.into();
10719 self
10720 }
10721
10722 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10724 self.0.request.filter = v.into();
10725 self
10726 }
10727
10728 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10730 self.0.request.page_size = v.into();
10731 self
10732 }
10733
10734 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10736 self.0.request.page_token = v.into();
10737 self
10738 }
10739 }
10740
10741 #[doc(hidden)]
10742 impl crate::RequestBuilder for ListLocations {
10743 fn request_options(&mut self) -> &mut crate::RequestOptions {
10744 &mut self.0.options
10745 }
10746 }
10747
10748 #[derive(Clone, Debug)]
10765 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10766
10767 impl GetLocation {
10768 pub(crate) fn new(
10769 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10770 ) -> Self {
10771 Self(RequestBuilder::new(stub))
10772 }
10773
10774 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10776 mut self,
10777 v: V,
10778 ) -> Self {
10779 self.0.request = v.into();
10780 self
10781 }
10782
10783 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10785 self.0.options = v.into();
10786 self
10787 }
10788
10789 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10791 (*self.0.stub)
10792 .get_location(self.0.request, self.0.options)
10793 .await
10794 .map(crate::Response::into_body)
10795 }
10796
10797 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10799 self.0.request.name = v.into();
10800 self
10801 }
10802 }
10803
10804 #[doc(hidden)]
10805 impl crate::RequestBuilder for GetLocation {
10806 fn request_options(&mut self) -> &mut crate::RequestOptions {
10807 &mut self.0.options
10808 }
10809 }
10810
10811 #[derive(Clone, Debug)]
10828 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10829
10830 impl SetIamPolicy {
10831 pub(crate) fn new(
10832 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10833 ) -> Self {
10834 Self(RequestBuilder::new(stub))
10835 }
10836
10837 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10839 mut self,
10840 v: V,
10841 ) -> Self {
10842 self.0.request = v.into();
10843 self
10844 }
10845
10846 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10848 self.0.options = v.into();
10849 self
10850 }
10851
10852 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10854 (*self.0.stub)
10855 .set_iam_policy(self.0.request, self.0.options)
10856 .await
10857 .map(crate::Response::into_body)
10858 }
10859
10860 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10864 self.0.request.resource = v.into();
10865 self
10866 }
10867
10868 pub fn set_policy<T>(mut self, v: T) -> Self
10872 where
10873 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10874 {
10875 self.0.request.policy = std::option::Option::Some(v.into());
10876 self
10877 }
10878
10879 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10883 where
10884 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10885 {
10886 self.0.request.policy = v.map(|x| x.into());
10887 self
10888 }
10889
10890 pub fn set_update_mask<T>(mut self, v: T) -> Self
10892 where
10893 T: std::convert::Into<wkt::FieldMask>,
10894 {
10895 self.0.request.update_mask = std::option::Option::Some(v.into());
10896 self
10897 }
10898
10899 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10901 where
10902 T: std::convert::Into<wkt::FieldMask>,
10903 {
10904 self.0.request.update_mask = v.map(|x| x.into());
10905 self
10906 }
10907 }
10908
10909 #[doc(hidden)]
10910 impl crate::RequestBuilder for SetIamPolicy {
10911 fn request_options(&mut self) -> &mut crate::RequestOptions {
10912 &mut self.0.options
10913 }
10914 }
10915
10916 #[derive(Clone, Debug)]
10933 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10934
10935 impl GetIamPolicy {
10936 pub(crate) fn new(
10937 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10938 ) -> Self {
10939 Self(RequestBuilder::new(stub))
10940 }
10941
10942 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10944 mut self,
10945 v: V,
10946 ) -> Self {
10947 self.0.request = v.into();
10948 self
10949 }
10950
10951 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10953 self.0.options = v.into();
10954 self
10955 }
10956
10957 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10959 (*self.0.stub)
10960 .get_iam_policy(self.0.request, self.0.options)
10961 .await
10962 .map(crate::Response::into_body)
10963 }
10964
10965 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10969 self.0.request.resource = v.into();
10970 self
10971 }
10972
10973 pub fn set_options<T>(mut self, v: T) -> Self
10975 where
10976 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10977 {
10978 self.0.request.options = std::option::Option::Some(v.into());
10979 self
10980 }
10981
10982 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10984 where
10985 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10986 {
10987 self.0.request.options = v.map(|x| x.into());
10988 self
10989 }
10990 }
10991
10992 #[doc(hidden)]
10993 impl crate::RequestBuilder for GetIamPolicy {
10994 fn request_options(&mut self) -> &mut crate::RequestOptions {
10995 &mut self.0.options
10996 }
10997 }
10998
10999 #[derive(Clone, Debug)]
11016 pub struct TestIamPermissions(
11017 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
11018 );
11019
11020 impl TestIamPermissions {
11021 pub(crate) fn new(
11022 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11023 ) -> Self {
11024 Self(RequestBuilder::new(stub))
11025 }
11026
11027 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
11029 mut self,
11030 v: V,
11031 ) -> Self {
11032 self.0.request = v.into();
11033 self
11034 }
11035
11036 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11038 self.0.options = v.into();
11039 self
11040 }
11041
11042 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
11044 (*self.0.stub)
11045 .test_iam_permissions(self.0.request, self.0.options)
11046 .await
11047 .map(crate::Response::into_body)
11048 }
11049
11050 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11054 self.0.request.resource = v.into();
11055 self
11056 }
11057
11058 pub fn set_permissions<T, V>(mut self, v: T) -> Self
11062 where
11063 T: std::iter::IntoIterator<Item = V>,
11064 V: std::convert::Into<std::string::String>,
11065 {
11066 use std::iter::Iterator;
11067 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11068 self
11069 }
11070 }
11071
11072 #[doc(hidden)]
11073 impl crate::RequestBuilder for TestIamPermissions {
11074 fn request_options(&mut self) -> &mut crate::RequestOptions {
11075 &mut self.0.options
11076 }
11077 }
11078
11079 #[derive(Clone, Debug)]
11100 pub struct ListOperations(
11101 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11102 );
11103
11104 impl ListOperations {
11105 pub(crate) fn new(
11106 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11107 ) -> Self {
11108 Self(RequestBuilder::new(stub))
11109 }
11110
11111 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11113 mut self,
11114 v: V,
11115 ) -> Self {
11116 self.0.request = v.into();
11117 self
11118 }
11119
11120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11122 self.0.options = v.into();
11123 self
11124 }
11125
11126 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11128 (*self.0.stub)
11129 .list_operations(self.0.request, self.0.options)
11130 .await
11131 .map(crate::Response::into_body)
11132 }
11133
11134 pub fn by_page(
11136 self,
11137 ) -> impl google_cloud_gax::paginator::Paginator<
11138 google_cloud_longrunning::model::ListOperationsResponse,
11139 crate::Error,
11140 > {
11141 use std::clone::Clone;
11142 let token = self.0.request.page_token.clone();
11143 let execute = move |token: String| {
11144 let mut builder = self.clone();
11145 builder.0.request = builder.0.request.set_page_token(token);
11146 builder.send()
11147 };
11148 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11149 }
11150
11151 pub fn by_item(
11153 self,
11154 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11155 google_cloud_longrunning::model::ListOperationsResponse,
11156 crate::Error,
11157 > {
11158 use google_cloud_gax::paginator::Paginator;
11159 self.by_page().items()
11160 }
11161
11162 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11164 self.0.request.name = v.into();
11165 self
11166 }
11167
11168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11170 self.0.request.filter = v.into();
11171 self
11172 }
11173
11174 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11176 self.0.request.page_size = v.into();
11177 self
11178 }
11179
11180 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11182 self.0.request.page_token = v.into();
11183 self
11184 }
11185
11186 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11188 self.0.request.return_partial_success = v.into();
11189 self
11190 }
11191 }
11192
11193 #[doc(hidden)]
11194 impl crate::RequestBuilder for ListOperations {
11195 fn request_options(&mut self) -> &mut crate::RequestOptions {
11196 &mut self.0.options
11197 }
11198 }
11199
11200 #[derive(Clone, Debug)]
11217 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11218
11219 impl GetOperation {
11220 pub(crate) fn new(
11221 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11222 ) -> Self {
11223 Self(RequestBuilder::new(stub))
11224 }
11225
11226 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11228 mut self,
11229 v: V,
11230 ) -> Self {
11231 self.0.request = v.into();
11232 self
11233 }
11234
11235 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11237 self.0.options = v.into();
11238 self
11239 }
11240
11241 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11243 (*self.0.stub)
11244 .get_operation(self.0.request, self.0.options)
11245 .await
11246 .map(crate::Response::into_body)
11247 }
11248
11249 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11251 self.0.request.name = v.into();
11252 self
11253 }
11254 }
11255
11256 #[doc(hidden)]
11257 impl crate::RequestBuilder for GetOperation {
11258 fn request_options(&mut self) -> &mut crate::RequestOptions {
11259 &mut self.0.options
11260 }
11261 }
11262
11263 #[derive(Clone, Debug)]
11280 pub struct DeleteOperation(
11281 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11282 );
11283
11284 impl DeleteOperation {
11285 pub(crate) fn new(
11286 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11287 ) -> Self {
11288 Self(RequestBuilder::new(stub))
11289 }
11290
11291 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11293 mut self,
11294 v: V,
11295 ) -> Self {
11296 self.0.request = v.into();
11297 self
11298 }
11299
11300 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11302 self.0.options = v.into();
11303 self
11304 }
11305
11306 pub async fn send(self) -> Result<()> {
11308 (*self.0.stub)
11309 .delete_operation(self.0.request, self.0.options)
11310 .await
11311 .map(crate::Response::into_body)
11312 }
11313
11314 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11316 self.0.request.name = v.into();
11317 self
11318 }
11319 }
11320
11321 #[doc(hidden)]
11322 impl crate::RequestBuilder for DeleteOperation {
11323 fn request_options(&mut self) -> &mut crate::RequestOptions {
11324 &mut self.0.options
11325 }
11326 }
11327
11328 #[derive(Clone, Debug)]
11345 pub struct CancelOperation(
11346 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11347 );
11348
11349 impl CancelOperation {
11350 pub(crate) fn new(
11351 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11352 ) -> Self {
11353 Self(RequestBuilder::new(stub))
11354 }
11355
11356 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11358 mut self,
11359 v: V,
11360 ) -> Self {
11361 self.0.request = v.into();
11362 self
11363 }
11364
11365 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11367 self.0.options = v.into();
11368 self
11369 }
11370
11371 pub async fn send(self) -> Result<()> {
11373 (*self.0.stub)
11374 .cancel_operation(self.0.request, self.0.options)
11375 .await
11376 .map(crate::Response::into_body)
11377 }
11378
11379 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11381 self.0.request.name = v.into();
11382 self
11383 }
11384 }
11385
11386 #[doc(hidden)]
11387 impl crate::RequestBuilder for CancelOperation {
11388 fn request_options(&mut self) -> &mut crate::RequestOptions {
11389 &mut self.0.options
11390 }
11391 }
11392}