google_cloud_bigquery_datatransfer_v1/
builders.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod data_transfer_service {
18    use crate::Result;
19    use std::sync::Arc;
20
21    /// Common implementation for [crate::client::DataTransferService] request builders.
22    #[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    /// The request builder for a DataTransferService::get_data_source call.
43    #[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        /// Sets the full request, replacing any prior values.
52        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        /// Sets all the options, replacing any prior values.
58        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        /// Sends the request.
64        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        /// Sets the value of [name][crate::model::GetDataSourceRequest::name].
71        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    /// The request builder for a DataTransferService::list_data_sources call.
84    #[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        /// Sets the full request, replacing any prior values.
93        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        /// Sets all the options, replacing any prior values.
99        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        /// Sends the request.
105        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        /// Streams the responses back.
112        #[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        /// Sets the value of [parent][crate::model::ListDataSourcesRequest::parent].
127        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        /// Sets the value of [page_token][crate::model::ListDataSourcesRequest::page_token].
133        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        /// Sets the value of [page_size][crate::model::ListDataSourcesRequest::page_size].
139        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    /// The request builder for a DataTransferService::create_transfer_config call.
152    #[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        /// Sets the full request, replacing any prior values.
161        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        /// Sets all the options, replacing any prior values.
170        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        /// Sends the request.
176        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        /// Sets the value of [parent][crate::model::CreateTransferConfigRequest::parent].
183        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        /// Sets the value of [transfer_config][crate::model::CreateTransferConfigRequest::transfer_config].
189        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        /// Sets the value of [authorization_code][crate::model::CreateTransferConfigRequest::authorization_code].
198        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        /// Sets the value of [version_info][crate::model::CreateTransferConfigRequest::version_info].
204        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        /// Sets the value of [service_account_name][crate::model::CreateTransferConfigRequest::service_account_name].
210        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    /// The request builder for a DataTransferService::update_transfer_config call.
223    #[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        /// Sets the full request, replacing any prior values.
232        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        /// Sets all the options, replacing any prior values.
241        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        /// Sends the request.
247        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        /// Sets the value of [transfer_config][crate::model::UpdateTransferConfigRequest::transfer_config].
254        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        /// Sets the value of [authorization_code][crate::model::UpdateTransferConfigRequest::authorization_code].
263        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        /// Sets the value of [update_mask][crate::model::UpdateTransferConfigRequest::update_mask].
269        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        /// Sets the value of [version_info][crate::model::UpdateTransferConfigRequest::version_info].
278        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        /// Sets the value of [service_account_name][crate::model::UpdateTransferConfigRequest::service_account_name].
284        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    /// The request builder for a DataTransferService::delete_transfer_config call.
297    #[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        /// Sets the full request, replacing any prior values.
306        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        /// Sets all the options, replacing any prior values.
315        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        /// Sends the request.
321        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        /// Sets the value of [name][crate::model::DeleteTransferConfigRequest::name].
328        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    /// The request builder for a DataTransferService::get_transfer_config call.
341    #[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        /// Sets the full request, replacing any prior values.
350        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        /// Sets all the options, replacing any prior values.
359        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        /// Sends the request.
365        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        /// Sets the value of [name][crate::model::GetTransferConfigRequest::name].
372        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    /// The request builder for a DataTransferService::list_transfer_configs call.
385    #[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        /// Sets the full request, replacing any prior values.
394        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        /// Sets all the options, replacing any prior values.
403        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        /// Sends the request.
409        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        /// Streams the responses back.
416        #[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        /// Sets the value of [parent][crate::model::ListTransferConfigsRequest::parent].
431        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        /// Sets the value of [page_token][crate::model::ListTransferConfigsRequest::page_token].
437        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        /// Sets the value of [page_size][crate::model::ListTransferConfigsRequest::page_size].
443        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        /// Sets the value of [data_source_ids][crate::model::ListTransferConfigsRequest::data_source_ids].
449        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    /// The request builder for a DataTransferService::schedule_transfer_runs call.
467    #[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        /// Sets the full request, replacing any prior values.
476        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        /// Sets all the options, replacing any prior values.
485        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        /// Sends the request.
491        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        /// Sets the value of [parent][crate::model::ScheduleTransferRunsRequest::parent].
498        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        /// Sets the value of [start_time][crate::model::ScheduleTransferRunsRequest::start_time].
504        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        /// Sets the value of [end_time][crate::model::ScheduleTransferRunsRequest::end_time].
513        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    /// The request builder for a DataTransferService::start_manual_transfer_runs call.
526    #[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        /// Sets the full request, replacing any prior values.
537        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        /// Sets all the options, replacing any prior values.
546        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        /// Sends the request.
552        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        /// Sets the value of [parent][crate::model::StartManualTransferRunsRequest::parent].
559        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        /// Sets the value of `time`.
565        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    /// The request builder for a DataTransferService::get_transfer_run call.
581    #[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        /// Sets the full request, replacing any prior values.
590        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        /// Sets all the options, replacing any prior values.
596        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        /// Sends the request.
602        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        /// Sets the value of [name][crate::model::GetTransferRunRequest::name].
609        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    /// The request builder for a DataTransferService::delete_transfer_run call.
622    #[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        /// Sets the full request, replacing any prior values.
631        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        /// Sets all the options, replacing any prior values.
640        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        /// Sends the request.
646        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        /// Sets the value of [name][crate::model::DeleteTransferRunRequest::name].
653        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    /// The request builder for a DataTransferService::list_transfer_runs call.
666    #[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        /// Sets the full request, replacing any prior values.
675        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        /// Sets all the options, replacing any prior values.
684        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        /// Sends the request.
690        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        /// Streams the responses back.
697        #[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        /// Sets the value of [parent][crate::model::ListTransferRunsRequest::parent].
712        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        /// Sets the value of [page_token][crate::model::ListTransferRunsRequest::page_token].
718        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        /// Sets the value of [page_size][crate::model::ListTransferRunsRequest::page_size].
724        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        /// Sets the value of [run_attempt][crate::model::ListTransferRunsRequest::run_attempt].
730        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        /// Sets the value of [states][crate::model::ListTransferRunsRequest::states].
739        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    /// The request builder for a DataTransferService::list_transfer_logs call.
757    #[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        /// Sets the full request, replacing any prior values.
766        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        /// Sets all the options, replacing any prior values.
775        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        /// Sends the request.
781        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        /// Streams the responses back.
788        #[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        /// Sets the value of [parent][crate::model::ListTransferLogsRequest::parent].
803        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        /// Sets the value of [page_token][crate::model::ListTransferLogsRequest::page_token].
809        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        /// Sets the value of [page_size][crate::model::ListTransferLogsRequest::page_size].
815        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        /// Sets the value of [message_types][crate::model::ListTransferLogsRequest::message_types].
821        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    /// The request builder for a DataTransferService::check_valid_creds call.
839    #[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        /// Sets the full request, replacing any prior values.
848        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        /// Sets all the options, replacing any prior values.
854        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        /// Sends the request.
860        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        /// Sets the value of [name][crate::model::CheckValidCredsRequest::name].
867        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    /// The request builder for a DataTransferService::enroll_data_sources call.
880    #[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        /// Sets the full request, replacing any prior values.
889        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        /// Sets all the options, replacing any prior values.
898        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        /// Sends the request.
904        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        /// Sets the value of [name][crate::model::EnrollDataSourcesRequest::name].
911        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        /// Sets the value of [data_source_ids][crate::model::EnrollDataSourcesRequest::data_source_ids].
917        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    /// The request builder for a DataTransferService::unenroll_data_sources call.
935    #[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        /// Sets the full request, replacing any prior values.
944        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        /// Sets all the options, replacing any prior values.
953        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        /// Sends the request.
959        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        /// Sets the value of [name][crate::model::UnenrollDataSourcesRequest::name].
966        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        /// Sets the value of [data_source_ids][crate::model::UnenrollDataSourcesRequest::data_source_ids].
972        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    /// The request builder for a DataTransferService::list_locations call.
990    #[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        /// Sets the full request, replacing any prior values.
999        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        /// Sets all the options, replacing any prior values.
1008        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        /// Sends the request.
1014        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        /// Streams the responses back.
1021        #[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        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1036        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        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1042        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        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1048        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        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1054        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    /// The request builder for a DataTransferService::get_location call.
1067    #[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        /// Sets the full request, replacing any prior values.
1076        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        /// Sets all the options, replacing any prior values.
1082        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        /// Sends the request.
1088        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        /// Sets the value of [name][location::model::GetLocationRequest::name].
1095        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}