1pub mod data_transfer_service {
18 use crate::Result;
19 use std::sync::Arc;
20
21 pub type ClientBuilder =
35 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
36
37 pub(crate) mod client {
38 use super::super::super::client::DataTransferService;
39 pub struct Factory;
40 impl gax::client_builder::internal::ClientFactory for Factory {
41 type Client = DataTransferService;
42 type Credentials = gaxi::options::Credentials;
43 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
44 Self::Client::new(config).await
45 }
46 }
47 }
48
49 #[derive(Clone, Debug)]
51 pub(crate) struct RequestBuilder<R: std::default::Default> {
52 stub: Arc<dyn super::super::stub::dynamic::DataTransferService>,
53 request: R,
54 options: gax::options::RequestOptions,
55 }
56
57 impl<R> RequestBuilder<R>
58 where
59 R: std::default::Default,
60 {
61 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
62 Self {
63 stub,
64 request: R::default(),
65 options: gax::options::RequestOptions::default(),
66 }
67 }
68 }
69
70 #[derive(Clone, Debug)]
72 pub struct GetDataSource(RequestBuilder<crate::model::GetDataSourceRequest>);
73
74 impl GetDataSource {
75 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
76 Self(RequestBuilder::new(stub))
77 }
78
79 pub fn with_request<V: Into<crate::model::GetDataSourceRequest>>(mut self, v: V) -> Self {
81 self.0.request = v.into();
82 self
83 }
84
85 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
87 self.0.options = v.into();
88 self
89 }
90
91 pub async fn send(self) -> Result<crate::model::DataSource> {
93 (*self.0.stub)
94 .get_data_source(self.0.request, self.0.options)
95 .await
96 .map(gax::response::Response::into_body)
97 }
98
99 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
101 self.0.request.name = v.into();
102 self
103 }
104 }
105
106 #[doc(hidden)]
107 impl gax::options::internal::RequestBuilder for GetDataSource {
108 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
109 &mut self.0.options
110 }
111 }
112
113 #[derive(Clone, Debug)]
115 pub struct ListDataSources(RequestBuilder<crate::model::ListDataSourcesRequest>);
116
117 impl ListDataSources {
118 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
119 Self(RequestBuilder::new(stub))
120 }
121
122 pub fn with_request<V: Into<crate::model::ListDataSourcesRequest>>(mut self, v: V) -> Self {
124 self.0.request = v.into();
125 self
126 }
127
128 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
130 self.0.options = v.into();
131 self
132 }
133
134 pub async fn send(self) -> Result<crate::model::ListDataSourcesResponse> {
136 (*self.0.stub)
137 .list_data_sources(self.0.request, self.0.options)
138 .await
139 .map(gax::response::Response::into_body)
140 }
141
142 pub async fn paginator(
144 self,
145 ) -> impl gax::paginator::Paginator<crate::model::ListDataSourcesResponse, gax::error::Error>
146 {
147 use std::clone::Clone;
148 let token = self.0.request.page_token.clone();
149 let execute = move |token: String| {
150 let mut builder = self.clone();
151 builder.0.request = builder.0.request.set_page_token(token);
152 builder.send()
153 };
154 gax::paginator::internal::new_paginator(token, execute)
155 }
156
157 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_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
171 self.0.request.page_size = v.into();
172 self
173 }
174 }
175
176 #[doc(hidden)]
177 impl gax::options::internal::RequestBuilder for ListDataSources {
178 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
179 &mut self.0.options
180 }
181 }
182
183 #[derive(Clone, Debug)]
185 pub struct CreateTransferConfig(RequestBuilder<crate::model::CreateTransferConfigRequest>);
186
187 impl CreateTransferConfig {
188 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
189 Self(RequestBuilder::new(stub))
190 }
191
192 pub fn with_request<V: Into<crate::model::CreateTransferConfigRequest>>(
194 mut self,
195 v: V,
196 ) -> Self {
197 self.0.request = v.into();
198 self
199 }
200
201 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
203 self.0.options = v.into();
204 self
205 }
206
207 pub async fn send(self) -> Result<crate::model::TransferConfig> {
209 (*self.0.stub)
210 .create_transfer_config(self.0.request, self.0.options)
211 .await
212 .map(gax::response::Response::into_body)
213 }
214
215 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
217 self.0.request.parent = v.into();
218 self
219 }
220
221 pub fn set_transfer_config<T: Into<std::option::Option<crate::model::TransferConfig>>>(
223 mut self,
224 v: T,
225 ) -> Self {
226 self.0.request.transfer_config = v.into();
227 self
228 }
229
230 pub fn set_authorization_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
232 self.0.request.authorization_code = v.into();
233 self
234 }
235
236 pub fn set_version_info<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.version_info = v.into();
239 self
240 }
241
242 pub fn set_service_account_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
244 self.0.request.service_account_name = v.into();
245 self
246 }
247 }
248
249 #[doc(hidden)]
250 impl gax::options::internal::RequestBuilder for CreateTransferConfig {
251 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
252 &mut self.0.options
253 }
254 }
255
256 #[derive(Clone, Debug)]
258 pub struct UpdateTransferConfig(RequestBuilder<crate::model::UpdateTransferConfigRequest>);
259
260 impl UpdateTransferConfig {
261 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
262 Self(RequestBuilder::new(stub))
263 }
264
265 pub fn with_request<V: Into<crate::model::UpdateTransferConfigRequest>>(
267 mut self,
268 v: V,
269 ) -> Self {
270 self.0.request = v.into();
271 self
272 }
273
274 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
276 self.0.options = v.into();
277 self
278 }
279
280 pub async fn send(self) -> Result<crate::model::TransferConfig> {
282 (*self.0.stub)
283 .update_transfer_config(self.0.request, self.0.options)
284 .await
285 .map(gax::response::Response::into_body)
286 }
287
288 pub fn set_transfer_config<T: Into<std::option::Option<crate::model::TransferConfig>>>(
290 mut self,
291 v: T,
292 ) -> Self {
293 self.0.request.transfer_config = v.into();
294 self
295 }
296
297 pub fn set_authorization_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
299 self.0.request.authorization_code = v.into();
300 self
301 }
302
303 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
305 mut self,
306 v: T,
307 ) -> Self {
308 self.0.request.update_mask = v.into();
309 self
310 }
311
312 pub fn set_version_info<T: Into<std::string::String>>(mut self, v: T) -> Self {
314 self.0.request.version_info = v.into();
315 self
316 }
317
318 pub fn set_service_account_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
320 self.0.request.service_account_name = v.into();
321 self
322 }
323 }
324
325 #[doc(hidden)]
326 impl gax::options::internal::RequestBuilder for UpdateTransferConfig {
327 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
328 &mut self.0.options
329 }
330 }
331
332 #[derive(Clone, Debug)]
334 pub struct DeleteTransferConfig(RequestBuilder<crate::model::DeleteTransferConfigRequest>);
335
336 impl DeleteTransferConfig {
337 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
338 Self(RequestBuilder::new(stub))
339 }
340
341 pub fn with_request<V: Into<crate::model::DeleteTransferConfigRequest>>(
343 mut self,
344 v: V,
345 ) -> Self {
346 self.0.request = v.into();
347 self
348 }
349
350 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
352 self.0.options = v.into();
353 self
354 }
355
356 pub async fn send(self) -> Result<()> {
358 (*self.0.stub)
359 .delete_transfer_config(self.0.request, self.0.options)
360 .await
361 .map(gax::response::Response::into_body)
362 }
363
364 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
366 self.0.request.name = v.into();
367 self
368 }
369 }
370
371 #[doc(hidden)]
372 impl gax::options::internal::RequestBuilder for DeleteTransferConfig {
373 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
374 &mut self.0.options
375 }
376 }
377
378 #[derive(Clone, Debug)]
380 pub struct GetTransferConfig(RequestBuilder<crate::model::GetTransferConfigRequest>);
381
382 impl GetTransferConfig {
383 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
384 Self(RequestBuilder::new(stub))
385 }
386
387 pub fn with_request<V: Into<crate::model::GetTransferConfigRequest>>(
389 mut self,
390 v: V,
391 ) -> Self {
392 self.0.request = v.into();
393 self
394 }
395
396 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
398 self.0.options = v.into();
399 self
400 }
401
402 pub async fn send(self) -> Result<crate::model::TransferConfig> {
404 (*self.0.stub)
405 .get_transfer_config(self.0.request, self.0.options)
406 .await
407 .map(gax::response::Response::into_body)
408 }
409
410 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
412 self.0.request.name = v.into();
413 self
414 }
415 }
416
417 #[doc(hidden)]
418 impl gax::options::internal::RequestBuilder for GetTransferConfig {
419 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
420 &mut self.0.options
421 }
422 }
423
424 #[derive(Clone, Debug)]
426 pub struct ListTransferConfigs(RequestBuilder<crate::model::ListTransferConfigsRequest>);
427
428 impl ListTransferConfigs {
429 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
430 Self(RequestBuilder::new(stub))
431 }
432
433 pub fn with_request<V: Into<crate::model::ListTransferConfigsRequest>>(
435 mut self,
436 v: V,
437 ) -> Self {
438 self.0.request = v.into();
439 self
440 }
441
442 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
444 self.0.options = v.into();
445 self
446 }
447
448 pub async fn send(self) -> Result<crate::model::ListTransferConfigsResponse> {
450 (*self.0.stub)
451 .list_transfer_configs(self.0.request, self.0.options)
452 .await
453 .map(gax::response::Response::into_body)
454 }
455
456 pub async fn paginator(
458 self,
459 ) -> impl gax::paginator::Paginator<crate::model::ListTransferConfigsResponse, gax::error::Error>
460 {
461 use std::clone::Clone;
462 let token = self.0.request.page_token.clone();
463 let execute = move |token: String| {
464 let mut builder = self.clone();
465 builder.0.request = builder.0.request.set_page_token(token);
466 builder.send()
467 };
468 gax::paginator::internal::new_paginator(token, execute)
469 }
470
471 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
473 self.0.request.parent = v.into();
474 self
475 }
476
477 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
479 self.0.request.page_token = v.into();
480 self
481 }
482
483 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
485 self.0.request.page_size = v.into();
486 self
487 }
488
489 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
491 where
492 T: std::iter::IntoIterator<Item = V>,
493 V: std::convert::Into<std::string::String>,
494 {
495 use std::iter::Iterator;
496 self.0.request.data_source_ids = v.into_iter().map(|i| i.into()).collect();
497 self
498 }
499 }
500
501 #[doc(hidden)]
502 impl gax::options::internal::RequestBuilder for ListTransferConfigs {
503 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
504 &mut self.0.options
505 }
506 }
507
508 #[derive(Clone, Debug)]
510 pub struct ScheduleTransferRuns(RequestBuilder<crate::model::ScheduleTransferRunsRequest>);
511
512 impl ScheduleTransferRuns {
513 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
514 Self(RequestBuilder::new(stub))
515 }
516
517 pub fn with_request<V: Into<crate::model::ScheduleTransferRunsRequest>>(
519 mut self,
520 v: V,
521 ) -> Self {
522 self.0.request = v.into();
523 self
524 }
525
526 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
528 self.0.options = v.into();
529 self
530 }
531
532 pub async fn send(self) -> Result<crate::model::ScheduleTransferRunsResponse> {
534 (*self.0.stub)
535 .schedule_transfer_runs(self.0.request, self.0.options)
536 .await
537 .map(gax::response::Response::into_body)
538 }
539
540 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
542 self.0.request.parent = v.into();
543 self
544 }
545
546 pub fn set_start_time<T: Into<std::option::Option<wkt::Timestamp>>>(
548 mut self,
549 v: T,
550 ) -> Self {
551 self.0.request.start_time = v.into();
552 self
553 }
554
555 pub fn set_end_time<T: Into<std::option::Option<wkt::Timestamp>>>(mut self, v: T) -> Self {
557 self.0.request.end_time = v.into();
558 self
559 }
560 }
561
562 #[doc(hidden)]
563 impl gax::options::internal::RequestBuilder for ScheduleTransferRuns {
564 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
565 &mut self.0.options
566 }
567 }
568
569 #[derive(Clone, Debug)]
571 pub struct StartManualTransferRuns(
572 RequestBuilder<crate::model::StartManualTransferRunsRequest>,
573 );
574
575 impl StartManualTransferRuns {
576 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
577 Self(RequestBuilder::new(stub))
578 }
579
580 pub fn with_request<V: Into<crate::model::StartManualTransferRunsRequest>>(
582 mut self,
583 v: V,
584 ) -> Self {
585 self.0.request = v.into();
586 self
587 }
588
589 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
591 self.0.options = v.into();
592 self
593 }
594
595 pub async fn send(self) -> Result<crate::model::StartManualTransferRunsResponse> {
597 (*self.0.stub)
598 .start_manual_transfer_runs(self.0.request, self.0.options)
599 .await
600 .map(gax::response::Response::into_body)
601 }
602
603 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
605 self.0.request.parent = v.into();
606 self
607 }
608
609 pub fn set_time<T: Into<Option<crate::model::start_manual_transfer_runs_request::Time>>>(
614 mut self,
615 v: T,
616 ) -> Self {
617 self.0.request.time = v.into();
618 self
619 }
620
621 pub fn set_requested_time_range<
627 T: std::convert::Into<
628 std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
629 >,
630 >(
631 mut self,
632 v: T,
633 ) -> Self {
634 self.0.request = self.0.request.set_requested_time_range(v);
635 self
636 }
637
638 pub fn set_requested_run_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
644 mut self,
645 v: T,
646 ) -> Self {
647 self.0.request = self.0.request.set_requested_run_time(v);
648 self
649 }
650 }
651
652 #[doc(hidden)]
653 impl gax::options::internal::RequestBuilder for StartManualTransferRuns {
654 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
655 &mut self.0.options
656 }
657 }
658
659 #[derive(Clone, Debug)]
661 pub struct GetTransferRun(RequestBuilder<crate::model::GetTransferRunRequest>);
662
663 impl GetTransferRun {
664 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
665 Self(RequestBuilder::new(stub))
666 }
667
668 pub fn with_request<V: Into<crate::model::GetTransferRunRequest>>(mut self, v: V) -> Self {
670 self.0.request = v.into();
671 self
672 }
673
674 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
676 self.0.options = v.into();
677 self
678 }
679
680 pub async fn send(self) -> Result<crate::model::TransferRun> {
682 (*self.0.stub)
683 .get_transfer_run(self.0.request, self.0.options)
684 .await
685 .map(gax::response::Response::into_body)
686 }
687
688 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
690 self.0.request.name = v.into();
691 self
692 }
693 }
694
695 #[doc(hidden)]
696 impl gax::options::internal::RequestBuilder for GetTransferRun {
697 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
698 &mut self.0.options
699 }
700 }
701
702 #[derive(Clone, Debug)]
704 pub struct DeleteTransferRun(RequestBuilder<crate::model::DeleteTransferRunRequest>);
705
706 impl DeleteTransferRun {
707 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
708 Self(RequestBuilder::new(stub))
709 }
710
711 pub fn with_request<V: Into<crate::model::DeleteTransferRunRequest>>(
713 mut self,
714 v: V,
715 ) -> Self {
716 self.0.request = v.into();
717 self
718 }
719
720 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
722 self.0.options = v.into();
723 self
724 }
725
726 pub async fn send(self) -> Result<()> {
728 (*self.0.stub)
729 .delete_transfer_run(self.0.request, self.0.options)
730 .await
731 .map(gax::response::Response::into_body)
732 }
733
734 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
736 self.0.request.name = v.into();
737 self
738 }
739 }
740
741 #[doc(hidden)]
742 impl gax::options::internal::RequestBuilder for DeleteTransferRun {
743 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
744 &mut self.0.options
745 }
746 }
747
748 #[derive(Clone, Debug)]
750 pub struct ListTransferRuns(RequestBuilder<crate::model::ListTransferRunsRequest>);
751
752 impl ListTransferRuns {
753 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
754 Self(RequestBuilder::new(stub))
755 }
756
757 pub fn with_request<V: Into<crate::model::ListTransferRunsRequest>>(
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<gax::options::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::ListTransferRunsResponse> {
774 (*self.0.stub)
775 .list_transfer_runs(self.0.request, self.0.options)
776 .await
777 .map(gax::response::Response::into_body)
778 }
779
780 pub async fn paginator(
782 self,
783 ) -> impl gax::paginator::Paginator<crate::model::ListTransferRunsResponse, gax::error::Error>
784 {
785 use std::clone::Clone;
786 let token = self.0.request.page_token.clone();
787 let execute = move |token: String| {
788 let mut builder = self.clone();
789 builder.0.request = builder.0.request.set_page_token(token);
790 builder.send()
791 };
792 gax::paginator::internal::new_paginator(token, execute)
793 }
794
795 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
797 self.0.request.parent = v.into();
798 self
799 }
800
801 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
803 self.0.request.page_token = v.into();
804 self
805 }
806
807 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
809 self.0.request.page_size = v.into();
810 self
811 }
812
813 pub fn set_run_attempt<T: Into<crate::model::list_transfer_runs_request::RunAttempt>>(
815 mut self,
816 v: T,
817 ) -> Self {
818 self.0.request.run_attempt = v.into();
819 self
820 }
821
822 pub fn set_states<T, V>(mut self, v: T) -> Self
824 where
825 T: std::iter::IntoIterator<Item = V>,
826 V: std::convert::Into<crate::model::TransferState>,
827 {
828 use std::iter::Iterator;
829 self.0.request.states = v.into_iter().map(|i| i.into()).collect();
830 self
831 }
832 }
833
834 #[doc(hidden)]
835 impl gax::options::internal::RequestBuilder for ListTransferRuns {
836 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
837 &mut self.0.options
838 }
839 }
840
841 #[derive(Clone, Debug)]
843 pub struct ListTransferLogs(RequestBuilder<crate::model::ListTransferLogsRequest>);
844
845 impl ListTransferLogs {
846 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
847 Self(RequestBuilder::new(stub))
848 }
849
850 pub fn with_request<V: Into<crate::model::ListTransferLogsRequest>>(
852 mut self,
853 v: V,
854 ) -> Self {
855 self.0.request = v.into();
856 self
857 }
858
859 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
861 self.0.options = v.into();
862 self
863 }
864
865 pub async fn send(self) -> Result<crate::model::ListTransferLogsResponse> {
867 (*self.0.stub)
868 .list_transfer_logs(self.0.request, self.0.options)
869 .await
870 .map(gax::response::Response::into_body)
871 }
872
873 pub async fn paginator(
875 self,
876 ) -> impl gax::paginator::Paginator<crate::model::ListTransferLogsResponse, gax::error::Error>
877 {
878 use std::clone::Clone;
879 let token = self.0.request.page_token.clone();
880 let execute = move |token: String| {
881 let mut builder = self.clone();
882 builder.0.request = builder.0.request.set_page_token(token);
883 builder.send()
884 };
885 gax::paginator::internal::new_paginator(token, execute)
886 }
887
888 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
890 self.0.request.parent = v.into();
891 self
892 }
893
894 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
896 self.0.request.page_token = v.into();
897 self
898 }
899
900 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
902 self.0.request.page_size = v.into();
903 self
904 }
905
906 pub fn set_message_types<T, V>(mut self, v: T) -> Self
908 where
909 T: std::iter::IntoIterator<Item = V>,
910 V: std::convert::Into<crate::model::transfer_message::MessageSeverity>,
911 {
912 use std::iter::Iterator;
913 self.0.request.message_types = v.into_iter().map(|i| i.into()).collect();
914 self
915 }
916 }
917
918 #[doc(hidden)]
919 impl gax::options::internal::RequestBuilder for ListTransferLogs {
920 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
921 &mut self.0.options
922 }
923 }
924
925 #[derive(Clone, Debug)]
927 pub struct CheckValidCreds(RequestBuilder<crate::model::CheckValidCredsRequest>);
928
929 impl CheckValidCreds {
930 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
931 Self(RequestBuilder::new(stub))
932 }
933
934 pub fn with_request<V: Into<crate::model::CheckValidCredsRequest>>(mut self, v: V) -> Self {
936 self.0.request = v.into();
937 self
938 }
939
940 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
942 self.0.options = v.into();
943 self
944 }
945
946 pub async fn send(self) -> Result<crate::model::CheckValidCredsResponse> {
948 (*self.0.stub)
949 .check_valid_creds(self.0.request, self.0.options)
950 .await
951 .map(gax::response::Response::into_body)
952 }
953
954 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
956 self.0.request.name = v.into();
957 self
958 }
959 }
960
961 #[doc(hidden)]
962 impl gax::options::internal::RequestBuilder for CheckValidCreds {
963 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
964 &mut self.0.options
965 }
966 }
967
968 #[derive(Clone, Debug)]
970 pub struct EnrollDataSources(RequestBuilder<crate::model::EnrollDataSourcesRequest>);
971
972 impl EnrollDataSources {
973 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
974 Self(RequestBuilder::new(stub))
975 }
976
977 pub fn with_request<V: Into<crate::model::EnrollDataSourcesRequest>>(
979 mut self,
980 v: V,
981 ) -> Self {
982 self.0.request = v.into();
983 self
984 }
985
986 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
988 self.0.options = v.into();
989 self
990 }
991
992 pub async fn send(self) -> Result<()> {
994 (*self.0.stub)
995 .enroll_data_sources(self.0.request, self.0.options)
996 .await
997 .map(gax::response::Response::into_body)
998 }
999
1000 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1002 self.0.request.name = v.into();
1003 self
1004 }
1005
1006 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
1008 where
1009 T: std::iter::IntoIterator<Item = V>,
1010 V: std::convert::Into<std::string::String>,
1011 {
1012 use std::iter::Iterator;
1013 self.0.request.data_source_ids = v.into_iter().map(|i| i.into()).collect();
1014 self
1015 }
1016 }
1017
1018 #[doc(hidden)]
1019 impl gax::options::internal::RequestBuilder for EnrollDataSources {
1020 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1021 &mut self.0.options
1022 }
1023 }
1024
1025 #[derive(Clone, Debug)]
1027 pub struct UnenrollDataSources(RequestBuilder<crate::model::UnenrollDataSourcesRequest>);
1028
1029 impl UnenrollDataSources {
1030 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
1031 Self(RequestBuilder::new(stub))
1032 }
1033
1034 pub fn with_request<V: Into<crate::model::UnenrollDataSourcesRequest>>(
1036 mut self,
1037 v: V,
1038 ) -> Self {
1039 self.0.request = v.into();
1040 self
1041 }
1042
1043 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1045 self.0.options = v.into();
1046 self
1047 }
1048
1049 pub async fn send(self) -> Result<()> {
1051 (*self.0.stub)
1052 .unenroll_data_sources(self.0.request, self.0.options)
1053 .await
1054 .map(gax::response::Response::into_body)
1055 }
1056
1057 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1059 self.0.request.name = v.into();
1060 self
1061 }
1062
1063 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
1065 where
1066 T: std::iter::IntoIterator<Item = V>,
1067 V: std::convert::Into<std::string::String>,
1068 {
1069 use std::iter::Iterator;
1070 self.0.request.data_source_ids = v.into_iter().map(|i| i.into()).collect();
1071 self
1072 }
1073 }
1074
1075 #[doc(hidden)]
1076 impl gax::options::internal::RequestBuilder for UnenrollDataSources {
1077 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1078 &mut self.0.options
1079 }
1080 }
1081
1082 #[derive(Clone, Debug)]
1084 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1085
1086 impl ListLocations {
1087 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
1088 Self(RequestBuilder::new(stub))
1089 }
1090
1091 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1093 mut self,
1094 v: V,
1095 ) -> Self {
1096 self.0.request = v.into();
1097 self
1098 }
1099
1100 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1102 self.0.options = v.into();
1103 self
1104 }
1105
1106 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1108 (*self.0.stub)
1109 .list_locations(self.0.request, self.0.options)
1110 .await
1111 .map(gax::response::Response::into_body)
1112 }
1113
1114 pub async fn paginator(
1116 self,
1117 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1118 {
1119 use std::clone::Clone;
1120 let token = self.0.request.page_token.clone();
1121 let execute = move |token: String| {
1122 let mut builder = self.clone();
1123 builder.0.request = builder.0.request.set_page_token(token);
1124 builder.send()
1125 };
1126 gax::paginator::internal::new_paginator(token, execute)
1127 }
1128
1129 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1131 self.0.request.name = v.into();
1132 self
1133 }
1134
1135 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1137 self.0.request.filter = v.into();
1138 self
1139 }
1140
1141 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1143 self.0.request.page_size = v.into();
1144 self
1145 }
1146
1147 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1149 self.0.request.page_token = v.into();
1150 self
1151 }
1152 }
1153
1154 #[doc(hidden)]
1155 impl gax::options::internal::RequestBuilder for ListLocations {
1156 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1157 &mut self.0.options
1158 }
1159 }
1160
1161 #[derive(Clone, Debug)]
1163 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1164
1165 impl GetLocation {
1166 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::DataTransferService>) -> Self {
1167 Self(RequestBuilder::new(stub))
1168 }
1169
1170 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1172 self.0.request = v.into();
1173 self
1174 }
1175
1176 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1178 self.0.options = v.into();
1179 self
1180 }
1181
1182 pub async fn send(self) -> Result<location::model::Location> {
1184 (*self.0.stub)
1185 .get_location(self.0.request, self.0.options)
1186 .await
1187 .map(gax::response::Response::into_body)
1188 }
1189
1190 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1192 self.0.request.name = v.into();
1193 self
1194 }
1195 }
1196
1197 #[doc(hidden)]
1198 impl gax::options::internal::RequestBuilder for GetLocation {
1199 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1200 &mut self.0.options
1201 }
1202 }
1203}