1pub mod cross_network_automation_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::CrossNetworkAutomationService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = CrossNetworkAutomationService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<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: gax::options::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: gax::options::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<gax::options::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(gax::response::Response::into_body)
127 }
128
129 pub fn by_page(
131 self,
132 ) -> impl gax::paginator::Paginator<
133 crate::model::ListServiceConnectionMapsResponse,
134 gax::error::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 gax::paginator::internal::new_paginator(token, execute)
144 }
145
146 pub fn by_item(
148 self,
149 ) -> impl gax::paginator::ItemPaginator<
150 crate::model::ListServiceConnectionMapsResponse,
151 gax::error::Error,
152 > {
153 use 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 gax::options::internal::RequestBuilder for ListServiceConnectionMaps {
192 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for GetServiceConnectionMap {
259 fn request_options(&mut self) -> &mut gax::options::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<gax::options::RequestOptions>>(mut self, v: V) -> Self {
304 self.0.options = v.into();
305 self
306 }
307
308 pub async fn send(self) -> Result<longrunning::model::Operation> {
315 (*self.0.stub)
316 .create_service_connection_map(self.0.request, self.0.options)
317 .await
318 .map(gax::response::Response::into_body)
319 }
320
321 pub fn poller(
323 self,
324 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
325 {
326 type Operation = lro::internal::Operation<
327 crate::model::ServiceConnectionMap,
328 crate::model::OperationMetadata,
329 >;
330 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
331 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
332
333 let stub = self.0.stub.clone();
334 let mut options = self.0.options.clone();
335 options.set_retry_policy(gax::retry_policy::NeverRetry);
336 let query = move |name| {
337 let stub = stub.clone();
338 let options = options.clone();
339 async {
340 let op = GetOperation::new(stub)
341 .set_name(name)
342 .with_options(options)
343 .send()
344 .await?;
345 Ok(Operation::new(op))
346 }
347 };
348
349 let start = move || async {
350 let op = self.send().await?;
351 Ok(Operation::new(op))
352 };
353
354 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
355 }
356
357 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
361 self.0.request.parent = v.into();
362 self
363 }
364
365 pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
367 self.0.request.service_connection_map_id = v.into();
368 self
369 }
370
371 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
375 where
376 T: std::convert::Into<crate::model::ServiceConnectionMap>,
377 {
378 self.0.request.service_connection_map = std::option::Option::Some(v.into());
379 self
380 }
381
382 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
386 where
387 T: std::convert::Into<crate::model::ServiceConnectionMap>,
388 {
389 self.0.request.service_connection_map = v.map(|x| x.into());
390 self
391 }
392
393 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
395 self.0.request.request_id = v.into();
396 self
397 }
398 }
399
400 #[doc(hidden)]
401 impl gax::options::internal::RequestBuilder for CreateServiceConnectionMap {
402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
403 &mut self.0.options
404 }
405 }
406
407 #[derive(Clone, Debug)]
425 pub struct UpdateServiceConnectionMap(
426 RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
427 );
428
429 impl UpdateServiceConnectionMap {
430 pub(crate) fn new(
431 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
432 ) -> Self {
433 Self(RequestBuilder::new(stub))
434 }
435
436 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
438 mut self,
439 v: V,
440 ) -> Self {
441 self.0.request = v.into();
442 self
443 }
444
445 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
447 self.0.options = v.into();
448 self
449 }
450
451 pub async fn send(self) -> Result<longrunning::model::Operation> {
458 (*self.0.stub)
459 .update_service_connection_map(self.0.request, self.0.options)
460 .await
461 .map(gax::response::Response::into_body)
462 }
463
464 pub fn poller(
466 self,
467 ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
468 {
469 type Operation = lro::internal::Operation<
470 crate::model::ServiceConnectionMap,
471 crate::model::OperationMetadata,
472 >;
473 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
474 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
475
476 let stub = self.0.stub.clone();
477 let mut options = self.0.options.clone();
478 options.set_retry_policy(gax::retry_policy::NeverRetry);
479 let query = move |name| {
480 let stub = stub.clone();
481 let options = options.clone();
482 async {
483 let op = GetOperation::new(stub)
484 .set_name(name)
485 .with_options(options)
486 .send()
487 .await?;
488 Ok(Operation::new(op))
489 }
490 };
491
492 let start = move || async {
493 let op = self.send().await?;
494 Ok(Operation::new(op))
495 };
496
497 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
498 }
499
500 pub fn set_update_mask<T>(mut self, v: T) -> Self
502 where
503 T: std::convert::Into<wkt::FieldMask>,
504 {
505 self.0.request.update_mask = std::option::Option::Some(v.into());
506 self
507 }
508
509 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
511 where
512 T: std::convert::Into<wkt::FieldMask>,
513 {
514 self.0.request.update_mask = v.map(|x| x.into());
515 self
516 }
517
518 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
522 where
523 T: std::convert::Into<crate::model::ServiceConnectionMap>,
524 {
525 self.0.request.service_connection_map = std::option::Option::Some(v.into());
526 self
527 }
528
529 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
533 where
534 T: std::convert::Into<crate::model::ServiceConnectionMap>,
535 {
536 self.0.request.service_connection_map = v.map(|x| x.into());
537 self
538 }
539
540 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
542 self.0.request.request_id = v.into();
543 self
544 }
545 }
546
547 #[doc(hidden)]
548 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionMap {
549 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
550 &mut self.0.options
551 }
552 }
553
554 #[derive(Clone, Debug)]
572 pub struct DeleteServiceConnectionMap(
573 RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
574 );
575
576 impl DeleteServiceConnectionMap {
577 pub(crate) fn new(
578 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
579 ) -> Self {
580 Self(RequestBuilder::new(stub))
581 }
582
583 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
585 mut self,
586 v: V,
587 ) -> Self {
588 self.0.request = v.into();
589 self
590 }
591
592 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
594 self.0.options = v.into();
595 self
596 }
597
598 pub async fn send(self) -> Result<longrunning::model::Operation> {
605 (*self.0.stub)
606 .delete_service_connection_map(self.0.request, self.0.options)
607 .await
608 .map(gax::response::Response::into_body)
609 }
610
611 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
613 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
614 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
615 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
616
617 let stub = self.0.stub.clone();
618 let mut options = self.0.options.clone();
619 options.set_retry_policy(gax::retry_policy::NeverRetry);
620 let query = move |name| {
621 let stub = stub.clone();
622 let options = options.clone();
623 async {
624 let op = GetOperation::new(stub)
625 .set_name(name)
626 .with_options(options)
627 .send()
628 .await?;
629 Ok(Operation::new(op))
630 }
631 };
632
633 let start = move || async {
634 let op = self.send().await?;
635 Ok(Operation::new(op))
636 };
637
638 lro::internal::new_unit_response_poller(
639 polling_error_policy,
640 polling_backoff_policy,
641 start,
642 query,
643 )
644 }
645
646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
650 self.0.request.name = v.into();
651 self
652 }
653
654 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
656 self.0.request.request_id = v.into();
657 self
658 }
659
660 pub fn set_etag<T>(mut self, v: T) -> Self
662 where
663 T: std::convert::Into<std::string::String>,
664 {
665 self.0.request.etag = std::option::Option::Some(v.into());
666 self
667 }
668
669 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
671 where
672 T: std::convert::Into<std::string::String>,
673 {
674 self.0.request.etag = v.map(|x| x.into());
675 self
676 }
677 }
678
679 #[doc(hidden)]
680 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionMap {
681 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
682 &mut self.0.options
683 }
684 }
685
686 #[derive(Clone, Debug)]
707 pub struct ListServiceConnectionPolicies(
708 RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
709 );
710
711 impl ListServiceConnectionPolicies {
712 pub(crate) fn new(
713 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
714 ) -> Self {
715 Self(RequestBuilder::new(stub))
716 }
717
718 pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
720 mut self,
721 v: V,
722 ) -> Self {
723 self.0.request = v.into();
724 self
725 }
726
727 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
729 self.0.options = v.into();
730 self
731 }
732
733 pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
735 (*self.0.stub)
736 .list_service_connection_policies(self.0.request, self.0.options)
737 .await
738 .map(gax::response::Response::into_body)
739 }
740
741 pub fn by_page(
743 self,
744 ) -> impl gax::paginator::Paginator<
745 crate::model::ListServiceConnectionPoliciesResponse,
746 gax::error::Error,
747 > {
748 use std::clone::Clone;
749 let token = self.0.request.page_token.clone();
750 let execute = move |token: String| {
751 let mut builder = self.clone();
752 builder.0.request = builder.0.request.set_page_token(token);
753 builder.send()
754 };
755 gax::paginator::internal::new_paginator(token, execute)
756 }
757
758 pub fn by_item(
760 self,
761 ) -> impl gax::paginator::ItemPaginator<
762 crate::model::ListServiceConnectionPoliciesResponse,
763 gax::error::Error,
764 > {
765 use gax::paginator::Paginator;
766 self.by_page().items()
767 }
768
769 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
773 self.0.request.parent = v.into();
774 self
775 }
776
777 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
779 self.0.request.page_size = v.into();
780 self
781 }
782
783 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
785 self.0.request.page_token = v.into();
786 self
787 }
788
789 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
791 self.0.request.filter = v.into();
792 self
793 }
794
795 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
797 self.0.request.order_by = v.into();
798 self
799 }
800 }
801
802 #[doc(hidden)]
803 impl gax::options::internal::RequestBuilder for ListServiceConnectionPolicies {
804 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
805 &mut self.0.options
806 }
807 }
808
809 #[derive(Clone, Debug)]
826 pub struct GetServiceConnectionPolicy(
827 RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
828 );
829
830 impl GetServiceConnectionPolicy {
831 pub(crate) fn new(
832 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
833 ) -> Self {
834 Self(RequestBuilder::new(stub))
835 }
836
837 pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
839 mut self,
840 v: V,
841 ) -> Self {
842 self.0.request = v.into();
843 self
844 }
845
846 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
848 self.0.options = v.into();
849 self
850 }
851
852 pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
854 (*self.0.stub)
855 .get_service_connection_policy(self.0.request, self.0.options)
856 .await
857 .map(gax::response::Response::into_body)
858 }
859
860 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
864 self.0.request.name = v.into();
865 self
866 }
867 }
868
869 #[doc(hidden)]
870 impl gax::options::internal::RequestBuilder for GetServiceConnectionPolicy {
871 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
872 &mut self.0.options
873 }
874 }
875
876 #[derive(Clone, Debug)]
894 pub struct CreateServiceConnectionPolicy(
895 RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
896 );
897
898 impl CreateServiceConnectionPolicy {
899 pub(crate) fn new(
900 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
901 ) -> Self {
902 Self(RequestBuilder::new(stub))
903 }
904
905 pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
907 mut self,
908 v: V,
909 ) -> Self {
910 self.0.request = v.into();
911 self
912 }
913
914 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
916 self.0.options = v.into();
917 self
918 }
919
920 pub async fn send(self) -> Result<longrunning::model::Operation> {
927 (*self.0.stub)
928 .create_service_connection_policy(self.0.request, self.0.options)
929 .await
930 .map(gax::response::Response::into_body)
931 }
932
933 pub fn poller(
935 self,
936 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
937 {
938 type Operation = lro::internal::Operation<
939 crate::model::ServiceConnectionPolicy,
940 crate::model::OperationMetadata,
941 >;
942 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
943 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
944
945 let stub = self.0.stub.clone();
946 let mut options = self.0.options.clone();
947 options.set_retry_policy(gax::retry_policy::NeverRetry);
948 let query = move |name| {
949 let stub = stub.clone();
950 let options = options.clone();
951 async {
952 let op = GetOperation::new(stub)
953 .set_name(name)
954 .with_options(options)
955 .send()
956 .await?;
957 Ok(Operation::new(op))
958 }
959 };
960
961 let start = move || async {
962 let op = self.send().await?;
963 Ok(Operation::new(op))
964 };
965
966 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
967 }
968
969 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
973 self.0.request.parent = v.into();
974 self
975 }
976
977 pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
979 mut self,
980 v: T,
981 ) -> Self {
982 self.0.request.service_connection_policy_id = v.into();
983 self
984 }
985
986 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
990 where
991 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
992 {
993 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
994 self
995 }
996
997 pub fn set_or_clear_service_connection_policy<T>(
1001 mut self,
1002 v: std::option::Option<T>,
1003 ) -> Self
1004 where
1005 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1006 {
1007 self.0.request.service_connection_policy = v.map(|x| x.into());
1008 self
1009 }
1010
1011 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1013 self.0.request.request_id = v.into();
1014 self
1015 }
1016 }
1017
1018 #[doc(hidden)]
1019 impl gax::options::internal::RequestBuilder for CreateServiceConnectionPolicy {
1020 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1021 &mut self.0.options
1022 }
1023 }
1024
1025 #[derive(Clone, Debug)]
1043 pub struct UpdateServiceConnectionPolicy(
1044 RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1045 );
1046
1047 impl UpdateServiceConnectionPolicy {
1048 pub(crate) fn new(
1049 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1050 ) -> Self {
1051 Self(RequestBuilder::new(stub))
1052 }
1053
1054 pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1056 mut self,
1057 v: V,
1058 ) -> Self {
1059 self.0.request = v.into();
1060 self
1061 }
1062
1063 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1065 self.0.options = v.into();
1066 self
1067 }
1068
1069 pub async fn send(self) -> Result<longrunning::model::Operation> {
1076 (*self.0.stub)
1077 .update_service_connection_policy(self.0.request, self.0.options)
1078 .await
1079 .map(gax::response::Response::into_body)
1080 }
1081
1082 pub fn poller(
1084 self,
1085 ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
1086 {
1087 type Operation = lro::internal::Operation<
1088 crate::model::ServiceConnectionPolicy,
1089 crate::model::OperationMetadata,
1090 >;
1091 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1092 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1093
1094 let stub = self.0.stub.clone();
1095 let mut options = self.0.options.clone();
1096 options.set_retry_policy(gax::retry_policy::NeverRetry);
1097 let query = move |name| {
1098 let stub = stub.clone();
1099 let options = options.clone();
1100 async {
1101 let op = GetOperation::new(stub)
1102 .set_name(name)
1103 .with_options(options)
1104 .send()
1105 .await?;
1106 Ok(Operation::new(op))
1107 }
1108 };
1109
1110 let start = move || async {
1111 let op = self.send().await?;
1112 Ok(Operation::new(op))
1113 };
1114
1115 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1116 }
1117
1118 pub fn set_update_mask<T>(mut self, v: T) -> Self
1120 where
1121 T: std::convert::Into<wkt::FieldMask>,
1122 {
1123 self.0.request.update_mask = std::option::Option::Some(v.into());
1124 self
1125 }
1126
1127 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1129 where
1130 T: std::convert::Into<wkt::FieldMask>,
1131 {
1132 self.0.request.update_mask = v.map(|x| x.into());
1133 self
1134 }
1135
1136 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1140 where
1141 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1142 {
1143 self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1144 self
1145 }
1146
1147 pub fn set_or_clear_service_connection_policy<T>(
1151 mut self,
1152 v: std::option::Option<T>,
1153 ) -> Self
1154 where
1155 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1156 {
1157 self.0.request.service_connection_policy = v.map(|x| x.into());
1158 self
1159 }
1160
1161 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163 self.0.request.request_id = v.into();
1164 self
1165 }
1166 }
1167
1168 #[doc(hidden)]
1169 impl gax::options::internal::RequestBuilder for UpdateServiceConnectionPolicy {
1170 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1171 &mut self.0.options
1172 }
1173 }
1174
1175 #[derive(Clone, Debug)]
1193 pub struct DeleteServiceConnectionPolicy(
1194 RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1195 );
1196
1197 impl DeleteServiceConnectionPolicy {
1198 pub(crate) fn new(
1199 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1200 ) -> Self {
1201 Self(RequestBuilder::new(stub))
1202 }
1203
1204 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1206 mut self,
1207 v: V,
1208 ) -> Self {
1209 self.0.request = v.into();
1210 self
1211 }
1212
1213 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1215 self.0.options = v.into();
1216 self
1217 }
1218
1219 pub async fn send(self) -> Result<longrunning::model::Operation> {
1226 (*self.0.stub)
1227 .delete_service_connection_policy(self.0.request, self.0.options)
1228 .await
1229 .map(gax::response::Response::into_body)
1230 }
1231
1232 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1234 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1235 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1236 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1237
1238 let stub = self.0.stub.clone();
1239 let mut options = self.0.options.clone();
1240 options.set_retry_policy(gax::retry_policy::NeverRetry);
1241 let query = move |name| {
1242 let stub = stub.clone();
1243 let options = options.clone();
1244 async {
1245 let op = GetOperation::new(stub)
1246 .set_name(name)
1247 .with_options(options)
1248 .send()
1249 .await?;
1250 Ok(Operation::new(op))
1251 }
1252 };
1253
1254 let start = move || async {
1255 let op = self.send().await?;
1256 Ok(Operation::new(op))
1257 };
1258
1259 lro::internal::new_unit_response_poller(
1260 polling_error_policy,
1261 polling_backoff_policy,
1262 start,
1263 query,
1264 )
1265 }
1266
1267 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1271 self.0.request.name = v.into();
1272 self
1273 }
1274
1275 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1277 self.0.request.request_id = v.into();
1278 self
1279 }
1280
1281 pub fn set_etag<T>(mut self, v: T) -> Self
1283 where
1284 T: std::convert::Into<std::string::String>,
1285 {
1286 self.0.request.etag = std::option::Option::Some(v.into());
1287 self
1288 }
1289
1290 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1292 where
1293 T: std::convert::Into<std::string::String>,
1294 {
1295 self.0.request.etag = v.map(|x| x.into());
1296 self
1297 }
1298 }
1299
1300 #[doc(hidden)]
1301 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionPolicy {
1302 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1303 &mut self.0.options
1304 }
1305 }
1306
1307 #[derive(Clone, Debug)]
1328 pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1329
1330 impl ListServiceClasses {
1331 pub(crate) fn new(
1332 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1333 ) -> Self {
1334 Self(RequestBuilder::new(stub))
1335 }
1336
1337 pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1339 mut self,
1340 v: V,
1341 ) -> Self {
1342 self.0.request = v.into();
1343 self
1344 }
1345
1346 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1348 self.0.options = v.into();
1349 self
1350 }
1351
1352 pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1354 (*self.0.stub)
1355 .list_service_classes(self.0.request, self.0.options)
1356 .await
1357 .map(gax::response::Response::into_body)
1358 }
1359
1360 pub fn by_page(
1362 self,
1363 ) -> impl gax::paginator::Paginator<crate::model::ListServiceClassesResponse, gax::error::Error>
1364 {
1365 use std::clone::Clone;
1366 let token = self.0.request.page_token.clone();
1367 let execute = move |token: String| {
1368 let mut builder = self.clone();
1369 builder.0.request = builder.0.request.set_page_token(token);
1370 builder.send()
1371 };
1372 gax::paginator::internal::new_paginator(token, execute)
1373 }
1374
1375 pub fn by_item(
1377 self,
1378 ) -> impl gax::paginator::ItemPaginator<
1379 crate::model::ListServiceClassesResponse,
1380 gax::error::Error,
1381 > {
1382 use gax::paginator::Paginator;
1383 self.by_page().items()
1384 }
1385
1386 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1390 self.0.request.parent = v.into();
1391 self
1392 }
1393
1394 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1396 self.0.request.page_size = v.into();
1397 self
1398 }
1399
1400 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1402 self.0.request.page_token = v.into();
1403 self
1404 }
1405
1406 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1408 self.0.request.filter = v.into();
1409 self
1410 }
1411
1412 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1414 self.0.request.order_by = v.into();
1415 self
1416 }
1417 }
1418
1419 #[doc(hidden)]
1420 impl gax::options::internal::RequestBuilder for ListServiceClasses {
1421 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1422 &mut self.0.options
1423 }
1424 }
1425
1426 #[derive(Clone, Debug)]
1443 pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1444
1445 impl GetServiceClass {
1446 pub(crate) fn new(
1447 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1448 ) -> Self {
1449 Self(RequestBuilder::new(stub))
1450 }
1451
1452 pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1454 self.0.request = v.into();
1455 self
1456 }
1457
1458 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1460 self.0.options = v.into();
1461 self
1462 }
1463
1464 pub async fn send(self) -> Result<crate::model::ServiceClass> {
1466 (*self.0.stub)
1467 .get_service_class(self.0.request, self.0.options)
1468 .await
1469 .map(gax::response::Response::into_body)
1470 }
1471
1472 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1476 self.0.request.name = v.into();
1477 self
1478 }
1479 }
1480
1481 #[doc(hidden)]
1482 impl gax::options::internal::RequestBuilder for GetServiceClass {
1483 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1484 &mut self.0.options
1485 }
1486 }
1487
1488 #[derive(Clone, Debug)]
1506 pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1507
1508 impl UpdateServiceClass {
1509 pub(crate) fn new(
1510 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1511 ) -> Self {
1512 Self(RequestBuilder::new(stub))
1513 }
1514
1515 pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1517 mut self,
1518 v: V,
1519 ) -> Self {
1520 self.0.request = v.into();
1521 self
1522 }
1523
1524 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1526 self.0.options = v.into();
1527 self
1528 }
1529
1530 pub async fn send(self) -> Result<longrunning::model::Operation> {
1537 (*self.0.stub)
1538 .update_service_class(self.0.request, self.0.options)
1539 .await
1540 .map(gax::response::Response::into_body)
1541 }
1542
1543 pub fn poller(
1545 self,
1546 ) -> impl lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata> {
1547 type Operation = lro::internal::Operation<
1548 crate::model::ServiceClass,
1549 crate::model::OperationMetadata,
1550 >;
1551 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1552 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1553
1554 let stub = self.0.stub.clone();
1555 let mut options = self.0.options.clone();
1556 options.set_retry_policy(gax::retry_policy::NeverRetry);
1557 let query = move |name| {
1558 let stub = stub.clone();
1559 let options = options.clone();
1560 async {
1561 let op = GetOperation::new(stub)
1562 .set_name(name)
1563 .with_options(options)
1564 .send()
1565 .await?;
1566 Ok(Operation::new(op))
1567 }
1568 };
1569
1570 let start = move || async {
1571 let op = self.send().await?;
1572 Ok(Operation::new(op))
1573 };
1574
1575 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1576 }
1577
1578 pub fn set_update_mask<T>(mut self, v: T) -> Self
1580 where
1581 T: std::convert::Into<wkt::FieldMask>,
1582 {
1583 self.0.request.update_mask = std::option::Option::Some(v.into());
1584 self
1585 }
1586
1587 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1589 where
1590 T: std::convert::Into<wkt::FieldMask>,
1591 {
1592 self.0.request.update_mask = v.map(|x| x.into());
1593 self
1594 }
1595
1596 pub fn set_service_class<T>(mut self, v: T) -> Self
1600 where
1601 T: std::convert::Into<crate::model::ServiceClass>,
1602 {
1603 self.0.request.service_class = std::option::Option::Some(v.into());
1604 self
1605 }
1606
1607 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1611 where
1612 T: std::convert::Into<crate::model::ServiceClass>,
1613 {
1614 self.0.request.service_class = v.map(|x| x.into());
1615 self
1616 }
1617
1618 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1620 self.0.request.request_id = v.into();
1621 self
1622 }
1623 }
1624
1625 #[doc(hidden)]
1626 impl gax::options::internal::RequestBuilder for UpdateServiceClass {
1627 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1628 &mut self.0.options
1629 }
1630 }
1631
1632 #[derive(Clone, Debug)]
1650 pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1651
1652 impl DeleteServiceClass {
1653 pub(crate) fn new(
1654 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1655 ) -> Self {
1656 Self(RequestBuilder::new(stub))
1657 }
1658
1659 pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1661 mut self,
1662 v: V,
1663 ) -> Self {
1664 self.0.request = v.into();
1665 self
1666 }
1667
1668 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1670 self.0.options = v.into();
1671 self
1672 }
1673
1674 pub async fn send(self) -> Result<longrunning::model::Operation> {
1681 (*self.0.stub)
1682 .delete_service_class(self.0.request, self.0.options)
1683 .await
1684 .map(gax::response::Response::into_body)
1685 }
1686
1687 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1689 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1690 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1691 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1692
1693 let stub = self.0.stub.clone();
1694 let mut options = self.0.options.clone();
1695 options.set_retry_policy(gax::retry_policy::NeverRetry);
1696 let query = move |name| {
1697 let stub = stub.clone();
1698 let options = options.clone();
1699 async {
1700 let op = GetOperation::new(stub)
1701 .set_name(name)
1702 .with_options(options)
1703 .send()
1704 .await?;
1705 Ok(Operation::new(op))
1706 }
1707 };
1708
1709 let start = move || async {
1710 let op = self.send().await?;
1711 Ok(Operation::new(op))
1712 };
1713
1714 lro::internal::new_unit_response_poller(
1715 polling_error_policy,
1716 polling_backoff_policy,
1717 start,
1718 query,
1719 )
1720 }
1721
1722 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1726 self.0.request.name = v.into();
1727 self
1728 }
1729
1730 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1732 self.0.request.request_id = v.into();
1733 self
1734 }
1735
1736 pub fn set_etag<T>(mut self, v: T) -> Self
1738 where
1739 T: std::convert::Into<std::string::String>,
1740 {
1741 self.0.request.etag = std::option::Option::Some(v.into());
1742 self
1743 }
1744
1745 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1747 where
1748 T: std::convert::Into<std::string::String>,
1749 {
1750 self.0.request.etag = v.map(|x| x.into());
1751 self
1752 }
1753 }
1754
1755 #[doc(hidden)]
1756 impl gax::options::internal::RequestBuilder for DeleteServiceClass {
1757 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1758 &mut self.0.options
1759 }
1760 }
1761
1762 #[derive(Clone, Debug)]
1779 pub struct GetServiceConnectionToken(
1780 RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1781 );
1782
1783 impl GetServiceConnectionToken {
1784 pub(crate) fn new(
1785 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1786 ) -> Self {
1787 Self(RequestBuilder::new(stub))
1788 }
1789
1790 pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1792 mut self,
1793 v: V,
1794 ) -> Self {
1795 self.0.request = v.into();
1796 self
1797 }
1798
1799 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1801 self.0.options = v.into();
1802 self
1803 }
1804
1805 pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1807 (*self.0.stub)
1808 .get_service_connection_token(self.0.request, self.0.options)
1809 .await
1810 .map(gax::response::Response::into_body)
1811 }
1812
1813 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1817 self.0.request.name = v.into();
1818 self
1819 }
1820 }
1821
1822 #[doc(hidden)]
1823 impl gax::options::internal::RequestBuilder for GetServiceConnectionToken {
1824 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1825 &mut self.0.options
1826 }
1827 }
1828
1829 #[derive(Clone, Debug)]
1850 pub struct ListServiceConnectionTokens(
1851 RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1852 );
1853
1854 impl ListServiceConnectionTokens {
1855 pub(crate) fn new(
1856 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1857 ) -> Self {
1858 Self(RequestBuilder::new(stub))
1859 }
1860
1861 pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1863 mut self,
1864 v: V,
1865 ) -> Self {
1866 self.0.request = v.into();
1867 self
1868 }
1869
1870 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1872 self.0.options = v.into();
1873 self
1874 }
1875
1876 pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1878 (*self.0.stub)
1879 .list_service_connection_tokens(self.0.request, self.0.options)
1880 .await
1881 .map(gax::response::Response::into_body)
1882 }
1883
1884 pub fn by_page(
1886 self,
1887 ) -> impl gax::paginator::Paginator<
1888 crate::model::ListServiceConnectionTokensResponse,
1889 gax::error::Error,
1890 > {
1891 use std::clone::Clone;
1892 let token = self.0.request.page_token.clone();
1893 let execute = move |token: String| {
1894 let mut builder = self.clone();
1895 builder.0.request = builder.0.request.set_page_token(token);
1896 builder.send()
1897 };
1898 gax::paginator::internal::new_paginator(token, execute)
1899 }
1900
1901 pub fn by_item(
1903 self,
1904 ) -> impl gax::paginator::ItemPaginator<
1905 crate::model::ListServiceConnectionTokensResponse,
1906 gax::error::Error,
1907 > {
1908 use gax::paginator::Paginator;
1909 self.by_page().items()
1910 }
1911
1912 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1916 self.0.request.parent = v.into();
1917 self
1918 }
1919
1920 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1922 self.0.request.page_size = v.into();
1923 self
1924 }
1925
1926 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1928 self.0.request.page_token = v.into();
1929 self
1930 }
1931
1932 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1934 self.0.request.filter = v.into();
1935 self
1936 }
1937
1938 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1940 self.0.request.order_by = v.into();
1941 self
1942 }
1943 }
1944
1945 #[doc(hidden)]
1946 impl gax::options::internal::RequestBuilder for ListServiceConnectionTokens {
1947 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1948 &mut self.0.options
1949 }
1950 }
1951
1952 #[derive(Clone, Debug)]
1970 pub struct CreateServiceConnectionToken(
1971 RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
1972 );
1973
1974 impl CreateServiceConnectionToken {
1975 pub(crate) fn new(
1976 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1977 ) -> Self {
1978 Self(RequestBuilder::new(stub))
1979 }
1980
1981 pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
1983 mut self,
1984 v: V,
1985 ) -> Self {
1986 self.0.request = v.into();
1987 self
1988 }
1989
1990 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1992 self.0.options = v.into();
1993 self
1994 }
1995
1996 pub async fn send(self) -> Result<longrunning::model::Operation> {
2003 (*self.0.stub)
2004 .create_service_connection_token(self.0.request, self.0.options)
2005 .await
2006 .map(gax::response::Response::into_body)
2007 }
2008
2009 pub fn poller(
2011 self,
2012 ) -> impl lro::Poller<crate::model::ServiceConnectionToken, crate::model::OperationMetadata>
2013 {
2014 type Operation = lro::internal::Operation<
2015 crate::model::ServiceConnectionToken,
2016 crate::model::OperationMetadata,
2017 >;
2018 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2019 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2020
2021 let stub = self.0.stub.clone();
2022 let mut options = self.0.options.clone();
2023 options.set_retry_policy(gax::retry_policy::NeverRetry);
2024 let query = move |name| {
2025 let stub = stub.clone();
2026 let options = options.clone();
2027 async {
2028 let op = GetOperation::new(stub)
2029 .set_name(name)
2030 .with_options(options)
2031 .send()
2032 .await?;
2033 Ok(Operation::new(op))
2034 }
2035 };
2036
2037 let start = move || async {
2038 let op = self.send().await?;
2039 Ok(Operation::new(op))
2040 };
2041
2042 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2043 }
2044
2045 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2049 self.0.request.parent = v.into();
2050 self
2051 }
2052
2053 pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2055 mut self,
2056 v: T,
2057 ) -> Self {
2058 self.0.request.service_connection_token_id = v.into();
2059 self
2060 }
2061
2062 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2066 where
2067 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2068 {
2069 self.0.request.service_connection_token = std::option::Option::Some(v.into());
2070 self
2071 }
2072
2073 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2077 where
2078 T: std::convert::Into<crate::model::ServiceConnectionToken>,
2079 {
2080 self.0.request.service_connection_token = v.map(|x| x.into());
2081 self
2082 }
2083
2084 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2086 self.0.request.request_id = v.into();
2087 self
2088 }
2089 }
2090
2091 #[doc(hidden)]
2092 impl gax::options::internal::RequestBuilder for CreateServiceConnectionToken {
2093 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2094 &mut self.0.options
2095 }
2096 }
2097
2098 #[derive(Clone, Debug)]
2116 pub struct DeleteServiceConnectionToken(
2117 RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2118 );
2119
2120 impl DeleteServiceConnectionToken {
2121 pub(crate) fn new(
2122 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2123 ) -> Self {
2124 Self(RequestBuilder::new(stub))
2125 }
2126
2127 pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2129 mut self,
2130 v: V,
2131 ) -> Self {
2132 self.0.request = v.into();
2133 self
2134 }
2135
2136 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2138 self.0.options = v.into();
2139 self
2140 }
2141
2142 pub async fn send(self) -> Result<longrunning::model::Operation> {
2149 (*self.0.stub)
2150 .delete_service_connection_token(self.0.request, self.0.options)
2151 .await
2152 .map(gax::response::Response::into_body)
2153 }
2154
2155 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2157 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2158 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2159 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2160
2161 let stub = self.0.stub.clone();
2162 let mut options = self.0.options.clone();
2163 options.set_retry_policy(gax::retry_policy::NeverRetry);
2164 let query = move |name| {
2165 let stub = stub.clone();
2166 let options = options.clone();
2167 async {
2168 let op = GetOperation::new(stub)
2169 .set_name(name)
2170 .with_options(options)
2171 .send()
2172 .await?;
2173 Ok(Operation::new(op))
2174 }
2175 };
2176
2177 let start = move || async {
2178 let op = self.send().await?;
2179 Ok(Operation::new(op))
2180 };
2181
2182 lro::internal::new_unit_response_poller(
2183 polling_error_policy,
2184 polling_backoff_policy,
2185 start,
2186 query,
2187 )
2188 }
2189
2190 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2194 self.0.request.name = v.into();
2195 self
2196 }
2197
2198 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2200 self.0.request.request_id = v.into();
2201 self
2202 }
2203
2204 pub fn set_etag<T>(mut self, v: T) -> Self
2206 where
2207 T: std::convert::Into<std::string::String>,
2208 {
2209 self.0.request.etag = std::option::Option::Some(v.into());
2210 self
2211 }
2212
2213 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2215 where
2216 T: std::convert::Into<std::string::String>,
2217 {
2218 self.0.request.etag = v.map(|x| x.into());
2219 self
2220 }
2221 }
2222
2223 #[doc(hidden)]
2224 impl gax::options::internal::RequestBuilder for DeleteServiceConnectionToken {
2225 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2226 &mut self.0.options
2227 }
2228 }
2229
2230 #[derive(Clone, Debug)]
2251 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2252
2253 impl ListLocations {
2254 pub(crate) fn new(
2255 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2256 ) -> Self {
2257 Self(RequestBuilder::new(stub))
2258 }
2259
2260 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2262 mut self,
2263 v: V,
2264 ) -> Self {
2265 self.0.request = v.into();
2266 self
2267 }
2268
2269 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2271 self.0.options = v.into();
2272 self
2273 }
2274
2275 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2277 (*self.0.stub)
2278 .list_locations(self.0.request, self.0.options)
2279 .await
2280 .map(gax::response::Response::into_body)
2281 }
2282
2283 pub fn by_page(
2285 self,
2286 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2287 {
2288 use std::clone::Clone;
2289 let token = self.0.request.page_token.clone();
2290 let execute = move |token: String| {
2291 let mut builder = self.clone();
2292 builder.0.request = builder.0.request.set_page_token(token);
2293 builder.send()
2294 };
2295 gax::paginator::internal::new_paginator(token, execute)
2296 }
2297
2298 pub fn by_item(
2300 self,
2301 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2302 {
2303 use gax::paginator::Paginator;
2304 self.by_page().items()
2305 }
2306
2307 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2309 self.0.request.name = v.into();
2310 self
2311 }
2312
2313 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2315 self.0.request.filter = v.into();
2316 self
2317 }
2318
2319 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2321 self.0.request.page_size = v.into();
2322 self
2323 }
2324
2325 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2327 self.0.request.page_token = v.into();
2328 self
2329 }
2330 }
2331
2332 #[doc(hidden)]
2333 impl gax::options::internal::RequestBuilder for ListLocations {
2334 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2335 &mut self.0.options
2336 }
2337 }
2338
2339 #[derive(Clone, Debug)]
2356 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2357
2358 impl GetLocation {
2359 pub(crate) fn new(
2360 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2361 ) -> Self {
2362 Self(RequestBuilder::new(stub))
2363 }
2364
2365 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2367 self.0.request = v.into();
2368 self
2369 }
2370
2371 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2373 self.0.options = v.into();
2374 self
2375 }
2376
2377 pub async fn send(self) -> Result<location::model::Location> {
2379 (*self.0.stub)
2380 .get_location(self.0.request, self.0.options)
2381 .await
2382 .map(gax::response::Response::into_body)
2383 }
2384
2385 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2387 self.0.request.name = v.into();
2388 self
2389 }
2390 }
2391
2392 #[doc(hidden)]
2393 impl gax::options::internal::RequestBuilder for GetLocation {
2394 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2395 &mut self.0.options
2396 }
2397 }
2398
2399 #[derive(Clone, Debug)]
2416 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2417
2418 impl SetIamPolicy {
2419 pub(crate) fn new(
2420 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2421 ) -> Self {
2422 Self(RequestBuilder::new(stub))
2423 }
2424
2425 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2427 self.0.request = v.into();
2428 self
2429 }
2430
2431 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2433 self.0.options = v.into();
2434 self
2435 }
2436
2437 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2439 (*self.0.stub)
2440 .set_iam_policy(self.0.request, self.0.options)
2441 .await
2442 .map(gax::response::Response::into_body)
2443 }
2444
2445 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2449 self.0.request.resource = v.into();
2450 self
2451 }
2452
2453 pub fn set_policy<T>(mut self, v: T) -> Self
2457 where
2458 T: std::convert::Into<iam_v1::model::Policy>,
2459 {
2460 self.0.request.policy = std::option::Option::Some(v.into());
2461 self
2462 }
2463
2464 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2468 where
2469 T: std::convert::Into<iam_v1::model::Policy>,
2470 {
2471 self.0.request.policy = v.map(|x| x.into());
2472 self
2473 }
2474
2475 pub fn set_update_mask<T>(mut self, v: T) -> Self
2477 where
2478 T: std::convert::Into<wkt::FieldMask>,
2479 {
2480 self.0.request.update_mask = std::option::Option::Some(v.into());
2481 self
2482 }
2483
2484 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2486 where
2487 T: std::convert::Into<wkt::FieldMask>,
2488 {
2489 self.0.request.update_mask = v.map(|x| x.into());
2490 self
2491 }
2492 }
2493
2494 #[doc(hidden)]
2495 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2496 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2497 &mut self.0.options
2498 }
2499 }
2500
2501 #[derive(Clone, Debug)]
2518 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2519
2520 impl GetIamPolicy {
2521 pub(crate) fn new(
2522 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2523 ) -> Self {
2524 Self(RequestBuilder::new(stub))
2525 }
2526
2527 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2529 self.0.request = v.into();
2530 self
2531 }
2532
2533 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2535 self.0.options = v.into();
2536 self
2537 }
2538
2539 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2541 (*self.0.stub)
2542 .get_iam_policy(self.0.request, self.0.options)
2543 .await
2544 .map(gax::response::Response::into_body)
2545 }
2546
2547 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2551 self.0.request.resource = v.into();
2552 self
2553 }
2554
2555 pub fn set_options<T>(mut self, v: T) -> Self
2557 where
2558 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2559 {
2560 self.0.request.options = std::option::Option::Some(v.into());
2561 self
2562 }
2563
2564 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2566 where
2567 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2568 {
2569 self.0.request.options = v.map(|x| x.into());
2570 self
2571 }
2572 }
2573
2574 #[doc(hidden)]
2575 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2576 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2577 &mut self.0.options
2578 }
2579 }
2580
2581 #[derive(Clone, Debug)]
2598 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2599
2600 impl TestIamPermissions {
2601 pub(crate) fn new(
2602 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2603 ) -> Self {
2604 Self(RequestBuilder::new(stub))
2605 }
2606
2607 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2609 mut self,
2610 v: V,
2611 ) -> Self {
2612 self.0.request = v.into();
2613 self
2614 }
2615
2616 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2618 self.0.options = v.into();
2619 self
2620 }
2621
2622 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2624 (*self.0.stub)
2625 .test_iam_permissions(self.0.request, self.0.options)
2626 .await
2627 .map(gax::response::Response::into_body)
2628 }
2629
2630 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2634 self.0.request.resource = v.into();
2635 self
2636 }
2637
2638 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2642 where
2643 T: std::iter::IntoIterator<Item = V>,
2644 V: std::convert::Into<std::string::String>,
2645 {
2646 use std::iter::Iterator;
2647 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2648 self
2649 }
2650 }
2651
2652 #[doc(hidden)]
2653 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2654 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2655 &mut self.0.options
2656 }
2657 }
2658
2659 #[derive(Clone, Debug)]
2680 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2681
2682 impl ListOperations {
2683 pub(crate) fn new(
2684 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2685 ) -> Self {
2686 Self(RequestBuilder::new(stub))
2687 }
2688
2689 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2691 mut self,
2692 v: V,
2693 ) -> Self {
2694 self.0.request = v.into();
2695 self
2696 }
2697
2698 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2700 self.0.options = v.into();
2701 self
2702 }
2703
2704 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2706 (*self.0.stub)
2707 .list_operations(self.0.request, self.0.options)
2708 .await
2709 .map(gax::response::Response::into_body)
2710 }
2711
2712 pub fn by_page(
2714 self,
2715 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2716 {
2717 use std::clone::Clone;
2718 let token = self.0.request.page_token.clone();
2719 let execute = move |token: String| {
2720 let mut builder = self.clone();
2721 builder.0.request = builder.0.request.set_page_token(token);
2722 builder.send()
2723 };
2724 gax::paginator::internal::new_paginator(token, execute)
2725 }
2726
2727 pub fn by_item(
2729 self,
2730 ) -> impl gax::paginator::ItemPaginator<
2731 longrunning::model::ListOperationsResponse,
2732 gax::error::Error,
2733 > {
2734 use gax::paginator::Paginator;
2735 self.by_page().items()
2736 }
2737
2738 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2740 self.0.request.name = v.into();
2741 self
2742 }
2743
2744 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2746 self.0.request.filter = v.into();
2747 self
2748 }
2749
2750 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2752 self.0.request.page_size = v.into();
2753 self
2754 }
2755
2756 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2758 self.0.request.page_token = v.into();
2759 self
2760 }
2761
2762 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2764 self.0.request.return_partial_success = v.into();
2765 self
2766 }
2767 }
2768
2769 #[doc(hidden)]
2770 impl gax::options::internal::RequestBuilder for ListOperations {
2771 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2772 &mut self.0.options
2773 }
2774 }
2775
2776 #[derive(Clone, Debug)]
2793 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2794
2795 impl GetOperation {
2796 pub(crate) fn new(
2797 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2798 ) -> Self {
2799 Self(RequestBuilder::new(stub))
2800 }
2801
2802 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2804 mut self,
2805 v: V,
2806 ) -> Self {
2807 self.0.request = v.into();
2808 self
2809 }
2810
2811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2813 self.0.options = v.into();
2814 self
2815 }
2816
2817 pub async fn send(self) -> Result<longrunning::model::Operation> {
2819 (*self.0.stub)
2820 .get_operation(self.0.request, self.0.options)
2821 .await
2822 .map(gax::response::Response::into_body)
2823 }
2824
2825 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2827 self.0.request.name = v.into();
2828 self
2829 }
2830 }
2831
2832 #[doc(hidden)]
2833 impl gax::options::internal::RequestBuilder for GetOperation {
2834 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2835 &mut self.0.options
2836 }
2837 }
2838
2839 #[derive(Clone, Debug)]
2856 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2857
2858 impl DeleteOperation {
2859 pub(crate) fn new(
2860 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2861 ) -> Self {
2862 Self(RequestBuilder::new(stub))
2863 }
2864
2865 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2867 mut self,
2868 v: V,
2869 ) -> Self {
2870 self.0.request = v.into();
2871 self
2872 }
2873
2874 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2876 self.0.options = v.into();
2877 self
2878 }
2879
2880 pub async fn send(self) -> Result<()> {
2882 (*self.0.stub)
2883 .delete_operation(self.0.request, self.0.options)
2884 .await
2885 .map(gax::response::Response::into_body)
2886 }
2887
2888 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2890 self.0.request.name = v.into();
2891 self
2892 }
2893 }
2894
2895 #[doc(hidden)]
2896 impl gax::options::internal::RequestBuilder for DeleteOperation {
2897 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2898 &mut self.0.options
2899 }
2900 }
2901
2902 #[derive(Clone, Debug)]
2919 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2920
2921 impl CancelOperation {
2922 pub(crate) fn new(
2923 stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2924 ) -> Self {
2925 Self(RequestBuilder::new(stub))
2926 }
2927
2928 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2930 mut self,
2931 v: V,
2932 ) -> Self {
2933 self.0.request = v.into();
2934 self
2935 }
2936
2937 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2939 self.0.options = v.into();
2940 self
2941 }
2942
2943 pub async fn send(self) -> Result<()> {
2945 (*self.0.stub)
2946 .cancel_operation(self.0.request, self.0.options)
2947 .await
2948 .map(gax::response::Response::into_body)
2949 }
2950
2951 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2953 self.0.request.name = v.into();
2954 self
2955 }
2956 }
2957
2958 #[doc(hidden)]
2959 impl gax::options::internal::RequestBuilder for CancelOperation {
2960 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2961 &mut self.0.options
2962 }
2963 }
2964}
2965
2966pub mod data_transfer_service {
2967 use crate::Result;
2968
2969 pub type ClientBuilder =
2983 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2984
2985 pub(crate) mod client {
2986 use super::super::super::client::DataTransferService;
2987 pub struct Factory;
2988 impl gax::client_builder::internal::ClientFactory for Factory {
2989 type Client = DataTransferService;
2990 type Credentials = gaxi::options::Credentials;
2991 async fn build(
2992 self,
2993 config: gaxi::options::ClientConfig,
2994 ) -> gax::client_builder::Result<Self::Client> {
2995 Self::Client::new(config).await
2996 }
2997 }
2998 }
2999
3000 #[derive(Clone, Debug)]
3002 pub(crate) struct RequestBuilder<R: std::default::Default> {
3003 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3004 request: R,
3005 options: gax::options::RequestOptions,
3006 }
3007
3008 impl<R> RequestBuilder<R>
3009 where
3010 R: std::default::Default,
3011 {
3012 pub(crate) fn new(
3013 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3014 ) -> Self {
3015 Self {
3016 stub,
3017 request: R::default(),
3018 options: gax::options::RequestOptions::default(),
3019 }
3020 }
3021 }
3022
3023 #[derive(Clone, Debug)]
3044 pub struct ListMulticloudDataTransferConfigs(
3045 RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3046 );
3047
3048 impl ListMulticloudDataTransferConfigs {
3049 pub(crate) fn new(
3050 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3051 ) -> Self {
3052 Self(RequestBuilder::new(stub))
3053 }
3054
3055 pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3057 mut self,
3058 v: V,
3059 ) -> Self {
3060 self.0.request = v.into();
3061 self
3062 }
3063
3064 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3066 self.0.options = v.into();
3067 self
3068 }
3069
3070 pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3072 (*self.0.stub)
3073 .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3074 .await
3075 .map(gax::response::Response::into_body)
3076 }
3077
3078 pub fn by_page(
3080 self,
3081 ) -> impl gax::paginator::Paginator<
3082 crate::model::ListMulticloudDataTransferConfigsResponse,
3083 gax::error::Error,
3084 > {
3085 use std::clone::Clone;
3086 let token = self.0.request.page_token.clone();
3087 let execute = move |token: String| {
3088 let mut builder = self.clone();
3089 builder.0.request = builder.0.request.set_page_token(token);
3090 builder.send()
3091 };
3092 gax::paginator::internal::new_paginator(token, execute)
3093 }
3094
3095 pub fn by_item(
3097 self,
3098 ) -> impl gax::paginator::ItemPaginator<
3099 crate::model::ListMulticloudDataTransferConfigsResponse,
3100 gax::error::Error,
3101 > {
3102 use gax::paginator::Paginator;
3103 self.by_page().items()
3104 }
3105
3106 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3110 self.0.request.parent = v.into();
3111 self
3112 }
3113
3114 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3116 self.0.request.page_size = v.into();
3117 self
3118 }
3119
3120 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3122 self.0.request.page_token = v.into();
3123 self
3124 }
3125
3126 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3128 self.0.request.filter = v.into();
3129 self
3130 }
3131
3132 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3134 self.0.request.order_by = v.into();
3135 self
3136 }
3137
3138 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3140 self.0.request.return_partial_success = v.into();
3141 self
3142 }
3143 }
3144
3145 #[doc(hidden)]
3146 impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferConfigs {
3147 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3148 &mut self.0.options
3149 }
3150 }
3151
3152 #[derive(Clone, Debug)]
3169 pub struct GetMulticloudDataTransferConfig(
3170 RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3171 );
3172
3173 impl GetMulticloudDataTransferConfig {
3174 pub(crate) fn new(
3175 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3176 ) -> Self {
3177 Self(RequestBuilder::new(stub))
3178 }
3179
3180 pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3182 mut self,
3183 v: V,
3184 ) -> Self {
3185 self.0.request = v.into();
3186 self
3187 }
3188
3189 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3191 self.0.options = v.into();
3192 self
3193 }
3194
3195 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3197 (*self.0.stub)
3198 .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3199 .await
3200 .map(gax::response::Response::into_body)
3201 }
3202
3203 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3207 self.0.request.name = v.into();
3208 self
3209 }
3210 }
3211
3212 #[doc(hidden)]
3213 impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferConfig {
3214 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3215 &mut self.0.options
3216 }
3217 }
3218
3219 #[derive(Clone, Debug)]
3237 pub struct CreateMulticloudDataTransferConfig(
3238 RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3239 );
3240
3241 impl CreateMulticloudDataTransferConfig {
3242 pub(crate) fn new(
3243 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3244 ) -> Self {
3245 Self(RequestBuilder::new(stub))
3246 }
3247
3248 pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3250 mut self,
3251 v: V,
3252 ) -> Self {
3253 self.0.request = v.into();
3254 self
3255 }
3256
3257 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3259 self.0.options = v.into();
3260 self
3261 }
3262
3263 pub async fn send(self) -> Result<longrunning::model::Operation> {
3270 (*self.0.stub)
3271 .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3272 .await
3273 .map(gax::response::Response::into_body)
3274 }
3275
3276 pub fn poller(
3278 self,
3279 ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3280 {
3281 type Operation = lro::internal::Operation<
3282 crate::model::MulticloudDataTransferConfig,
3283 crate::model::OperationMetadata,
3284 >;
3285 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3286 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3287
3288 let stub = self.0.stub.clone();
3289 let mut options = self.0.options.clone();
3290 options.set_retry_policy(gax::retry_policy::NeverRetry);
3291 let query = move |name| {
3292 let stub = stub.clone();
3293 let options = options.clone();
3294 async {
3295 let op = GetOperation::new(stub)
3296 .set_name(name)
3297 .with_options(options)
3298 .send()
3299 .await?;
3300 Ok(Operation::new(op))
3301 }
3302 };
3303
3304 let start = move || async {
3305 let op = self.send().await?;
3306 Ok(Operation::new(op))
3307 };
3308
3309 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3310 }
3311
3312 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3316 self.0.request.parent = v.into();
3317 self
3318 }
3319
3320 pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3324 mut self,
3325 v: T,
3326 ) -> Self {
3327 self.0.request.multicloud_data_transfer_config_id = v.into();
3328 self
3329 }
3330
3331 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3335 where
3336 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3337 {
3338 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3339 self
3340 }
3341
3342 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3346 mut self,
3347 v: std::option::Option<T>,
3348 ) -> Self
3349 where
3350 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3351 {
3352 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3353 self
3354 }
3355
3356 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3358 self.0.request.request_id = v.into();
3359 self
3360 }
3361 }
3362
3363 #[doc(hidden)]
3364 impl gax::options::internal::RequestBuilder for CreateMulticloudDataTransferConfig {
3365 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3366 &mut self.0.options
3367 }
3368 }
3369
3370 #[derive(Clone, Debug)]
3388 pub struct UpdateMulticloudDataTransferConfig(
3389 RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3390 );
3391
3392 impl UpdateMulticloudDataTransferConfig {
3393 pub(crate) fn new(
3394 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3395 ) -> Self {
3396 Self(RequestBuilder::new(stub))
3397 }
3398
3399 pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3401 mut self,
3402 v: V,
3403 ) -> Self {
3404 self.0.request = v.into();
3405 self
3406 }
3407
3408 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3410 self.0.options = v.into();
3411 self
3412 }
3413
3414 pub async fn send(self) -> Result<longrunning::model::Operation> {
3421 (*self.0.stub)
3422 .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3423 .await
3424 .map(gax::response::Response::into_body)
3425 }
3426
3427 pub fn poller(
3429 self,
3430 ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3431 {
3432 type Operation = lro::internal::Operation<
3433 crate::model::MulticloudDataTransferConfig,
3434 crate::model::OperationMetadata,
3435 >;
3436 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3437 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3438
3439 let stub = self.0.stub.clone();
3440 let mut options = self.0.options.clone();
3441 options.set_retry_policy(gax::retry_policy::NeverRetry);
3442 let query = move |name| {
3443 let stub = stub.clone();
3444 let options = options.clone();
3445 async {
3446 let op = GetOperation::new(stub)
3447 .set_name(name)
3448 .with_options(options)
3449 .send()
3450 .await?;
3451 Ok(Operation::new(op))
3452 }
3453 };
3454
3455 let start = move || async {
3456 let op = self.send().await?;
3457 Ok(Operation::new(op))
3458 };
3459
3460 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3461 }
3462
3463 pub fn set_update_mask<T>(mut self, v: T) -> Self
3465 where
3466 T: std::convert::Into<wkt::FieldMask>,
3467 {
3468 self.0.request.update_mask = std::option::Option::Some(v.into());
3469 self
3470 }
3471
3472 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3474 where
3475 T: std::convert::Into<wkt::FieldMask>,
3476 {
3477 self.0.request.update_mask = v.map(|x| x.into());
3478 self
3479 }
3480
3481 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3485 where
3486 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3487 {
3488 self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3489 self
3490 }
3491
3492 pub fn set_or_clear_multicloud_data_transfer_config<T>(
3496 mut self,
3497 v: std::option::Option<T>,
3498 ) -> Self
3499 where
3500 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3501 {
3502 self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3503 self
3504 }
3505
3506 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3508 self.0.request.request_id = v.into();
3509 self
3510 }
3511 }
3512
3513 #[doc(hidden)]
3514 impl gax::options::internal::RequestBuilder for UpdateMulticloudDataTransferConfig {
3515 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3516 &mut self.0.options
3517 }
3518 }
3519
3520 #[derive(Clone, Debug)]
3538 pub struct DeleteMulticloudDataTransferConfig(
3539 RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3540 );
3541
3542 impl DeleteMulticloudDataTransferConfig {
3543 pub(crate) fn new(
3544 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3545 ) -> Self {
3546 Self(RequestBuilder::new(stub))
3547 }
3548
3549 pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3551 mut self,
3552 v: V,
3553 ) -> Self {
3554 self.0.request = v.into();
3555 self
3556 }
3557
3558 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3560 self.0.options = v.into();
3561 self
3562 }
3563
3564 pub async fn send(self) -> Result<longrunning::model::Operation> {
3571 (*self.0.stub)
3572 .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3573 .await
3574 .map(gax::response::Response::into_body)
3575 }
3576
3577 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3579 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3580 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3581 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3582
3583 let stub = self.0.stub.clone();
3584 let mut options = self.0.options.clone();
3585 options.set_retry_policy(gax::retry_policy::NeverRetry);
3586 let query = move |name| {
3587 let stub = stub.clone();
3588 let options = options.clone();
3589 async {
3590 let op = GetOperation::new(stub)
3591 .set_name(name)
3592 .with_options(options)
3593 .send()
3594 .await?;
3595 Ok(Operation::new(op))
3596 }
3597 };
3598
3599 let start = move || async {
3600 let op = self.send().await?;
3601 Ok(Operation::new(op))
3602 };
3603
3604 lro::internal::new_unit_response_poller(
3605 polling_error_policy,
3606 polling_backoff_policy,
3607 start,
3608 query,
3609 )
3610 }
3611
3612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3616 self.0.request.name = v.into();
3617 self
3618 }
3619
3620 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3622 self.0.request.request_id = v.into();
3623 self
3624 }
3625
3626 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3628 self.0.request.etag = v.into();
3629 self
3630 }
3631 }
3632
3633 #[doc(hidden)]
3634 impl gax::options::internal::RequestBuilder for DeleteMulticloudDataTransferConfig {
3635 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3636 &mut self.0.options
3637 }
3638 }
3639
3640 #[derive(Clone, Debug)]
3661 pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3662
3663 impl ListDestinations {
3664 pub(crate) fn new(
3665 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3666 ) -> Self {
3667 Self(RequestBuilder::new(stub))
3668 }
3669
3670 pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3672 mut self,
3673 v: V,
3674 ) -> Self {
3675 self.0.request = v.into();
3676 self
3677 }
3678
3679 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3681 self.0.options = v.into();
3682 self
3683 }
3684
3685 pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3687 (*self.0.stub)
3688 .list_destinations(self.0.request, self.0.options)
3689 .await
3690 .map(gax::response::Response::into_body)
3691 }
3692
3693 pub fn by_page(
3695 self,
3696 ) -> impl gax::paginator::Paginator<crate::model::ListDestinationsResponse, gax::error::Error>
3697 {
3698 use std::clone::Clone;
3699 let token = self.0.request.page_token.clone();
3700 let execute = move |token: String| {
3701 let mut builder = self.clone();
3702 builder.0.request = builder.0.request.set_page_token(token);
3703 builder.send()
3704 };
3705 gax::paginator::internal::new_paginator(token, execute)
3706 }
3707
3708 pub fn by_item(
3710 self,
3711 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDestinationsResponse, gax::error::Error>
3712 {
3713 use gax::paginator::Paginator;
3714 self.by_page().items()
3715 }
3716
3717 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3721 self.0.request.parent = v.into();
3722 self
3723 }
3724
3725 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3727 self.0.request.page_size = v.into();
3728 self
3729 }
3730
3731 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3733 self.0.request.page_token = v.into();
3734 self
3735 }
3736
3737 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3739 self.0.request.filter = v.into();
3740 self
3741 }
3742
3743 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3745 self.0.request.order_by = v.into();
3746 self
3747 }
3748
3749 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3751 self.0.request.return_partial_success = v.into();
3752 self
3753 }
3754 }
3755
3756 #[doc(hidden)]
3757 impl gax::options::internal::RequestBuilder for ListDestinations {
3758 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3759 &mut self.0.options
3760 }
3761 }
3762
3763 #[derive(Clone, Debug)]
3780 pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3781
3782 impl GetDestination {
3783 pub(crate) fn new(
3784 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3785 ) -> Self {
3786 Self(RequestBuilder::new(stub))
3787 }
3788
3789 pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3791 self.0.request = v.into();
3792 self
3793 }
3794
3795 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3797 self.0.options = v.into();
3798 self
3799 }
3800
3801 pub async fn send(self) -> Result<crate::model::Destination> {
3803 (*self.0.stub)
3804 .get_destination(self.0.request, self.0.options)
3805 .await
3806 .map(gax::response::Response::into_body)
3807 }
3808
3809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3813 self.0.request.name = v.into();
3814 self
3815 }
3816 }
3817
3818 #[doc(hidden)]
3819 impl gax::options::internal::RequestBuilder for GetDestination {
3820 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3821 &mut self.0.options
3822 }
3823 }
3824
3825 #[derive(Clone, Debug)]
3843 pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3844
3845 impl CreateDestination {
3846 pub(crate) fn new(
3847 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3848 ) -> Self {
3849 Self(RequestBuilder::new(stub))
3850 }
3851
3852 pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3854 mut self,
3855 v: V,
3856 ) -> Self {
3857 self.0.request = v.into();
3858 self
3859 }
3860
3861 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3863 self.0.options = v.into();
3864 self
3865 }
3866
3867 pub async fn send(self) -> Result<longrunning::model::Operation> {
3874 (*self.0.stub)
3875 .create_destination(self.0.request, self.0.options)
3876 .await
3877 .map(gax::response::Response::into_body)
3878 }
3879
3880 pub fn poller(
3882 self,
3883 ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
3884 type Operation = lro::internal::Operation<
3885 crate::model::Destination,
3886 crate::model::OperationMetadata,
3887 >;
3888 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3889 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3890
3891 let stub = self.0.stub.clone();
3892 let mut options = self.0.options.clone();
3893 options.set_retry_policy(gax::retry_policy::NeverRetry);
3894 let query = move |name| {
3895 let stub = stub.clone();
3896 let options = options.clone();
3897 async {
3898 let op = GetOperation::new(stub)
3899 .set_name(name)
3900 .with_options(options)
3901 .send()
3902 .await?;
3903 Ok(Operation::new(op))
3904 }
3905 };
3906
3907 let start = move || async {
3908 let op = self.send().await?;
3909 Ok(Operation::new(op))
3910 };
3911
3912 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3913 }
3914
3915 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3919 self.0.request.parent = v.into();
3920 self
3921 }
3922
3923 pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3927 self.0.request.destination_id = v.into();
3928 self
3929 }
3930
3931 pub fn set_destination<T>(mut self, v: T) -> Self
3935 where
3936 T: std::convert::Into<crate::model::Destination>,
3937 {
3938 self.0.request.destination = std::option::Option::Some(v.into());
3939 self
3940 }
3941
3942 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
3946 where
3947 T: std::convert::Into<crate::model::Destination>,
3948 {
3949 self.0.request.destination = v.map(|x| x.into());
3950 self
3951 }
3952
3953 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3955 self.0.request.request_id = v.into();
3956 self
3957 }
3958 }
3959
3960 #[doc(hidden)]
3961 impl gax::options::internal::RequestBuilder for CreateDestination {
3962 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3963 &mut self.0.options
3964 }
3965 }
3966
3967 #[derive(Clone, Debug)]
3985 pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
3986
3987 impl UpdateDestination {
3988 pub(crate) fn new(
3989 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3990 ) -> Self {
3991 Self(RequestBuilder::new(stub))
3992 }
3993
3994 pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
3996 mut self,
3997 v: V,
3998 ) -> Self {
3999 self.0.request = v.into();
4000 self
4001 }
4002
4003 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4005 self.0.options = v.into();
4006 self
4007 }
4008
4009 pub async fn send(self) -> Result<longrunning::model::Operation> {
4016 (*self.0.stub)
4017 .update_destination(self.0.request, self.0.options)
4018 .await
4019 .map(gax::response::Response::into_body)
4020 }
4021
4022 pub fn poller(
4024 self,
4025 ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
4026 type Operation = lro::internal::Operation<
4027 crate::model::Destination,
4028 crate::model::OperationMetadata,
4029 >;
4030 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4031 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4032
4033 let stub = self.0.stub.clone();
4034 let mut options = self.0.options.clone();
4035 options.set_retry_policy(gax::retry_policy::NeverRetry);
4036 let query = move |name| {
4037 let stub = stub.clone();
4038 let options = options.clone();
4039 async {
4040 let op = GetOperation::new(stub)
4041 .set_name(name)
4042 .with_options(options)
4043 .send()
4044 .await?;
4045 Ok(Operation::new(op))
4046 }
4047 };
4048
4049 let start = move || async {
4050 let op = self.send().await?;
4051 Ok(Operation::new(op))
4052 };
4053
4054 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4055 }
4056
4057 pub fn set_update_mask<T>(mut self, v: T) -> Self
4059 where
4060 T: std::convert::Into<wkt::FieldMask>,
4061 {
4062 self.0.request.update_mask = std::option::Option::Some(v.into());
4063 self
4064 }
4065
4066 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4068 where
4069 T: std::convert::Into<wkt::FieldMask>,
4070 {
4071 self.0.request.update_mask = v.map(|x| x.into());
4072 self
4073 }
4074
4075 pub fn set_destination<T>(mut self, v: T) -> Self
4079 where
4080 T: std::convert::Into<crate::model::Destination>,
4081 {
4082 self.0.request.destination = std::option::Option::Some(v.into());
4083 self
4084 }
4085
4086 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4090 where
4091 T: std::convert::Into<crate::model::Destination>,
4092 {
4093 self.0.request.destination = v.map(|x| x.into());
4094 self
4095 }
4096
4097 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4099 self.0.request.request_id = v.into();
4100 self
4101 }
4102 }
4103
4104 #[doc(hidden)]
4105 impl gax::options::internal::RequestBuilder for UpdateDestination {
4106 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4107 &mut self.0.options
4108 }
4109 }
4110
4111 #[derive(Clone, Debug)]
4129 pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4130
4131 impl DeleteDestination {
4132 pub(crate) fn new(
4133 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4134 ) -> Self {
4135 Self(RequestBuilder::new(stub))
4136 }
4137
4138 pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4140 mut self,
4141 v: V,
4142 ) -> Self {
4143 self.0.request = v.into();
4144 self
4145 }
4146
4147 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4149 self.0.options = v.into();
4150 self
4151 }
4152
4153 pub async fn send(self) -> Result<longrunning::model::Operation> {
4160 (*self.0.stub)
4161 .delete_destination(self.0.request, self.0.options)
4162 .await
4163 .map(gax::response::Response::into_body)
4164 }
4165
4166 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4168 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4169 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4170 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4171
4172 let stub = self.0.stub.clone();
4173 let mut options = self.0.options.clone();
4174 options.set_retry_policy(gax::retry_policy::NeverRetry);
4175 let query = move |name| {
4176 let stub = stub.clone();
4177 let options = options.clone();
4178 async {
4179 let op = GetOperation::new(stub)
4180 .set_name(name)
4181 .with_options(options)
4182 .send()
4183 .await?;
4184 Ok(Operation::new(op))
4185 }
4186 };
4187
4188 let start = move || async {
4189 let op = self.send().await?;
4190 Ok(Operation::new(op))
4191 };
4192
4193 lro::internal::new_unit_response_poller(
4194 polling_error_policy,
4195 polling_backoff_policy,
4196 start,
4197 query,
4198 )
4199 }
4200
4201 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4205 self.0.request.name = v.into();
4206 self
4207 }
4208
4209 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4211 self.0.request.request_id = v.into();
4212 self
4213 }
4214
4215 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4217 self.0.request.etag = v.into();
4218 self
4219 }
4220 }
4221
4222 #[doc(hidden)]
4223 impl gax::options::internal::RequestBuilder for DeleteDestination {
4224 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4225 &mut self.0.options
4226 }
4227 }
4228
4229 #[derive(Clone, Debug)]
4246 pub struct GetMulticloudDataTransferSupportedService(
4247 RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4248 );
4249
4250 impl GetMulticloudDataTransferSupportedService {
4251 pub(crate) fn new(
4252 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4253 ) -> Self {
4254 Self(RequestBuilder::new(stub))
4255 }
4256
4257 pub fn with_request<
4259 V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4260 >(
4261 mut self,
4262 v: V,
4263 ) -> Self {
4264 self.0.request = v.into();
4265 self
4266 }
4267
4268 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4270 self.0.options = v.into();
4271 self
4272 }
4273
4274 pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4276 (*self.0.stub)
4277 .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4278 .await
4279 .map(gax::response::Response::into_body)
4280 }
4281
4282 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4286 self.0.request.name = v.into();
4287 self
4288 }
4289 }
4290
4291 #[doc(hidden)]
4292 impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferSupportedService {
4293 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4294 &mut self.0.options
4295 }
4296 }
4297
4298 #[derive(Clone, Debug)]
4319 pub struct ListMulticloudDataTransferSupportedServices(
4320 RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4321 );
4322
4323 impl ListMulticloudDataTransferSupportedServices {
4324 pub(crate) fn new(
4325 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4326 ) -> Self {
4327 Self(RequestBuilder::new(stub))
4328 }
4329
4330 pub fn with_request<
4332 V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4333 >(
4334 mut self,
4335 v: V,
4336 ) -> Self {
4337 self.0.request = v.into();
4338 self
4339 }
4340
4341 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4343 self.0.options = v.into();
4344 self
4345 }
4346
4347 pub async fn send(
4349 self,
4350 ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4351 (*self.0.stub)
4352 .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4353 .await
4354 .map(gax::response::Response::into_body)
4355 }
4356
4357 pub fn by_page(
4359 self,
4360 ) -> impl gax::paginator::Paginator<
4361 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4362 gax::error::Error,
4363 > {
4364 use std::clone::Clone;
4365 let token = self.0.request.page_token.clone();
4366 let execute = move |token: String| {
4367 let mut builder = self.clone();
4368 builder.0.request = builder.0.request.set_page_token(token);
4369 builder.send()
4370 };
4371 gax::paginator::internal::new_paginator(token, execute)
4372 }
4373
4374 pub fn by_item(
4376 self,
4377 ) -> impl gax::paginator::ItemPaginator<
4378 crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4379 gax::error::Error,
4380 > {
4381 use gax::paginator::Paginator;
4382 self.by_page().items()
4383 }
4384
4385 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4389 self.0.request.parent = v.into();
4390 self
4391 }
4392
4393 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4395 self.0.request.page_size = v.into();
4396 self
4397 }
4398
4399 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4401 self.0.request.page_token = v.into();
4402 self
4403 }
4404 }
4405
4406 #[doc(hidden)]
4407 impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4408 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4409 &mut self.0.options
4410 }
4411 }
4412
4413 #[derive(Clone, Debug)]
4434 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4435
4436 impl ListLocations {
4437 pub(crate) fn new(
4438 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4439 ) -> Self {
4440 Self(RequestBuilder::new(stub))
4441 }
4442
4443 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4445 mut self,
4446 v: V,
4447 ) -> Self {
4448 self.0.request = v.into();
4449 self
4450 }
4451
4452 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4454 self.0.options = v.into();
4455 self
4456 }
4457
4458 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4460 (*self.0.stub)
4461 .list_locations(self.0.request, self.0.options)
4462 .await
4463 .map(gax::response::Response::into_body)
4464 }
4465
4466 pub fn by_page(
4468 self,
4469 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4470 {
4471 use std::clone::Clone;
4472 let token = self.0.request.page_token.clone();
4473 let execute = move |token: String| {
4474 let mut builder = self.clone();
4475 builder.0.request = builder.0.request.set_page_token(token);
4476 builder.send()
4477 };
4478 gax::paginator::internal::new_paginator(token, execute)
4479 }
4480
4481 pub fn by_item(
4483 self,
4484 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4485 {
4486 use gax::paginator::Paginator;
4487 self.by_page().items()
4488 }
4489
4490 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4492 self.0.request.name = v.into();
4493 self
4494 }
4495
4496 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4498 self.0.request.filter = v.into();
4499 self
4500 }
4501
4502 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4504 self.0.request.page_size = v.into();
4505 self
4506 }
4507
4508 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510 self.0.request.page_token = v.into();
4511 self
4512 }
4513 }
4514
4515 #[doc(hidden)]
4516 impl gax::options::internal::RequestBuilder for ListLocations {
4517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4518 &mut self.0.options
4519 }
4520 }
4521
4522 #[derive(Clone, Debug)]
4539 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4540
4541 impl GetLocation {
4542 pub(crate) fn new(
4543 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4544 ) -> Self {
4545 Self(RequestBuilder::new(stub))
4546 }
4547
4548 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4550 self.0.request = v.into();
4551 self
4552 }
4553
4554 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4556 self.0.options = v.into();
4557 self
4558 }
4559
4560 pub async fn send(self) -> Result<location::model::Location> {
4562 (*self.0.stub)
4563 .get_location(self.0.request, self.0.options)
4564 .await
4565 .map(gax::response::Response::into_body)
4566 }
4567
4568 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4570 self.0.request.name = v.into();
4571 self
4572 }
4573 }
4574
4575 #[doc(hidden)]
4576 impl gax::options::internal::RequestBuilder for GetLocation {
4577 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4578 &mut self.0.options
4579 }
4580 }
4581
4582 #[derive(Clone, Debug)]
4599 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4600
4601 impl SetIamPolicy {
4602 pub(crate) fn new(
4603 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4604 ) -> Self {
4605 Self(RequestBuilder::new(stub))
4606 }
4607
4608 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4610 self.0.request = v.into();
4611 self
4612 }
4613
4614 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4616 self.0.options = v.into();
4617 self
4618 }
4619
4620 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4622 (*self.0.stub)
4623 .set_iam_policy(self.0.request, self.0.options)
4624 .await
4625 .map(gax::response::Response::into_body)
4626 }
4627
4628 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4632 self.0.request.resource = v.into();
4633 self
4634 }
4635
4636 pub fn set_policy<T>(mut self, v: T) -> Self
4640 where
4641 T: std::convert::Into<iam_v1::model::Policy>,
4642 {
4643 self.0.request.policy = std::option::Option::Some(v.into());
4644 self
4645 }
4646
4647 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4651 where
4652 T: std::convert::Into<iam_v1::model::Policy>,
4653 {
4654 self.0.request.policy = v.map(|x| x.into());
4655 self
4656 }
4657
4658 pub fn set_update_mask<T>(mut self, v: T) -> Self
4660 where
4661 T: std::convert::Into<wkt::FieldMask>,
4662 {
4663 self.0.request.update_mask = std::option::Option::Some(v.into());
4664 self
4665 }
4666
4667 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4669 where
4670 T: std::convert::Into<wkt::FieldMask>,
4671 {
4672 self.0.request.update_mask = v.map(|x| x.into());
4673 self
4674 }
4675 }
4676
4677 #[doc(hidden)]
4678 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4679 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4680 &mut self.0.options
4681 }
4682 }
4683
4684 #[derive(Clone, Debug)]
4701 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4702
4703 impl GetIamPolicy {
4704 pub(crate) fn new(
4705 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4706 ) -> Self {
4707 Self(RequestBuilder::new(stub))
4708 }
4709
4710 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4712 self.0.request = v.into();
4713 self
4714 }
4715
4716 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4718 self.0.options = v.into();
4719 self
4720 }
4721
4722 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4724 (*self.0.stub)
4725 .get_iam_policy(self.0.request, self.0.options)
4726 .await
4727 .map(gax::response::Response::into_body)
4728 }
4729
4730 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4734 self.0.request.resource = v.into();
4735 self
4736 }
4737
4738 pub fn set_options<T>(mut self, v: T) -> Self
4740 where
4741 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4742 {
4743 self.0.request.options = std::option::Option::Some(v.into());
4744 self
4745 }
4746
4747 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4749 where
4750 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4751 {
4752 self.0.request.options = v.map(|x| x.into());
4753 self
4754 }
4755 }
4756
4757 #[doc(hidden)]
4758 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4759 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4760 &mut self.0.options
4761 }
4762 }
4763
4764 #[derive(Clone, Debug)]
4781 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4782
4783 impl TestIamPermissions {
4784 pub(crate) fn new(
4785 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4786 ) -> Self {
4787 Self(RequestBuilder::new(stub))
4788 }
4789
4790 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4792 mut self,
4793 v: V,
4794 ) -> Self {
4795 self.0.request = v.into();
4796 self
4797 }
4798
4799 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4801 self.0.options = v.into();
4802 self
4803 }
4804
4805 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4807 (*self.0.stub)
4808 .test_iam_permissions(self.0.request, self.0.options)
4809 .await
4810 .map(gax::response::Response::into_body)
4811 }
4812
4813 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4817 self.0.request.resource = v.into();
4818 self
4819 }
4820
4821 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4825 where
4826 T: std::iter::IntoIterator<Item = V>,
4827 V: std::convert::Into<std::string::String>,
4828 {
4829 use std::iter::Iterator;
4830 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4831 self
4832 }
4833 }
4834
4835 #[doc(hidden)]
4836 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4837 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4838 &mut self.0.options
4839 }
4840 }
4841
4842 #[derive(Clone, Debug)]
4863 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4864
4865 impl ListOperations {
4866 pub(crate) fn new(
4867 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4868 ) -> Self {
4869 Self(RequestBuilder::new(stub))
4870 }
4871
4872 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4874 mut self,
4875 v: V,
4876 ) -> Self {
4877 self.0.request = v.into();
4878 self
4879 }
4880
4881 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4883 self.0.options = v.into();
4884 self
4885 }
4886
4887 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4889 (*self.0.stub)
4890 .list_operations(self.0.request, self.0.options)
4891 .await
4892 .map(gax::response::Response::into_body)
4893 }
4894
4895 pub fn by_page(
4897 self,
4898 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4899 {
4900 use std::clone::Clone;
4901 let token = self.0.request.page_token.clone();
4902 let execute = move |token: String| {
4903 let mut builder = self.clone();
4904 builder.0.request = builder.0.request.set_page_token(token);
4905 builder.send()
4906 };
4907 gax::paginator::internal::new_paginator(token, execute)
4908 }
4909
4910 pub fn by_item(
4912 self,
4913 ) -> impl gax::paginator::ItemPaginator<
4914 longrunning::model::ListOperationsResponse,
4915 gax::error::Error,
4916 > {
4917 use gax::paginator::Paginator;
4918 self.by_page().items()
4919 }
4920
4921 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4923 self.0.request.name = v.into();
4924 self
4925 }
4926
4927 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4929 self.0.request.filter = v.into();
4930 self
4931 }
4932
4933 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4935 self.0.request.page_size = v.into();
4936 self
4937 }
4938
4939 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4941 self.0.request.page_token = v.into();
4942 self
4943 }
4944
4945 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4947 self.0.request.return_partial_success = v.into();
4948 self
4949 }
4950 }
4951
4952 #[doc(hidden)]
4953 impl gax::options::internal::RequestBuilder for ListOperations {
4954 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4955 &mut self.0.options
4956 }
4957 }
4958
4959 #[derive(Clone, Debug)]
4976 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4977
4978 impl GetOperation {
4979 pub(crate) fn new(
4980 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4981 ) -> Self {
4982 Self(RequestBuilder::new(stub))
4983 }
4984
4985 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4987 mut self,
4988 v: V,
4989 ) -> Self {
4990 self.0.request = v.into();
4991 self
4992 }
4993
4994 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4996 self.0.options = v.into();
4997 self
4998 }
4999
5000 pub async fn send(self) -> Result<longrunning::model::Operation> {
5002 (*self.0.stub)
5003 .get_operation(self.0.request, self.0.options)
5004 .await
5005 .map(gax::response::Response::into_body)
5006 }
5007
5008 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5010 self.0.request.name = v.into();
5011 self
5012 }
5013 }
5014
5015 #[doc(hidden)]
5016 impl gax::options::internal::RequestBuilder for GetOperation {
5017 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5018 &mut self.0.options
5019 }
5020 }
5021
5022 #[derive(Clone, Debug)]
5039 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5040
5041 impl DeleteOperation {
5042 pub(crate) fn new(
5043 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5044 ) -> Self {
5045 Self(RequestBuilder::new(stub))
5046 }
5047
5048 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5050 mut self,
5051 v: V,
5052 ) -> Self {
5053 self.0.request = v.into();
5054 self
5055 }
5056
5057 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5059 self.0.options = v.into();
5060 self
5061 }
5062
5063 pub async fn send(self) -> Result<()> {
5065 (*self.0.stub)
5066 .delete_operation(self.0.request, self.0.options)
5067 .await
5068 .map(gax::response::Response::into_body)
5069 }
5070
5071 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5073 self.0.request.name = v.into();
5074 self
5075 }
5076 }
5077
5078 #[doc(hidden)]
5079 impl gax::options::internal::RequestBuilder for DeleteOperation {
5080 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5081 &mut self.0.options
5082 }
5083 }
5084
5085 #[derive(Clone, Debug)]
5102 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5103
5104 impl CancelOperation {
5105 pub(crate) fn new(
5106 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5107 ) -> Self {
5108 Self(RequestBuilder::new(stub))
5109 }
5110
5111 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5113 mut self,
5114 v: V,
5115 ) -> Self {
5116 self.0.request = v.into();
5117 self
5118 }
5119
5120 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5122 self.0.options = v.into();
5123 self
5124 }
5125
5126 pub async fn send(self) -> Result<()> {
5128 (*self.0.stub)
5129 .cancel_operation(self.0.request, self.0.options)
5130 .await
5131 .map(gax::response::Response::into_body)
5132 }
5133
5134 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5136 self.0.request.name = v.into();
5137 self
5138 }
5139 }
5140
5141 #[doc(hidden)]
5142 impl gax::options::internal::RequestBuilder for CancelOperation {
5143 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5144 &mut self.0.options
5145 }
5146 }
5147}
5148
5149pub mod hub_service {
5150 use crate::Result;
5151
5152 pub type ClientBuilder =
5166 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5167
5168 pub(crate) mod client {
5169 use super::super::super::client::HubService;
5170 pub struct Factory;
5171 impl gax::client_builder::internal::ClientFactory for Factory {
5172 type Client = HubService;
5173 type Credentials = gaxi::options::Credentials;
5174 async fn build(
5175 self,
5176 config: gaxi::options::ClientConfig,
5177 ) -> gax::client_builder::Result<Self::Client> {
5178 Self::Client::new(config).await
5179 }
5180 }
5181 }
5182
5183 #[derive(Clone, Debug)]
5185 pub(crate) struct RequestBuilder<R: std::default::Default> {
5186 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5187 request: R,
5188 options: gax::options::RequestOptions,
5189 }
5190
5191 impl<R> RequestBuilder<R>
5192 where
5193 R: std::default::Default,
5194 {
5195 pub(crate) fn new(
5196 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5197 ) -> Self {
5198 Self {
5199 stub,
5200 request: R::default(),
5201 options: gax::options::RequestOptions::default(),
5202 }
5203 }
5204 }
5205
5206 #[derive(Clone, Debug)]
5227 pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5228
5229 impl ListHubs {
5230 pub(crate) fn new(
5231 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5232 ) -> Self {
5233 Self(RequestBuilder::new(stub))
5234 }
5235
5236 pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5238 self.0.request = v.into();
5239 self
5240 }
5241
5242 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5244 self.0.options = v.into();
5245 self
5246 }
5247
5248 pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5250 (*self.0.stub)
5251 .list_hubs(self.0.request, self.0.options)
5252 .await
5253 .map(gax::response::Response::into_body)
5254 }
5255
5256 pub fn by_page(
5258 self,
5259 ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
5260 {
5261 use std::clone::Clone;
5262 let token = self.0.request.page_token.clone();
5263 let execute = move |token: String| {
5264 let mut builder = self.clone();
5265 builder.0.request = builder.0.request.set_page_token(token);
5266 builder.send()
5267 };
5268 gax::paginator::internal::new_paginator(token, execute)
5269 }
5270
5271 pub fn by_item(
5273 self,
5274 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubsResponse, gax::error::Error>
5275 {
5276 use gax::paginator::Paginator;
5277 self.by_page().items()
5278 }
5279
5280 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5284 self.0.request.parent = v.into();
5285 self
5286 }
5287
5288 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5290 self.0.request.page_size = v.into();
5291 self
5292 }
5293
5294 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5296 self.0.request.page_token = v.into();
5297 self
5298 }
5299
5300 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5302 self.0.request.filter = v.into();
5303 self
5304 }
5305
5306 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5308 self.0.request.order_by = v.into();
5309 self
5310 }
5311 }
5312
5313 #[doc(hidden)]
5314 impl gax::options::internal::RequestBuilder for ListHubs {
5315 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5316 &mut self.0.options
5317 }
5318 }
5319
5320 #[derive(Clone, Debug)]
5337 pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5338
5339 impl GetHub {
5340 pub(crate) fn new(
5341 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5342 ) -> Self {
5343 Self(RequestBuilder::new(stub))
5344 }
5345
5346 pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5348 self.0.request = v.into();
5349 self
5350 }
5351
5352 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5354 self.0.options = v.into();
5355 self
5356 }
5357
5358 pub async fn send(self) -> Result<crate::model::Hub> {
5360 (*self.0.stub)
5361 .get_hub(self.0.request, self.0.options)
5362 .await
5363 .map(gax::response::Response::into_body)
5364 }
5365
5366 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5370 self.0.request.name = v.into();
5371 self
5372 }
5373 }
5374
5375 #[doc(hidden)]
5376 impl gax::options::internal::RequestBuilder for GetHub {
5377 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5378 &mut self.0.options
5379 }
5380 }
5381
5382 #[derive(Clone, Debug)]
5400 pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5401
5402 impl CreateHub {
5403 pub(crate) fn new(
5404 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5405 ) -> Self {
5406 Self(RequestBuilder::new(stub))
5407 }
5408
5409 pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5411 self.0.request = v.into();
5412 self
5413 }
5414
5415 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5417 self.0.options = v.into();
5418 self
5419 }
5420
5421 pub async fn send(self) -> Result<longrunning::model::Operation> {
5428 (*self.0.stub)
5429 .create_hub(self.0.request, self.0.options)
5430 .await
5431 .map(gax::response::Response::into_body)
5432 }
5433
5434 pub fn poller(
5436 self,
5437 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5438 type Operation =
5439 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5440 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5441 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5442
5443 let stub = self.0.stub.clone();
5444 let mut options = self.0.options.clone();
5445 options.set_retry_policy(gax::retry_policy::NeverRetry);
5446 let query = move |name| {
5447 let stub = stub.clone();
5448 let options = options.clone();
5449 async {
5450 let op = GetOperation::new(stub)
5451 .set_name(name)
5452 .with_options(options)
5453 .send()
5454 .await?;
5455 Ok(Operation::new(op))
5456 }
5457 };
5458
5459 let start = move || async {
5460 let op = self.send().await?;
5461 Ok(Operation::new(op))
5462 };
5463
5464 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5465 }
5466
5467 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5471 self.0.request.parent = v.into();
5472 self
5473 }
5474
5475 pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5479 self.0.request.hub_id = v.into();
5480 self
5481 }
5482
5483 pub fn set_hub<T>(mut self, v: T) -> Self
5487 where
5488 T: std::convert::Into<crate::model::Hub>,
5489 {
5490 self.0.request.hub = std::option::Option::Some(v.into());
5491 self
5492 }
5493
5494 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5498 where
5499 T: std::convert::Into<crate::model::Hub>,
5500 {
5501 self.0.request.hub = v.map(|x| x.into());
5502 self
5503 }
5504
5505 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5507 self.0.request.request_id = v.into();
5508 self
5509 }
5510 }
5511
5512 #[doc(hidden)]
5513 impl gax::options::internal::RequestBuilder for CreateHub {
5514 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5515 &mut self.0.options
5516 }
5517 }
5518
5519 #[derive(Clone, Debug)]
5537 pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5538
5539 impl UpdateHub {
5540 pub(crate) fn new(
5541 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5542 ) -> Self {
5543 Self(RequestBuilder::new(stub))
5544 }
5545
5546 pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5548 self.0.request = v.into();
5549 self
5550 }
5551
5552 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5554 self.0.options = v.into();
5555 self
5556 }
5557
5558 pub async fn send(self) -> Result<longrunning::model::Operation> {
5565 (*self.0.stub)
5566 .update_hub(self.0.request, self.0.options)
5567 .await
5568 .map(gax::response::Response::into_body)
5569 }
5570
5571 pub fn poller(
5573 self,
5574 ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5575 type Operation =
5576 lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5577 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5578 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5579
5580 let stub = self.0.stub.clone();
5581 let mut options = self.0.options.clone();
5582 options.set_retry_policy(gax::retry_policy::NeverRetry);
5583 let query = move |name| {
5584 let stub = stub.clone();
5585 let options = options.clone();
5586 async {
5587 let op = GetOperation::new(stub)
5588 .set_name(name)
5589 .with_options(options)
5590 .send()
5591 .await?;
5592 Ok(Operation::new(op))
5593 }
5594 };
5595
5596 let start = move || async {
5597 let op = self.send().await?;
5598 Ok(Operation::new(op))
5599 };
5600
5601 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5602 }
5603
5604 pub fn set_update_mask<T>(mut self, v: T) -> Self
5606 where
5607 T: std::convert::Into<wkt::FieldMask>,
5608 {
5609 self.0.request.update_mask = std::option::Option::Some(v.into());
5610 self
5611 }
5612
5613 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5615 where
5616 T: std::convert::Into<wkt::FieldMask>,
5617 {
5618 self.0.request.update_mask = v.map(|x| x.into());
5619 self
5620 }
5621
5622 pub fn set_hub<T>(mut self, v: T) -> Self
5626 where
5627 T: std::convert::Into<crate::model::Hub>,
5628 {
5629 self.0.request.hub = std::option::Option::Some(v.into());
5630 self
5631 }
5632
5633 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5637 where
5638 T: std::convert::Into<crate::model::Hub>,
5639 {
5640 self.0.request.hub = v.map(|x| x.into());
5641 self
5642 }
5643
5644 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5646 self.0.request.request_id = v.into();
5647 self
5648 }
5649 }
5650
5651 #[doc(hidden)]
5652 impl gax::options::internal::RequestBuilder for UpdateHub {
5653 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5654 &mut self.0.options
5655 }
5656 }
5657
5658 #[derive(Clone, Debug)]
5676 pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5677
5678 impl DeleteHub {
5679 pub(crate) fn new(
5680 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5681 ) -> Self {
5682 Self(RequestBuilder::new(stub))
5683 }
5684
5685 pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5687 self.0.request = v.into();
5688 self
5689 }
5690
5691 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5693 self.0.options = v.into();
5694 self
5695 }
5696
5697 pub async fn send(self) -> Result<longrunning::model::Operation> {
5704 (*self.0.stub)
5705 .delete_hub(self.0.request, self.0.options)
5706 .await
5707 .map(gax::response::Response::into_body)
5708 }
5709
5710 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5712 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
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(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 lro::internal::new_unit_response_poller(
5738 polling_error_policy,
5739 polling_backoff_policy,
5740 start,
5741 query,
5742 )
5743 }
5744
5745 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5749 self.0.request.name = v.into();
5750 self
5751 }
5752
5753 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5755 self.0.request.request_id = v.into();
5756 self
5757 }
5758 }
5759
5760 #[doc(hidden)]
5761 impl gax::options::internal::RequestBuilder for DeleteHub {
5762 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5763 &mut self.0.options
5764 }
5765 }
5766
5767 #[derive(Clone, Debug)]
5788 pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5789
5790 impl ListHubSpokes {
5791 pub(crate) fn new(
5792 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5793 ) -> Self {
5794 Self(RequestBuilder::new(stub))
5795 }
5796
5797 pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5799 self.0.request = v.into();
5800 self
5801 }
5802
5803 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5805 self.0.options = v.into();
5806 self
5807 }
5808
5809 pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5811 (*self.0.stub)
5812 .list_hub_spokes(self.0.request, self.0.options)
5813 .await
5814 .map(gax::response::Response::into_body)
5815 }
5816
5817 pub fn by_page(
5819 self,
5820 ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5821 {
5822 use std::clone::Clone;
5823 let token = self.0.request.page_token.clone();
5824 let execute = move |token: String| {
5825 let mut builder = self.clone();
5826 builder.0.request = builder.0.request.set_page_token(token);
5827 builder.send()
5828 };
5829 gax::paginator::internal::new_paginator(token, execute)
5830 }
5831
5832 pub fn by_item(
5834 self,
5835 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5836 {
5837 use gax::paginator::Paginator;
5838 self.by_page().items()
5839 }
5840
5841 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5845 self.0.request.name = v.into();
5846 self
5847 }
5848
5849 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5851 where
5852 T: std::iter::IntoIterator<Item = V>,
5853 V: std::convert::Into<std::string::String>,
5854 {
5855 use std::iter::Iterator;
5856 self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5857 self
5858 }
5859
5860 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5862 self.0.request.page_size = v.into();
5863 self
5864 }
5865
5866 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5868 self.0.request.page_token = v.into();
5869 self
5870 }
5871
5872 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5874 self.0.request.filter = v.into();
5875 self
5876 }
5877
5878 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5880 self.0.request.order_by = v.into();
5881 self
5882 }
5883
5884 pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
5886 mut self,
5887 v: T,
5888 ) -> Self {
5889 self.0.request.view = v.into();
5890 self
5891 }
5892 }
5893
5894 #[doc(hidden)]
5895 impl gax::options::internal::RequestBuilder for ListHubSpokes {
5896 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5897 &mut self.0.options
5898 }
5899 }
5900
5901 #[derive(Clone, Debug)]
5922 pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
5923
5924 impl QueryHubStatus {
5925 pub(crate) fn new(
5926 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5927 ) -> Self {
5928 Self(RequestBuilder::new(stub))
5929 }
5930
5931 pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
5933 self.0.request = v.into();
5934 self
5935 }
5936
5937 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5939 self.0.options = v.into();
5940 self
5941 }
5942
5943 pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
5945 (*self.0.stub)
5946 .query_hub_status(self.0.request, self.0.options)
5947 .await
5948 .map(gax::response::Response::into_body)
5949 }
5950
5951 pub fn by_page(
5953 self,
5954 ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
5955 {
5956 use std::clone::Clone;
5957 let token = self.0.request.page_token.clone();
5958 let execute = move |token: String| {
5959 let mut builder = self.clone();
5960 builder.0.request = builder.0.request.set_page_token(token);
5961 builder.send()
5962 };
5963 gax::paginator::internal::new_paginator(token, execute)
5964 }
5965
5966 pub fn by_item(
5968 self,
5969 ) -> impl gax::paginator::ItemPaginator<crate::model::QueryHubStatusResponse, gax::error::Error>
5970 {
5971 use gax::paginator::Paginator;
5972 self.by_page().items()
5973 }
5974
5975 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5979 self.0.request.name = v.into();
5980 self
5981 }
5982
5983 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5985 self.0.request.page_size = v.into();
5986 self
5987 }
5988
5989 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5991 self.0.request.page_token = v.into();
5992 self
5993 }
5994
5995 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5997 self.0.request.filter = v.into();
5998 self
5999 }
6000
6001 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6003 self.0.request.order_by = v.into();
6004 self
6005 }
6006
6007 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6009 self.0.request.group_by = v.into();
6010 self
6011 }
6012 }
6013
6014 #[doc(hidden)]
6015 impl gax::options::internal::RequestBuilder for QueryHubStatus {
6016 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6017 &mut self.0.options
6018 }
6019 }
6020
6021 #[derive(Clone, Debug)]
6042 pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6043
6044 impl ListSpokes {
6045 pub(crate) fn new(
6046 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6047 ) -> Self {
6048 Self(RequestBuilder::new(stub))
6049 }
6050
6051 pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6053 self.0.request = v.into();
6054 self
6055 }
6056
6057 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6059 self.0.options = v.into();
6060 self
6061 }
6062
6063 pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6065 (*self.0.stub)
6066 .list_spokes(self.0.request, self.0.options)
6067 .await
6068 .map(gax::response::Response::into_body)
6069 }
6070
6071 pub fn by_page(
6073 self,
6074 ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
6075 {
6076 use std::clone::Clone;
6077 let token = self.0.request.page_token.clone();
6078 let execute = move |token: String| {
6079 let mut builder = self.clone();
6080 builder.0.request = builder.0.request.set_page_token(token);
6081 builder.send()
6082 };
6083 gax::paginator::internal::new_paginator(token, execute)
6084 }
6085
6086 pub fn by_item(
6088 self,
6089 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpokesResponse, gax::error::Error>
6090 {
6091 use gax::paginator::Paginator;
6092 self.by_page().items()
6093 }
6094
6095 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6099 self.0.request.parent = v.into();
6100 self
6101 }
6102
6103 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6105 self.0.request.page_size = v.into();
6106 self
6107 }
6108
6109 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6111 self.0.request.page_token = v.into();
6112 self
6113 }
6114
6115 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6117 self.0.request.filter = v.into();
6118 self
6119 }
6120
6121 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6123 self.0.request.order_by = v.into();
6124 self
6125 }
6126 }
6127
6128 #[doc(hidden)]
6129 impl gax::options::internal::RequestBuilder for ListSpokes {
6130 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6131 &mut self.0.options
6132 }
6133 }
6134
6135 #[derive(Clone, Debug)]
6152 pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6153
6154 impl GetSpoke {
6155 pub(crate) fn new(
6156 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6157 ) -> Self {
6158 Self(RequestBuilder::new(stub))
6159 }
6160
6161 pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6163 self.0.request = v.into();
6164 self
6165 }
6166
6167 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6169 self.0.options = v.into();
6170 self
6171 }
6172
6173 pub async fn send(self) -> Result<crate::model::Spoke> {
6175 (*self.0.stub)
6176 .get_spoke(self.0.request, self.0.options)
6177 .await
6178 .map(gax::response::Response::into_body)
6179 }
6180
6181 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6185 self.0.request.name = v.into();
6186 self
6187 }
6188 }
6189
6190 #[doc(hidden)]
6191 impl gax::options::internal::RequestBuilder for GetSpoke {
6192 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6193 &mut self.0.options
6194 }
6195 }
6196
6197 #[derive(Clone, Debug)]
6215 pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6216
6217 impl CreateSpoke {
6218 pub(crate) fn new(
6219 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6220 ) -> Self {
6221 Self(RequestBuilder::new(stub))
6222 }
6223
6224 pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6226 self.0.request = v.into();
6227 self
6228 }
6229
6230 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6232 self.0.options = v.into();
6233 self
6234 }
6235
6236 pub async fn send(self) -> Result<longrunning::model::Operation> {
6243 (*self.0.stub)
6244 .create_spoke(self.0.request, self.0.options)
6245 .await
6246 .map(gax::response::Response::into_body)
6247 }
6248
6249 pub fn poller(
6251 self,
6252 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6253 type Operation =
6254 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6255 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6256 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6257
6258 let stub = self.0.stub.clone();
6259 let mut options = self.0.options.clone();
6260 options.set_retry_policy(gax::retry_policy::NeverRetry);
6261 let query = move |name| {
6262 let stub = stub.clone();
6263 let options = options.clone();
6264 async {
6265 let op = GetOperation::new(stub)
6266 .set_name(name)
6267 .with_options(options)
6268 .send()
6269 .await?;
6270 Ok(Operation::new(op))
6271 }
6272 };
6273
6274 let start = move || async {
6275 let op = self.send().await?;
6276 Ok(Operation::new(op))
6277 };
6278
6279 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6280 }
6281
6282 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6286 self.0.request.parent = v.into();
6287 self
6288 }
6289
6290 pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6294 self.0.request.spoke_id = v.into();
6295 self
6296 }
6297
6298 pub fn set_spoke<T>(mut self, v: T) -> Self
6302 where
6303 T: std::convert::Into<crate::model::Spoke>,
6304 {
6305 self.0.request.spoke = std::option::Option::Some(v.into());
6306 self
6307 }
6308
6309 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6313 where
6314 T: std::convert::Into<crate::model::Spoke>,
6315 {
6316 self.0.request.spoke = v.map(|x| x.into());
6317 self
6318 }
6319
6320 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6322 self.0.request.request_id = v.into();
6323 self
6324 }
6325 }
6326
6327 #[doc(hidden)]
6328 impl gax::options::internal::RequestBuilder for CreateSpoke {
6329 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6330 &mut self.0.options
6331 }
6332 }
6333
6334 #[derive(Clone, Debug)]
6352 pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6353
6354 impl UpdateSpoke {
6355 pub(crate) fn new(
6356 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6357 ) -> Self {
6358 Self(RequestBuilder::new(stub))
6359 }
6360
6361 pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6363 self.0.request = v.into();
6364 self
6365 }
6366
6367 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6369 self.0.options = v.into();
6370 self
6371 }
6372
6373 pub async fn send(self) -> Result<longrunning::model::Operation> {
6380 (*self.0.stub)
6381 .update_spoke(self.0.request, self.0.options)
6382 .await
6383 .map(gax::response::Response::into_body)
6384 }
6385
6386 pub fn poller(
6388 self,
6389 ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6390 type Operation =
6391 lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6392 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6393 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6394
6395 let stub = self.0.stub.clone();
6396 let mut options = self.0.options.clone();
6397 options.set_retry_policy(gax::retry_policy::NeverRetry);
6398 let query = move |name| {
6399 let stub = stub.clone();
6400 let options = options.clone();
6401 async {
6402 let op = GetOperation::new(stub)
6403 .set_name(name)
6404 .with_options(options)
6405 .send()
6406 .await?;
6407 Ok(Operation::new(op))
6408 }
6409 };
6410
6411 let start = move || async {
6412 let op = self.send().await?;
6413 Ok(Operation::new(op))
6414 };
6415
6416 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6417 }
6418
6419 pub fn set_update_mask<T>(mut self, v: T) -> Self
6421 where
6422 T: std::convert::Into<wkt::FieldMask>,
6423 {
6424 self.0.request.update_mask = std::option::Option::Some(v.into());
6425 self
6426 }
6427
6428 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6430 where
6431 T: std::convert::Into<wkt::FieldMask>,
6432 {
6433 self.0.request.update_mask = v.map(|x| x.into());
6434 self
6435 }
6436
6437 pub fn set_spoke<T>(mut self, v: T) -> Self
6441 where
6442 T: std::convert::Into<crate::model::Spoke>,
6443 {
6444 self.0.request.spoke = std::option::Option::Some(v.into());
6445 self
6446 }
6447
6448 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6452 where
6453 T: std::convert::Into<crate::model::Spoke>,
6454 {
6455 self.0.request.spoke = v.map(|x| x.into());
6456 self
6457 }
6458
6459 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6461 self.0.request.request_id = v.into();
6462 self
6463 }
6464 }
6465
6466 #[doc(hidden)]
6467 impl gax::options::internal::RequestBuilder for UpdateSpoke {
6468 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6469 &mut self.0.options
6470 }
6471 }
6472
6473 #[derive(Clone, Debug)]
6491 pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6492
6493 impl RejectHubSpoke {
6494 pub(crate) fn new(
6495 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6496 ) -> Self {
6497 Self(RequestBuilder::new(stub))
6498 }
6499
6500 pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6502 self.0.request = v.into();
6503 self
6504 }
6505
6506 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6508 self.0.options = v.into();
6509 self
6510 }
6511
6512 pub async fn send(self) -> Result<longrunning::model::Operation> {
6519 (*self.0.stub)
6520 .reject_hub_spoke(self.0.request, self.0.options)
6521 .await
6522 .map(gax::response::Response::into_body)
6523 }
6524
6525 pub fn poller(
6527 self,
6528 ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
6529 {
6530 type Operation = lro::internal::Operation<
6531 crate::model::RejectHubSpokeResponse,
6532 crate::model::OperationMetadata,
6533 >;
6534 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6535 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6536
6537 let stub = self.0.stub.clone();
6538 let mut options = self.0.options.clone();
6539 options.set_retry_policy(gax::retry_policy::NeverRetry);
6540 let query = move |name| {
6541 let stub = stub.clone();
6542 let options = options.clone();
6543 async {
6544 let op = GetOperation::new(stub)
6545 .set_name(name)
6546 .with_options(options)
6547 .send()
6548 .await?;
6549 Ok(Operation::new(op))
6550 }
6551 };
6552
6553 let start = move || async {
6554 let op = self.send().await?;
6555 Ok(Operation::new(op))
6556 };
6557
6558 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6559 }
6560
6561 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6565 self.0.request.name = v.into();
6566 self
6567 }
6568
6569 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6573 self.0.request.spoke_uri = v.into();
6574 self
6575 }
6576
6577 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6579 self.0.request.request_id = v.into();
6580 self
6581 }
6582
6583 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6585 self.0.request.details = v.into();
6586 self
6587 }
6588 }
6589
6590 #[doc(hidden)]
6591 impl gax::options::internal::RequestBuilder for RejectHubSpoke {
6592 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6593 &mut self.0.options
6594 }
6595 }
6596
6597 #[derive(Clone, Debug)]
6615 pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6616
6617 impl AcceptHubSpoke {
6618 pub(crate) fn new(
6619 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6620 ) -> Self {
6621 Self(RequestBuilder::new(stub))
6622 }
6623
6624 pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6626 self.0.request = v.into();
6627 self
6628 }
6629
6630 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6632 self.0.options = v.into();
6633 self
6634 }
6635
6636 pub async fn send(self) -> Result<longrunning::model::Operation> {
6643 (*self.0.stub)
6644 .accept_hub_spoke(self.0.request, self.0.options)
6645 .await
6646 .map(gax::response::Response::into_body)
6647 }
6648
6649 pub fn poller(
6651 self,
6652 ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
6653 {
6654 type Operation = lro::internal::Operation<
6655 crate::model::AcceptHubSpokeResponse,
6656 crate::model::OperationMetadata,
6657 >;
6658 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6659 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6660
6661 let stub = self.0.stub.clone();
6662 let mut options = self.0.options.clone();
6663 options.set_retry_policy(gax::retry_policy::NeverRetry);
6664 let query = move |name| {
6665 let stub = stub.clone();
6666 let options = options.clone();
6667 async {
6668 let op = GetOperation::new(stub)
6669 .set_name(name)
6670 .with_options(options)
6671 .send()
6672 .await?;
6673 Ok(Operation::new(op))
6674 }
6675 };
6676
6677 let start = move || async {
6678 let op = self.send().await?;
6679 Ok(Operation::new(op))
6680 };
6681
6682 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6683 }
6684
6685 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6689 self.0.request.name = v.into();
6690 self
6691 }
6692
6693 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6697 self.0.request.spoke_uri = v.into();
6698 self
6699 }
6700
6701 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6703 self.0.request.request_id = v.into();
6704 self
6705 }
6706 }
6707
6708 #[doc(hidden)]
6709 impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
6710 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6711 &mut self.0.options
6712 }
6713 }
6714
6715 #[derive(Clone, Debug)]
6733 pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6734
6735 impl AcceptSpokeUpdate {
6736 pub(crate) fn new(
6737 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6738 ) -> Self {
6739 Self(RequestBuilder::new(stub))
6740 }
6741
6742 pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6744 mut self,
6745 v: V,
6746 ) -> Self {
6747 self.0.request = v.into();
6748 self
6749 }
6750
6751 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6753 self.0.options = v.into();
6754 self
6755 }
6756
6757 pub async fn send(self) -> Result<longrunning::model::Operation> {
6764 (*self.0.stub)
6765 .accept_spoke_update(self.0.request, self.0.options)
6766 .await
6767 .map(gax::response::Response::into_body)
6768 }
6769
6770 pub fn poller(
6772 self,
6773 ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
6774 {
6775 type Operation = lro::internal::Operation<
6776 crate::model::AcceptSpokeUpdateResponse,
6777 crate::model::OperationMetadata,
6778 >;
6779 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6780 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6781
6782 let stub = self.0.stub.clone();
6783 let mut options = self.0.options.clone();
6784 options.set_retry_policy(gax::retry_policy::NeverRetry);
6785 let query = move |name| {
6786 let stub = stub.clone();
6787 let options = options.clone();
6788 async {
6789 let op = GetOperation::new(stub)
6790 .set_name(name)
6791 .with_options(options)
6792 .send()
6793 .await?;
6794 Ok(Operation::new(op))
6795 }
6796 };
6797
6798 let start = move || async {
6799 let op = self.send().await?;
6800 Ok(Operation::new(op))
6801 };
6802
6803 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6804 }
6805
6806 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6810 self.0.request.name = v.into();
6811 self
6812 }
6813
6814 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6818 self.0.request.spoke_uri = v.into();
6819 self
6820 }
6821
6822 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6826 self.0.request.spoke_etag = v.into();
6827 self
6828 }
6829
6830 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6832 self.0.request.request_id = v.into();
6833 self
6834 }
6835 }
6836
6837 #[doc(hidden)]
6838 impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
6839 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6840 &mut self.0.options
6841 }
6842 }
6843
6844 #[derive(Clone, Debug)]
6862 pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
6863
6864 impl RejectSpokeUpdate {
6865 pub(crate) fn new(
6866 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6867 ) -> Self {
6868 Self(RequestBuilder::new(stub))
6869 }
6870
6871 pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
6873 mut self,
6874 v: V,
6875 ) -> Self {
6876 self.0.request = v.into();
6877 self
6878 }
6879
6880 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6882 self.0.options = v.into();
6883 self
6884 }
6885
6886 pub async fn send(self) -> Result<longrunning::model::Operation> {
6893 (*self.0.stub)
6894 .reject_spoke_update(self.0.request, self.0.options)
6895 .await
6896 .map(gax::response::Response::into_body)
6897 }
6898
6899 pub fn poller(
6901 self,
6902 ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
6903 {
6904 type Operation = lro::internal::Operation<
6905 crate::model::RejectSpokeUpdateResponse,
6906 crate::model::OperationMetadata,
6907 >;
6908 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6909 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6910
6911 let stub = self.0.stub.clone();
6912 let mut options = self.0.options.clone();
6913 options.set_retry_policy(gax::retry_policy::NeverRetry);
6914 let query = move |name| {
6915 let stub = stub.clone();
6916 let options = options.clone();
6917 async {
6918 let op = GetOperation::new(stub)
6919 .set_name(name)
6920 .with_options(options)
6921 .send()
6922 .await?;
6923 Ok(Operation::new(op))
6924 }
6925 };
6926
6927 let start = move || async {
6928 let op = self.send().await?;
6929 Ok(Operation::new(op))
6930 };
6931
6932 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6933 }
6934
6935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6939 self.0.request.name = v.into();
6940 self
6941 }
6942
6943 pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6947 self.0.request.spoke_uri = v.into();
6948 self
6949 }
6950
6951 pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6955 self.0.request.spoke_etag = v.into();
6956 self
6957 }
6958
6959 pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6961 self.0.request.details = v.into();
6962 self
6963 }
6964
6965 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6967 self.0.request.request_id = v.into();
6968 self
6969 }
6970 }
6971
6972 #[doc(hidden)]
6973 impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
6974 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6975 &mut self.0.options
6976 }
6977 }
6978
6979 #[derive(Clone, Debug)]
6997 pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
6998
6999 impl DeleteSpoke {
7000 pub(crate) fn new(
7001 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7002 ) -> Self {
7003 Self(RequestBuilder::new(stub))
7004 }
7005
7006 pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7008 self.0.request = v.into();
7009 self
7010 }
7011
7012 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7014 self.0.options = v.into();
7015 self
7016 }
7017
7018 pub async fn send(self) -> Result<longrunning::model::Operation> {
7025 (*self.0.stub)
7026 .delete_spoke(self.0.request, self.0.options)
7027 .await
7028 .map(gax::response::Response::into_body)
7029 }
7030
7031 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
7033 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7034 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7035 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7036
7037 let stub = self.0.stub.clone();
7038 let mut options = self.0.options.clone();
7039 options.set_retry_policy(gax::retry_policy::NeverRetry);
7040 let query = move |name| {
7041 let stub = stub.clone();
7042 let options = options.clone();
7043 async {
7044 let op = GetOperation::new(stub)
7045 .set_name(name)
7046 .with_options(options)
7047 .send()
7048 .await?;
7049 Ok(Operation::new(op))
7050 }
7051 };
7052
7053 let start = move || async {
7054 let op = self.send().await?;
7055 Ok(Operation::new(op))
7056 };
7057
7058 lro::internal::new_unit_response_poller(
7059 polling_error_policy,
7060 polling_backoff_policy,
7061 start,
7062 query,
7063 )
7064 }
7065
7066 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7070 self.0.request.name = v.into();
7071 self
7072 }
7073
7074 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7076 self.0.request.request_id = v.into();
7077 self
7078 }
7079 }
7080
7081 #[doc(hidden)]
7082 impl gax::options::internal::RequestBuilder for DeleteSpoke {
7083 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7084 &mut self.0.options
7085 }
7086 }
7087
7088 #[derive(Clone, Debug)]
7105 pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7106
7107 impl GetRouteTable {
7108 pub(crate) fn new(
7109 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7110 ) -> Self {
7111 Self(RequestBuilder::new(stub))
7112 }
7113
7114 pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7116 self.0.request = v.into();
7117 self
7118 }
7119
7120 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7122 self.0.options = v.into();
7123 self
7124 }
7125
7126 pub async fn send(self) -> Result<crate::model::RouteTable> {
7128 (*self.0.stub)
7129 .get_route_table(self.0.request, self.0.options)
7130 .await
7131 .map(gax::response::Response::into_body)
7132 }
7133
7134 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7138 self.0.request.name = v.into();
7139 self
7140 }
7141 }
7142
7143 #[doc(hidden)]
7144 impl gax::options::internal::RequestBuilder for GetRouteTable {
7145 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7146 &mut self.0.options
7147 }
7148 }
7149
7150 #[derive(Clone, Debug)]
7167 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7168
7169 impl GetRoute {
7170 pub(crate) fn new(
7171 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7172 ) -> Self {
7173 Self(RequestBuilder::new(stub))
7174 }
7175
7176 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7178 self.0.request = v.into();
7179 self
7180 }
7181
7182 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7184 self.0.options = v.into();
7185 self
7186 }
7187
7188 pub async fn send(self) -> Result<crate::model::Route> {
7190 (*self.0.stub)
7191 .get_route(self.0.request, self.0.options)
7192 .await
7193 .map(gax::response::Response::into_body)
7194 }
7195
7196 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7200 self.0.request.name = v.into();
7201 self
7202 }
7203 }
7204
7205 #[doc(hidden)]
7206 impl gax::options::internal::RequestBuilder for GetRoute {
7207 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7208 &mut self.0.options
7209 }
7210 }
7211
7212 #[derive(Clone, Debug)]
7233 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7234
7235 impl ListRoutes {
7236 pub(crate) fn new(
7237 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7238 ) -> Self {
7239 Self(RequestBuilder::new(stub))
7240 }
7241
7242 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7244 self.0.request = v.into();
7245 self
7246 }
7247
7248 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7250 self.0.options = v.into();
7251 self
7252 }
7253
7254 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7256 (*self.0.stub)
7257 .list_routes(self.0.request, self.0.options)
7258 .await
7259 .map(gax::response::Response::into_body)
7260 }
7261
7262 pub fn by_page(
7264 self,
7265 ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
7266 {
7267 use std::clone::Clone;
7268 let token = self.0.request.page_token.clone();
7269 let execute = move |token: String| {
7270 let mut builder = self.clone();
7271 builder.0.request = builder.0.request.set_page_token(token);
7272 builder.send()
7273 };
7274 gax::paginator::internal::new_paginator(token, execute)
7275 }
7276
7277 pub fn by_item(
7279 self,
7280 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
7281 {
7282 use gax::paginator::Paginator;
7283 self.by_page().items()
7284 }
7285
7286 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7290 self.0.request.parent = v.into();
7291 self
7292 }
7293
7294 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7296 self.0.request.page_size = v.into();
7297 self
7298 }
7299
7300 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7302 self.0.request.page_token = v.into();
7303 self
7304 }
7305
7306 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7308 self.0.request.filter = v.into();
7309 self
7310 }
7311
7312 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7314 self.0.request.order_by = v.into();
7315 self
7316 }
7317 }
7318
7319 #[doc(hidden)]
7320 impl gax::options::internal::RequestBuilder for ListRoutes {
7321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7322 &mut self.0.options
7323 }
7324 }
7325
7326 #[derive(Clone, Debug)]
7347 pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7348
7349 impl ListRouteTables {
7350 pub(crate) fn new(
7351 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7352 ) -> Self {
7353 Self(RequestBuilder::new(stub))
7354 }
7355
7356 pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7358 self.0.request = v.into();
7359 self
7360 }
7361
7362 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7364 self.0.options = v.into();
7365 self
7366 }
7367
7368 pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7370 (*self.0.stub)
7371 .list_route_tables(self.0.request, self.0.options)
7372 .await
7373 .map(gax::response::Response::into_body)
7374 }
7375
7376 pub fn by_page(
7378 self,
7379 ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7380 {
7381 use std::clone::Clone;
7382 let token = self.0.request.page_token.clone();
7383 let execute = move |token: String| {
7384 let mut builder = self.clone();
7385 builder.0.request = builder.0.request.set_page_token(token);
7386 builder.send()
7387 };
7388 gax::paginator::internal::new_paginator(token, execute)
7389 }
7390
7391 pub fn by_item(
7393 self,
7394 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7395 {
7396 use gax::paginator::Paginator;
7397 self.by_page().items()
7398 }
7399
7400 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7404 self.0.request.parent = v.into();
7405 self
7406 }
7407
7408 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7410 self.0.request.page_size = v.into();
7411 self
7412 }
7413
7414 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7416 self.0.request.page_token = v.into();
7417 self
7418 }
7419
7420 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7422 self.0.request.filter = v.into();
7423 self
7424 }
7425
7426 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7428 self.0.request.order_by = v.into();
7429 self
7430 }
7431 }
7432
7433 #[doc(hidden)]
7434 impl gax::options::internal::RequestBuilder for ListRouteTables {
7435 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7436 &mut self.0.options
7437 }
7438 }
7439
7440 #[derive(Clone, Debug)]
7457 pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7458
7459 impl GetGroup {
7460 pub(crate) fn new(
7461 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7462 ) -> Self {
7463 Self(RequestBuilder::new(stub))
7464 }
7465
7466 pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7468 self.0.request = v.into();
7469 self
7470 }
7471
7472 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7474 self.0.options = v.into();
7475 self
7476 }
7477
7478 pub async fn send(self) -> Result<crate::model::Group> {
7480 (*self.0.stub)
7481 .get_group(self.0.request, self.0.options)
7482 .await
7483 .map(gax::response::Response::into_body)
7484 }
7485
7486 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7490 self.0.request.name = v.into();
7491 self
7492 }
7493 }
7494
7495 #[doc(hidden)]
7496 impl gax::options::internal::RequestBuilder for GetGroup {
7497 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7498 &mut self.0.options
7499 }
7500 }
7501
7502 #[derive(Clone, Debug)]
7523 pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7524
7525 impl ListGroups {
7526 pub(crate) fn new(
7527 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7528 ) -> Self {
7529 Self(RequestBuilder::new(stub))
7530 }
7531
7532 pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7534 self.0.request = v.into();
7535 self
7536 }
7537
7538 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7540 self.0.options = v.into();
7541 self
7542 }
7543
7544 pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7546 (*self.0.stub)
7547 .list_groups(self.0.request, self.0.options)
7548 .await
7549 .map(gax::response::Response::into_body)
7550 }
7551
7552 pub fn by_page(
7554 self,
7555 ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
7556 {
7557 use std::clone::Clone;
7558 let token = self.0.request.page_token.clone();
7559 let execute = move |token: String| {
7560 let mut builder = self.clone();
7561 builder.0.request = builder.0.request.set_page_token(token);
7562 builder.send()
7563 };
7564 gax::paginator::internal::new_paginator(token, execute)
7565 }
7566
7567 pub fn by_item(
7569 self,
7570 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGroupsResponse, gax::error::Error>
7571 {
7572 use gax::paginator::Paginator;
7573 self.by_page().items()
7574 }
7575
7576 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7580 self.0.request.parent = v.into();
7581 self
7582 }
7583
7584 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7586 self.0.request.page_size = v.into();
7587 self
7588 }
7589
7590 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7592 self.0.request.page_token = v.into();
7593 self
7594 }
7595
7596 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7598 self.0.request.filter = v.into();
7599 self
7600 }
7601
7602 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7604 self.0.request.order_by = v.into();
7605 self
7606 }
7607 }
7608
7609 #[doc(hidden)]
7610 impl gax::options::internal::RequestBuilder for ListGroups {
7611 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7612 &mut self.0.options
7613 }
7614 }
7615
7616 #[derive(Clone, Debug)]
7634 pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7635
7636 impl UpdateGroup {
7637 pub(crate) fn new(
7638 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7639 ) -> Self {
7640 Self(RequestBuilder::new(stub))
7641 }
7642
7643 pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7645 self.0.request = v.into();
7646 self
7647 }
7648
7649 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7651 self.0.options = v.into();
7652 self
7653 }
7654
7655 pub async fn send(self) -> Result<longrunning::model::Operation> {
7662 (*self.0.stub)
7663 .update_group(self.0.request, self.0.options)
7664 .await
7665 .map(gax::response::Response::into_body)
7666 }
7667
7668 pub fn poller(
7670 self,
7671 ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
7672 type Operation =
7673 lro::internal::Operation<crate::model::Group, crate::model::OperationMetadata>;
7674 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7675 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7676
7677 let stub = self.0.stub.clone();
7678 let mut options = self.0.options.clone();
7679 options.set_retry_policy(gax::retry_policy::NeverRetry);
7680 let query = move |name| {
7681 let stub = stub.clone();
7682 let options = options.clone();
7683 async {
7684 let op = GetOperation::new(stub)
7685 .set_name(name)
7686 .with_options(options)
7687 .send()
7688 .await?;
7689 Ok(Operation::new(op))
7690 }
7691 };
7692
7693 let start = move || async {
7694 let op = self.send().await?;
7695 Ok(Operation::new(op))
7696 };
7697
7698 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7699 }
7700
7701 pub fn set_update_mask<T>(mut self, v: T) -> Self
7703 where
7704 T: std::convert::Into<wkt::FieldMask>,
7705 {
7706 self.0.request.update_mask = std::option::Option::Some(v.into());
7707 self
7708 }
7709
7710 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7712 where
7713 T: std::convert::Into<wkt::FieldMask>,
7714 {
7715 self.0.request.update_mask = v.map(|x| x.into());
7716 self
7717 }
7718
7719 pub fn set_group<T>(mut self, v: T) -> Self
7723 where
7724 T: std::convert::Into<crate::model::Group>,
7725 {
7726 self.0.request.group = std::option::Option::Some(v.into());
7727 self
7728 }
7729
7730 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7734 where
7735 T: std::convert::Into<crate::model::Group>,
7736 {
7737 self.0.request.group = v.map(|x| x.into());
7738 self
7739 }
7740
7741 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7743 self.0.request.request_id = v.into();
7744 self
7745 }
7746 }
7747
7748 #[doc(hidden)]
7749 impl gax::options::internal::RequestBuilder for UpdateGroup {
7750 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7751 &mut self.0.options
7752 }
7753 }
7754
7755 #[derive(Clone, Debug)]
7776 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7777
7778 impl ListLocations {
7779 pub(crate) fn new(
7780 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7781 ) -> Self {
7782 Self(RequestBuilder::new(stub))
7783 }
7784
7785 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7787 mut self,
7788 v: V,
7789 ) -> Self {
7790 self.0.request = v.into();
7791 self
7792 }
7793
7794 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7796 self.0.options = v.into();
7797 self
7798 }
7799
7800 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7802 (*self.0.stub)
7803 .list_locations(self.0.request, self.0.options)
7804 .await
7805 .map(gax::response::Response::into_body)
7806 }
7807
7808 pub fn by_page(
7810 self,
7811 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7812 {
7813 use std::clone::Clone;
7814 let token = self.0.request.page_token.clone();
7815 let execute = move |token: String| {
7816 let mut builder = self.clone();
7817 builder.0.request = builder.0.request.set_page_token(token);
7818 builder.send()
7819 };
7820 gax::paginator::internal::new_paginator(token, execute)
7821 }
7822
7823 pub fn by_item(
7825 self,
7826 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7827 {
7828 use gax::paginator::Paginator;
7829 self.by_page().items()
7830 }
7831
7832 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7834 self.0.request.name = v.into();
7835 self
7836 }
7837
7838 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7840 self.0.request.filter = v.into();
7841 self
7842 }
7843
7844 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7846 self.0.request.page_size = v.into();
7847 self
7848 }
7849
7850 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7852 self.0.request.page_token = v.into();
7853 self
7854 }
7855 }
7856
7857 #[doc(hidden)]
7858 impl gax::options::internal::RequestBuilder for ListLocations {
7859 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7860 &mut self.0.options
7861 }
7862 }
7863
7864 #[derive(Clone, Debug)]
7881 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7882
7883 impl GetLocation {
7884 pub(crate) fn new(
7885 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7886 ) -> Self {
7887 Self(RequestBuilder::new(stub))
7888 }
7889
7890 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7892 self.0.request = v.into();
7893 self
7894 }
7895
7896 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7898 self.0.options = v.into();
7899 self
7900 }
7901
7902 pub async fn send(self) -> Result<location::model::Location> {
7904 (*self.0.stub)
7905 .get_location(self.0.request, self.0.options)
7906 .await
7907 .map(gax::response::Response::into_body)
7908 }
7909
7910 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7912 self.0.request.name = v.into();
7913 self
7914 }
7915 }
7916
7917 #[doc(hidden)]
7918 impl gax::options::internal::RequestBuilder for GetLocation {
7919 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7920 &mut self.0.options
7921 }
7922 }
7923
7924 #[derive(Clone, Debug)]
7941 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
7942
7943 impl SetIamPolicy {
7944 pub(crate) fn new(
7945 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7946 ) -> Self {
7947 Self(RequestBuilder::new(stub))
7948 }
7949
7950 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
7952 self.0.request = v.into();
7953 self
7954 }
7955
7956 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7958 self.0.options = v.into();
7959 self
7960 }
7961
7962 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7964 (*self.0.stub)
7965 .set_iam_policy(self.0.request, self.0.options)
7966 .await
7967 .map(gax::response::Response::into_body)
7968 }
7969
7970 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7974 self.0.request.resource = v.into();
7975 self
7976 }
7977
7978 pub fn set_policy<T>(mut self, v: T) -> Self
7982 where
7983 T: std::convert::Into<iam_v1::model::Policy>,
7984 {
7985 self.0.request.policy = std::option::Option::Some(v.into());
7986 self
7987 }
7988
7989 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7993 where
7994 T: std::convert::Into<iam_v1::model::Policy>,
7995 {
7996 self.0.request.policy = v.map(|x| x.into());
7997 self
7998 }
7999
8000 pub fn set_update_mask<T>(mut self, v: T) -> Self
8002 where
8003 T: std::convert::Into<wkt::FieldMask>,
8004 {
8005 self.0.request.update_mask = std::option::Option::Some(v.into());
8006 self
8007 }
8008
8009 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8011 where
8012 T: std::convert::Into<wkt::FieldMask>,
8013 {
8014 self.0.request.update_mask = v.map(|x| x.into());
8015 self
8016 }
8017 }
8018
8019 #[doc(hidden)]
8020 impl gax::options::internal::RequestBuilder for SetIamPolicy {
8021 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8022 &mut self.0.options
8023 }
8024 }
8025
8026 #[derive(Clone, Debug)]
8043 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
8044
8045 impl GetIamPolicy {
8046 pub(crate) fn new(
8047 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8048 ) -> Self {
8049 Self(RequestBuilder::new(stub))
8050 }
8051
8052 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
8054 self.0.request = v.into();
8055 self
8056 }
8057
8058 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8060 self.0.options = v.into();
8061 self
8062 }
8063
8064 pub async fn send(self) -> Result<iam_v1::model::Policy> {
8066 (*self.0.stub)
8067 .get_iam_policy(self.0.request, self.0.options)
8068 .await
8069 .map(gax::response::Response::into_body)
8070 }
8071
8072 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8076 self.0.request.resource = v.into();
8077 self
8078 }
8079
8080 pub fn set_options<T>(mut self, v: T) -> Self
8082 where
8083 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8084 {
8085 self.0.request.options = std::option::Option::Some(v.into());
8086 self
8087 }
8088
8089 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8091 where
8092 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8093 {
8094 self.0.request.options = v.map(|x| x.into());
8095 self
8096 }
8097 }
8098
8099 #[doc(hidden)]
8100 impl gax::options::internal::RequestBuilder for GetIamPolicy {
8101 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8102 &mut self.0.options
8103 }
8104 }
8105
8106 #[derive(Clone, Debug)]
8123 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8124
8125 impl TestIamPermissions {
8126 pub(crate) fn new(
8127 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8128 ) -> Self {
8129 Self(RequestBuilder::new(stub))
8130 }
8131
8132 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8134 mut self,
8135 v: V,
8136 ) -> Self {
8137 self.0.request = v.into();
8138 self
8139 }
8140
8141 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8143 self.0.options = v.into();
8144 self
8145 }
8146
8147 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8149 (*self.0.stub)
8150 .test_iam_permissions(self.0.request, self.0.options)
8151 .await
8152 .map(gax::response::Response::into_body)
8153 }
8154
8155 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8159 self.0.request.resource = v.into();
8160 self
8161 }
8162
8163 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8167 where
8168 T: std::iter::IntoIterator<Item = V>,
8169 V: std::convert::Into<std::string::String>,
8170 {
8171 use std::iter::Iterator;
8172 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8173 self
8174 }
8175 }
8176
8177 #[doc(hidden)]
8178 impl gax::options::internal::RequestBuilder for TestIamPermissions {
8179 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8180 &mut self.0.options
8181 }
8182 }
8183
8184 #[derive(Clone, Debug)]
8205 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8206
8207 impl ListOperations {
8208 pub(crate) fn new(
8209 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8210 ) -> Self {
8211 Self(RequestBuilder::new(stub))
8212 }
8213
8214 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8216 mut self,
8217 v: V,
8218 ) -> Self {
8219 self.0.request = v.into();
8220 self
8221 }
8222
8223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8225 self.0.options = v.into();
8226 self
8227 }
8228
8229 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8231 (*self.0.stub)
8232 .list_operations(self.0.request, self.0.options)
8233 .await
8234 .map(gax::response::Response::into_body)
8235 }
8236
8237 pub fn by_page(
8239 self,
8240 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8241 {
8242 use std::clone::Clone;
8243 let token = self.0.request.page_token.clone();
8244 let execute = move |token: String| {
8245 let mut builder = self.clone();
8246 builder.0.request = builder.0.request.set_page_token(token);
8247 builder.send()
8248 };
8249 gax::paginator::internal::new_paginator(token, execute)
8250 }
8251
8252 pub fn by_item(
8254 self,
8255 ) -> impl gax::paginator::ItemPaginator<
8256 longrunning::model::ListOperationsResponse,
8257 gax::error::Error,
8258 > {
8259 use gax::paginator::Paginator;
8260 self.by_page().items()
8261 }
8262
8263 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8265 self.0.request.name = v.into();
8266 self
8267 }
8268
8269 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8271 self.0.request.filter = v.into();
8272 self
8273 }
8274
8275 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8277 self.0.request.page_size = v.into();
8278 self
8279 }
8280
8281 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8283 self.0.request.page_token = v.into();
8284 self
8285 }
8286
8287 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8289 self.0.request.return_partial_success = v.into();
8290 self
8291 }
8292 }
8293
8294 #[doc(hidden)]
8295 impl gax::options::internal::RequestBuilder for ListOperations {
8296 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8297 &mut self.0.options
8298 }
8299 }
8300
8301 #[derive(Clone, Debug)]
8318 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8319
8320 impl GetOperation {
8321 pub(crate) fn new(
8322 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8323 ) -> Self {
8324 Self(RequestBuilder::new(stub))
8325 }
8326
8327 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8329 mut self,
8330 v: V,
8331 ) -> Self {
8332 self.0.request = v.into();
8333 self
8334 }
8335
8336 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8338 self.0.options = v.into();
8339 self
8340 }
8341
8342 pub async fn send(self) -> Result<longrunning::model::Operation> {
8344 (*self.0.stub)
8345 .get_operation(self.0.request, self.0.options)
8346 .await
8347 .map(gax::response::Response::into_body)
8348 }
8349
8350 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8352 self.0.request.name = v.into();
8353 self
8354 }
8355 }
8356
8357 #[doc(hidden)]
8358 impl gax::options::internal::RequestBuilder for GetOperation {
8359 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8360 &mut self.0.options
8361 }
8362 }
8363
8364 #[derive(Clone, Debug)]
8381 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8382
8383 impl DeleteOperation {
8384 pub(crate) fn new(
8385 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8386 ) -> Self {
8387 Self(RequestBuilder::new(stub))
8388 }
8389
8390 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8392 mut self,
8393 v: V,
8394 ) -> Self {
8395 self.0.request = v.into();
8396 self
8397 }
8398
8399 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8401 self.0.options = v.into();
8402 self
8403 }
8404
8405 pub async fn send(self) -> Result<()> {
8407 (*self.0.stub)
8408 .delete_operation(self.0.request, self.0.options)
8409 .await
8410 .map(gax::response::Response::into_body)
8411 }
8412
8413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8415 self.0.request.name = v.into();
8416 self
8417 }
8418 }
8419
8420 #[doc(hidden)]
8421 impl gax::options::internal::RequestBuilder for DeleteOperation {
8422 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8423 &mut self.0.options
8424 }
8425 }
8426
8427 #[derive(Clone, Debug)]
8444 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8445
8446 impl CancelOperation {
8447 pub(crate) fn new(
8448 stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8449 ) -> Self {
8450 Self(RequestBuilder::new(stub))
8451 }
8452
8453 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8455 mut self,
8456 v: V,
8457 ) -> Self {
8458 self.0.request = v.into();
8459 self
8460 }
8461
8462 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8464 self.0.options = v.into();
8465 self
8466 }
8467
8468 pub async fn send(self) -> Result<()> {
8470 (*self.0.stub)
8471 .cancel_operation(self.0.request, self.0.options)
8472 .await
8473 .map(gax::response::Response::into_body)
8474 }
8475
8476 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8478 self.0.request.name = v.into();
8479 self
8480 }
8481 }
8482
8483 #[doc(hidden)]
8484 impl gax::options::internal::RequestBuilder for CancelOperation {
8485 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8486 &mut self.0.options
8487 }
8488 }
8489}
8490
8491pub mod internal_range_service {
8492 use crate::Result;
8493
8494 pub type ClientBuilder =
8508 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8509
8510 pub(crate) mod client {
8511 use super::super::super::client::InternalRangeService;
8512 pub struct Factory;
8513 impl gax::client_builder::internal::ClientFactory for Factory {
8514 type Client = InternalRangeService;
8515 type Credentials = gaxi::options::Credentials;
8516 async fn build(
8517 self,
8518 config: gaxi::options::ClientConfig,
8519 ) -> gax::client_builder::Result<Self::Client> {
8520 Self::Client::new(config).await
8521 }
8522 }
8523 }
8524
8525 #[derive(Clone, Debug)]
8527 pub(crate) struct RequestBuilder<R: std::default::Default> {
8528 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8529 request: R,
8530 options: gax::options::RequestOptions,
8531 }
8532
8533 impl<R> RequestBuilder<R>
8534 where
8535 R: std::default::Default,
8536 {
8537 pub(crate) fn new(
8538 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8539 ) -> Self {
8540 Self {
8541 stub,
8542 request: R::default(),
8543 options: gax::options::RequestOptions::default(),
8544 }
8545 }
8546 }
8547
8548 #[derive(Clone, Debug)]
8569 pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8570
8571 impl ListInternalRanges {
8572 pub(crate) fn new(
8573 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8574 ) -> Self {
8575 Self(RequestBuilder::new(stub))
8576 }
8577
8578 pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8580 mut self,
8581 v: V,
8582 ) -> Self {
8583 self.0.request = v.into();
8584 self
8585 }
8586
8587 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8589 self.0.options = v.into();
8590 self
8591 }
8592
8593 pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8595 (*self.0.stub)
8596 .list_internal_ranges(self.0.request, self.0.options)
8597 .await
8598 .map(gax::response::Response::into_body)
8599 }
8600
8601 pub fn by_page(
8603 self,
8604 ) -> impl gax::paginator::Paginator<crate::model::ListInternalRangesResponse, gax::error::Error>
8605 {
8606 use std::clone::Clone;
8607 let token = self.0.request.page_token.clone();
8608 let execute = move |token: String| {
8609 let mut builder = self.clone();
8610 builder.0.request = builder.0.request.set_page_token(token);
8611 builder.send()
8612 };
8613 gax::paginator::internal::new_paginator(token, execute)
8614 }
8615
8616 pub fn by_item(
8618 self,
8619 ) -> impl gax::paginator::ItemPaginator<
8620 crate::model::ListInternalRangesResponse,
8621 gax::error::Error,
8622 > {
8623 use gax::paginator::Paginator;
8624 self.by_page().items()
8625 }
8626
8627 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8631 self.0.request.parent = v.into();
8632 self
8633 }
8634
8635 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8637 self.0.request.page_size = v.into();
8638 self
8639 }
8640
8641 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8643 self.0.request.page_token = v.into();
8644 self
8645 }
8646
8647 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8649 self.0.request.filter = v.into();
8650 self
8651 }
8652
8653 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8655 self.0.request.order_by = v.into();
8656 self
8657 }
8658 }
8659
8660 #[doc(hidden)]
8661 impl gax::options::internal::RequestBuilder for ListInternalRanges {
8662 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8663 &mut self.0.options
8664 }
8665 }
8666
8667 #[derive(Clone, Debug)]
8684 pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8685
8686 impl GetInternalRange {
8687 pub(crate) fn new(
8688 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8689 ) -> Self {
8690 Self(RequestBuilder::new(stub))
8691 }
8692
8693 pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8695 mut self,
8696 v: V,
8697 ) -> Self {
8698 self.0.request = v.into();
8699 self
8700 }
8701
8702 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8704 self.0.options = v.into();
8705 self
8706 }
8707
8708 pub async fn send(self) -> Result<crate::model::InternalRange> {
8710 (*self.0.stub)
8711 .get_internal_range(self.0.request, self.0.options)
8712 .await
8713 .map(gax::response::Response::into_body)
8714 }
8715
8716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8720 self.0.request.name = v.into();
8721 self
8722 }
8723 }
8724
8725 #[doc(hidden)]
8726 impl gax::options::internal::RequestBuilder for GetInternalRange {
8727 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8728 &mut self.0.options
8729 }
8730 }
8731
8732 #[derive(Clone, Debug)]
8750 pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8751
8752 impl CreateInternalRange {
8753 pub(crate) fn new(
8754 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8755 ) -> Self {
8756 Self(RequestBuilder::new(stub))
8757 }
8758
8759 pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8761 mut self,
8762 v: V,
8763 ) -> Self {
8764 self.0.request = v.into();
8765 self
8766 }
8767
8768 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8770 self.0.options = v.into();
8771 self
8772 }
8773
8774 pub async fn send(self) -> Result<longrunning::model::Operation> {
8781 (*self.0.stub)
8782 .create_internal_range(self.0.request, self.0.options)
8783 .await
8784 .map(gax::response::Response::into_body)
8785 }
8786
8787 pub fn poller(
8789 self,
8790 ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8791 {
8792 type Operation = lro::internal::Operation<
8793 crate::model::InternalRange,
8794 crate::model::OperationMetadata,
8795 >;
8796 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8797 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8798
8799 let stub = self.0.stub.clone();
8800 let mut options = self.0.options.clone();
8801 options.set_retry_policy(gax::retry_policy::NeverRetry);
8802 let query = move |name| {
8803 let stub = stub.clone();
8804 let options = options.clone();
8805 async {
8806 let op = GetOperation::new(stub)
8807 .set_name(name)
8808 .with_options(options)
8809 .send()
8810 .await?;
8811 Ok(Operation::new(op))
8812 }
8813 };
8814
8815 let start = move || async {
8816 let op = self.send().await?;
8817 Ok(Operation::new(op))
8818 };
8819
8820 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8821 }
8822
8823 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8827 self.0.request.parent = v.into();
8828 self
8829 }
8830
8831 pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8833 self.0.request.internal_range_id = v.into();
8834 self
8835 }
8836
8837 pub fn set_internal_range<T>(mut self, v: T) -> Self
8841 where
8842 T: std::convert::Into<crate::model::InternalRange>,
8843 {
8844 self.0.request.internal_range = std::option::Option::Some(v.into());
8845 self
8846 }
8847
8848 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
8852 where
8853 T: std::convert::Into<crate::model::InternalRange>,
8854 {
8855 self.0.request.internal_range = v.map(|x| x.into());
8856 self
8857 }
8858
8859 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8861 self.0.request.request_id = v.into();
8862 self
8863 }
8864 }
8865
8866 #[doc(hidden)]
8867 impl gax::options::internal::RequestBuilder for CreateInternalRange {
8868 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8869 &mut self.0.options
8870 }
8871 }
8872
8873 #[derive(Clone, Debug)]
8891 pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
8892
8893 impl UpdateInternalRange {
8894 pub(crate) fn new(
8895 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8896 ) -> Self {
8897 Self(RequestBuilder::new(stub))
8898 }
8899
8900 pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
8902 mut self,
8903 v: V,
8904 ) -> Self {
8905 self.0.request = v.into();
8906 self
8907 }
8908
8909 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8911 self.0.options = v.into();
8912 self
8913 }
8914
8915 pub async fn send(self) -> Result<longrunning::model::Operation> {
8922 (*self.0.stub)
8923 .update_internal_range(self.0.request, self.0.options)
8924 .await
8925 .map(gax::response::Response::into_body)
8926 }
8927
8928 pub fn poller(
8930 self,
8931 ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8932 {
8933 type Operation = lro::internal::Operation<
8934 crate::model::InternalRange,
8935 crate::model::OperationMetadata,
8936 >;
8937 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8938 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8939
8940 let stub = self.0.stub.clone();
8941 let mut options = self.0.options.clone();
8942 options.set_retry_policy(gax::retry_policy::NeverRetry);
8943 let query = move |name| {
8944 let stub = stub.clone();
8945 let options = options.clone();
8946 async {
8947 let op = GetOperation::new(stub)
8948 .set_name(name)
8949 .with_options(options)
8950 .send()
8951 .await?;
8952 Ok(Operation::new(op))
8953 }
8954 };
8955
8956 let start = move || async {
8957 let op = self.send().await?;
8958 Ok(Operation::new(op))
8959 };
8960
8961 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8962 }
8963
8964 pub fn set_update_mask<T>(mut self, v: T) -> Self
8966 where
8967 T: std::convert::Into<wkt::FieldMask>,
8968 {
8969 self.0.request.update_mask = std::option::Option::Some(v.into());
8970 self
8971 }
8972
8973 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8975 where
8976 T: std::convert::Into<wkt::FieldMask>,
8977 {
8978 self.0.request.update_mask = v.map(|x| x.into());
8979 self
8980 }
8981
8982 pub fn set_internal_range<T>(mut self, v: T) -> Self
8986 where
8987 T: std::convert::Into<crate::model::InternalRange>,
8988 {
8989 self.0.request.internal_range = std::option::Option::Some(v.into());
8990 self
8991 }
8992
8993 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
8997 where
8998 T: std::convert::Into<crate::model::InternalRange>,
8999 {
9000 self.0.request.internal_range = v.map(|x| x.into());
9001 self
9002 }
9003
9004 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9006 self.0.request.request_id = v.into();
9007 self
9008 }
9009 }
9010
9011 #[doc(hidden)]
9012 impl gax::options::internal::RequestBuilder for UpdateInternalRange {
9013 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9014 &mut self.0.options
9015 }
9016 }
9017
9018 #[derive(Clone, Debug)]
9036 pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9037
9038 impl DeleteInternalRange {
9039 pub(crate) fn new(
9040 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9041 ) -> Self {
9042 Self(RequestBuilder::new(stub))
9043 }
9044
9045 pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9047 mut self,
9048 v: V,
9049 ) -> Self {
9050 self.0.request = v.into();
9051 self
9052 }
9053
9054 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9056 self.0.options = v.into();
9057 self
9058 }
9059
9060 pub async fn send(self) -> Result<longrunning::model::Operation> {
9067 (*self.0.stub)
9068 .delete_internal_range(self.0.request, self.0.options)
9069 .await
9070 .map(gax::response::Response::into_body)
9071 }
9072
9073 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9075 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9076 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9077 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9078
9079 let stub = self.0.stub.clone();
9080 let mut options = self.0.options.clone();
9081 options.set_retry_policy(gax::retry_policy::NeverRetry);
9082 let query = move |name| {
9083 let stub = stub.clone();
9084 let options = options.clone();
9085 async {
9086 let op = GetOperation::new(stub)
9087 .set_name(name)
9088 .with_options(options)
9089 .send()
9090 .await?;
9091 Ok(Operation::new(op))
9092 }
9093 };
9094
9095 let start = move || async {
9096 let op = self.send().await?;
9097 Ok(Operation::new(op))
9098 };
9099
9100 lro::internal::new_unit_response_poller(
9101 polling_error_policy,
9102 polling_backoff_policy,
9103 start,
9104 query,
9105 )
9106 }
9107
9108 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9112 self.0.request.name = v.into();
9113 self
9114 }
9115
9116 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9118 self.0.request.request_id = v.into();
9119 self
9120 }
9121 }
9122
9123 #[doc(hidden)]
9124 impl gax::options::internal::RequestBuilder for DeleteInternalRange {
9125 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9126 &mut self.0.options
9127 }
9128 }
9129
9130 #[derive(Clone, Debug)]
9151 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9152
9153 impl ListLocations {
9154 pub(crate) fn new(
9155 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9156 ) -> Self {
9157 Self(RequestBuilder::new(stub))
9158 }
9159
9160 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9162 mut self,
9163 v: V,
9164 ) -> Self {
9165 self.0.request = v.into();
9166 self
9167 }
9168
9169 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9171 self.0.options = v.into();
9172 self
9173 }
9174
9175 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9177 (*self.0.stub)
9178 .list_locations(self.0.request, self.0.options)
9179 .await
9180 .map(gax::response::Response::into_body)
9181 }
9182
9183 pub fn by_page(
9185 self,
9186 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9187 {
9188 use std::clone::Clone;
9189 let token = self.0.request.page_token.clone();
9190 let execute = move |token: String| {
9191 let mut builder = self.clone();
9192 builder.0.request = builder.0.request.set_page_token(token);
9193 builder.send()
9194 };
9195 gax::paginator::internal::new_paginator(token, execute)
9196 }
9197
9198 pub fn by_item(
9200 self,
9201 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9202 {
9203 use gax::paginator::Paginator;
9204 self.by_page().items()
9205 }
9206
9207 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9209 self.0.request.name = v.into();
9210 self
9211 }
9212
9213 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9215 self.0.request.filter = v.into();
9216 self
9217 }
9218
9219 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9221 self.0.request.page_size = v.into();
9222 self
9223 }
9224
9225 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9227 self.0.request.page_token = v.into();
9228 self
9229 }
9230 }
9231
9232 #[doc(hidden)]
9233 impl gax::options::internal::RequestBuilder for ListLocations {
9234 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9235 &mut self.0.options
9236 }
9237 }
9238
9239 #[derive(Clone, Debug)]
9256 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
9257
9258 impl GetLocation {
9259 pub(crate) fn new(
9260 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9261 ) -> Self {
9262 Self(RequestBuilder::new(stub))
9263 }
9264
9265 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
9267 self.0.request = v.into();
9268 self
9269 }
9270
9271 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9273 self.0.options = v.into();
9274 self
9275 }
9276
9277 pub async fn send(self) -> Result<location::model::Location> {
9279 (*self.0.stub)
9280 .get_location(self.0.request, self.0.options)
9281 .await
9282 .map(gax::response::Response::into_body)
9283 }
9284
9285 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9287 self.0.request.name = v.into();
9288 self
9289 }
9290 }
9291
9292 #[doc(hidden)]
9293 impl gax::options::internal::RequestBuilder for GetLocation {
9294 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9295 &mut self.0.options
9296 }
9297 }
9298
9299 #[derive(Clone, Debug)]
9316 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
9317
9318 impl SetIamPolicy {
9319 pub(crate) fn new(
9320 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9321 ) -> Self {
9322 Self(RequestBuilder::new(stub))
9323 }
9324
9325 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
9327 self.0.request = v.into();
9328 self
9329 }
9330
9331 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9333 self.0.options = v.into();
9334 self
9335 }
9336
9337 pub async fn send(self) -> Result<iam_v1::model::Policy> {
9339 (*self.0.stub)
9340 .set_iam_policy(self.0.request, self.0.options)
9341 .await
9342 .map(gax::response::Response::into_body)
9343 }
9344
9345 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9349 self.0.request.resource = v.into();
9350 self
9351 }
9352
9353 pub fn set_policy<T>(mut self, v: T) -> Self
9357 where
9358 T: std::convert::Into<iam_v1::model::Policy>,
9359 {
9360 self.0.request.policy = std::option::Option::Some(v.into());
9361 self
9362 }
9363
9364 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9368 where
9369 T: std::convert::Into<iam_v1::model::Policy>,
9370 {
9371 self.0.request.policy = v.map(|x| x.into());
9372 self
9373 }
9374
9375 pub fn set_update_mask<T>(mut self, v: T) -> Self
9377 where
9378 T: std::convert::Into<wkt::FieldMask>,
9379 {
9380 self.0.request.update_mask = std::option::Option::Some(v.into());
9381 self
9382 }
9383
9384 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9386 where
9387 T: std::convert::Into<wkt::FieldMask>,
9388 {
9389 self.0.request.update_mask = v.map(|x| x.into());
9390 self
9391 }
9392 }
9393
9394 #[doc(hidden)]
9395 impl gax::options::internal::RequestBuilder for SetIamPolicy {
9396 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9397 &mut self.0.options
9398 }
9399 }
9400
9401 #[derive(Clone, Debug)]
9418 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
9419
9420 impl GetIamPolicy {
9421 pub(crate) fn new(
9422 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9423 ) -> Self {
9424 Self(RequestBuilder::new(stub))
9425 }
9426
9427 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
9429 self.0.request = v.into();
9430 self
9431 }
9432
9433 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9435 self.0.options = v.into();
9436 self
9437 }
9438
9439 pub async fn send(self) -> Result<iam_v1::model::Policy> {
9441 (*self.0.stub)
9442 .get_iam_policy(self.0.request, self.0.options)
9443 .await
9444 .map(gax::response::Response::into_body)
9445 }
9446
9447 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9451 self.0.request.resource = v.into();
9452 self
9453 }
9454
9455 pub fn set_options<T>(mut self, v: T) -> Self
9457 where
9458 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9459 {
9460 self.0.request.options = std::option::Option::Some(v.into());
9461 self
9462 }
9463
9464 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9466 where
9467 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9468 {
9469 self.0.request.options = v.map(|x| x.into());
9470 self
9471 }
9472 }
9473
9474 #[doc(hidden)]
9475 impl gax::options::internal::RequestBuilder for GetIamPolicy {
9476 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9477 &mut self.0.options
9478 }
9479 }
9480
9481 #[derive(Clone, Debug)]
9498 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
9499
9500 impl TestIamPermissions {
9501 pub(crate) fn new(
9502 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9503 ) -> Self {
9504 Self(RequestBuilder::new(stub))
9505 }
9506
9507 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
9509 mut self,
9510 v: V,
9511 ) -> Self {
9512 self.0.request = v.into();
9513 self
9514 }
9515
9516 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9518 self.0.options = v.into();
9519 self
9520 }
9521
9522 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
9524 (*self.0.stub)
9525 .test_iam_permissions(self.0.request, self.0.options)
9526 .await
9527 .map(gax::response::Response::into_body)
9528 }
9529
9530 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9534 self.0.request.resource = v.into();
9535 self
9536 }
9537
9538 pub fn set_permissions<T, V>(mut self, v: T) -> Self
9542 where
9543 T: std::iter::IntoIterator<Item = V>,
9544 V: std::convert::Into<std::string::String>,
9545 {
9546 use std::iter::Iterator;
9547 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9548 self
9549 }
9550 }
9551
9552 #[doc(hidden)]
9553 impl gax::options::internal::RequestBuilder for TestIamPermissions {
9554 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9555 &mut self.0.options
9556 }
9557 }
9558
9559 #[derive(Clone, Debug)]
9580 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
9581
9582 impl ListOperations {
9583 pub(crate) fn new(
9584 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9585 ) -> Self {
9586 Self(RequestBuilder::new(stub))
9587 }
9588
9589 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
9591 mut self,
9592 v: V,
9593 ) -> Self {
9594 self.0.request = v.into();
9595 self
9596 }
9597
9598 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9600 self.0.options = v.into();
9601 self
9602 }
9603
9604 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
9606 (*self.0.stub)
9607 .list_operations(self.0.request, self.0.options)
9608 .await
9609 .map(gax::response::Response::into_body)
9610 }
9611
9612 pub fn by_page(
9614 self,
9615 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
9616 {
9617 use std::clone::Clone;
9618 let token = self.0.request.page_token.clone();
9619 let execute = move |token: String| {
9620 let mut builder = self.clone();
9621 builder.0.request = builder.0.request.set_page_token(token);
9622 builder.send()
9623 };
9624 gax::paginator::internal::new_paginator(token, execute)
9625 }
9626
9627 pub fn by_item(
9629 self,
9630 ) -> impl gax::paginator::ItemPaginator<
9631 longrunning::model::ListOperationsResponse,
9632 gax::error::Error,
9633 > {
9634 use gax::paginator::Paginator;
9635 self.by_page().items()
9636 }
9637
9638 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9640 self.0.request.name = v.into();
9641 self
9642 }
9643
9644 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9646 self.0.request.filter = v.into();
9647 self
9648 }
9649
9650 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9652 self.0.request.page_size = v.into();
9653 self
9654 }
9655
9656 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9658 self.0.request.page_token = v.into();
9659 self
9660 }
9661
9662 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9664 self.0.request.return_partial_success = v.into();
9665 self
9666 }
9667 }
9668
9669 #[doc(hidden)]
9670 impl gax::options::internal::RequestBuilder for ListOperations {
9671 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9672 &mut self.0.options
9673 }
9674 }
9675
9676 #[derive(Clone, Debug)]
9693 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
9694
9695 impl GetOperation {
9696 pub(crate) fn new(
9697 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9698 ) -> Self {
9699 Self(RequestBuilder::new(stub))
9700 }
9701
9702 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
9704 mut self,
9705 v: V,
9706 ) -> Self {
9707 self.0.request = v.into();
9708 self
9709 }
9710
9711 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9713 self.0.options = v.into();
9714 self
9715 }
9716
9717 pub async fn send(self) -> Result<longrunning::model::Operation> {
9719 (*self.0.stub)
9720 .get_operation(self.0.request, self.0.options)
9721 .await
9722 .map(gax::response::Response::into_body)
9723 }
9724
9725 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9727 self.0.request.name = v.into();
9728 self
9729 }
9730 }
9731
9732 #[doc(hidden)]
9733 impl gax::options::internal::RequestBuilder for GetOperation {
9734 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9735 &mut self.0.options
9736 }
9737 }
9738
9739 #[derive(Clone, Debug)]
9756 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
9757
9758 impl DeleteOperation {
9759 pub(crate) fn new(
9760 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9761 ) -> Self {
9762 Self(RequestBuilder::new(stub))
9763 }
9764
9765 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
9767 mut self,
9768 v: V,
9769 ) -> Self {
9770 self.0.request = v.into();
9771 self
9772 }
9773
9774 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9776 self.0.options = v.into();
9777 self
9778 }
9779
9780 pub async fn send(self) -> Result<()> {
9782 (*self.0.stub)
9783 .delete_operation(self.0.request, self.0.options)
9784 .await
9785 .map(gax::response::Response::into_body)
9786 }
9787
9788 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9790 self.0.request.name = v.into();
9791 self
9792 }
9793 }
9794
9795 #[doc(hidden)]
9796 impl gax::options::internal::RequestBuilder for DeleteOperation {
9797 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9798 &mut self.0.options
9799 }
9800 }
9801
9802 #[derive(Clone, Debug)]
9819 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
9820
9821 impl CancelOperation {
9822 pub(crate) fn new(
9823 stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9824 ) -> Self {
9825 Self(RequestBuilder::new(stub))
9826 }
9827
9828 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
9830 mut self,
9831 v: V,
9832 ) -> Self {
9833 self.0.request = v.into();
9834 self
9835 }
9836
9837 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9839 self.0.options = v.into();
9840 self
9841 }
9842
9843 pub async fn send(self) -> Result<()> {
9845 (*self.0.stub)
9846 .cancel_operation(self.0.request, self.0.options)
9847 .await
9848 .map(gax::response::Response::into_body)
9849 }
9850
9851 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9853 self.0.request.name = v.into();
9854 self
9855 }
9856 }
9857
9858 #[doc(hidden)]
9859 impl gax::options::internal::RequestBuilder for CancelOperation {
9860 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9861 &mut self.0.options
9862 }
9863 }
9864}
9865
9866pub mod policy_based_routing_service {
9867 use crate::Result;
9868
9869 pub type ClientBuilder =
9883 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9884
9885 pub(crate) mod client {
9886 use super::super::super::client::PolicyBasedRoutingService;
9887 pub struct Factory;
9888 impl gax::client_builder::internal::ClientFactory for Factory {
9889 type Client = PolicyBasedRoutingService;
9890 type Credentials = gaxi::options::Credentials;
9891 async fn build(
9892 self,
9893 config: gaxi::options::ClientConfig,
9894 ) -> gax::client_builder::Result<Self::Client> {
9895 Self::Client::new(config).await
9896 }
9897 }
9898 }
9899
9900 #[derive(Clone, Debug)]
9902 pub(crate) struct RequestBuilder<R: std::default::Default> {
9903 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9904 request: R,
9905 options: gax::options::RequestOptions,
9906 }
9907
9908 impl<R> RequestBuilder<R>
9909 where
9910 R: std::default::Default,
9911 {
9912 pub(crate) fn new(
9913 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9914 ) -> Self {
9915 Self {
9916 stub,
9917 request: R::default(),
9918 options: gax::options::RequestOptions::default(),
9919 }
9920 }
9921 }
9922
9923 #[derive(Clone, Debug)]
9944 pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
9945
9946 impl ListPolicyBasedRoutes {
9947 pub(crate) fn new(
9948 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9949 ) -> Self {
9950 Self(RequestBuilder::new(stub))
9951 }
9952
9953 pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
9955 mut self,
9956 v: V,
9957 ) -> Self {
9958 self.0.request = v.into();
9959 self
9960 }
9961
9962 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9964 self.0.options = v.into();
9965 self
9966 }
9967
9968 pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
9970 (*self.0.stub)
9971 .list_policy_based_routes(self.0.request, self.0.options)
9972 .await
9973 .map(gax::response::Response::into_body)
9974 }
9975
9976 pub fn by_page(
9978 self,
9979 ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
9980 {
9981 use std::clone::Clone;
9982 let token = self.0.request.page_token.clone();
9983 let execute = move |token: String| {
9984 let mut builder = self.clone();
9985 builder.0.request = builder.0.request.set_page_token(token);
9986 builder.send()
9987 };
9988 gax::paginator::internal::new_paginator(token, execute)
9989 }
9990
9991 pub fn by_item(
9993 self,
9994 ) -> impl gax::paginator::ItemPaginator<
9995 crate::model::ListPolicyBasedRoutesResponse,
9996 gax::error::Error,
9997 > {
9998 use gax::paginator::Paginator;
9999 self.by_page().items()
10000 }
10001
10002 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10006 self.0.request.parent = v.into();
10007 self
10008 }
10009
10010 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10012 self.0.request.page_size = v.into();
10013 self
10014 }
10015
10016 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10018 self.0.request.page_token = v.into();
10019 self
10020 }
10021
10022 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10024 self.0.request.filter = v.into();
10025 self
10026 }
10027
10028 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10030 self.0.request.order_by = v.into();
10031 self
10032 }
10033 }
10034
10035 #[doc(hidden)]
10036 impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
10037 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10038 &mut self.0.options
10039 }
10040 }
10041
10042 #[derive(Clone, Debug)]
10059 pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10060
10061 impl GetPolicyBasedRoute {
10062 pub(crate) fn new(
10063 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10064 ) -> Self {
10065 Self(RequestBuilder::new(stub))
10066 }
10067
10068 pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10070 mut self,
10071 v: V,
10072 ) -> Self {
10073 self.0.request = v.into();
10074 self
10075 }
10076
10077 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10079 self.0.options = v.into();
10080 self
10081 }
10082
10083 pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10085 (*self.0.stub)
10086 .get_policy_based_route(self.0.request, self.0.options)
10087 .await
10088 .map(gax::response::Response::into_body)
10089 }
10090
10091 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10095 self.0.request.name = v.into();
10096 self
10097 }
10098 }
10099
10100 #[doc(hidden)]
10101 impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
10102 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10103 &mut self.0.options
10104 }
10105 }
10106
10107 #[derive(Clone, Debug)]
10125 pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10126
10127 impl CreatePolicyBasedRoute {
10128 pub(crate) fn new(
10129 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10130 ) -> Self {
10131 Self(RequestBuilder::new(stub))
10132 }
10133
10134 pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10136 mut self,
10137 v: V,
10138 ) -> Self {
10139 self.0.request = v.into();
10140 self
10141 }
10142
10143 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10145 self.0.options = v.into();
10146 self
10147 }
10148
10149 pub async fn send(self) -> Result<longrunning::model::Operation> {
10156 (*self.0.stub)
10157 .create_policy_based_route(self.0.request, self.0.options)
10158 .await
10159 .map(gax::response::Response::into_body)
10160 }
10161
10162 pub fn poller(
10164 self,
10165 ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10166 {
10167 type Operation = lro::internal::Operation<
10168 crate::model::PolicyBasedRoute,
10169 crate::model::OperationMetadata,
10170 >;
10171 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10172 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10173
10174 let stub = self.0.stub.clone();
10175 let mut options = self.0.options.clone();
10176 options.set_retry_policy(gax::retry_policy::NeverRetry);
10177 let query = move |name| {
10178 let stub = stub.clone();
10179 let options = options.clone();
10180 async {
10181 let op = GetOperation::new(stub)
10182 .set_name(name)
10183 .with_options(options)
10184 .send()
10185 .await?;
10186 Ok(Operation::new(op))
10187 }
10188 };
10189
10190 let start = move || async {
10191 let op = self.send().await?;
10192 Ok(Operation::new(op))
10193 };
10194
10195 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10196 }
10197
10198 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10202 self.0.request.parent = v.into();
10203 self
10204 }
10205
10206 pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10210 self.0.request.policy_based_route_id = v.into();
10211 self
10212 }
10213
10214 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10218 where
10219 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10220 {
10221 self.0.request.policy_based_route = std::option::Option::Some(v.into());
10222 self
10223 }
10224
10225 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10229 where
10230 T: std::convert::Into<crate::model::PolicyBasedRoute>,
10231 {
10232 self.0.request.policy_based_route = v.map(|x| x.into());
10233 self
10234 }
10235
10236 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10238 self.0.request.request_id = v.into();
10239 self
10240 }
10241 }
10242
10243 #[doc(hidden)]
10244 impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
10245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10246 &mut self.0.options
10247 }
10248 }
10249
10250 #[derive(Clone, Debug)]
10268 pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10269
10270 impl DeletePolicyBasedRoute {
10271 pub(crate) fn new(
10272 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10273 ) -> Self {
10274 Self(RequestBuilder::new(stub))
10275 }
10276
10277 pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10279 mut self,
10280 v: V,
10281 ) -> Self {
10282 self.0.request = v.into();
10283 self
10284 }
10285
10286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10288 self.0.options = v.into();
10289 self
10290 }
10291
10292 pub async fn send(self) -> Result<longrunning::model::Operation> {
10299 (*self.0.stub)
10300 .delete_policy_based_route(self.0.request, self.0.options)
10301 .await
10302 .map(gax::response::Response::into_body)
10303 }
10304
10305 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10307 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10308 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10309 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10310
10311 let stub = self.0.stub.clone();
10312 let mut options = self.0.options.clone();
10313 options.set_retry_policy(gax::retry_policy::NeverRetry);
10314 let query = move |name| {
10315 let stub = stub.clone();
10316 let options = options.clone();
10317 async {
10318 let op = GetOperation::new(stub)
10319 .set_name(name)
10320 .with_options(options)
10321 .send()
10322 .await?;
10323 Ok(Operation::new(op))
10324 }
10325 };
10326
10327 let start = move || async {
10328 let op = self.send().await?;
10329 Ok(Operation::new(op))
10330 };
10331
10332 lro::internal::new_unit_response_poller(
10333 polling_error_policy,
10334 polling_backoff_policy,
10335 start,
10336 query,
10337 )
10338 }
10339
10340 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10344 self.0.request.name = v.into();
10345 self
10346 }
10347
10348 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10350 self.0.request.request_id = v.into();
10351 self
10352 }
10353 }
10354
10355 #[doc(hidden)]
10356 impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
10357 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10358 &mut self.0.options
10359 }
10360 }
10361
10362 #[derive(Clone, Debug)]
10383 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10384
10385 impl ListLocations {
10386 pub(crate) fn new(
10387 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10388 ) -> Self {
10389 Self(RequestBuilder::new(stub))
10390 }
10391
10392 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10394 mut self,
10395 v: V,
10396 ) -> Self {
10397 self.0.request = v.into();
10398 self
10399 }
10400
10401 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10403 self.0.options = v.into();
10404 self
10405 }
10406
10407 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10409 (*self.0.stub)
10410 .list_locations(self.0.request, self.0.options)
10411 .await
10412 .map(gax::response::Response::into_body)
10413 }
10414
10415 pub fn by_page(
10417 self,
10418 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10419 {
10420 use std::clone::Clone;
10421 let token = self.0.request.page_token.clone();
10422 let execute = move |token: String| {
10423 let mut builder = self.clone();
10424 builder.0.request = builder.0.request.set_page_token(token);
10425 builder.send()
10426 };
10427 gax::paginator::internal::new_paginator(token, execute)
10428 }
10429
10430 pub fn by_item(
10432 self,
10433 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10434 {
10435 use gax::paginator::Paginator;
10436 self.by_page().items()
10437 }
10438
10439 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10441 self.0.request.name = v.into();
10442 self
10443 }
10444
10445 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10447 self.0.request.filter = v.into();
10448 self
10449 }
10450
10451 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10453 self.0.request.page_size = v.into();
10454 self
10455 }
10456
10457 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10459 self.0.request.page_token = v.into();
10460 self
10461 }
10462 }
10463
10464 #[doc(hidden)]
10465 impl gax::options::internal::RequestBuilder for ListLocations {
10466 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10467 &mut self.0.options
10468 }
10469 }
10470
10471 #[derive(Clone, Debug)]
10488 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10489
10490 impl GetLocation {
10491 pub(crate) fn new(
10492 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10493 ) -> Self {
10494 Self(RequestBuilder::new(stub))
10495 }
10496
10497 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10499 self.0.request = v.into();
10500 self
10501 }
10502
10503 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10505 self.0.options = v.into();
10506 self
10507 }
10508
10509 pub async fn send(self) -> Result<location::model::Location> {
10511 (*self.0.stub)
10512 .get_location(self.0.request, self.0.options)
10513 .await
10514 .map(gax::response::Response::into_body)
10515 }
10516
10517 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10519 self.0.request.name = v.into();
10520 self
10521 }
10522 }
10523
10524 #[doc(hidden)]
10525 impl gax::options::internal::RequestBuilder for GetLocation {
10526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10527 &mut self.0.options
10528 }
10529 }
10530
10531 #[derive(Clone, Debug)]
10548 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
10549
10550 impl SetIamPolicy {
10551 pub(crate) fn new(
10552 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10553 ) -> Self {
10554 Self(RequestBuilder::new(stub))
10555 }
10556
10557 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
10559 self.0.request = v.into();
10560 self
10561 }
10562
10563 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10565 self.0.options = v.into();
10566 self
10567 }
10568
10569 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10571 (*self.0.stub)
10572 .set_iam_policy(self.0.request, self.0.options)
10573 .await
10574 .map(gax::response::Response::into_body)
10575 }
10576
10577 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10581 self.0.request.resource = v.into();
10582 self
10583 }
10584
10585 pub fn set_policy<T>(mut self, v: T) -> Self
10589 where
10590 T: std::convert::Into<iam_v1::model::Policy>,
10591 {
10592 self.0.request.policy = std::option::Option::Some(v.into());
10593 self
10594 }
10595
10596 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10600 where
10601 T: std::convert::Into<iam_v1::model::Policy>,
10602 {
10603 self.0.request.policy = v.map(|x| x.into());
10604 self
10605 }
10606
10607 pub fn set_update_mask<T>(mut self, v: T) -> Self
10609 where
10610 T: std::convert::Into<wkt::FieldMask>,
10611 {
10612 self.0.request.update_mask = std::option::Option::Some(v.into());
10613 self
10614 }
10615
10616 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10618 where
10619 T: std::convert::Into<wkt::FieldMask>,
10620 {
10621 self.0.request.update_mask = v.map(|x| x.into());
10622 self
10623 }
10624 }
10625
10626 #[doc(hidden)]
10627 impl gax::options::internal::RequestBuilder for SetIamPolicy {
10628 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10629 &mut self.0.options
10630 }
10631 }
10632
10633 #[derive(Clone, Debug)]
10650 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
10651
10652 impl GetIamPolicy {
10653 pub(crate) fn new(
10654 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10655 ) -> Self {
10656 Self(RequestBuilder::new(stub))
10657 }
10658
10659 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
10661 self.0.request = v.into();
10662 self
10663 }
10664
10665 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10667 self.0.options = v.into();
10668 self
10669 }
10670
10671 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10673 (*self.0.stub)
10674 .get_iam_policy(self.0.request, self.0.options)
10675 .await
10676 .map(gax::response::Response::into_body)
10677 }
10678
10679 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10683 self.0.request.resource = v.into();
10684 self
10685 }
10686
10687 pub fn set_options<T>(mut self, v: T) -> Self
10689 where
10690 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10691 {
10692 self.0.request.options = std::option::Option::Some(v.into());
10693 self
10694 }
10695
10696 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10698 where
10699 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10700 {
10701 self.0.request.options = v.map(|x| x.into());
10702 self
10703 }
10704 }
10705
10706 #[doc(hidden)]
10707 impl gax::options::internal::RequestBuilder for GetIamPolicy {
10708 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10709 &mut self.0.options
10710 }
10711 }
10712
10713 #[derive(Clone, Debug)]
10730 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
10731
10732 impl TestIamPermissions {
10733 pub(crate) fn new(
10734 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10735 ) -> Self {
10736 Self(RequestBuilder::new(stub))
10737 }
10738
10739 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
10741 mut self,
10742 v: V,
10743 ) -> Self {
10744 self.0.request = v.into();
10745 self
10746 }
10747
10748 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10750 self.0.options = v.into();
10751 self
10752 }
10753
10754 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
10756 (*self.0.stub)
10757 .test_iam_permissions(self.0.request, self.0.options)
10758 .await
10759 .map(gax::response::Response::into_body)
10760 }
10761
10762 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10766 self.0.request.resource = v.into();
10767 self
10768 }
10769
10770 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10774 where
10775 T: std::iter::IntoIterator<Item = V>,
10776 V: std::convert::Into<std::string::String>,
10777 {
10778 use std::iter::Iterator;
10779 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10780 self
10781 }
10782 }
10783
10784 #[doc(hidden)]
10785 impl gax::options::internal::RequestBuilder for TestIamPermissions {
10786 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10787 &mut self.0.options
10788 }
10789 }
10790
10791 #[derive(Clone, Debug)]
10812 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10813
10814 impl ListOperations {
10815 pub(crate) fn new(
10816 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10817 ) -> Self {
10818 Self(RequestBuilder::new(stub))
10819 }
10820
10821 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10823 mut self,
10824 v: V,
10825 ) -> Self {
10826 self.0.request = v.into();
10827 self
10828 }
10829
10830 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10832 self.0.options = v.into();
10833 self
10834 }
10835
10836 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10838 (*self.0.stub)
10839 .list_operations(self.0.request, self.0.options)
10840 .await
10841 .map(gax::response::Response::into_body)
10842 }
10843
10844 pub fn by_page(
10846 self,
10847 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10848 {
10849 use std::clone::Clone;
10850 let token = self.0.request.page_token.clone();
10851 let execute = move |token: String| {
10852 let mut builder = self.clone();
10853 builder.0.request = builder.0.request.set_page_token(token);
10854 builder.send()
10855 };
10856 gax::paginator::internal::new_paginator(token, execute)
10857 }
10858
10859 pub fn by_item(
10861 self,
10862 ) -> impl gax::paginator::ItemPaginator<
10863 longrunning::model::ListOperationsResponse,
10864 gax::error::Error,
10865 > {
10866 use gax::paginator::Paginator;
10867 self.by_page().items()
10868 }
10869
10870 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10872 self.0.request.name = v.into();
10873 self
10874 }
10875
10876 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10878 self.0.request.filter = v.into();
10879 self
10880 }
10881
10882 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10884 self.0.request.page_size = v.into();
10885 self
10886 }
10887
10888 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10890 self.0.request.page_token = v.into();
10891 self
10892 }
10893
10894 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10896 self.0.request.return_partial_success = v.into();
10897 self
10898 }
10899 }
10900
10901 #[doc(hidden)]
10902 impl gax::options::internal::RequestBuilder for ListOperations {
10903 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10904 &mut self.0.options
10905 }
10906 }
10907
10908 #[derive(Clone, Debug)]
10925 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
10926
10927 impl GetOperation {
10928 pub(crate) fn new(
10929 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10930 ) -> Self {
10931 Self(RequestBuilder::new(stub))
10932 }
10933
10934 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
10936 mut self,
10937 v: V,
10938 ) -> Self {
10939 self.0.request = v.into();
10940 self
10941 }
10942
10943 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10945 self.0.options = v.into();
10946 self
10947 }
10948
10949 pub async fn send(self) -> Result<longrunning::model::Operation> {
10951 (*self.0.stub)
10952 .get_operation(self.0.request, self.0.options)
10953 .await
10954 .map(gax::response::Response::into_body)
10955 }
10956
10957 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10959 self.0.request.name = v.into();
10960 self
10961 }
10962 }
10963
10964 #[doc(hidden)]
10965 impl gax::options::internal::RequestBuilder for GetOperation {
10966 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10967 &mut self.0.options
10968 }
10969 }
10970
10971 #[derive(Clone, Debug)]
10988 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
10989
10990 impl DeleteOperation {
10991 pub(crate) fn new(
10992 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10993 ) -> Self {
10994 Self(RequestBuilder::new(stub))
10995 }
10996
10997 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
10999 mut self,
11000 v: V,
11001 ) -> Self {
11002 self.0.request = v.into();
11003 self
11004 }
11005
11006 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11008 self.0.options = v.into();
11009 self
11010 }
11011
11012 pub async fn send(self) -> Result<()> {
11014 (*self.0.stub)
11015 .delete_operation(self.0.request, self.0.options)
11016 .await
11017 .map(gax::response::Response::into_body)
11018 }
11019
11020 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11022 self.0.request.name = v.into();
11023 self
11024 }
11025 }
11026
11027 #[doc(hidden)]
11028 impl gax::options::internal::RequestBuilder for DeleteOperation {
11029 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11030 &mut self.0.options
11031 }
11032 }
11033
11034 #[derive(Clone, Debug)]
11051 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11052
11053 impl CancelOperation {
11054 pub(crate) fn new(
11055 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11056 ) -> Self {
11057 Self(RequestBuilder::new(stub))
11058 }
11059
11060 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11062 mut self,
11063 v: V,
11064 ) -> Self {
11065 self.0.request = v.into();
11066 self
11067 }
11068
11069 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11071 self.0.options = v.into();
11072 self
11073 }
11074
11075 pub async fn send(self) -> Result<()> {
11077 (*self.0.stub)
11078 .cancel_operation(self.0.request, self.0.options)
11079 .await
11080 .map(gax::response::Response::into_body)
11081 }
11082
11083 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11085 self.0.request.name = v.into();
11086 self
11087 }
11088 }
11089
11090 #[doc(hidden)]
11091 impl gax::options::internal::RequestBuilder for CancelOperation {
11092 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11093 &mut self.0.options
11094 }
11095 }
11096}