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)]
95 pub struct ListConnectionProfiles(RequestBuilder<crate::model::ListConnectionProfilesRequest>);
96
97 impl ListConnectionProfiles {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListConnectionProfilesRequest>>(
106 mut self,
107 v: V,
108 ) -> Self {
109 self.0.request = v.into();
110 self
111 }
112
113 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
115 self.0.options = v.into();
116 self
117 }
118
119 pub async fn send(self) -> Result<crate::model::ListConnectionProfilesResponse> {
121 (*self.0.stub)
122 .list_connection_profiles(self.0.request, self.0.options)
123 .await
124 .map(gax::response::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl gax::paginator::Paginator<
131 crate::model::ListConnectionProfilesResponse,
132 gax::error::Error,
133 > {
134 use std::clone::Clone;
135 let token = self.0.request.page_token.clone();
136 let execute = move |token: String| {
137 let mut builder = self.clone();
138 builder.0.request = builder.0.request.set_page_token(token);
139 builder.send()
140 };
141 gax::paginator::internal::new_paginator(token, execute)
142 }
143
144 pub fn by_item(
146 self,
147 ) -> impl gax::paginator::ItemPaginator<
148 crate::model::ListConnectionProfilesResponse,
149 gax::error::Error,
150 > {
151 use gax::paginator::Paginator;
152 self.by_page().items()
153 }
154
155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159 self.0.request.parent = v.into();
160 self
161 }
162
163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165 self.0.request.page_size = v.into();
166 self
167 }
168
169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.page_token = v.into();
172 self
173 }
174
175 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.filter = v.into();
178 self
179 }
180
181 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
183 self.0.request.order_by = v.into();
184 self
185 }
186 }
187
188 #[doc(hidden)]
189 impl gax::options::internal::RequestBuilder for ListConnectionProfiles {
190 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
191 &mut self.0.options
192 }
193 }
194
195 #[derive(Clone, Debug)]
212 pub struct GetConnectionProfile(RequestBuilder<crate::model::GetConnectionProfileRequest>);
213
214 impl GetConnectionProfile {
215 pub(crate) fn new(
216 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
217 ) -> Self {
218 Self(RequestBuilder::new(stub))
219 }
220
221 pub fn with_request<V: Into<crate::model::GetConnectionProfileRequest>>(
223 mut self,
224 v: V,
225 ) -> Self {
226 self.0.request = v.into();
227 self
228 }
229
230 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
232 self.0.options = v.into();
233 self
234 }
235
236 pub async fn send(self) -> Result<crate::model::ConnectionProfile> {
238 (*self.0.stub)
239 .get_connection_profile(self.0.request, self.0.options)
240 .await
241 .map(gax::response::Response::into_body)
242 }
243
244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
248 self.0.request.name = v.into();
249 self
250 }
251 }
252
253 #[doc(hidden)]
254 impl gax::options::internal::RequestBuilder for GetConnectionProfile {
255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
256 &mut self.0.options
257 }
258 }
259
260 #[derive(Clone, Debug)]
278 pub struct CreateConnectionProfile(
279 RequestBuilder<crate::model::CreateConnectionProfileRequest>,
280 );
281
282 impl CreateConnectionProfile {
283 pub(crate) fn new(
284 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
285 ) -> Self {
286 Self(RequestBuilder::new(stub))
287 }
288
289 pub fn with_request<V: Into<crate::model::CreateConnectionProfileRequest>>(
291 mut self,
292 v: V,
293 ) -> Self {
294 self.0.request = v.into();
295 self
296 }
297
298 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
300 self.0.options = v.into();
301 self
302 }
303
304 pub async fn send(self) -> Result<longrunning::model::Operation> {
311 (*self.0.stub)
312 .create_connection_profile(self.0.request, self.0.options)
313 .await
314 .map(gax::response::Response::into_body)
315 }
316
317 pub fn poller(
319 self,
320 ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
321 {
322 type Operation = lro::internal::Operation<
323 crate::model::ConnectionProfile,
324 crate::model::OperationMetadata,
325 >;
326 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
327 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
328
329 let stub = self.0.stub.clone();
330 let mut options = self.0.options.clone();
331 options.set_retry_policy(gax::retry_policy::NeverRetry);
332 let query = move |name| {
333 let stub = stub.clone();
334 let options = options.clone();
335 async {
336 let op = GetOperation::new(stub)
337 .set_name(name)
338 .with_options(options)
339 .send()
340 .await?;
341 Ok(Operation::new(op))
342 }
343 };
344
345 let start = move || async {
346 let op = self.send().await?;
347 Ok(Operation::new(op))
348 };
349
350 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
351 }
352
353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
357 self.0.request.parent = v.into();
358 self
359 }
360
361 pub fn set_connection_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
365 self.0.request.connection_profile_id = v.into();
366 self
367 }
368
369 pub fn set_connection_profile<T>(mut self, v: T) -> Self
373 where
374 T: std::convert::Into<crate::model::ConnectionProfile>,
375 {
376 self.0.request.connection_profile = std::option::Option::Some(v.into());
377 self
378 }
379
380 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
384 where
385 T: std::convert::Into<crate::model::ConnectionProfile>,
386 {
387 self.0.request.connection_profile = v.map(|x| x.into());
388 self
389 }
390
391 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
393 self.0.request.request_id = v.into();
394 self
395 }
396
397 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
399 self.0.request.validate_only = v.into();
400 self
401 }
402
403 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
405 self.0.request.force = v.into();
406 self
407 }
408 }
409
410 #[doc(hidden)]
411 impl gax::options::internal::RequestBuilder for CreateConnectionProfile {
412 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
413 &mut self.0.options
414 }
415 }
416
417 #[derive(Clone, Debug)]
435 pub struct UpdateConnectionProfile(
436 RequestBuilder<crate::model::UpdateConnectionProfileRequest>,
437 );
438
439 impl UpdateConnectionProfile {
440 pub(crate) fn new(
441 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
442 ) -> Self {
443 Self(RequestBuilder::new(stub))
444 }
445
446 pub fn with_request<V: Into<crate::model::UpdateConnectionProfileRequest>>(
448 mut self,
449 v: V,
450 ) -> Self {
451 self.0.request = v.into();
452 self
453 }
454
455 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
457 self.0.options = v.into();
458 self
459 }
460
461 pub async fn send(self) -> Result<longrunning::model::Operation> {
468 (*self.0.stub)
469 .update_connection_profile(self.0.request, self.0.options)
470 .await
471 .map(gax::response::Response::into_body)
472 }
473
474 pub fn poller(
476 self,
477 ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
478 {
479 type Operation = lro::internal::Operation<
480 crate::model::ConnectionProfile,
481 crate::model::OperationMetadata,
482 >;
483 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
484 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
485
486 let stub = self.0.stub.clone();
487 let mut options = self.0.options.clone();
488 options.set_retry_policy(gax::retry_policy::NeverRetry);
489 let query = move |name| {
490 let stub = stub.clone();
491 let options = options.clone();
492 async {
493 let op = GetOperation::new(stub)
494 .set_name(name)
495 .with_options(options)
496 .send()
497 .await?;
498 Ok(Operation::new(op))
499 }
500 };
501
502 let start = move || async {
503 let op = self.send().await?;
504 Ok(Operation::new(op))
505 };
506
507 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
508 }
509
510 pub fn set_update_mask<T>(mut self, v: T) -> Self
512 where
513 T: std::convert::Into<wkt::FieldMask>,
514 {
515 self.0.request.update_mask = std::option::Option::Some(v.into());
516 self
517 }
518
519 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
521 where
522 T: std::convert::Into<wkt::FieldMask>,
523 {
524 self.0.request.update_mask = v.map(|x| x.into());
525 self
526 }
527
528 pub fn set_connection_profile<T>(mut self, v: T) -> Self
532 where
533 T: std::convert::Into<crate::model::ConnectionProfile>,
534 {
535 self.0.request.connection_profile = std::option::Option::Some(v.into());
536 self
537 }
538
539 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
543 where
544 T: std::convert::Into<crate::model::ConnectionProfile>,
545 {
546 self.0.request.connection_profile = v.map(|x| x.into());
547 self
548 }
549
550 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
552 self.0.request.request_id = v.into();
553 self
554 }
555
556 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
558 self.0.request.validate_only = v.into();
559 self
560 }
561
562 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
564 self.0.request.force = v.into();
565 self
566 }
567 }
568
569 #[doc(hidden)]
570 impl gax::options::internal::RequestBuilder for UpdateConnectionProfile {
571 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
572 &mut self.0.options
573 }
574 }
575
576 #[derive(Clone, Debug)]
594 pub struct DeleteConnectionProfile(
595 RequestBuilder<crate::model::DeleteConnectionProfileRequest>,
596 );
597
598 impl DeleteConnectionProfile {
599 pub(crate) fn new(
600 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
601 ) -> Self {
602 Self(RequestBuilder::new(stub))
603 }
604
605 pub fn with_request<V: Into<crate::model::DeleteConnectionProfileRequest>>(
607 mut self,
608 v: V,
609 ) -> Self {
610 self.0.request = v.into();
611 self
612 }
613
614 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
616 self.0.options = v.into();
617 self
618 }
619
620 pub async fn send(self) -> Result<longrunning::model::Operation> {
627 (*self.0.stub)
628 .delete_connection_profile(self.0.request, self.0.options)
629 .await
630 .map(gax::response::Response::into_body)
631 }
632
633 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
635 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
636 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
637 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
638
639 let stub = self.0.stub.clone();
640 let mut options = self.0.options.clone();
641 options.set_retry_policy(gax::retry_policy::NeverRetry);
642 let query = move |name| {
643 let stub = stub.clone();
644 let options = options.clone();
645 async {
646 let op = GetOperation::new(stub)
647 .set_name(name)
648 .with_options(options)
649 .send()
650 .await?;
651 Ok(Operation::new(op))
652 }
653 };
654
655 let start = move || async {
656 let op = self.send().await?;
657 Ok(Operation::new(op))
658 };
659
660 lro::internal::new_unit_response_poller(
661 polling_error_policy,
662 polling_backoff_policy,
663 start,
664 query,
665 )
666 }
667
668 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
672 self.0.request.name = v.into();
673 self
674 }
675
676 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
678 self.0.request.request_id = v.into();
679 self
680 }
681 }
682
683 #[doc(hidden)]
684 impl gax::options::internal::RequestBuilder for DeleteConnectionProfile {
685 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
686 &mut self.0.options
687 }
688 }
689
690 #[derive(Clone, Debug)]
707 pub struct DiscoverConnectionProfile(
708 RequestBuilder<crate::model::DiscoverConnectionProfileRequest>,
709 );
710
711 impl DiscoverConnectionProfile {
712 pub(crate) fn new(
713 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
714 ) -> Self {
715 Self(RequestBuilder::new(stub))
716 }
717
718 pub fn with_request<V: Into<crate::model::DiscoverConnectionProfileRequest>>(
720 mut self,
721 v: V,
722 ) -> Self {
723 self.0.request = v.into();
724 self
725 }
726
727 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
729 self.0.options = v.into();
730 self
731 }
732
733 pub async fn send(self) -> Result<crate::model::DiscoverConnectionProfileResponse> {
735 (*self.0.stub)
736 .discover_connection_profile(self.0.request, self.0.options)
737 .await
738 .map(gax::response::Response::into_body)
739 }
740
741 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
745 self.0.request.parent = v.into();
746 self
747 }
748
749 pub fn set_target<
754 T: Into<Option<crate::model::discover_connection_profile_request::Target>>,
755 >(
756 mut self,
757 v: T,
758 ) -> Self {
759 self.0.request.target = v.into();
760 self
761 }
762
763 pub fn set_connection_profile<
769 T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
770 >(
771 mut self,
772 v: T,
773 ) -> Self {
774 self.0.request = self.0.request.set_connection_profile(v);
775 self
776 }
777
778 pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
784 mut self,
785 v: T,
786 ) -> Self {
787 self.0.request = self.0.request.set_connection_profile_name(v);
788 self
789 }
790
791 pub fn set_hierarchy<
796 T: Into<Option<crate::model::discover_connection_profile_request::Hierarchy>>,
797 >(
798 mut self,
799 v: T,
800 ) -> Self {
801 self.0.request.hierarchy = v.into();
802 self
803 }
804
805 pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
811 self.0.request = self.0.request.set_full_hierarchy(v);
812 self
813 }
814
815 pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
821 self.0.request = self.0.request.set_hierarchy_depth(v);
822 self
823 }
824
825 pub fn set_data_object<
830 T: Into<Option<crate::model::discover_connection_profile_request::DataObject>>,
831 >(
832 mut self,
833 v: T,
834 ) -> Self {
835 self.0.request.data_object = v.into();
836 self
837 }
838
839 pub fn set_oracle_rdbms<
845 T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
846 >(
847 mut self,
848 v: T,
849 ) -> Self {
850 self.0.request = self.0.request.set_oracle_rdbms(v);
851 self
852 }
853
854 pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
860 mut self,
861 v: T,
862 ) -> Self {
863 self.0.request = self.0.request.set_mysql_rdbms(v);
864 self
865 }
866
867 pub fn set_postgresql_rdbms<
873 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
874 >(
875 mut self,
876 v: T,
877 ) -> Self {
878 self.0.request = self.0.request.set_postgresql_rdbms(v);
879 self
880 }
881
882 pub fn set_sql_server_rdbms<
888 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
889 >(
890 mut self,
891 v: T,
892 ) -> Self {
893 self.0.request = self.0.request.set_sql_server_rdbms(v);
894 self
895 }
896
897 pub fn set_salesforce_org<
903 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
904 >(
905 mut self,
906 v: T,
907 ) -> Self {
908 self.0.request = self.0.request.set_salesforce_org(v);
909 self
910 }
911
912 pub fn set_mongodb_cluster<
918 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
919 >(
920 mut self,
921 v: T,
922 ) -> Self {
923 self.0.request = self.0.request.set_mongodb_cluster(v);
924 self
925 }
926 }
927
928 #[doc(hidden)]
929 impl gax::options::internal::RequestBuilder for DiscoverConnectionProfile {
930 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
931 &mut self.0.options
932 }
933 }
934
935 #[derive(Clone, Debug)]
956 pub struct ListStreams(RequestBuilder<crate::model::ListStreamsRequest>);
957
958 impl ListStreams {
959 pub(crate) fn new(
960 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
961 ) -> Self {
962 Self(RequestBuilder::new(stub))
963 }
964
965 pub fn with_request<V: Into<crate::model::ListStreamsRequest>>(mut self, v: V) -> Self {
967 self.0.request = v.into();
968 self
969 }
970
971 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
973 self.0.options = v.into();
974 self
975 }
976
977 pub async fn send(self) -> Result<crate::model::ListStreamsResponse> {
979 (*self.0.stub)
980 .list_streams(self.0.request, self.0.options)
981 .await
982 .map(gax::response::Response::into_body)
983 }
984
985 pub fn by_page(
987 self,
988 ) -> impl gax::paginator::Paginator<crate::model::ListStreamsResponse, gax::error::Error>
989 {
990 use std::clone::Clone;
991 let token = self.0.request.page_token.clone();
992 let execute = move |token: String| {
993 let mut builder = self.clone();
994 builder.0.request = builder.0.request.set_page_token(token);
995 builder.send()
996 };
997 gax::paginator::internal::new_paginator(token, execute)
998 }
999
1000 pub fn by_item(
1002 self,
1003 ) -> impl gax::paginator::ItemPaginator<crate::model::ListStreamsResponse, gax::error::Error>
1004 {
1005 use gax::paginator::Paginator;
1006 self.by_page().items()
1007 }
1008
1009 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1013 self.0.request.parent = v.into();
1014 self
1015 }
1016
1017 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1019 self.0.request.page_size = v.into();
1020 self
1021 }
1022
1023 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1025 self.0.request.page_token = v.into();
1026 self
1027 }
1028
1029 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1031 self.0.request.filter = v.into();
1032 self
1033 }
1034
1035 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1037 self.0.request.order_by = v.into();
1038 self
1039 }
1040 }
1041
1042 #[doc(hidden)]
1043 impl gax::options::internal::RequestBuilder for ListStreams {
1044 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1045 &mut self.0.options
1046 }
1047 }
1048
1049 #[derive(Clone, Debug)]
1066 pub struct GetStream(RequestBuilder<crate::model::GetStreamRequest>);
1067
1068 impl GetStream {
1069 pub(crate) fn new(
1070 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1071 ) -> Self {
1072 Self(RequestBuilder::new(stub))
1073 }
1074
1075 pub fn with_request<V: Into<crate::model::GetStreamRequest>>(mut self, v: V) -> Self {
1077 self.0.request = v.into();
1078 self
1079 }
1080
1081 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1083 self.0.options = v.into();
1084 self
1085 }
1086
1087 pub async fn send(self) -> Result<crate::model::Stream> {
1089 (*self.0.stub)
1090 .get_stream(self.0.request, self.0.options)
1091 .await
1092 .map(gax::response::Response::into_body)
1093 }
1094
1095 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1099 self.0.request.name = v.into();
1100 self
1101 }
1102 }
1103
1104 #[doc(hidden)]
1105 impl gax::options::internal::RequestBuilder for GetStream {
1106 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1107 &mut self.0.options
1108 }
1109 }
1110
1111 #[derive(Clone, Debug)]
1129 pub struct CreateStream(RequestBuilder<crate::model::CreateStreamRequest>);
1130
1131 impl CreateStream {
1132 pub(crate) fn new(
1133 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1134 ) -> Self {
1135 Self(RequestBuilder::new(stub))
1136 }
1137
1138 pub fn with_request<V: Into<crate::model::CreateStreamRequest>>(mut self, v: V) -> Self {
1140 self.0.request = v.into();
1141 self
1142 }
1143
1144 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1146 self.0.options = v.into();
1147 self
1148 }
1149
1150 pub async fn send(self) -> Result<longrunning::model::Operation> {
1157 (*self.0.stub)
1158 .create_stream(self.0.request, self.0.options)
1159 .await
1160 .map(gax::response::Response::into_body)
1161 }
1162
1163 pub fn poller(
1165 self,
1166 ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1167 type Operation =
1168 lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1169 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1170 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1171
1172 let stub = self.0.stub.clone();
1173 let mut options = self.0.options.clone();
1174 options.set_retry_policy(gax::retry_policy::NeverRetry);
1175 let query = move |name| {
1176 let stub = stub.clone();
1177 let options = options.clone();
1178 async {
1179 let op = GetOperation::new(stub)
1180 .set_name(name)
1181 .with_options(options)
1182 .send()
1183 .await?;
1184 Ok(Operation::new(op))
1185 }
1186 };
1187
1188 let start = move || async {
1189 let op = self.send().await?;
1190 Ok(Operation::new(op))
1191 };
1192
1193 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1194 }
1195
1196 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1200 self.0.request.parent = v.into();
1201 self
1202 }
1203
1204 pub fn set_stream_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1208 self.0.request.stream_id = v.into();
1209 self
1210 }
1211
1212 pub fn set_stream<T>(mut self, v: T) -> Self
1216 where
1217 T: std::convert::Into<crate::model::Stream>,
1218 {
1219 self.0.request.stream = std::option::Option::Some(v.into());
1220 self
1221 }
1222
1223 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1227 where
1228 T: std::convert::Into<crate::model::Stream>,
1229 {
1230 self.0.request.stream = v.map(|x| x.into());
1231 self
1232 }
1233
1234 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1236 self.0.request.request_id = v.into();
1237 self
1238 }
1239
1240 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1242 self.0.request.validate_only = v.into();
1243 self
1244 }
1245
1246 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1248 self.0.request.force = v.into();
1249 self
1250 }
1251 }
1252
1253 #[doc(hidden)]
1254 impl gax::options::internal::RequestBuilder for CreateStream {
1255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1256 &mut self.0.options
1257 }
1258 }
1259
1260 #[derive(Clone, Debug)]
1278 pub struct UpdateStream(RequestBuilder<crate::model::UpdateStreamRequest>);
1279
1280 impl UpdateStream {
1281 pub(crate) fn new(
1282 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1283 ) -> Self {
1284 Self(RequestBuilder::new(stub))
1285 }
1286
1287 pub fn with_request<V: Into<crate::model::UpdateStreamRequest>>(mut self, v: V) -> Self {
1289 self.0.request = v.into();
1290 self
1291 }
1292
1293 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1295 self.0.options = v.into();
1296 self
1297 }
1298
1299 pub async fn send(self) -> Result<longrunning::model::Operation> {
1306 (*self.0.stub)
1307 .update_stream(self.0.request, self.0.options)
1308 .await
1309 .map(gax::response::Response::into_body)
1310 }
1311
1312 pub fn poller(
1314 self,
1315 ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1316 type Operation =
1317 lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1320
1321 let stub = self.0.stub.clone();
1322 let mut options = self.0.options.clone();
1323 options.set_retry_policy(gax::retry_policy::NeverRetry);
1324 let query = move |name| {
1325 let stub = stub.clone();
1326 let options = options.clone();
1327 async {
1328 let op = GetOperation::new(stub)
1329 .set_name(name)
1330 .with_options(options)
1331 .send()
1332 .await?;
1333 Ok(Operation::new(op))
1334 }
1335 };
1336
1337 let start = move || async {
1338 let op = self.send().await?;
1339 Ok(Operation::new(op))
1340 };
1341
1342 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1343 }
1344
1345 pub fn set_update_mask<T>(mut self, v: T) -> Self
1347 where
1348 T: std::convert::Into<wkt::FieldMask>,
1349 {
1350 self.0.request.update_mask = std::option::Option::Some(v.into());
1351 self
1352 }
1353
1354 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1356 where
1357 T: std::convert::Into<wkt::FieldMask>,
1358 {
1359 self.0.request.update_mask = v.map(|x| x.into());
1360 self
1361 }
1362
1363 pub fn set_stream<T>(mut self, v: T) -> Self
1367 where
1368 T: std::convert::Into<crate::model::Stream>,
1369 {
1370 self.0.request.stream = std::option::Option::Some(v.into());
1371 self
1372 }
1373
1374 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1378 where
1379 T: std::convert::Into<crate::model::Stream>,
1380 {
1381 self.0.request.stream = v.map(|x| x.into());
1382 self
1383 }
1384
1385 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1387 self.0.request.request_id = v.into();
1388 self
1389 }
1390
1391 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1393 self.0.request.validate_only = v.into();
1394 self
1395 }
1396
1397 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1399 self.0.request.force = v.into();
1400 self
1401 }
1402 }
1403
1404 #[doc(hidden)]
1405 impl gax::options::internal::RequestBuilder for UpdateStream {
1406 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1407 &mut self.0.options
1408 }
1409 }
1410
1411 #[derive(Clone, Debug)]
1429 pub struct DeleteStream(RequestBuilder<crate::model::DeleteStreamRequest>);
1430
1431 impl DeleteStream {
1432 pub(crate) fn new(
1433 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1434 ) -> Self {
1435 Self(RequestBuilder::new(stub))
1436 }
1437
1438 pub fn with_request<V: Into<crate::model::DeleteStreamRequest>>(mut self, v: V) -> Self {
1440 self.0.request = v.into();
1441 self
1442 }
1443
1444 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1446 self.0.options = v.into();
1447 self
1448 }
1449
1450 pub async fn send(self) -> Result<longrunning::model::Operation> {
1457 (*self.0.stub)
1458 .delete_stream(self.0.request, self.0.options)
1459 .await
1460 .map(gax::response::Response::into_body)
1461 }
1462
1463 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1465 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1468
1469 let stub = self.0.stub.clone();
1470 let mut options = self.0.options.clone();
1471 options.set_retry_policy(gax::retry_policy::NeverRetry);
1472 let query = move |name| {
1473 let stub = stub.clone();
1474 let options = options.clone();
1475 async {
1476 let op = GetOperation::new(stub)
1477 .set_name(name)
1478 .with_options(options)
1479 .send()
1480 .await?;
1481 Ok(Operation::new(op))
1482 }
1483 };
1484
1485 let start = move || async {
1486 let op = self.send().await?;
1487 Ok(Operation::new(op))
1488 };
1489
1490 lro::internal::new_unit_response_poller(
1491 polling_error_policy,
1492 polling_backoff_policy,
1493 start,
1494 query,
1495 )
1496 }
1497
1498 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1502 self.0.request.name = v.into();
1503 self
1504 }
1505
1506 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1508 self.0.request.request_id = v.into();
1509 self
1510 }
1511 }
1512
1513 #[doc(hidden)]
1514 impl gax::options::internal::RequestBuilder for DeleteStream {
1515 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1516 &mut self.0.options
1517 }
1518 }
1519
1520 #[derive(Clone, Debug)]
1538 pub struct RunStream(RequestBuilder<crate::model::RunStreamRequest>);
1539
1540 impl RunStream {
1541 pub(crate) fn new(
1542 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1543 ) -> Self {
1544 Self(RequestBuilder::new(stub))
1545 }
1546
1547 pub fn with_request<V: Into<crate::model::RunStreamRequest>>(mut self, v: V) -> Self {
1549 self.0.request = v.into();
1550 self
1551 }
1552
1553 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1555 self.0.options = v.into();
1556 self
1557 }
1558
1559 pub async fn send(self) -> Result<longrunning::model::Operation> {
1566 (*self.0.stub)
1567 .run_stream(self.0.request, self.0.options)
1568 .await
1569 .map(gax::response::Response::into_body)
1570 }
1571
1572 pub fn poller(
1574 self,
1575 ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1576 type Operation =
1577 lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1578 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1579 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1580
1581 let stub = self.0.stub.clone();
1582 let mut options = self.0.options.clone();
1583 options.set_retry_policy(gax::retry_policy::NeverRetry);
1584 let query = move |name| {
1585 let stub = stub.clone();
1586 let options = options.clone();
1587 async {
1588 let op = GetOperation::new(stub)
1589 .set_name(name)
1590 .with_options(options)
1591 .send()
1592 .await?;
1593 Ok(Operation::new(op))
1594 }
1595 };
1596
1597 let start = move || async {
1598 let op = self.send().await?;
1599 Ok(Operation::new(op))
1600 };
1601
1602 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1603 }
1604
1605 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1609 self.0.request.name = v.into();
1610 self
1611 }
1612
1613 pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
1615 where
1616 T: std::convert::Into<crate::model::CdcStrategy>,
1617 {
1618 self.0.request.cdc_strategy = std::option::Option::Some(v.into());
1619 self
1620 }
1621
1622 pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
1624 where
1625 T: std::convert::Into<crate::model::CdcStrategy>,
1626 {
1627 self.0.request.cdc_strategy = v.map(|x| x.into());
1628 self
1629 }
1630
1631 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1633 self.0.request.force = v.into();
1634 self
1635 }
1636 }
1637
1638 #[doc(hidden)]
1639 impl gax::options::internal::RequestBuilder for RunStream {
1640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1641 &mut self.0.options
1642 }
1643 }
1644
1645 #[derive(Clone, Debug)]
1662 pub struct GetStreamObject(RequestBuilder<crate::model::GetStreamObjectRequest>);
1663
1664 impl GetStreamObject {
1665 pub(crate) fn new(
1666 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1667 ) -> Self {
1668 Self(RequestBuilder::new(stub))
1669 }
1670
1671 pub fn with_request<V: Into<crate::model::GetStreamObjectRequest>>(mut self, v: V) -> Self {
1673 self.0.request = v.into();
1674 self
1675 }
1676
1677 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1679 self.0.options = v.into();
1680 self
1681 }
1682
1683 pub async fn send(self) -> Result<crate::model::StreamObject> {
1685 (*self.0.stub)
1686 .get_stream_object(self.0.request, self.0.options)
1687 .await
1688 .map(gax::response::Response::into_body)
1689 }
1690
1691 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1695 self.0.request.name = v.into();
1696 self
1697 }
1698 }
1699
1700 #[doc(hidden)]
1701 impl gax::options::internal::RequestBuilder for GetStreamObject {
1702 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1703 &mut self.0.options
1704 }
1705 }
1706
1707 #[derive(Clone, Debug)]
1724 pub struct LookupStreamObject(RequestBuilder<crate::model::LookupStreamObjectRequest>);
1725
1726 impl LookupStreamObject {
1727 pub(crate) fn new(
1728 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1729 ) -> Self {
1730 Self(RequestBuilder::new(stub))
1731 }
1732
1733 pub fn with_request<V: Into<crate::model::LookupStreamObjectRequest>>(
1735 mut self,
1736 v: V,
1737 ) -> Self {
1738 self.0.request = v.into();
1739 self
1740 }
1741
1742 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1744 self.0.options = v.into();
1745 self
1746 }
1747
1748 pub async fn send(self) -> Result<crate::model::StreamObject> {
1750 (*self.0.stub)
1751 .lookup_stream_object(self.0.request, self.0.options)
1752 .await
1753 .map(gax::response::Response::into_body)
1754 }
1755
1756 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1760 self.0.request.parent = v.into();
1761 self
1762 }
1763
1764 pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
1768 where
1769 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1770 {
1771 self.0.request.source_object_identifier = std::option::Option::Some(v.into());
1772 self
1773 }
1774
1775 pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
1779 where
1780 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1781 {
1782 self.0.request.source_object_identifier = v.map(|x| x.into());
1783 self
1784 }
1785 }
1786
1787 #[doc(hidden)]
1788 impl gax::options::internal::RequestBuilder for LookupStreamObject {
1789 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1790 &mut self.0.options
1791 }
1792 }
1793
1794 #[derive(Clone, Debug)]
1815 pub struct ListStreamObjects(RequestBuilder<crate::model::ListStreamObjectsRequest>);
1816
1817 impl ListStreamObjects {
1818 pub(crate) fn new(
1819 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1820 ) -> Self {
1821 Self(RequestBuilder::new(stub))
1822 }
1823
1824 pub fn with_request<V: Into<crate::model::ListStreamObjectsRequest>>(
1826 mut self,
1827 v: V,
1828 ) -> Self {
1829 self.0.request = v.into();
1830 self
1831 }
1832
1833 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1835 self.0.options = v.into();
1836 self
1837 }
1838
1839 pub async fn send(self) -> Result<crate::model::ListStreamObjectsResponse> {
1841 (*self.0.stub)
1842 .list_stream_objects(self.0.request, self.0.options)
1843 .await
1844 .map(gax::response::Response::into_body)
1845 }
1846
1847 pub fn by_page(
1849 self,
1850 ) -> impl gax::paginator::Paginator<crate::model::ListStreamObjectsResponse, gax::error::Error>
1851 {
1852 use std::clone::Clone;
1853 let token = self.0.request.page_token.clone();
1854 let execute = move |token: String| {
1855 let mut builder = self.clone();
1856 builder.0.request = builder.0.request.set_page_token(token);
1857 builder.send()
1858 };
1859 gax::paginator::internal::new_paginator(token, execute)
1860 }
1861
1862 pub fn by_item(
1864 self,
1865 ) -> impl gax::paginator::ItemPaginator<crate::model::ListStreamObjectsResponse, gax::error::Error>
1866 {
1867 use gax::paginator::Paginator;
1868 self.by_page().items()
1869 }
1870
1871 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1875 self.0.request.parent = v.into();
1876 self
1877 }
1878
1879 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1881 self.0.request.page_size = v.into();
1882 self
1883 }
1884
1885 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1887 self.0.request.page_token = v.into();
1888 self
1889 }
1890 }
1891
1892 #[doc(hidden)]
1893 impl gax::options::internal::RequestBuilder for ListStreamObjects {
1894 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1895 &mut self.0.options
1896 }
1897 }
1898
1899 #[derive(Clone, Debug)]
1916 pub struct StartBackfillJob(RequestBuilder<crate::model::StartBackfillJobRequest>);
1917
1918 impl StartBackfillJob {
1919 pub(crate) fn new(
1920 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1921 ) -> Self {
1922 Self(RequestBuilder::new(stub))
1923 }
1924
1925 pub fn with_request<V: Into<crate::model::StartBackfillJobRequest>>(
1927 mut self,
1928 v: V,
1929 ) -> Self {
1930 self.0.request = v.into();
1931 self
1932 }
1933
1934 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1936 self.0.options = v.into();
1937 self
1938 }
1939
1940 pub async fn send(self) -> Result<crate::model::StartBackfillJobResponse> {
1942 (*self.0.stub)
1943 .start_backfill_job(self.0.request, self.0.options)
1944 .await
1945 .map(gax::response::Response::into_body)
1946 }
1947
1948 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.0.request.object = v.into();
1953 self
1954 }
1955 }
1956
1957 #[doc(hidden)]
1958 impl gax::options::internal::RequestBuilder for StartBackfillJob {
1959 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1960 &mut self.0.options
1961 }
1962 }
1963
1964 #[derive(Clone, Debug)]
1981 pub struct StopBackfillJob(RequestBuilder<crate::model::StopBackfillJobRequest>);
1982
1983 impl StopBackfillJob {
1984 pub(crate) fn new(
1985 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1986 ) -> Self {
1987 Self(RequestBuilder::new(stub))
1988 }
1989
1990 pub fn with_request<V: Into<crate::model::StopBackfillJobRequest>>(mut self, v: V) -> Self {
1992 self.0.request = v.into();
1993 self
1994 }
1995
1996 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1998 self.0.options = v.into();
1999 self
2000 }
2001
2002 pub async fn send(self) -> Result<crate::model::StopBackfillJobResponse> {
2004 (*self.0.stub)
2005 .stop_backfill_job(self.0.request, self.0.options)
2006 .await
2007 .map(gax::response::Response::into_body)
2008 }
2009
2010 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2014 self.0.request.object = v.into();
2015 self
2016 }
2017 }
2018
2019 #[doc(hidden)]
2020 impl gax::options::internal::RequestBuilder for StopBackfillJob {
2021 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2022 &mut self.0.options
2023 }
2024 }
2025
2026 #[derive(Clone, Debug)]
2043 pub struct FetchStaticIps(RequestBuilder<crate::model::FetchStaticIpsRequest>);
2044
2045 impl FetchStaticIps {
2046 pub(crate) fn new(
2047 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2048 ) -> Self {
2049 Self(RequestBuilder::new(stub))
2050 }
2051
2052 pub fn with_request<V: Into<crate::model::FetchStaticIpsRequest>>(mut self, v: V) -> Self {
2054 self.0.request = v.into();
2055 self
2056 }
2057
2058 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2060 self.0.options = v.into();
2061 self
2062 }
2063
2064 pub async fn send(self) -> Result<crate::model::FetchStaticIpsResponse> {
2066 (*self.0.stub)
2067 .fetch_static_ips(self.0.request, self.0.options)
2068 .await
2069 .map(gax::response::Response::into_body)
2070 }
2071
2072 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2076 self.0.request.name = v.into();
2077 self
2078 }
2079
2080 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2082 self.0.request.page_size = v.into();
2083 self
2084 }
2085
2086 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2088 self.0.request.page_token = v.into();
2089 self
2090 }
2091 }
2092
2093 #[doc(hidden)]
2094 impl gax::options::internal::RequestBuilder for FetchStaticIps {
2095 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2096 &mut self.0.options
2097 }
2098 }
2099
2100 #[derive(Clone, Debug)]
2118 pub struct CreatePrivateConnection(
2119 RequestBuilder<crate::model::CreatePrivateConnectionRequest>,
2120 );
2121
2122 impl CreatePrivateConnection {
2123 pub(crate) fn new(
2124 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2125 ) -> Self {
2126 Self(RequestBuilder::new(stub))
2127 }
2128
2129 pub fn with_request<V: Into<crate::model::CreatePrivateConnectionRequest>>(
2131 mut self,
2132 v: V,
2133 ) -> Self {
2134 self.0.request = v.into();
2135 self
2136 }
2137
2138 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2140 self.0.options = v.into();
2141 self
2142 }
2143
2144 pub async fn send(self) -> Result<longrunning::model::Operation> {
2151 (*self.0.stub)
2152 .create_private_connection(self.0.request, self.0.options)
2153 .await
2154 .map(gax::response::Response::into_body)
2155 }
2156
2157 pub fn poller(
2159 self,
2160 ) -> impl lro::Poller<crate::model::PrivateConnection, crate::model::OperationMetadata>
2161 {
2162 type Operation = lro::internal::Operation<
2163 crate::model::PrivateConnection,
2164 crate::model::OperationMetadata,
2165 >;
2166 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2167 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2168
2169 let stub = self.0.stub.clone();
2170 let mut options = self.0.options.clone();
2171 options.set_retry_policy(gax::retry_policy::NeverRetry);
2172 let query = move |name| {
2173 let stub = stub.clone();
2174 let options = options.clone();
2175 async {
2176 let op = GetOperation::new(stub)
2177 .set_name(name)
2178 .with_options(options)
2179 .send()
2180 .await?;
2181 Ok(Operation::new(op))
2182 }
2183 };
2184
2185 let start = move || async {
2186 let op = self.send().await?;
2187 Ok(Operation::new(op))
2188 };
2189
2190 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2191 }
2192
2193 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2197 self.0.request.parent = v.into();
2198 self
2199 }
2200
2201 pub fn set_private_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2205 self.0.request.private_connection_id = v.into();
2206 self
2207 }
2208
2209 pub fn set_private_connection<T>(mut self, v: T) -> Self
2213 where
2214 T: std::convert::Into<crate::model::PrivateConnection>,
2215 {
2216 self.0.request.private_connection = std::option::Option::Some(v.into());
2217 self
2218 }
2219
2220 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2224 where
2225 T: std::convert::Into<crate::model::PrivateConnection>,
2226 {
2227 self.0.request.private_connection = v.map(|x| x.into());
2228 self
2229 }
2230
2231 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2233 self.0.request.request_id = v.into();
2234 self
2235 }
2236
2237 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2239 self.0.request.force = v.into();
2240 self
2241 }
2242
2243 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2245 self.0.request.validate_only = v.into();
2246 self
2247 }
2248 }
2249
2250 #[doc(hidden)]
2251 impl gax::options::internal::RequestBuilder for CreatePrivateConnection {
2252 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2253 &mut self.0.options
2254 }
2255 }
2256
2257 #[derive(Clone, Debug)]
2274 pub struct GetPrivateConnection(RequestBuilder<crate::model::GetPrivateConnectionRequest>);
2275
2276 impl GetPrivateConnection {
2277 pub(crate) fn new(
2278 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2279 ) -> Self {
2280 Self(RequestBuilder::new(stub))
2281 }
2282
2283 pub fn with_request<V: Into<crate::model::GetPrivateConnectionRequest>>(
2285 mut self,
2286 v: V,
2287 ) -> Self {
2288 self.0.request = v.into();
2289 self
2290 }
2291
2292 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2294 self.0.options = v.into();
2295 self
2296 }
2297
2298 pub async fn send(self) -> Result<crate::model::PrivateConnection> {
2300 (*self.0.stub)
2301 .get_private_connection(self.0.request, self.0.options)
2302 .await
2303 .map(gax::response::Response::into_body)
2304 }
2305
2306 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2310 self.0.request.name = v.into();
2311 self
2312 }
2313 }
2314
2315 #[doc(hidden)]
2316 impl gax::options::internal::RequestBuilder for GetPrivateConnection {
2317 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2318 &mut self.0.options
2319 }
2320 }
2321
2322 #[derive(Clone, Debug)]
2343 pub struct ListPrivateConnections(RequestBuilder<crate::model::ListPrivateConnectionsRequest>);
2344
2345 impl ListPrivateConnections {
2346 pub(crate) fn new(
2347 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2348 ) -> Self {
2349 Self(RequestBuilder::new(stub))
2350 }
2351
2352 pub fn with_request<V: Into<crate::model::ListPrivateConnectionsRequest>>(
2354 mut self,
2355 v: V,
2356 ) -> Self {
2357 self.0.request = v.into();
2358 self
2359 }
2360
2361 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2363 self.0.options = v.into();
2364 self
2365 }
2366
2367 pub async fn send(self) -> Result<crate::model::ListPrivateConnectionsResponse> {
2369 (*self.0.stub)
2370 .list_private_connections(self.0.request, self.0.options)
2371 .await
2372 .map(gax::response::Response::into_body)
2373 }
2374
2375 pub fn by_page(
2377 self,
2378 ) -> impl gax::paginator::Paginator<
2379 crate::model::ListPrivateConnectionsResponse,
2380 gax::error::Error,
2381 > {
2382 use std::clone::Clone;
2383 let token = self.0.request.page_token.clone();
2384 let execute = move |token: String| {
2385 let mut builder = self.clone();
2386 builder.0.request = builder.0.request.set_page_token(token);
2387 builder.send()
2388 };
2389 gax::paginator::internal::new_paginator(token, execute)
2390 }
2391
2392 pub fn by_item(
2394 self,
2395 ) -> impl gax::paginator::ItemPaginator<
2396 crate::model::ListPrivateConnectionsResponse,
2397 gax::error::Error,
2398 > {
2399 use gax::paginator::Paginator;
2400 self.by_page().items()
2401 }
2402
2403 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2407 self.0.request.parent = v.into();
2408 self
2409 }
2410
2411 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2413 self.0.request.page_size = v.into();
2414 self
2415 }
2416
2417 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2419 self.0.request.page_token = v.into();
2420 self
2421 }
2422
2423 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2425 self.0.request.filter = v.into();
2426 self
2427 }
2428
2429 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2431 self.0.request.order_by = v.into();
2432 self
2433 }
2434 }
2435
2436 #[doc(hidden)]
2437 impl gax::options::internal::RequestBuilder for ListPrivateConnections {
2438 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2439 &mut self.0.options
2440 }
2441 }
2442
2443 #[derive(Clone, Debug)]
2461 pub struct DeletePrivateConnection(
2462 RequestBuilder<crate::model::DeletePrivateConnectionRequest>,
2463 );
2464
2465 impl DeletePrivateConnection {
2466 pub(crate) fn new(
2467 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2468 ) -> Self {
2469 Self(RequestBuilder::new(stub))
2470 }
2471
2472 pub fn with_request<V: Into<crate::model::DeletePrivateConnectionRequest>>(
2474 mut self,
2475 v: V,
2476 ) -> Self {
2477 self.0.request = v.into();
2478 self
2479 }
2480
2481 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2483 self.0.options = v.into();
2484 self
2485 }
2486
2487 pub async fn send(self) -> Result<longrunning::model::Operation> {
2494 (*self.0.stub)
2495 .delete_private_connection(self.0.request, self.0.options)
2496 .await
2497 .map(gax::response::Response::into_body)
2498 }
2499
2500 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2502 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2503 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2504 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2505
2506 let stub = self.0.stub.clone();
2507 let mut options = self.0.options.clone();
2508 options.set_retry_policy(gax::retry_policy::NeverRetry);
2509 let query = move |name| {
2510 let stub = stub.clone();
2511 let options = options.clone();
2512 async {
2513 let op = GetOperation::new(stub)
2514 .set_name(name)
2515 .with_options(options)
2516 .send()
2517 .await?;
2518 Ok(Operation::new(op))
2519 }
2520 };
2521
2522 let start = move || async {
2523 let op = self.send().await?;
2524 Ok(Operation::new(op))
2525 };
2526
2527 lro::internal::new_unit_response_poller(
2528 polling_error_policy,
2529 polling_backoff_policy,
2530 start,
2531 query,
2532 )
2533 }
2534
2535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2539 self.0.request.name = v.into();
2540 self
2541 }
2542
2543 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2545 self.0.request.request_id = v.into();
2546 self
2547 }
2548
2549 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2551 self.0.request.force = v.into();
2552 self
2553 }
2554 }
2555
2556 #[doc(hidden)]
2557 impl gax::options::internal::RequestBuilder for DeletePrivateConnection {
2558 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2559 &mut self.0.options
2560 }
2561 }
2562
2563 #[derive(Clone, Debug)]
2581 pub struct CreateRoute(RequestBuilder<crate::model::CreateRouteRequest>);
2582
2583 impl CreateRoute {
2584 pub(crate) fn new(
2585 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2586 ) -> Self {
2587 Self(RequestBuilder::new(stub))
2588 }
2589
2590 pub fn with_request<V: Into<crate::model::CreateRouteRequest>>(mut self, v: V) -> Self {
2592 self.0.request = v.into();
2593 self
2594 }
2595
2596 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2598 self.0.options = v.into();
2599 self
2600 }
2601
2602 pub async fn send(self) -> Result<longrunning::model::Operation> {
2609 (*self.0.stub)
2610 .create_route(self.0.request, self.0.options)
2611 .await
2612 .map(gax::response::Response::into_body)
2613 }
2614
2615 pub fn poller(
2617 self,
2618 ) -> impl lro::Poller<crate::model::Route, crate::model::OperationMetadata> {
2619 type Operation =
2620 lro::internal::Operation<crate::model::Route, crate::model::OperationMetadata>;
2621 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2622 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2623
2624 let stub = self.0.stub.clone();
2625 let mut options = self.0.options.clone();
2626 options.set_retry_policy(gax::retry_policy::NeverRetry);
2627 let query = move |name| {
2628 let stub = stub.clone();
2629 let options = options.clone();
2630 async {
2631 let op = GetOperation::new(stub)
2632 .set_name(name)
2633 .with_options(options)
2634 .send()
2635 .await?;
2636 Ok(Operation::new(op))
2637 }
2638 };
2639
2640 let start = move || async {
2641 let op = self.send().await?;
2642 Ok(Operation::new(op))
2643 };
2644
2645 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2646 }
2647
2648 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2652 self.0.request.parent = v.into();
2653 self
2654 }
2655
2656 pub fn set_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2660 self.0.request.route_id = v.into();
2661 self
2662 }
2663
2664 pub fn set_route<T>(mut self, v: T) -> Self
2668 where
2669 T: std::convert::Into<crate::model::Route>,
2670 {
2671 self.0.request.route = std::option::Option::Some(v.into());
2672 self
2673 }
2674
2675 pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
2679 where
2680 T: std::convert::Into<crate::model::Route>,
2681 {
2682 self.0.request.route = v.map(|x| x.into());
2683 self
2684 }
2685
2686 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2688 self.0.request.request_id = v.into();
2689 self
2690 }
2691 }
2692
2693 #[doc(hidden)]
2694 impl gax::options::internal::RequestBuilder for CreateRoute {
2695 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2696 &mut self.0.options
2697 }
2698 }
2699
2700 #[derive(Clone, Debug)]
2717 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
2718
2719 impl GetRoute {
2720 pub(crate) fn new(
2721 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2722 ) -> Self {
2723 Self(RequestBuilder::new(stub))
2724 }
2725
2726 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
2728 self.0.request = v.into();
2729 self
2730 }
2731
2732 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2734 self.0.options = v.into();
2735 self
2736 }
2737
2738 pub async fn send(self) -> Result<crate::model::Route> {
2740 (*self.0.stub)
2741 .get_route(self.0.request, self.0.options)
2742 .await
2743 .map(gax::response::Response::into_body)
2744 }
2745
2746 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2750 self.0.request.name = v.into();
2751 self
2752 }
2753 }
2754
2755 #[doc(hidden)]
2756 impl gax::options::internal::RequestBuilder for GetRoute {
2757 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2758 &mut self.0.options
2759 }
2760 }
2761
2762 #[derive(Clone, Debug)]
2783 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
2784
2785 impl ListRoutes {
2786 pub(crate) fn new(
2787 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2788 ) -> Self {
2789 Self(RequestBuilder::new(stub))
2790 }
2791
2792 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
2794 self.0.request = v.into();
2795 self
2796 }
2797
2798 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2800 self.0.options = v.into();
2801 self
2802 }
2803
2804 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
2806 (*self.0.stub)
2807 .list_routes(self.0.request, self.0.options)
2808 .await
2809 .map(gax::response::Response::into_body)
2810 }
2811
2812 pub fn by_page(
2814 self,
2815 ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
2816 {
2817 use std::clone::Clone;
2818 let token = self.0.request.page_token.clone();
2819 let execute = move |token: String| {
2820 let mut builder = self.clone();
2821 builder.0.request = builder.0.request.set_page_token(token);
2822 builder.send()
2823 };
2824 gax::paginator::internal::new_paginator(token, execute)
2825 }
2826
2827 pub fn by_item(
2829 self,
2830 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
2831 {
2832 use gax::paginator::Paginator;
2833 self.by_page().items()
2834 }
2835
2836 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2840 self.0.request.parent = v.into();
2841 self
2842 }
2843
2844 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2846 self.0.request.page_size = v.into();
2847 self
2848 }
2849
2850 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2852 self.0.request.page_token = v.into();
2853 self
2854 }
2855
2856 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2858 self.0.request.filter = v.into();
2859 self
2860 }
2861
2862 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2864 self.0.request.order_by = v.into();
2865 self
2866 }
2867 }
2868
2869 #[doc(hidden)]
2870 impl gax::options::internal::RequestBuilder for ListRoutes {
2871 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2872 &mut self.0.options
2873 }
2874 }
2875
2876 #[derive(Clone, Debug)]
2894 pub struct DeleteRoute(RequestBuilder<crate::model::DeleteRouteRequest>);
2895
2896 impl DeleteRoute {
2897 pub(crate) fn new(
2898 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2899 ) -> Self {
2900 Self(RequestBuilder::new(stub))
2901 }
2902
2903 pub fn with_request<V: Into<crate::model::DeleteRouteRequest>>(mut self, v: V) -> Self {
2905 self.0.request = v.into();
2906 self
2907 }
2908
2909 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2911 self.0.options = v.into();
2912 self
2913 }
2914
2915 pub async fn send(self) -> Result<longrunning::model::Operation> {
2922 (*self.0.stub)
2923 .delete_route(self.0.request, self.0.options)
2924 .await
2925 .map(gax::response::Response::into_body)
2926 }
2927
2928 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2930 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2931 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2932 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2933
2934 let stub = self.0.stub.clone();
2935 let mut options = self.0.options.clone();
2936 options.set_retry_policy(gax::retry_policy::NeverRetry);
2937 let query = move |name| {
2938 let stub = stub.clone();
2939 let options = options.clone();
2940 async {
2941 let op = GetOperation::new(stub)
2942 .set_name(name)
2943 .with_options(options)
2944 .send()
2945 .await?;
2946 Ok(Operation::new(op))
2947 }
2948 };
2949
2950 let start = move || async {
2951 let op = self.send().await?;
2952 Ok(Operation::new(op))
2953 };
2954
2955 lro::internal::new_unit_response_poller(
2956 polling_error_policy,
2957 polling_backoff_policy,
2958 start,
2959 query,
2960 )
2961 }
2962
2963 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2967 self.0.request.name = v.into();
2968 self
2969 }
2970
2971 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2973 self.0.request.request_id = v.into();
2974 self
2975 }
2976 }
2977
2978 #[doc(hidden)]
2979 impl gax::options::internal::RequestBuilder for DeleteRoute {
2980 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2981 &mut self.0.options
2982 }
2983 }
2984
2985 #[derive(Clone, Debug)]
3006 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3007
3008 impl ListLocations {
3009 pub(crate) fn new(
3010 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3011 ) -> Self {
3012 Self(RequestBuilder::new(stub))
3013 }
3014
3015 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3017 mut self,
3018 v: V,
3019 ) -> Self {
3020 self.0.request = v.into();
3021 self
3022 }
3023
3024 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3026 self.0.options = v.into();
3027 self
3028 }
3029
3030 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3032 (*self.0.stub)
3033 .list_locations(self.0.request, self.0.options)
3034 .await
3035 .map(gax::response::Response::into_body)
3036 }
3037
3038 pub fn by_page(
3040 self,
3041 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3042 {
3043 use std::clone::Clone;
3044 let token = self.0.request.page_token.clone();
3045 let execute = move |token: String| {
3046 let mut builder = self.clone();
3047 builder.0.request = builder.0.request.set_page_token(token);
3048 builder.send()
3049 };
3050 gax::paginator::internal::new_paginator(token, execute)
3051 }
3052
3053 pub fn by_item(
3055 self,
3056 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3057 {
3058 use gax::paginator::Paginator;
3059 self.by_page().items()
3060 }
3061
3062 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3064 self.0.request.name = v.into();
3065 self
3066 }
3067
3068 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3070 self.0.request.filter = v.into();
3071 self
3072 }
3073
3074 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3076 self.0.request.page_size = v.into();
3077 self
3078 }
3079
3080 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3082 self.0.request.page_token = v.into();
3083 self
3084 }
3085 }
3086
3087 #[doc(hidden)]
3088 impl gax::options::internal::RequestBuilder for ListLocations {
3089 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3090 &mut self.0.options
3091 }
3092 }
3093
3094 #[derive(Clone, Debug)]
3111 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3112
3113 impl GetLocation {
3114 pub(crate) fn new(
3115 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3116 ) -> Self {
3117 Self(RequestBuilder::new(stub))
3118 }
3119
3120 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3122 self.0.request = v.into();
3123 self
3124 }
3125
3126 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3128 self.0.options = v.into();
3129 self
3130 }
3131
3132 pub async fn send(self) -> Result<location::model::Location> {
3134 (*self.0.stub)
3135 .get_location(self.0.request, self.0.options)
3136 .await
3137 .map(gax::response::Response::into_body)
3138 }
3139
3140 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3142 self.0.request.name = v.into();
3143 self
3144 }
3145 }
3146
3147 #[doc(hidden)]
3148 impl gax::options::internal::RequestBuilder for GetLocation {
3149 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3150 &mut self.0.options
3151 }
3152 }
3153
3154 #[derive(Clone, Debug)]
3175 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3176
3177 impl ListOperations {
3178 pub(crate) fn new(
3179 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3180 ) -> Self {
3181 Self(RequestBuilder::new(stub))
3182 }
3183
3184 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3186 mut self,
3187 v: V,
3188 ) -> Self {
3189 self.0.request = v.into();
3190 self
3191 }
3192
3193 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3195 self.0.options = v.into();
3196 self
3197 }
3198
3199 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3201 (*self.0.stub)
3202 .list_operations(self.0.request, self.0.options)
3203 .await
3204 .map(gax::response::Response::into_body)
3205 }
3206
3207 pub fn by_page(
3209 self,
3210 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3211 {
3212 use std::clone::Clone;
3213 let token = self.0.request.page_token.clone();
3214 let execute = move |token: String| {
3215 let mut builder = self.clone();
3216 builder.0.request = builder.0.request.set_page_token(token);
3217 builder.send()
3218 };
3219 gax::paginator::internal::new_paginator(token, execute)
3220 }
3221
3222 pub fn by_item(
3224 self,
3225 ) -> impl gax::paginator::ItemPaginator<
3226 longrunning::model::ListOperationsResponse,
3227 gax::error::Error,
3228 > {
3229 use gax::paginator::Paginator;
3230 self.by_page().items()
3231 }
3232
3233 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3235 self.0.request.name = v.into();
3236 self
3237 }
3238
3239 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3241 self.0.request.filter = v.into();
3242 self
3243 }
3244
3245 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3247 self.0.request.page_size = v.into();
3248 self
3249 }
3250
3251 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3253 self.0.request.page_token = v.into();
3254 self
3255 }
3256
3257 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3259 self.0.request.return_partial_success = v.into();
3260 self
3261 }
3262 }
3263
3264 #[doc(hidden)]
3265 impl gax::options::internal::RequestBuilder for ListOperations {
3266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3267 &mut self.0.options
3268 }
3269 }
3270
3271 #[derive(Clone, Debug)]
3288 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3289
3290 impl GetOperation {
3291 pub(crate) fn new(
3292 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3293 ) -> Self {
3294 Self(RequestBuilder::new(stub))
3295 }
3296
3297 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3299 mut self,
3300 v: V,
3301 ) -> Self {
3302 self.0.request = v.into();
3303 self
3304 }
3305
3306 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3308 self.0.options = v.into();
3309 self
3310 }
3311
3312 pub async fn send(self) -> Result<longrunning::model::Operation> {
3314 (*self.0.stub)
3315 .get_operation(self.0.request, self.0.options)
3316 .await
3317 .map(gax::response::Response::into_body)
3318 }
3319
3320 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3322 self.0.request.name = v.into();
3323 self
3324 }
3325 }
3326
3327 #[doc(hidden)]
3328 impl gax::options::internal::RequestBuilder for GetOperation {
3329 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3330 &mut self.0.options
3331 }
3332 }
3333
3334 #[derive(Clone, Debug)]
3351 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3352
3353 impl DeleteOperation {
3354 pub(crate) fn new(
3355 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3356 ) -> Self {
3357 Self(RequestBuilder::new(stub))
3358 }
3359
3360 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3362 mut self,
3363 v: V,
3364 ) -> Self {
3365 self.0.request = v.into();
3366 self
3367 }
3368
3369 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3371 self.0.options = v.into();
3372 self
3373 }
3374
3375 pub async fn send(self) -> Result<()> {
3377 (*self.0.stub)
3378 .delete_operation(self.0.request, self.0.options)
3379 .await
3380 .map(gax::response::Response::into_body)
3381 }
3382
3383 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3385 self.0.request.name = v.into();
3386 self
3387 }
3388 }
3389
3390 #[doc(hidden)]
3391 impl gax::options::internal::RequestBuilder for DeleteOperation {
3392 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3393 &mut self.0.options
3394 }
3395 }
3396
3397 #[derive(Clone, Debug)]
3414 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3415
3416 impl CancelOperation {
3417 pub(crate) fn new(
3418 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3419 ) -> Self {
3420 Self(RequestBuilder::new(stub))
3421 }
3422
3423 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3425 mut self,
3426 v: V,
3427 ) -> Self {
3428 self.0.request = v.into();
3429 self
3430 }
3431
3432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3434 self.0.options = v.into();
3435 self
3436 }
3437
3438 pub async fn send(self) -> Result<()> {
3440 (*self.0.stub)
3441 .cancel_operation(self.0.request, self.0.options)
3442 .await
3443 .map(gax::response::Response::into_body)
3444 }
3445
3446 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.0.request.name = v.into();
3449 self
3450 }
3451 }
3452
3453 #[doc(hidden)]
3454 impl gax::options::internal::RequestBuilder for CancelOperation {
3455 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3456 &mut self.0.options
3457 }
3458 }
3459}