1pub mod connectors {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::Connectors;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = Connectors;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
95
96 impl ListConnections {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
117 (*self.0.stub)
118 .list_connections(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn by_page(
125 self,
126 ) -> impl google_cloud_gax::paginator::Paginator<
127 crate::model::ListConnectionsResponse,
128 crate::Error,
129 > {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 google_cloud_gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl google_cloud_gax::paginator::ItemPaginator<
144 crate::model::ListConnectionsResponse,
145 crate::Error,
146 > {
147 use google_cloud_gax::paginator::Paginator;
148 self.by_page().items()
149 }
150
151 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
155 self.0.request.parent = v.into();
156 self
157 }
158
159 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
161 self.0.request.page_size = v.into();
162 self
163 }
164
165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
167 self.0.request.page_token = v.into();
168 self
169 }
170
171 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
173 self.0.request.filter = v.into();
174 self
175 }
176
177 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
179 self.0.request.order_by = v.into();
180 self
181 }
182
183 pub fn set_view<T: Into<crate::model::ConnectionView>>(mut self, v: T) -> Self {
185 self.0.request.view = v.into();
186 self
187 }
188 }
189
190 #[doc(hidden)]
191 impl crate::RequestBuilder for ListConnections {
192 fn request_options(&mut self) -> &mut crate::RequestOptions {
193 &mut self.0.options
194 }
195 }
196
197 #[derive(Clone, Debug)]
214 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
215
216 impl GetConnection {
217 pub(crate) fn new(
218 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
219 ) -> Self {
220 Self(RequestBuilder::new(stub))
221 }
222
223 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
225 self.0.request = v.into();
226 self
227 }
228
229 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
231 self.0.options = v.into();
232 self
233 }
234
235 pub async fn send(self) -> Result<crate::model::Connection> {
237 (*self.0.stub)
238 .get_connection(self.0.request, self.0.options)
239 .await
240 .map(crate::Response::into_body)
241 }
242
243 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
247 self.0.request.name = v.into();
248 self
249 }
250
251 pub fn set_view<T: Into<crate::model::ConnectionView>>(mut self, v: T) -> Self {
253 self.0.request.view = v.into();
254 self
255 }
256 }
257
258 #[doc(hidden)]
259 impl crate::RequestBuilder for GetConnection {
260 fn request_options(&mut self) -> &mut crate::RequestOptions {
261 &mut self.0.options
262 }
263 }
264
265 #[derive(Clone, Debug)]
283 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
284
285 impl CreateConnection {
286 pub(crate) fn new(
287 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
288 ) -> Self {
289 Self(RequestBuilder::new(stub))
290 }
291
292 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
294 mut self,
295 v: V,
296 ) -> Self {
297 self.0.request = v.into();
298 self
299 }
300
301 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
303 self.0.options = v.into();
304 self
305 }
306
307 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
314 (*self.0.stub)
315 .create_connection(self.0.request, self.0.options)
316 .await
317 .map(crate::Response::into_body)
318 }
319
320 pub fn poller(
322 self,
323 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
324 {
325 type Operation = google_cloud_lro::internal::Operation<
326 crate::model::Connection,
327 crate::model::OperationMetadata,
328 >;
329 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
330 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
331
332 let stub = self.0.stub.clone();
333 let mut options = self.0.options.clone();
334 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
335 let query = move |name| {
336 let stub = stub.clone();
337 let options = options.clone();
338 async {
339 let op = GetOperation::new(stub)
340 .set_name(name)
341 .with_options(options)
342 .send()
343 .await?;
344 Ok(Operation::new(op))
345 }
346 };
347
348 let start = move || async {
349 let op = self.send().await?;
350 Ok(Operation::new(op))
351 };
352
353 google_cloud_lro::internal::new_poller(
354 polling_error_policy,
355 polling_backoff_policy,
356 start,
357 query,
358 )
359 }
360
361 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
365 self.0.request.parent = v.into();
366 self
367 }
368
369 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
373 self.0.request.connection_id = v.into();
374 self
375 }
376
377 pub fn set_connection<T>(mut self, v: T) -> Self
381 where
382 T: std::convert::Into<crate::model::Connection>,
383 {
384 self.0.request.connection = std::option::Option::Some(v.into());
385 self
386 }
387
388 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
392 where
393 T: std::convert::Into<crate::model::Connection>,
394 {
395 self.0.request.connection = v.map(|x| x.into());
396 self
397 }
398 }
399
400 #[doc(hidden)]
401 impl crate::RequestBuilder for CreateConnection {
402 fn request_options(&mut self) -> &mut crate::RequestOptions {
403 &mut self.0.options
404 }
405 }
406
407 #[derive(Clone, Debug)]
425 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
426
427 impl UpdateConnection {
428 pub(crate) fn new(
429 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
430 ) -> Self {
431 Self(RequestBuilder::new(stub))
432 }
433
434 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
436 mut self,
437 v: V,
438 ) -> Self {
439 self.0.request = v.into();
440 self
441 }
442
443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
445 self.0.options = v.into();
446 self
447 }
448
449 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
456 (*self.0.stub)
457 .update_connection(self.0.request, self.0.options)
458 .await
459 .map(crate::Response::into_body)
460 }
461
462 pub fn poller(
464 self,
465 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
466 {
467 type Operation = google_cloud_lro::internal::Operation<
468 crate::model::Connection,
469 crate::model::OperationMetadata,
470 >;
471 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
472 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
473
474 let stub = self.0.stub.clone();
475 let mut options = self.0.options.clone();
476 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
477 let query = move |name| {
478 let stub = stub.clone();
479 let options = options.clone();
480 async {
481 let op = GetOperation::new(stub)
482 .set_name(name)
483 .with_options(options)
484 .send()
485 .await?;
486 Ok(Operation::new(op))
487 }
488 };
489
490 let start = move || async {
491 let op = self.send().await?;
492 Ok(Operation::new(op))
493 };
494
495 google_cloud_lro::internal::new_poller(
496 polling_error_policy,
497 polling_backoff_policy,
498 start,
499 query,
500 )
501 }
502
503 pub fn set_connection<T>(mut self, v: T) -> Self
507 where
508 T: std::convert::Into<crate::model::Connection>,
509 {
510 self.0.request.connection = std::option::Option::Some(v.into());
511 self
512 }
513
514 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
518 where
519 T: std::convert::Into<crate::model::Connection>,
520 {
521 self.0.request.connection = v.map(|x| x.into());
522 self
523 }
524
525 pub fn set_update_mask<T>(mut self, v: T) -> Self
529 where
530 T: std::convert::Into<wkt::FieldMask>,
531 {
532 self.0.request.update_mask = std::option::Option::Some(v.into());
533 self
534 }
535
536 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
540 where
541 T: std::convert::Into<wkt::FieldMask>,
542 {
543 self.0.request.update_mask = v.map(|x| x.into());
544 self
545 }
546 }
547
548 #[doc(hidden)]
549 impl crate::RequestBuilder for UpdateConnection {
550 fn request_options(&mut self) -> &mut crate::RequestOptions {
551 &mut self.0.options
552 }
553 }
554
555 #[derive(Clone, Debug)]
573 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
574
575 impl DeleteConnection {
576 pub(crate) fn new(
577 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
578 ) -> Self {
579 Self(RequestBuilder::new(stub))
580 }
581
582 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
584 mut self,
585 v: V,
586 ) -> Self {
587 self.0.request = v.into();
588 self
589 }
590
591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
593 self.0.options = v.into();
594 self
595 }
596
597 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
604 (*self.0.stub)
605 .delete_connection(self.0.request, self.0.options)
606 .await
607 .map(crate::Response::into_body)
608 }
609
610 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
612 type Operation =
613 google_cloud_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(google_cloud_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 google_cloud_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
655 #[doc(hidden)]
656 impl crate::RequestBuilder for DeleteConnection {
657 fn request_options(&mut self) -> &mut crate::RequestOptions {
658 &mut self.0.options
659 }
660 }
661
662 #[derive(Clone, Debug)]
683 pub struct ListProviders(RequestBuilder<crate::model::ListProvidersRequest>);
684
685 impl ListProviders {
686 pub(crate) fn new(
687 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
688 ) -> Self {
689 Self(RequestBuilder::new(stub))
690 }
691
692 pub fn with_request<V: Into<crate::model::ListProvidersRequest>>(mut self, v: V) -> Self {
694 self.0.request = v.into();
695 self
696 }
697
698 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
700 self.0.options = v.into();
701 self
702 }
703
704 pub async fn send(self) -> Result<crate::model::ListProvidersResponse> {
706 (*self.0.stub)
707 .list_providers(self.0.request, self.0.options)
708 .await
709 .map(crate::Response::into_body)
710 }
711
712 pub fn by_page(
714 self,
715 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListProvidersResponse, crate::Error>
716 {
717 use std::clone::Clone;
718 let token = self.0.request.page_token.clone();
719 let execute = move |token: String| {
720 let mut builder = self.clone();
721 builder.0.request = builder.0.request.set_page_token(token);
722 builder.send()
723 };
724 google_cloud_gax::paginator::internal::new_paginator(token, execute)
725 }
726
727 pub fn by_item(
729 self,
730 ) -> impl google_cloud_gax::paginator::ItemPaginator<
731 crate::model::ListProvidersResponse,
732 crate::Error,
733 > {
734 use google_cloud_gax::paginator::Paginator;
735 self.by_page().items()
736 }
737
738 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
742 self.0.request.parent = v.into();
743 self
744 }
745
746 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
748 self.0.request.page_size = v.into();
749 self
750 }
751
752 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
754 self.0.request.page_token = v.into();
755 self
756 }
757 }
758
759 #[doc(hidden)]
760 impl crate::RequestBuilder for ListProviders {
761 fn request_options(&mut self) -> &mut crate::RequestOptions {
762 &mut self.0.options
763 }
764 }
765
766 #[derive(Clone, Debug)]
783 pub struct GetProvider(RequestBuilder<crate::model::GetProviderRequest>);
784
785 impl GetProvider {
786 pub(crate) fn new(
787 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
788 ) -> Self {
789 Self(RequestBuilder::new(stub))
790 }
791
792 pub fn with_request<V: Into<crate::model::GetProviderRequest>>(mut self, v: V) -> Self {
794 self.0.request = v.into();
795 self
796 }
797
798 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
800 self.0.options = v.into();
801 self
802 }
803
804 pub async fn send(self) -> Result<crate::model::Provider> {
806 (*self.0.stub)
807 .get_provider(self.0.request, self.0.options)
808 .await
809 .map(crate::Response::into_body)
810 }
811
812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
816 self.0.request.name = v.into();
817 self
818 }
819 }
820
821 #[doc(hidden)]
822 impl crate::RequestBuilder for GetProvider {
823 fn request_options(&mut self) -> &mut crate::RequestOptions {
824 &mut self.0.options
825 }
826 }
827
828 #[derive(Clone, Debug)]
849 pub struct ListConnectors(RequestBuilder<crate::model::ListConnectorsRequest>);
850
851 impl ListConnectors {
852 pub(crate) fn new(
853 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
854 ) -> Self {
855 Self(RequestBuilder::new(stub))
856 }
857
858 pub fn with_request<V: Into<crate::model::ListConnectorsRequest>>(mut self, v: V) -> Self {
860 self.0.request = v.into();
861 self
862 }
863
864 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
866 self.0.options = v.into();
867 self
868 }
869
870 pub async fn send(self) -> Result<crate::model::ListConnectorsResponse> {
872 (*self.0.stub)
873 .list_connectors(self.0.request, self.0.options)
874 .await
875 .map(crate::Response::into_body)
876 }
877
878 pub fn by_page(
880 self,
881 ) -> impl google_cloud_gax::paginator::Paginator<
882 crate::model::ListConnectorsResponse,
883 crate::Error,
884 > {
885 use std::clone::Clone;
886 let token = self.0.request.page_token.clone();
887 let execute = move |token: String| {
888 let mut builder = self.clone();
889 builder.0.request = builder.0.request.set_page_token(token);
890 builder.send()
891 };
892 google_cloud_gax::paginator::internal::new_paginator(token, execute)
893 }
894
895 pub fn by_item(
897 self,
898 ) -> impl google_cloud_gax::paginator::ItemPaginator<
899 crate::model::ListConnectorsResponse,
900 crate::Error,
901 > {
902 use google_cloud_gax::paginator::Paginator;
903 self.by_page().items()
904 }
905
906 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
910 self.0.request.parent = v.into();
911 self
912 }
913
914 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
916 self.0.request.page_size = v.into();
917 self
918 }
919
920 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
922 self.0.request.page_token = v.into();
923 self
924 }
925 }
926
927 #[doc(hidden)]
928 impl crate::RequestBuilder for ListConnectors {
929 fn request_options(&mut self) -> &mut crate::RequestOptions {
930 &mut self.0.options
931 }
932 }
933
934 #[derive(Clone, Debug)]
951 pub struct GetConnector(RequestBuilder<crate::model::GetConnectorRequest>);
952
953 impl GetConnector {
954 pub(crate) fn new(
955 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
956 ) -> Self {
957 Self(RequestBuilder::new(stub))
958 }
959
960 pub fn with_request<V: Into<crate::model::GetConnectorRequest>>(mut self, v: V) -> Self {
962 self.0.request = v.into();
963 self
964 }
965
966 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
968 self.0.options = v.into();
969 self
970 }
971
972 pub async fn send(self) -> Result<crate::model::Connector> {
974 (*self.0.stub)
975 .get_connector(self.0.request, self.0.options)
976 .await
977 .map(crate::Response::into_body)
978 }
979
980 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
984 self.0.request.name = v.into();
985 self
986 }
987 }
988
989 #[doc(hidden)]
990 impl crate::RequestBuilder for GetConnector {
991 fn request_options(&mut self) -> &mut crate::RequestOptions {
992 &mut self.0.options
993 }
994 }
995
996 #[derive(Clone, Debug)]
1017 pub struct ListConnectorVersions(RequestBuilder<crate::model::ListConnectorVersionsRequest>);
1018
1019 impl ListConnectorVersions {
1020 pub(crate) fn new(
1021 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1022 ) -> Self {
1023 Self(RequestBuilder::new(stub))
1024 }
1025
1026 pub fn with_request<V: Into<crate::model::ListConnectorVersionsRequest>>(
1028 mut self,
1029 v: V,
1030 ) -> Self {
1031 self.0.request = v.into();
1032 self
1033 }
1034
1035 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1037 self.0.options = v.into();
1038 self
1039 }
1040
1041 pub async fn send(self) -> Result<crate::model::ListConnectorVersionsResponse> {
1043 (*self.0.stub)
1044 .list_connector_versions(self.0.request, self.0.options)
1045 .await
1046 .map(crate::Response::into_body)
1047 }
1048
1049 pub fn by_page(
1051 self,
1052 ) -> impl google_cloud_gax::paginator::Paginator<
1053 crate::model::ListConnectorVersionsResponse,
1054 crate::Error,
1055 > {
1056 use std::clone::Clone;
1057 let token = self.0.request.page_token.clone();
1058 let execute = move |token: String| {
1059 let mut builder = self.clone();
1060 builder.0.request = builder.0.request.set_page_token(token);
1061 builder.send()
1062 };
1063 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1064 }
1065
1066 pub fn by_item(
1068 self,
1069 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1070 crate::model::ListConnectorVersionsResponse,
1071 crate::Error,
1072 > {
1073 use google_cloud_gax::paginator::Paginator;
1074 self.by_page().items()
1075 }
1076
1077 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1081 self.0.request.parent = v.into();
1082 self
1083 }
1084
1085 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1087 self.0.request.page_size = v.into();
1088 self
1089 }
1090
1091 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1093 self.0.request.page_token = v.into();
1094 self
1095 }
1096
1097 pub fn set_view<T: Into<crate::model::ConnectorVersionView>>(mut self, v: T) -> Self {
1099 self.0.request.view = v.into();
1100 self
1101 }
1102 }
1103
1104 #[doc(hidden)]
1105 impl crate::RequestBuilder for ListConnectorVersions {
1106 fn request_options(&mut self) -> &mut crate::RequestOptions {
1107 &mut self.0.options
1108 }
1109 }
1110
1111 #[derive(Clone, Debug)]
1128 pub struct GetConnectorVersion(RequestBuilder<crate::model::GetConnectorVersionRequest>);
1129
1130 impl GetConnectorVersion {
1131 pub(crate) fn new(
1132 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1133 ) -> Self {
1134 Self(RequestBuilder::new(stub))
1135 }
1136
1137 pub fn with_request<V: Into<crate::model::GetConnectorVersionRequest>>(
1139 mut self,
1140 v: V,
1141 ) -> Self {
1142 self.0.request = v.into();
1143 self
1144 }
1145
1146 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1148 self.0.options = v.into();
1149 self
1150 }
1151
1152 pub async fn send(self) -> Result<crate::model::ConnectorVersion> {
1154 (*self.0.stub)
1155 .get_connector_version(self.0.request, self.0.options)
1156 .await
1157 .map(crate::Response::into_body)
1158 }
1159
1160 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1164 self.0.request.name = v.into();
1165 self
1166 }
1167
1168 pub fn set_view<T: Into<crate::model::ConnectorVersionView>>(mut self, v: T) -> Self {
1170 self.0.request.view = v.into();
1171 self
1172 }
1173 }
1174
1175 #[doc(hidden)]
1176 impl crate::RequestBuilder for GetConnectorVersion {
1177 fn request_options(&mut self) -> &mut crate::RequestOptions {
1178 &mut self.0.options
1179 }
1180 }
1181
1182 #[derive(Clone, Debug)]
1199 pub struct GetConnectionSchemaMetadata(
1200 RequestBuilder<crate::model::GetConnectionSchemaMetadataRequest>,
1201 );
1202
1203 impl GetConnectionSchemaMetadata {
1204 pub(crate) fn new(
1205 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1206 ) -> Self {
1207 Self(RequestBuilder::new(stub))
1208 }
1209
1210 pub fn with_request<V: Into<crate::model::GetConnectionSchemaMetadataRequest>>(
1212 mut self,
1213 v: V,
1214 ) -> Self {
1215 self.0.request = v.into();
1216 self
1217 }
1218
1219 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1221 self.0.options = v.into();
1222 self
1223 }
1224
1225 pub async fn send(self) -> Result<crate::model::ConnectionSchemaMetadata> {
1227 (*self.0.stub)
1228 .get_connection_schema_metadata(self.0.request, self.0.options)
1229 .await
1230 .map(crate::Response::into_body)
1231 }
1232
1233 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1237 self.0.request.name = v.into();
1238 self
1239 }
1240 }
1241
1242 #[doc(hidden)]
1243 impl crate::RequestBuilder for GetConnectionSchemaMetadata {
1244 fn request_options(&mut self) -> &mut crate::RequestOptions {
1245 &mut self.0.options
1246 }
1247 }
1248
1249 #[derive(Clone, Debug)]
1267 pub struct RefreshConnectionSchemaMetadata(
1268 RequestBuilder<crate::model::RefreshConnectionSchemaMetadataRequest>,
1269 );
1270
1271 impl RefreshConnectionSchemaMetadata {
1272 pub(crate) fn new(
1273 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1274 ) -> Self {
1275 Self(RequestBuilder::new(stub))
1276 }
1277
1278 pub fn with_request<V: Into<crate::model::RefreshConnectionSchemaMetadataRequest>>(
1280 mut self,
1281 v: V,
1282 ) -> Self {
1283 self.0.request = v.into();
1284 self
1285 }
1286
1287 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1289 self.0.options = v.into();
1290 self
1291 }
1292
1293 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1300 (*self.0.stub)
1301 .refresh_connection_schema_metadata(self.0.request, self.0.options)
1302 .await
1303 .map(crate::Response::into_body)
1304 }
1305
1306 pub fn poller(
1308 self,
1309 ) -> impl google_cloud_lro::Poller<
1310 crate::model::ConnectionSchemaMetadata,
1311 crate::model::OperationMetadata,
1312 > {
1313 type Operation = google_cloud_lro::internal::Operation<
1314 crate::model::ConnectionSchemaMetadata,
1315 crate::model::OperationMetadata,
1316 >;
1317 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1318 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1319
1320 let stub = self.0.stub.clone();
1321 let mut options = self.0.options.clone();
1322 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1323 let query = move |name| {
1324 let stub = stub.clone();
1325 let options = options.clone();
1326 async {
1327 let op = GetOperation::new(stub)
1328 .set_name(name)
1329 .with_options(options)
1330 .send()
1331 .await?;
1332 Ok(Operation::new(op))
1333 }
1334 };
1335
1336 let start = move || async {
1337 let op = self.send().await?;
1338 Ok(Operation::new(op))
1339 };
1340
1341 google_cloud_lro::internal::new_poller(
1342 polling_error_policy,
1343 polling_backoff_policy,
1344 start,
1345 query,
1346 )
1347 }
1348
1349 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1353 self.0.request.name = v.into();
1354 self
1355 }
1356 }
1357
1358 #[doc(hidden)]
1359 impl crate::RequestBuilder for RefreshConnectionSchemaMetadata {
1360 fn request_options(&mut self) -> &mut crate::RequestOptions {
1361 &mut self.0.options
1362 }
1363 }
1364
1365 #[derive(Clone, Debug)]
1386 pub struct ListRuntimeEntitySchemas(
1387 RequestBuilder<crate::model::ListRuntimeEntitySchemasRequest>,
1388 );
1389
1390 impl ListRuntimeEntitySchemas {
1391 pub(crate) fn new(
1392 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1393 ) -> Self {
1394 Self(RequestBuilder::new(stub))
1395 }
1396
1397 pub fn with_request<V: Into<crate::model::ListRuntimeEntitySchemasRequest>>(
1399 mut self,
1400 v: V,
1401 ) -> Self {
1402 self.0.request = v.into();
1403 self
1404 }
1405
1406 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1408 self.0.options = v.into();
1409 self
1410 }
1411
1412 pub async fn send(self) -> Result<crate::model::ListRuntimeEntitySchemasResponse> {
1414 (*self.0.stub)
1415 .list_runtime_entity_schemas(self.0.request, self.0.options)
1416 .await
1417 .map(crate::Response::into_body)
1418 }
1419
1420 pub fn by_page(
1422 self,
1423 ) -> impl google_cloud_gax::paginator::Paginator<
1424 crate::model::ListRuntimeEntitySchemasResponse,
1425 crate::Error,
1426 > {
1427 use std::clone::Clone;
1428 let token = self.0.request.page_token.clone();
1429 let execute = move |token: String| {
1430 let mut builder = self.clone();
1431 builder.0.request = builder.0.request.set_page_token(token);
1432 builder.send()
1433 };
1434 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1435 }
1436
1437 pub fn by_item(
1439 self,
1440 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1441 crate::model::ListRuntimeEntitySchemasResponse,
1442 crate::Error,
1443 > {
1444 use google_cloud_gax::paginator::Paginator;
1445 self.by_page().items()
1446 }
1447
1448 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1452 self.0.request.parent = v.into();
1453 self
1454 }
1455
1456 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1458 self.0.request.page_size = v.into();
1459 self
1460 }
1461
1462 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1464 self.0.request.page_token = v.into();
1465 self
1466 }
1467
1468 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1472 self.0.request.filter = v.into();
1473 self
1474 }
1475 }
1476
1477 #[doc(hidden)]
1478 impl crate::RequestBuilder for ListRuntimeEntitySchemas {
1479 fn request_options(&mut self) -> &mut crate::RequestOptions {
1480 &mut self.0.options
1481 }
1482 }
1483
1484 #[derive(Clone, Debug)]
1505 pub struct ListRuntimeActionSchemas(
1506 RequestBuilder<crate::model::ListRuntimeActionSchemasRequest>,
1507 );
1508
1509 impl ListRuntimeActionSchemas {
1510 pub(crate) fn new(
1511 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1512 ) -> Self {
1513 Self(RequestBuilder::new(stub))
1514 }
1515
1516 pub fn with_request<V: Into<crate::model::ListRuntimeActionSchemasRequest>>(
1518 mut self,
1519 v: V,
1520 ) -> Self {
1521 self.0.request = v.into();
1522 self
1523 }
1524
1525 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1527 self.0.options = v.into();
1528 self
1529 }
1530
1531 pub async fn send(self) -> Result<crate::model::ListRuntimeActionSchemasResponse> {
1533 (*self.0.stub)
1534 .list_runtime_action_schemas(self.0.request, self.0.options)
1535 .await
1536 .map(crate::Response::into_body)
1537 }
1538
1539 pub fn by_page(
1541 self,
1542 ) -> impl google_cloud_gax::paginator::Paginator<
1543 crate::model::ListRuntimeActionSchemasResponse,
1544 crate::Error,
1545 > {
1546 use std::clone::Clone;
1547 let token = self.0.request.page_token.clone();
1548 let execute = move |token: String| {
1549 let mut builder = self.clone();
1550 builder.0.request = builder.0.request.set_page_token(token);
1551 builder.send()
1552 };
1553 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1554 }
1555
1556 pub fn by_item(
1558 self,
1559 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1560 crate::model::ListRuntimeActionSchemasResponse,
1561 crate::Error,
1562 > {
1563 use google_cloud_gax::paginator::Paginator;
1564 self.by_page().items()
1565 }
1566
1567 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1571 self.0.request.parent = v.into();
1572 self
1573 }
1574
1575 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1577 self.0.request.page_size = v.into();
1578 self
1579 }
1580
1581 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1583 self.0.request.page_token = v.into();
1584 self
1585 }
1586
1587 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1591 self.0.request.filter = v.into();
1592 self
1593 }
1594 }
1595
1596 #[doc(hidden)]
1597 impl crate::RequestBuilder for ListRuntimeActionSchemas {
1598 fn request_options(&mut self) -> &mut crate::RequestOptions {
1599 &mut self.0.options
1600 }
1601 }
1602
1603 #[derive(Clone, Debug)]
1620 pub struct GetRuntimeConfig(RequestBuilder<crate::model::GetRuntimeConfigRequest>);
1621
1622 impl GetRuntimeConfig {
1623 pub(crate) fn new(
1624 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1625 ) -> Self {
1626 Self(RequestBuilder::new(stub))
1627 }
1628
1629 pub fn with_request<V: Into<crate::model::GetRuntimeConfigRequest>>(
1631 mut self,
1632 v: V,
1633 ) -> Self {
1634 self.0.request = v.into();
1635 self
1636 }
1637
1638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1640 self.0.options = v.into();
1641 self
1642 }
1643
1644 pub async fn send(self) -> Result<crate::model::RuntimeConfig> {
1646 (*self.0.stub)
1647 .get_runtime_config(self.0.request, self.0.options)
1648 .await
1649 .map(crate::Response::into_body)
1650 }
1651
1652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.0.request.name = v.into();
1657 self
1658 }
1659 }
1660
1661 #[doc(hidden)]
1662 impl crate::RequestBuilder for GetRuntimeConfig {
1663 fn request_options(&mut self) -> &mut crate::RequestOptions {
1664 &mut self.0.options
1665 }
1666 }
1667
1668 #[derive(Clone, Debug)]
1685 pub struct GetGlobalSettings(RequestBuilder<crate::model::GetGlobalSettingsRequest>);
1686
1687 impl GetGlobalSettings {
1688 pub(crate) fn new(
1689 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1690 ) -> Self {
1691 Self(RequestBuilder::new(stub))
1692 }
1693
1694 pub fn with_request<V: Into<crate::model::GetGlobalSettingsRequest>>(
1696 mut self,
1697 v: V,
1698 ) -> Self {
1699 self.0.request = v.into();
1700 self
1701 }
1702
1703 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1705 self.0.options = v.into();
1706 self
1707 }
1708
1709 pub async fn send(self) -> Result<crate::model::Settings> {
1711 (*self.0.stub)
1712 .get_global_settings(self.0.request, self.0.options)
1713 .await
1714 .map(crate::Response::into_body)
1715 }
1716
1717 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1721 self.0.request.name = v.into();
1722 self
1723 }
1724 }
1725
1726 #[doc(hidden)]
1727 impl crate::RequestBuilder for GetGlobalSettings {
1728 fn request_options(&mut self) -> &mut crate::RequestOptions {
1729 &mut self.0.options
1730 }
1731 }
1732
1733 #[derive(Clone, Debug)]
1754 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1755
1756 impl ListLocations {
1757 pub(crate) fn new(
1758 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1759 ) -> Self {
1760 Self(RequestBuilder::new(stub))
1761 }
1762
1763 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1765 mut self,
1766 v: V,
1767 ) -> Self {
1768 self.0.request = v.into();
1769 self
1770 }
1771
1772 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1774 self.0.options = v.into();
1775 self
1776 }
1777
1778 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1780 (*self.0.stub)
1781 .list_locations(self.0.request, self.0.options)
1782 .await
1783 .map(crate::Response::into_body)
1784 }
1785
1786 pub fn by_page(
1788 self,
1789 ) -> impl google_cloud_gax::paginator::Paginator<
1790 google_cloud_location::model::ListLocationsResponse,
1791 crate::Error,
1792 > {
1793 use std::clone::Clone;
1794 let token = self.0.request.page_token.clone();
1795 let execute = move |token: String| {
1796 let mut builder = self.clone();
1797 builder.0.request = builder.0.request.set_page_token(token);
1798 builder.send()
1799 };
1800 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1801 }
1802
1803 pub fn by_item(
1805 self,
1806 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1807 google_cloud_location::model::ListLocationsResponse,
1808 crate::Error,
1809 > {
1810 use google_cloud_gax::paginator::Paginator;
1811 self.by_page().items()
1812 }
1813
1814 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816 self.0.request.name = v.into();
1817 self
1818 }
1819
1820 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1822 self.0.request.filter = v.into();
1823 self
1824 }
1825
1826 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1828 self.0.request.page_size = v.into();
1829 self
1830 }
1831
1832 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1834 self.0.request.page_token = v.into();
1835 self
1836 }
1837 }
1838
1839 #[doc(hidden)]
1840 impl crate::RequestBuilder for ListLocations {
1841 fn request_options(&mut self) -> &mut crate::RequestOptions {
1842 &mut self.0.options
1843 }
1844 }
1845
1846 #[derive(Clone, Debug)]
1863 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1864
1865 impl GetLocation {
1866 pub(crate) fn new(
1867 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1868 ) -> Self {
1869 Self(RequestBuilder::new(stub))
1870 }
1871
1872 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1874 mut self,
1875 v: V,
1876 ) -> Self {
1877 self.0.request = v.into();
1878 self
1879 }
1880
1881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1883 self.0.options = v.into();
1884 self
1885 }
1886
1887 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1889 (*self.0.stub)
1890 .get_location(self.0.request, self.0.options)
1891 .await
1892 .map(crate::Response::into_body)
1893 }
1894
1895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1897 self.0.request.name = v.into();
1898 self
1899 }
1900 }
1901
1902 #[doc(hidden)]
1903 impl crate::RequestBuilder for GetLocation {
1904 fn request_options(&mut self) -> &mut crate::RequestOptions {
1905 &mut self.0.options
1906 }
1907 }
1908
1909 #[derive(Clone, Debug)]
1926 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1927
1928 impl SetIamPolicy {
1929 pub(crate) fn new(
1930 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
1931 ) -> Self {
1932 Self(RequestBuilder::new(stub))
1933 }
1934
1935 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1937 mut self,
1938 v: V,
1939 ) -> Self {
1940 self.0.request = v.into();
1941 self
1942 }
1943
1944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1946 self.0.options = v.into();
1947 self
1948 }
1949
1950 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1952 (*self.0.stub)
1953 .set_iam_policy(self.0.request, self.0.options)
1954 .await
1955 .map(crate::Response::into_body)
1956 }
1957
1958 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1962 self.0.request.resource = v.into();
1963 self
1964 }
1965
1966 pub fn set_policy<T>(mut self, v: T) -> Self
1970 where
1971 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1972 {
1973 self.0.request.policy = std::option::Option::Some(v.into());
1974 self
1975 }
1976
1977 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1981 where
1982 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1983 {
1984 self.0.request.policy = v.map(|x| x.into());
1985 self
1986 }
1987
1988 pub fn set_update_mask<T>(mut self, v: T) -> Self
1990 where
1991 T: std::convert::Into<wkt::FieldMask>,
1992 {
1993 self.0.request.update_mask = std::option::Option::Some(v.into());
1994 self
1995 }
1996
1997 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1999 where
2000 T: std::convert::Into<wkt::FieldMask>,
2001 {
2002 self.0.request.update_mask = v.map(|x| x.into());
2003 self
2004 }
2005 }
2006
2007 #[doc(hidden)]
2008 impl crate::RequestBuilder for SetIamPolicy {
2009 fn request_options(&mut self) -> &mut crate::RequestOptions {
2010 &mut self.0.options
2011 }
2012 }
2013
2014 #[derive(Clone, Debug)]
2031 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2032
2033 impl GetIamPolicy {
2034 pub(crate) fn new(
2035 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2036 ) -> Self {
2037 Self(RequestBuilder::new(stub))
2038 }
2039
2040 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2042 mut self,
2043 v: V,
2044 ) -> Self {
2045 self.0.request = v.into();
2046 self
2047 }
2048
2049 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2051 self.0.options = v.into();
2052 self
2053 }
2054
2055 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2057 (*self.0.stub)
2058 .get_iam_policy(self.0.request, self.0.options)
2059 .await
2060 .map(crate::Response::into_body)
2061 }
2062
2063 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2067 self.0.request.resource = v.into();
2068 self
2069 }
2070
2071 pub fn set_options<T>(mut self, v: T) -> Self
2073 where
2074 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2075 {
2076 self.0.request.options = std::option::Option::Some(v.into());
2077 self
2078 }
2079
2080 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2082 where
2083 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2084 {
2085 self.0.request.options = v.map(|x| x.into());
2086 self
2087 }
2088 }
2089
2090 #[doc(hidden)]
2091 impl crate::RequestBuilder for GetIamPolicy {
2092 fn request_options(&mut self) -> &mut crate::RequestOptions {
2093 &mut self.0.options
2094 }
2095 }
2096
2097 #[derive(Clone, Debug)]
2114 pub struct TestIamPermissions(
2115 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2116 );
2117
2118 impl TestIamPermissions {
2119 pub(crate) fn new(
2120 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2121 ) -> Self {
2122 Self(RequestBuilder::new(stub))
2123 }
2124
2125 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2127 mut self,
2128 v: V,
2129 ) -> Self {
2130 self.0.request = v.into();
2131 self
2132 }
2133
2134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2136 self.0.options = v.into();
2137 self
2138 }
2139
2140 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2142 (*self.0.stub)
2143 .test_iam_permissions(self.0.request, self.0.options)
2144 .await
2145 .map(crate::Response::into_body)
2146 }
2147
2148 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2152 self.0.request.resource = v.into();
2153 self
2154 }
2155
2156 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2160 where
2161 T: std::iter::IntoIterator<Item = V>,
2162 V: std::convert::Into<std::string::String>,
2163 {
2164 use std::iter::Iterator;
2165 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2166 self
2167 }
2168 }
2169
2170 #[doc(hidden)]
2171 impl crate::RequestBuilder for TestIamPermissions {
2172 fn request_options(&mut self) -> &mut crate::RequestOptions {
2173 &mut self.0.options
2174 }
2175 }
2176
2177 #[derive(Clone, Debug)]
2198 pub struct ListOperations(
2199 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2200 );
2201
2202 impl ListOperations {
2203 pub(crate) fn new(
2204 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2205 ) -> Self {
2206 Self(RequestBuilder::new(stub))
2207 }
2208
2209 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2211 mut self,
2212 v: V,
2213 ) -> Self {
2214 self.0.request = v.into();
2215 self
2216 }
2217
2218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2220 self.0.options = v.into();
2221 self
2222 }
2223
2224 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2226 (*self.0.stub)
2227 .list_operations(self.0.request, self.0.options)
2228 .await
2229 .map(crate::Response::into_body)
2230 }
2231
2232 pub fn by_page(
2234 self,
2235 ) -> impl google_cloud_gax::paginator::Paginator<
2236 google_cloud_longrunning::model::ListOperationsResponse,
2237 crate::Error,
2238 > {
2239 use std::clone::Clone;
2240 let token = self.0.request.page_token.clone();
2241 let execute = move |token: String| {
2242 let mut builder = self.clone();
2243 builder.0.request = builder.0.request.set_page_token(token);
2244 builder.send()
2245 };
2246 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2247 }
2248
2249 pub fn by_item(
2251 self,
2252 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2253 google_cloud_longrunning::model::ListOperationsResponse,
2254 crate::Error,
2255 > {
2256 use google_cloud_gax::paginator::Paginator;
2257 self.by_page().items()
2258 }
2259
2260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2262 self.0.request.name = v.into();
2263 self
2264 }
2265
2266 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2268 self.0.request.filter = v.into();
2269 self
2270 }
2271
2272 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2274 self.0.request.page_size = v.into();
2275 self
2276 }
2277
2278 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2280 self.0.request.page_token = v.into();
2281 self
2282 }
2283
2284 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2286 self.0.request.return_partial_success = v.into();
2287 self
2288 }
2289 }
2290
2291 #[doc(hidden)]
2292 impl crate::RequestBuilder for ListOperations {
2293 fn request_options(&mut self) -> &mut crate::RequestOptions {
2294 &mut self.0.options
2295 }
2296 }
2297
2298 #[derive(Clone, Debug)]
2315 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2316
2317 impl GetOperation {
2318 pub(crate) fn new(
2319 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2320 ) -> Self {
2321 Self(RequestBuilder::new(stub))
2322 }
2323
2324 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2326 mut self,
2327 v: V,
2328 ) -> Self {
2329 self.0.request = v.into();
2330 self
2331 }
2332
2333 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2335 self.0.options = v.into();
2336 self
2337 }
2338
2339 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2341 (*self.0.stub)
2342 .get_operation(self.0.request, self.0.options)
2343 .await
2344 .map(crate::Response::into_body)
2345 }
2346
2347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2349 self.0.request.name = v.into();
2350 self
2351 }
2352 }
2353
2354 #[doc(hidden)]
2355 impl crate::RequestBuilder for GetOperation {
2356 fn request_options(&mut self) -> &mut crate::RequestOptions {
2357 &mut self.0.options
2358 }
2359 }
2360
2361 #[derive(Clone, Debug)]
2378 pub struct DeleteOperation(
2379 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2380 );
2381
2382 impl DeleteOperation {
2383 pub(crate) fn new(
2384 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2385 ) -> Self {
2386 Self(RequestBuilder::new(stub))
2387 }
2388
2389 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2391 mut self,
2392 v: V,
2393 ) -> Self {
2394 self.0.request = v.into();
2395 self
2396 }
2397
2398 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2400 self.0.options = v.into();
2401 self
2402 }
2403
2404 pub async fn send(self) -> Result<()> {
2406 (*self.0.stub)
2407 .delete_operation(self.0.request, self.0.options)
2408 .await
2409 .map(crate::Response::into_body)
2410 }
2411
2412 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2414 self.0.request.name = v.into();
2415 self
2416 }
2417 }
2418
2419 #[doc(hidden)]
2420 impl crate::RequestBuilder for DeleteOperation {
2421 fn request_options(&mut self) -> &mut crate::RequestOptions {
2422 &mut self.0.options
2423 }
2424 }
2425
2426 #[derive(Clone, Debug)]
2443 pub struct CancelOperation(
2444 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2445 );
2446
2447 impl CancelOperation {
2448 pub(crate) fn new(
2449 stub: std::sync::Arc<dyn super::super::stub::dynamic::Connectors>,
2450 ) -> Self {
2451 Self(RequestBuilder::new(stub))
2452 }
2453
2454 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2456 mut self,
2457 v: V,
2458 ) -> Self {
2459 self.0.request = v.into();
2460 self
2461 }
2462
2463 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2465 self.0.options = v.into();
2466 self
2467 }
2468
2469 pub async fn send(self) -> Result<()> {
2471 (*self.0.stub)
2472 .cancel_operation(self.0.request, self.0.options)
2473 .await
2474 .map(crate::Response::into_body)
2475 }
2476
2477 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2479 self.0.request.name = v.into();
2480 self
2481 }
2482 }
2483
2484 #[doc(hidden)]
2485 impl crate::RequestBuilder for CancelOperation {
2486 fn request_options(&mut self) -> &mut crate::RequestOptions {
2487 &mut self.0.options
2488 }
2489 }
2490}