1pub mod datastream {
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::Datastream;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = Datastream;
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::Datastream>,
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::Datastream>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListConnectionProfiles(RequestBuilder<crate::model::ListConnectionProfilesRequest>);
97
98 impl ListConnectionProfiles {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListConnectionProfilesRequest>>(
107 mut self,
108 v: V,
109 ) -> Self {
110 self.0.request = v.into();
111 self
112 }
113
114 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116 self.0.options = v.into();
117 self
118 }
119
120 pub async fn send(self) -> Result<crate::model::ListConnectionProfilesResponse> {
122 (*self.0.stub)
123 .list_connection_profiles(self.0.request, self.0.options)
124 .await
125 .map(gax::response::Response::into_body)
126 }
127
128 pub fn by_page(
130 self,
131 ) -> impl gax::paginator::Paginator<
132 crate::model::ListConnectionProfilesResponse,
133 gax::error::Error,
134 > {
135 use std::clone::Clone;
136 let token = self.0.request.page_token.clone();
137 let execute = move |token: String| {
138 let mut builder = self.clone();
139 builder.0.request = builder.0.request.set_page_token(token);
140 builder.send()
141 };
142 gax::paginator::internal::new_paginator(token, execute)
143 }
144
145 pub fn by_item(
147 self,
148 ) -> impl gax::paginator::ItemPaginator<
149 crate::model::ListConnectionProfilesResponse,
150 gax::error::Error,
151 > {
152 use gax::paginator::Paginator;
153 self.by_page().items()
154 }
155
156 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
160 self.0.request.parent = v.into();
161 self
162 }
163
164 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
166 self.0.request.page_size = v.into();
167 self
168 }
169
170 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.page_token = v.into();
173 self
174 }
175
176 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.filter = v.into();
179 self
180 }
181
182 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
184 self.0.request.order_by = v.into();
185 self
186 }
187 }
188
189 #[doc(hidden)]
190 impl gax::options::internal::RequestBuilder for ListConnectionProfiles {
191 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
192 &mut self.0.options
193 }
194 }
195
196 #[derive(Clone, Debug)]
214 pub struct GetConnectionProfile(RequestBuilder<crate::model::GetConnectionProfileRequest>);
215
216 impl GetConnectionProfile {
217 pub(crate) fn new(
218 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
219 ) -> Self {
220 Self(RequestBuilder::new(stub))
221 }
222
223 pub fn with_request<V: Into<crate::model::GetConnectionProfileRequest>>(
225 mut self,
226 v: V,
227 ) -> Self {
228 self.0.request = v.into();
229 self
230 }
231
232 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
234 self.0.options = v.into();
235 self
236 }
237
238 pub async fn send(self) -> Result<crate::model::ConnectionProfile> {
240 (*self.0.stub)
241 .get_connection_profile(self.0.request, self.0.options)
242 .await
243 .map(gax::response::Response::into_body)
244 }
245
246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
250 self.0.request.name = v.into();
251 self
252 }
253 }
254
255 #[doc(hidden)]
256 impl gax::options::internal::RequestBuilder for GetConnectionProfile {
257 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
258 &mut self.0.options
259 }
260 }
261
262 #[derive(Clone, Debug)]
281 pub struct CreateConnectionProfile(
282 RequestBuilder<crate::model::CreateConnectionProfileRequest>,
283 );
284
285 impl CreateConnectionProfile {
286 pub(crate) fn new(
287 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
288 ) -> Self {
289 Self(RequestBuilder::new(stub))
290 }
291
292 pub fn with_request<V: Into<crate::model::CreateConnectionProfileRequest>>(
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<gax::options::RequestOptions>>(mut self, v: V) -> Self {
303 self.0.options = v.into();
304 self
305 }
306
307 pub async fn send(self) -> Result<longrunning::model::Operation> {
314 (*self.0.stub)
315 .create_connection_profile(self.0.request, self.0.options)
316 .await
317 .map(gax::response::Response::into_body)
318 }
319
320 pub fn poller(
322 self,
323 ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
324 {
325 type Operation = lro::internal::Operation<
326 crate::model::ConnectionProfile,
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(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 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
354 }
355
356 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
360 self.0.request.parent = v.into();
361 self
362 }
363
364 pub fn set_connection_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
368 self.0.request.connection_profile_id = v.into();
369 self
370 }
371
372 pub fn set_connection_profile<T>(mut self, v: T) -> Self
376 where
377 T: std::convert::Into<crate::model::ConnectionProfile>,
378 {
379 self.0.request.connection_profile = std::option::Option::Some(v.into());
380 self
381 }
382
383 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
387 where
388 T: std::convert::Into<crate::model::ConnectionProfile>,
389 {
390 self.0.request.connection_profile = v.map(|x| x.into());
391 self
392 }
393
394 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
396 self.0.request.request_id = v.into();
397 self
398 }
399
400 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
402 self.0.request.validate_only = v.into();
403 self
404 }
405
406 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
408 self.0.request.force = v.into();
409 self
410 }
411 }
412
413 #[doc(hidden)]
414 impl gax::options::internal::RequestBuilder for CreateConnectionProfile {
415 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
416 &mut self.0.options
417 }
418 }
419
420 #[derive(Clone, Debug)]
439 pub struct UpdateConnectionProfile(
440 RequestBuilder<crate::model::UpdateConnectionProfileRequest>,
441 );
442
443 impl UpdateConnectionProfile {
444 pub(crate) fn new(
445 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
446 ) -> Self {
447 Self(RequestBuilder::new(stub))
448 }
449
450 pub fn with_request<V: Into<crate::model::UpdateConnectionProfileRequest>>(
452 mut self,
453 v: V,
454 ) -> Self {
455 self.0.request = v.into();
456 self
457 }
458
459 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
461 self.0.options = v.into();
462 self
463 }
464
465 pub async fn send(self) -> Result<longrunning::model::Operation> {
472 (*self.0.stub)
473 .update_connection_profile(self.0.request, self.0.options)
474 .await
475 .map(gax::response::Response::into_body)
476 }
477
478 pub fn poller(
480 self,
481 ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
482 {
483 type Operation = lro::internal::Operation<
484 crate::model::ConnectionProfile,
485 crate::model::OperationMetadata,
486 >;
487 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
488 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
489
490 let stub = self.0.stub.clone();
491 let mut options = self.0.options.clone();
492 options.set_retry_policy(gax::retry_policy::NeverRetry);
493 let query = move |name| {
494 let stub = stub.clone();
495 let options = options.clone();
496 async {
497 let op = GetOperation::new(stub)
498 .set_name(name)
499 .with_options(options)
500 .send()
501 .await?;
502 Ok(Operation::new(op))
503 }
504 };
505
506 let start = move || async {
507 let op = self.send().await?;
508 Ok(Operation::new(op))
509 };
510
511 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
512 }
513
514 pub fn set_update_mask<T>(mut self, v: T) -> Self
516 where
517 T: std::convert::Into<wkt::FieldMask>,
518 {
519 self.0.request.update_mask = std::option::Option::Some(v.into());
520 self
521 }
522
523 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
525 where
526 T: std::convert::Into<wkt::FieldMask>,
527 {
528 self.0.request.update_mask = v.map(|x| x.into());
529 self
530 }
531
532 pub fn set_connection_profile<T>(mut self, v: T) -> Self
536 where
537 T: std::convert::Into<crate::model::ConnectionProfile>,
538 {
539 self.0.request.connection_profile = std::option::Option::Some(v.into());
540 self
541 }
542
543 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
547 where
548 T: std::convert::Into<crate::model::ConnectionProfile>,
549 {
550 self.0.request.connection_profile = v.map(|x| x.into());
551 self
552 }
553
554 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
556 self.0.request.request_id = v.into();
557 self
558 }
559
560 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
562 self.0.request.validate_only = v.into();
563 self
564 }
565
566 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
568 self.0.request.force = v.into();
569 self
570 }
571 }
572
573 #[doc(hidden)]
574 impl gax::options::internal::RequestBuilder for UpdateConnectionProfile {
575 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
576 &mut self.0.options
577 }
578 }
579
580 #[derive(Clone, Debug)]
599 pub struct DeleteConnectionProfile(
600 RequestBuilder<crate::model::DeleteConnectionProfileRequest>,
601 );
602
603 impl DeleteConnectionProfile {
604 pub(crate) fn new(
605 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
606 ) -> Self {
607 Self(RequestBuilder::new(stub))
608 }
609
610 pub fn with_request<V: Into<crate::model::DeleteConnectionProfileRequest>>(
612 mut self,
613 v: V,
614 ) -> Self {
615 self.0.request = v.into();
616 self
617 }
618
619 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
621 self.0.options = v.into();
622 self
623 }
624
625 pub async fn send(self) -> Result<longrunning::model::Operation> {
632 (*self.0.stub)
633 .delete_connection_profile(self.0.request, self.0.options)
634 .await
635 .map(gax::response::Response::into_body)
636 }
637
638 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
640 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
641 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
642 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
643
644 let stub = self.0.stub.clone();
645 let mut options = self.0.options.clone();
646 options.set_retry_policy(gax::retry_policy::NeverRetry);
647 let query = move |name| {
648 let stub = stub.clone();
649 let options = options.clone();
650 async {
651 let op = GetOperation::new(stub)
652 .set_name(name)
653 .with_options(options)
654 .send()
655 .await?;
656 Ok(Operation::new(op))
657 }
658 };
659
660 let start = move || async {
661 let op = self.send().await?;
662 Ok(Operation::new(op))
663 };
664
665 lro::internal::new_unit_response_poller(
666 polling_error_policy,
667 polling_backoff_policy,
668 start,
669 query,
670 )
671 }
672
673 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
677 self.0.request.name = v.into();
678 self
679 }
680
681 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
683 self.0.request.request_id = v.into();
684 self
685 }
686 }
687
688 #[doc(hidden)]
689 impl gax::options::internal::RequestBuilder for DeleteConnectionProfile {
690 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
691 &mut self.0.options
692 }
693 }
694
695 #[derive(Clone, Debug)]
713 pub struct DiscoverConnectionProfile(
714 RequestBuilder<crate::model::DiscoverConnectionProfileRequest>,
715 );
716
717 impl DiscoverConnectionProfile {
718 pub(crate) fn new(
719 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
720 ) -> Self {
721 Self(RequestBuilder::new(stub))
722 }
723
724 pub fn with_request<V: Into<crate::model::DiscoverConnectionProfileRequest>>(
726 mut self,
727 v: V,
728 ) -> Self {
729 self.0.request = v.into();
730 self
731 }
732
733 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
735 self.0.options = v.into();
736 self
737 }
738
739 pub async fn send(self) -> Result<crate::model::DiscoverConnectionProfileResponse> {
741 (*self.0.stub)
742 .discover_connection_profile(self.0.request, self.0.options)
743 .await
744 .map(gax::response::Response::into_body)
745 }
746
747 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
751 self.0.request.parent = v.into();
752 self
753 }
754
755 pub fn set_target<
760 T: Into<Option<crate::model::discover_connection_profile_request::Target>>,
761 >(
762 mut self,
763 v: T,
764 ) -> Self {
765 self.0.request.target = v.into();
766 self
767 }
768
769 pub fn set_connection_profile<
775 T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
776 >(
777 mut self,
778 v: T,
779 ) -> Self {
780 self.0.request = self.0.request.set_connection_profile(v);
781 self
782 }
783
784 pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
790 mut self,
791 v: T,
792 ) -> Self {
793 self.0.request = self.0.request.set_connection_profile_name(v);
794 self
795 }
796
797 pub fn set_hierarchy<
802 T: Into<Option<crate::model::discover_connection_profile_request::Hierarchy>>,
803 >(
804 mut self,
805 v: T,
806 ) -> Self {
807 self.0.request.hierarchy = v.into();
808 self
809 }
810
811 pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
817 self.0.request = self.0.request.set_full_hierarchy(v);
818 self
819 }
820
821 pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
827 self.0.request = self.0.request.set_hierarchy_depth(v);
828 self
829 }
830
831 pub fn set_data_object<
836 T: Into<Option<crate::model::discover_connection_profile_request::DataObject>>,
837 >(
838 mut self,
839 v: T,
840 ) -> Self {
841 self.0.request.data_object = v.into();
842 self
843 }
844
845 pub fn set_oracle_rdbms<
851 T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
852 >(
853 mut self,
854 v: T,
855 ) -> Self {
856 self.0.request = self.0.request.set_oracle_rdbms(v);
857 self
858 }
859
860 pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
866 mut self,
867 v: T,
868 ) -> Self {
869 self.0.request = self.0.request.set_mysql_rdbms(v);
870 self
871 }
872
873 pub fn set_postgresql_rdbms<
879 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
880 >(
881 mut self,
882 v: T,
883 ) -> Self {
884 self.0.request = self.0.request.set_postgresql_rdbms(v);
885 self
886 }
887
888 pub fn set_sql_server_rdbms<
894 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
895 >(
896 mut self,
897 v: T,
898 ) -> Self {
899 self.0.request = self.0.request.set_sql_server_rdbms(v);
900 self
901 }
902
903 pub fn set_salesforce_org<
909 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
910 >(
911 mut self,
912 v: T,
913 ) -> Self {
914 self.0.request = self.0.request.set_salesforce_org(v);
915 self
916 }
917
918 pub fn set_mongodb_cluster<
924 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
925 >(
926 mut self,
927 v: T,
928 ) -> Self {
929 self.0.request = self.0.request.set_mongodb_cluster(v);
930 self
931 }
932 }
933
934 #[doc(hidden)]
935 impl gax::options::internal::RequestBuilder for DiscoverConnectionProfile {
936 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
937 &mut self.0.options
938 }
939 }
940
941 #[derive(Clone, Debug)]
963 pub struct ListStreams(RequestBuilder<crate::model::ListStreamsRequest>);
964
965 impl ListStreams {
966 pub(crate) fn new(
967 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
968 ) -> Self {
969 Self(RequestBuilder::new(stub))
970 }
971
972 pub fn with_request<V: Into<crate::model::ListStreamsRequest>>(mut self, v: V) -> Self {
974 self.0.request = v.into();
975 self
976 }
977
978 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
980 self.0.options = v.into();
981 self
982 }
983
984 pub async fn send(self) -> Result<crate::model::ListStreamsResponse> {
986 (*self.0.stub)
987 .list_streams(self.0.request, self.0.options)
988 .await
989 .map(gax::response::Response::into_body)
990 }
991
992 pub fn by_page(
994 self,
995 ) -> impl gax::paginator::Paginator<crate::model::ListStreamsResponse, gax::error::Error>
996 {
997 use std::clone::Clone;
998 let token = self.0.request.page_token.clone();
999 let execute = move |token: String| {
1000 let mut builder = self.clone();
1001 builder.0.request = builder.0.request.set_page_token(token);
1002 builder.send()
1003 };
1004 gax::paginator::internal::new_paginator(token, execute)
1005 }
1006
1007 pub fn by_item(
1009 self,
1010 ) -> impl gax::paginator::ItemPaginator<crate::model::ListStreamsResponse, gax::error::Error>
1011 {
1012 use gax::paginator::Paginator;
1013 self.by_page().items()
1014 }
1015
1016 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1020 self.0.request.parent = v.into();
1021 self
1022 }
1023
1024 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1026 self.0.request.page_size = v.into();
1027 self
1028 }
1029
1030 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032 self.0.request.page_token = v.into();
1033 self
1034 }
1035
1036 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1038 self.0.request.filter = v.into();
1039 self
1040 }
1041
1042 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1044 self.0.request.order_by = v.into();
1045 self
1046 }
1047 }
1048
1049 #[doc(hidden)]
1050 impl gax::options::internal::RequestBuilder for ListStreams {
1051 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1052 &mut self.0.options
1053 }
1054 }
1055
1056 #[derive(Clone, Debug)]
1074 pub struct GetStream(RequestBuilder<crate::model::GetStreamRequest>);
1075
1076 impl GetStream {
1077 pub(crate) fn new(
1078 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1079 ) -> Self {
1080 Self(RequestBuilder::new(stub))
1081 }
1082
1083 pub fn with_request<V: Into<crate::model::GetStreamRequest>>(mut self, v: V) -> Self {
1085 self.0.request = v.into();
1086 self
1087 }
1088
1089 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1091 self.0.options = v.into();
1092 self
1093 }
1094
1095 pub async fn send(self) -> Result<crate::model::Stream> {
1097 (*self.0.stub)
1098 .get_stream(self.0.request, self.0.options)
1099 .await
1100 .map(gax::response::Response::into_body)
1101 }
1102
1103 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1107 self.0.request.name = v.into();
1108 self
1109 }
1110 }
1111
1112 #[doc(hidden)]
1113 impl gax::options::internal::RequestBuilder for GetStream {
1114 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1115 &mut self.0.options
1116 }
1117 }
1118
1119 #[derive(Clone, Debug)]
1138 pub struct CreateStream(RequestBuilder<crate::model::CreateStreamRequest>);
1139
1140 impl CreateStream {
1141 pub(crate) fn new(
1142 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1143 ) -> Self {
1144 Self(RequestBuilder::new(stub))
1145 }
1146
1147 pub fn with_request<V: Into<crate::model::CreateStreamRequest>>(mut self, v: V) -> Self {
1149 self.0.request = v.into();
1150 self
1151 }
1152
1153 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1155 self.0.options = v.into();
1156 self
1157 }
1158
1159 pub async fn send(self) -> Result<longrunning::model::Operation> {
1166 (*self.0.stub)
1167 .create_stream(self.0.request, self.0.options)
1168 .await
1169 .map(gax::response::Response::into_body)
1170 }
1171
1172 pub fn poller(
1174 self,
1175 ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1176 type Operation =
1177 lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1178 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1179 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1180
1181 let stub = self.0.stub.clone();
1182 let mut options = self.0.options.clone();
1183 options.set_retry_policy(gax::retry_policy::NeverRetry);
1184 let query = move |name| {
1185 let stub = stub.clone();
1186 let options = options.clone();
1187 async {
1188 let op = GetOperation::new(stub)
1189 .set_name(name)
1190 .with_options(options)
1191 .send()
1192 .await?;
1193 Ok(Operation::new(op))
1194 }
1195 };
1196
1197 let start = move || async {
1198 let op = self.send().await?;
1199 Ok(Operation::new(op))
1200 };
1201
1202 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1203 }
1204
1205 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1209 self.0.request.parent = v.into();
1210 self
1211 }
1212
1213 pub fn set_stream_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1217 self.0.request.stream_id = v.into();
1218 self
1219 }
1220
1221 pub fn set_stream<T>(mut self, v: T) -> Self
1225 where
1226 T: std::convert::Into<crate::model::Stream>,
1227 {
1228 self.0.request.stream = std::option::Option::Some(v.into());
1229 self
1230 }
1231
1232 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1236 where
1237 T: std::convert::Into<crate::model::Stream>,
1238 {
1239 self.0.request.stream = v.map(|x| x.into());
1240 self
1241 }
1242
1243 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1245 self.0.request.request_id = v.into();
1246 self
1247 }
1248
1249 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1251 self.0.request.validate_only = v.into();
1252 self
1253 }
1254
1255 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1257 self.0.request.force = v.into();
1258 self
1259 }
1260 }
1261
1262 #[doc(hidden)]
1263 impl gax::options::internal::RequestBuilder for CreateStream {
1264 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1265 &mut self.0.options
1266 }
1267 }
1268
1269 #[derive(Clone, Debug)]
1288 pub struct UpdateStream(RequestBuilder<crate::model::UpdateStreamRequest>);
1289
1290 impl UpdateStream {
1291 pub(crate) fn new(
1292 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1293 ) -> Self {
1294 Self(RequestBuilder::new(stub))
1295 }
1296
1297 pub fn with_request<V: Into<crate::model::UpdateStreamRequest>>(mut self, v: V) -> Self {
1299 self.0.request = v.into();
1300 self
1301 }
1302
1303 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1305 self.0.options = v.into();
1306 self
1307 }
1308
1309 pub async fn send(self) -> Result<longrunning::model::Operation> {
1316 (*self.0.stub)
1317 .update_stream(self.0.request, self.0.options)
1318 .await
1319 .map(gax::response::Response::into_body)
1320 }
1321
1322 pub fn poller(
1324 self,
1325 ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1326 type Operation =
1327 lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1328 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1329 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1330
1331 let stub = self.0.stub.clone();
1332 let mut options = self.0.options.clone();
1333 options.set_retry_policy(gax::retry_policy::NeverRetry);
1334 let query = move |name| {
1335 let stub = stub.clone();
1336 let options = options.clone();
1337 async {
1338 let op = GetOperation::new(stub)
1339 .set_name(name)
1340 .with_options(options)
1341 .send()
1342 .await?;
1343 Ok(Operation::new(op))
1344 }
1345 };
1346
1347 let start = move || async {
1348 let op = self.send().await?;
1349 Ok(Operation::new(op))
1350 };
1351
1352 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1353 }
1354
1355 pub fn set_update_mask<T>(mut self, v: T) -> Self
1357 where
1358 T: std::convert::Into<wkt::FieldMask>,
1359 {
1360 self.0.request.update_mask = std::option::Option::Some(v.into());
1361 self
1362 }
1363
1364 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1366 where
1367 T: std::convert::Into<wkt::FieldMask>,
1368 {
1369 self.0.request.update_mask = v.map(|x| x.into());
1370 self
1371 }
1372
1373 pub fn set_stream<T>(mut self, v: T) -> Self
1377 where
1378 T: std::convert::Into<crate::model::Stream>,
1379 {
1380 self.0.request.stream = std::option::Option::Some(v.into());
1381 self
1382 }
1383
1384 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1388 where
1389 T: std::convert::Into<crate::model::Stream>,
1390 {
1391 self.0.request.stream = v.map(|x| x.into());
1392 self
1393 }
1394
1395 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1397 self.0.request.request_id = v.into();
1398 self
1399 }
1400
1401 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1403 self.0.request.validate_only = v.into();
1404 self
1405 }
1406
1407 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1409 self.0.request.force = v.into();
1410 self
1411 }
1412 }
1413
1414 #[doc(hidden)]
1415 impl gax::options::internal::RequestBuilder for UpdateStream {
1416 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1417 &mut self.0.options
1418 }
1419 }
1420
1421 #[derive(Clone, Debug)]
1440 pub struct DeleteStream(RequestBuilder<crate::model::DeleteStreamRequest>);
1441
1442 impl DeleteStream {
1443 pub(crate) fn new(
1444 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1445 ) -> Self {
1446 Self(RequestBuilder::new(stub))
1447 }
1448
1449 pub fn with_request<V: Into<crate::model::DeleteStreamRequest>>(mut self, v: V) -> Self {
1451 self.0.request = v.into();
1452 self
1453 }
1454
1455 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1457 self.0.options = v.into();
1458 self
1459 }
1460
1461 pub async fn send(self) -> Result<longrunning::model::Operation> {
1468 (*self.0.stub)
1469 .delete_stream(self.0.request, self.0.options)
1470 .await
1471 .map(gax::response::Response::into_body)
1472 }
1473
1474 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1476 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1477 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1478 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1479
1480 let stub = self.0.stub.clone();
1481 let mut options = self.0.options.clone();
1482 options.set_retry_policy(gax::retry_policy::NeverRetry);
1483 let query = move |name| {
1484 let stub = stub.clone();
1485 let options = options.clone();
1486 async {
1487 let op = GetOperation::new(stub)
1488 .set_name(name)
1489 .with_options(options)
1490 .send()
1491 .await?;
1492 Ok(Operation::new(op))
1493 }
1494 };
1495
1496 let start = move || async {
1497 let op = self.send().await?;
1498 Ok(Operation::new(op))
1499 };
1500
1501 lro::internal::new_unit_response_poller(
1502 polling_error_policy,
1503 polling_backoff_policy,
1504 start,
1505 query,
1506 )
1507 }
1508
1509 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1513 self.0.request.name = v.into();
1514 self
1515 }
1516
1517 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1519 self.0.request.request_id = v.into();
1520 self
1521 }
1522 }
1523
1524 #[doc(hidden)]
1525 impl gax::options::internal::RequestBuilder for DeleteStream {
1526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1527 &mut self.0.options
1528 }
1529 }
1530
1531 #[derive(Clone, Debug)]
1550 pub struct RunStream(RequestBuilder<crate::model::RunStreamRequest>);
1551
1552 impl RunStream {
1553 pub(crate) fn new(
1554 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1555 ) -> Self {
1556 Self(RequestBuilder::new(stub))
1557 }
1558
1559 pub fn with_request<V: Into<crate::model::RunStreamRequest>>(mut self, v: V) -> Self {
1561 self.0.request = v.into();
1562 self
1563 }
1564
1565 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1567 self.0.options = v.into();
1568 self
1569 }
1570
1571 pub async fn send(self) -> Result<longrunning::model::Operation> {
1578 (*self.0.stub)
1579 .run_stream(self.0.request, self.0.options)
1580 .await
1581 .map(gax::response::Response::into_body)
1582 }
1583
1584 pub fn poller(
1586 self,
1587 ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1588 type Operation =
1589 lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1590 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1591 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1592
1593 let stub = self.0.stub.clone();
1594 let mut options = self.0.options.clone();
1595 options.set_retry_policy(gax::retry_policy::NeverRetry);
1596 let query = move |name| {
1597 let stub = stub.clone();
1598 let options = options.clone();
1599 async {
1600 let op = GetOperation::new(stub)
1601 .set_name(name)
1602 .with_options(options)
1603 .send()
1604 .await?;
1605 Ok(Operation::new(op))
1606 }
1607 };
1608
1609 let start = move || async {
1610 let op = self.send().await?;
1611 Ok(Operation::new(op))
1612 };
1613
1614 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1615 }
1616
1617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1621 self.0.request.name = v.into();
1622 self
1623 }
1624
1625 pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
1627 where
1628 T: std::convert::Into<crate::model::CdcStrategy>,
1629 {
1630 self.0.request.cdc_strategy = std::option::Option::Some(v.into());
1631 self
1632 }
1633
1634 pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
1636 where
1637 T: std::convert::Into<crate::model::CdcStrategy>,
1638 {
1639 self.0.request.cdc_strategy = v.map(|x| x.into());
1640 self
1641 }
1642
1643 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1645 self.0.request.force = v.into();
1646 self
1647 }
1648 }
1649
1650 #[doc(hidden)]
1651 impl gax::options::internal::RequestBuilder for RunStream {
1652 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1653 &mut self.0.options
1654 }
1655 }
1656
1657 #[derive(Clone, Debug)]
1675 pub struct GetStreamObject(RequestBuilder<crate::model::GetStreamObjectRequest>);
1676
1677 impl GetStreamObject {
1678 pub(crate) fn new(
1679 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1680 ) -> Self {
1681 Self(RequestBuilder::new(stub))
1682 }
1683
1684 pub fn with_request<V: Into<crate::model::GetStreamObjectRequest>>(mut self, v: V) -> Self {
1686 self.0.request = v.into();
1687 self
1688 }
1689
1690 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1692 self.0.options = v.into();
1693 self
1694 }
1695
1696 pub async fn send(self) -> Result<crate::model::StreamObject> {
1698 (*self.0.stub)
1699 .get_stream_object(self.0.request, self.0.options)
1700 .await
1701 .map(gax::response::Response::into_body)
1702 }
1703
1704 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1708 self.0.request.name = v.into();
1709 self
1710 }
1711 }
1712
1713 #[doc(hidden)]
1714 impl gax::options::internal::RequestBuilder for GetStreamObject {
1715 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1716 &mut self.0.options
1717 }
1718 }
1719
1720 #[derive(Clone, Debug)]
1738 pub struct LookupStreamObject(RequestBuilder<crate::model::LookupStreamObjectRequest>);
1739
1740 impl LookupStreamObject {
1741 pub(crate) fn new(
1742 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1743 ) -> Self {
1744 Self(RequestBuilder::new(stub))
1745 }
1746
1747 pub fn with_request<V: Into<crate::model::LookupStreamObjectRequest>>(
1749 mut self,
1750 v: V,
1751 ) -> Self {
1752 self.0.request = v.into();
1753 self
1754 }
1755
1756 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1758 self.0.options = v.into();
1759 self
1760 }
1761
1762 pub async fn send(self) -> Result<crate::model::StreamObject> {
1764 (*self.0.stub)
1765 .lookup_stream_object(self.0.request, self.0.options)
1766 .await
1767 .map(gax::response::Response::into_body)
1768 }
1769
1770 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1774 self.0.request.parent = v.into();
1775 self
1776 }
1777
1778 pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
1782 where
1783 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1784 {
1785 self.0.request.source_object_identifier = std::option::Option::Some(v.into());
1786 self
1787 }
1788
1789 pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
1793 where
1794 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1795 {
1796 self.0.request.source_object_identifier = v.map(|x| x.into());
1797 self
1798 }
1799 }
1800
1801 #[doc(hidden)]
1802 impl gax::options::internal::RequestBuilder for LookupStreamObject {
1803 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1804 &mut self.0.options
1805 }
1806 }
1807
1808 #[derive(Clone, Debug)]
1830 pub struct ListStreamObjects(RequestBuilder<crate::model::ListStreamObjectsRequest>);
1831
1832 impl ListStreamObjects {
1833 pub(crate) fn new(
1834 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1835 ) -> Self {
1836 Self(RequestBuilder::new(stub))
1837 }
1838
1839 pub fn with_request<V: Into<crate::model::ListStreamObjectsRequest>>(
1841 mut self,
1842 v: V,
1843 ) -> Self {
1844 self.0.request = v.into();
1845 self
1846 }
1847
1848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1850 self.0.options = v.into();
1851 self
1852 }
1853
1854 pub async fn send(self) -> Result<crate::model::ListStreamObjectsResponse> {
1856 (*self.0.stub)
1857 .list_stream_objects(self.0.request, self.0.options)
1858 .await
1859 .map(gax::response::Response::into_body)
1860 }
1861
1862 pub fn by_page(
1864 self,
1865 ) -> impl gax::paginator::Paginator<crate::model::ListStreamObjectsResponse, gax::error::Error>
1866 {
1867 use std::clone::Clone;
1868 let token = self.0.request.page_token.clone();
1869 let execute = move |token: String| {
1870 let mut builder = self.clone();
1871 builder.0.request = builder.0.request.set_page_token(token);
1872 builder.send()
1873 };
1874 gax::paginator::internal::new_paginator(token, execute)
1875 }
1876
1877 pub fn by_item(
1879 self,
1880 ) -> impl gax::paginator::ItemPaginator<crate::model::ListStreamObjectsResponse, gax::error::Error>
1881 {
1882 use gax::paginator::Paginator;
1883 self.by_page().items()
1884 }
1885
1886 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1890 self.0.request.parent = v.into();
1891 self
1892 }
1893
1894 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1896 self.0.request.page_size = v.into();
1897 self
1898 }
1899
1900 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1902 self.0.request.page_token = v.into();
1903 self
1904 }
1905 }
1906
1907 #[doc(hidden)]
1908 impl gax::options::internal::RequestBuilder for ListStreamObjects {
1909 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1910 &mut self.0.options
1911 }
1912 }
1913
1914 #[derive(Clone, Debug)]
1932 pub struct StartBackfillJob(RequestBuilder<crate::model::StartBackfillJobRequest>);
1933
1934 impl StartBackfillJob {
1935 pub(crate) fn new(
1936 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1937 ) -> Self {
1938 Self(RequestBuilder::new(stub))
1939 }
1940
1941 pub fn with_request<V: Into<crate::model::StartBackfillJobRequest>>(
1943 mut self,
1944 v: V,
1945 ) -> Self {
1946 self.0.request = v.into();
1947 self
1948 }
1949
1950 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1952 self.0.options = v.into();
1953 self
1954 }
1955
1956 pub async fn send(self) -> Result<crate::model::StartBackfillJobResponse> {
1958 (*self.0.stub)
1959 .start_backfill_job(self.0.request, self.0.options)
1960 .await
1961 .map(gax::response::Response::into_body)
1962 }
1963
1964 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1968 self.0.request.object = v.into();
1969 self
1970 }
1971 }
1972
1973 #[doc(hidden)]
1974 impl gax::options::internal::RequestBuilder for StartBackfillJob {
1975 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1976 &mut self.0.options
1977 }
1978 }
1979
1980 #[derive(Clone, Debug)]
1998 pub struct StopBackfillJob(RequestBuilder<crate::model::StopBackfillJobRequest>);
1999
2000 impl StopBackfillJob {
2001 pub(crate) fn new(
2002 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2003 ) -> Self {
2004 Self(RequestBuilder::new(stub))
2005 }
2006
2007 pub fn with_request<V: Into<crate::model::StopBackfillJobRequest>>(mut self, v: V) -> Self {
2009 self.0.request = v.into();
2010 self
2011 }
2012
2013 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2015 self.0.options = v.into();
2016 self
2017 }
2018
2019 pub async fn send(self) -> Result<crate::model::StopBackfillJobResponse> {
2021 (*self.0.stub)
2022 .stop_backfill_job(self.0.request, self.0.options)
2023 .await
2024 .map(gax::response::Response::into_body)
2025 }
2026
2027 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2031 self.0.request.object = v.into();
2032 self
2033 }
2034 }
2035
2036 #[doc(hidden)]
2037 impl gax::options::internal::RequestBuilder for StopBackfillJob {
2038 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2039 &mut self.0.options
2040 }
2041 }
2042
2043 #[derive(Clone, Debug)]
2061 pub struct FetchStaticIps(RequestBuilder<crate::model::FetchStaticIpsRequest>);
2062
2063 impl FetchStaticIps {
2064 pub(crate) fn new(
2065 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2066 ) -> Self {
2067 Self(RequestBuilder::new(stub))
2068 }
2069
2070 pub fn with_request<V: Into<crate::model::FetchStaticIpsRequest>>(mut self, v: V) -> Self {
2072 self.0.request = v.into();
2073 self
2074 }
2075
2076 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2078 self.0.options = v.into();
2079 self
2080 }
2081
2082 pub async fn send(self) -> Result<crate::model::FetchStaticIpsResponse> {
2084 (*self.0.stub)
2085 .fetch_static_ips(self.0.request, self.0.options)
2086 .await
2087 .map(gax::response::Response::into_body)
2088 }
2089
2090 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2094 self.0.request.name = v.into();
2095 self
2096 }
2097
2098 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2100 self.0.request.page_size = v.into();
2101 self
2102 }
2103
2104 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2106 self.0.request.page_token = v.into();
2107 self
2108 }
2109 }
2110
2111 #[doc(hidden)]
2112 impl gax::options::internal::RequestBuilder for FetchStaticIps {
2113 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2114 &mut self.0.options
2115 }
2116 }
2117
2118 #[derive(Clone, Debug)]
2137 pub struct CreatePrivateConnection(
2138 RequestBuilder<crate::model::CreatePrivateConnectionRequest>,
2139 );
2140
2141 impl CreatePrivateConnection {
2142 pub(crate) fn new(
2143 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2144 ) -> Self {
2145 Self(RequestBuilder::new(stub))
2146 }
2147
2148 pub fn with_request<V: Into<crate::model::CreatePrivateConnectionRequest>>(
2150 mut self,
2151 v: V,
2152 ) -> Self {
2153 self.0.request = v.into();
2154 self
2155 }
2156
2157 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2159 self.0.options = v.into();
2160 self
2161 }
2162
2163 pub async fn send(self) -> Result<longrunning::model::Operation> {
2170 (*self.0.stub)
2171 .create_private_connection(self.0.request, self.0.options)
2172 .await
2173 .map(gax::response::Response::into_body)
2174 }
2175
2176 pub fn poller(
2178 self,
2179 ) -> impl lro::Poller<crate::model::PrivateConnection, crate::model::OperationMetadata>
2180 {
2181 type Operation = lro::internal::Operation<
2182 crate::model::PrivateConnection,
2183 crate::model::OperationMetadata,
2184 >;
2185 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2186 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2187
2188 let stub = self.0.stub.clone();
2189 let mut options = self.0.options.clone();
2190 options.set_retry_policy(gax::retry_policy::NeverRetry);
2191 let query = move |name| {
2192 let stub = stub.clone();
2193 let options = options.clone();
2194 async {
2195 let op = GetOperation::new(stub)
2196 .set_name(name)
2197 .with_options(options)
2198 .send()
2199 .await?;
2200 Ok(Operation::new(op))
2201 }
2202 };
2203
2204 let start = move || async {
2205 let op = self.send().await?;
2206 Ok(Operation::new(op))
2207 };
2208
2209 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2210 }
2211
2212 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2216 self.0.request.parent = v.into();
2217 self
2218 }
2219
2220 pub fn set_private_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2224 self.0.request.private_connection_id = v.into();
2225 self
2226 }
2227
2228 pub fn set_private_connection<T>(mut self, v: T) -> Self
2232 where
2233 T: std::convert::Into<crate::model::PrivateConnection>,
2234 {
2235 self.0.request.private_connection = std::option::Option::Some(v.into());
2236 self
2237 }
2238
2239 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2243 where
2244 T: std::convert::Into<crate::model::PrivateConnection>,
2245 {
2246 self.0.request.private_connection = v.map(|x| x.into());
2247 self
2248 }
2249
2250 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2252 self.0.request.request_id = v.into();
2253 self
2254 }
2255
2256 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2258 self.0.request.force = v.into();
2259 self
2260 }
2261
2262 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2264 self.0.request.validate_only = v.into();
2265 self
2266 }
2267 }
2268
2269 #[doc(hidden)]
2270 impl gax::options::internal::RequestBuilder for CreatePrivateConnection {
2271 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2272 &mut self.0.options
2273 }
2274 }
2275
2276 #[derive(Clone, Debug)]
2294 pub struct GetPrivateConnection(RequestBuilder<crate::model::GetPrivateConnectionRequest>);
2295
2296 impl GetPrivateConnection {
2297 pub(crate) fn new(
2298 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2299 ) -> Self {
2300 Self(RequestBuilder::new(stub))
2301 }
2302
2303 pub fn with_request<V: Into<crate::model::GetPrivateConnectionRequest>>(
2305 mut self,
2306 v: V,
2307 ) -> Self {
2308 self.0.request = v.into();
2309 self
2310 }
2311
2312 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2314 self.0.options = v.into();
2315 self
2316 }
2317
2318 pub async fn send(self) -> Result<crate::model::PrivateConnection> {
2320 (*self.0.stub)
2321 .get_private_connection(self.0.request, self.0.options)
2322 .await
2323 .map(gax::response::Response::into_body)
2324 }
2325
2326 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2330 self.0.request.name = v.into();
2331 self
2332 }
2333 }
2334
2335 #[doc(hidden)]
2336 impl gax::options::internal::RequestBuilder for GetPrivateConnection {
2337 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2338 &mut self.0.options
2339 }
2340 }
2341
2342 #[derive(Clone, Debug)]
2364 pub struct ListPrivateConnections(RequestBuilder<crate::model::ListPrivateConnectionsRequest>);
2365
2366 impl ListPrivateConnections {
2367 pub(crate) fn new(
2368 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2369 ) -> Self {
2370 Self(RequestBuilder::new(stub))
2371 }
2372
2373 pub fn with_request<V: Into<crate::model::ListPrivateConnectionsRequest>>(
2375 mut self,
2376 v: V,
2377 ) -> Self {
2378 self.0.request = v.into();
2379 self
2380 }
2381
2382 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2384 self.0.options = v.into();
2385 self
2386 }
2387
2388 pub async fn send(self) -> Result<crate::model::ListPrivateConnectionsResponse> {
2390 (*self.0.stub)
2391 .list_private_connections(self.0.request, self.0.options)
2392 .await
2393 .map(gax::response::Response::into_body)
2394 }
2395
2396 pub fn by_page(
2398 self,
2399 ) -> impl gax::paginator::Paginator<
2400 crate::model::ListPrivateConnectionsResponse,
2401 gax::error::Error,
2402 > {
2403 use std::clone::Clone;
2404 let token = self.0.request.page_token.clone();
2405 let execute = move |token: String| {
2406 let mut builder = self.clone();
2407 builder.0.request = builder.0.request.set_page_token(token);
2408 builder.send()
2409 };
2410 gax::paginator::internal::new_paginator(token, execute)
2411 }
2412
2413 pub fn by_item(
2415 self,
2416 ) -> impl gax::paginator::ItemPaginator<
2417 crate::model::ListPrivateConnectionsResponse,
2418 gax::error::Error,
2419 > {
2420 use gax::paginator::Paginator;
2421 self.by_page().items()
2422 }
2423
2424 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2428 self.0.request.parent = v.into();
2429 self
2430 }
2431
2432 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2434 self.0.request.page_size = v.into();
2435 self
2436 }
2437
2438 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2440 self.0.request.page_token = v.into();
2441 self
2442 }
2443
2444 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2446 self.0.request.filter = v.into();
2447 self
2448 }
2449
2450 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2452 self.0.request.order_by = v.into();
2453 self
2454 }
2455 }
2456
2457 #[doc(hidden)]
2458 impl gax::options::internal::RequestBuilder for ListPrivateConnections {
2459 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2460 &mut self.0.options
2461 }
2462 }
2463
2464 #[derive(Clone, Debug)]
2483 pub struct DeletePrivateConnection(
2484 RequestBuilder<crate::model::DeletePrivateConnectionRequest>,
2485 );
2486
2487 impl DeletePrivateConnection {
2488 pub(crate) fn new(
2489 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2490 ) -> Self {
2491 Self(RequestBuilder::new(stub))
2492 }
2493
2494 pub fn with_request<V: Into<crate::model::DeletePrivateConnectionRequest>>(
2496 mut self,
2497 v: V,
2498 ) -> Self {
2499 self.0.request = v.into();
2500 self
2501 }
2502
2503 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2505 self.0.options = v.into();
2506 self
2507 }
2508
2509 pub async fn send(self) -> Result<longrunning::model::Operation> {
2516 (*self.0.stub)
2517 .delete_private_connection(self.0.request, self.0.options)
2518 .await
2519 .map(gax::response::Response::into_body)
2520 }
2521
2522 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2524 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2525 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2526 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2527
2528 let stub = self.0.stub.clone();
2529 let mut options = self.0.options.clone();
2530 options.set_retry_policy(gax::retry_policy::NeverRetry);
2531 let query = move |name| {
2532 let stub = stub.clone();
2533 let options = options.clone();
2534 async {
2535 let op = GetOperation::new(stub)
2536 .set_name(name)
2537 .with_options(options)
2538 .send()
2539 .await?;
2540 Ok(Operation::new(op))
2541 }
2542 };
2543
2544 let start = move || async {
2545 let op = self.send().await?;
2546 Ok(Operation::new(op))
2547 };
2548
2549 lro::internal::new_unit_response_poller(
2550 polling_error_policy,
2551 polling_backoff_policy,
2552 start,
2553 query,
2554 )
2555 }
2556
2557 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2561 self.0.request.name = v.into();
2562 self
2563 }
2564
2565 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2567 self.0.request.request_id = v.into();
2568 self
2569 }
2570
2571 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2573 self.0.request.force = v.into();
2574 self
2575 }
2576 }
2577
2578 #[doc(hidden)]
2579 impl gax::options::internal::RequestBuilder for DeletePrivateConnection {
2580 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2581 &mut self.0.options
2582 }
2583 }
2584
2585 #[derive(Clone, Debug)]
2604 pub struct CreateRoute(RequestBuilder<crate::model::CreateRouteRequest>);
2605
2606 impl CreateRoute {
2607 pub(crate) fn new(
2608 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2609 ) -> Self {
2610 Self(RequestBuilder::new(stub))
2611 }
2612
2613 pub fn with_request<V: Into<crate::model::CreateRouteRequest>>(mut self, v: V) -> Self {
2615 self.0.request = v.into();
2616 self
2617 }
2618
2619 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2621 self.0.options = v.into();
2622 self
2623 }
2624
2625 pub async fn send(self) -> Result<longrunning::model::Operation> {
2632 (*self.0.stub)
2633 .create_route(self.0.request, self.0.options)
2634 .await
2635 .map(gax::response::Response::into_body)
2636 }
2637
2638 pub fn poller(
2640 self,
2641 ) -> impl lro::Poller<crate::model::Route, crate::model::OperationMetadata> {
2642 type Operation =
2643 lro::internal::Operation<crate::model::Route, crate::model::OperationMetadata>;
2644 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2645 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2646
2647 let stub = self.0.stub.clone();
2648 let mut options = self.0.options.clone();
2649 options.set_retry_policy(gax::retry_policy::NeverRetry);
2650 let query = move |name| {
2651 let stub = stub.clone();
2652 let options = options.clone();
2653 async {
2654 let op = GetOperation::new(stub)
2655 .set_name(name)
2656 .with_options(options)
2657 .send()
2658 .await?;
2659 Ok(Operation::new(op))
2660 }
2661 };
2662
2663 let start = move || async {
2664 let op = self.send().await?;
2665 Ok(Operation::new(op))
2666 };
2667
2668 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2669 }
2670
2671 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2675 self.0.request.parent = v.into();
2676 self
2677 }
2678
2679 pub fn set_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2683 self.0.request.route_id = v.into();
2684 self
2685 }
2686
2687 pub fn set_route<T>(mut self, v: T) -> Self
2691 where
2692 T: std::convert::Into<crate::model::Route>,
2693 {
2694 self.0.request.route = std::option::Option::Some(v.into());
2695 self
2696 }
2697
2698 pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
2702 where
2703 T: std::convert::Into<crate::model::Route>,
2704 {
2705 self.0.request.route = v.map(|x| x.into());
2706 self
2707 }
2708
2709 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2711 self.0.request.request_id = v.into();
2712 self
2713 }
2714 }
2715
2716 #[doc(hidden)]
2717 impl gax::options::internal::RequestBuilder for CreateRoute {
2718 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2719 &mut self.0.options
2720 }
2721 }
2722
2723 #[derive(Clone, Debug)]
2741 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
2742
2743 impl GetRoute {
2744 pub(crate) fn new(
2745 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2746 ) -> Self {
2747 Self(RequestBuilder::new(stub))
2748 }
2749
2750 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
2752 self.0.request = v.into();
2753 self
2754 }
2755
2756 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2758 self.0.options = v.into();
2759 self
2760 }
2761
2762 pub async fn send(self) -> Result<crate::model::Route> {
2764 (*self.0.stub)
2765 .get_route(self.0.request, self.0.options)
2766 .await
2767 .map(gax::response::Response::into_body)
2768 }
2769
2770 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2774 self.0.request.name = v.into();
2775 self
2776 }
2777 }
2778
2779 #[doc(hidden)]
2780 impl gax::options::internal::RequestBuilder for GetRoute {
2781 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2782 &mut self.0.options
2783 }
2784 }
2785
2786 #[derive(Clone, Debug)]
2808 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
2809
2810 impl ListRoutes {
2811 pub(crate) fn new(
2812 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2813 ) -> Self {
2814 Self(RequestBuilder::new(stub))
2815 }
2816
2817 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
2819 self.0.request = v.into();
2820 self
2821 }
2822
2823 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2825 self.0.options = v.into();
2826 self
2827 }
2828
2829 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
2831 (*self.0.stub)
2832 .list_routes(self.0.request, self.0.options)
2833 .await
2834 .map(gax::response::Response::into_body)
2835 }
2836
2837 pub fn by_page(
2839 self,
2840 ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
2841 {
2842 use std::clone::Clone;
2843 let token = self.0.request.page_token.clone();
2844 let execute = move |token: String| {
2845 let mut builder = self.clone();
2846 builder.0.request = builder.0.request.set_page_token(token);
2847 builder.send()
2848 };
2849 gax::paginator::internal::new_paginator(token, execute)
2850 }
2851
2852 pub fn by_item(
2854 self,
2855 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
2856 {
2857 use gax::paginator::Paginator;
2858 self.by_page().items()
2859 }
2860
2861 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2865 self.0.request.parent = v.into();
2866 self
2867 }
2868
2869 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2871 self.0.request.page_size = v.into();
2872 self
2873 }
2874
2875 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2877 self.0.request.page_token = v.into();
2878 self
2879 }
2880
2881 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2883 self.0.request.filter = v.into();
2884 self
2885 }
2886
2887 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2889 self.0.request.order_by = v.into();
2890 self
2891 }
2892 }
2893
2894 #[doc(hidden)]
2895 impl gax::options::internal::RequestBuilder for ListRoutes {
2896 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2897 &mut self.0.options
2898 }
2899 }
2900
2901 #[derive(Clone, Debug)]
2920 pub struct DeleteRoute(RequestBuilder<crate::model::DeleteRouteRequest>);
2921
2922 impl DeleteRoute {
2923 pub(crate) fn new(
2924 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2925 ) -> Self {
2926 Self(RequestBuilder::new(stub))
2927 }
2928
2929 pub fn with_request<V: Into<crate::model::DeleteRouteRequest>>(mut self, v: V) -> Self {
2931 self.0.request = v.into();
2932 self
2933 }
2934
2935 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2937 self.0.options = v.into();
2938 self
2939 }
2940
2941 pub async fn send(self) -> Result<longrunning::model::Operation> {
2948 (*self.0.stub)
2949 .delete_route(self.0.request, self.0.options)
2950 .await
2951 .map(gax::response::Response::into_body)
2952 }
2953
2954 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2956 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2957 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2958 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2959
2960 let stub = self.0.stub.clone();
2961 let mut options = self.0.options.clone();
2962 options.set_retry_policy(gax::retry_policy::NeverRetry);
2963 let query = move |name| {
2964 let stub = stub.clone();
2965 let options = options.clone();
2966 async {
2967 let op = GetOperation::new(stub)
2968 .set_name(name)
2969 .with_options(options)
2970 .send()
2971 .await?;
2972 Ok(Operation::new(op))
2973 }
2974 };
2975
2976 let start = move || async {
2977 let op = self.send().await?;
2978 Ok(Operation::new(op))
2979 };
2980
2981 lro::internal::new_unit_response_poller(
2982 polling_error_policy,
2983 polling_backoff_policy,
2984 start,
2985 query,
2986 )
2987 }
2988
2989 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2993 self.0.request.name = v.into();
2994 self
2995 }
2996
2997 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2999 self.0.request.request_id = v.into();
3000 self
3001 }
3002 }
3003
3004 #[doc(hidden)]
3005 impl gax::options::internal::RequestBuilder for DeleteRoute {
3006 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3007 &mut self.0.options
3008 }
3009 }
3010
3011 #[derive(Clone, Debug)]
3033 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3034
3035 impl ListLocations {
3036 pub(crate) fn new(
3037 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3038 ) -> Self {
3039 Self(RequestBuilder::new(stub))
3040 }
3041
3042 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3044 mut self,
3045 v: V,
3046 ) -> Self {
3047 self.0.request = v.into();
3048 self
3049 }
3050
3051 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3053 self.0.options = v.into();
3054 self
3055 }
3056
3057 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3059 (*self.0.stub)
3060 .list_locations(self.0.request, self.0.options)
3061 .await
3062 .map(gax::response::Response::into_body)
3063 }
3064
3065 pub fn by_page(
3067 self,
3068 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3069 {
3070 use std::clone::Clone;
3071 let token = self.0.request.page_token.clone();
3072 let execute = move |token: String| {
3073 let mut builder = self.clone();
3074 builder.0.request = builder.0.request.set_page_token(token);
3075 builder.send()
3076 };
3077 gax::paginator::internal::new_paginator(token, execute)
3078 }
3079
3080 pub fn by_item(
3082 self,
3083 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3084 {
3085 use gax::paginator::Paginator;
3086 self.by_page().items()
3087 }
3088
3089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3091 self.0.request.name = v.into();
3092 self
3093 }
3094
3095 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3097 self.0.request.filter = v.into();
3098 self
3099 }
3100
3101 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3103 self.0.request.page_size = v.into();
3104 self
3105 }
3106
3107 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3109 self.0.request.page_token = v.into();
3110 self
3111 }
3112 }
3113
3114 #[doc(hidden)]
3115 impl gax::options::internal::RequestBuilder for ListLocations {
3116 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3117 &mut self.0.options
3118 }
3119 }
3120
3121 #[derive(Clone, Debug)]
3139 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3140
3141 impl GetLocation {
3142 pub(crate) fn new(
3143 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3144 ) -> Self {
3145 Self(RequestBuilder::new(stub))
3146 }
3147
3148 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3150 self.0.request = v.into();
3151 self
3152 }
3153
3154 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3156 self.0.options = v.into();
3157 self
3158 }
3159
3160 pub async fn send(self) -> Result<location::model::Location> {
3162 (*self.0.stub)
3163 .get_location(self.0.request, self.0.options)
3164 .await
3165 .map(gax::response::Response::into_body)
3166 }
3167
3168 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3170 self.0.request.name = v.into();
3171 self
3172 }
3173 }
3174
3175 #[doc(hidden)]
3176 impl gax::options::internal::RequestBuilder for GetLocation {
3177 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3178 &mut self.0.options
3179 }
3180 }
3181
3182 #[derive(Clone, Debug)]
3204 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3205
3206 impl ListOperations {
3207 pub(crate) fn new(
3208 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3209 ) -> Self {
3210 Self(RequestBuilder::new(stub))
3211 }
3212
3213 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3215 mut self,
3216 v: V,
3217 ) -> Self {
3218 self.0.request = v.into();
3219 self
3220 }
3221
3222 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3224 self.0.options = v.into();
3225 self
3226 }
3227
3228 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3230 (*self.0.stub)
3231 .list_operations(self.0.request, self.0.options)
3232 .await
3233 .map(gax::response::Response::into_body)
3234 }
3235
3236 pub fn by_page(
3238 self,
3239 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3240 {
3241 use std::clone::Clone;
3242 let token = self.0.request.page_token.clone();
3243 let execute = move |token: String| {
3244 let mut builder = self.clone();
3245 builder.0.request = builder.0.request.set_page_token(token);
3246 builder.send()
3247 };
3248 gax::paginator::internal::new_paginator(token, execute)
3249 }
3250
3251 pub fn by_item(
3253 self,
3254 ) -> impl gax::paginator::ItemPaginator<
3255 longrunning::model::ListOperationsResponse,
3256 gax::error::Error,
3257 > {
3258 use gax::paginator::Paginator;
3259 self.by_page().items()
3260 }
3261
3262 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3264 self.0.request.name = v.into();
3265 self
3266 }
3267
3268 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3270 self.0.request.filter = v.into();
3271 self
3272 }
3273
3274 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3276 self.0.request.page_size = v.into();
3277 self
3278 }
3279
3280 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3282 self.0.request.page_token = v.into();
3283 self
3284 }
3285 }
3286
3287 #[doc(hidden)]
3288 impl gax::options::internal::RequestBuilder for ListOperations {
3289 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3290 &mut self.0.options
3291 }
3292 }
3293
3294 #[derive(Clone, Debug)]
3312 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3313
3314 impl GetOperation {
3315 pub(crate) fn new(
3316 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3317 ) -> Self {
3318 Self(RequestBuilder::new(stub))
3319 }
3320
3321 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3323 mut self,
3324 v: V,
3325 ) -> Self {
3326 self.0.request = v.into();
3327 self
3328 }
3329
3330 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3332 self.0.options = v.into();
3333 self
3334 }
3335
3336 pub async fn send(self) -> Result<longrunning::model::Operation> {
3338 (*self.0.stub)
3339 .get_operation(self.0.request, self.0.options)
3340 .await
3341 .map(gax::response::Response::into_body)
3342 }
3343
3344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3346 self.0.request.name = v.into();
3347 self
3348 }
3349 }
3350
3351 #[doc(hidden)]
3352 impl gax::options::internal::RequestBuilder for GetOperation {
3353 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3354 &mut self.0.options
3355 }
3356 }
3357
3358 #[derive(Clone, Debug)]
3376 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3377
3378 impl DeleteOperation {
3379 pub(crate) fn new(
3380 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3381 ) -> Self {
3382 Self(RequestBuilder::new(stub))
3383 }
3384
3385 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3387 mut self,
3388 v: V,
3389 ) -> Self {
3390 self.0.request = v.into();
3391 self
3392 }
3393
3394 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3396 self.0.options = v.into();
3397 self
3398 }
3399
3400 pub async fn send(self) -> Result<()> {
3402 (*self.0.stub)
3403 .delete_operation(self.0.request, self.0.options)
3404 .await
3405 .map(gax::response::Response::into_body)
3406 }
3407
3408 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3410 self.0.request.name = v.into();
3411 self
3412 }
3413 }
3414
3415 #[doc(hidden)]
3416 impl gax::options::internal::RequestBuilder for DeleteOperation {
3417 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3418 &mut self.0.options
3419 }
3420 }
3421
3422 #[derive(Clone, Debug)]
3440 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3441
3442 impl CancelOperation {
3443 pub(crate) fn new(
3444 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3445 ) -> Self {
3446 Self(RequestBuilder::new(stub))
3447 }
3448
3449 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3451 mut self,
3452 v: V,
3453 ) -> Self {
3454 self.0.request = v.into();
3455 self
3456 }
3457
3458 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3460 self.0.options = v.into();
3461 self
3462 }
3463
3464 pub async fn send(self) -> Result<()> {
3466 (*self.0.stub)
3467 .cancel_operation(self.0.request, self.0.options)
3468 .await
3469 .map(gax::response::Response::into_body)
3470 }
3471
3472 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3474 self.0.request.name = v.into();
3475 self
3476 }
3477 }
3478
3479 #[doc(hidden)]
3480 impl gax::options::internal::RequestBuilder for CancelOperation {
3481 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3482 &mut self.0.options
3483 }
3484 }
3485}