1pub mod data_transfer_service {
18 use crate::Result;
19 use std::sync::Arc;
20
21 #[derive(Clone, Debug)]
23 pub struct RequestBuilder<R: std::default::Default> {
24 stub: Arc<dyn crate::stubs::dynamic::DataTransferService>,
25 request: R,
26 options: gax::options::RequestOptions,
27 }
28
29 impl<R> RequestBuilder<R>
30 where
31 R: std::default::Default,
32 {
33 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
34 Self {
35 stub,
36 request: R::default(),
37 options: gax::options::RequestOptions::default(),
38 }
39 }
40 }
41
42 #[derive(Clone, Debug)]
44 pub struct GetDataSource(RequestBuilder<crate::model::GetDataSourceRequest>);
45
46 impl GetDataSource {
47 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
48 Self(RequestBuilder::new(stub))
49 }
50
51 pub fn with_request<V: Into<crate::model::GetDataSourceRequest>>(mut self, v: V) -> Self {
53 self.0.request = v.into();
54 self
55 }
56
57 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
59 self.0.options = v.into();
60 self
61 }
62
63 pub async fn send(self) -> Result<crate::model::DataSource> {
65 (*self.0.stub)
66 .get_data_source(self.0.request, self.0.options)
67 .await
68 }
69
70 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
72 self.0.request.name = v.into();
73 self
74 }
75 }
76
77 impl gax::options::RequestBuilder for GetDataSource {
78 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
79 &mut self.0.options
80 }
81 }
82
83 #[derive(Clone, Debug)]
85 pub struct ListDataSources(RequestBuilder<crate::model::ListDataSourcesRequest>);
86
87 impl ListDataSources {
88 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
89 Self(RequestBuilder::new(stub))
90 }
91
92 pub fn with_request<V: Into<crate::model::ListDataSourcesRequest>>(mut self, v: V) -> Self {
94 self.0.request = v.into();
95 self
96 }
97
98 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
100 self.0.options = v.into();
101 self
102 }
103
104 pub async fn send(self) -> Result<crate::model::ListDataSourcesResponse> {
106 (*self.0.stub)
107 .list_data_sources(self.0.request, self.0.options)
108 .await
109 }
110
111 #[cfg(feature = "unstable-stream")]
113 pub async fn stream(
114 self,
115 ) -> gax::paginator::Paginator<crate::model::ListDataSourcesResponse, gax::error::Error>
116 {
117 let token = gax::paginator::extract_token(&self.0.request.page_token);
118 let execute = move |token: String| {
119 let mut builder = self.clone();
120 builder.0.request = builder.0.request.set_page_token(token);
121 builder.send()
122 };
123 gax::paginator::Paginator::new(token, execute)
124 }
125
126 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
128 self.0.request.parent = v.into();
129 self
130 }
131
132 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
134 self.0.request.page_token = v.into();
135 self
136 }
137
138 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
140 self.0.request.page_size = v.into();
141 self
142 }
143 }
144
145 impl gax::options::RequestBuilder for ListDataSources {
146 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
147 &mut self.0.options
148 }
149 }
150
151 #[derive(Clone, Debug)]
153 pub struct CreateTransferConfig(RequestBuilder<crate::model::CreateTransferConfigRequest>);
154
155 impl CreateTransferConfig {
156 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
157 Self(RequestBuilder::new(stub))
158 }
159
160 pub fn with_request<V: Into<crate::model::CreateTransferConfigRequest>>(
162 mut self,
163 v: V,
164 ) -> Self {
165 self.0.request = v.into();
166 self
167 }
168
169 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
171 self.0.options = v.into();
172 self
173 }
174
175 pub async fn send(self) -> Result<crate::model::TransferConfig> {
177 (*self.0.stub)
178 .create_transfer_config(self.0.request, self.0.options)
179 .await
180 }
181
182 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
184 self.0.request.parent = v.into();
185 self
186 }
187
188 pub fn set_transfer_config<T: Into<std::option::Option<crate::model::TransferConfig>>>(
190 mut self,
191 v: T,
192 ) -> Self {
193 self.0.request.transfer_config = v.into();
194 self
195 }
196
197 pub fn set_authorization_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
199 self.0.request.authorization_code = v.into();
200 self
201 }
202
203 pub fn set_version_info<T: Into<std::string::String>>(mut self, v: T) -> Self {
205 self.0.request.version_info = v.into();
206 self
207 }
208
209 pub fn set_service_account_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
211 self.0.request.service_account_name = v.into();
212 self
213 }
214 }
215
216 impl gax::options::RequestBuilder for CreateTransferConfig {
217 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
218 &mut self.0.options
219 }
220 }
221
222 #[derive(Clone, Debug)]
224 pub struct UpdateTransferConfig(RequestBuilder<crate::model::UpdateTransferConfigRequest>);
225
226 impl UpdateTransferConfig {
227 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
228 Self(RequestBuilder::new(stub))
229 }
230
231 pub fn with_request<V: Into<crate::model::UpdateTransferConfigRequest>>(
233 mut self,
234 v: V,
235 ) -> Self {
236 self.0.request = v.into();
237 self
238 }
239
240 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
242 self.0.options = v.into();
243 self
244 }
245
246 pub async fn send(self) -> Result<crate::model::TransferConfig> {
248 (*self.0.stub)
249 .update_transfer_config(self.0.request, self.0.options)
250 .await
251 }
252
253 pub fn set_transfer_config<T: Into<std::option::Option<crate::model::TransferConfig>>>(
255 mut self,
256 v: T,
257 ) -> Self {
258 self.0.request.transfer_config = v.into();
259 self
260 }
261
262 pub fn set_authorization_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
264 self.0.request.authorization_code = v.into();
265 self
266 }
267
268 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
270 mut self,
271 v: T,
272 ) -> Self {
273 self.0.request.update_mask = v.into();
274 self
275 }
276
277 pub fn set_version_info<T: Into<std::string::String>>(mut self, v: T) -> Self {
279 self.0.request.version_info = v.into();
280 self
281 }
282
283 pub fn set_service_account_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
285 self.0.request.service_account_name = v.into();
286 self
287 }
288 }
289
290 impl gax::options::RequestBuilder for UpdateTransferConfig {
291 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
292 &mut self.0.options
293 }
294 }
295
296 #[derive(Clone, Debug)]
298 pub struct DeleteTransferConfig(RequestBuilder<crate::model::DeleteTransferConfigRequest>);
299
300 impl DeleteTransferConfig {
301 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
302 Self(RequestBuilder::new(stub))
303 }
304
305 pub fn with_request<V: Into<crate::model::DeleteTransferConfigRequest>>(
307 mut self,
308 v: V,
309 ) -> Self {
310 self.0.request = v.into();
311 self
312 }
313
314 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
316 self.0.options = v.into();
317 self
318 }
319
320 pub async fn send(self) -> Result<wkt::Empty> {
322 (*self.0.stub)
323 .delete_transfer_config(self.0.request, self.0.options)
324 .await
325 }
326
327 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
329 self.0.request.name = v.into();
330 self
331 }
332 }
333
334 impl gax::options::RequestBuilder for DeleteTransferConfig {
335 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
336 &mut self.0.options
337 }
338 }
339
340 #[derive(Clone, Debug)]
342 pub struct GetTransferConfig(RequestBuilder<crate::model::GetTransferConfigRequest>);
343
344 impl GetTransferConfig {
345 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
346 Self(RequestBuilder::new(stub))
347 }
348
349 pub fn with_request<V: Into<crate::model::GetTransferConfigRequest>>(
351 mut self,
352 v: V,
353 ) -> Self {
354 self.0.request = v.into();
355 self
356 }
357
358 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
360 self.0.options = v.into();
361 self
362 }
363
364 pub async fn send(self) -> Result<crate::model::TransferConfig> {
366 (*self.0.stub)
367 .get_transfer_config(self.0.request, self.0.options)
368 .await
369 }
370
371 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
373 self.0.request.name = v.into();
374 self
375 }
376 }
377
378 impl gax::options::RequestBuilder for GetTransferConfig {
379 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
380 &mut self.0.options
381 }
382 }
383
384 #[derive(Clone, Debug)]
386 pub struct ListTransferConfigs(RequestBuilder<crate::model::ListTransferConfigsRequest>);
387
388 impl ListTransferConfigs {
389 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
390 Self(RequestBuilder::new(stub))
391 }
392
393 pub fn with_request<V: Into<crate::model::ListTransferConfigsRequest>>(
395 mut self,
396 v: V,
397 ) -> Self {
398 self.0.request = v.into();
399 self
400 }
401
402 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
404 self.0.options = v.into();
405 self
406 }
407
408 pub async fn send(self) -> Result<crate::model::ListTransferConfigsResponse> {
410 (*self.0.stub)
411 .list_transfer_configs(self.0.request, self.0.options)
412 .await
413 }
414
415 #[cfg(feature = "unstable-stream")]
417 pub async fn stream(
418 self,
419 ) -> gax::paginator::Paginator<crate::model::ListTransferConfigsResponse, gax::error::Error>
420 {
421 let token = gax::paginator::extract_token(&self.0.request.page_token);
422 let execute = move |token: String| {
423 let mut builder = self.clone();
424 builder.0.request = builder.0.request.set_page_token(token);
425 builder.send()
426 };
427 gax::paginator::Paginator::new(token, execute)
428 }
429
430 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
432 self.0.request.parent = v.into();
433 self
434 }
435
436 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
438 self.0.request.page_token = v.into();
439 self
440 }
441
442 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
444 self.0.request.page_size = v.into();
445 self
446 }
447
448 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
450 where
451 T: std::iter::IntoIterator<Item = V>,
452 V: std::convert::Into<std::string::String>,
453 {
454 use std::iter::Iterator;
455 self.0.request.data_source_ids = v.into_iter().map(|i| i.into()).collect();
456 self
457 }
458 }
459
460 impl gax::options::RequestBuilder for ListTransferConfigs {
461 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
462 &mut self.0.options
463 }
464 }
465
466 #[derive(Clone, Debug)]
468 pub struct ScheduleTransferRuns(RequestBuilder<crate::model::ScheduleTransferRunsRequest>);
469
470 impl ScheduleTransferRuns {
471 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
472 Self(RequestBuilder::new(stub))
473 }
474
475 pub fn with_request<V: Into<crate::model::ScheduleTransferRunsRequest>>(
477 mut self,
478 v: V,
479 ) -> Self {
480 self.0.request = v.into();
481 self
482 }
483
484 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
486 self.0.options = v.into();
487 self
488 }
489
490 pub async fn send(self) -> Result<crate::model::ScheduleTransferRunsResponse> {
492 (*self.0.stub)
493 .schedule_transfer_runs(self.0.request, self.0.options)
494 .await
495 }
496
497 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
499 self.0.request.parent = v.into();
500 self
501 }
502
503 pub fn set_start_time<T: Into<std::option::Option<wkt::Timestamp>>>(
505 mut self,
506 v: T,
507 ) -> Self {
508 self.0.request.start_time = v.into();
509 self
510 }
511
512 pub fn set_end_time<T: Into<std::option::Option<wkt::Timestamp>>>(mut self, v: T) -> Self {
514 self.0.request.end_time = v.into();
515 self
516 }
517 }
518
519 impl gax::options::RequestBuilder for ScheduleTransferRuns {
520 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
521 &mut self.0.options
522 }
523 }
524
525 #[derive(Clone, Debug)]
527 pub struct StartManualTransferRuns(
528 RequestBuilder<crate::model::StartManualTransferRunsRequest>,
529 );
530
531 impl StartManualTransferRuns {
532 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
533 Self(RequestBuilder::new(stub))
534 }
535
536 pub fn with_request<V: Into<crate::model::StartManualTransferRunsRequest>>(
538 mut self,
539 v: V,
540 ) -> Self {
541 self.0.request = v.into();
542 self
543 }
544
545 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
547 self.0.options = v.into();
548 self
549 }
550
551 pub async fn send(self) -> Result<crate::model::StartManualTransferRunsResponse> {
553 (*self.0.stub)
554 .start_manual_transfer_runs(self.0.request, self.0.options)
555 .await
556 }
557
558 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
560 self.0.request.parent = v.into();
561 self
562 }
563
564 pub fn set_time<T: Into<Option<crate::model::start_manual_transfer_runs_request::Time>>>(
566 mut self,
567 v: T,
568 ) -> Self {
569 self.0.request.time = v.into();
570 self
571 }
572 }
573
574 impl gax::options::RequestBuilder for StartManualTransferRuns {
575 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
576 &mut self.0.options
577 }
578 }
579
580 #[derive(Clone, Debug)]
582 pub struct GetTransferRun(RequestBuilder<crate::model::GetTransferRunRequest>);
583
584 impl GetTransferRun {
585 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
586 Self(RequestBuilder::new(stub))
587 }
588
589 pub fn with_request<V: Into<crate::model::GetTransferRunRequest>>(mut self, v: V) -> Self {
591 self.0.request = v.into();
592 self
593 }
594
595 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
597 self.0.options = v.into();
598 self
599 }
600
601 pub async fn send(self) -> Result<crate::model::TransferRun> {
603 (*self.0.stub)
604 .get_transfer_run(self.0.request, self.0.options)
605 .await
606 }
607
608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
610 self.0.request.name = v.into();
611 self
612 }
613 }
614
615 impl gax::options::RequestBuilder for GetTransferRun {
616 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
617 &mut self.0.options
618 }
619 }
620
621 #[derive(Clone, Debug)]
623 pub struct DeleteTransferRun(RequestBuilder<crate::model::DeleteTransferRunRequest>);
624
625 impl DeleteTransferRun {
626 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
627 Self(RequestBuilder::new(stub))
628 }
629
630 pub fn with_request<V: Into<crate::model::DeleteTransferRunRequest>>(
632 mut self,
633 v: V,
634 ) -> Self {
635 self.0.request = v.into();
636 self
637 }
638
639 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
641 self.0.options = v.into();
642 self
643 }
644
645 pub async fn send(self) -> Result<wkt::Empty> {
647 (*self.0.stub)
648 .delete_transfer_run(self.0.request, self.0.options)
649 .await
650 }
651
652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
654 self.0.request.name = v.into();
655 self
656 }
657 }
658
659 impl gax::options::RequestBuilder for DeleteTransferRun {
660 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
661 &mut self.0.options
662 }
663 }
664
665 #[derive(Clone, Debug)]
667 pub struct ListTransferRuns(RequestBuilder<crate::model::ListTransferRunsRequest>);
668
669 impl ListTransferRuns {
670 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
671 Self(RequestBuilder::new(stub))
672 }
673
674 pub fn with_request<V: Into<crate::model::ListTransferRunsRequest>>(
676 mut self,
677 v: V,
678 ) -> Self {
679 self.0.request = v.into();
680 self
681 }
682
683 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
685 self.0.options = v.into();
686 self
687 }
688
689 pub async fn send(self) -> Result<crate::model::ListTransferRunsResponse> {
691 (*self.0.stub)
692 .list_transfer_runs(self.0.request, self.0.options)
693 .await
694 }
695
696 #[cfg(feature = "unstable-stream")]
698 pub async fn stream(
699 self,
700 ) -> gax::paginator::Paginator<crate::model::ListTransferRunsResponse, gax::error::Error>
701 {
702 let token = gax::paginator::extract_token(&self.0.request.page_token);
703 let execute = move |token: String| {
704 let mut builder = self.clone();
705 builder.0.request = builder.0.request.set_page_token(token);
706 builder.send()
707 };
708 gax::paginator::Paginator::new(token, execute)
709 }
710
711 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
713 self.0.request.parent = v.into();
714 self
715 }
716
717 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
719 self.0.request.page_token = v.into();
720 self
721 }
722
723 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
725 self.0.request.page_size = v.into();
726 self
727 }
728
729 pub fn set_run_attempt<T: Into<crate::model::list_transfer_runs_request::RunAttempt>>(
731 mut self,
732 v: T,
733 ) -> Self {
734 self.0.request.run_attempt = v.into();
735 self
736 }
737
738 pub fn set_states<T, V>(mut self, v: T) -> Self
740 where
741 T: std::iter::IntoIterator<Item = V>,
742 V: std::convert::Into<crate::model::TransferState>,
743 {
744 use std::iter::Iterator;
745 self.0.request.states = v.into_iter().map(|i| i.into()).collect();
746 self
747 }
748 }
749
750 impl gax::options::RequestBuilder for ListTransferRuns {
751 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
752 &mut self.0.options
753 }
754 }
755
756 #[derive(Clone, Debug)]
758 pub struct ListTransferLogs(RequestBuilder<crate::model::ListTransferLogsRequest>);
759
760 impl ListTransferLogs {
761 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
762 Self(RequestBuilder::new(stub))
763 }
764
765 pub fn with_request<V: Into<crate::model::ListTransferLogsRequest>>(
767 mut self,
768 v: V,
769 ) -> Self {
770 self.0.request = v.into();
771 self
772 }
773
774 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
776 self.0.options = v.into();
777 self
778 }
779
780 pub async fn send(self) -> Result<crate::model::ListTransferLogsResponse> {
782 (*self.0.stub)
783 .list_transfer_logs(self.0.request, self.0.options)
784 .await
785 }
786
787 #[cfg(feature = "unstable-stream")]
789 pub async fn stream(
790 self,
791 ) -> gax::paginator::Paginator<crate::model::ListTransferLogsResponse, gax::error::Error>
792 {
793 let token = gax::paginator::extract_token(&self.0.request.page_token);
794 let execute = move |token: String| {
795 let mut builder = self.clone();
796 builder.0.request = builder.0.request.set_page_token(token);
797 builder.send()
798 };
799 gax::paginator::Paginator::new(token, execute)
800 }
801
802 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
804 self.0.request.parent = v.into();
805 self
806 }
807
808 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
810 self.0.request.page_token = v.into();
811 self
812 }
813
814 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
816 self.0.request.page_size = v.into();
817 self
818 }
819
820 pub fn set_message_types<T, V>(mut self, v: T) -> Self
822 where
823 T: std::iter::IntoIterator<Item = V>,
824 V: std::convert::Into<crate::model::transfer_message::MessageSeverity>,
825 {
826 use std::iter::Iterator;
827 self.0.request.message_types = v.into_iter().map(|i| i.into()).collect();
828 self
829 }
830 }
831
832 impl gax::options::RequestBuilder for ListTransferLogs {
833 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
834 &mut self.0.options
835 }
836 }
837
838 #[derive(Clone, Debug)]
840 pub struct CheckValidCreds(RequestBuilder<crate::model::CheckValidCredsRequest>);
841
842 impl CheckValidCreds {
843 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
844 Self(RequestBuilder::new(stub))
845 }
846
847 pub fn with_request<V: Into<crate::model::CheckValidCredsRequest>>(mut self, v: V) -> Self {
849 self.0.request = v.into();
850 self
851 }
852
853 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
855 self.0.options = v.into();
856 self
857 }
858
859 pub async fn send(self) -> Result<crate::model::CheckValidCredsResponse> {
861 (*self.0.stub)
862 .check_valid_creds(self.0.request, self.0.options)
863 .await
864 }
865
866 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
868 self.0.request.name = v.into();
869 self
870 }
871 }
872
873 impl gax::options::RequestBuilder for CheckValidCreds {
874 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
875 &mut self.0.options
876 }
877 }
878
879 #[derive(Clone, Debug)]
881 pub struct EnrollDataSources(RequestBuilder<crate::model::EnrollDataSourcesRequest>);
882
883 impl EnrollDataSources {
884 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
885 Self(RequestBuilder::new(stub))
886 }
887
888 pub fn with_request<V: Into<crate::model::EnrollDataSourcesRequest>>(
890 mut self,
891 v: V,
892 ) -> Self {
893 self.0.request = v.into();
894 self
895 }
896
897 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
899 self.0.options = v.into();
900 self
901 }
902
903 pub async fn send(self) -> Result<wkt::Empty> {
905 (*self.0.stub)
906 .enroll_data_sources(self.0.request, self.0.options)
907 .await
908 }
909
910 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
912 self.0.request.name = v.into();
913 self
914 }
915
916 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
918 where
919 T: std::iter::IntoIterator<Item = V>,
920 V: std::convert::Into<std::string::String>,
921 {
922 use std::iter::Iterator;
923 self.0.request.data_source_ids = v.into_iter().map(|i| i.into()).collect();
924 self
925 }
926 }
927
928 impl gax::options::RequestBuilder for EnrollDataSources {
929 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
930 &mut self.0.options
931 }
932 }
933
934 #[derive(Clone, Debug)]
936 pub struct UnenrollDataSources(RequestBuilder<crate::model::UnenrollDataSourcesRequest>);
937
938 impl UnenrollDataSources {
939 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
940 Self(RequestBuilder::new(stub))
941 }
942
943 pub fn with_request<V: Into<crate::model::UnenrollDataSourcesRequest>>(
945 mut self,
946 v: V,
947 ) -> Self {
948 self.0.request = v.into();
949 self
950 }
951
952 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
954 self.0.options = v.into();
955 self
956 }
957
958 pub async fn send(self) -> Result<wkt::Empty> {
960 (*self.0.stub)
961 .unenroll_data_sources(self.0.request, self.0.options)
962 .await
963 }
964
965 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
967 self.0.request.name = v.into();
968 self
969 }
970
971 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
973 where
974 T: std::iter::IntoIterator<Item = V>,
975 V: std::convert::Into<std::string::String>,
976 {
977 use std::iter::Iterator;
978 self.0.request.data_source_ids = v.into_iter().map(|i| i.into()).collect();
979 self
980 }
981 }
982
983 impl gax::options::RequestBuilder for UnenrollDataSources {
984 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
985 &mut self.0.options
986 }
987 }
988
989 #[derive(Clone, Debug)]
991 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
992
993 impl ListLocations {
994 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
995 Self(RequestBuilder::new(stub))
996 }
997
998 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1000 mut self,
1001 v: V,
1002 ) -> Self {
1003 self.0.request = v.into();
1004 self
1005 }
1006
1007 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1009 self.0.options = v.into();
1010 self
1011 }
1012
1013 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1015 (*self.0.stub)
1016 .list_locations(self.0.request, self.0.options)
1017 .await
1018 }
1019
1020 #[cfg(feature = "unstable-stream")]
1022 pub async fn stream(
1023 self,
1024 ) -> gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1025 {
1026 let token = gax::paginator::extract_token(&self.0.request.page_token);
1027 let execute = move |token: String| {
1028 let mut builder = self.clone();
1029 builder.0.request = builder.0.request.set_page_token(token);
1030 builder.send()
1031 };
1032 gax::paginator::Paginator::new(token, execute)
1033 }
1034
1035 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1037 self.0.request.name = v.into();
1038 self
1039 }
1040
1041 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1043 self.0.request.filter = v.into();
1044 self
1045 }
1046
1047 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1049 self.0.request.page_size = v.into();
1050 self
1051 }
1052
1053 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1055 self.0.request.page_token = v.into();
1056 self
1057 }
1058 }
1059
1060 impl gax::options::RequestBuilder for ListLocations {
1061 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1062 &mut self.0.options
1063 }
1064 }
1065
1066 #[derive(Clone, Debug)]
1068 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1069
1070 impl GetLocation {
1071 pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DataTransferService>) -> Self {
1072 Self(RequestBuilder::new(stub))
1073 }
1074
1075 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1077 self.0.request = v.into();
1078 self
1079 }
1080
1081 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1083 self.0.options = v.into();
1084 self
1085 }
1086
1087 pub async fn send(self) -> Result<location::model::Location> {
1089 (*self.0.stub)
1090 .get_location(self.0.request, self.0.options)
1091 .await
1092 }
1093
1094 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1096 self.0.request.name = v.into();
1097 self
1098 }
1099 }
1100
1101 impl gax::options::RequestBuilder for GetLocation {
1102 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1103 &mut self.0.options
1104 }
1105 }
1106}