1pub mod cross_network_automation_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::CrossNetworkAutomationService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = CrossNetworkAutomationService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListServiceConnectionMaps(
96 RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
97 );
98
99 impl ListServiceConnectionMaps {
100 pub(crate) fn new(
101 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
102 ) -> Self {
103 Self(RequestBuilder::new(stub))
104 }
105
106 pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
108 mut self,
109 v: V,
110 ) -> Self {
111 self.0.request = v.into();
112 self
113 }
114
115 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
117 self.0.options = v.into();
118 self
119 }
120
121 pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
123 (*self.0.stub)
124 .list_service_connection_maps(self.0.request, self.0.options)
125 .await
126 .map(crate::Response::into_body)
127 }
128
129 pub fn by_page(
131 self,
132 ) -> impl google_cloud_gax::paginator::Paginator<
133 crate::model::ListServiceConnectionMapsResponse,
134 crate::Error,
135 > {
136 use std::clone::Clone;
137 let token = self.0.request.page_token.clone();
138 let execute = move |token: String| {
139 let mut builder = self.clone();
140 builder.0.request = builder.0.request.set_page_token(token);
141 builder.send()
142 };
143 google_cloud_gax::paginator::internal::new_paginator(token, execute)
144 }
145
146 pub fn by_item(
148 self,
149 ) -> impl google_cloud_gax::paginator::ItemPaginator<
150 crate::model::ListServiceConnectionMapsResponse,
151 crate::Error,
152 > {
153 use google_cloud_gax::paginator::Paginator;
154 self.by_page().items()
155 }
156
157 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
161 self.0.request.parent = v.into();
162 self
163 }
164
165 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
167 self.0.request.page_size = v.into();
168 self
169 }
170
171 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
173 self.0.request.page_token = v.into();
174 self
175 }
176
177 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
179 self.0.request.filter = v.into();
180 self
181 }
182
183 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
185 self.0.request.order_by = v.into();
186 self
187 }
188 }
189
190 #[doc(hidden)]
191 impl crate::RequestBuilder for ListServiceConnectionMaps {
192 fn request_options(&mut self) -> &mut crate::RequestOptions {
193 &mut self.0.options
194 }
195 }
196
197 #[derive(Clone, Debug)]
214 pub struct GetServiceConnectionMap(
215 RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
216 );
217
218 impl GetServiceConnectionMap {
219 pub(crate) fn new(
220 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
221 ) -> Self {
222 Self(RequestBuilder::new(stub))
223 }
224
225 pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
227 mut self,
228 v: V,
229 ) -> Self {
230 self.0.request = v.into();
231 self
232 }
233
234 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
236 self.0.options = v.into();
237 self
238 }
239
240 pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
242 (*self.0.stub)
243 .get_service_connection_map(self.0.request, self.0.options)
244 .await
245 .map(crate::Response::into_body)
246 }
247
248 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
252 self.0.request.name = v.into();
253 self
254 }
255 }
256
257 #[doc(hidden)]
258 impl crate::RequestBuilder for GetServiceConnectionMap {
259 fn request_options(&mut self) -> &mut crate::RequestOptions {
260 &mut self.0.options
261 }
262 }
263
264 #[derive(Clone, Debug)]
282 pub struct CreateServiceConnectionMap(
283 RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
284 );
285
286 impl CreateServiceConnectionMap {
287 pub(crate) fn new(
288 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
289 ) -> Self {
290 Self(RequestBuilder::new(stub))
291 }
292
293 pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
295 mut self,
296 v: V,
297 ) -> Self {
298 self.0.request = v.into();
299 self
300 }
301
302 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
304 self.0.options = v.into();
305 self
306 }
307
308 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
315 (*self.0.stub)
316 .create_service_connection_map(self.0.request, self.0.options)
317 .await
318 .map(crate::Response::into_body)
319 }
320
321 pub fn poller(
323 self,
324 ) -> impl google_cloud_lro::Poller<
325 crate::model::ServiceConnectionMap,
326 crate::model::OperationMetadata,
327 > {
328 type Operation = google_cloud_lro::internal::Operation<
329 crate::model::ServiceConnectionMap,
330 crate::model::OperationMetadata,
331 >;
332 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
333 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
334
335 let stub = self.0.stub.clone();
336 let mut options = self.0.options.clone();
337 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
338 let query = move |name| {
339 let stub = stub.clone();
340 let options = options.clone();
341 async {
342 let op = GetOperation::new(stub)
343 .set_name(name)
344 .with_options(options)
345 .send()
346 .await?;
347 Ok(Operation::new(op))
348 }
349 };
350
351 let start = move || async {
352 let op = self.send().await?;
353 Ok(Operation::new(op))
354 };
355
356 google_cloud_lro::internal::new_poller(
357 polling_error_policy,
358 polling_backoff_policy,
359 start,
360 query,
361 )
362 }
363
364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368 self.0.request.parent = v.into();
369 self
370 }
371
372 pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
374 self.0.request.service_connection_map_id = v.into();
375 self
376 }
377
378 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
382 where
383 T: std::convert::Into<crate::model::ServiceConnectionMap>,
384 {
385 self.0.request.service_connection_map = std::option::Option::Some(v.into());
386 self
387 }
388
389 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
393 where
394 T: std::convert::Into<crate::model::ServiceConnectionMap>,
395 {
396 self.0.request.service_connection_map = v.map(|x| x.into());
397 self
398 }
399
400 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
402 self.0.request.request_id = v.into();
403 self
404 }
405 }
406
407 #[doc(hidden)]
408 impl crate::RequestBuilder for CreateServiceConnectionMap {
409 fn request_options(&mut self) -> &mut crate::RequestOptions {
410 &mut self.0.options
411 }
412 }
413
414 #[derive(Clone, Debug)]
432 pub struct UpdateServiceConnectionMap(
433 RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
434 );
435
436 impl UpdateServiceConnectionMap {
437 pub(crate) fn new(
438 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
439 ) -> Self {
440 Self(RequestBuilder::new(stub))
441 }
442
443 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
445 mut self,
446 v: V,
447 ) -> Self {
448 self.0.request = v.into();
449 self
450 }
451
452 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
454 self.0.options = v.into();
455 self
456 }
457
458 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
465 (*self.0.stub)
466 .update_service_connection_map(self.0.request, self.0.options)
467 .await
468 .map(crate::Response::into_body)
469 }
470
471 pub fn poller(
473 self,
474 ) -> impl google_cloud_lro::Poller<
475 crate::model::ServiceConnectionMap,
476 crate::model::OperationMetadata,
477 > {
478 type Operation = google_cloud_lro::internal::Operation<
479 crate::model::ServiceConnectionMap,
480 crate::model::OperationMetadata,
481 >;
482 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
483 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
484
485 let stub = self.0.stub.clone();
486 let mut options = self.0.options.clone();
487 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
488 let query = move |name| {
489 let stub = stub.clone();
490 let options = options.clone();
491 async {
492 let op = GetOperation::new(stub)
493 .set_name(name)
494 .with_options(options)
495 .send()
496 .await?;
497 Ok(Operation::new(op))
498 }
499 };
500
501 let start = move || async {
502 let op = self.send().await?;
503 Ok(Operation::new(op))
504 };
505
506 google_cloud_lro::internal::new_poller(
507 polling_error_policy,
508 polling_backoff_policy,
509 start,
510 query,
511 )
512 }
513
514 pub fn set_update_mask<T>(mut self, v: T) -> Self
516 where
517 T: std::convert::Into<wkt::FieldMask>,
518 {
519 self.0.request.update_mask = std::option::Option::Some(v.into());
520 self
521 }
522
523 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
525 where
526 T: std::convert::Into<wkt::FieldMask>,
527 {
528 self.0.request.update_mask = v.map(|x| x.into());
529 self
530 }
531
532 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
536 where
537 T: std::convert::Into<crate::model::ServiceConnectionMap>,
538 {
539 self.0.request.service_connection_map = std::option::Option::Some(v.into());
540 self
541 }
542
543 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
547 where
548 T: std::convert::Into<crate::model::ServiceConnectionMap>,
549 {
550 self.0.request.service_connection_map = v.map(|x| x.into());
551 self
552 }
553
554 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
556 self.0.request.request_id = v.into();
557 self
558 }
559 }
560
561 #[doc(hidden)]
562 impl crate::RequestBuilder for UpdateServiceConnectionMap {
563 fn request_options(&mut self) -> &mut crate::RequestOptions {
564 &mut self.0.options
565 }
566 }
567
568 #[derive(Clone, Debug)]
586 pub struct DeleteServiceConnectionMap(
587 RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
588 );
589
590 impl DeleteServiceConnectionMap {
591 pub(crate) fn new(
592 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
593 ) -> Self {
594 Self(RequestBuilder::new(stub))
595 }
596
597 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
599 mut self,
600 v: V,
601 ) -> Self {
602 self.0.request = v.into();
603 self
604 }
605
606 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
608 self.0.options = v.into();
609 self
610 }
611
612 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
619 (*self.0.stub)
620 .delete_service_connection_map(self.0.request, self.0.options)
621 .await
622 .map(crate::Response::into_body)
623 }
624
625 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
627 type Operation =
628 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
629 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
630 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
631
632 let stub = self.0.stub.clone();
633 let mut options = self.0.options.clone();
634 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
635 let query = move |name| {
636 let stub = stub.clone();
637 let options = options.clone();
638 async {
639 let op = GetOperation::new(stub)
640 .set_name(name)
641 .with_options(options)
642 .send()
643 .await?;
644 Ok(Operation::new(op))
645 }
646 };
647
648 let start = move || async {
649 let op = self.send().await?;
650 Ok(Operation::new(op))
651 };
652
653 google_cloud_lro::internal::new_unit_response_poller(
654 polling_error_policy,
655 polling_backoff_policy,
656 start,
657 query,
658 )
659 }
660
661 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
665 self.0.request.name = v.into();
666 self
667 }
668
669 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
671 self.0.request.request_id = v.into();
672 self
673 }
674
675 pub fn set_etag<T>(mut self, v: T) -> Self
677 where
678 T: std::convert::Into<std::string::String>,
679 {
680 self.0.request.etag = std::option::Option::Some(v.into());
681 self
682 }
683
684 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
686 where
687 T: std::convert::Into<std::string::String>,
688 {
689 self.0.request.etag = v.map(|x| x.into());
690 self
691 }
692 }
693
694 #[doc(hidden)]
695 impl crate::RequestBuilder for DeleteServiceConnectionMap {
696 fn request_options(&mut self) -> &mut crate::RequestOptions {
697 &mut self.0.options
698 }
699 }
700
701 #[derive(Clone, Debug)]
722 pub struct ListServiceConnectionPolicies(
723 RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
724 );
725
726 impl ListServiceConnectionPolicies {
727 pub(crate) fn new(
728 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
729 ) -> Self {
730 Self(RequestBuilder::new(stub))
731 }
732
733 pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
735 mut self,
736 v: V,
737 ) -> Self {
738 self.0.request = v.into();
739 self
740 }
741
742 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
744 self.0.options = v.into();
745 self
746 }
747
748 pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
750 (*self.0.stub)
751 .list_service_connection_policies(self.0.request, self.0.options)
752 .await
753 .map(crate::Response::into_body)
754 }
755
756 pub fn by_page(
758 self,
759 ) -> impl google_cloud_gax::paginator::Paginator<
760 crate::model::ListServiceConnectionPoliciesResponse,
761 crate::Error,
762 > {
763 use std::clone::Clone;
764 let token = self.0.request.page_token.clone();
765 let execute = move |token: String| {
766 let mut builder = self.clone();
767 builder.0.request = builder.0.request.set_page_token(token);
768 builder.send()
769 };
770 google_cloud_gax::paginator::internal::new_paginator(token, execute)
771 }
772
773 pub fn by_item(
775 self,
776 ) -> impl google_cloud_gax::paginator::ItemPaginator<
777 crate::model::ListServiceConnectionPoliciesResponse,
778 crate::Error,
779 > {
780 use google_cloud_gax::paginator::Paginator;
781 self.by_page().items()
782 }
783
784 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
788 self.0.request.parent = v.into();
789 self
790 }
791
792 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
794 self.0.request.page_size = v.into();
795 self
796 }
797
798 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
800 self.0.request.page_token = v.into();
801 self
802 }
803
804 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
806 self.0.request.filter = v.into();
807 self
808 }
809
810 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
812 self.0.request.order_by = v.into();
813 self
814 }
815 }
816
817 #[doc(hidden)]
818 impl crate::RequestBuilder for ListServiceConnectionPolicies {
819 fn request_options(&mut self) -> &mut crate::RequestOptions {
820 &mut self.0.options
821 }
822 }
823
824 #[derive(Clone, Debug)]
841 pub struct GetServiceConnectionPolicy(
842 RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
843 );
844
845 impl GetServiceConnectionPolicy {
846 pub(crate) fn new(
847 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
848 ) -> Self {
849 Self(RequestBuilder::new(stub))
850 }
851
852 pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
854 mut self,
855 v: V,
856 ) -> Self {
857 self.0.request = v.into();
858 self
859 }
860
861 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
863 self.0.options = v.into();
864 self
865 }
866
867 pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
869 (*self.0.stub)
870 .get_service_connection_policy(self.0.request, self.0.options)
871 .await
872 .map(crate::Response::into_body)
873 }
874
875 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
879 self.0.request.name = v.into();
880 self
881 }
882 }
883
884 #[doc(hidden)]
885 impl crate::RequestBuilder for GetServiceConnectionPolicy {
886 fn request_options(&mut self) -> &mut crate::RequestOptions {
887 &mut self.0.options
888 }
889 }
890
891 #[derive(Clone, Debug)]
909 pub struct CreateServiceConnectionPolicy(
910 RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
911 );
912
913 impl CreateServiceConnectionPolicy {
914 pub(crate) fn new(
915 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
916 ) -> Self {
917 Self(RequestBuilder::new(stub))
918 }
919
920 pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
922 mut self,
923 v: V,
924 ) -> Self {
925 self.0.request = v.into();
926 self
927 }
928
929 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
931 self.0.options = v.into();
932 self
933 }
934
935 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
942 (*self.0.stub)
943 .create_service_connection_policy(self.0.request, self.0.options)
944 .await
945 .map(crate::Response::into_body)
946 }
947
948 pub fn poller(
950 self,
951 ) -> impl google_cloud_lro::Poller<
952 crate::model::ServiceConnectionPolicy,
953 crate::model::OperationMetadata,
954 > {
955 type Operation = google_cloud_lro::internal::Operation<
956 crate::model::ServiceConnectionPolicy,
957 crate::model::OperationMetadata,
958 >;
959 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
960 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
961
962 let stub = self.0.stub.clone();
963 let mut options = self.0.options.clone();
964 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
965 let query = move |name| {
966 let stub = stub.clone();
967 let options = options.clone();
968 async {
969 let op = GetOperation::new(stub)
970 .set_name(name)
971 .with_options(options)
972 .send()
973 .await?;
974 Ok(Operation::new(op))
975 }
976 };
977
978 let start = move || async {
979 let op = self.send().await?;
980 Ok(Operation::new(op))
981 };
982
983 google_cloud_lro::internal::new_poller(
984 polling_error_policy,
985 polling_backoff_policy,
986 start,
987 query,
988 )
989 }
990
991 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
995 self.0.request.parent = v.into();
996 self
997 }
998
999 pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
1001 mut self,
1002 v: T,
1003 ) -> Self {
1004 self.0.request.service_connection_policy_id = v.into();
1005 self
1006 }
1007
1008 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1012 where
1013 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1014 {
1015 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1016 self
1017 }
1018
1019 pub fn set_or_clear_service_connection_policy<T>(
1023 mut self,
1024 v: std::option::Option<T>,
1025 ) -> Self
1026 where
1027 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1028 {
1029 self.0.request.service_connection_policy = v.map(|x| x.into());
1030 self
1031 }
1032
1033 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1035 self.0.request.request_id = v.into();
1036 self
1037 }
1038 }
1039
1040 #[doc(hidden)]
1041 impl crate::RequestBuilder for CreateServiceConnectionPolicy {
1042 fn request_options(&mut self) -> &mut crate::RequestOptions {
1043 &mut self.0.options
1044 }
1045 }
1046
1047 #[derive(Clone, Debug)]
1065 pub struct UpdateServiceConnectionPolicy(
1066 RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1067 );
1068
1069 impl UpdateServiceConnectionPolicy {
1070 pub(crate) fn new(
1071 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1072 ) -> Self {
1073 Self(RequestBuilder::new(stub))
1074 }
1075
1076 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1078 mut self,
1079 v: V,
1080 ) -> Self {
1081 self.0.request = v.into();
1082 self
1083 }
1084
1085 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1087 self.0.options = v.into();
1088 self
1089 }
1090
1091 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1098 (*self.0.stub)
1099 .update_service_connection_policy(self.0.request, self.0.options)
1100 .await
1101 .map(crate::Response::into_body)
1102 }
1103
1104 pub fn poller(
1106 self,
1107 ) -> impl google_cloud_lro::Poller<
1108 crate::model::ServiceConnectionPolicy,
1109 crate::model::OperationMetadata,
1110 > {
1111 type Operation = google_cloud_lro::internal::Operation<
1112 crate::model::ServiceConnectionPolicy,
1113 crate::model::OperationMetadata,
1114 >;
1115 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1116 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1117
1118 let stub = self.0.stub.clone();
1119 let mut options = self.0.options.clone();
1120 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1121 let query = move |name| {
1122 let stub = stub.clone();
1123 let options = options.clone();
1124 async {
1125 let op = GetOperation::new(stub)
1126 .set_name(name)
1127 .with_options(options)
1128 .send()
1129 .await?;
1130 Ok(Operation::new(op))
1131 }
1132 };
1133
1134 let start = move || async {
1135 let op = self.send().await?;
1136 Ok(Operation::new(op))
1137 };
1138
1139 google_cloud_lro::internal::new_poller(
1140 polling_error_policy,
1141 polling_backoff_policy,
1142 start,
1143 query,
1144 )
1145 }
1146
1147 pub fn set_update_mask<T>(mut self, v: T) -> Self
1149 where
1150 T: std::convert::Into<wkt::FieldMask>,
1151 {
1152 self.0.request.update_mask = std::option::Option::Some(v.into());
1153 self
1154 }
1155
1156 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1158 where
1159 T: std::convert::Into<wkt::FieldMask>,
1160 {
1161 self.0.request.update_mask = v.map(|x| x.into());
1162 self
1163 }
1164
1165 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1169 where
1170 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1171 {
1172 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1173 self
1174 }
1175
1176 pub fn set_or_clear_service_connection_policy<T>(
1180 mut self,
1181 v: std::option::Option<T>,
1182 ) -> Self
1183 where
1184 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1185 {
1186 self.0.request.service_connection_policy = v.map(|x| x.into());
1187 self
1188 }
1189
1190 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1192 self.0.request.request_id = v.into();
1193 self
1194 }
1195 }
1196
1197 #[doc(hidden)]
1198 impl crate::RequestBuilder for UpdateServiceConnectionPolicy {
1199 fn request_options(&mut self) -> &mut crate::RequestOptions {
1200 &mut self.0.options
1201 }
1202 }
1203
1204 #[derive(Clone, Debug)]
1222 pub struct DeleteServiceConnectionPolicy(
1223 RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1224 );
1225
1226 impl DeleteServiceConnectionPolicy {
1227 pub(crate) fn new(
1228 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1229 ) -> Self {
1230 Self(RequestBuilder::new(stub))
1231 }
1232
1233 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1235 mut self,
1236 v: V,
1237 ) -> Self {
1238 self.0.request = v.into();
1239 self
1240 }
1241
1242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1244 self.0.options = v.into();
1245 self
1246 }
1247
1248 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1255 (*self.0.stub)
1256 .delete_service_connection_policy(self.0.request, self.0.options)
1257 .await
1258 .map(crate::Response::into_body)
1259 }
1260
1261 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1263 type Operation =
1264 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1265 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1266 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1267
1268 let stub = self.0.stub.clone();
1269 let mut options = self.0.options.clone();
1270 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1271 let query = move |name| {
1272 let stub = stub.clone();
1273 let options = options.clone();
1274 async {
1275 let op = GetOperation::new(stub)
1276 .set_name(name)
1277 .with_options(options)
1278 .send()
1279 .await?;
1280 Ok(Operation::new(op))
1281 }
1282 };
1283
1284 let start = move || async {
1285 let op = self.send().await?;
1286 Ok(Operation::new(op))
1287 };
1288
1289 google_cloud_lro::internal::new_unit_response_poller(
1290 polling_error_policy,
1291 polling_backoff_policy,
1292 start,
1293 query,
1294 )
1295 }
1296
1297 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1301 self.0.request.name = v.into();
1302 self
1303 }
1304
1305 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1307 self.0.request.request_id = v.into();
1308 self
1309 }
1310
1311 pub fn set_etag<T>(mut self, v: T) -> Self
1313 where
1314 T: std::convert::Into<std::string::String>,
1315 {
1316 self.0.request.etag = std::option::Option::Some(v.into());
1317 self
1318 }
1319
1320 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1322 where
1323 T: std::convert::Into<std::string::String>,
1324 {
1325 self.0.request.etag = v.map(|x| x.into());
1326 self
1327 }
1328 }
1329
1330 #[doc(hidden)]
1331 impl crate::RequestBuilder for DeleteServiceConnectionPolicy {
1332 fn request_options(&mut self) -> &mut crate::RequestOptions {
1333 &mut self.0.options
1334 }
1335 }
1336
1337 #[derive(Clone, Debug)]
1358 pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1359
1360 impl ListServiceClasses {
1361 pub(crate) fn new(
1362 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1363 ) -> Self {
1364 Self(RequestBuilder::new(stub))
1365 }
1366
1367 pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1369 mut self,
1370 v: V,
1371 ) -> Self {
1372 self.0.request = v.into();
1373 self
1374 }
1375
1376 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1378 self.0.options = v.into();
1379 self
1380 }
1381
1382 pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1384 (*self.0.stub)
1385 .list_service_classes(self.0.request, self.0.options)
1386 .await
1387 .map(crate::Response::into_body)
1388 }
1389
1390 pub fn by_page(
1392 self,
1393 ) -> impl google_cloud_gax::paginator::Paginator<
1394 crate::model::ListServiceClassesResponse,
1395 crate::Error,
1396 > {
1397 use std::clone::Clone;
1398 let token = self.0.request.page_token.clone();
1399 let execute = move |token: String| {
1400 let mut builder = self.clone();
1401 builder.0.request = builder.0.request.set_page_token(token);
1402 builder.send()
1403 };
1404 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1405 }
1406
1407 pub fn by_item(
1409 self,
1410 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1411 crate::model::ListServiceClassesResponse,
1412 crate::Error,
1413 > {
1414 use google_cloud_gax::paginator::Paginator;
1415 self.by_page().items()
1416 }
1417
1418 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1422 self.0.request.parent = v.into();
1423 self
1424 }
1425
1426 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1428 self.0.request.page_size = v.into();
1429 self
1430 }
1431
1432 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1434 self.0.request.page_token = v.into();
1435 self
1436 }
1437
1438 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440 self.0.request.filter = v.into();
1441 self
1442 }
1443
1444 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1446 self.0.request.order_by = v.into();
1447 self
1448 }
1449 }
1450
1451 #[doc(hidden)]
1452 impl crate::RequestBuilder for ListServiceClasses {
1453 fn request_options(&mut self) -> &mut crate::RequestOptions {
1454 &mut self.0.options
1455 }
1456 }
1457
1458 #[derive(Clone, Debug)]
1475 pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1476
1477 impl GetServiceClass {
1478 pub(crate) fn new(
1479 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1480 ) -> Self {
1481 Self(RequestBuilder::new(stub))
1482 }
1483
1484 pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1486 self.0.request = v.into();
1487 self
1488 }
1489
1490 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1492 self.0.options = v.into();
1493 self
1494 }
1495
1496 pub async fn send(self) -> Result<crate::model::ServiceClass> {
1498 (*self.0.stub)
1499 .get_service_class(self.0.request, self.0.options)
1500 .await
1501 .map(crate::Response::into_body)
1502 }
1503
1504 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1508 self.0.request.name = v.into();
1509 self
1510 }
1511 }
1512
1513 #[doc(hidden)]
1514 impl crate::RequestBuilder for GetServiceClass {
1515 fn request_options(&mut self) -> &mut crate::RequestOptions {
1516 &mut self.0.options
1517 }
1518 }
1519
1520 #[derive(Clone, Debug)]
1538 pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1539
1540 impl UpdateServiceClass {
1541 pub(crate) fn new(
1542 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1543 ) -> Self {
1544 Self(RequestBuilder::new(stub))
1545 }
1546
1547 pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1549 mut self,
1550 v: V,
1551 ) -> Self {
1552 self.0.request = v.into();
1553 self
1554 }
1555
1556 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1558 self.0.options = v.into();
1559 self
1560 }
1561
1562 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1569 (*self.0.stub)
1570 .update_service_class(self.0.request, self.0.options)
1571 .await
1572 .map(crate::Response::into_body)
1573 }
1574
1575 pub fn poller(
1577 self,
1578 ) -> impl google_cloud_lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata>
1579 {
1580 type Operation = google_cloud_lro::internal::Operation<
1581 crate::model::ServiceClass,
1582 crate::model::OperationMetadata,
1583 >;
1584 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1585 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1586
1587 let stub = self.0.stub.clone();
1588 let mut options = self.0.options.clone();
1589 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1590 let query = move |name| {
1591 let stub = stub.clone();
1592 let options = options.clone();
1593 async {
1594 let op = GetOperation::new(stub)
1595 .set_name(name)
1596 .with_options(options)
1597 .send()
1598 .await?;
1599 Ok(Operation::new(op))
1600 }
1601 };
1602
1603 let start = move || async {
1604 let op = self.send().await?;
1605 Ok(Operation::new(op))
1606 };
1607
1608 google_cloud_lro::internal::new_poller(
1609 polling_error_policy,
1610 polling_backoff_policy,
1611 start,
1612 query,
1613 )
1614 }
1615
1616 pub fn set_update_mask<T>(mut self, v: T) -> Self
1618 where
1619 T: std::convert::Into<wkt::FieldMask>,
1620 {
1621 self.0.request.update_mask = std::option::Option::Some(v.into());
1622 self
1623 }
1624
1625 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1627 where
1628 T: std::convert::Into<wkt::FieldMask>,
1629 {
1630 self.0.request.update_mask = v.map(|x| x.into());
1631 self
1632 }
1633
1634 pub fn set_service_class<T>(mut self, v: T) -> Self
1638 where
1639 T: std::convert::Into<crate::model::ServiceClass>,
1640 {
1641 self.0.request.service_class = std::option::Option::Some(v.into());
1642 self
1643 }
1644
1645 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1649 where
1650 T: std::convert::Into<crate::model::ServiceClass>,
1651 {
1652 self.0.request.service_class = v.map(|x| x.into());
1653 self
1654 }
1655
1656 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1658 self.0.request.request_id = v.into();
1659 self
1660 }
1661 }
1662
1663 #[doc(hidden)]
1664 impl crate::RequestBuilder for UpdateServiceClass {
1665 fn request_options(&mut self) -> &mut crate::RequestOptions {
1666 &mut self.0.options
1667 }
1668 }
1669
1670 #[derive(Clone, Debug)]
1688 pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1689
1690 impl DeleteServiceClass {
1691 pub(crate) fn new(
1692 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1693 ) -> Self {
1694 Self(RequestBuilder::new(stub))
1695 }
1696
1697 pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1699 mut self,
1700 v: V,
1701 ) -> Self {
1702 self.0.request = v.into();
1703 self
1704 }
1705
1706 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1708 self.0.options = v.into();
1709 self
1710 }
1711
1712 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1719 (*self.0.stub)
1720 .delete_service_class(self.0.request, self.0.options)
1721 .await
1722 .map(crate::Response::into_body)
1723 }
1724
1725 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1727 type Operation =
1728 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1729 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1730 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1731
1732 let stub = self.0.stub.clone();
1733 let mut options = self.0.options.clone();
1734 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1735 let query = move |name| {
1736 let stub = stub.clone();
1737 let options = options.clone();
1738 async {
1739 let op = GetOperation::new(stub)
1740 .set_name(name)
1741 .with_options(options)
1742 .send()
1743 .await?;
1744 Ok(Operation::new(op))
1745 }
1746 };
1747
1748 let start = move || async {
1749 let op = self.send().await?;
1750 Ok(Operation::new(op))
1751 };
1752
1753 google_cloud_lro::internal::new_unit_response_poller(
1754 polling_error_policy,
1755 polling_backoff_policy,
1756 start,
1757 query,
1758 )
1759 }
1760
1761 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1765 self.0.request.name = v.into();
1766 self
1767 }
1768
1769 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1771 self.0.request.request_id = v.into();
1772 self
1773 }
1774
1775 pub fn set_etag<T>(mut self, v: T) -> Self
1777 where
1778 T: std::convert::Into<std::string::String>,
1779 {
1780 self.0.request.etag = std::option::Option::Some(v.into());
1781 self
1782 }
1783
1784 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1786 where
1787 T: std::convert::Into<std::string::String>,
1788 {
1789 self.0.request.etag = v.map(|x| x.into());
1790 self
1791 }
1792 }
1793
1794 #[doc(hidden)]
1795 impl crate::RequestBuilder for DeleteServiceClass {
1796 fn request_options(&mut self) -> &mut crate::RequestOptions {
1797 &mut self.0.options
1798 }
1799 }
1800
1801 #[derive(Clone, Debug)]
1818 pub struct GetServiceConnectionToken(
1819 RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1820 );
1821
1822 impl GetServiceConnectionToken {
1823 pub(crate) fn new(
1824 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1825 ) -> Self {
1826 Self(RequestBuilder::new(stub))
1827 }
1828
1829 pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1831 mut self,
1832 v: V,
1833 ) -> Self {
1834 self.0.request = v.into();
1835 self
1836 }
1837
1838 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1840 self.0.options = v.into();
1841 self
1842 }
1843
1844 pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1846 (*self.0.stub)
1847 .get_service_connection_token(self.0.request, self.0.options)
1848 .await
1849 .map(crate::Response::into_body)
1850 }
1851
1852 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1856 self.0.request.name = v.into();
1857 self
1858 }
1859 }
1860
1861 #[doc(hidden)]
1862 impl crate::RequestBuilder for GetServiceConnectionToken {
1863 fn request_options(&mut self) -> &mut crate::RequestOptions {
1864 &mut self.0.options
1865 }
1866 }
1867
1868 #[derive(Clone, Debug)]
1889 pub struct ListServiceConnectionTokens(
1890 RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1891 );
1892
1893 impl ListServiceConnectionTokens {
1894 pub(crate) fn new(
1895 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1896 ) -> Self {
1897 Self(RequestBuilder::new(stub))
1898 }
1899
1900 pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1902 mut self,
1903 v: V,
1904 ) -> Self {
1905 self.0.request = v.into();
1906 self
1907 }
1908
1909 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1911 self.0.options = v.into();
1912 self
1913 }
1914
1915 pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1917 (*self.0.stub)
1918 .list_service_connection_tokens(self.0.request, self.0.options)
1919 .await
1920 .map(crate::Response::into_body)
1921 }
1922
1923 pub fn by_page(
1925 self,
1926 ) -> impl google_cloud_gax::paginator::Paginator<
1927 crate::model::ListServiceConnectionTokensResponse,
1928 crate::Error,
1929 > {
1930 use std::clone::Clone;
1931 let token = self.0.request.page_token.clone();
1932 let execute = move |token: String| {
1933 let mut builder = self.clone();
1934 builder.0.request = builder.0.request.set_page_token(token);
1935 builder.send()
1936 };
1937 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1938 }
1939
1940 pub fn by_item(
1942 self,
1943 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1944 crate::model::ListServiceConnectionTokensResponse,
1945 crate::Error,
1946 > {
1947 use google_cloud_gax::paginator::Paginator;
1948 self.by_page().items()
1949 }
1950
1951 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1955 self.0.request.parent = v.into();
1956 self
1957 }
1958
1959 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1961 self.0.request.page_size = v.into();
1962 self
1963 }
1964
1965 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1967 self.0.request.page_token = v.into();
1968 self
1969 }
1970
1971 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1973 self.0.request.filter = v.into();
1974 self
1975 }
1976
1977 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1979 self.0.request.order_by = v.into();
1980 self
1981 }
1982 }
1983
1984 #[doc(hidden)]
1985 impl crate::RequestBuilder for ListServiceConnectionTokens {
1986 fn request_options(&mut self) -> &mut crate::RequestOptions {
1987 &mut self.0.options
1988 }
1989 }
1990
1991 #[derive(Clone, Debug)]
2009 pub struct CreateServiceConnectionToken(
2010 RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
2011 );
2012
2013 impl CreateServiceConnectionToken {
2014 pub(crate) fn new(
2015 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2016 ) -> Self {
2017 Self(RequestBuilder::new(stub))
2018 }
2019
2020 pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2022 mut self,
2023 v: V,
2024 ) -> Self {
2025 self.0.request = v.into();
2026 self
2027 }
2028
2029 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2031 self.0.options = v.into();
2032 self
2033 }
2034
2035 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2042 (*self.0.stub)
2043 .create_service_connection_token(self.0.request, self.0.options)
2044 .await
2045 .map(crate::Response::into_body)
2046 }
2047
2048 pub fn poller(
2050 self,
2051 ) -> impl google_cloud_lro::Poller<
2052 crate::model::ServiceConnectionToken,
2053 crate::model::OperationMetadata,
2054 > {
2055 type Operation = google_cloud_lro::internal::Operation<
2056 crate::model::ServiceConnectionToken,
2057 crate::model::OperationMetadata,
2058 >;
2059 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2060 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2061
2062 let stub = self.0.stub.clone();
2063 let mut options = self.0.options.clone();
2064 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2065 let query = move |name| {
2066 let stub = stub.clone();
2067 let options = options.clone();
2068 async {
2069 let op = GetOperation::new(stub)
2070 .set_name(name)
2071 .with_options(options)
2072 .send()
2073 .await?;
2074 Ok(Operation::new(op))
2075 }
2076 };
2077
2078 let start = move || async {
2079 let op = self.send().await?;
2080 Ok(Operation::new(op))
2081 };
2082
2083 google_cloud_lro::internal::new_poller(
2084 polling_error_policy,
2085 polling_backoff_policy,
2086 start,
2087 query,
2088 )
2089 }
2090
2091 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2095 self.0.request.parent = v.into();
2096 self
2097 }
2098
2099 pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2101 mut self,
2102 v: T,
2103 ) -> Self {
2104 self.0.request.service_connection_token_id = v.into();
2105 self
2106 }
2107
2108 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2112 where
2113 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2114 {
2115 self.0.request.service_connection_token = std::option::Option::Some(v.into());
2116 self
2117 }
2118
2119 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2123 where
2124 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2125 {
2126 self.0.request.service_connection_token = v.map(|x| x.into());
2127 self
2128 }
2129
2130 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2132 self.0.request.request_id = v.into();
2133 self
2134 }
2135 }
2136
2137 #[doc(hidden)]
2138 impl crate::RequestBuilder for CreateServiceConnectionToken {
2139 fn request_options(&mut self) -> &mut crate::RequestOptions {
2140 &mut self.0.options
2141 }
2142 }
2143
2144 #[derive(Clone, Debug)]
2162 pub struct DeleteServiceConnectionToken(
2163 RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2164 );
2165
2166 impl DeleteServiceConnectionToken {
2167 pub(crate) fn new(
2168 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2169 ) -> Self {
2170 Self(RequestBuilder::new(stub))
2171 }
2172
2173 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2175 mut self,
2176 v: V,
2177 ) -> Self {
2178 self.0.request = v.into();
2179 self
2180 }
2181
2182 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2184 self.0.options = v.into();
2185 self
2186 }
2187
2188 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2195 (*self.0.stub)
2196 .delete_service_connection_token(self.0.request, self.0.options)
2197 .await
2198 .map(crate::Response::into_body)
2199 }
2200
2201 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2203 type Operation =
2204 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2205 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2206 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2207
2208 let stub = self.0.stub.clone();
2209 let mut options = self.0.options.clone();
2210 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2211 let query = move |name| {
2212 let stub = stub.clone();
2213 let options = options.clone();
2214 async {
2215 let op = GetOperation::new(stub)
2216 .set_name(name)
2217 .with_options(options)
2218 .send()
2219 .await?;
2220 Ok(Operation::new(op))
2221 }
2222 };
2223
2224 let start = move || async {
2225 let op = self.send().await?;
2226 Ok(Operation::new(op))
2227 };
2228
2229 google_cloud_lro::internal::new_unit_response_poller(
2230 polling_error_policy,
2231 polling_backoff_policy,
2232 start,
2233 query,
2234 )
2235 }
2236
2237 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2241 self.0.request.name = v.into();
2242 self
2243 }
2244
2245 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2247 self.0.request.request_id = v.into();
2248 self
2249 }
2250
2251 pub fn set_etag<T>(mut self, v: T) -> Self
2253 where
2254 T: std::convert::Into<std::string::String>,
2255 {
2256 self.0.request.etag = std::option::Option::Some(v.into());
2257 self
2258 }
2259
2260 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2262 where
2263 T: std::convert::Into<std::string::String>,
2264 {
2265 self.0.request.etag = v.map(|x| x.into());
2266 self
2267 }
2268 }
2269
2270 #[doc(hidden)]
2271 impl crate::RequestBuilder for DeleteServiceConnectionToken {
2272 fn request_options(&mut self) -> &mut crate::RequestOptions {
2273 &mut self.0.options
2274 }
2275 }
2276
2277 #[derive(Clone, Debug)]
2298 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2299
2300 impl ListLocations {
2301 pub(crate) fn new(
2302 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2303 ) -> Self {
2304 Self(RequestBuilder::new(stub))
2305 }
2306
2307 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2309 mut self,
2310 v: V,
2311 ) -> Self {
2312 self.0.request = v.into();
2313 self
2314 }
2315
2316 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2318 self.0.options = v.into();
2319 self
2320 }
2321
2322 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2324 (*self.0.stub)
2325 .list_locations(self.0.request, self.0.options)
2326 .await
2327 .map(crate::Response::into_body)
2328 }
2329
2330 pub fn by_page(
2332 self,
2333 ) -> impl google_cloud_gax::paginator::Paginator<
2334 google_cloud_location::model::ListLocationsResponse,
2335 crate::Error,
2336 > {
2337 use std::clone::Clone;
2338 let token = self.0.request.page_token.clone();
2339 let execute = move |token: String| {
2340 let mut builder = self.clone();
2341 builder.0.request = builder.0.request.set_page_token(token);
2342 builder.send()
2343 };
2344 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2345 }
2346
2347 pub fn by_item(
2349 self,
2350 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2351 google_cloud_location::model::ListLocationsResponse,
2352 crate::Error,
2353 > {
2354 use google_cloud_gax::paginator::Paginator;
2355 self.by_page().items()
2356 }
2357
2358 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2360 self.0.request.name = v.into();
2361 self
2362 }
2363
2364 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2366 self.0.request.filter = v.into();
2367 self
2368 }
2369
2370 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2372 self.0.request.page_size = v.into();
2373 self
2374 }
2375
2376 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2378 self.0.request.page_token = v.into();
2379 self
2380 }
2381 }
2382
2383 #[doc(hidden)]
2384 impl crate::RequestBuilder for ListLocations {
2385 fn request_options(&mut self) -> &mut crate::RequestOptions {
2386 &mut self.0.options
2387 }
2388 }
2389
2390 #[derive(Clone, Debug)]
2407 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2408
2409 impl GetLocation {
2410 pub(crate) fn new(
2411 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2412 ) -> Self {
2413 Self(RequestBuilder::new(stub))
2414 }
2415
2416 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2418 mut self,
2419 v: V,
2420 ) -> Self {
2421 self.0.request = v.into();
2422 self
2423 }
2424
2425 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2427 self.0.options = v.into();
2428 self
2429 }
2430
2431 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2433 (*self.0.stub)
2434 .get_location(self.0.request, self.0.options)
2435 .await
2436 .map(crate::Response::into_body)
2437 }
2438
2439 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2441 self.0.request.name = v.into();
2442 self
2443 }
2444 }
2445
2446 #[doc(hidden)]
2447 impl crate::RequestBuilder for GetLocation {
2448 fn request_options(&mut self) -> &mut crate::RequestOptions {
2449 &mut self.0.options
2450 }
2451 }
2452
2453 #[derive(Clone, Debug)]
2470 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2471
2472 impl SetIamPolicy {
2473 pub(crate) fn new(
2474 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2475 ) -> Self {
2476 Self(RequestBuilder::new(stub))
2477 }
2478
2479 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2481 mut self,
2482 v: V,
2483 ) -> Self {
2484 self.0.request = v.into();
2485 self
2486 }
2487
2488 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2490 self.0.options = v.into();
2491 self
2492 }
2493
2494 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2496 (*self.0.stub)
2497 .set_iam_policy(self.0.request, self.0.options)
2498 .await
2499 .map(crate::Response::into_body)
2500 }
2501
2502 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2506 self.0.request.resource = v.into();
2507 self
2508 }
2509
2510 pub fn set_policy<T>(mut self, v: T) -> Self
2514 where
2515 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2516 {
2517 self.0.request.policy = std::option::Option::Some(v.into());
2518 self
2519 }
2520
2521 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2525 where
2526 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2527 {
2528 self.0.request.policy = v.map(|x| x.into());
2529 self
2530 }
2531
2532 pub fn set_update_mask<T>(mut self, v: T) -> Self
2534 where
2535 T: std::convert::Into<wkt::FieldMask>,
2536 {
2537 self.0.request.update_mask = std::option::Option::Some(v.into());
2538 self
2539 }
2540
2541 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2543 where
2544 T: std::convert::Into<wkt::FieldMask>,
2545 {
2546 self.0.request.update_mask = v.map(|x| x.into());
2547 self
2548 }
2549 }
2550
2551 #[doc(hidden)]
2552 impl crate::RequestBuilder for SetIamPolicy {
2553 fn request_options(&mut self) -> &mut crate::RequestOptions {
2554 &mut self.0.options
2555 }
2556 }
2557
2558 #[derive(Clone, Debug)]
2575 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2576
2577 impl GetIamPolicy {
2578 pub(crate) fn new(
2579 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2580 ) -> Self {
2581 Self(RequestBuilder::new(stub))
2582 }
2583
2584 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2586 mut self,
2587 v: V,
2588 ) -> Self {
2589 self.0.request = v.into();
2590 self
2591 }
2592
2593 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2595 self.0.options = v.into();
2596 self
2597 }
2598
2599 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2601 (*self.0.stub)
2602 .get_iam_policy(self.0.request, self.0.options)
2603 .await
2604 .map(crate::Response::into_body)
2605 }
2606
2607 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2611 self.0.request.resource = v.into();
2612 self
2613 }
2614
2615 pub fn set_options<T>(mut self, v: T) -> Self
2617 where
2618 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2619 {
2620 self.0.request.options = std::option::Option::Some(v.into());
2621 self
2622 }
2623
2624 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2626 where
2627 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2628 {
2629 self.0.request.options = v.map(|x| x.into());
2630 self
2631 }
2632 }
2633
2634 #[doc(hidden)]
2635 impl crate::RequestBuilder for GetIamPolicy {
2636 fn request_options(&mut self) -> &mut crate::RequestOptions {
2637 &mut self.0.options
2638 }
2639 }
2640
2641 #[derive(Clone, Debug)]
2658 pub struct TestIamPermissions(
2659 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2660 );
2661
2662 impl TestIamPermissions {
2663 pub(crate) fn new(
2664 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2665 ) -> Self {
2666 Self(RequestBuilder::new(stub))
2667 }
2668
2669 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2671 mut self,
2672 v: V,
2673 ) -> Self {
2674 self.0.request = v.into();
2675 self
2676 }
2677
2678 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2680 self.0.options = v.into();
2681 self
2682 }
2683
2684 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2686 (*self.0.stub)
2687 .test_iam_permissions(self.0.request, self.0.options)
2688 .await
2689 .map(crate::Response::into_body)
2690 }
2691
2692 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2696 self.0.request.resource = v.into();
2697 self
2698 }
2699
2700 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2704 where
2705 T: std::iter::IntoIterator<Item = V>,
2706 V: std::convert::Into<std::string::String>,
2707 {
2708 use std::iter::Iterator;
2709 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2710 self
2711 }
2712 }
2713
2714 #[doc(hidden)]
2715 impl crate::RequestBuilder for TestIamPermissions {
2716 fn request_options(&mut self) -> &mut crate::RequestOptions {
2717 &mut self.0.options
2718 }
2719 }
2720
2721 #[derive(Clone, Debug)]
2742 pub struct ListOperations(
2743 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2744 );
2745
2746 impl ListOperations {
2747 pub(crate) fn new(
2748 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2749 ) -> Self {
2750 Self(RequestBuilder::new(stub))
2751 }
2752
2753 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2755 mut self,
2756 v: V,
2757 ) -> Self {
2758 self.0.request = v.into();
2759 self
2760 }
2761
2762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2764 self.0.options = v.into();
2765 self
2766 }
2767
2768 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2770 (*self.0.stub)
2771 .list_operations(self.0.request, self.0.options)
2772 .await
2773 .map(crate::Response::into_body)
2774 }
2775
2776 pub fn by_page(
2778 self,
2779 ) -> impl google_cloud_gax::paginator::Paginator<
2780 google_cloud_longrunning::model::ListOperationsResponse,
2781 crate::Error,
2782 > {
2783 use std::clone::Clone;
2784 let token = self.0.request.page_token.clone();
2785 let execute = move |token: String| {
2786 let mut builder = self.clone();
2787 builder.0.request = builder.0.request.set_page_token(token);
2788 builder.send()
2789 };
2790 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2791 }
2792
2793 pub fn by_item(
2795 self,
2796 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2797 google_cloud_longrunning::model::ListOperationsResponse,
2798 crate::Error,
2799 > {
2800 use google_cloud_gax::paginator::Paginator;
2801 self.by_page().items()
2802 }
2803
2804 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2806 self.0.request.name = v.into();
2807 self
2808 }
2809
2810 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2812 self.0.request.filter = v.into();
2813 self
2814 }
2815
2816 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2818 self.0.request.page_size = v.into();
2819 self
2820 }
2821
2822 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2824 self.0.request.page_token = v.into();
2825 self
2826 }
2827
2828 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2830 self.0.request.return_partial_success = v.into();
2831 self
2832 }
2833 }
2834
2835 #[doc(hidden)]
2836 impl crate::RequestBuilder for ListOperations {
2837 fn request_options(&mut self) -> &mut crate::RequestOptions {
2838 &mut self.0.options
2839 }
2840 }
2841
2842 #[derive(Clone, Debug)]
2859 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2860
2861 impl GetOperation {
2862 pub(crate) fn new(
2863 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2864 ) -> Self {
2865 Self(RequestBuilder::new(stub))
2866 }
2867
2868 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2870 mut self,
2871 v: V,
2872 ) -> Self {
2873 self.0.request = v.into();
2874 self
2875 }
2876
2877 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2879 self.0.options = v.into();
2880 self
2881 }
2882
2883 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2885 (*self.0.stub)
2886 .get_operation(self.0.request, self.0.options)
2887 .await
2888 .map(crate::Response::into_body)
2889 }
2890
2891 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893 self.0.request.name = v.into();
2894 self
2895 }
2896 }
2897
2898 #[doc(hidden)]
2899 impl crate::RequestBuilder for GetOperation {
2900 fn request_options(&mut self) -> &mut crate::RequestOptions {
2901 &mut self.0.options
2902 }
2903 }
2904
2905 #[derive(Clone, Debug)]
2922 pub struct DeleteOperation(
2923 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2924 );
2925
2926 impl DeleteOperation {
2927 pub(crate) fn new(
2928 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2929 ) -> Self {
2930 Self(RequestBuilder::new(stub))
2931 }
2932
2933 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2935 mut self,
2936 v: V,
2937 ) -> Self {
2938 self.0.request = v.into();
2939 self
2940 }
2941
2942 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2944 self.0.options = v.into();
2945 self
2946 }
2947
2948 pub async fn send(self) -> Result<()> {
2950 (*self.0.stub)
2951 .delete_operation(self.0.request, self.0.options)
2952 .await
2953 .map(crate::Response::into_body)
2954 }
2955
2956 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2958 self.0.request.name = v.into();
2959 self
2960 }
2961 }
2962
2963 #[doc(hidden)]
2964 impl crate::RequestBuilder for DeleteOperation {
2965 fn request_options(&mut self) -> &mut crate::RequestOptions {
2966 &mut self.0.options
2967 }
2968 }
2969
2970 #[derive(Clone, Debug)]
2987 pub struct CancelOperation(
2988 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2989 );
2990
2991 impl CancelOperation {
2992 pub(crate) fn new(
2993 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2994 ) -> Self {
2995 Self(RequestBuilder::new(stub))
2996 }
2997
2998 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3000 mut self,
3001 v: V,
3002 ) -> Self {
3003 self.0.request = v.into();
3004 self
3005 }
3006
3007 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3009 self.0.options = v.into();
3010 self
3011 }
3012
3013 pub async fn send(self) -> Result<()> {
3015 (*self.0.stub)
3016 .cancel_operation(self.0.request, self.0.options)
3017 .await
3018 .map(crate::Response::into_body)
3019 }
3020
3021 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3023 self.0.request.name = v.into();
3024 self
3025 }
3026 }
3027
3028 #[doc(hidden)]
3029 impl crate::RequestBuilder for CancelOperation {
3030 fn request_options(&mut self) -> &mut crate::RequestOptions {
3031 &mut self.0.options
3032 }
3033 }
3034}
3035
3036pub mod data_transfer_service {
3038 use crate::Result;
3039
3040 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3054
3055 pub(crate) mod client {
3056 use super::super::super::client::DataTransferService;
3057 pub struct Factory;
3058 impl crate::ClientFactory for Factory {
3059 type Client = DataTransferService;
3060 type Credentials = gaxi::options::Credentials;
3061 async fn build(
3062 self,
3063 config: gaxi::options::ClientConfig,
3064 ) -> crate::ClientBuilderResult<Self::Client> {
3065 Self::Client::new(config).await
3066 }
3067 }
3068 }
3069
3070 #[derive(Clone, Debug)]
3072 pub(crate) struct RequestBuilder<R: std::default::Default> {
3073 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3074 request: R,
3075 options: crate::RequestOptions,
3076 }
3077
3078 impl<R> RequestBuilder<R>
3079 where
3080 R: std::default::Default,
3081 {
3082 pub(crate) fn new(
3083 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3084 ) -> Self {
3085 Self {
3086 stub,
3087 request: R::default(),
3088 options: crate::RequestOptions::default(),
3089 }
3090 }
3091 }
3092
3093 #[derive(Clone, Debug)]
3114 pub struct ListMulticloudDataTransferConfigs(
3115 RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3116 );
3117
3118 impl ListMulticloudDataTransferConfigs {
3119 pub(crate) fn new(
3120 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3121 ) -> Self {
3122 Self(RequestBuilder::new(stub))
3123 }
3124
3125 pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3127 mut self,
3128 v: V,
3129 ) -> Self {
3130 self.0.request = v.into();
3131 self
3132 }
3133
3134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3136 self.0.options = v.into();
3137 self
3138 }
3139
3140 pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3142 (*self.0.stub)
3143 .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3144 .await
3145 .map(crate::Response::into_body)
3146 }
3147
3148 pub fn by_page(
3150 self,
3151 ) -> impl google_cloud_gax::paginator::Paginator<
3152 crate::model::ListMulticloudDataTransferConfigsResponse,
3153 crate::Error,
3154 > {
3155 use std::clone::Clone;
3156 let token = self.0.request.page_token.clone();
3157 let execute = move |token: String| {
3158 let mut builder = self.clone();
3159 builder.0.request = builder.0.request.set_page_token(token);
3160 builder.send()
3161 };
3162 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3163 }
3164
3165 pub fn by_item(
3167 self,
3168 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3169 crate::model::ListMulticloudDataTransferConfigsResponse,
3170 crate::Error,
3171 > {
3172 use google_cloud_gax::paginator::Paginator;
3173 self.by_page().items()
3174 }
3175
3176 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3180 self.0.request.parent = v.into();
3181 self
3182 }
3183
3184 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3186 self.0.request.page_size = v.into();
3187 self
3188 }
3189
3190 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3192 self.0.request.page_token = v.into();
3193 self
3194 }
3195
3196 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3198 self.0.request.filter = v.into();
3199 self
3200 }
3201
3202 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3204 self.0.request.order_by = v.into();
3205 self
3206 }
3207
3208 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3210 self.0.request.return_partial_success = v.into();
3211 self
3212 }
3213 }
3214
3215 #[doc(hidden)]
3216 impl crate::RequestBuilder for ListMulticloudDataTransferConfigs {
3217 fn request_options(&mut self) -> &mut crate::RequestOptions {
3218 &mut self.0.options
3219 }
3220 }
3221
3222 #[derive(Clone, Debug)]
3239 pub struct GetMulticloudDataTransferConfig(
3240 RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3241 );
3242
3243 impl GetMulticloudDataTransferConfig {
3244 pub(crate) fn new(
3245 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3246 ) -> Self {
3247 Self(RequestBuilder::new(stub))
3248 }
3249
3250 pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3252 mut self,
3253 v: V,
3254 ) -> Self {
3255 self.0.request = v.into();
3256 self
3257 }
3258
3259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3261 self.0.options = v.into();
3262 self
3263 }
3264
3265 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3267 (*self.0.stub)
3268 .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3269 .await
3270 .map(crate::Response::into_body)
3271 }
3272
3273 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3277 self.0.request.name = v.into();
3278 self
3279 }
3280 }
3281
3282 #[doc(hidden)]
3283 impl crate::RequestBuilder for GetMulticloudDataTransferConfig {
3284 fn request_options(&mut self) -> &mut crate::RequestOptions {
3285 &mut self.0.options
3286 }
3287 }
3288
3289 #[derive(Clone, Debug)]
3307 pub struct CreateMulticloudDataTransferConfig(
3308 RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3309 );
3310
3311 impl CreateMulticloudDataTransferConfig {
3312 pub(crate) fn new(
3313 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3314 ) -> Self {
3315 Self(RequestBuilder::new(stub))
3316 }
3317
3318 pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3320 mut self,
3321 v: V,
3322 ) -> Self {
3323 self.0.request = v.into();
3324 self
3325 }
3326
3327 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3329 self.0.options = v.into();
3330 self
3331 }
3332
3333 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3340 (*self.0.stub)
3341 .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3342 .await
3343 .map(crate::Response::into_body)
3344 }
3345
3346 pub fn poller(
3348 self,
3349 ) -> impl google_cloud_lro::Poller<
3350 crate::model::MulticloudDataTransferConfig,
3351 crate::model::OperationMetadata,
3352 > {
3353 type Operation = google_cloud_lro::internal::Operation<
3354 crate::model::MulticloudDataTransferConfig,
3355 crate::model::OperationMetadata,
3356 >;
3357 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3358 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3359
3360 let stub = self.0.stub.clone();
3361 let mut options = self.0.options.clone();
3362 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3363 let query = move |name| {
3364 let stub = stub.clone();
3365 let options = options.clone();
3366 async {
3367 let op = GetOperation::new(stub)
3368 .set_name(name)
3369 .with_options(options)
3370 .send()
3371 .await?;
3372 Ok(Operation::new(op))
3373 }
3374 };
3375
3376 let start = move || async {
3377 let op = self.send().await?;
3378 Ok(Operation::new(op))
3379 };
3380
3381 google_cloud_lro::internal::new_poller(
3382 polling_error_policy,
3383 polling_backoff_policy,
3384 start,
3385 query,
3386 )
3387 }
3388
3389 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3393 self.0.request.parent = v.into();
3394 self
3395 }
3396
3397 pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3401 mut self,
3402 v: T,
3403 ) -> Self {
3404 self.0.request.multicloud_data_transfer_config_id = v.into();
3405 self
3406 }
3407
3408 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3412 where
3413 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3414 {
3415 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3416 self
3417 }
3418
3419 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3423 mut self,
3424 v: std::option::Option<T>,
3425 ) -> Self
3426 where
3427 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3428 {
3429 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3430 self
3431 }
3432
3433 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3435 self.0.request.request_id = v.into();
3436 self
3437 }
3438 }
3439
3440 #[doc(hidden)]
3441 impl crate::RequestBuilder for CreateMulticloudDataTransferConfig {
3442 fn request_options(&mut self) -> &mut crate::RequestOptions {
3443 &mut self.0.options
3444 }
3445 }
3446
3447 #[derive(Clone, Debug)]
3465 pub struct UpdateMulticloudDataTransferConfig(
3466 RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3467 );
3468
3469 impl UpdateMulticloudDataTransferConfig {
3470 pub(crate) fn new(
3471 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3472 ) -> Self {
3473 Self(RequestBuilder::new(stub))
3474 }
3475
3476 pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3478 mut self,
3479 v: V,
3480 ) -> Self {
3481 self.0.request = v.into();
3482 self
3483 }
3484
3485 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3487 self.0.options = v.into();
3488 self
3489 }
3490
3491 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3498 (*self.0.stub)
3499 .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3500 .await
3501 .map(crate::Response::into_body)
3502 }
3503
3504 pub fn poller(
3506 self,
3507 ) -> impl google_cloud_lro::Poller<
3508 crate::model::MulticloudDataTransferConfig,
3509 crate::model::OperationMetadata,
3510 > {
3511 type Operation = google_cloud_lro::internal::Operation<
3512 crate::model::MulticloudDataTransferConfig,
3513 crate::model::OperationMetadata,
3514 >;
3515 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3516 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3517
3518 let stub = self.0.stub.clone();
3519 let mut options = self.0.options.clone();
3520 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3521 let query = move |name| {
3522 let stub = stub.clone();
3523 let options = options.clone();
3524 async {
3525 let op = GetOperation::new(stub)
3526 .set_name(name)
3527 .with_options(options)
3528 .send()
3529 .await?;
3530 Ok(Operation::new(op))
3531 }
3532 };
3533
3534 let start = move || async {
3535 let op = self.send().await?;
3536 Ok(Operation::new(op))
3537 };
3538
3539 google_cloud_lro::internal::new_poller(
3540 polling_error_policy,
3541 polling_backoff_policy,
3542 start,
3543 query,
3544 )
3545 }
3546
3547 pub fn set_update_mask<T>(mut self, v: T) -> Self
3549 where
3550 T: std::convert::Into<wkt::FieldMask>,
3551 {
3552 self.0.request.update_mask = std::option::Option::Some(v.into());
3553 self
3554 }
3555
3556 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3558 where
3559 T: std::convert::Into<wkt::FieldMask>,
3560 {
3561 self.0.request.update_mask = v.map(|x| x.into());
3562 self
3563 }
3564
3565 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3569 where
3570 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3571 {
3572 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3573 self
3574 }
3575
3576 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3580 mut self,
3581 v: std::option::Option<T>,
3582 ) -> Self
3583 where
3584 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3585 {
3586 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3587 self
3588 }
3589
3590 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3592 self.0.request.request_id = v.into();
3593 self
3594 }
3595 }
3596
3597 #[doc(hidden)]
3598 impl crate::RequestBuilder for UpdateMulticloudDataTransferConfig {
3599 fn request_options(&mut self) -> &mut crate::RequestOptions {
3600 &mut self.0.options
3601 }
3602 }
3603
3604 #[derive(Clone, Debug)]
3622 pub struct DeleteMulticloudDataTransferConfig(
3623 RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3624 );
3625
3626 impl DeleteMulticloudDataTransferConfig {
3627 pub(crate) fn new(
3628 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3629 ) -> Self {
3630 Self(RequestBuilder::new(stub))
3631 }
3632
3633 pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3635 mut self,
3636 v: V,
3637 ) -> Self {
3638 self.0.request = v.into();
3639 self
3640 }
3641
3642 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3644 self.0.options = v.into();
3645 self
3646 }
3647
3648 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3655 (*self.0.stub)
3656 .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3657 .await
3658 .map(crate::Response::into_body)
3659 }
3660
3661 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3663 type Operation =
3664 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3665 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3666 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3667
3668 let stub = self.0.stub.clone();
3669 let mut options = self.0.options.clone();
3670 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3671 let query = move |name| {
3672 let stub = stub.clone();
3673 let options = options.clone();
3674 async {
3675 let op = GetOperation::new(stub)
3676 .set_name(name)
3677 .with_options(options)
3678 .send()
3679 .await?;
3680 Ok(Operation::new(op))
3681 }
3682 };
3683
3684 let start = move || async {
3685 let op = self.send().await?;
3686 Ok(Operation::new(op))
3687 };
3688
3689 google_cloud_lro::internal::new_unit_response_poller(
3690 polling_error_policy,
3691 polling_backoff_policy,
3692 start,
3693 query,
3694 )
3695 }
3696
3697 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3701 self.0.request.name = v.into();
3702 self
3703 }
3704
3705 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3707 self.0.request.request_id = v.into();
3708 self
3709 }
3710
3711 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3713 self.0.request.etag = v.into();
3714 self
3715 }
3716 }
3717
3718 #[doc(hidden)]
3719 impl crate::RequestBuilder for DeleteMulticloudDataTransferConfig {
3720 fn request_options(&mut self) -> &mut crate::RequestOptions {
3721 &mut self.0.options
3722 }
3723 }
3724
3725 #[derive(Clone, Debug)]
3746 pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3747
3748 impl ListDestinations {
3749 pub(crate) fn new(
3750 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3751 ) -> Self {
3752 Self(RequestBuilder::new(stub))
3753 }
3754
3755 pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3757 mut self,
3758 v: V,
3759 ) -> Self {
3760 self.0.request = v.into();
3761 self
3762 }
3763
3764 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3766 self.0.options = v.into();
3767 self
3768 }
3769
3770 pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3772 (*self.0.stub)
3773 .list_destinations(self.0.request, self.0.options)
3774 .await
3775 .map(crate::Response::into_body)
3776 }
3777
3778 pub fn by_page(
3780 self,
3781 ) -> impl google_cloud_gax::paginator::Paginator<
3782 crate::model::ListDestinationsResponse,
3783 crate::Error,
3784 > {
3785 use std::clone::Clone;
3786 let token = self.0.request.page_token.clone();
3787 let execute = move |token: String| {
3788 let mut builder = self.clone();
3789 builder.0.request = builder.0.request.set_page_token(token);
3790 builder.send()
3791 };
3792 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3793 }
3794
3795 pub fn by_item(
3797 self,
3798 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3799 crate::model::ListDestinationsResponse,
3800 crate::Error,
3801 > {
3802 use google_cloud_gax::paginator::Paginator;
3803 self.by_page().items()
3804 }
3805
3806 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3810 self.0.request.parent = v.into();
3811 self
3812 }
3813
3814 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3816 self.0.request.page_size = v.into();
3817 self
3818 }
3819
3820 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.0.request.page_token = v.into();
3823 self
3824 }
3825
3826 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3828 self.0.request.filter = v.into();
3829 self
3830 }
3831
3832 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3834 self.0.request.order_by = v.into();
3835 self
3836 }
3837
3838 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3840 self.0.request.return_partial_success = v.into();
3841 self
3842 }
3843 }
3844
3845 #[doc(hidden)]
3846 impl crate::RequestBuilder for ListDestinations {
3847 fn request_options(&mut self) -> &mut crate::RequestOptions {
3848 &mut self.0.options
3849 }
3850 }
3851
3852 #[derive(Clone, Debug)]
3869 pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3870
3871 impl GetDestination {
3872 pub(crate) fn new(
3873 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3874 ) -> Self {
3875 Self(RequestBuilder::new(stub))
3876 }
3877
3878 pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3880 self.0.request = v.into();
3881 self
3882 }
3883
3884 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3886 self.0.options = v.into();
3887 self
3888 }
3889
3890 pub async fn send(self) -> Result<crate::model::Destination> {
3892 (*self.0.stub)
3893 .get_destination(self.0.request, self.0.options)
3894 .await
3895 .map(crate::Response::into_body)
3896 }
3897
3898 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3902 self.0.request.name = v.into();
3903 self
3904 }
3905 }
3906
3907 #[doc(hidden)]
3908 impl crate::RequestBuilder for GetDestination {
3909 fn request_options(&mut self) -> &mut crate::RequestOptions {
3910 &mut self.0.options
3911 }
3912 }
3913
3914 #[derive(Clone, Debug)]
3932 pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3933
3934 impl CreateDestination {
3935 pub(crate) fn new(
3936 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3937 ) -> Self {
3938 Self(RequestBuilder::new(stub))
3939 }
3940
3941 pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3943 mut self,
3944 v: V,
3945 ) -> Self {
3946 self.0.request = v.into();
3947 self
3948 }
3949
3950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3952 self.0.options = v.into();
3953 self
3954 }
3955
3956 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3963 (*self.0.stub)
3964 .create_destination(self.0.request, self.0.options)
3965 .await
3966 .map(crate::Response::into_body)
3967 }
3968
3969 pub fn poller(
3971 self,
3972 ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
3973 {
3974 type Operation = google_cloud_lro::internal::Operation<
3975 crate::model::Destination,
3976 crate::model::OperationMetadata,
3977 >;
3978 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3979 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3980
3981 let stub = self.0.stub.clone();
3982 let mut options = self.0.options.clone();
3983 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3984 let query = move |name| {
3985 let stub = stub.clone();
3986 let options = options.clone();
3987 async {
3988 let op = GetOperation::new(stub)
3989 .set_name(name)
3990 .with_options(options)
3991 .send()
3992 .await?;
3993 Ok(Operation::new(op))
3994 }
3995 };
3996
3997 let start = move || async {
3998 let op = self.send().await?;
3999 Ok(Operation::new(op))
4000 };
4001
4002 google_cloud_lro::internal::new_poller(
4003 polling_error_policy,
4004 polling_backoff_policy,
4005 start,
4006 query,
4007 )
4008 }
4009
4010 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4014 self.0.request.parent = v.into();
4015 self
4016 }
4017
4018 pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4022 self.0.request.destination_id = v.into();
4023 self
4024 }
4025
4026 pub fn set_destination<T>(mut self, v: T) -> Self
4030 where
4031 T: std::convert::Into<crate::model::Destination>,
4032 {
4033 self.0.request.destination = std::option::Option::Some(v.into());
4034 self
4035 }
4036
4037 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4041 where
4042 T: std::convert::Into<crate::model::Destination>,
4043 {
4044 self.0.request.destination = v.map(|x| x.into());
4045 self
4046 }
4047
4048 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4050 self.0.request.request_id = v.into();
4051 self
4052 }
4053 }
4054
4055 #[doc(hidden)]
4056 impl crate::RequestBuilder for CreateDestination {
4057 fn request_options(&mut self) -> &mut crate::RequestOptions {
4058 &mut self.0.options
4059 }
4060 }
4061
4062 #[derive(Clone, Debug)]
4080 pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4081
4082 impl UpdateDestination {
4083 pub(crate) fn new(
4084 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4085 ) -> Self {
4086 Self(RequestBuilder::new(stub))
4087 }
4088
4089 pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4091 mut self,
4092 v: V,
4093 ) -> Self {
4094 self.0.request = v.into();
4095 self
4096 }
4097
4098 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4100 self.0.options = v.into();
4101 self
4102 }
4103
4104 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4111 (*self.0.stub)
4112 .update_destination(self.0.request, self.0.options)
4113 .await
4114 .map(crate::Response::into_body)
4115 }
4116
4117 pub fn poller(
4119 self,
4120 ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
4121 {
4122 type Operation = google_cloud_lro::internal::Operation<
4123 crate::model::Destination,
4124 crate::model::OperationMetadata,
4125 >;
4126 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4127 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4128
4129 let stub = self.0.stub.clone();
4130 let mut options = self.0.options.clone();
4131 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4132 let query = move |name| {
4133 let stub = stub.clone();
4134 let options = options.clone();
4135 async {
4136 let op = GetOperation::new(stub)
4137 .set_name(name)
4138 .with_options(options)
4139 .send()
4140 .await?;
4141 Ok(Operation::new(op))
4142 }
4143 };
4144
4145 let start = move || async {
4146 let op = self.send().await?;
4147 Ok(Operation::new(op))
4148 };
4149
4150 google_cloud_lro::internal::new_poller(
4151 polling_error_policy,
4152 polling_backoff_policy,
4153 start,
4154 query,
4155 )
4156 }
4157
4158 pub fn set_update_mask<T>(mut self, v: T) -> Self
4160 where
4161 T: std::convert::Into<wkt::FieldMask>,
4162 {
4163 self.0.request.update_mask = std::option::Option::Some(v.into());
4164 self
4165 }
4166
4167 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4169 where
4170 T: std::convert::Into<wkt::FieldMask>,
4171 {
4172 self.0.request.update_mask = v.map(|x| x.into());
4173 self
4174 }
4175
4176 pub fn set_destination<T>(mut self, v: T) -> Self
4180 where
4181 T: std::convert::Into<crate::model::Destination>,
4182 {
4183 self.0.request.destination = std::option::Option::Some(v.into());
4184 self
4185 }
4186
4187 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4191 where
4192 T: std::convert::Into<crate::model::Destination>,
4193 {
4194 self.0.request.destination = v.map(|x| x.into());
4195 self
4196 }
4197
4198 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4200 self.0.request.request_id = v.into();
4201 self
4202 }
4203 }
4204
4205 #[doc(hidden)]
4206 impl crate::RequestBuilder for UpdateDestination {
4207 fn request_options(&mut self) -> &mut crate::RequestOptions {
4208 &mut self.0.options
4209 }
4210 }
4211
4212 #[derive(Clone, Debug)]
4230 pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4231
4232 impl DeleteDestination {
4233 pub(crate) fn new(
4234 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4235 ) -> Self {
4236 Self(RequestBuilder::new(stub))
4237 }
4238
4239 pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4241 mut self,
4242 v: V,
4243 ) -> Self {
4244 self.0.request = v.into();
4245 self
4246 }
4247
4248 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4250 self.0.options = v.into();
4251 self
4252 }
4253
4254 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4261 (*self.0.stub)
4262 .delete_destination(self.0.request, self.0.options)
4263 .await
4264 .map(crate::Response::into_body)
4265 }
4266
4267 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4269 type Operation =
4270 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4271 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4272 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4273
4274 let stub = self.0.stub.clone();
4275 let mut options = self.0.options.clone();
4276 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4277 let query = move |name| {
4278 let stub = stub.clone();
4279 let options = options.clone();
4280 async {
4281 let op = GetOperation::new(stub)
4282 .set_name(name)
4283 .with_options(options)
4284 .send()
4285 .await?;
4286 Ok(Operation::new(op))
4287 }
4288 };
4289
4290 let start = move || async {
4291 let op = self.send().await?;
4292 Ok(Operation::new(op))
4293 };
4294
4295 google_cloud_lro::internal::new_unit_response_poller(
4296 polling_error_policy,
4297 polling_backoff_policy,
4298 start,
4299 query,
4300 )
4301 }
4302
4303 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4307 self.0.request.name = v.into();
4308 self
4309 }
4310
4311 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4313 self.0.request.request_id = v.into();
4314 self
4315 }
4316
4317 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4319 self.0.request.etag = v.into();
4320 self
4321 }
4322 }
4323
4324 #[doc(hidden)]
4325 impl crate::RequestBuilder for DeleteDestination {
4326 fn request_options(&mut self) -> &mut crate::RequestOptions {
4327 &mut self.0.options
4328 }
4329 }
4330
4331 #[derive(Clone, Debug)]
4348 pub struct GetMulticloudDataTransferSupportedService(
4349 RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4350 );
4351
4352 impl GetMulticloudDataTransferSupportedService {
4353 pub(crate) fn new(
4354 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4355 ) -> Self {
4356 Self(RequestBuilder::new(stub))
4357 }
4358
4359 pub fn with_request<
4361 V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4362 >(
4363 mut self,
4364 v: V,
4365 ) -> Self {
4366 self.0.request = v.into();
4367 self
4368 }
4369
4370 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4372 self.0.options = v.into();
4373 self
4374 }
4375
4376 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4378 (*self.0.stub)
4379 .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4380 .await
4381 .map(crate::Response::into_body)
4382 }
4383
4384 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4388 self.0.request.name = v.into();
4389 self
4390 }
4391 }
4392
4393 #[doc(hidden)]
4394 impl crate::RequestBuilder for GetMulticloudDataTransferSupportedService {
4395 fn request_options(&mut self) -> &mut crate::RequestOptions {
4396 &mut self.0.options
4397 }
4398 }
4399
4400 #[derive(Clone, Debug)]
4421 pub struct ListMulticloudDataTransferSupportedServices(
4422 RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4423 );
4424
4425 impl ListMulticloudDataTransferSupportedServices {
4426 pub(crate) fn new(
4427 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4428 ) -> Self {
4429 Self(RequestBuilder::new(stub))
4430 }
4431
4432 pub fn with_request<
4434 V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4435 >(
4436 mut self,
4437 v: V,
4438 ) -> Self {
4439 self.0.request = v.into();
4440 self
4441 }
4442
4443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4445 self.0.options = v.into();
4446 self
4447 }
4448
4449 pub async fn send(
4451 self,
4452 ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4453 (*self.0.stub)
4454 .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4455 .await
4456 .map(crate::Response::into_body)
4457 }
4458
4459 pub fn by_page(
4461 self,
4462 ) -> impl google_cloud_gax::paginator::Paginator<
4463 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4464 crate::Error,
4465 > {
4466 use std::clone::Clone;
4467 let token = self.0.request.page_token.clone();
4468 let execute = move |token: String| {
4469 let mut builder = self.clone();
4470 builder.0.request = builder.0.request.set_page_token(token);
4471 builder.send()
4472 };
4473 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4474 }
4475
4476 pub fn by_item(
4478 self,
4479 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4480 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4481 crate::Error,
4482 > {
4483 use google_cloud_gax::paginator::Paginator;
4484 self.by_page().items()
4485 }
4486
4487 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4491 self.0.request.parent = v.into();
4492 self
4493 }
4494
4495 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4497 self.0.request.page_size = v.into();
4498 self
4499 }
4500
4501 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4503 self.0.request.page_token = v.into();
4504 self
4505 }
4506 }
4507
4508 #[doc(hidden)]
4509 impl crate::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4510 fn request_options(&mut self) -> &mut crate::RequestOptions {
4511 &mut self.0.options
4512 }
4513 }
4514
4515 #[derive(Clone, Debug)]
4536 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4537
4538 impl ListLocations {
4539 pub(crate) fn new(
4540 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4541 ) -> Self {
4542 Self(RequestBuilder::new(stub))
4543 }
4544
4545 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4547 mut self,
4548 v: V,
4549 ) -> Self {
4550 self.0.request = v.into();
4551 self
4552 }
4553
4554 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4556 self.0.options = v.into();
4557 self
4558 }
4559
4560 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4562 (*self.0.stub)
4563 .list_locations(self.0.request, self.0.options)
4564 .await
4565 .map(crate::Response::into_body)
4566 }
4567
4568 pub fn by_page(
4570 self,
4571 ) -> impl google_cloud_gax::paginator::Paginator<
4572 google_cloud_location::model::ListLocationsResponse,
4573 crate::Error,
4574 > {
4575 use std::clone::Clone;
4576 let token = self.0.request.page_token.clone();
4577 let execute = move |token: String| {
4578 let mut builder = self.clone();
4579 builder.0.request = builder.0.request.set_page_token(token);
4580 builder.send()
4581 };
4582 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4583 }
4584
4585 pub fn by_item(
4587 self,
4588 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4589 google_cloud_location::model::ListLocationsResponse,
4590 crate::Error,
4591 > {
4592 use google_cloud_gax::paginator::Paginator;
4593 self.by_page().items()
4594 }
4595
4596 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4598 self.0.request.name = v.into();
4599 self
4600 }
4601
4602 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4604 self.0.request.filter = v.into();
4605 self
4606 }
4607
4608 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4610 self.0.request.page_size = v.into();
4611 self
4612 }
4613
4614 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4616 self.0.request.page_token = v.into();
4617 self
4618 }
4619 }
4620
4621 #[doc(hidden)]
4622 impl crate::RequestBuilder for ListLocations {
4623 fn request_options(&mut self) -> &mut crate::RequestOptions {
4624 &mut self.0.options
4625 }
4626 }
4627
4628 #[derive(Clone, Debug)]
4645 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4646
4647 impl GetLocation {
4648 pub(crate) fn new(
4649 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4650 ) -> Self {
4651 Self(RequestBuilder::new(stub))
4652 }
4653
4654 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4656 mut self,
4657 v: V,
4658 ) -> Self {
4659 self.0.request = v.into();
4660 self
4661 }
4662
4663 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4665 self.0.options = v.into();
4666 self
4667 }
4668
4669 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4671 (*self.0.stub)
4672 .get_location(self.0.request, self.0.options)
4673 .await
4674 .map(crate::Response::into_body)
4675 }
4676
4677 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4679 self.0.request.name = v.into();
4680 self
4681 }
4682 }
4683
4684 #[doc(hidden)]
4685 impl crate::RequestBuilder for GetLocation {
4686 fn request_options(&mut self) -> &mut crate::RequestOptions {
4687 &mut self.0.options
4688 }
4689 }
4690
4691 #[derive(Clone, Debug)]
4708 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4709
4710 impl SetIamPolicy {
4711 pub(crate) fn new(
4712 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4713 ) -> Self {
4714 Self(RequestBuilder::new(stub))
4715 }
4716
4717 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4719 mut self,
4720 v: V,
4721 ) -> Self {
4722 self.0.request = v.into();
4723 self
4724 }
4725
4726 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4728 self.0.options = v.into();
4729 self
4730 }
4731
4732 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4734 (*self.0.stub)
4735 .set_iam_policy(self.0.request, self.0.options)
4736 .await
4737 .map(crate::Response::into_body)
4738 }
4739
4740 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4744 self.0.request.resource = v.into();
4745 self
4746 }
4747
4748 pub fn set_policy<T>(mut self, v: T) -> Self
4752 where
4753 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4754 {
4755 self.0.request.policy = std::option::Option::Some(v.into());
4756 self
4757 }
4758
4759 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4763 where
4764 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4765 {
4766 self.0.request.policy = v.map(|x| x.into());
4767 self
4768 }
4769
4770 pub fn set_update_mask<T>(mut self, v: T) -> Self
4772 where
4773 T: std::convert::Into<wkt::FieldMask>,
4774 {
4775 self.0.request.update_mask = std::option::Option::Some(v.into());
4776 self
4777 }
4778
4779 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4781 where
4782 T: std::convert::Into<wkt::FieldMask>,
4783 {
4784 self.0.request.update_mask = v.map(|x| x.into());
4785 self
4786 }
4787 }
4788
4789 #[doc(hidden)]
4790 impl crate::RequestBuilder for SetIamPolicy {
4791 fn request_options(&mut self) -> &mut crate::RequestOptions {
4792 &mut self.0.options
4793 }
4794 }
4795
4796 #[derive(Clone, Debug)]
4813 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4814
4815 impl GetIamPolicy {
4816 pub(crate) fn new(
4817 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4818 ) -> Self {
4819 Self(RequestBuilder::new(stub))
4820 }
4821
4822 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4824 mut self,
4825 v: V,
4826 ) -> Self {
4827 self.0.request = v.into();
4828 self
4829 }
4830
4831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4833 self.0.options = v.into();
4834 self
4835 }
4836
4837 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4839 (*self.0.stub)
4840 .get_iam_policy(self.0.request, self.0.options)
4841 .await
4842 .map(crate::Response::into_body)
4843 }
4844
4845 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4849 self.0.request.resource = v.into();
4850 self
4851 }
4852
4853 pub fn set_options<T>(mut self, v: T) -> Self
4855 where
4856 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4857 {
4858 self.0.request.options = std::option::Option::Some(v.into());
4859 self
4860 }
4861
4862 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4864 where
4865 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4866 {
4867 self.0.request.options = v.map(|x| x.into());
4868 self
4869 }
4870 }
4871
4872 #[doc(hidden)]
4873 impl crate::RequestBuilder for GetIamPolicy {
4874 fn request_options(&mut self) -> &mut crate::RequestOptions {
4875 &mut self.0.options
4876 }
4877 }
4878
4879 #[derive(Clone, Debug)]
4896 pub struct TestIamPermissions(
4897 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4898 );
4899
4900 impl TestIamPermissions {
4901 pub(crate) fn new(
4902 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4903 ) -> Self {
4904 Self(RequestBuilder::new(stub))
4905 }
4906
4907 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4909 mut self,
4910 v: V,
4911 ) -> Self {
4912 self.0.request = v.into();
4913 self
4914 }
4915
4916 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4918 self.0.options = v.into();
4919 self
4920 }
4921
4922 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4924 (*self.0.stub)
4925 .test_iam_permissions(self.0.request, self.0.options)
4926 .await
4927 .map(crate::Response::into_body)
4928 }
4929
4930 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4934 self.0.request.resource = v.into();
4935 self
4936 }
4937
4938 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4942 where
4943 T: std::iter::IntoIterator<Item = V>,
4944 V: std::convert::Into<std::string::String>,
4945 {
4946 use std::iter::Iterator;
4947 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4948 self
4949 }
4950 }
4951
4952 #[doc(hidden)]
4953 impl crate::RequestBuilder for TestIamPermissions {
4954 fn request_options(&mut self) -> &mut crate::RequestOptions {
4955 &mut self.0.options
4956 }
4957 }
4958
4959 #[derive(Clone, Debug)]
4980 pub struct ListOperations(
4981 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4982 );
4983
4984 impl ListOperations {
4985 pub(crate) fn new(
4986 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4987 ) -> Self {
4988 Self(RequestBuilder::new(stub))
4989 }
4990
4991 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4993 mut self,
4994 v: V,
4995 ) -> Self {
4996 self.0.request = v.into();
4997 self
4998 }
4999
5000 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5002 self.0.options = v.into();
5003 self
5004 }
5005
5006 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5008 (*self.0.stub)
5009 .list_operations(self.0.request, self.0.options)
5010 .await
5011 .map(crate::Response::into_body)
5012 }
5013
5014 pub fn by_page(
5016 self,
5017 ) -> impl google_cloud_gax::paginator::Paginator<
5018 google_cloud_longrunning::model::ListOperationsResponse,
5019 crate::Error,
5020 > {
5021 use std::clone::Clone;
5022 let token = self.0.request.page_token.clone();
5023 let execute = move |token: String| {
5024 let mut builder = self.clone();
5025 builder.0.request = builder.0.request.set_page_token(token);
5026 builder.send()
5027 };
5028 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5029 }
5030
5031 pub fn by_item(
5033 self,
5034 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5035 google_cloud_longrunning::model::ListOperationsResponse,
5036 crate::Error,
5037 > {
5038 use google_cloud_gax::paginator::Paginator;
5039 self.by_page().items()
5040 }
5041
5042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5044 self.0.request.name = v.into();
5045 self
5046 }
5047
5048 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5050 self.0.request.filter = v.into();
5051 self
5052 }
5053
5054 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5056 self.0.request.page_size = v.into();
5057 self
5058 }
5059
5060 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5062 self.0.request.page_token = v.into();
5063 self
5064 }
5065
5066 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5068 self.0.request.return_partial_success = v.into();
5069 self
5070 }
5071 }
5072
5073 #[doc(hidden)]
5074 impl crate::RequestBuilder for ListOperations {
5075 fn request_options(&mut self) -> &mut crate::RequestOptions {
5076 &mut self.0.options
5077 }
5078 }
5079
5080 #[derive(Clone, Debug)]
5097 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5098
5099 impl GetOperation {
5100 pub(crate) fn new(
5101 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5102 ) -> Self {
5103 Self(RequestBuilder::new(stub))
5104 }
5105
5106 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5108 mut self,
5109 v: V,
5110 ) -> Self {
5111 self.0.request = v.into();
5112 self
5113 }
5114
5115 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5117 self.0.options = v.into();
5118 self
5119 }
5120
5121 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5123 (*self.0.stub)
5124 .get_operation(self.0.request, self.0.options)
5125 .await
5126 .map(crate::Response::into_body)
5127 }
5128
5129 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5131 self.0.request.name = v.into();
5132 self
5133 }
5134 }
5135
5136 #[doc(hidden)]
5137 impl crate::RequestBuilder for GetOperation {
5138 fn request_options(&mut self) -> &mut crate::RequestOptions {
5139 &mut self.0.options
5140 }
5141 }
5142
5143 #[derive(Clone, Debug)]
5160 pub struct DeleteOperation(
5161 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5162 );
5163
5164 impl DeleteOperation {
5165 pub(crate) fn new(
5166 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5167 ) -> Self {
5168 Self(RequestBuilder::new(stub))
5169 }
5170
5171 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5173 mut self,
5174 v: V,
5175 ) -> Self {
5176 self.0.request = v.into();
5177 self
5178 }
5179
5180 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5182 self.0.options = v.into();
5183 self
5184 }
5185
5186 pub async fn send(self) -> Result<()> {
5188 (*self.0.stub)
5189 .delete_operation(self.0.request, self.0.options)
5190 .await
5191 .map(crate::Response::into_body)
5192 }
5193
5194 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5196 self.0.request.name = v.into();
5197 self
5198 }
5199 }
5200
5201 #[doc(hidden)]
5202 impl crate::RequestBuilder for DeleteOperation {
5203 fn request_options(&mut self) -> &mut crate::RequestOptions {
5204 &mut self.0.options
5205 }
5206 }
5207
5208 #[derive(Clone, Debug)]
5225 pub struct CancelOperation(
5226 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5227 );
5228
5229 impl CancelOperation {
5230 pub(crate) fn new(
5231 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5232 ) -> Self {
5233 Self(RequestBuilder::new(stub))
5234 }
5235
5236 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5238 mut self,
5239 v: V,
5240 ) -> Self {
5241 self.0.request = v.into();
5242 self
5243 }
5244
5245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5247 self.0.options = v.into();
5248 self
5249 }
5250
5251 pub async fn send(self) -> Result<()> {
5253 (*self.0.stub)
5254 .cancel_operation(self.0.request, self.0.options)
5255 .await
5256 .map(crate::Response::into_body)
5257 }
5258
5259 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5261 self.0.request.name = v.into();
5262 self
5263 }
5264 }
5265
5266 #[doc(hidden)]
5267 impl crate::RequestBuilder for CancelOperation {
5268 fn request_options(&mut self) -> &mut crate::RequestOptions {
5269 &mut self.0.options
5270 }
5271 }
5272}
5273
5274pub mod hub_service {
5276 use crate::Result;
5277
5278 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5292
5293 pub(crate) mod client {
5294 use super::super::super::client::HubService;
5295 pub struct Factory;
5296 impl crate::ClientFactory for Factory {
5297 type Client = HubService;
5298 type Credentials = gaxi::options::Credentials;
5299 async fn build(
5300 self,
5301 config: gaxi::options::ClientConfig,
5302 ) -> crate::ClientBuilderResult<Self::Client> {
5303 Self::Client::new(config).await
5304 }
5305 }
5306 }
5307
5308 #[derive(Clone, Debug)]
5310 pub(crate) struct RequestBuilder<R: std::default::Default> {
5311 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5312 request: R,
5313 options: crate::RequestOptions,
5314 }
5315
5316 impl<R> RequestBuilder<R>
5317 where
5318 R: std::default::Default,
5319 {
5320 pub(crate) fn new(
5321 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5322 ) -> Self {
5323 Self {
5324 stub,
5325 request: R::default(),
5326 options: crate::RequestOptions::default(),
5327 }
5328 }
5329 }
5330
5331 #[derive(Clone, Debug)]
5352 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5353
5354 impl ListHubs {
5355 pub(crate) fn new(
5356 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5357 ) -> Self {
5358 Self(RequestBuilder::new(stub))
5359 }
5360
5361 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5363 self.0.request = v.into();
5364 self
5365 }
5366
5367 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5369 self.0.options = v.into();
5370 self
5371 }
5372
5373 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5375 (*self.0.stub)
5376 .list_hubs(self.0.request, self.0.options)
5377 .await
5378 .map(crate::Response::into_body)
5379 }
5380
5381 pub fn by_page(
5383 self,
5384 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubsResponse, crate::Error>
5385 {
5386 use std::clone::Clone;
5387 let token = self.0.request.page_token.clone();
5388 let execute = move |token: String| {
5389 let mut builder = self.clone();
5390 builder.0.request = builder.0.request.set_page_token(token);
5391 builder.send()
5392 };
5393 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5394 }
5395
5396 pub fn by_item(
5398 self,
5399 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHubsResponse, crate::Error>
5400 {
5401 use google_cloud_gax::paginator::Paginator;
5402 self.by_page().items()
5403 }
5404
5405 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5409 self.0.request.parent = v.into();
5410 self
5411 }
5412
5413 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5415 self.0.request.page_size = v.into();
5416 self
5417 }
5418
5419 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5421 self.0.request.page_token = v.into();
5422 self
5423 }
5424
5425 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5427 self.0.request.filter = v.into();
5428 self
5429 }
5430
5431 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5433 self.0.request.order_by = v.into();
5434 self
5435 }
5436 }
5437
5438 #[doc(hidden)]
5439 impl crate::RequestBuilder for ListHubs {
5440 fn request_options(&mut self) -> &mut crate::RequestOptions {
5441 &mut self.0.options
5442 }
5443 }
5444
5445 #[derive(Clone, Debug)]
5462 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5463
5464 impl GetHub {
5465 pub(crate) fn new(
5466 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5467 ) -> Self {
5468 Self(RequestBuilder::new(stub))
5469 }
5470
5471 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5473 self.0.request = v.into();
5474 self
5475 }
5476
5477 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5479 self.0.options = v.into();
5480 self
5481 }
5482
5483 pub async fn send(self) -> Result<crate::model::Hub> {
5485 (*self.0.stub)
5486 .get_hub(self.0.request, self.0.options)
5487 .await
5488 .map(crate::Response::into_body)
5489 }
5490
5491 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5495 self.0.request.name = v.into();
5496 self
5497 }
5498 }
5499
5500 #[doc(hidden)]
5501 impl crate::RequestBuilder for GetHub {
5502 fn request_options(&mut self) -> &mut crate::RequestOptions {
5503 &mut self.0.options
5504 }
5505 }
5506
5507 #[derive(Clone, Debug)]
5525 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5526
5527 impl CreateHub {
5528 pub(crate) fn new(
5529 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5530 ) -> Self {
5531 Self(RequestBuilder::new(stub))
5532 }
5533
5534 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5536 self.0.request = v.into();
5537 self
5538 }
5539
5540 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5542 self.0.options = v.into();
5543 self
5544 }
5545
5546 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5553 (*self.0.stub)
5554 .create_hub(self.0.request, self.0.options)
5555 .await
5556 .map(crate::Response::into_body)
5557 }
5558
5559 pub fn poller(
5561 self,
5562 ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5563 {
5564 type Operation = google_cloud_lro::internal::Operation<
5565 crate::model::Hub,
5566 crate::model::OperationMetadata,
5567 >;
5568 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5569 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5570
5571 let stub = self.0.stub.clone();
5572 let mut options = self.0.options.clone();
5573 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5574 let query = move |name| {
5575 let stub = stub.clone();
5576 let options = options.clone();
5577 async {
5578 let op = GetOperation::new(stub)
5579 .set_name(name)
5580 .with_options(options)
5581 .send()
5582 .await?;
5583 Ok(Operation::new(op))
5584 }
5585 };
5586
5587 let start = move || async {
5588 let op = self.send().await?;
5589 Ok(Operation::new(op))
5590 };
5591
5592 google_cloud_lro::internal::new_poller(
5593 polling_error_policy,
5594 polling_backoff_policy,
5595 start,
5596 query,
5597 )
5598 }
5599
5600 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5604 self.0.request.parent = v.into();
5605 self
5606 }
5607
5608 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5612 self.0.request.hub_id = v.into();
5613 self
5614 }
5615
5616 pub fn set_hub<T>(mut self, v: T) -> Self
5620 where
5621 T: std::convert::Into<crate::model::Hub>,
5622 {
5623 self.0.request.hub = std::option::Option::Some(v.into());
5624 self
5625 }
5626
5627 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5631 where
5632 T: std::convert::Into<crate::model::Hub>,
5633 {
5634 self.0.request.hub = v.map(|x| x.into());
5635 self
5636 }
5637
5638 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5640 self.0.request.request_id = v.into();
5641 self
5642 }
5643 }
5644
5645 #[doc(hidden)]
5646 impl crate::RequestBuilder for CreateHub {
5647 fn request_options(&mut self) -> &mut crate::RequestOptions {
5648 &mut self.0.options
5649 }
5650 }
5651
5652 #[derive(Clone, Debug)]
5670 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5671
5672 impl UpdateHub {
5673 pub(crate) fn new(
5674 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5675 ) -> Self {
5676 Self(RequestBuilder::new(stub))
5677 }
5678
5679 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5681 self.0.request = v.into();
5682 self
5683 }
5684
5685 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5687 self.0.options = v.into();
5688 self
5689 }
5690
5691 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5698 (*self.0.stub)
5699 .update_hub(self.0.request, self.0.options)
5700 .await
5701 .map(crate::Response::into_body)
5702 }
5703
5704 pub fn poller(
5706 self,
5707 ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5708 {
5709 type Operation = google_cloud_lro::internal::Operation<
5710 crate::model::Hub,
5711 crate::model::OperationMetadata,
5712 >;
5713 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5714 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5715
5716 let stub = self.0.stub.clone();
5717 let mut options = self.0.options.clone();
5718 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5719 let query = move |name| {
5720 let stub = stub.clone();
5721 let options = options.clone();
5722 async {
5723 let op = GetOperation::new(stub)
5724 .set_name(name)
5725 .with_options(options)
5726 .send()
5727 .await?;
5728 Ok(Operation::new(op))
5729 }
5730 };
5731
5732 let start = move || async {
5733 let op = self.send().await?;
5734 Ok(Operation::new(op))
5735 };
5736
5737 google_cloud_lro::internal::new_poller(
5738 polling_error_policy,
5739 polling_backoff_policy,
5740 start,
5741 query,
5742 )
5743 }
5744
5745 pub fn set_update_mask<T>(mut self, v: T) -> Self
5747 where
5748 T: std::convert::Into<wkt::FieldMask>,
5749 {
5750 self.0.request.update_mask = std::option::Option::Some(v.into());
5751 self
5752 }
5753
5754 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5756 where
5757 T: std::convert::Into<wkt::FieldMask>,
5758 {
5759 self.0.request.update_mask = v.map(|x| x.into());
5760 self
5761 }
5762
5763 pub fn set_hub<T>(mut self, v: T) -> Self
5767 where
5768 T: std::convert::Into<crate::model::Hub>,
5769 {
5770 self.0.request.hub = std::option::Option::Some(v.into());
5771 self
5772 }
5773
5774 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5778 where
5779 T: std::convert::Into<crate::model::Hub>,
5780 {
5781 self.0.request.hub = v.map(|x| x.into());
5782 self
5783 }
5784
5785 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5787 self.0.request.request_id = v.into();
5788 self
5789 }
5790 }
5791
5792 #[doc(hidden)]
5793 impl crate::RequestBuilder for UpdateHub {
5794 fn request_options(&mut self) -> &mut crate::RequestOptions {
5795 &mut self.0.options
5796 }
5797 }
5798
5799 #[derive(Clone, Debug)]
5817 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5818
5819 impl DeleteHub {
5820 pub(crate) fn new(
5821 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5822 ) -> Self {
5823 Self(RequestBuilder::new(stub))
5824 }
5825
5826 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5828 self.0.request = v.into();
5829 self
5830 }
5831
5832 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5834 self.0.options = v.into();
5835 self
5836 }
5837
5838 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5845 (*self.0.stub)
5846 .delete_hub(self.0.request, self.0.options)
5847 .await
5848 .map(crate::Response::into_body)
5849 }
5850
5851 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5853 type Operation =
5854 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5855 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5856 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5857
5858 let stub = self.0.stub.clone();
5859 let mut options = self.0.options.clone();
5860 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5861 let query = move |name| {
5862 let stub = stub.clone();
5863 let options = options.clone();
5864 async {
5865 let op = GetOperation::new(stub)
5866 .set_name(name)
5867 .with_options(options)
5868 .send()
5869 .await?;
5870 Ok(Operation::new(op))
5871 }
5872 };
5873
5874 let start = move || async {
5875 let op = self.send().await?;
5876 Ok(Operation::new(op))
5877 };
5878
5879 google_cloud_lro::internal::new_unit_response_poller(
5880 polling_error_policy,
5881 polling_backoff_policy,
5882 start,
5883 query,
5884 )
5885 }
5886
5887 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5891 self.0.request.name = v.into();
5892 self
5893 }
5894
5895 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5897 self.0.request.request_id = v.into();
5898 self
5899 }
5900 }
5901
5902 #[doc(hidden)]
5903 impl crate::RequestBuilder for DeleteHub {
5904 fn request_options(&mut self) -> &mut crate::RequestOptions {
5905 &mut self.0.options
5906 }
5907 }
5908
5909 #[derive(Clone, Debug)]
5930 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5931
5932 impl ListHubSpokes {
5933 pub(crate) fn new(
5934 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5935 ) -> Self {
5936 Self(RequestBuilder::new(stub))
5937 }
5938
5939 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5941 self.0.request = v.into();
5942 self
5943 }
5944
5945 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5947 self.0.options = v.into();
5948 self
5949 }
5950
5951 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5953 (*self.0.stub)
5954 .list_hub_spokes(self.0.request, self.0.options)
5955 .await
5956 .map(crate::Response::into_body)
5957 }
5958
5959 pub fn by_page(
5961 self,
5962 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubSpokesResponse, crate::Error>
5963 {
5964 use std::clone::Clone;
5965 let token = self.0.request.page_token.clone();
5966 let execute = move |token: String| {
5967 let mut builder = self.clone();
5968 builder.0.request = builder.0.request.set_page_token(token);
5969 builder.send()
5970 };
5971 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5972 }
5973
5974 pub fn by_item(
5976 self,
5977 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5978 crate::model::ListHubSpokesResponse,
5979 crate::Error,
5980 > {
5981 use google_cloud_gax::paginator::Paginator;
5982 self.by_page().items()
5983 }
5984
5985 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5989 self.0.request.name = v.into();
5990 self
5991 }
5992
5993 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5995 where
5996 T: std::iter::IntoIterator<Item = V>,
5997 V: std::convert::Into<std::string::String>,
5998 {
5999 use std::iter::Iterator;
6000 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
6001 self
6002 }
6003
6004 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6006 self.0.request.page_size = v.into();
6007 self
6008 }
6009
6010 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6012 self.0.request.page_token = v.into();
6013 self
6014 }
6015
6016 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6018 self.0.request.filter = v.into();
6019 self
6020 }
6021
6022 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6024 self.0.request.order_by = v.into();
6025 self
6026 }
6027
6028 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
6030 mut self,
6031 v: T,
6032 ) -> Self {
6033 self.0.request.view = v.into();
6034 self
6035 }
6036 }
6037
6038 #[doc(hidden)]
6039 impl crate::RequestBuilder for ListHubSpokes {
6040 fn request_options(&mut self) -> &mut crate::RequestOptions {
6041 &mut self.0.options
6042 }
6043 }
6044
6045 #[derive(Clone, Debug)]
6066 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
6067
6068 impl QueryHubStatus {
6069 pub(crate) fn new(
6070 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6071 ) -> Self {
6072 Self(RequestBuilder::new(stub))
6073 }
6074
6075 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
6077 self.0.request = v.into();
6078 self
6079 }
6080
6081 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6083 self.0.options = v.into();
6084 self
6085 }
6086
6087 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
6089 (*self.0.stub)
6090 .query_hub_status(self.0.request, self.0.options)
6091 .await
6092 .map(crate::Response::into_body)
6093 }
6094
6095 pub fn by_page(
6097 self,
6098 ) -> impl google_cloud_gax::paginator::Paginator<
6099 crate::model::QueryHubStatusResponse,
6100 crate::Error,
6101 > {
6102 use std::clone::Clone;
6103 let token = self.0.request.page_token.clone();
6104 let execute = move |token: String| {
6105 let mut builder = self.clone();
6106 builder.0.request = builder.0.request.set_page_token(token);
6107 builder.send()
6108 };
6109 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6110 }
6111
6112 pub fn by_item(
6114 self,
6115 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6116 crate::model::QueryHubStatusResponse,
6117 crate::Error,
6118 > {
6119 use google_cloud_gax::paginator::Paginator;
6120 self.by_page().items()
6121 }
6122
6123 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6127 self.0.request.name = v.into();
6128 self
6129 }
6130
6131 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6133 self.0.request.page_size = v.into();
6134 self
6135 }
6136
6137 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6139 self.0.request.page_token = v.into();
6140 self
6141 }
6142
6143 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6145 self.0.request.filter = v.into();
6146 self
6147 }
6148
6149 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6151 self.0.request.order_by = v.into();
6152 self
6153 }
6154
6155 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6157 self.0.request.group_by = v.into();
6158 self
6159 }
6160 }
6161
6162 #[doc(hidden)]
6163 impl crate::RequestBuilder for QueryHubStatus {
6164 fn request_options(&mut self) -> &mut crate::RequestOptions {
6165 &mut self.0.options
6166 }
6167 }
6168
6169 #[derive(Clone, Debug)]
6190 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6191
6192 impl ListSpokes {
6193 pub(crate) fn new(
6194 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6195 ) -> Self {
6196 Self(RequestBuilder::new(stub))
6197 }
6198
6199 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6201 self.0.request = v.into();
6202 self
6203 }
6204
6205 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6207 self.0.options = v.into();
6208 self
6209 }
6210
6211 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6213 (*self.0.stub)
6214 .list_spokes(self.0.request, self.0.options)
6215 .await
6216 .map(crate::Response::into_body)
6217 }
6218
6219 pub fn by_page(
6221 self,
6222 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSpokesResponse, crate::Error>
6223 {
6224 use std::clone::Clone;
6225 let token = self.0.request.page_token.clone();
6226 let execute = move |token: String| {
6227 let mut builder = self.clone();
6228 builder.0.request = builder.0.request.set_page_token(token);
6229 builder.send()
6230 };
6231 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6232 }
6233
6234 pub fn by_item(
6236 self,
6237 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6238 crate::model::ListSpokesResponse,
6239 crate::Error,
6240 > {
6241 use google_cloud_gax::paginator::Paginator;
6242 self.by_page().items()
6243 }
6244
6245 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6249 self.0.request.parent = v.into();
6250 self
6251 }
6252
6253 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6255 self.0.request.page_size = v.into();
6256 self
6257 }
6258
6259 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6261 self.0.request.page_token = v.into();
6262 self
6263 }
6264
6265 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6267 self.0.request.filter = v.into();
6268 self
6269 }
6270
6271 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6273 self.0.request.order_by = v.into();
6274 self
6275 }
6276 }
6277
6278 #[doc(hidden)]
6279 impl crate::RequestBuilder for ListSpokes {
6280 fn request_options(&mut self) -> &mut crate::RequestOptions {
6281 &mut self.0.options
6282 }
6283 }
6284
6285 #[derive(Clone, Debug)]
6302 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6303
6304 impl GetSpoke {
6305 pub(crate) fn new(
6306 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6307 ) -> Self {
6308 Self(RequestBuilder::new(stub))
6309 }
6310
6311 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6313 self.0.request = v.into();
6314 self
6315 }
6316
6317 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6319 self.0.options = v.into();
6320 self
6321 }
6322
6323 pub async fn send(self) -> Result<crate::model::Spoke> {
6325 (*self.0.stub)
6326 .get_spoke(self.0.request, self.0.options)
6327 .await
6328 .map(crate::Response::into_body)
6329 }
6330
6331 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6335 self.0.request.name = v.into();
6336 self
6337 }
6338 }
6339
6340 #[doc(hidden)]
6341 impl crate::RequestBuilder for GetSpoke {
6342 fn request_options(&mut self) -> &mut crate::RequestOptions {
6343 &mut self.0.options
6344 }
6345 }
6346
6347 #[derive(Clone, Debug)]
6365 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6366
6367 impl CreateSpoke {
6368 pub(crate) fn new(
6369 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6370 ) -> Self {
6371 Self(RequestBuilder::new(stub))
6372 }
6373
6374 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6376 self.0.request = v.into();
6377 self
6378 }
6379
6380 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6382 self.0.options = v.into();
6383 self
6384 }
6385
6386 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6393 (*self.0.stub)
6394 .create_spoke(self.0.request, self.0.options)
6395 .await
6396 .map(crate::Response::into_body)
6397 }
6398
6399 pub fn poller(
6401 self,
6402 ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6403 {
6404 type Operation = google_cloud_lro::internal::Operation<
6405 crate::model::Spoke,
6406 crate::model::OperationMetadata,
6407 >;
6408 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6409 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6410
6411 let stub = self.0.stub.clone();
6412 let mut options = self.0.options.clone();
6413 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6414 let query = move |name| {
6415 let stub = stub.clone();
6416 let options = options.clone();
6417 async {
6418 let op = GetOperation::new(stub)
6419 .set_name(name)
6420 .with_options(options)
6421 .send()
6422 .await?;
6423 Ok(Operation::new(op))
6424 }
6425 };
6426
6427 let start = move || async {
6428 let op = self.send().await?;
6429 Ok(Operation::new(op))
6430 };
6431
6432 google_cloud_lro::internal::new_poller(
6433 polling_error_policy,
6434 polling_backoff_policy,
6435 start,
6436 query,
6437 )
6438 }
6439
6440 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6444 self.0.request.parent = v.into();
6445 self
6446 }
6447
6448 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6452 self.0.request.spoke_id = v.into();
6453 self
6454 }
6455
6456 pub fn set_spoke<T>(mut self, v: T) -> Self
6460 where
6461 T: std::convert::Into<crate::model::Spoke>,
6462 {
6463 self.0.request.spoke = std::option::Option::Some(v.into());
6464 self
6465 }
6466
6467 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6471 where
6472 T: std::convert::Into<crate::model::Spoke>,
6473 {
6474 self.0.request.spoke = v.map(|x| x.into());
6475 self
6476 }
6477
6478 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6480 self.0.request.request_id = v.into();
6481 self
6482 }
6483 }
6484
6485 #[doc(hidden)]
6486 impl crate::RequestBuilder for CreateSpoke {
6487 fn request_options(&mut self) -> &mut crate::RequestOptions {
6488 &mut self.0.options
6489 }
6490 }
6491
6492 #[derive(Clone, Debug)]
6510 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6511
6512 impl UpdateSpoke {
6513 pub(crate) fn new(
6514 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6515 ) -> Self {
6516 Self(RequestBuilder::new(stub))
6517 }
6518
6519 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6521 self.0.request = v.into();
6522 self
6523 }
6524
6525 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6527 self.0.options = v.into();
6528 self
6529 }
6530
6531 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6538 (*self.0.stub)
6539 .update_spoke(self.0.request, self.0.options)
6540 .await
6541 .map(crate::Response::into_body)
6542 }
6543
6544 pub fn poller(
6546 self,
6547 ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6548 {
6549 type Operation = google_cloud_lro::internal::Operation<
6550 crate::model::Spoke,
6551 crate::model::OperationMetadata,
6552 >;
6553 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6554 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6555
6556 let stub = self.0.stub.clone();
6557 let mut options = self.0.options.clone();
6558 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6559 let query = move |name| {
6560 let stub = stub.clone();
6561 let options = options.clone();
6562 async {
6563 let op = GetOperation::new(stub)
6564 .set_name(name)
6565 .with_options(options)
6566 .send()
6567 .await?;
6568 Ok(Operation::new(op))
6569 }
6570 };
6571
6572 let start = move || async {
6573 let op = self.send().await?;
6574 Ok(Operation::new(op))
6575 };
6576
6577 google_cloud_lro::internal::new_poller(
6578 polling_error_policy,
6579 polling_backoff_policy,
6580 start,
6581 query,
6582 )
6583 }
6584
6585 pub fn set_update_mask<T>(mut self, v: T) -> Self
6587 where
6588 T: std::convert::Into<wkt::FieldMask>,
6589 {
6590 self.0.request.update_mask = std::option::Option::Some(v.into());
6591 self
6592 }
6593
6594 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6596 where
6597 T: std::convert::Into<wkt::FieldMask>,
6598 {
6599 self.0.request.update_mask = v.map(|x| x.into());
6600 self
6601 }
6602
6603 pub fn set_spoke<T>(mut self, v: T) -> Self
6607 where
6608 T: std::convert::Into<crate::model::Spoke>,
6609 {
6610 self.0.request.spoke = std::option::Option::Some(v.into());
6611 self
6612 }
6613
6614 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6618 where
6619 T: std::convert::Into<crate::model::Spoke>,
6620 {
6621 self.0.request.spoke = v.map(|x| x.into());
6622 self
6623 }
6624
6625 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6627 self.0.request.request_id = v.into();
6628 self
6629 }
6630 }
6631
6632 #[doc(hidden)]
6633 impl crate::RequestBuilder for UpdateSpoke {
6634 fn request_options(&mut self) -> &mut crate::RequestOptions {
6635 &mut self.0.options
6636 }
6637 }
6638
6639 #[derive(Clone, Debug)]
6657 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6658
6659 impl RejectHubSpoke {
6660 pub(crate) fn new(
6661 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6662 ) -> Self {
6663 Self(RequestBuilder::new(stub))
6664 }
6665
6666 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6668 self.0.request = v.into();
6669 self
6670 }
6671
6672 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6674 self.0.options = v.into();
6675 self
6676 }
6677
6678 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6685 (*self.0.stub)
6686 .reject_hub_spoke(self.0.request, self.0.options)
6687 .await
6688 .map(crate::Response::into_body)
6689 }
6690
6691 pub fn poller(
6693 self,
6694 ) -> impl google_cloud_lro::Poller<
6695 crate::model::RejectHubSpokeResponse,
6696 crate::model::OperationMetadata,
6697 > {
6698 type Operation = google_cloud_lro::internal::Operation<
6699 crate::model::RejectHubSpokeResponse,
6700 crate::model::OperationMetadata,
6701 >;
6702 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6703 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6704
6705 let stub = self.0.stub.clone();
6706 let mut options = self.0.options.clone();
6707 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6708 let query = move |name| {
6709 let stub = stub.clone();
6710 let options = options.clone();
6711 async {
6712 let op = GetOperation::new(stub)
6713 .set_name(name)
6714 .with_options(options)
6715 .send()
6716 .await?;
6717 Ok(Operation::new(op))
6718 }
6719 };
6720
6721 let start = move || async {
6722 let op = self.send().await?;
6723 Ok(Operation::new(op))
6724 };
6725
6726 google_cloud_lro::internal::new_poller(
6727 polling_error_policy,
6728 polling_backoff_policy,
6729 start,
6730 query,
6731 )
6732 }
6733
6734 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6738 self.0.request.name = v.into();
6739 self
6740 }
6741
6742 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6746 self.0.request.spoke_uri = v.into();
6747 self
6748 }
6749
6750 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6752 self.0.request.request_id = v.into();
6753 self
6754 }
6755
6756 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6758 self.0.request.details = v.into();
6759 self
6760 }
6761 }
6762
6763 #[doc(hidden)]
6764 impl crate::RequestBuilder for RejectHubSpoke {
6765 fn request_options(&mut self) -> &mut crate::RequestOptions {
6766 &mut self.0.options
6767 }
6768 }
6769
6770 #[derive(Clone, Debug)]
6788 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6789
6790 impl AcceptHubSpoke {
6791 pub(crate) fn new(
6792 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6793 ) -> Self {
6794 Self(RequestBuilder::new(stub))
6795 }
6796
6797 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6799 self.0.request = v.into();
6800 self
6801 }
6802
6803 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6805 self.0.options = v.into();
6806 self
6807 }
6808
6809 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6816 (*self.0.stub)
6817 .accept_hub_spoke(self.0.request, self.0.options)
6818 .await
6819 .map(crate::Response::into_body)
6820 }
6821
6822 pub fn poller(
6824 self,
6825 ) -> impl google_cloud_lro::Poller<
6826 crate::model::AcceptHubSpokeResponse,
6827 crate::model::OperationMetadata,
6828 > {
6829 type Operation = google_cloud_lro::internal::Operation<
6830 crate::model::AcceptHubSpokeResponse,
6831 crate::model::OperationMetadata,
6832 >;
6833 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6834 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6835
6836 let stub = self.0.stub.clone();
6837 let mut options = self.0.options.clone();
6838 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6839 let query = move |name| {
6840 let stub = stub.clone();
6841 let options = options.clone();
6842 async {
6843 let op = GetOperation::new(stub)
6844 .set_name(name)
6845 .with_options(options)
6846 .send()
6847 .await?;
6848 Ok(Operation::new(op))
6849 }
6850 };
6851
6852 let start = move || async {
6853 let op = self.send().await?;
6854 Ok(Operation::new(op))
6855 };
6856
6857 google_cloud_lro::internal::new_poller(
6858 polling_error_policy,
6859 polling_backoff_policy,
6860 start,
6861 query,
6862 )
6863 }
6864
6865 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6869 self.0.request.name = v.into();
6870 self
6871 }
6872
6873 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6877 self.0.request.spoke_uri = v.into();
6878 self
6879 }
6880
6881 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6883 self.0.request.request_id = v.into();
6884 self
6885 }
6886 }
6887
6888 #[doc(hidden)]
6889 impl crate::RequestBuilder for AcceptHubSpoke {
6890 fn request_options(&mut self) -> &mut crate::RequestOptions {
6891 &mut self.0.options
6892 }
6893 }
6894
6895 #[derive(Clone, Debug)]
6913 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6914
6915 impl AcceptSpokeUpdate {
6916 pub(crate) fn new(
6917 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6918 ) -> Self {
6919 Self(RequestBuilder::new(stub))
6920 }
6921
6922 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6924 mut self,
6925 v: V,
6926 ) -> Self {
6927 self.0.request = v.into();
6928 self
6929 }
6930
6931 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6933 self.0.options = v.into();
6934 self
6935 }
6936
6937 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6944 (*self.0.stub)
6945 .accept_spoke_update(self.0.request, self.0.options)
6946 .await
6947 .map(crate::Response::into_body)
6948 }
6949
6950 pub fn poller(
6952 self,
6953 ) -> impl google_cloud_lro::Poller<
6954 crate::model::AcceptSpokeUpdateResponse,
6955 crate::model::OperationMetadata,
6956 > {
6957 type Operation = google_cloud_lro::internal::Operation<
6958 crate::model::AcceptSpokeUpdateResponse,
6959 crate::model::OperationMetadata,
6960 >;
6961 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6962 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6963
6964 let stub = self.0.stub.clone();
6965 let mut options = self.0.options.clone();
6966 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6967 let query = move |name| {
6968 let stub = stub.clone();
6969 let options = options.clone();
6970 async {
6971 let op = GetOperation::new(stub)
6972 .set_name(name)
6973 .with_options(options)
6974 .send()
6975 .await?;
6976 Ok(Operation::new(op))
6977 }
6978 };
6979
6980 let start = move || async {
6981 let op = self.send().await?;
6982 Ok(Operation::new(op))
6983 };
6984
6985 google_cloud_lro::internal::new_poller(
6986 polling_error_policy,
6987 polling_backoff_policy,
6988 start,
6989 query,
6990 )
6991 }
6992
6993 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6997 self.0.request.name = v.into();
6998 self
6999 }
7000
7001 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7005 self.0.request.spoke_uri = v.into();
7006 self
7007 }
7008
7009 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7013 self.0.request.spoke_etag = v.into();
7014 self
7015 }
7016
7017 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7019 self.0.request.request_id = v.into();
7020 self
7021 }
7022 }
7023
7024 #[doc(hidden)]
7025 impl crate::RequestBuilder for AcceptSpokeUpdate {
7026 fn request_options(&mut self) -> &mut crate::RequestOptions {
7027 &mut self.0.options
7028 }
7029 }
7030
7031 #[derive(Clone, Debug)]
7049 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
7050
7051 impl RejectSpokeUpdate {
7052 pub(crate) fn new(
7053 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7054 ) -> Self {
7055 Self(RequestBuilder::new(stub))
7056 }
7057
7058 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
7060 mut self,
7061 v: V,
7062 ) -> Self {
7063 self.0.request = v.into();
7064 self
7065 }
7066
7067 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7069 self.0.options = v.into();
7070 self
7071 }
7072
7073 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7080 (*self.0.stub)
7081 .reject_spoke_update(self.0.request, self.0.options)
7082 .await
7083 .map(crate::Response::into_body)
7084 }
7085
7086 pub fn poller(
7088 self,
7089 ) -> impl google_cloud_lro::Poller<
7090 crate::model::RejectSpokeUpdateResponse,
7091 crate::model::OperationMetadata,
7092 > {
7093 type Operation = google_cloud_lro::internal::Operation<
7094 crate::model::RejectSpokeUpdateResponse,
7095 crate::model::OperationMetadata,
7096 >;
7097 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7098 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7099
7100 let stub = self.0.stub.clone();
7101 let mut options = self.0.options.clone();
7102 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7103 let query = move |name| {
7104 let stub = stub.clone();
7105 let options = options.clone();
7106 async {
7107 let op = GetOperation::new(stub)
7108 .set_name(name)
7109 .with_options(options)
7110 .send()
7111 .await?;
7112 Ok(Operation::new(op))
7113 }
7114 };
7115
7116 let start = move || async {
7117 let op = self.send().await?;
7118 Ok(Operation::new(op))
7119 };
7120
7121 google_cloud_lro::internal::new_poller(
7122 polling_error_policy,
7123 polling_backoff_policy,
7124 start,
7125 query,
7126 )
7127 }
7128
7129 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7133 self.0.request.name = v.into();
7134 self
7135 }
7136
7137 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7141 self.0.request.spoke_uri = v.into();
7142 self
7143 }
7144
7145 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7149 self.0.request.spoke_etag = v.into();
7150 self
7151 }
7152
7153 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7155 self.0.request.details = v.into();
7156 self
7157 }
7158
7159 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7161 self.0.request.request_id = v.into();
7162 self
7163 }
7164 }
7165
7166 #[doc(hidden)]
7167 impl crate::RequestBuilder for RejectSpokeUpdate {
7168 fn request_options(&mut self) -> &mut crate::RequestOptions {
7169 &mut self.0.options
7170 }
7171 }
7172
7173 #[derive(Clone, Debug)]
7191 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7192
7193 impl DeleteSpoke {
7194 pub(crate) fn new(
7195 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7196 ) -> Self {
7197 Self(RequestBuilder::new(stub))
7198 }
7199
7200 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7202 self.0.request = v.into();
7203 self
7204 }
7205
7206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7208 self.0.options = v.into();
7209 self
7210 }
7211
7212 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7219 (*self.0.stub)
7220 .delete_spoke(self.0.request, self.0.options)
7221 .await
7222 .map(crate::Response::into_body)
7223 }
7224
7225 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7227 type Operation =
7228 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7229 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7230 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7231
7232 let stub = self.0.stub.clone();
7233 let mut options = self.0.options.clone();
7234 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7235 let query = move |name| {
7236 let stub = stub.clone();
7237 let options = options.clone();
7238 async {
7239 let op = GetOperation::new(stub)
7240 .set_name(name)
7241 .with_options(options)
7242 .send()
7243 .await?;
7244 Ok(Operation::new(op))
7245 }
7246 };
7247
7248 let start = move || async {
7249 let op = self.send().await?;
7250 Ok(Operation::new(op))
7251 };
7252
7253 google_cloud_lro::internal::new_unit_response_poller(
7254 polling_error_policy,
7255 polling_backoff_policy,
7256 start,
7257 query,
7258 )
7259 }
7260
7261 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7265 self.0.request.name = v.into();
7266 self
7267 }
7268
7269 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7271 self.0.request.request_id = v.into();
7272 self
7273 }
7274 }
7275
7276 #[doc(hidden)]
7277 impl crate::RequestBuilder for DeleteSpoke {
7278 fn request_options(&mut self) -> &mut crate::RequestOptions {
7279 &mut self.0.options
7280 }
7281 }
7282
7283 #[derive(Clone, Debug)]
7300 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7301
7302 impl GetRouteTable {
7303 pub(crate) fn new(
7304 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7305 ) -> Self {
7306 Self(RequestBuilder::new(stub))
7307 }
7308
7309 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7311 self.0.request = v.into();
7312 self
7313 }
7314
7315 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7317 self.0.options = v.into();
7318 self
7319 }
7320
7321 pub async fn send(self) -> Result<crate::model::RouteTable> {
7323 (*self.0.stub)
7324 .get_route_table(self.0.request, self.0.options)
7325 .await
7326 .map(crate::Response::into_body)
7327 }
7328
7329 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7333 self.0.request.name = v.into();
7334 self
7335 }
7336 }
7337
7338 #[doc(hidden)]
7339 impl crate::RequestBuilder for GetRouteTable {
7340 fn request_options(&mut self) -> &mut crate::RequestOptions {
7341 &mut self.0.options
7342 }
7343 }
7344
7345 #[derive(Clone, Debug)]
7362 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7363
7364 impl GetRoute {
7365 pub(crate) fn new(
7366 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7367 ) -> Self {
7368 Self(RequestBuilder::new(stub))
7369 }
7370
7371 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7373 self.0.request = v.into();
7374 self
7375 }
7376
7377 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7379 self.0.options = v.into();
7380 self
7381 }
7382
7383 pub async fn send(self) -> Result<crate::model::Route> {
7385 (*self.0.stub)
7386 .get_route(self.0.request, self.0.options)
7387 .await
7388 .map(crate::Response::into_body)
7389 }
7390
7391 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7395 self.0.request.name = v.into();
7396 self
7397 }
7398 }
7399
7400 #[doc(hidden)]
7401 impl crate::RequestBuilder for GetRoute {
7402 fn request_options(&mut self) -> &mut crate::RequestOptions {
7403 &mut self.0.options
7404 }
7405 }
7406
7407 #[derive(Clone, Debug)]
7428 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7429
7430 impl ListRoutes {
7431 pub(crate) fn new(
7432 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7433 ) -> Self {
7434 Self(RequestBuilder::new(stub))
7435 }
7436
7437 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7439 self.0.request = v.into();
7440 self
7441 }
7442
7443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7445 self.0.options = v.into();
7446 self
7447 }
7448
7449 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7451 (*self.0.stub)
7452 .list_routes(self.0.request, self.0.options)
7453 .await
7454 .map(crate::Response::into_body)
7455 }
7456
7457 pub fn by_page(
7459 self,
7460 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutesResponse, crate::Error>
7461 {
7462 use std::clone::Clone;
7463 let token = self.0.request.page_token.clone();
7464 let execute = move |token: String| {
7465 let mut builder = self.clone();
7466 builder.0.request = builder.0.request.set_page_token(token);
7467 builder.send()
7468 };
7469 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7470 }
7471
7472 pub fn by_item(
7474 self,
7475 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7476 crate::model::ListRoutesResponse,
7477 crate::Error,
7478 > {
7479 use google_cloud_gax::paginator::Paginator;
7480 self.by_page().items()
7481 }
7482
7483 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7487 self.0.request.parent = v.into();
7488 self
7489 }
7490
7491 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7493 self.0.request.page_size = v.into();
7494 self
7495 }
7496
7497 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7499 self.0.request.page_token = v.into();
7500 self
7501 }
7502
7503 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7505 self.0.request.filter = v.into();
7506 self
7507 }
7508
7509 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7511 self.0.request.order_by = v.into();
7512 self
7513 }
7514 }
7515
7516 #[doc(hidden)]
7517 impl crate::RequestBuilder for ListRoutes {
7518 fn request_options(&mut self) -> &mut crate::RequestOptions {
7519 &mut self.0.options
7520 }
7521 }
7522
7523 #[derive(Clone, Debug)]
7544 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7545
7546 impl ListRouteTables {
7547 pub(crate) fn new(
7548 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7549 ) -> Self {
7550 Self(RequestBuilder::new(stub))
7551 }
7552
7553 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7555 self.0.request = v.into();
7556 self
7557 }
7558
7559 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7561 self.0.options = v.into();
7562 self
7563 }
7564
7565 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7567 (*self.0.stub)
7568 .list_route_tables(self.0.request, self.0.options)
7569 .await
7570 .map(crate::Response::into_body)
7571 }
7572
7573 pub fn by_page(
7575 self,
7576 ) -> impl google_cloud_gax::paginator::Paginator<
7577 crate::model::ListRouteTablesResponse,
7578 crate::Error,
7579 > {
7580 use std::clone::Clone;
7581 let token = self.0.request.page_token.clone();
7582 let execute = move |token: String| {
7583 let mut builder = self.clone();
7584 builder.0.request = builder.0.request.set_page_token(token);
7585 builder.send()
7586 };
7587 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7588 }
7589
7590 pub fn by_item(
7592 self,
7593 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7594 crate::model::ListRouteTablesResponse,
7595 crate::Error,
7596 > {
7597 use google_cloud_gax::paginator::Paginator;
7598 self.by_page().items()
7599 }
7600
7601 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7605 self.0.request.parent = v.into();
7606 self
7607 }
7608
7609 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7611 self.0.request.page_size = v.into();
7612 self
7613 }
7614
7615 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7617 self.0.request.page_token = v.into();
7618 self
7619 }
7620
7621 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7623 self.0.request.filter = v.into();
7624 self
7625 }
7626
7627 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7629 self.0.request.order_by = v.into();
7630 self
7631 }
7632 }
7633
7634 #[doc(hidden)]
7635 impl crate::RequestBuilder for ListRouteTables {
7636 fn request_options(&mut self) -> &mut crate::RequestOptions {
7637 &mut self.0.options
7638 }
7639 }
7640
7641 #[derive(Clone, Debug)]
7658 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7659
7660 impl GetGroup {
7661 pub(crate) fn new(
7662 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7663 ) -> Self {
7664 Self(RequestBuilder::new(stub))
7665 }
7666
7667 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7669 self.0.request = v.into();
7670 self
7671 }
7672
7673 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7675 self.0.options = v.into();
7676 self
7677 }
7678
7679 pub async fn send(self) -> Result<crate::model::Group> {
7681 (*self.0.stub)
7682 .get_group(self.0.request, self.0.options)
7683 .await
7684 .map(crate::Response::into_body)
7685 }
7686
7687 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7691 self.0.request.name = v.into();
7692 self
7693 }
7694 }
7695
7696 #[doc(hidden)]
7697 impl crate::RequestBuilder for GetGroup {
7698 fn request_options(&mut self) -> &mut crate::RequestOptions {
7699 &mut self.0.options
7700 }
7701 }
7702
7703 #[derive(Clone, Debug)]
7724 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7725
7726 impl ListGroups {
7727 pub(crate) fn new(
7728 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7729 ) -> Self {
7730 Self(RequestBuilder::new(stub))
7731 }
7732
7733 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7735 self.0.request = v.into();
7736 self
7737 }
7738
7739 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7741 self.0.options = v.into();
7742 self
7743 }
7744
7745 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7747 (*self.0.stub)
7748 .list_groups(self.0.request, self.0.options)
7749 .await
7750 .map(crate::Response::into_body)
7751 }
7752
7753 pub fn by_page(
7755 self,
7756 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListGroupsResponse, crate::Error>
7757 {
7758 use std::clone::Clone;
7759 let token = self.0.request.page_token.clone();
7760 let execute = move |token: String| {
7761 let mut builder = self.clone();
7762 builder.0.request = builder.0.request.set_page_token(token);
7763 builder.send()
7764 };
7765 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7766 }
7767
7768 pub fn by_item(
7770 self,
7771 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7772 crate::model::ListGroupsResponse,
7773 crate::Error,
7774 > {
7775 use google_cloud_gax::paginator::Paginator;
7776 self.by_page().items()
7777 }
7778
7779 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7783 self.0.request.parent = v.into();
7784 self
7785 }
7786
7787 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7789 self.0.request.page_size = v.into();
7790 self
7791 }
7792
7793 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7795 self.0.request.page_token = v.into();
7796 self
7797 }
7798
7799 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7801 self.0.request.filter = v.into();
7802 self
7803 }
7804
7805 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7807 self.0.request.order_by = v.into();
7808 self
7809 }
7810 }
7811
7812 #[doc(hidden)]
7813 impl crate::RequestBuilder for ListGroups {
7814 fn request_options(&mut self) -> &mut crate::RequestOptions {
7815 &mut self.0.options
7816 }
7817 }
7818
7819 #[derive(Clone, Debug)]
7837 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7838
7839 impl UpdateGroup {
7840 pub(crate) fn new(
7841 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7842 ) -> Self {
7843 Self(RequestBuilder::new(stub))
7844 }
7845
7846 pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7848 self.0.request = v.into();
7849 self
7850 }
7851
7852 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7854 self.0.options = v.into();
7855 self
7856 }
7857
7858 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7865 (*self.0.stub)
7866 .update_group(self.0.request, self.0.options)
7867 .await
7868 .map(crate::Response::into_body)
7869 }
7870
7871 pub fn poller(
7873 self,
7874 ) -> impl google_cloud_lro::Poller<crate::model::Group, crate::model::OperationMetadata>
7875 {
7876 type Operation = google_cloud_lro::internal::Operation<
7877 crate::model::Group,
7878 crate::model::OperationMetadata,
7879 >;
7880 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7881 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7882
7883 let stub = self.0.stub.clone();
7884 let mut options = self.0.options.clone();
7885 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7886 let query = move |name| {
7887 let stub = stub.clone();
7888 let options = options.clone();
7889 async {
7890 let op = GetOperation::new(stub)
7891 .set_name(name)
7892 .with_options(options)
7893 .send()
7894 .await?;
7895 Ok(Operation::new(op))
7896 }
7897 };
7898
7899 let start = move || async {
7900 let op = self.send().await?;
7901 Ok(Operation::new(op))
7902 };
7903
7904 google_cloud_lro::internal::new_poller(
7905 polling_error_policy,
7906 polling_backoff_policy,
7907 start,
7908 query,
7909 )
7910 }
7911
7912 pub fn set_update_mask<T>(mut self, v: T) -> Self
7914 where
7915 T: std::convert::Into<wkt::FieldMask>,
7916 {
7917 self.0.request.update_mask = std::option::Option::Some(v.into());
7918 self
7919 }
7920
7921 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7923 where
7924 T: std::convert::Into<wkt::FieldMask>,
7925 {
7926 self.0.request.update_mask = v.map(|x| x.into());
7927 self
7928 }
7929
7930 pub fn set_group<T>(mut self, v: T) -> Self
7934 where
7935 T: std::convert::Into<crate::model::Group>,
7936 {
7937 self.0.request.group = std::option::Option::Some(v.into());
7938 self
7939 }
7940
7941 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7945 where
7946 T: std::convert::Into<crate::model::Group>,
7947 {
7948 self.0.request.group = v.map(|x| x.into());
7949 self
7950 }
7951
7952 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7954 self.0.request.request_id = v.into();
7955 self
7956 }
7957 }
7958
7959 #[doc(hidden)]
7960 impl crate::RequestBuilder for UpdateGroup {
7961 fn request_options(&mut self) -> &mut crate::RequestOptions {
7962 &mut self.0.options
7963 }
7964 }
7965
7966 #[derive(Clone, Debug)]
7987 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7988
7989 impl ListLocations {
7990 pub(crate) fn new(
7991 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7992 ) -> Self {
7993 Self(RequestBuilder::new(stub))
7994 }
7995
7996 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7998 mut self,
7999 v: V,
8000 ) -> Self {
8001 self.0.request = v.into();
8002 self
8003 }
8004
8005 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8007 self.0.options = v.into();
8008 self
8009 }
8010
8011 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8013 (*self.0.stub)
8014 .list_locations(self.0.request, self.0.options)
8015 .await
8016 .map(crate::Response::into_body)
8017 }
8018
8019 pub fn by_page(
8021 self,
8022 ) -> impl google_cloud_gax::paginator::Paginator<
8023 google_cloud_location::model::ListLocationsResponse,
8024 crate::Error,
8025 > {
8026 use std::clone::Clone;
8027 let token = self.0.request.page_token.clone();
8028 let execute = move |token: String| {
8029 let mut builder = self.clone();
8030 builder.0.request = builder.0.request.set_page_token(token);
8031 builder.send()
8032 };
8033 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8034 }
8035
8036 pub fn by_item(
8038 self,
8039 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8040 google_cloud_location::model::ListLocationsResponse,
8041 crate::Error,
8042 > {
8043 use google_cloud_gax::paginator::Paginator;
8044 self.by_page().items()
8045 }
8046
8047 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8049 self.0.request.name = v.into();
8050 self
8051 }
8052
8053 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8055 self.0.request.filter = v.into();
8056 self
8057 }
8058
8059 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8061 self.0.request.page_size = v.into();
8062 self
8063 }
8064
8065 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8067 self.0.request.page_token = v.into();
8068 self
8069 }
8070 }
8071
8072 #[doc(hidden)]
8073 impl crate::RequestBuilder for ListLocations {
8074 fn request_options(&mut self) -> &mut crate::RequestOptions {
8075 &mut self.0.options
8076 }
8077 }
8078
8079 #[derive(Clone, Debug)]
8096 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8097
8098 impl GetLocation {
8099 pub(crate) fn new(
8100 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8101 ) -> Self {
8102 Self(RequestBuilder::new(stub))
8103 }
8104
8105 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8107 mut self,
8108 v: V,
8109 ) -> Self {
8110 self.0.request = v.into();
8111 self
8112 }
8113
8114 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8116 self.0.options = v.into();
8117 self
8118 }
8119
8120 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8122 (*self.0.stub)
8123 .get_location(self.0.request, self.0.options)
8124 .await
8125 .map(crate::Response::into_body)
8126 }
8127
8128 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8130 self.0.request.name = v.into();
8131 self
8132 }
8133 }
8134
8135 #[doc(hidden)]
8136 impl crate::RequestBuilder for GetLocation {
8137 fn request_options(&mut self) -> &mut crate::RequestOptions {
8138 &mut self.0.options
8139 }
8140 }
8141
8142 #[derive(Clone, Debug)]
8159 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8160
8161 impl SetIamPolicy {
8162 pub(crate) fn new(
8163 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8164 ) -> Self {
8165 Self(RequestBuilder::new(stub))
8166 }
8167
8168 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8170 mut self,
8171 v: V,
8172 ) -> Self {
8173 self.0.request = v.into();
8174 self
8175 }
8176
8177 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8179 self.0.options = v.into();
8180 self
8181 }
8182
8183 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8185 (*self.0.stub)
8186 .set_iam_policy(self.0.request, self.0.options)
8187 .await
8188 .map(crate::Response::into_body)
8189 }
8190
8191 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8195 self.0.request.resource = v.into();
8196 self
8197 }
8198
8199 pub fn set_policy<T>(mut self, v: T) -> Self
8203 where
8204 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8205 {
8206 self.0.request.policy = std::option::Option::Some(v.into());
8207 self
8208 }
8209
8210 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8214 where
8215 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8216 {
8217 self.0.request.policy = v.map(|x| x.into());
8218 self
8219 }
8220
8221 pub fn set_update_mask<T>(mut self, v: T) -> Self
8223 where
8224 T: std::convert::Into<wkt::FieldMask>,
8225 {
8226 self.0.request.update_mask = std::option::Option::Some(v.into());
8227 self
8228 }
8229
8230 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8232 where
8233 T: std::convert::Into<wkt::FieldMask>,
8234 {
8235 self.0.request.update_mask = v.map(|x| x.into());
8236 self
8237 }
8238 }
8239
8240 #[doc(hidden)]
8241 impl crate::RequestBuilder for SetIamPolicy {
8242 fn request_options(&mut self) -> &mut crate::RequestOptions {
8243 &mut self.0.options
8244 }
8245 }
8246
8247 #[derive(Clone, Debug)]
8264 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8265
8266 impl GetIamPolicy {
8267 pub(crate) fn new(
8268 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8269 ) -> Self {
8270 Self(RequestBuilder::new(stub))
8271 }
8272
8273 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8275 mut self,
8276 v: V,
8277 ) -> Self {
8278 self.0.request = v.into();
8279 self
8280 }
8281
8282 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8284 self.0.options = v.into();
8285 self
8286 }
8287
8288 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8290 (*self.0.stub)
8291 .get_iam_policy(self.0.request, self.0.options)
8292 .await
8293 .map(crate::Response::into_body)
8294 }
8295
8296 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8300 self.0.request.resource = v.into();
8301 self
8302 }
8303
8304 pub fn set_options<T>(mut self, v: T) -> Self
8306 where
8307 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8308 {
8309 self.0.request.options = std::option::Option::Some(v.into());
8310 self
8311 }
8312
8313 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8315 where
8316 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8317 {
8318 self.0.request.options = v.map(|x| x.into());
8319 self
8320 }
8321 }
8322
8323 #[doc(hidden)]
8324 impl crate::RequestBuilder for GetIamPolicy {
8325 fn request_options(&mut self) -> &mut crate::RequestOptions {
8326 &mut self.0.options
8327 }
8328 }
8329
8330 #[derive(Clone, Debug)]
8347 pub struct TestIamPermissions(
8348 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8349 );
8350
8351 impl TestIamPermissions {
8352 pub(crate) fn new(
8353 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8354 ) -> Self {
8355 Self(RequestBuilder::new(stub))
8356 }
8357
8358 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8360 mut self,
8361 v: V,
8362 ) -> Self {
8363 self.0.request = v.into();
8364 self
8365 }
8366
8367 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8369 self.0.options = v.into();
8370 self
8371 }
8372
8373 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8375 (*self.0.stub)
8376 .test_iam_permissions(self.0.request, self.0.options)
8377 .await
8378 .map(crate::Response::into_body)
8379 }
8380
8381 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8385 self.0.request.resource = v.into();
8386 self
8387 }
8388
8389 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8393 where
8394 T: std::iter::IntoIterator<Item = V>,
8395 V: std::convert::Into<std::string::String>,
8396 {
8397 use std::iter::Iterator;
8398 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8399 self
8400 }
8401 }
8402
8403 #[doc(hidden)]
8404 impl crate::RequestBuilder for TestIamPermissions {
8405 fn request_options(&mut self) -> &mut crate::RequestOptions {
8406 &mut self.0.options
8407 }
8408 }
8409
8410 #[derive(Clone, Debug)]
8431 pub struct ListOperations(
8432 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8433 );
8434
8435 impl ListOperations {
8436 pub(crate) fn new(
8437 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8438 ) -> Self {
8439 Self(RequestBuilder::new(stub))
8440 }
8441
8442 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8444 mut self,
8445 v: V,
8446 ) -> Self {
8447 self.0.request = v.into();
8448 self
8449 }
8450
8451 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8453 self.0.options = v.into();
8454 self
8455 }
8456
8457 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8459 (*self.0.stub)
8460 .list_operations(self.0.request, self.0.options)
8461 .await
8462 .map(crate::Response::into_body)
8463 }
8464
8465 pub fn by_page(
8467 self,
8468 ) -> impl google_cloud_gax::paginator::Paginator<
8469 google_cloud_longrunning::model::ListOperationsResponse,
8470 crate::Error,
8471 > {
8472 use std::clone::Clone;
8473 let token = self.0.request.page_token.clone();
8474 let execute = move |token: String| {
8475 let mut builder = self.clone();
8476 builder.0.request = builder.0.request.set_page_token(token);
8477 builder.send()
8478 };
8479 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8480 }
8481
8482 pub fn by_item(
8484 self,
8485 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8486 google_cloud_longrunning::model::ListOperationsResponse,
8487 crate::Error,
8488 > {
8489 use google_cloud_gax::paginator::Paginator;
8490 self.by_page().items()
8491 }
8492
8493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8495 self.0.request.name = v.into();
8496 self
8497 }
8498
8499 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8501 self.0.request.filter = v.into();
8502 self
8503 }
8504
8505 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8507 self.0.request.page_size = v.into();
8508 self
8509 }
8510
8511 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8513 self.0.request.page_token = v.into();
8514 self
8515 }
8516
8517 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8519 self.0.request.return_partial_success = v.into();
8520 self
8521 }
8522 }
8523
8524 #[doc(hidden)]
8525 impl crate::RequestBuilder for ListOperations {
8526 fn request_options(&mut self) -> &mut crate::RequestOptions {
8527 &mut self.0.options
8528 }
8529 }
8530
8531 #[derive(Clone, Debug)]
8548 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8549
8550 impl GetOperation {
8551 pub(crate) fn new(
8552 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8553 ) -> Self {
8554 Self(RequestBuilder::new(stub))
8555 }
8556
8557 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8559 mut self,
8560 v: V,
8561 ) -> Self {
8562 self.0.request = v.into();
8563 self
8564 }
8565
8566 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8568 self.0.options = v.into();
8569 self
8570 }
8571
8572 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8574 (*self.0.stub)
8575 .get_operation(self.0.request, self.0.options)
8576 .await
8577 .map(crate::Response::into_body)
8578 }
8579
8580 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8582 self.0.request.name = v.into();
8583 self
8584 }
8585 }
8586
8587 #[doc(hidden)]
8588 impl crate::RequestBuilder for GetOperation {
8589 fn request_options(&mut self) -> &mut crate::RequestOptions {
8590 &mut self.0.options
8591 }
8592 }
8593
8594 #[derive(Clone, Debug)]
8611 pub struct DeleteOperation(
8612 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8613 );
8614
8615 impl DeleteOperation {
8616 pub(crate) fn new(
8617 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8618 ) -> Self {
8619 Self(RequestBuilder::new(stub))
8620 }
8621
8622 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8624 mut self,
8625 v: V,
8626 ) -> Self {
8627 self.0.request = v.into();
8628 self
8629 }
8630
8631 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8633 self.0.options = v.into();
8634 self
8635 }
8636
8637 pub async fn send(self) -> Result<()> {
8639 (*self.0.stub)
8640 .delete_operation(self.0.request, self.0.options)
8641 .await
8642 .map(crate::Response::into_body)
8643 }
8644
8645 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8647 self.0.request.name = v.into();
8648 self
8649 }
8650 }
8651
8652 #[doc(hidden)]
8653 impl crate::RequestBuilder for DeleteOperation {
8654 fn request_options(&mut self) -> &mut crate::RequestOptions {
8655 &mut self.0.options
8656 }
8657 }
8658
8659 #[derive(Clone, Debug)]
8676 pub struct CancelOperation(
8677 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8678 );
8679
8680 impl CancelOperation {
8681 pub(crate) fn new(
8682 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8683 ) -> Self {
8684 Self(RequestBuilder::new(stub))
8685 }
8686
8687 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8689 mut self,
8690 v: V,
8691 ) -> Self {
8692 self.0.request = v.into();
8693 self
8694 }
8695
8696 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8698 self.0.options = v.into();
8699 self
8700 }
8701
8702 pub async fn send(self) -> Result<()> {
8704 (*self.0.stub)
8705 .cancel_operation(self.0.request, self.0.options)
8706 .await
8707 .map(crate::Response::into_body)
8708 }
8709
8710 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712 self.0.request.name = v.into();
8713 self
8714 }
8715 }
8716
8717 #[doc(hidden)]
8718 impl crate::RequestBuilder for CancelOperation {
8719 fn request_options(&mut self) -> &mut crate::RequestOptions {
8720 &mut self.0.options
8721 }
8722 }
8723}
8724
8725pub mod internal_range_service {
8727 use crate::Result;
8728
8729 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8743
8744 pub(crate) mod client {
8745 use super::super::super::client::InternalRangeService;
8746 pub struct Factory;
8747 impl crate::ClientFactory for Factory {
8748 type Client = InternalRangeService;
8749 type Credentials = gaxi::options::Credentials;
8750 async fn build(
8751 self,
8752 config: gaxi::options::ClientConfig,
8753 ) -> crate::ClientBuilderResult<Self::Client> {
8754 Self::Client::new(config).await
8755 }
8756 }
8757 }
8758
8759 #[derive(Clone, Debug)]
8761 pub(crate) struct RequestBuilder<R: std::default::Default> {
8762 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8763 request: R,
8764 options: crate::RequestOptions,
8765 }
8766
8767 impl<R> RequestBuilder<R>
8768 where
8769 R: std::default::Default,
8770 {
8771 pub(crate) fn new(
8772 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8773 ) -> Self {
8774 Self {
8775 stub,
8776 request: R::default(),
8777 options: crate::RequestOptions::default(),
8778 }
8779 }
8780 }
8781
8782 #[derive(Clone, Debug)]
8803 pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8804
8805 impl ListInternalRanges {
8806 pub(crate) fn new(
8807 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8808 ) -> Self {
8809 Self(RequestBuilder::new(stub))
8810 }
8811
8812 pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8814 mut self,
8815 v: V,
8816 ) -> Self {
8817 self.0.request = v.into();
8818 self
8819 }
8820
8821 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8823 self.0.options = v.into();
8824 self
8825 }
8826
8827 pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8829 (*self.0.stub)
8830 .list_internal_ranges(self.0.request, self.0.options)
8831 .await
8832 .map(crate::Response::into_body)
8833 }
8834
8835 pub fn by_page(
8837 self,
8838 ) -> impl google_cloud_gax::paginator::Paginator<
8839 crate::model::ListInternalRangesResponse,
8840 crate::Error,
8841 > {
8842 use std::clone::Clone;
8843 let token = self.0.request.page_token.clone();
8844 let execute = move |token: String| {
8845 let mut builder = self.clone();
8846 builder.0.request = builder.0.request.set_page_token(token);
8847 builder.send()
8848 };
8849 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8850 }
8851
8852 pub fn by_item(
8854 self,
8855 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8856 crate::model::ListInternalRangesResponse,
8857 crate::Error,
8858 > {
8859 use google_cloud_gax::paginator::Paginator;
8860 self.by_page().items()
8861 }
8862
8863 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8867 self.0.request.parent = v.into();
8868 self
8869 }
8870
8871 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8873 self.0.request.page_size = v.into();
8874 self
8875 }
8876
8877 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8879 self.0.request.page_token = v.into();
8880 self
8881 }
8882
8883 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8885 self.0.request.filter = v.into();
8886 self
8887 }
8888
8889 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8891 self.0.request.order_by = v.into();
8892 self
8893 }
8894 }
8895
8896 #[doc(hidden)]
8897 impl crate::RequestBuilder for ListInternalRanges {
8898 fn request_options(&mut self) -> &mut crate::RequestOptions {
8899 &mut self.0.options
8900 }
8901 }
8902
8903 #[derive(Clone, Debug)]
8920 pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8921
8922 impl GetInternalRange {
8923 pub(crate) fn new(
8924 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8925 ) -> Self {
8926 Self(RequestBuilder::new(stub))
8927 }
8928
8929 pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8931 mut self,
8932 v: V,
8933 ) -> Self {
8934 self.0.request = v.into();
8935 self
8936 }
8937
8938 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8940 self.0.options = v.into();
8941 self
8942 }
8943
8944 pub async fn send(self) -> Result<crate::model::InternalRange> {
8946 (*self.0.stub)
8947 .get_internal_range(self.0.request, self.0.options)
8948 .await
8949 .map(crate::Response::into_body)
8950 }
8951
8952 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8956 self.0.request.name = v.into();
8957 self
8958 }
8959 }
8960
8961 #[doc(hidden)]
8962 impl crate::RequestBuilder for GetInternalRange {
8963 fn request_options(&mut self) -> &mut crate::RequestOptions {
8964 &mut self.0.options
8965 }
8966 }
8967
8968 #[derive(Clone, Debug)]
8986 pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8987
8988 impl CreateInternalRange {
8989 pub(crate) fn new(
8990 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8991 ) -> Self {
8992 Self(RequestBuilder::new(stub))
8993 }
8994
8995 pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8997 mut self,
8998 v: V,
8999 ) -> Self {
9000 self.0.request = v.into();
9001 self
9002 }
9003
9004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9006 self.0.options = v.into();
9007 self
9008 }
9009
9010 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9017 (*self.0.stub)
9018 .create_internal_range(self.0.request, self.0.options)
9019 .await
9020 .map(crate::Response::into_body)
9021 }
9022
9023 pub fn poller(
9025 self,
9026 ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9027 {
9028 type Operation = google_cloud_lro::internal::Operation<
9029 crate::model::InternalRange,
9030 crate::model::OperationMetadata,
9031 >;
9032 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9033 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9034
9035 let stub = self.0.stub.clone();
9036 let mut options = self.0.options.clone();
9037 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9038 let query = move |name| {
9039 let stub = stub.clone();
9040 let options = options.clone();
9041 async {
9042 let op = GetOperation::new(stub)
9043 .set_name(name)
9044 .with_options(options)
9045 .send()
9046 .await?;
9047 Ok(Operation::new(op))
9048 }
9049 };
9050
9051 let start = move || async {
9052 let op = self.send().await?;
9053 Ok(Operation::new(op))
9054 };
9055
9056 google_cloud_lro::internal::new_poller(
9057 polling_error_policy,
9058 polling_backoff_policy,
9059 start,
9060 query,
9061 )
9062 }
9063
9064 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9068 self.0.request.parent = v.into();
9069 self
9070 }
9071
9072 pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9074 self.0.request.internal_range_id = v.into();
9075 self
9076 }
9077
9078 pub fn set_internal_range<T>(mut self, v: T) -> Self
9082 where
9083 T: std::convert::Into<crate::model::InternalRange>,
9084 {
9085 self.0.request.internal_range = std::option::Option::Some(v.into());
9086 self
9087 }
9088
9089 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9093 where
9094 T: std::convert::Into<crate::model::InternalRange>,
9095 {
9096 self.0.request.internal_range = v.map(|x| x.into());
9097 self
9098 }
9099
9100 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9102 self.0.request.request_id = v.into();
9103 self
9104 }
9105 }
9106
9107 #[doc(hidden)]
9108 impl crate::RequestBuilder for CreateInternalRange {
9109 fn request_options(&mut self) -> &mut crate::RequestOptions {
9110 &mut self.0.options
9111 }
9112 }
9113
9114 #[derive(Clone, Debug)]
9132 pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
9133
9134 impl UpdateInternalRange {
9135 pub(crate) fn new(
9136 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9137 ) -> Self {
9138 Self(RequestBuilder::new(stub))
9139 }
9140
9141 pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
9143 mut self,
9144 v: V,
9145 ) -> Self {
9146 self.0.request = v.into();
9147 self
9148 }
9149
9150 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9152 self.0.options = v.into();
9153 self
9154 }
9155
9156 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9163 (*self.0.stub)
9164 .update_internal_range(self.0.request, self.0.options)
9165 .await
9166 .map(crate::Response::into_body)
9167 }
9168
9169 pub fn poller(
9171 self,
9172 ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9173 {
9174 type Operation = google_cloud_lro::internal::Operation<
9175 crate::model::InternalRange,
9176 crate::model::OperationMetadata,
9177 >;
9178 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9179 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9180
9181 let stub = self.0.stub.clone();
9182 let mut options = self.0.options.clone();
9183 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9184 let query = move |name| {
9185 let stub = stub.clone();
9186 let options = options.clone();
9187 async {
9188 let op = GetOperation::new(stub)
9189 .set_name(name)
9190 .with_options(options)
9191 .send()
9192 .await?;
9193 Ok(Operation::new(op))
9194 }
9195 };
9196
9197 let start = move || async {
9198 let op = self.send().await?;
9199 Ok(Operation::new(op))
9200 };
9201
9202 google_cloud_lro::internal::new_poller(
9203 polling_error_policy,
9204 polling_backoff_policy,
9205 start,
9206 query,
9207 )
9208 }
9209
9210 pub fn set_update_mask<T>(mut self, v: T) -> Self
9212 where
9213 T: std::convert::Into<wkt::FieldMask>,
9214 {
9215 self.0.request.update_mask = std::option::Option::Some(v.into());
9216 self
9217 }
9218
9219 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9221 where
9222 T: std::convert::Into<wkt::FieldMask>,
9223 {
9224 self.0.request.update_mask = v.map(|x| x.into());
9225 self
9226 }
9227
9228 pub fn set_internal_range<T>(mut self, v: T) -> Self
9232 where
9233 T: std::convert::Into<crate::model::InternalRange>,
9234 {
9235 self.0.request.internal_range = std::option::Option::Some(v.into());
9236 self
9237 }
9238
9239 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9243 where
9244 T: std::convert::Into<crate::model::InternalRange>,
9245 {
9246 self.0.request.internal_range = v.map(|x| x.into());
9247 self
9248 }
9249
9250 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9252 self.0.request.request_id = v.into();
9253 self
9254 }
9255 }
9256
9257 #[doc(hidden)]
9258 impl crate::RequestBuilder for UpdateInternalRange {
9259 fn request_options(&mut self) -> &mut crate::RequestOptions {
9260 &mut self.0.options
9261 }
9262 }
9263
9264 #[derive(Clone, Debug)]
9282 pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9283
9284 impl DeleteInternalRange {
9285 pub(crate) fn new(
9286 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9287 ) -> Self {
9288 Self(RequestBuilder::new(stub))
9289 }
9290
9291 pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9293 mut self,
9294 v: V,
9295 ) -> Self {
9296 self.0.request = v.into();
9297 self
9298 }
9299
9300 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9302 self.0.options = v.into();
9303 self
9304 }
9305
9306 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9313 (*self.0.stub)
9314 .delete_internal_range(self.0.request, self.0.options)
9315 .await
9316 .map(crate::Response::into_body)
9317 }
9318
9319 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9321 type Operation =
9322 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9323 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9324 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9325
9326 let stub = self.0.stub.clone();
9327 let mut options = self.0.options.clone();
9328 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9329 let query = move |name| {
9330 let stub = stub.clone();
9331 let options = options.clone();
9332 async {
9333 let op = GetOperation::new(stub)
9334 .set_name(name)
9335 .with_options(options)
9336 .send()
9337 .await?;
9338 Ok(Operation::new(op))
9339 }
9340 };
9341
9342 let start = move || async {
9343 let op = self.send().await?;
9344 Ok(Operation::new(op))
9345 };
9346
9347 google_cloud_lro::internal::new_unit_response_poller(
9348 polling_error_policy,
9349 polling_backoff_policy,
9350 start,
9351 query,
9352 )
9353 }
9354
9355 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9359 self.0.request.name = v.into();
9360 self
9361 }
9362
9363 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9365 self.0.request.request_id = v.into();
9366 self
9367 }
9368 }
9369
9370 #[doc(hidden)]
9371 impl crate::RequestBuilder for DeleteInternalRange {
9372 fn request_options(&mut self) -> &mut crate::RequestOptions {
9373 &mut self.0.options
9374 }
9375 }
9376
9377 #[derive(Clone, Debug)]
9398 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9399
9400 impl ListLocations {
9401 pub(crate) fn new(
9402 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9403 ) -> Self {
9404 Self(RequestBuilder::new(stub))
9405 }
9406
9407 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9409 mut self,
9410 v: V,
9411 ) -> Self {
9412 self.0.request = v.into();
9413 self
9414 }
9415
9416 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9418 self.0.options = v.into();
9419 self
9420 }
9421
9422 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9424 (*self.0.stub)
9425 .list_locations(self.0.request, self.0.options)
9426 .await
9427 .map(crate::Response::into_body)
9428 }
9429
9430 pub fn by_page(
9432 self,
9433 ) -> impl google_cloud_gax::paginator::Paginator<
9434 google_cloud_location::model::ListLocationsResponse,
9435 crate::Error,
9436 > {
9437 use std::clone::Clone;
9438 let token = self.0.request.page_token.clone();
9439 let execute = move |token: String| {
9440 let mut builder = self.clone();
9441 builder.0.request = builder.0.request.set_page_token(token);
9442 builder.send()
9443 };
9444 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9445 }
9446
9447 pub fn by_item(
9449 self,
9450 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9451 google_cloud_location::model::ListLocationsResponse,
9452 crate::Error,
9453 > {
9454 use google_cloud_gax::paginator::Paginator;
9455 self.by_page().items()
9456 }
9457
9458 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9460 self.0.request.name = v.into();
9461 self
9462 }
9463
9464 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9466 self.0.request.filter = v.into();
9467 self
9468 }
9469
9470 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9472 self.0.request.page_size = v.into();
9473 self
9474 }
9475
9476 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9478 self.0.request.page_token = v.into();
9479 self
9480 }
9481 }
9482
9483 #[doc(hidden)]
9484 impl crate::RequestBuilder for ListLocations {
9485 fn request_options(&mut self) -> &mut crate::RequestOptions {
9486 &mut self.0.options
9487 }
9488 }
9489
9490 #[derive(Clone, Debug)]
9507 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9508
9509 impl GetLocation {
9510 pub(crate) fn new(
9511 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9512 ) -> Self {
9513 Self(RequestBuilder::new(stub))
9514 }
9515
9516 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9518 mut self,
9519 v: V,
9520 ) -> Self {
9521 self.0.request = v.into();
9522 self
9523 }
9524
9525 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9527 self.0.options = v.into();
9528 self
9529 }
9530
9531 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9533 (*self.0.stub)
9534 .get_location(self.0.request, self.0.options)
9535 .await
9536 .map(crate::Response::into_body)
9537 }
9538
9539 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9541 self.0.request.name = v.into();
9542 self
9543 }
9544 }
9545
9546 #[doc(hidden)]
9547 impl crate::RequestBuilder for GetLocation {
9548 fn request_options(&mut self) -> &mut crate::RequestOptions {
9549 &mut self.0.options
9550 }
9551 }
9552
9553 #[derive(Clone, Debug)]
9570 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9571
9572 impl SetIamPolicy {
9573 pub(crate) fn new(
9574 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9575 ) -> Self {
9576 Self(RequestBuilder::new(stub))
9577 }
9578
9579 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9581 mut self,
9582 v: V,
9583 ) -> Self {
9584 self.0.request = v.into();
9585 self
9586 }
9587
9588 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9590 self.0.options = v.into();
9591 self
9592 }
9593
9594 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9596 (*self.0.stub)
9597 .set_iam_policy(self.0.request, self.0.options)
9598 .await
9599 .map(crate::Response::into_body)
9600 }
9601
9602 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9606 self.0.request.resource = v.into();
9607 self
9608 }
9609
9610 pub fn set_policy<T>(mut self, v: T) -> Self
9614 where
9615 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9616 {
9617 self.0.request.policy = std::option::Option::Some(v.into());
9618 self
9619 }
9620
9621 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9625 where
9626 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9627 {
9628 self.0.request.policy = v.map(|x| x.into());
9629 self
9630 }
9631
9632 pub fn set_update_mask<T>(mut self, v: T) -> Self
9634 where
9635 T: std::convert::Into<wkt::FieldMask>,
9636 {
9637 self.0.request.update_mask = std::option::Option::Some(v.into());
9638 self
9639 }
9640
9641 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9643 where
9644 T: std::convert::Into<wkt::FieldMask>,
9645 {
9646 self.0.request.update_mask = v.map(|x| x.into());
9647 self
9648 }
9649 }
9650
9651 #[doc(hidden)]
9652 impl crate::RequestBuilder for SetIamPolicy {
9653 fn request_options(&mut self) -> &mut crate::RequestOptions {
9654 &mut self.0.options
9655 }
9656 }
9657
9658 #[derive(Clone, Debug)]
9675 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9676
9677 impl GetIamPolicy {
9678 pub(crate) fn new(
9679 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9680 ) -> Self {
9681 Self(RequestBuilder::new(stub))
9682 }
9683
9684 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9686 mut self,
9687 v: V,
9688 ) -> Self {
9689 self.0.request = v.into();
9690 self
9691 }
9692
9693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9695 self.0.options = v.into();
9696 self
9697 }
9698
9699 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9701 (*self.0.stub)
9702 .get_iam_policy(self.0.request, self.0.options)
9703 .await
9704 .map(crate::Response::into_body)
9705 }
9706
9707 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9711 self.0.request.resource = v.into();
9712 self
9713 }
9714
9715 pub fn set_options<T>(mut self, v: T) -> Self
9717 where
9718 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9719 {
9720 self.0.request.options = std::option::Option::Some(v.into());
9721 self
9722 }
9723
9724 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9726 where
9727 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9728 {
9729 self.0.request.options = v.map(|x| x.into());
9730 self
9731 }
9732 }
9733
9734 #[doc(hidden)]
9735 impl crate::RequestBuilder for GetIamPolicy {
9736 fn request_options(&mut self) -> &mut crate::RequestOptions {
9737 &mut self.0.options
9738 }
9739 }
9740
9741 #[derive(Clone, Debug)]
9758 pub struct TestIamPermissions(
9759 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
9760 );
9761
9762 impl TestIamPermissions {
9763 pub(crate) fn new(
9764 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9765 ) -> Self {
9766 Self(RequestBuilder::new(stub))
9767 }
9768
9769 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
9771 mut self,
9772 v: V,
9773 ) -> Self {
9774 self.0.request = v.into();
9775 self
9776 }
9777
9778 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9780 self.0.options = v.into();
9781 self
9782 }
9783
9784 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
9786 (*self.0.stub)
9787 .test_iam_permissions(self.0.request, self.0.options)
9788 .await
9789 .map(crate::Response::into_body)
9790 }
9791
9792 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9796 self.0.request.resource = v.into();
9797 self
9798 }
9799
9800 pub fn set_permissions<T, V>(mut self, v: T) -> Self
9804 where
9805 T: std::iter::IntoIterator<Item = V>,
9806 V: std::convert::Into<std::string::String>,
9807 {
9808 use std::iter::Iterator;
9809 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9810 self
9811 }
9812 }
9813
9814 #[doc(hidden)]
9815 impl crate::RequestBuilder for TestIamPermissions {
9816 fn request_options(&mut self) -> &mut crate::RequestOptions {
9817 &mut self.0.options
9818 }
9819 }
9820
9821 #[derive(Clone, Debug)]
9842 pub struct ListOperations(
9843 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9844 );
9845
9846 impl ListOperations {
9847 pub(crate) fn new(
9848 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9849 ) -> Self {
9850 Self(RequestBuilder::new(stub))
9851 }
9852
9853 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9855 mut self,
9856 v: V,
9857 ) -> Self {
9858 self.0.request = v.into();
9859 self
9860 }
9861
9862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9864 self.0.options = v.into();
9865 self
9866 }
9867
9868 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9870 (*self.0.stub)
9871 .list_operations(self.0.request, self.0.options)
9872 .await
9873 .map(crate::Response::into_body)
9874 }
9875
9876 pub fn by_page(
9878 self,
9879 ) -> impl google_cloud_gax::paginator::Paginator<
9880 google_cloud_longrunning::model::ListOperationsResponse,
9881 crate::Error,
9882 > {
9883 use std::clone::Clone;
9884 let token = self.0.request.page_token.clone();
9885 let execute = move |token: String| {
9886 let mut builder = self.clone();
9887 builder.0.request = builder.0.request.set_page_token(token);
9888 builder.send()
9889 };
9890 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9891 }
9892
9893 pub fn by_item(
9895 self,
9896 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9897 google_cloud_longrunning::model::ListOperationsResponse,
9898 crate::Error,
9899 > {
9900 use google_cloud_gax::paginator::Paginator;
9901 self.by_page().items()
9902 }
9903
9904 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9906 self.0.request.name = v.into();
9907 self
9908 }
9909
9910 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9912 self.0.request.filter = v.into();
9913 self
9914 }
9915
9916 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9918 self.0.request.page_size = v.into();
9919 self
9920 }
9921
9922 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9924 self.0.request.page_token = v.into();
9925 self
9926 }
9927
9928 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9930 self.0.request.return_partial_success = v.into();
9931 self
9932 }
9933 }
9934
9935 #[doc(hidden)]
9936 impl crate::RequestBuilder for ListOperations {
9937 fn request_options(&mut self) -> &mut crate::RequestOptions {
9938 &mut self.0.options
9939 }
9940 }
9941
9942 #[derive(Clone, Debug)]
9959 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9960
9961 impl GetOperation {
9962 pub(crate) fn new(
9963 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9964 ) -> Self {
9965 Self(RequestBuilder::new(stub))
9966 }
9967
9968 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9970 mut self,
9971 v: V,
9972 ) -> Self {
9973 self.0.request = v.into();
9974 self
9975 }
9976
9977 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9979 self.0.options = v.into();
9980 self
9981 }
9982
9983 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9985 (*self.0.stub)
9986 .get_operation(self.0.request, self.0.options)
9987 .await
9988 .map(crate::Response::into_body)
9989 }
9990
9991 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9993 self.0.request.name = v.into();
9994 self
9995 }
9996 }
9997
9998 #[doc(hidden)]
9999 impl crate::RequestBuilder for GetOperation {
10000 fn request_options(&mut self) -> &mut crate::RequestOptions {
10001 &mut self.0.options
10002 }
10003 }
10004
10005 #[derive(Clone, Debug)]
10022 pub struct DeleteOperation(
10023 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10024 );
10025
10026 impl DeleteOperation {
10027 pub(crate) fn new(
10028 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10029 ) -> Self {
10030 Self(RequestBuilder::new(stub))
10031 }
10032
10033 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10035 mut self,
10036 v: V,
10037 ) -> Self {
10038 self.0.request = v.into();
10039 self
10040 }
10041
10042 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10044 self.0.options = v.into();
10045 self
10046 }
10047
10048 pub async fn send(self) -> Result<()> {
10050 (*self.0.stub)
10051 .delete_operation(self.0.request, self.0.options)
10052 .await
10053 .map(crate::Response::into_body)
10054 }
10055
10056 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10058 self.0.request.name = v.into();
10059 self
10060 }
10061 }
10062
10063 #[doc(hidden)]
10064 impl crate::RequestBuilder for DeleteOperation {
10065 fn request_options(&mut self) -> &mut crate::RequestOptions {
10066 &mut self.0.options
10067 }
10068 }
10069
10070 #[derive(Clone, Debug)]
10087 pub struct CancelOperation(
10088 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10089 );
10090
10091 impl CancelOperation {
10092 pub(crate) fn new(
10093 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10094 ) -> Self {
10095 Self(RequestBuilder::new(stub))
10096 }
10097
10098 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10100 mut self,
10101 v: V,
10102 ) -> Self {
10103 self.0.request = v.into();
10104 self
10105 }
10106
10107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10109 self.0.options = v.into();
10110 self
10111 }
10112
10113 pub async fn send(self) -> Result<()> {
10115 (*self.0.stub)
10116 .cancel_operation(self.0.request, self.0.options)
10117 .await
10118 .map(crate::Response::into_body)
10119 }
10120
10121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10123 self.0.request.name = v.into();
10124 self
10125 }
10126 }
10127
10128 #[doc(hidden)]
10129 impl crate::RequestBuilder for CancelOperation {
10130 fn request_options(&mut self) -> &mut crate::RequestOptions {
10131 &mut self.0.options
10132 }
10133 }
10134}
10135
10136pub mod policy_based_routing_service {
10138 use crate::Result;
10139
10140 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10154
10155 pub(crate) mod client {
10156 use super::super::super::client::PolicyBasedRoutingService;
10157 pub struct Factory;
10158 impl crate::ClientFactory for Factory {
10159 type Client = PolicyBasedRoutingService;
10160 type Credentials = gaxi::options::Credentials;
10161 async fn build(
10162 self,
10163 config: gaxi::options::ClientConfig,
10164 ) -> crate::ClientBuilderResult<Self::Client> {
10165 Self::Client::new(config).await
10166 }
10167 }
10168 }
10169
10170 #[derive(Clone, Debug)]
10172 pub(crate) struct RequestBuilder<R: std::default::Default> {
10173 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10174 request: R,
10175 options: crate::RequestOptions,
10176 }
10177
10178 impl<R> RequestBuilder<R>
10179 where
10180 R: std::default::Default,
10181 {
10182 pub(crate) fn new(
10183 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10184 ) -> Self {
10185 Self {
10186 stub,
10187 request: R::default(),
10188 options: crate::RequestOptions::default(),
10189 }
10190 }
10191 }
10192
10193 #[derive(Clone, Debug)]
10214 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10215
10216 impl ListPolicyBasedRoutes {
10217 pub(crate) fn new(
10218 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10219 ) -> Self {
10220 Self(RequestBuilder::new(stub))
10221 }
10222
10223 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10225 mut self,
10226 v: V,
10227 ) -> Self {
10228 self.0.request = v.into();
10229 self
10230 }
10231
10232 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10234 self.0.options = v.into();
10235 self
10236 }
10237
10238 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10240 (*self.0.stub)
10241 .list_policy_based_routes(self.0.request, self.0.options)
10242 .await
10243 .map(crate::Response::into_body)
10244 }
10245
10246 pub fn by_page(
10248 self,
10249 ) -> impl google_cloud_gax::paginator::Paginator<
10250 crate::model::ListPolicyBasedRoutesResponse,
10251 crate::Error,
10252 > {
10253 use std::clone::Clone;
10254 let token = self.0.request.page_token.clone();
10255 let execute = move |token: String| {
10256 let mut builder = self.clone();
10257 builder.0.request = builder.0.request.set_page_token(token);
10258 builder.send()
10259 };
10260 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10261 }
10262
10263 pub fn by_item(
10265 self,
10266 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10267 crate::model::ListPolicyBasedRoutesResponse,
10268 crate::Error,
10269 > {
10270 use google_cloud_gax::paginator::Paginator;
10271 self.by_page().items()
10272 }
10273
10274 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10278 self.0.request.parent = v.into();
10279 self
10280 }
10281
10282 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10284 self.0.request.page_size = v.into();
10285 self
10286 }
10287
10288 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10290 self.0.request.page_token = v.into();
10291 self
10292 }
10293
10294 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10296 self.0.request.filter = v.into();
10297 self
10298 }
10299
10300 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10302 self.0.request.order_by = v.into();
10303 self
10304 }
10305 }
10306
10307 #[doc(hidden)]
10308 impl crate::RequestBuilder for ListPolicyBasedRoutes {
10309 fn request_options(&mut self) -> &mut crate::RequestOptions {
10310 &mut self.0.options
10311 }
10312 }
10313
10314 #[derive(Clone, Debug)]
10331 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10332
10333 impl GetPolicyBasedRoute {
10334 pub(crate) fn new(
10335 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10336 ) -> Self {
10337 Self(RequestBuilder::new(stub))
10338 }
10339
10340 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10342 mut self,
10343 v: V,
10344 ) -> Self {
10345 self.0.request = v.into();
10346 self
10347 }
10348
10349 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10351 self.0.options = v.into();
10352 self
10353 }
10354
10355 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10357 (*self.0.stub)
10358 .get_policy_based_route(self.0.request, self.0.options)
10359 .await
10360 .map(crate::Response::into_body)
10361 }
10362
10363 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10367 self.0.request.name = v.into();
10368 self
10369 }
10370 }
10371
10372 #[doc(hidden)]
10373 impl crate::RequestBuilder for GetPolicyBasedRoute {
10374 fn request_options(&mut self) -> &mut crate::RequestOptions {
10375 &mut self.0.options
10376 }
10377 }
10378
10379 #[derive(Clone, Debug)]
10397 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10398
10399 impl CreatePolicyBasedRoute {
10400 pub(crate) fn new(
10401 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10402 ) -> Self {
10403 Self(RequestBuilder::new(stub))
10404 }
10405
10406 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10408 mut self,
10409 v: V,
10410 ) -> Self {
10411 self.0.request = v.into();
10412 self
10413 }
10414
10415 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10417 self.0.options = v.into();
10418 self
10419 }
10420
10421 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10428 (*self.0.stub)
10429 .create_policy_based_route(self.0.request, self.0.options)
10430 .await
10431 .map(crate::Response::into_body)
10432 }
10433
10434 pub fn poller(
10436 self,
10437 ) -> impl google_cloud_lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10438 {
10439 type Operation = google_cloud_lro::internal::Operation<
10440 crate::model::PolicyBasedRoute,
10441 crate::model::OperationMetadata,
10442 >;
10443 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10444 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10445
10446 let stub = self.0.stub.clone();
10447 let mut options = self.0.options.clone();
10448 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10449 let query = move |name| {
10450 let stub = stub.clone();
10451 let options = options.clone();
10452 async {
10453 let op = GetOperation::new(stub)
10454 .set_name(name)
10455 .with_options(options)
10456 .send()
10457 .await?;
10458 Ok(Operation::new(op))
10459 }
10460 };
10461
10462 let start = move || async {
10463 let op = self.send().await?;
10464 Ok(Operation::new(op))
10465 };
10466
10467 google_cloud_lro::internal::new_poller(
10468 polling_error_policy,
10469 polling_backoff_policy,
10470 start,
10471 query,
10472 )
10473 }
10474
10475 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10479 self.0.request.parent = v.into();
10480 self
10481 }
10482
10483 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10487 self.0.request.policy_based_route_id = v.into();
10488 self
10489 }
10490
10491 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10495 where
10496 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10497 {
10498 self.0.request.policy_based_route = std::option::Option::Some(v.into());
10499 self
10500 }
10501
10502 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10506 where
10507 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10508 {
10509 self.0.request.policy_based_route = v.map(|x| x.into());
10510 self
10511 }
10512
10513 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10515 self.0.request.request_id = v.into();
10516 self
10517 }
10518 }
10519
10520 #[doc(hidden)]
10521 impl crate::RequestBuilder for CreatePolicyBasedRoute {
10522 fn request_options(&mut self) -> &mut crate::RequestOptions {
10523 &mut self.0.options
10524 }
10525 }
10526
10527 #[derive(Clone, Debug)]
10545 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10546
10547 impl DeletePolicyBasedRoute {
10548 pub(crate) fn new(
10549 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10550 ) -> Self {
10551 Self(RequestBuilder::new(stub))
10552 }
10553
10554 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10556 mut self,
10557 v: V,
10558 ) -> Self {
10559 self.0.request = v.into();
10560 self
10561 }
10562
10563 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10565 self.0.options = v.into();
10566 self
10567 }
10568
10569 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10576 (*self.0.stub)
10577 .delete_policy_based_route(self.0.request, self.0.options)
10578 .await
10579 .map(crate::Response::into_body)
10580 }
10581
10582 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10584 type Operation =
10585 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10586 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10587 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10588
10589 let stub = self.0.stub.clone();
10590 let mut options = self.0.options.clone();
10591 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10592 let query = move |name| {
10593 let stub = stub.clone();
10594 let options = options.clone();
10595 async {
10596 let op = GetOperation::new(stub)
10597 .set_name(name)
10598 .with_options(options)
10599 .send()
10600 .await?;
10601 Ok(Operation::new(op))
10602 }
10603 };
10604
10605 let start = move || async {
10606 let op = self.send().await?;
10607 Ok(Operation::new(op))
10608 };
10609
10610 google_cloud_lro::internal::new_unit_response_poller(
10611 polling_error_policy,
10612 polling_backoff_policy,
10613 start,
10614 query,
10615 )
10616 }
10617
10618 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10622 self.0.request.name = v.into();
10623 self
10624 }
10625
10626 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10628 self.0.request.request_id = v.into();
10629 self
10630 }
10631 }
10632
10633 #[doc(hidden)]
10634 impl crate::RequestBuilder for DeletePolicyBasedRoute {
10635 fn request_options(&mut self) -> &mut crate::RequestOptions {
10636 &mut self.0.options
10637 }
10638 }
10639
10640 #[derive(Clone, Debug)]
10661 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10662
10663 impl ListLocations {
10664 pub(crate) fn new(
10665 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10666 ) -> Self {
10667 Self(RequestBuilder::new(stub))
10668 }
10669
10670 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10672 mut self,
10673 v: V,
10674 ) -> Self {
10675 self.0.request = v.into();
10676 self
10677 }
10678
10679 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10681 self.0.options = v.into();
10682 self
10683 }
10684
10685 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10687 (*self.0.stub)
10688 .list_locations(self.0.request, self.0.options)
10689 .await
10690 .map(crate::Response::into_body)
10691 }
10692
10693 pub fn by_page(
10695 self,
10696 ) -> impl google_cloud_gax::paginator::Paginator<
10697 google_cloud_location::model::ListLocationsResponse,
10698 crate::Error,
10699 > {
10700 use std::clone::Clone;
10701 let token = self.0.request.page_token.clone();
10702 let execute = move |token: String| {
10703 let mut builder = self.clone();
10704 builder.0.request = builder.0.request.set_page_token(token);
10705 builder.send()
10706 };
10707 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10708 }
10709
10710 pub fn by_item(
10712 self,
10713 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10714 google_cloud_location::model::ListLocationsResponse,
10715 crate::Error,
10716 > {
10717 use google_cloud_gax::paginator::Paginator;
10718 self.by_page().items()
10719 }
10720
10721 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10723 self.0.request.name = v.into();
10724 self
10725 }
10726
10727 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10729 self.0.request.filter = v.into();
10730 self
10731 }
10732
10733 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10735 self.0.request.page_size = v.into();
10736 self
10737 }
10738
10739 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10741 self.0.request.page_token = v.into();
10742 self
10743 }
10744 }
10745
10746 #[doc(hidden)]
10747 impl crate::RequestBuilder for ListLocations {
10748 fn request_options(&mut self) -> &mut crate::RequestOptions {
10749 &mut self.0.options
10750 }
10751 }
10752
10753 #[derive(Clone, Debug)]
10770 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10771
10772 impl GetLocation {
10773 pub(crate) fn new(
10774 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10775 ) -> Self {
10776 Self(RequestBuilder::new(stub))
10777 }
10778
10779 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10781 mut self,
10782 v: V,
10783 ) -> Self {
10784 self.0.request = v.into();
10785 self
10786 }
10787
10788 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10790 self.0.options = v.into();
10791 self
10792 }
10793
10794 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10796 (*self.0.stub)
10797 .get_location(self.0.request, self.0.options)
10798 .await
10799 .map(crate::Response::into_body)
10800 }
10801
10802 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10804 self.0.request.name = v.into();
10805 self
10806 }
10807 }
10808
10809 #[doc(hidden)]
10810 impl crate::RequestBuilder for GetLocation {
10811 fn request_options(&mut self) -> &mut crate::RequestOptions {
10812 &mut self.0.options
10813 }
10814 }
10815
10816 #[derive(Clone, Debug)]
10833 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10834
10835 impl SetIamPolicy {
10836 pub(crate) fn new(
10837 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10838 ) -> Self {
10839 Self(RequestBuilder::new(stub))
10840 }
10841
10842 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10844 mut self,
10845 v: V,
10846 ) -> Self {
10847 self.0.request = v.into();
10848 self
10849 }
10850
10851 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10853 self.0.options = v.into();
10854 self
10855 }
10856
10857 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10859 (*self.0.stub)
10860 .set_iam_policy(self.0.request, self.0.options)
10861 .await
10862 .map(crate::Response::into_body)
10863 }
10864
10865 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10869 self.0.request.resource = v.into();
10870 self
10871 }
10872
10873 pub fn set_policy<T>(mut self, v: T) -> Self
10877 where
10878 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10879 {
10880 self.0.request.policy = std::option::Option::Some(v.into());
10881 self
10882 }
10883
10884 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10888 where
10889 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10890 {
10891 self.0.request.policy = v.map(|x| x.into());
10892 self
10893 }
10894
10895 pub fn set_update_mask<T>(mut self, v: T) -> Self
10897 where
10898 T: std::convert::Into<wkt::FieldMask>,
10899 {
10900 self.0.request.update_mask = std::option::Option::Some(v.into());
10901 self
10902 }
10903
10904 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10906 where
10907 T: std::convert::Into<wkt::FieldMask>,
10908 {
10909 self.0.request.update_mask = v.map(|x| x.into());
10910 self
10911 }
10912 }
10913
10914 #[doc(hidden)]
10915 impl crate::RequestBuilder for SetIamPolicy {
10916 fn request_options(&mut self) -> &mut crate::RequestOptions {
10917 &mut self.0.options
10918 }
10919 }
10920
10921 #[derive(Clone, Debug)]
10938 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10939
10940 impl GetIamPolicy {
10941 pub(crate) fn new(
10942 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10943 ) -> Self {
10944 Self(RequestBuilder::new(stub))
10945 }
10946
10947 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10949 mut self,
10950 v: V,
10951 ) -> Self {
10952 self.0.request = v.into();
10953 self
10954 }
10955
10956 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10958 self.0.options = v.into();
10959 self
10960 }
10961
10962 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10964 (*self.0.stub)
10965 .get_iam_policy(self.0.request, self.0.options)
10966 .await
10967 .map(crate::Response::into_body)
10968 }
10969
10970 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10974 self.0.request.resource = v.into();
10975 self
10976 }
10977
10978 pub fn set_options<T>(mut self, v: T) -> Self
10980 where
10981 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10982 {
10983 self.0.request.options = std::option::Option::Some(v.into());
10984 self
10985 }
10986
10987 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10989 where
10990 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10991 {
10992 self.0.request.options = v.map(|x| x.into());
10993 self
10994 }
10995 }
10996
10997 #[doc(hidden)]
10998 impl crate::RequestBuilder for GetIamPolicy {
10999 fn request_options(&mut self) -> &mut crate::RequestOptions {
11000 &mut self.0.options
11001 }
11002 }
11003
11004 #[derive(Clone, Debug)]
11021 pub struct TestIamPermissions(
11022 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
11023 );
11024
11025 impl TestIamPermissions {
11026 pub(crate) fn new(
11027 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11028 ) -> Self {
11029 Self(RequestBuilder::new(stub))
11030 }
11031
11032 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
11034 mut self,
11035 v: V,
11036 ) -> Self {
11037 self.0.request = v.into();
11038 self
11039 }
11040
11041 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11043 self.0.options = v.into();
11044 self
11045 }
11046
11047 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
11049 (*self.0.stub)
11050 .test_iam_permissions(self.0.request, self.0.options)
11051 .await
11052 .map(crate::Response::into_body)
11053 }
11054
11055 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11059 self.0.request.resource = v.into();
11060 self
11061 }
11062
11063 pub fn set_permissions<T, V>(mut self, v: T) -> Self
11067 where
11068 T: std::iter::IntoIterator<Item = V>,
11069 V: std::convert::Into<std::string::String>,
11070 {
11071 use std::iter::Iterator;
11072 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11073 self
11074 }
11075 }
11076
11077 #[doc(hidden)]
11078 impl crate::RequestBuilder for TestIamPermissions {
11079 fn request_options(&mut self) -> &mut crate::RequestOptions {
11080 &mut self.0.options
11081 }
11082 }
11083
11084 #[derive(Clone, Debug)]
11105 pub struct ListOperations(
11106 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11107 );
11108
11109 impl ListOperations {
11110 pub(crate) fn new(
11111 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11112 ) -> Self {
11113 Self(RequestBuilder::new(stub))
11114 }
11115
11116 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11118 mut self,
11119 v: V,
11120 ) -> Self {
11121 self.0.request = v.into();
11122 self
11123 }
11124
11125 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11127 self.0.options = v.into();
11128 self
11129 }
11130
11131 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11133 (*self.0.stub)
11134 .list_operations(self.0.request, self.0.options)
11135 .await
11136 .map(crate::Response::into_body)
11137 }
11138
11139 pub fn by_page(
11141 self,
11142 ) -> impl google_cloud_gax::paginator::Paginator<
11143 google_cloud_longrunning::model::ListOperationsResponse,
11144 crate::Error,
11145 > {
11146 use std::clone::Clone;
11147 let token = self.0.request.page_token.clone();
11148 let execute = move |token: String| {
11149 let mut builder = self.clone();
11150 builder.0.request = builder.0.request.set_page_token(token);
11151 builder.send()
11152 };
11153 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11154 }
11155
11156 pub fn by_item(
11158 self,
11159 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11160 google_cloud_longrunning::model::ListOperationsResponse,
11161 crate::Error,
11162 > {
11163 use google_cloud_gax::paginator::Paginator;
11164 self.by_page().items()
11165 }
11166
11167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11169 self.0.request.name = v.into();
11170 self
11171 }
11172
11173 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11175 self.0.request.filter = v.into();
11176 self
11177 }
11178
11179 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11181 self.0.request.page_size = v.into();
11182 self
11183 }
11184
11185 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11187 self.0.request.page_token = v.into();
11188 self
11189 }
11190
11191 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11193 self.0.request.return_partial_success = v.into();
11194 self
11195 }
11196 }
11197
11198 #[doc(hidden)]
11199 impl crate::RequestBuilder for ListOperations {
11200 fn request_options(&mut self) -> &mut crate::RequestOptions {
11201 &mut self.0.options
11202 }
11203 }
11204
11205 #[derive(Clone, Debug)]
11222 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11223
11224 impl GetOperation {
11225 pub(crate) fn new(
11226 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11227 ) -> Self {
11228 Self(RequestBuilder::new(stub))
11229 }
11230
11231 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11233 mut self,
11234 v: V,
11235 ) -> Self {
11236 self.0.request = v.into();
11237 self
11238 }
11239
11240 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11242 self.0.options = v.into();
11243 self
11244 }
11245
11246 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11248 (*self.0.stub)
11249 .get_operation(self.0.request, self.0.options)
11250 .await
11251 .map(crate::Response::into_body)
11252 }
11253
11254 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11256 self.0.request.name = v.into();
11257 self
11258 }
11259 }
11260
11261 #[doc(hidden)]
11262 impl crate::RequestBuilder for GetOperation {
11263 fn request_options(&mut self) -> &mut crate::RequestOptions {
11264 &mut self.0.options
11265 }
11266 }
11267
11268 #[derive(Clone, Debug)]
11285 pub struct DeleteOperation(
11286 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11287 );
11288
11289 impl DeleteOperation {
11290 pub(crate) fn new(
11291 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11292 ) -> Self {
11293 Self(RequestBuilder::new(stub))
11294 }
11295
11296 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11298 mut self,
11299 v: V,
11300 ) -> Self {
11301 self.0.request = v.into();
11302 self
11303 }
11304
11305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11307 self.0.options = v.into();
11308 self
11309 }
11310
11311 pub async fn send(self) -> Result<()> {
11313 (*self.0.stub)
11314 .delete_operation(self.0.request, self.0.options)
11315 .await
11316 .map(crate::Response::into_body)
11317 }
11318
11319 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11321 self.0.request.name = v.into();
11322 self
11323 }
11324 }
11325
11326 #[doc(hidden)]
11327 impl crate::RequestBuilder for DeleteOperation {
11328 fn request_options(&mut self) -> &mut crate::RequestOptions {
11329 &mut self.0.options
11330 }
11331 }
11332
11333 #[derive(Clone, Debug)]
11350 pub struct CancelOperation(
11351 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11352 );
11353
11354 impl CancelOperation {
11355 pub(crate) fn new(
11356 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11357 ) -> Self {
11358 Self(RequestBuilder::new(stub))
11359 }
11360
11361 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11363 mut self,
11364 v: V,
11365 ) -> Self {
11366 self.0.request = v.into();
11367 self
11368 }
11369
11370 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11372 self.0.options = v.into();
11373 self
11374 }
11375
11376 pub async fn send(self) -> Result<()> {
11378 (*self.0.stub)
11379 .cancel_operation(self.0.request, self.0.options)
11380 .await
11381 .map(crate::Response::into_body)
11382 }
11383
11384 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11386 self.0.request.name = v.into();
11387 self
11388 }
11389 }
11390
11391 #[doc(hidden)]
11392 impl crate::RequestBuilder for CancelOperation {
11393 fn request_options(&mut self) -> &mut crate::RequestOptions {
11394 &mut self.0.options
11395 }
11396 }
11397}