1pub mod datastream {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Datastream;
38 pub struct Factory;
39 impl crate::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 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct 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<crate::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(crate::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl google_cloud_gax::paginator::Paginator<
131 crate::model::ListConnectionProfilesResponse,
132 crate::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 google_cloud_gax::paginator::internal::new_paginator(token, execute)
142 }
143
144 pub fn by_item(
146 self,
147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
148 crate::model::ListConnectionProfilesResponse,
149 crate::Error,
150 > {
151 use google_cloud_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 crate::RequestBuilder for ListConnectionProfiles {
190 fn request_options(&mut self) -> &mut crate::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<crate::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(crate::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 crate::RequestBuilder for GetConnectionProfile {
255 fn request_options(&mut self) -> &mut crate::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<crate::RequestOptions>>(mut self, v: V) -> Self {
300 self.0.options = v.into();
301 self
302 }
303
304 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
311 (*self.0.stub)
312 .create_connection_profile(self.0.request, self.0.options)
313 .await
314 .map(crate::Response::into_body)
315 }
316
317 pub fn poller(
319 self,
320 ) -> impl google_cloud_lro::Poller<
321 crate::model::ConnectionProfile,
322 crate::model::OperationMetadata,
323 > {
324 type Operation = google_cloud_lro::internal::Operation<
325 crate::model::ConnectionProfile,
326 crate::model::OperationMetadata,
327 >;
328 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
329 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
330 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
331 if let Some(ref mut details) = poller_options.tracing {
332 details.method_name = "google_cloud_datastream_v1::client::Datastream::create_connection_profile::until_done";
333 }
334
335 let stub = self.0.stub.clone();
336 let mut options = self.0.options.clone();
337 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
338 let query = move |name| {
339 let stub = stub.clone();
340 let options = options.clone();
341 async {
342 let op = GetOperation::new(stub)
343 .set_name(name)
344 .with_options(options)
345 .send()
346 .await?;
347 Ok(Operation::new(op))
348 }
349 };
350
351 let start = move || async {
352 let op = self.send().await?;
353 Ok(Operation::new(op))
354 };
355
356 use google_cloud_lro::internal::PollerExt;
357 {
358 google_cloud_lro::internal::new_poller(
359 polling_error_policy,
360 polling_backoff_policy,
361 start,
362 query,
363 )
364 }
365 .with_options(poller_options)
366 }
367
368 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
372 self.0.request.parent = v.into();
373 self
374 }
375
376 pub fn set_connection_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
380 self.0.request.connection_profile_id = v.into();
381 self
382 }
383
384 pub fn set_connection_profile<T>(mut self, v: T) -> Self
388 where
389 T: std::convert::Into<crate::model::ConnectionProfile>,
390 {
391 self.0.request.connection_profile = std::option::Option::Some(v.into());
392 self
393 }
394
395 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
399 where
400 T: std::convert::Into<crate::model::ConnectionProfile>,
401 {
402 self.0.request.connection_profile = v.map(|x| x.into());
403 self
404 }
405
406 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
408 self.0.request.request_id = v.into();
409 self
410 }
411
412 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
414 self.0.request.validate_only = v.into();
415 self
416 }
417
418 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
420 self.0.request.force = v.into();
421 self
422 }
423 }
424
425 #[doc(hidden)]
426 impl crate::RequestBuilder for CreateConnectionProfile {
427 fn request_options(&mut self) -> &mut crate::RequestOptions {
428 &mut self.0.options
429 }
430 }
431
432 #[derive(Clone, Debug)]
450 pub struct UpdateConnectionProfile(
451 RequestBuilder<crate::model::UpdateConnectionProfileRequest>,
452 );
453
454 impl UpdateConnectionProfile {
455 pub(crate) fn new(
456 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
457 ) -> Self {
458 Self(RequestBuilder::new(stub))
459 }
460
461 pub fn with_request<V: Into<crate::model::UpdateConnectionProfileRequest>>(
463 mut self,
464 v: V,
465 ) -> Self {
466 self.0.request = v.into();
467 self
468 }
469
470 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
472 self.0.options = v.into();
473 self
474 }
475
476 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
483 (*self.0.stub)
484 .update_connection_profile(self.0.request, self.0.options)
485 .await
486 .map(crate::Response::into_body)
487 }
488
489 pub fn poller(
491 self,
492 ) -> impl google_cloud_lro::Poller<
493 crate::model::ConnectionProfile,
494 crate::model::OperationMetadata,
495 > {
496 type Operation = google_cloud_lro::internal::Operation<
497 crate::model::ConnectionProfile,
498 crate::model::OperationMetadata,
499 >;
500 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
501 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
502 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
503 if let Some(ref mut details) = poller_options.tracing {
504 details.method_name = "google_cloud_datastream_v1::client::Datastream::update_connection_profile::until_done";
505 }
506
507 let stub = self.0.stub.clone();
508 let mut options = self.0.options.clone();
509 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
510 let query = move |name| {
511 let stub = stub.clone();
512 let options = options.clone();
513 async {
514 let op = GetOperation::new(stub)
515 .set_name(name)
516 .with_options(options)
517 .send()
518 .await?;
519 Ok(Operation::new(op))
520 }
521 };
522
523 let start = move || async {
524 let op = self.send().await?;
525 Ok(Operation::new(op))
526 };
527
528 use google_cloud_lro::internal::PollerExt;
529 {
530 google_cloud_lro::internal::new_poller(
531 polling_error_policy,
532 polling_backoff_policy,
533 start,
534 query,
535 )
536 }
537 .with_options(poller_options)
538 }
539
540 pub fn set_update_mask<T>(mut self, v: T) -> Self
542 where
543 T: std::convert::Into<wkt::FieldMask>,
544 {
545 self.0.request.update_mask = std::option::Option::Some(v.into());
546 self
547 }
548
549 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
551 where
552 T: std::convert::Into<wkt::FieldMask>,
553 {
554 self.0.request.update_mask = v.map(|x| x.into());
555 self
556 }
557
558 pub fn set_connection_profile<T>(mut self, v: T) -> Self
562 where
563 T: std::convert::Into<crate::model::ConnectionProfile>,
564 {
565 self.0.request.connection_profile = std::option::Option::Some(v.into());
566 self
567 }
568
569 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
573 where
574 T: std::convert::Into<crate::model::ConnectionProfile>,
575 {
576 self.0.request.connection_profile = v.map(|x| x.into());
577 self
578 }
579
580 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
582 self.0.request.request_id = v.into();
583 self
584 }
585
586 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
588 self.0.request.validate_only = v.into();
589 self
590 }
591
592 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
594 self.0.request.force = v.into();
595 self
596 }
597 }
598
599 #[doc(hidden)]
600 impl crate::RequestBuilder for UpdateConnectionProfile {
601 fn request_options(&mut self) -> &mut crate::RequestOptions {
602 &mut self.0.options
603 }
604 }
605
606 #[derive(Clone, Debug)]
624 pub struct DeleteConnectionProfile(
625 RequestBuilder<crate::model::DeleteConnectionProfileRequest>,
626 );
627
628 impl DeleteConnectionProfile {
629 pub(crate) fn new(
630 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
631 ) -> Self {
632 Self(RequestBuilder::new(stub))
633 }
634
635 pub fn with_request<V: Into<crate::model::DeleteConnectionProfileRequest>>(
637 mut self,
638 v: V,
639 ) -> Self {
640 self.0.request = v.into();
641 self
642 }
643
644 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
646 self.0.options = v.into();
647 self
648 }
649
650 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
657 (*self.0.stub)
658 .delete_connection_profile(self.0.request, self.0.options)
659 .await
660 .map(crate::Response::into_body)
661 }
662
663 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
665 type Operation =
666 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
667 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
668 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
669 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
670 if let Some(ref mut details) = poller_options.tracing {
671 details.method_name = "google_cloud_datastream_v1::client::Datastream::delete_connection_profile::until_done";
672 }
673
674 let stub = self.0.stub.clone();
675 let mut options = self.0.options.clone();
676 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
677 let query = move |name| {
678 let stub = stub.clone();
679 let options = options.clone();
680 async {
681 let op = GetOperation::new(stub)
682 .set_name(name)
683 .with_options(options)
684 .send()
685 .await?;
686 Ok(Operation::new(op))
687 }
688 };
689
690 let start = move || async {
691 let op = self.send().await?;
692 Ok(Operation::new(op))
693 };
694
695 use google_cloud_lro::internal::PollerExt;
696 {
697 google_cloud_lro::internal::new_unit_response_poller(
698 polling_error_policy,
699 polling_backoff_policy,
700 start,
701 query,
702 )
703 }
704 .with_options(poller_options)
705 }
706
707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
711 self.0.request.name = v.into();
712 self
713 }
714
715 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
717 self.0.request.request_id = v.into();
718 self
719 }
720 }
721
722 #[doc(hidden)]
723 impl crate::RequestBuilder for DeleteConnectionProfile {
724 fn request_options(&mut self) -> &mut crate::RequestOptions {
725 &mut self.0.options
726 }
727 }
728
729 #[derive(Clone, Debug)]
746 pub struct DiscoverConnectionProfile(
747 RequestBuilder<crate::model::DiscoverConnectionProfileRequest>,
748 );
749
750 impl DiscoverConnectionProfile {
751 pub(crate) fn new(
752 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
753 ) -> Self {
754 Self(RequestBuilder::new(stub))
755 }
756
757 pub fn with_request<V: Into<crate::model::DiscoverConnectionProfileRequest>>(
759 mut self,
760 v: V,
761 ) -> Self {
762 self.0.request = v.into();
763 self
764 }
765
766 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
768 self.0.options = v.into();
769 self
770 }
771
772 pub async fn send(self) -> Result<crate::model::DiscoverConnectionProfileResponse> {
774 (*self.0.stub)
775 .discover_connection_profile(self.0.request, self.0.options)
776 .await
777 .map(crate::Response::into_body)
778 }
779
780 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
784 self.0.request.parent = v.into();
785 self
786 }
787
788 pub fn set_target<
793 T: Into<Option<crate::model::discover_connection_profile_request::Target>>,
794 >(
795 mut self,
796 v: T,
797 ) -> Self {
798 self.0.request.target = v.into();
799 self
800 }
801
802 pub fn set_connection_profile<
808 T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
809 >(
810 mut self,
811 v: T,
812 ) -> Self {
813 self.0.request = self.0.request.set_connection_profile(v);
814 self
815 }
816
817 pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
823 mut self,
824 v: T,
825 ) -> Self {
826 self.0.request = self.0.request.set_connection_profile_name(v);
827 self
828 }
829
830 pub fn set_hierarchy<
835 T: Into<Option<crate::model::discover_connection_profile_request::Hierarchy>>,
836 >(
837 mut self,
838 v: T,
839 ) -> Self {
840 self.0.request.hierarchy = v.into();
841 self
842 }
843
844 pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
850 self.0.request = self.0.request.set_full_hierarchy(v);
851 self
852 }
853
854 pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
860 self.0.request = self.0.request.set_hierarchy_depth(v);
861 self
862 }
863
864 pub fn set_data_object<
869 T: Into<Option<crate::model::discover_connection_profile_request::DataObject>>,
870 >(
871 mut self,
872 v: T,
873 ) -> Self {
874 self.0.request.data_object = v.into();
875 self
876 }
877
878 pub fn set_oracle_rdbms<
884 T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
885 >(
886 mut self,
887 v: T,
888 ) -> Self {
889 self.0.request = self.0.request.set_oracle_rdbms(v);
890 self
891 }
892
893 pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
899 mut self,
900 v: T,
901 ) -> Self {
902 self.0.request = self.0.request.set_mysql_rdbms(v);
903 self
904 }
905
906 pub fn set_postgresql_rdbms<
912 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
913 >(
914 mut self,
915 v: T,
916 ) -> Self {
917 self.0.request = self.0.request.set_postgresql_rdbms(v);
918 self
919 }
920
921 pub fn set_sql_server_rdbms<
927 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
928 >(
929 mut self,
930 v: T,
931 ) -> Self {
932 self.0.request = self.0.request.set_sql_server_rdbms(v);
933 self
934 }
935
936 pub fn set_salesforce_org<
942 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
943 >(
944 mut self,
945 v: T,
946 ) -> Self {
947 self.0.request = self.0.request.set_salesforce_org(v);
948 self
949 }
950
951 pub fn set_mongodb_cluster<
957 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
958 >(
959 mut self,
960 v: T,
961 ) -> Self {
962 self.0.request = self.0.request.set_mongodb_cluster(v);
963 self
964 }
965 }
966
967 #[doc(hidden)]
968 impl crate::RequestBuilder for DiscoverConnectionProfile {
969 fn request_options(&mut self) -> &mut crate::RequestOptions {
970 &mut self.0.options
971 }
972 }
973
974 #[derive(Clone, Debug)]
995 pub struct ListStreams(RequestBuilder<crate::model::ListStreamsRequest>);
996
997 impl ListStreams {
998 pub(crate) fn new(
999 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1000 ) -> Self {
1001 Self(RequestBuilder::new(stub))
1002 }
1003
1004 pub fn with_request<V: Into<crate::model::ListStreamsRequest>>(mut self, v: V) -> Self {
1006 self.0.request = v.into();
1007 self
1008 }
1009
1010 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1012 self.0.options = v.into();
1013 self
1014 }
1015
1016 pub async fn send(self) -> Result<crate::model::ListStreamsResponse> {
1018 (*self.0.stub)
1019 .list_streams(self.0.request, self.0.options)
1020 .await
1021 .map(crate::Response::into_body)
1022 }
1023
1024 pub fn by_page(
1026 self,
1027 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListStreamsResponse, crate::Error>
1028 {
1029 use std::clone::Clone;
1030 let token = self.0.request.page_token.clone();
1031 let execute = move |token: String| {
1032 let mut builder = self.clone();
1033 builder.0.request = builder.0.request.set_page_token(token);
1034 builder.send()
1035 };
1036 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1037 }
1038
1039 pub fn by_item(
1041 self,
1042 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1043 crate::model::ListStreamsResponse,
1044 crate::Error,
1045 > {
1046 use google_cloud_gax::paginator::Paginator;
1047 self.by_page().items()
1048 }
1049
1050 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1054 self.0.request.parent = v.into();
1055 self
1056 }
1057
1058 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1060 self.0.request.page_size = v.into();
1061 self
1062 }
1063
1064 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1066 self.0.request.page_token = v.into();
1067 self
1068 }
1069
1070 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.0.request.filter = v.into();
1073 self
1074 }
1075
1076 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1078 self.0.request.order_by = v.into();
1079 self
1080 }
1081 }
1082
1083 #[doc(hidden)]
1084 impl crate::RequestBuilder for ListStreams {
1085 fn request_options(&mut self) -> &mut crate::RequestOptions {
1086 &mut self.0.options
1087 }
1088 }
1089
1090 #[derive(Clone, Debug)]
1107 pub struct GetStream(RequestBuilder<crate::model::GetStreamRequest>);
1108
1109 impl GetStream {
1110 pub(crate) fn new(
1111 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1112 ) -> Self {
1113 Self(RequestBuilder::new(stub))
1114 }
1115
1116 pub fn with_request<V: Into<crate::model::GetStreamRequest>>(mut self, v: V) -> Self {
1118 self.0.request = v.into();
1119 self
1120 }
1121
1122 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1124 self.0.options = v.into();
1125 self
1126 }
1127
1128 pub async fn send(self) -> Result<crate::model::Stream> {
1130 (*self.0.stub)
1131 .get_stream(self.0.request, self.0.options)
1132 .await
1133 .map(crate::Response::into_body)
1134 }
1135
1136 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1140 self.0.request.name = v.into();
1141 self
1142 }
1143 }
1144
1145 #[doc(hidden)]
1146 impl crate::RequestBuilder for GetStream {
1147 fn request_options(&mut self) -> &mut crate::RequestOptions {
1148 &mut self.0.options
1149 }
1150 }
1151
1152 #[derive(Clone, Debug)]
1170 pub struct CreateStream(RequestBuilder<crate::model::CreateStreamRequest>);
1171
1172 impl CreateStream {
1173 pub(crate) fn new(
1174 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1175 ) -> Self {
1176 Self(RequestBuilder::new(stub))
1177 }
1178
1179 pub fn with_request<V: Into<crate::model::CreateStreamRequest>>(mut self, v: V) -> Self {
1181 self.0.request = v.into();
1182 self
1183 }
1184
1185 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1187 self.0.options = v.into();
1188 self
1189 }
1190
1191 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1198 (*self.0.stub)
1199 .create_stream(self.0.request, self.0.options)
1200 .await
1201 .map(crate::Response::into_body)
1202 }
1203
1204 pub fn poller(
1206 self,
1207 ) -> impl google_cloud_lro::Poller<crate::model::Stream, crate::model::OperationMetadata>
1208 {
1209 type Operation = google_cloud_lro::internal::Operation<
1210 crate::model::Stream,
1211 crate::model::OperationMetadata,
1212 >;
1213 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1214 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1215 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1216 if let Some(ref mut details) = poller_options.tracing {
1217 details.method_name =
1218 "google_cloud_datastream_v1::client::Datastream::create_stream::until_done";
1219 }
1220
1221 let stub = self.0.stub.clone();
1222 let mut options = self.0.options.clone();
1223 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1224 let query = move |name| {
1225 let stub = stub.clone();
1226 let options = options.clone();
1227 async {
1228 let op = GetOperation::new(stub)
1229 .set_name(name)
1230 .with_options(options)
1231 .send()
1232 .await?;
1233 Ok(Operation::new(op))
1234 }
1235 };
1236
1237 let start = move || async {
1238 let op = self.send().await?;
1239 Ok(Operation::new(op))
1240 };
1241
1242 use google_cloud_lro::internal::PollerExt;
1243 {
1244 google_cloud_lro::internal::new_poller(
1245 polling_error_policy,
1246 polling_backoff_policy,
1247 start,
1248 query,
1249 )
1250 }
1251 .with_options(poller_options)
1252 }
1253
1254 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1258 self.0.request.parent = v.into();
1259 self
1260 }
1261
1262 pub fn set_stream_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1266 self.0.request.stream_id = v.into();
1267 self
1268 }
1269
1270 pub fn set_stream<T>(mut self, v: T) -> Self
1274 where
1275 T: std::convert::Into<crate::model::Stream>,
1276 {
1277 self.0.request.stream = std::option::Option::Some(v.into());
1278 self
1279 }
1280
1281 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1285 where
1286 T: std::convert::Into<crate::model::Stream>,
1287 {
1288 self.0.request.stream = v.map(|x| x.into());
1289 self
1290 }
1291
1292 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1294 self.0.request.request_id = v.into();
1295 self
1296 }
1297
1298 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1300 self.0.request.validate_only = v.into();
1301 self
1302 }
1303
1304 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1306 self.0.request.force = v.into();
1307 self
1308 }
1309 }
1310
1311 #[doc(hidden)]
1312 impl crate::RequestBuilder for CreateStream {
1313 fn request_options(&mut self) -> &mut crate::RequestOptions {
1314 &mut self.0.options
1315 }
1316 }
1317
1318 #[derive(Clone, Debug)]
1336 pub struct UpdateStream(RequestBuilder<crate::model::UpdateStreamRequest>);
1337
1338 impl UpdateStream {
1339 pub(crate) fn new(
1340 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1341 ) -> Self {
1342 Self(RequestBuilder::new(stub))
1343 }
1344
1345 pub fn with_request<V: Into<crate::model::UpdateStreamRequest>>(mut self, v: V) -> Self {
1347 self.0.request = v.into();
1348 self
1349 }
1350
1351 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1353 self.0.options = v.into();
1354 self
1355 }
1356
1357 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1364 (*self.0.stub)
1365 .update_stream(self.0.request, self.0.options)
1366 .await
1367 .map(crate::Response::into_body)
1368 }
1369
1370 pub fn poller(
1372 self,
1373 ) -> impl google_cloud_lro::Poller<crate::model::Stream, crate::model::OperationMetadata>
1374 {
1375 type Operation = google_cloud_lro::internal::Operation<
1376 crate::model::Stream,
1377 crate::model::OperationMetadata,
1378 >;
1379 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1380 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1381 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1382 if let Some(ref mut details) = poller_options.tracing {
1383 details.method_name =
1384 "google_cloud_datastream_v1::client::Datastream::update_stream::until_done";
1385 }
1386
1387 let stub = self.0.stub.clone();
1388 let mut options = self.0.options.clone();
1389 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1390 let query = move |name| {
1391 let stub = stub.clone();
1392 let options = options.clone();
1393 async {
1394 let op = GetOperation::new(stub)
1395 .set_name(name)
1396 .with_options(options)
1397 .send()
1398 .await?;
1399 Ok(Operation::new(op))
1400 }
1401 };
1402
1403 let start = move || async {
1404 let op = self.send().await?;
1405 Ok(Operation::new(op))
1406 };
1407
1408 use google_cloud_lro::internal::PollerExt;
1409 {
1410 google_cloud_lro::internal::new_poller(
1411 polling_error_policy,
1412 polling_backoff_policy,
1413 start,
1414 query,
1415 )
1416 }
1417 .with_options(poller_options)
1418 }
1419
1420 pub fn set_update_mask<T>(mut self, v: T) -> Self
1422 where
1423 T: std::convert::Into<wkt::FieldMask>,
1424 {
1425 self.0.request.update_mask = std::option::Option::Some(v.into());
1426 self
1427 }
1428
1429 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1431 where
1432 T: std::convert::Into<wkt::FieldMask>,
1433 {
1434 self.0.request.update_mask = v.map(|x| x.into());
1435 self
1436 }
1437
1438 pub fn set_stream<T>(mut self, v: T) -> Self
1442 where
1443 T: std::convert::Into<crate::model::Stream>,
1444 {
1445 self.0.request.stream = std::option::Option::Some(v.into());
1446 self
1447 }
1448
1449 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1453 where
1454 T: std::convert::Into<crate::model::Stream>,
1455 {
1456 self.0.request.stream = v.map(|x| x.into());
1457 self
1458 }
1459
1460 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462 self.0.request.request_id = v.into();
1463 self
1464 }
1465
1466 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1468 self.0.request.validate_only = v.into();
1469 self
1470 }
1471
1472 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1474 self.0.request.force = v.into();
1475 self
1476 }
1477 }
1478
1479 #[doc(hidden)]
1480 impl crate::RequestBuilder for UpdateStream {
1481 fn request_options(&mut self) -> &mut crate::RequestOptions {
1482 &mut self.0.options
1483 }
1484 }
1485
1486 #[derive(Clone, Debug)]
1504 pub struct DeleteStream(RequestBuilder<crate::model::DeleteStreamRequest>);
1505
1506 impl DeleteStream {
1507 pub(crate) fn new(
1508 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1509 ) -> Self {
1510 Self(RequestBuilder::new(stub))
1511 }
1512
1513 pub fn with_request<V: Into<crate::model::DeleteStreamRequest>>(mut self, v: V) -> Self {
1515 self.0.request = v.into();
1516 self
1517 }
1518
1519 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1521 self.0.options = v.into();
1522 self
1523 }
1524
1525 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1532 (*self.0.stub)
1533 .delete_stream(self.0.request, self.0.options)
1534 .await
1535 .map(crate::Response::into_body)
1536 }
1537
1538 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1540 type Operation =
1541 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1542 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1543 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1544 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1545 if let Some(ref mut details) = poller_options.tracing {
1546 details.method_name =
1547 "google_cloud_datastream_v1::client::Datastream::delete_stream::until_done";
1548 }
1549
1550 let stub = self.0.stub.clone();
1551 let mut options = self.0.options.clone();
1552 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1553 let query = move |name| {
1554 let stub = stub.clone();
1555 let options = options.clone();
1556 async {
1557 let op = GetOperation::new(stub)
1558 .set_name(name)
1559 .with_options(options)
1560 .send()
1561 .await?;
1562 Ok(Operation::new(op))
1563 }
1564 };
1565
1566 let start = move || async {
1567 let op = self.send().await?;
1568 Ok(Operation::new(op))
1569 };
1570
1571 use google_cloud_lro::internal::PollerExt;
1572 {
1573 google_cloud_lro::internal::new_unit_response_poller(
1574 polling_error_policy,
1575 polling_backoff_policy,
1576 start,
1577 query,
1578 )
1579 }
1580 .with_options(poller_options)
1581 }
1582
1583 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1587 self.0.request.name = v.into();
1588 self
1589 }
1590
1591 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1593 self.0.request.request_id = v.into();
1594 self
1595 }
1596 }
1597
1598 #[doc(hidden)]
1599 impl crate::RequestBuilder for DeleteStream {
1600 fn request_options(&mut self) -> &mut crate::RequestOptions {
1601 &mut self.0.options
1602 }
1603 }
1604
1605 #[derive(Clone, Debug)]
1623 pub struct RunStream(RequestBuilder<crate::model::RunStreamRequest>);
1624
1625 impl RunStream {
1626 pub(crate) fn new(
1627 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1628 ) -> Self {
1629 Self(RequestBuilder::new(stub))
1630 }
1631
1632 pub fn with_request<V: Into<crate::model::RunStreamRequest>>(mut self, v: V) -> Self {
1634 self.0.request = v.into();
1635 self
1636 }
1637
1638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1640 self.0.options = v.into();
1641 self
1642 }
1643
1644 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1651 (*self.0.stub)
1652 .run_stream(self.0.request, self.0.options)
1653 .await
1654 .map(crate::Response::into_body)
1655 }
1656
1657 pub fn poller(
1659 self,
1660 ) -> impl google_cloud_lro::Poller<crate::model::Stream, crate::model::OperationMetadata>
1661 {
1662 type Operation = google_cloud_lro::internal::Operation<
1663 crate::model::Stream,
1664 crate::model::OperationMetadata,
1665 >;
1666 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1667 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1668 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1669 if let Some(ref mut details) = poller_options.tracing {
1670 details.method_name =
1671 "google_cloud_datastream_v1::client::Datastream::run_stream::until_done";
1672 }
1673
1674 let stub = self.0.stub.clone();
1675 let mut options = self.0.options.clone();
1676 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1677 let query = move |name| {
1678 let stub = stub.clone();
1679 let options = options.clone();
1680 async {
1681 let op = GetOperation::new(stub)
1682 .set_name(name)
1683 .with_options(options)
1684 .send()
1685 .await?;
1686 Ok(Operation::new(op))
1687 }
1688 };
1689
1690 let start = move || async {
1691 let op = self.send().await?;
1692 Ok(Operation::new(op))
1693 };
1694
1695 use google_cloud_lro::internal::PollerExt;
1696 {
1697 google_cloud_lro::internal::new_poller(
1698 polling_error_policy,
1699 polling_backoff_policy,
1700 start,
1701 query,
1702 )
1703 }
1704 .with_options(poller_options)
1705 }
1706
1707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1711 self.0.request.name = v.into();
1712 self
1713 }
1714
1715 pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
1717 where
1718 T: std::convert::Into<crate::model::CdcStrategy>,
1719 {
1720 self.0.request.cdc_strategy = std::option::Option::Some(v.into());
1721 self
1722 }
1723
1724 pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
1726 where
1727 T: std::convert::Into<crate::model::CdcStrategy>,
1728 {
1729 self.0.request.cdc_strategy = v.map(|x| x.into());
1730 self
1731 }
1732
1733 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1735 self.0.request.force = v.into();
1736 self
1737 }
1738 }
1739
1740 #[doc(hidden)]
1741 impl crate::RequestBuilder for RunStream {
1742 fn request_options(&mut self) -> &mut crate::RequestOptions {
1743 &mut self.0.options
1744 }
1745 }
1746
1747 #[derive(Clone, Debug)]
1764 pub struct GetStreamObject(RequestBuilder<crate::model::GetStreamObjectRequest>);
1765
1766 impl GetStreamObject {
1767 pub(crate) fn new(
1768 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1769 ) -> Self {
1770 Self(RequestBuilder::new(stub))
1771 }
1772
1773 pub fn with_request<V: Into<crate::model::GetStreamObjectRequest>>(mut self, v: V) -> Self {
1775 self.0.request = v.into();
1776 self
1777 }
1778
1779 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1781 self.0.options = v.into();
1782 self
1783 }
1784
1785 pub async fn send(self) -> Result<crate::model::StreamObject> {
1787 (*self.0.stub)
1788 .get_stream_object(self.0.request, self.0.options)
1789 .await
1790 .map(crate::Response::into_body)
1791 }
1792
1793 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.0.request.name = v.into();
1798 self
1799 }
1800 }
1801
1802 #[doc(hidden)]
1803 impl crate::RequestBuilder for GetStreamObject {
1804 fn request_options(&mut self) -> &mut crate::RequestOptions {
1805 &mut self.0.options
1806 }
1807 }
1808
1809 #[derive(Clone, Debug)]
1826 pub struct LookupStreamObject(RequestBuilder<crate::model::LookupStreamObjectRequest>);
1827
1828 impl LookupStreamObject {
1829 pub(crate) fn new(
1830 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1831 ) -> Self {
1832 Self(RequestBuilder::new(stub))
1833 }
1834
1835 pub fn with_request<V: Into<crate::model::LookupStreamObjectRequest>>(
1837 mut self,
1838 v: V,
1839 ) -> Self {
1840 self.0.request = v.into();
1841 self
1842 }
1843
1844 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1846 self.0.options = v.into();
1847 self
1848 }
1849
1850 pub async fn send(self) -> Result<crate::model::StreamObject> {
1852 (*self.0.stub)
1853 .lookup_stream_object(self.0.request, self.0.options)
1854 .await
1855 .map(crate::Response::into_body)
1856 }
1857
1858 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1862 self.0.request.parent = v.into();
1863 self
1864 }
1865
1866 pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
1870 where
1871 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1872 {
1873 self.0.request.source_object_identifier = std::option::Option::Some(v.into());
1874 self
1875 }
1876
1877 pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
1881 where
1882 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1883 {
1884 self.0.request.source_object_identifier = v.map(|x| x.into());
1885 self
1886 }
1887 }
1888
1889 #[doc(hidden)]
1890 impl crate::RequestBuilder for LookupStreamObject {
1891 fn request_options(&mut self) -> &mut crate::RequestOptions {
1892 &mut self.0.options
1893 }
1894 }
1895
1896 #[derive(Clone, Debug)]
1917 pub struct ListStreamObjects(RequestBuilder<crate::model::ListStreamObjectsRequest>);
1918
1919 impl ListStreamObjects {
1920 pub(crate) fn new(
1921 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1922 ) -> Self {
1923 Self(RequestBuilder::new(stub))
1924 }
1925
1926 pub fn with_request<V: Into<crate::model::ListStreamObjectsRequest>>(
1928 mut self,
1929 v: V,
1930 ) -> Self {
1931 self.0.request = v.into();
1932 self
1933 }
1934
1935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1937 self.0.options = v.into();
1938 self
1939 }
1940
1941 pub async fn send(self) -> Result<crate::model::ListStreamObjectsResponse> {
1943 (*self.0.stub)
1944 .list_stream_objects(self.0.request, self.0.options)
1945 .await
1946 .map(crate::Response::into_body)
1947 }
1948
1949 pub fn by_page(
1951 self,
1952 ) -> impl google_cloud_gax::paginator::Paginator<
1953 crate::model::ListStreamObjectsResponse,
1954 crate::Error,
1955 > {
1956 use std::clone::Clone;
1957 let token = self.0.request.page_token.clone();
1958 let execute = move |token: String| {
1959 let mut builder = self.clone();
1960 builder.0.request = builder.0.request.set_page_token(token);
1961 builder.send()
1962 };
1963 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1964 }
1965
1966 pub fn by_item(
1968 self,
1969 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1970 crate::model::ListStreamObjectsResponse,
1971 crate::Error,
1972 > {
1973 use google_cloud_gax::paginator::Paginator;
1974 self.by_page().items()
1975 }
1976
1977 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1981 self.0.request.parent = v.into();
1982 self
1983 }
1984
1985 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1987 self.0.request.page_size = v.into();
1988 self
1989 }
1990
1991 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1993 self.0.request.page_token = v.into();
1994 self
1995 }
1996 }
1997
1998 #[doc(hidden)]
1999 impl crate::RequestBuilder for ListStreamObjects {
2000 fn request_options(&mut self) -> &mut crate::RequestOptions {
2001 &mut self.0.options
2002 }
2003 }
2004
2005 #[derive(Clone, Debug)]
2022 pub struct StartBackfillJob(RequestBuilder<crate::model::StartBackfillJobRequest>);
2023
2024 impl StartBackfillJob {
2025 pub(crate) fn new(
2026 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2027 ) -> Self {
2028 Self(RequestBuilder::new(stub))
2029 }
2030
2031 pub fn with_request<V: Into<crate::model::StartBackfillJobRequest>>(
2033 mut self,
2034 v: V,
2035 ) -> Self {
2036 self.0.request = v.into();
2037 self
2038 }
2039
2040 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2042 self.0.options = v.into();
2043 self
2044 }
2045
2046 pub async fn send(self) -> Result<crate::model::StartBackfillJobResponse> {
2048 (*self.0.stub)
2049 .start_backfill_job(self.0.request, self.0.options)
2050 .await
2051 .map(crate::Response::into_body)
2052 }
2053
2054 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2058 self.0.request.object = v.into();
2059 self
2060 }
2061 }
2062
2063 #[doc(hidden)]
2064 impl crate::RequestBuilder for StartBackfillJob {
2065 fn request_options(&mut self) -> &mut crate::RequestOptions {
2066 &mut self.0.options
2067 }
2068 }
2069
2070 #[derive(Clone, Debug)]
2087 pub struct StopBackfillJob(RequestBuilder<crate::model::StopBackfillJobRequest>);
2088
2089 impl StopBackfillJob {
2090 pub(crate) fn new(
2091 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2092 ) -> Self {
2093 Self(RequestBuilder::new(stub))
2094 }
2095
2096 pub fn with_request<V: Into<crate::model::StopBackfillJobRequest>>(mut self, v: V) -> Self {
2098 self.0.request = v.into();
2099 self
2100 }
2101
2102 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2104 self.0.options = v.into();
2105 self
2106 }
2107
2108 pub async fn send(self) -> Result<crate::model::StopBackfillJobResponse> {
2110 (*self.0.stub)
2111 .stop_backfill_job(self.0.request, self.0.options)
2112 .await
2113 .map(crate::Response::into_body)
2114 }
2115
2116 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2120 self.0.request.object = v.into();
2121 self
2122 }
2123 }
2124
2125 #[doc(hidden)]
2126 impl crate::RequestBuilder for StopBackfillJob {
2127 fn request_options(&mut self) -> &mut crate::RequestOptions {
2128 &mut self.0.options
2129 }
2130 }
2131
2132 #[derive(Clone, Debug)]
2149 pub struct FetchStaticIps(RequestBuilder<crate::model::FetchStaticIpsRequest>);
2150
2151 impl FetchStaticIps {
2152 pub(crate) fn new(
2153 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2154 ) -> Self {
2155 Self(RequestBuilder::new(stub))
2156 }
2157
2158 pub fn with_request<V: Into<crate::model::FetchStaticIpsRequest>>(mut self, v: V) -> Self {
2160 self.0.request = v.into();
2161 self
2162 }
2163
2164 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2166 self.0.options = v.into();
2167 self
2168 }
2169
2170 pub async fn send(self) -> Result<crate::model::FetchStaticIpsResponse> {
2172 (*self.0.stub)
2173 .fetch_static_ips(self.0.request, self.0.options)
2174 .await
2175 .map(crate::Response::into_body)
2176 }
2177
2178 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2182 self.0.request.name = v.into();
2183 self
2184 }
2185
2186 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2188 self.0.request.page_size = v.into();
2189 self
2190 }
2191
2192 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2194 self.0.request.page_token = v.into();
2195 self
2196 }
2197 }
2198
2199 #[doc(hidden)]
2200 impl crate::RequestBuilder for FetchStaticIps {
2201 fn request_options(&mut self) -> &mut crate::RequestOptions {
2202 &mut self.0.options
2203 }
2204 }
2205
2206 #[derive(Clone, Debug)]
2224 pub struct CreatePrivateConnection(
2225 RequestBuilder<crate::model::CreatePrivateConnectionRequest>,
2226 );
2227
2228 impl CreatePrivateConnection {
2229 pub(crate) fn new(
2230 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2231 ) -> Self {
2232 Self(RequestBuilder::new(stub))
2233 }
2234
2235 pub fn with_request<V: Into<crate::model::CreatePrivateConnectionRequest>>(
2237 mut self,
2238 v: V,
2239 ) -> Self {
2240 self.0.request = v.into();
2241 self
2242 }
2243
2244 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2246 self.0.options = v.into();
2247 self
2248 }
2249
2250 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2257 (*self.0.stub)
2258 .create_private_connection(self.0.request, self.0.options)
2259 .await
2260 .map(crate::Response::into_body)
2261 }
2262
2263 pub fn poller(
2265 self,
2266 ) -> impl google_cloud_lro::Poller<
2267 crate::model::PrivateConnection,
2268 crate::model::OperationMetadata,
2269 > {
2270 type Operation = google_cloud_lro::internal::Operation<
2271 crate::model::PrivateConnection,
2272 crate::model::OperationMetadata,
2273 >;
2274 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2275 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2276 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2277 if let Some(ref mut details) = poller_options.tracing {
2278 details.method_name = "google_cloud_datastream_v1::client::Datastream::create_private_connection::until_done";
2279 }
2280
2281 let stub = self.0.stub.clone();
2282 let mut options = self.0.options.clone();
2283 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2284 let query = move |name| {
2285 let stub = stub.clone();
2286 let options = options.clone();
2287 async {
2288 let op = GetOperation::new(stub)
2289 .set_name(name)
2290 .with_options(options)
2291 .send()
2292 .await?;
2293 Ok(Operation::new(op))
2294 }
2295 };
2296
2297 let start = move || async {
2298 let op = self.send().await?;
2299 Ok(Operation::new(op))
2300 };
2301
2302 use google_cloud_lro::internal::PollerExt;
2303 {
2304 google_cloud_lro::internal::new_poller(
2305 polling_error_policy,
2306 polling_backoff_policy,
2307 start,
2308 query,
2309 )
2310 }
2311 .with_options(poller_options)
2312 }
2313
2314 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.0.request.parent = v.into();
2319 self
2320 }
2321
2322 pub fn set_private_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2326 self.0.request.private_connection_id = v.into();
2327 self
2328 }
2329
2330 pub fn set_private_connection<T>(mut self, v: T) -> Self
2334 where
2335 T: std::convert::Into<crate::model::PrivateConnection>,
2336 {
2337 self.0.request.private_connection = std::option::Option::Some(v.into());
2338 self
2339 }
2340
2341 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2345 where
2346 T: std::convert::Into<crate::model::PrivateConnection>,
2347 {
2348 self.0.request.private_connection = v.map(|x| x.into());
2349 self
2350 }
2351
2352 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2354 self.0.request.request_id = v.into();
2355 self
2356 }
2357
2358 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2360 self.0.request.force = v.into();
2361 self
2362 }
2363
2364 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2366 self.0.request.validate_only = v.into();
2367 self
2368 }
2369 }
2370
2371 #[doc(hidden)]
2372 impl crate::RequestBuilder for CreatePrivateConnection {
2373 fn request_options(&mut self) -> &mut crate::RequestOptions {
2374 &mut self.0.options
2375 }
2376 }
2377
2378 #[derive(Clone, Debug)]
2395 pub struct GetPrivateConnection(RequestBuilder<crate::model::GetPrivateConnectionRequest>);
2396
2397 impl GetPrivateConnection {
2398 pub(crate) fn new(
2399 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2400 ) -> Self {
2401 Self(RequestBuilder::new(stub))
2402 }
2403
2404 pub fn with_request<V: Into<crate::model::GetPrivateConnectionRequest>>(
2406 mut self,
2407 v: V,
2408 ) -> Self {
2409 self.0.request = v.into();
2410 self
2411 }
2412
2413 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2415 self.0.options = v.into();
2416 self
2417 }
2418
2419 pub async fn send(self) -> Result<crate::model::PrivateConnection> {
2421 (*self.0.stub)
2422 .get_private_connection(self.0.request, self.0.options)
2423 .await
2424 .map(crate::Response::into_body)
2425 }
2426
2427 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2431 self.0.request.name = v.into();
2432 self
2433 }
2434 }
2435
2436 #[doc(hidden)]
2437 impl crate::RequestBuilder for GetPrivateConnection {
2438 fn request_options(&mut self) -> &mut crate::RequestOptions {
2439 &mut self.0.options
2440 }
2441 }
2442
2443 #[derive(Clone, Debug)]
2464 pub struct ListPrivateConnections(RequestBuilder<crate::model::ListPrivateConnectionsRequest>);
2465
2466 impl ListPrivateConnections {
2467 pub(crate) fn new(
2468 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2469 ) -> Self {
2470 Self(RequestBuilder::new(stub))
2471 }
2472
2473 pub fn with_request<V: Into<crate::model::ListPrivateConnectionsRequest>>(
2475 mut self,
2476 v: V,
2477 ) -> Self {
2478 self.0.request = v.into();
2479 self
2480 }
2481
2482 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2484 self.0.options = v.into();
2485 self
2486 }
2487
2488 pub async fn send(self) -> Result<crate::model::ListPrivateConnectionsResponse> {
2490 (*self.0.stub)
2491 .list_private_connections(self.0.request, self.0.options)
2492 .await
2493 .map(crate::Response::into_body)
2494 }
2495
2496 pub fn by_page(
2498 self,
2499 ) -> impl google_cloud_gax::paginator::Paginator<
2500 crate::model::ListPrivateConnectionsResponse,
2501 crate::Error,
2502 > {
2503 use std::clone::Clone;
2504 let token = self.0.request.page_token.clone();
2505 let execute = move |token: String| {
2506 let mut builder = self.clone();
2507 builder.0.request = builder.0.request.set_page_token(token);
2508 builder.send()
2509 };
2510 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2511 }
2512
2513 pub fn by_item(
2515 self,
2516 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2517 crate::model::ListPrivateConnectionsResponse,
2518 crate::Error,
2519 > {
2520 use google_cloud_gax::paginator::Paginator;
2521 self.by_page().items()
2522 }
2523
2524 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2528 self.0.request.parent = v.into();
2529 self
2530 }
2531
2532 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2534 self.0.request.page_size = v.into();
2535 self
2536 }
2537
2538 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2540 self.0.request.page_token = v.into();
2541 self
2542 }
2543
2544 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2546 self.0.request.filter = v.into();
2547 self
2548 }
2549
2550 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2552 self.0.request.order_by = v.into();
2553 self
2554 }
2555 }
2556
2557 #[doc(hidden)]
2558 impl crate::RequestBuilder for ListPrivateConnections {
2559 fn request_options(&mut self) -> &mut crate::RequestOptions {
2560 &mut self.0.options
2561 }
2562 }
2563
2564 #[derive(Clone, Debug)]
2582 pub struct DeletePrivateConnection(
2583 RequestBuilder<crate::model::DeletePrivateConnectionRequest>,
2584 );
2585
2586 impl DeletePrivateConnection {
2587 pub(crate) fn new(
2588 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2589 ) -> Self {
2590 Self(RequestBuilder::new(stub))
2591 }
2592
2593 pub fn with_request<V: Into<crate::model::DeletePrivateConnectionRequest>>(
2595 mut self,
2596 v: V,
2597 ) -> Self {
2598 self.0.request = v.into();
2599 self
2600 }
2601
2602 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2604 self.0.options = v.into();
2605 self
2606 }
2607
2608 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2615 (*self.0.stub)
2616 .delete_private_connection(self.0.request, self.0.options)
2617 .await
2618 .map(crate::Response::into_body)
2619 }
2620
2621 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2623 type Operation =
2624 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2625 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2626 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2627 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2628 if let Some(ref mut details) = poller_options.tracing {
2629 details.method_name = "google_cloud_datastream_v1::client::Datastream::delete_private_connection::until_done";
2630 }
2631
2632 let stub = self.0.stub.clone();
2633 let mut options = self.0.options.clone();
2634 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2635 let query = move |name| {
2636 let stub = stub.clone();
2637 let options = options.clone();
2638 async {
2639 let op = GetOperation::new(stub)
2640 .set_name(name)
2641 .with_options(options)
2642 .send()
2643 .await?;
2644 Ok(Operation::new(op))
2645 }
2646 };
2647
2648 let start = move || async {
2649 let op = self.send().await?;
2650 Ok(Operation::new(op))
2651 };
2652
2653 use google_cloud_lro::internal::PollerExt;
2654 {
2655 google_cloud_lro::internal::new_unit_response_poller(
2656 polling_error_policy,
2657 polling_backoff_policy,
2658 start,
2659 query,
2660 )
2661 }
2662 .with_options(poller_options)
2663 }
2664
2665 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2669 self.0.request.name = v.into();
2670 self
2671 }
2672
2673 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2675 self.0.request.request_id = v.into();
2676 self
2677 }
2678
2679 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2681 self.0.request.force = v.into();
2682 self
2683 }
2684 }
2685
2686 #[doc(hidden)]
2687 impl crate::RequestBuilder for DeletePrivateConnection {
2688 fn request_options(&mut self) -> &mut crate::RequestOptions {
2689 &mut self.0.options
2690 }
2691 }
2692
2693 #[derive(Clone, Debug)]
2711 pub struct CreateRoute(RequestBuilder<crate::model::CreateRouteRequest>);
2712
2713 impl CreateRoute {
2714 pub(crate) fn new(
2715 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2716 ) -> Self {
2717 Self(RequestBuilder::new(stub))
2718 }
2719
2720 pub fn with_request<V: Into<crate::model::CreateRouteRequest>>(mut self, v: V) -> Self {
2722 self.0.request = v.into();
2723 self
2724 }
2725
2726 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2728 self.0.options = v.into();
2729 self
2730 }
2731
2732 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2739 (*self.0.stub)
2740 .create_route(self.0.request, self.0.options)
2741 .await
2742 .map(crate::Response::into_body)
2743 }
2744
2745 pub fn poller(
2747 self,
2748 ) -> impl google_cloud_lro::Poller<crate::model::Route, crate::model::OperationMetadata>
2749 {
2750 type Operation = google_cloud_lro::internal::Operation<
2751 crate::model::Route,
2752 crate::model::OperationMetadata,
2753 >;
2754 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2755 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2756 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2757 if let Some(ref mut details) = poller_options.tracing {
2758 details.method_name =
2759 "google_cloud_datastream_v1::client::Datastream::create_route::until_done";
2760 }
2761
2762 let stub = self.0.stub.clone();
2763 let mut options = self.0.options.clone();
2764 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2765 let query = move |name| {
2766 let stub = stub.clone();
2767 let options = options.clone();
2768 async {
2769 let op = GetOperation::new(stub)
2770 .set_name(name)
2771 .with_options(options)
2772 .send()
2773 .await?;
2774 Ok(Operation::new(op))
2775 }
2776 };
2777
2778 let start = move || async {
2779 let op = self.send().await?;
2780 Ok(Operation::new(op))
2781 };
2782
2783 use google_cloud_lro::internal::PollerExt;
2784 {
2785 google_cloud_lro::internal::new_poller(
2786 polling_error_policy,
2787 polling_backoff_policy,
2788 start,
2789 query,
2790 )
2791 }
2792 .with_options(poller_options)
2793 }
2794
2795 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2799 self.0.request.parent = v.into();
2800 self
2801 }
2802
2803 pub fn set_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2807 self.0.request.route_id = v.into();
2808 self
2809 }
2810
2811 pub fn set_route<T>(mut self, v: T) -> Self
2815 where
2816 T: std::convert::Into<crate::model::Route>,
2817 {
2818 self.0.request.route = std::option::Option::Some(v.into());
2819 self
2820 }
2821
2822 pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
2826 where
2827 T: std::convert::Into<crate::model::Route>,
2828 {
2829 self.0.request.route = v.map(|x| x.into());
2830 self
2831 }
2832
2833 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2835 self.0.request.request_id = v.into();
2836 self
2837 }
2838 }
2839
2840 #[doc(hidden)]
2841 impl crate::RequestBuilder for CreateRoute {
2842 fn request_options(&mut self) -> &mut crate::RequestOptions {
2843 &mut self.0.options
2844 }
2845 }
2846
2847 #[derive(Clone, Debug)]
2864 pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
2865
2866 impl GetRoute {
2867 pub(crate) fn new(
2868 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2869 ) -> Self {
2870 Self(RequestBuilder::new(stub))
2871 }
2872
2873 pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
2875 self.0.request = v.into();
2876 self
2877 }
2878
2879 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2881 self.0.options = v.into();
2882 self
2883 }
2884
2885 pub async fn send(self) -> Result<crate::model::Route> {
2887 (*self.0.stub)
2888 .get_route(self.0.request, self.0.options)
2889 .await
2890 .map(crate::Response::into_body)
2891 }
2892
2893 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2897 self.0.request.name = v.into();
2898 self
2899 }
2900 }
2901
2902 #[doc(hidden)]
2903 impl crate::RequestBuilder for GetRoute {
2904 fn request_options(&mut self) -> &mut crate::RequestOptions {
2905 &mut self.0.options
2906 }
2907 }
2908
2909 #[derive(Clone, Debug)]
2930 pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
2931
2932 impl ListRoutes {
2933 pub(crate) fn new(
2934 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2935 ) -> Self {
2936 Self(RequestBuilder::new(stub))
2937 }
2938
2939 pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
2941 self.0.request = v.into();
2942 self
2943 }
2944
2945 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2947 self.0.options = v.into();
2948 self
2949 }
2950
2951 pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
2953 (*self.0.stub)
2954 .list_routes(self.0.request, self.0.options)
2955 .await
2956 .map(crate::Response::into_body)
2957 }
2958
2959 pub fn by_page(
2961 self,
2962 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutesResponse, crate::Error>
2963 {
2964 use std::clone::Clone;
2965 let token = self.0.request.page_token.clone();
2966 let execute = move |token: String| {
2967 let mut builder = self.clone();
2968 builder.0.request = builder.0.request.set_page_token(token);
2969 builder.send()
2970 };
2971 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2972 }
2973
2974 pub fn by_item(
2976 self,
2977 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2978 crate::model::ListRoutesResponse,
2979 crate::Error,
2980 > {
2981 use google_cloud_gax::paginator::Paginator;
2982 self.by_page().items()
2983 }
2984
2985 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2989 self.0.request.parent = v.into();
2990 self
2991 }
2992
2993 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2995 self.0.request.page_size = v.into();
2996 self
2997 }
2998
2999 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3001 self.0.request.page_token = v.into();
3002 self
3003 }
3004
3005 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3007 self.0.request.filter = v.into();
3008 self
3009 }
3010
3011 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3013 self.0.request.order_by = v.into();
3014 self
3015 }
3016 }
3017
3018 #[doc(hidden)]
3019 impl crate::RequestBuilder for ListRoutes {
3020 fn request_options(&mut self) -> &mut crate::RequestOptions {
3021 &mut self.0.options
3022 }
3023 }
3024
3025 #[derive(Clone, Debug)]
3043 pub struct DeleteRoute(RequestBuilder<crate::model::DeleteRouteRequest>);
3044
3045 impl DeleteRoute {
3046 pub(crate) fn new(
3047 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3048 ) -> Self {
3049 Self(RequestBuilder::new(stub))
3050 }
3051
3052 pub fn with_request<V: Into<crate::model::DeleteRouteRequest>>(mut self, v: V) -> Self {
3054 self.0.request = v.into();
3055 self
3056 }
3057
3058 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3060 self.0.options = v.into();
3061 self
3062 }
3063
3064 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3071 (*self.0.stub)
3072 .delete_route(self.0.request, self.0.options)
3073 .await
3074 .map(crate::Response::into_body)
3075 }
3076
3077 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3079 type Operation =
3080 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3081 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3082 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3083 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3084 if let Some(ref mut details) = poller_options.tracing {
3085 details.method_name =
3086 "google_cloud_datastream_v1::client::Datastream::delete_route::until_done";
3087 }
3088
3089 let stub = self.0.stub.clone();
3090 let mut options = self.0.options.clone();
3091 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3092 let query = move |name| {
3093 let stub = stub.clone();
3094 let options = options.clone();
3095 async {
3096 let op = GetOperation::new(stub)
3097 .set_name(name)
3098 .with_options(options)
3099 .send()
3100 .await?;
3101 Ok(Operation::new(op))
3102 }
3103 };
3104
3105 let start = move || async {
3106 let op = self.send().await?;
3107 Ok(Operation::new(op))
3108 };
3109
3110 use google_cloud_lro::internal::PollerExt;
3111 {
3112 google_cloud_lro::internal::new_unit_response_poller(
3113 polling_error_policy,
3114 polling_backoff_policy,
3115 start,
3116 query,
3117 )
3118 }
3119 .with_options(poller_options)
3120 }
3121
3122 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3126 self.0.request.name = v.into();
3127 self
3128 }
3129
3130 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3132 self.0.request.request_id = v.into();
3133 self
3134 }
3135 }
3136
3137 #[doc(hidden)]
3138 impl crate::RequestBuilder for DeleteRoute {
3139 fn request_options(&mut self) -> &mut crate::RequestOptions {
3140 &mut self.0.options
3141 }
3142 }
3143
3144 #[derive(Clone, Debug)]
3165 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3166
3167 impl ListLocations {
3168 pub(crate) fn new(
3169 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3170 ) -> Self {
3171 Self(RequestBuilder::new(stub))
3172 }
3173
3174 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3176 mut self,
3177 v: V,
3178 ) -> Self {
3179 self.0.request = v.into();
3180 self
3181 }
3182
3183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3185 self.0.options = v.into();
3186 self
3187 }
3188
3189 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3191 (*self.0.stub)
3192 .list_locations(self.0.request, self.0.options)
3193 .await
3194 .map(crate::Response::into_body)
3195 }
3196
3197 pub fn by_page(
3199 self,
3200 ) -> impl google_cloud_gax::paginator::Paginator<
3201 google_cloud_location::model::ListLocationsResponse,
3202 crate::Error,
3203 > {
3204 use std::clone::Clone;
3205 let token = self.0.request.page_token.clone();
3206 let execute = move |token: String| {
3207 let mut builder = self.clone();
3208 builder.0.request = builder.0.request.set_page_token(token);
3209 builder.send()
3210 };
3211 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3212 }
3213
3214 pub fn by_item(
3216 self,
3217 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3218 google_cloud_location::model::ListLocationsResponse,
3219 crate::Error,
3220 > {
3221 use google_cloud_gax::paginator::Paginator;
3222 self.by_page().items()
3223 }
3224
3225 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3227 self.0.request.name = v.into();
3228 self
3229 }
3230
3231 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3233 self.0.request.filter = v.into();
3234 self
3235 }
3236
3237 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3239 self.0.request.page_size = v.into();
3240 self
3241 }
3242
3243 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3245 self.0.request.page_token = v.into();
3246 self
3247 }
3248 }
3249
3250 #[doc(hidden)]
3251 impl crate::RequestBuilder for ListLocations {
3252 fn request_options(&mut self) -> &mut crate::RequestOptions {
3253 &mut self.0.options
3254 }
3255 }
3256
3257 #[derive(Clone, Debug)]
3274 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3275
3276 impl GetLocation {
3277 pub(crate) fn new(
3278 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3279 ) -> Self {
3280 Self(RequestBuilder::new(stub))
3281 }
3282
3283 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3285 mut self,
3286 v: V,
3287 ) -> Self {
3288 self.0.request = v.into();
3289 self
3290 }
3291
3292 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3294 self.0.options = v.into();
3295 self
3296 }
3297
3298 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3300 (*self.0.stub)
3301 .get_location(self.0.request, self.0.options)
3302 .await
3303 .map(crate::Response::into_body)
3304 }
3305
3306 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3308 self.0.request.name = v.into();
3309 self
3310 }
3311 }
3312
3313 #[doc(hidden)]
3314 impl crate::RequestBuilder for GetLocation {
3315 fn request_options(&mut self) -> &mut crate::RequestOptions {
3316 &mut self.0.options
3317 }
3318 }
3319
3320 #[derive(Clone, Debug)]
3341 pub struct ListOperations(
3342 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3343 );
3344
3345 impl ListOperations {
3346 pub(crate) fn new(
3347 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3348 ) -> Self {
3349 Self(RequestBuilder::new(stub))
3350 }
3351
3352 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3354 mut self,
3355 v: V,
3356 ) -> Self {
3357 self.0.request = v.into();
3358 self
3359 }
3360
3361 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3363 self.0.options = v.into();
3364 self
3365 }
3366
3367 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3369 (*self.0.stub)
3370 .list_operations(self.0.request, self.0.options)
3371 .await
3372 .map(crate::Response::into_body)
3373 }
3374
3375 pub fn by_page(
3377 self,
3378 ) -> impl google_cloud_gax::paginator::Paginator<
3379 google_cloud_longrunning::model::ListOperationsResponse,
3380 crate::Error,
3381 > {
3382 use std::clone::Clone;
3383 let token = self.0.request.page_token.clone();
3384 let execute = move |token: String| {
3385 let mut builder = self.clone();
3386 builder.0.request = builder.0.request.set_page_token(token);
3387 builder.send()
3388 };
3389 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3390 }
3391
3392 pub fn by_item(
3394 self,
3395 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3396 google_cloud_longrunning::model::ListOperationsResponse,
3397 crate::Error,
3398 > {
3399 use google_cloud_gax::paginator::Paginator;
3400 self.by_page().items()
3401 }
3402
3403 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3405 self.0.request.name = v.into();
3406 self
3407 }
3408
3409 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.0.request.filter = v.into();
3412 self
3413 }
3414
3415 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3417 self.0.request.page_size = v.into();
3418 self
3419 }
3420
3421 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3423 self.0.request.page_token = v.into();
3424 self
3425 }
3426
3427 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3429 self.0.request.return_partial_success = v.into();
3430 self
3431 }
3432 }
3433
3434 #[doc(hidden)]
3435 impl crate::RequestBuilder for ListOperations {
3436 fn request_options(&mut self) -> &mut crate::RequestOptions {
3437 &mut self.0.options
3438 }
3439 }
3440
3441 #[derive(Clone, Debug)]
3458 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3459
3460 impl GetOperation {
3461 pub(crate) fn new(
3462 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3463 ) -> Self {
3464 Self(RequestBuilder::new(stub))
3465 }
3466
3467 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3469 mut self,
3470 v: V,
3471 ) -> Self {
3472 self.0.request = v.into();
3473 self
3474 }
3475
3476 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3478 self.0.options = v.into();
3479 self
3480 }
3481
3482 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3484 (*self.0.stub)
3485 .get_operation(self.0.request, self.0.options)
3486 .await
3487 .map(crate::Response::into_body)
3488 }
3489
3490 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3492 self.0.request.name = v.into();
3493 self
3494 }
3495 }
3496
3497 #[doc(hidden)]
3498 impl crate::RequestBuilder for GetOperation {
3499 fn request_options(&mut self) -> &mut crate::RequestOptions {
3500 &mut self.0.options
3501 }
3502 }
3503
3504 #[derive(Clone, Debug)]
3521 pub struct DeleteOperation(
3522 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3523 );
3524
3525 impl DeleteOperation {
3526 pub(crate) fn new(
3527 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3528 ) -> Self {
3529 Self(RequestBuilder::new(stub))
3530 }
3531
3532 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3534 mut self,
3535 v: V,
3536 ) -> Self {
3537 self.0.request = v.into();
3538 self
3539 }
3540
3541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3543 self.0.options = v.into();
3544 self
3545 }
3546
3547 pub async fn send(self) -> Result<()> {
3549 (*self.0.stub)
3550 .delete_operation(self.0.request, self.0.options)
3551 .await
3552 .map(crate::Response::into_body)
3553 }
3554
3555 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3557 self.0.request.name = v.into();
3558 self
3559 }
3560 }
3561
3562 #[doc(hidden)]
3563 impl crate::RequestBuilder for DeleteOperation {
3564 fn request_options(&mut self) -> &mut crate::RequestOptions {
3565 &mut self.0.options
3566 }
3567 }
3568
3569 #[derive(Clone, Debug)]
3586 pub struct CancelOperation(
3587 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3588 );
3589
3590 impl CancelOperation {
3591 pub(crate) fn new(
3592 stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3593 ) -> Self {
3594 Self(RequestBuilder::new(stub))
3595 }
3596
3597 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3599 mut self,
3600 v: V,
3601 ) -> Self {
3602 self.0.request = v.into();
3603 self
3604 }
3605
3606 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3608 self.0.options = v.into();
3609 self
3610 }
3611
3612 pub async fn send(self) -> Result<()> {
3614 (*self.0.stub)
3615 .cancel_operation(self.0.request, self.0.options)
3616 .await
3617 .map(crate::Response::into_body)
3618 }
3619
3620 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3622 self.0.request.name = v.into();
3623 self
3624 }
3625 }
3626
3627 #[doc(hidden)]
3628 impl crate::RequestBuilder for CancelOperation {
3629 fn request_options(&mut self) -> &mut crate::RequestOptions {
3630 &mut self.0.options
3631 }
3632 }
3633}