google_cloud_clouddms_v1/
builder.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_migration_service {
18    use crate::Result;
19
20    /// A builder for [DataMigrationService][crate::client::DataMigrationService].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_clouddms_v1::*;
25    /// # use builder::data_migration_service::ClientBuilder;
26    /// # use client::DataMigrationService;
27    /// let builder : ClientBuilder = DataMigrationService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://datamigration.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::DataMigrationService;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = DataMigrationService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::DataMigrationService] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [DataMigrationService::list_migration_jobs][crate::client::DataMigrationService::list_migration_jobs] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_clouddms_v1::builder;
79    /// use builder::data_migration_service::ListMigrationJobs;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListMigrationJobs {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListMigrationJobs(RequestBuilder<crate::model::ListMigrationJobsRequest>);
97
98    impl ListMigrationJobs {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListMigrationJobsRequest>>(
107            mut self,
108            v: V,
109        ) -> Self {
110            self.0.request = v.into();
111            self
112        }
113
114        /// Sets all the options, replacing any prior values.
115        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116            self.0.options = v.into();
117            self
118        }
119
120        /// Sends the request.
121        pub async fn send(self) -> Result<crate::model::ListMigrationJobsResponse> {
122            (*self.0.stub)
123                .list_migration_jobs(self.0.request, self.0.options)
124                .await
125                .map(gax::response::Response::into_body)
126        }
127
128        /// Streams each page in the collection.
129        pub fn by_page(
130            self,
131        ) -> impl gax::paginator::Paginator<crate::model::ListMigrationJobsResponse, gax::error::Error>
132        {
133            use std::clone::Clone;
134            let token = self.0.request.page_token.clone();
135            let execute = move |token: String| {
136                let mut builder = self.clone();
137                builder.0.request = builder.0.request.set_page_token(token);
138                builder.send()
139            };
140            gax::paginator::internal::new_paginator(token, execute)
141        }
142
143        /// Streams each item in the collection.
144        pub fn by_item(
145            self,
146        ) -> impl gax::paginator::ItemPaginator<crate::model::ListMigrationJobsResponse, gax::error::Error>
147        {
148            use gax::paginator::Paginator;
149            self.by_page().items()
150        }
151
152        /// Sets the value of [parent][crate::model::ListMigrationJobsRequest::parent].
153        ///
154        /// This is a **required** field for requests.
155        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
156            self.0.request.parent = v.into();
157            self
158        }
159
160        /// Sets the value of [page_size][crate::model::ListMigrationJobsRequest::page_size].
161        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
162            self.0.request.page_size = v.into();
163            self
164        }
165
166        /// Sets the value of [page_token][crate::model::ListMigrationJobsRequest::page_token].
167        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
168            self.0.request.page_token = v.into();
169            self
170        }
171
172        /// Sets the value of [filter][crate::model::ListMigrationJobsRequest::filter].
173        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
174            self.0.request.filter = v.into();
175            self
176        }
177
178        /// Sets the value of [order_by][crate::model::ListMigrationJobsRequest::order_by].
179        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
180            self.0.request.order_by = v.into();
181            self
182        }
183    }
184
185    #[doc(hidden)]
186    impl gax::options::internal::RequestBuilder for ListMigrationJobs {
187        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
188            &mut self.0.options
189        }
190    }
191
192    /// The request builder for [DataMigrationService::get_migration_job][crate::client::DataMigrationService::get_migration_job] calls.
193    ///
194    /// # Example
195    /// ```no_run
196    /// # use google_cloud_clouddms_v1::builder;
197    /// use builder::data_migration_service::GetMigrationJob;
198    /// # tokio_test::block_on(async {
199    ///
200    /// let builder = prepare_request_builder();
201    /// let response = builder.send().await?;
202    /// # gax::Result::<()>::Ok(()) });
203    ///
204    /// fn prepare_request_builder() -> GetMigrationJob {
205    ///   # panic!();
206    ///   // ... details omitted ...
207    /// }
208    /// ```
209    #[derive(Clone, Debug)]
210    pub struct GetMigrationJob(RequestBuilder<crate::model::GetMigrationJobRequest>);
211
212    impl GetMigrationJob {
213        pub(crate) fn new(
214            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
215        ) -> Self {
216            Self(RequestBuilder::new(stub))
217        }
218
219        /// Sets the full request, replacing any prior values.
220        pub fn with_request<V: Into<crate::model::GetMigrationJobRequest>>(mut self, v: V) -> Self {
221            self.0.request = v.into();
222            self
223        }
224
225        /// Sets all the options, replacing any prior values.
226        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
227            self.0.options = v.into();
228            self
229        }
230
231        /// Sends the request.
232        pub async fn send(self) -> Result<crate::model::MigrationJob> {
233            (*self.0.stub)
234                .get_migration_job(self.0.request, self.0.options)
235                .await
236                .map(gax::response::Response::into_body)
237        }
238
239        /// Sets the value of [name][crate::model::GetMigrationJobRequest::name].
240        ///
241        /// This is a **required** field for requests.
242        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
243            self.0.request.name = v.into();
244            self
245        }
246    }
247
248    #[doc(hidden)]
249    impl gax::options::internal::RequestBuilder for GetMigrationJob {
250        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
251            &mut self.0.options
252        }
253    }
254
255    /// The request builder for [DataMigrationService::create_migration_job][crate::client::DataMigrationService::create_migration_job] calls.
256    ///
257    /// # Example
258    /// ```no_run
259    /// # use google_cloud_clouddms_v1::builder;
260    /// use builder::data_migration_service::CreateMigrationJob;
261    /// # tokio_test::block_on(async {
262    /// use lro::Poller;
263    ///
264    /// let builder = prepare_request_builder();
265    /// let response = builder.poller().until_done().await?;
266    /// # gax::Result::<()>::Ok(()) });
267    ///
268    /// fn prepare_request_builder() -> CreateMigrationJob {
269    ///   # panic!();
270    ///   // ... details omitted ...
271    /// }
272    /// ```
273    #[derive(Clone, Debug)]
274    pub struct CreateMigrationJob(RequestBuilder<crate::model::CreateMigrationJobRequest>);
275
276    impl CreateMigrationJob {
277        pub(crate) fn new(
278            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
279        ) -> Self {
280            Self(RequestBuilder::new(stub))
281        }
282
283        /// Sets the full request, replacing any prior values.
284        pub fn with_request<V: Into<crate::model::CreateMigrationJobRequest>>(
285            mut self,
286            v: V,
287        ) -> Self {
288            self.0.request = v.into();
289            self
290        }
291
292        /// Sets all the options, replacing any prior values.
293        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
294            self.0.options = v.into();
295            self
296        }
297
298        /// Sends the request.
299        ///
300        /// # Long running operations
301        ///
302        /// This starts, but does not poll, a longrunning operation. More information
303        /// on [create_migration_job][crate::client::DataMigrationService::create_migration_job].
304        pub async fn send(self) -> Result<longrunning::model::Operation> {
305            (*self.0.stub)
306                .create_migration_job(self.0.request, self.0.options)
307                .await
308                .map(gax::response::Response::into_body)
309        }
310
311        /// Creates a [Poller][lro::Poller] to work with `create_migration_job`.
312        pub fn poller(
313            self,
314        ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
315            type Operation = lro::internal::Operation<
316                crate::model::MigrationJob,
317                crate::model::OperationMetadata,
318            >;
319            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
320            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
321
322            let stub = self.0.stub.clone();
323            let mut options = self.0.options.clone();
324            options.set_retry_policy(gax::retry_policy::NeverRetry);
325            let query = move |name| {
326                let stub = stub.clone();
327                let options = options.clone();
328                async {
329                    let op = GetOperation::new(stub)
330                        .set_name(name)
331                        .with_options(options)
332                        .send()
333                        .await?;
334                    Ok(Operation::new(op))
335                }
336            };
337
338            let start = move || async {
339                let op = self.send().await?;
340                Ok(Operation::new(op))
341            };
342
343            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
344        }
345
346        /// Sets the value of [parent][crate::model::CreateMigrationJobRequest::parent].
347        ///
348        /// This is a **required** field for requests.
349        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
350            self.0.request.parent = v.into();
351            self
352        }
353
354        /// Sets the value of [migration_job_id][crate::model::CreateMigrationJobRequest::migration_job_id].
355        ///
356        /// This is a **required** field for requests.
357        pub fn set_migration_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
358            self.0.request.migration_job_id = v.into();
359            self
360        }
361
362        /// Sets the value of [migration_job][crate::model::CreateMigrationJobRequest::migration_job].
363        ///
364        /// This is a **required** field for requests.
365        pub fn set_migration_job<T>(mut self, v: T) -> Self
366        where
367            T: std::convert::Into<crate::model::MigrationJob>,
368        {
369            self.0.request.migration_job = std::option::Option::Some(v.into());
370            self
371        }
372
373        /// Sets or clears the value of [migration_job][crate::model::CreateMigrationJobRequest::migration_job].
374        ///
375        /// This is a **required** field for requests.
376        pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
377        where
378            T: std::convert::Into<crate::model::MigrationJob>,
379        {
380            self.0.request.migration_job = v.map(|x| x.into());
381            self
382        }
383
384        /// Sets the value of [request_id][crate::model::CreateMigrationJobRequest::request_id].
385        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
386            self.0.request.request_id = v.into();
387            self
388        }
389    }
390
391    #[doc(hidden)]
392    impl gax::options::internal::RequestBuilder for CreateMigrationJob {
393        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
394            &mut self.0.options
395        }
396    }
397
398    /// The request builder for [DataMigrationService::update_migration_job][crate::client::DataMigrationService::update_migration_job] calls.
399    ///
400    /// # Example
401    /// ```no_run
402    /// # use google_cloud_clouddms_v1::builder;
403    /// use builder::data_migration_service::UpdateMigrationJob;
404    /// # tokio_test::block_on(async {
405    /// use lro::Poller;
406    ///
407    /// let builder = prepare_request_builder();
408    /// let response = builder.poller().until_done().await?;
409    /// # gax::Result::<()>::Ok(()) });
410    ///
411    /// fn prepare_request_builder() -> UpdateMigrationJob {
412    ///   # panic!();
413    ///   // ... details omitted ...
414    /// }
415    /// ```
416    #[derive(Clone, Debug)]
417    pub struct UpdateMigrationJob(RequestBuilder<crate::model::UpdateMigrationJobRequest>);
418
419    impl UpdateMigrationJob {
420        pub(crate) fn new(
421            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
422        ) -> Self {
423            Self(RequestBuilder::new(stub))
424        }
425
426        /// Sets the full request, replacing any prior values.
427        pub fn with_request<V: Into<crate::model::UpdateMigrationJobRequest>>(
428            mut self,
429            v: V,
430        ) -> Self {
431            self.0.request = v.into();
432            self
433        }
434
435        /// Sets all the options, replacing any prior values.
436        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
437            self.0.options = v.into();
438            self
439        }
440
441        /// Sends the request.
442        ///
443        /// # Long running operations
444        ///
445        /// This starts, but does not poll, a longrunning operation. More information
446        /// on [update_migration_job][crate::client::DataMigrationService::update_migration_job].
447        pub async fn send(self) -> Result<longrunning::model::Operation> {
448            (*self.0.stub)
449                .update_migration_job(self.0.request, self.0.options)
450                .await
451                .map(gax::response::Response::into_body)
452        }
453
454        /// Creates a [Poller][lro::Poller] to work with `update_migration_job`.
455        pub fn poller(
456            self,
457        ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
458            type Operation = lro::internal::Operation<
459                crate::model::MigrationJob,
460                crate::model::OperationMetadata,
461            >;
462            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
463            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
464
465            let stub = self.0.stub.clone();
466            let mut options = self.0.options.clone();
467            options.set_retry_policy(gax::retry_policy::NeverRetry);
468            let query = move |name| {
469                let stub = stub.clone();
470                let options = options.clone();
471                async {
472                    let op = GetOperation::new(stub)
473                        .set_name(name)
474                        .with_options(options)
475                        .send()
476                        .await?;
477                    Ok(Operation::new(op))
478                }
479            };
480
481            let start = move || async {
482                let op = self.send().await?;
483                Ok(Operation::new(op))
484            };
485
486            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
487        }
488
489        /// Sets the value of [update_mask][crate::model::UpdateMigrationJobRequest::update_mask].
490        ///
491        /// This is a **required** field for requests.
492        pub fn set_update_mask<T>(mut self, v: T) -> Self
493        where
494            T: std::convert::Into<wkt::FieldMask>,
495        {
496            self.0.request.update_mask = std::option::Option::Some(v.into());
497            self
498        }
499
500        /// Sets or clears the value of [update_mask][crate::model::UpdateMigrationJobRequest::update_mask].
501        ///
502        /// This is a **required** field for requests.
503        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
504        where
505            T: std::convert::Into<wkt::FieldMask>,
506        {
507            self.0.request.update_mask = v.map(|x| x.into());
508            self
509        }
510
511        /// Sets the value of [migration_job][crate::model::UpdateMigrationJobRequest::migration_job].
512        ///
513        /// This is a **required** field for requests.
514        pub fn set_migration_job<T>(mut self, v: T) -> Self
515        where
516            T: std::convert::Into<crate::model::MigrationJob>,
517        {
518            self.0.request.migration_job = std::option::Option::Some(v.into());
519            self
520        }
521
522        /// Sets or clears the value of [migration_job][crate::model::UpdateMigrationJobRequest::migration_job].
523        ///
524        /// This is a **required** field for requests.
525        pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
526        where
527            T: std::convert::Into<crate::model::MigrationJob>,
528        {
529            self.0.request.migration_job = v.map(|x| x.into());
530            self
531        }
532
533        /// Sets the value of [request_id][crate::model::UpdateMigrationJobRequest::request_id].
534        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
535            self.0.request.request_id = v.into();
536            self
537        }
538    }
539
540    #[doc(hidden)]
541    impl gax::options::internal::RequestBuilder for UpdateMigrationJob {
542        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
543            &mut self.0.options
544        }
545    }
546
547    /// The request builder for [DataMigrationService::delete_migration_job][crate::client::DataMigrationService::delete_migration_job] calls.
548    ///
549    /// # Example
550    /// ```no_run
551    /// # use google_cloud_clouddms_v1::builder;
552    /// use builder::data_migration_service::DeleteMigrationJob;
553    /// # tokio_test::block_on(async {
554    /// use lro::Poller;
555    ///
556    /// let builder = prepare_request_builder();
557    /// let response = builder.poller().until_done().await?;
558    /// # gax::Result::<()>::Ok(()) });
559    ///
560    /// fn prepare_request_builder() -> DeleteMigrationJob {
561    ///   # panic!();
562    ///   // ... details omitted ...
563    /// }
564    /// ```
565    #[derive(Clone, Debug)]
566    pub struct DeleteMigrationJob(RequestBuilder<crate::model::DeleteMigrationJobRequest>);
567
568    impl DeleteMigrationJob {
569        pub(crate) fn new(
570            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
571        ) -> Self {
572            Self(RequestBuilder::new(stub))
573        }
574
575        /// Sets the full request, replacing any prior values.
576        pub fn with_request<V: Into<crate::model::DeleteMigrationJobRequest>>(
577            mut self,
578            v: V,
579        ) -> Self {
580            self.0.request = v.into();
581            self
582        }
583
584        /// Sets all the options, replacing any prior values.
585        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
586            self.0.options = v.into();
587            self
588        }
589
590        /// Sends the request.
591        ///
592        /// # Long running operations
593        ///
594        /// This starts, but does not poll, a longrunning operation. More information
595        /// on [delete_migration_job][crate::client::DataMigrationService::delete_migration_job].
596        pub async fn send(self) -> Result<longrunning::model::Operation> {
597            (*self.0.stub)
598                .delete_migration_job(self.0.request, self.0.options)
599                .await
600                .map(gax::response::Response::into_body)
601        }
602
603        /// Creates a [Poller][lro::Poller] to work with `delete_migration_job`.
604        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
605            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
606            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
607            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
608
609            let stub = self.0.stub.clone();
610            let mut options = self.0.options.clone();
611            options.set_retry_policy(gax::retry_policy::NeverRetry);
612            let query = move |name| {
613                let stub = stub.clone();
614                let options = options.clone();
615                async {
616                    let op = GetOperation::new(stub)
617                        .set_name(name)
618                        .with_options(options)
619                        .send()
620                        .await?;
621                    Ok(Operation::new(op))
622                }
623            };
624
625            let start = move || async {
626                let op = self.send().await?;
627                Ok(Operation::new(op))
628            };
629
630            lro::internal::new_unit_response_poller(
631                polling_error_policy,
632                polling_backoff_policy,
633                start,
634                query,
635            )
636        }
637
638        /// Sets the value of [name][crate::model::DeleteMigrationJobRequest::name].
639        ///
640        /// This is a **required** field for requests.
641        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
642            self.0.request.name = v.into();
643            self
644        }
645
646        /// Sets the value of [request_id][crate::model::DeleteMigrationJobRequest::request_id].
647        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
648            self.0.request.request_id = v.into();
649            self
650        }
651
652        /// Sets the value of [force][crate::model::DeleteMigrationJobRequest::force].
653        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
654            self.0.request.force = v.into();
655            self
656        }
657    }
658
659    #[doc(hidden)]
660    impl gax::options::internal::RequestBuilder for DeleteMigrationJob {
661        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
662            &mut self.0.options
663        }
664    }
665
666    /// The request builder for [DataMigrationService::start_migration_job][crate::client::DataMigrationService::start_migration_job] calls.
667    ///
668    /// # Example
669    /// ```no_run
670    /// # use google_cloud_clouddms_v1::builder;
671    /// use builder::data_migration_service::StartMigrationJob;
672    /// # tokio_test::block_on(async {
673    /// use lro::Poller;
674    ///
675    /// let builder = prepare_request_builder();
676    /// let response = builder.poller().until_done().await?;
677    /// # gax::Result::<()>::Ok(()) });
678    ///
679    /// fn prepare_request_builder() -> StartMigrationJob {
680    ///   # panic!();
681    ///   // ... details omitted ...
682    /// }
683    /// ```
684    #[derive(Clone, Debug)]
685    pub struct StartMigrationJob(RequestBuilder<crate::model::StartMigrationJobRequest>);
686
687    impl StartMigrationJob {
688        pub(crate) fn new(
689            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
690        ) -> Self {
691            Self(RequestBuilder::new(stub))
692        }
693
694        /// Sets the full request, replacing any prior values.
695        pub fn with_request<V: Into<crate::model::StartMigrationJobRequest>>(
696            mut self,
697            v: V,
698        ) -> Self {
699            self.0.request = v.into();
700            self
701        }
702
703        /// Sets all the options, replacing any prior values.
704        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
705            self.0.options = v.into();
706            self
707        }
708
709        /// Sends the request.
710        ///
711        /// # Long running operations
712        ///
713        /// This starts, but does not poll, a longrunning operation. More information
714        /// on [start_migration_job][crate::client::DataMigrationService::start_migration_job].
715        pub async fn send(self) -> Result<longrunning::model::Operation> {
716            (*self.0.stub)
717                .start_migration_job(self.0.request, self.0.options)
718                .await
719                .map(gax::response::Response::into_body)
720        }
721
722        /// Creates a [Poller][lro::Poller] to work with `start_migration_job`.
723        pub fn poller(
724            self,
725        ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
726            type Operation = lro::internal::Operation<
727                crate::model::MigrationJob,
728                crate::model::OperationMetadata,
729            >;
730            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
731            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
732
733            let stub = self.0.stub.clone();
734            let mut options = self.0.options.clone();
735            options.set_retry_policy(gax::retry_policy::NeverRetry);
736            let query = move |name| {
737                let stub = stub.clone();
738                let options = options.clone();
739                async {
740                    let op = GetOperation::new(stub)
741                        .set_name(name)
742                        .with_options(options)
743                        .send()
744                        .await?;
745                    Ok(Operation::new(op))
746                }
747            };
748
749            let start = move || async {
750                let op = self.send().await?;
751                Ok(Operation::new(op))
752            };
753
754            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
755        }
756
757        /// Sets the value of [name][crate::model::StartMigrationJobRequest::name].
758        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
759            self.0.request.name = v.into();
760            self
761        }
762
763        /// Sets the value of [skip_validation][crate::model::StartMigrationJobRequest::skip_validation].
764        pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
765            self.0.request.skip_validation = v.into();
766            self
767        }
768    }
769
770    #[doc(hidden)]
771    impl gax::options::internal::RequestBuilder for StartMigrationJob {
772        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
773            &mut self.0.options
774        }
775    }
776
777    /// The request builder for [DataMigrationService::stop_migration_job][crate::client::DataMigrationService::stop_migration_job] calls.
778    ///
779    /// # Example
780    /// ```no_run
781    /// # use google_cloud_clouddms_v1::builder;
782    /// use builder::data_migration_service::StopMigrationJob;
783    /// # tokio_test::block_on(async {
784    /// use lro::Poller;
785    ///
786    /// let builder = prepare_request_builder();
787    /// let response = builder.poller().until_done().await?;
788    /// # gax::Result::<()>::Ok(()) });
789    ///
790    /// fn prepare_request_builder() -> StopMigrationJob {
791    ///   # panic!();
792    ///   // ... details omitted ...
793    /// }
794    /// ```
795    #[derive(Clone, Debug)]
796    pub struct StopMigrationJob(RequestBuilder<crate::model::StopMigrationJobRequest>);
797
798    impl StopMigrationJob {
799        pub(crate) fn new(
800            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
801        ) -> Self {
802            Self(RequestBuilder::new(stub))
803        }
804
805        /// Sets the full request, replacing any prior values.
806        pub fn with_request<V: Into<crate::model::StopMigrationJobRequest>>(
807            mut self,
808            v: V,
809        ) -> Self {
810            self.0.request = v.into();
811            self
812        }
813
814        /// Sets all the options, replacing any prior values.
815        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
816            self.0.options = v.into();
817            self
818        }
819
820        /// Sends the request.
821        ///
822        /// # Long running operations
823        ///
824        /// This starts, but does not poll, a longrunning operation. More information
825        /// on [stop_migration_job][crate::client::DataMigrationService::stop_migration_job].
826        pub async fn send(self) -> Result<longrunning::model::Operation> {
827            (*self.0.stub)
828                .stop_migration_job(self.0.request, self.0.options)
829                .await
830                .map(gax::response::Response::into_body)
831        }
832
833        /// Creates a [Poller][lro::Poller] to work with `stop_migration_job`.
834        pub fn poller(
835            self,
836        ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
837            type Operation = lro::internal::Operation<
838                crate::model::MigrationJob,
839                crate::model::OperationMetadata,
840            >;
841            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
842            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
843
844            let stub = self.0.stub.clone();
845            let mut options = self.0.options.clone();
846            options.set_retry_policy(gax::retry_policy::NeverRetry);
847            let query = move |name| {
848                let stub = stub.clone();
849                let options = options.clone();
850                async {
851                    let op = GetOperation::new(stub)
852                        .set_name(name)
853                        .with_options(options)
854                        .send()
855                        .await?;
856                    Ok(Operation::new(op))
857                }
858            };
859
860            let start = move || async {
861                let op = self.send().await?;
862                Ok(Operation::new(op))
863            };
864
865            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
866        }
867
868        /// Sets the value of [name][crate::model::StopMigrationJobRequest::name].
869        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
870            self.0.request.name = v.into();
871            self
872        }
873    }
874
875    #[doc(hidden)]
876    impl gax::options::internal::RequestBuilder for StopMigrationJob {
877        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
878            &mut self.0.options
879        }
880    }
881
882    /// The request builder for [DataMigrationService::resume_migration_job][crate::client::DataMigrationService::resume_migration_job] calls.
883    ///
884    /// # Example
885    /// ```no_run
886    /// # use google_cloud_clouddms_v1::builder;
887    /// use builder::data_migration_service::ResumeMigrationJob;
888    /// # tokio_test::block_on(async {
889    /// use lro::Poller;
890    ///
891    /// let builder = prepare_request_builder();
892    /// let response = builder.poller().until_done().await?;
893    /// # gax::Result::<()>::Ok(()) });
894    ///
895    /// fn prepare_request_builder() -> ResumeMigrationJob {
896    ///   # panic!();
897    ///   // ... details omitted ...
898    /// }
899    /// ```
900    #[derive(Clone, Debug)]
901    pub struct ResumeMigrationJob(RequestBuilder<crate::model::ResumeMigrationJobRequest>);
902
903    impl ResumeMigrationJob {
904        pub(crate) fn new(
905            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
906        ) -> Self {
907            Self(RequestBuilder::new(stub))
908        }
909
910        /// Sets the full request, replacing any prior values.
911        pub fn with_request<V: Into<crate::model::ResumeMigrationJobRequest>>(
912            mut self,
913            v: V,
914        ) -> Self {
915            self.0.request = v.into();
916            self
917        }
918
919        /// Sets all the options, replacing any prior values.
920        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
921            self.0.options = v.into();
922            self
923        }
924
925        /// Sends the request.
926        ///
927        /// # Long running operations
928        ///
929        /// This starts, but does not poll, a longrunning operation. More information
930        /// on [resume_migration_job][crate::client::DataMigrationService::resume_migration_job].
931        pub async fn send(self) -> Result<longrunning::model::Operation> {
932            (*self.0.stub)
933                .resume_migration_job(self.0.request, self.0.options)
934                .await
935                .map(gax::response::Response::into_body)
936        }
937
938        /// Creates a [Poller][lro::Poller] to work with `resume_migration_job`.
939        pub fn poller(
940            self,
941        ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
942            type Operation = lro::internal::Operation<
943                crate::model::MigrationJob,
944                crate::model::OperationMetadata,
945            >;
946            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
947            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
948
949            let stub = self.0.stub.clone();
950            let mut options = self.0.options.clone();
951            options.set_retry_policy(gax::retry_policy::NeverRetry);
952            let query = move |name| {
953                let stub = stub.clone();
954                let options = options.clone();
955                async {
956                    let op = GetOperation::new(stub)
957                        .set_name(name)
958                        .with_options(options)
959                        .send()
960                        .await?;
961                    Ok(Operation::new(op))
962                }
963            };
964
965            let start = move || async {
966                let op = self.send().await?;
967                Ok(Operation::new(op))
968            };
969
970            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
971        }
972
973        /// Sets the value of [name][crate::model::ResumeMigrationJobRequest::name].
974        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
975            self.0.request.name = v.into();
976            self
977        }
978    }
979
980    #[doc(hidden)]
981    impl gax::options::internal::RequestBuilder for ResumeMigrationJob {
982        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
983            &mut self.0.options
984        }
985    }
986
987    /// The request builder for [DataMigrationService::promote_migration_job][crate::client::DataMigrationService::promote_migration_job] calls.
988    ///
989    /// # Example
990    /// ```no_run
991    /// # use google_cloud_clouddms_v1::builder;
992    /// use builder::data_migration_service::PromoteMigrationJob;
993    /// # tokio_test::block_on(async {
994    /// use lro::Poller;
995    ///
996    /// let builder = prepare_request_builder();
997    /// let response = builder.poller().until_done().await?;
998    /// # gax::Result::<()>::Ok(()) });
999    ///
1000    /// fn prepare_request_builder() -> PromoteMigrationJob {
1001    ///   # panic!();
1002    ///   // ... details omitted ...
1003    /// }
1004    /// ```
1005    #[derive(Clone, Debug)]
1006    pub struct PromoteMigrationJob(RequestBuilder<crate::model::PromoteMigrationJobRequest>);
1007
1008    impl PromoteMigrationJob {
1009        pub(crate) fn new(
1010            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1011        ) -> Self {
1012            Self(RequestBuilder::new(stub))
1013        }
1014
1015        /// Sets the full request, replacing any prior values.
1016        pub fn with_request<V: Into<crate::model::PromoteMigrationJobRequest>>(
1017            mut self,
1018            v: V,
1019        ) -> Self {
1020            self.0.request = v.into();
1021            self
1022        }
1023
1024        /// Sets all the options, replacing any prior values.
1025        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1026            self.0.options = v.into();
1027            self
1028        }
1029
1030        /// Sends the request.
1031        ///
1032        /// # Long running operations
1033        ///
1034        /// This starts, but does not poll, a longrunning operation. More information
1035        /// on [promote_migration_job][crate::client::DataMigrationService::promote_migration_job].
1036        pub async fn send(self) -> Result<longrunning::model::Operation> {
1037            (*self.0.stub)
1038                .promote_migration_job(self.0.request, self.0.options)
1039                .await
1040                .map(gax::response::Response::into_body)
1041        }
1042
1043        /// Creates a [Poller][lro::Poller] to work with `promote_migration_job`.
1044        pub fn poller(
1045            self,
1046        ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
1047            type Operation = lro::internal::Operation<
1048                crate::model::MigrationJob,
1049                crate::model::OperationMetadata,
1050            >;
1051            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1052            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1053
1054            let stub = self.0.stub.clone();
1055            let mut options = self.0.options.clone();
1056            options.set_retry_policy(gax::retry_policy::NeverRetry);
1057            let query = move |name| {
1058                let stub = stub.clone();
1059                let options = options.clone();
1060                async {
1061                    let op = GetOperation::new(stub)
1062                        .set_name(name)
1063                        .with_options(options)
1064                        .send()
1065                        .await?;
1066                    Ok(Operation::new(op))
1067                }
1068            };
1069
1070            let start = move || async {
1071                let op = self.send().await?;
1072                Ok(Operation::new(op))
1073            };
1074
1075            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1076        }
1077
1078        /// Sets the value of [name][crate::model::PromoteMigrationJobRequest::name].
1079        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1080            self.0.request.name = v.into();
1081            self
1082        }
1083    }
1084
1085    #[doc(hidden)]
1086    impl gax::options::internal::RequestBuilder for PromoteMigrationJob {
1087        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1088            &mut self.0.options
1089        }
1090    }
1091
1092    /// The request builder for [DataMigrationService::verify_migration_job][crate::client::DataMigrationService::verify_migration_job] calls.
1093    ///
1094    /// # Example
1095    /// ```no_run
1096    /// # use google_cloud_clouddms_v1::builder;
1097    /// use builder::data_migration_service::VerifyMigrationJob;
1098    /// # tokio_test::block_on(async {
1099    /// use lro::Poller;
1100    ///
1101    /// let builder = prepare_request_builder();
1102    /// let response = builder.poller().until_done().await?;
1103    /// # gax::Result::<()>::Ok(()) });
1104    ///
1105    /// fn prepare_request_builder() -> VerifyMigrationJob {
1106    ///   # panic!();
1107    ///   // ... details omitted ...
1108    /// }
1109    /// ```
1110    #[derive(Clone, Debug)]
1111    pub struct VerifyMigrationJob(RequestBuilder<crate::model::VerifyMigrationJobRequest>);
1112
1113    impl VerifyMigrationJob {
1114        pub(crate) fn new(
1115            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1116        ) -> Self {
1117            Self(RequestBuilder::new(stub))
1118        }
1119
1120        /// Sets the full request, replacing any prior values.
1121        pub fn with_request<V: Into<crate::model::VerifyMigrationJobRequest>>(
1122            mut self,
1123            v: V,
1124        ) -> Self {
1125            self.0.request = v.into();
1126            self
1127        }
1128
1129        /// Sets all the options, replacing any prior values.
1130        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1131            self.0.options = v.into();
1132            self
1133        }
1134
1135        /// Sends the request.
1136        ///
1137        /// # Long running operations
1138        ///
1139        /// This starts, but does not poll, a longrunning operation. More information
1140        /// on [verify_migration_job][crate::client::DataMigrationService::verify_migration_job].
1141        pub async fn send(self) -> Result<longrunning::model::Operation> {
1142            (*self.0.stub)
1143                .verify_migration_job(self.0.request, self.0.options)
1144                .await
1145                .map(gax::response::Response::into_body)
1146        }
1147
1148        /// Creates a [Poller][lro::Poller] to work with `verify_migration_job`.
1149        pub fn poller(
1150            self,
1151        ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
1152            type Operation = lro::internal::Operation<
1153                crate::model::MigrationJob,
1154                crate::model::OperationMetadata,
1155            >;
1156            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1157            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1158
1159            let stub = self.0.stub.clone();
1160            let mut options = self.0.options.clone();
1161            options.set_retry_policy(gax::retry_policy::NeverRetry);
1162            let query = move |name| {
1163                let stub = stub.clone();
1164                let options = options.clone();
1165                async {
1166                    let op = GetOperation::new(stub)
1167                        .set_name(name)
1168                        .with_options(options)
1169                        .send()
1170                        .await?;
1171                    Ok(Operation::new(op))
1172                }
1173            };
1174
1175            let start = move || async {
1176                let op = self.send().await?;
1177                Ok(Operation::new(op))
1178            };
1179
1180            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1181        }
1182
1183        /// Sets the value of [name][crate::model::VerifyMigrationJobRequest::name].
1184        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185            self.0.request.name = v.into();
1186            self
1187        }
1188
1189        /// Sets the value of [update_mask][crate::model::VerifyMigrationJobRequest::update_mask].
1190        pub fn set_update_mask<T>(mut self, v: T) -> Self
1191        where
1192            T: std::convert::Into<wkt::FieldMask>,
1193        {
1194            self.0.request.update_mask = std::option::Option::Some(v.into());
1195            self
1196        }
1197
1198        /// Sets or clears the value of [update_mask][crate::model::VerifyMigrationJobRequest::update_mask].
1199        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1200        where
1201            T: std::convert::Into<wkt::FieldMask>,
1202        {
1203            self.0.request.update_mask = v.map(|x| x.into());
1204            self
1205        }
1206
1207        /// Sets the value of [migration_job][crate::model::VerifyMigrationJobRequest::migration_job].
1208        pub fn set_migration_job<T>(mut self, v: T) -> Self
1209        where
1210            T: std::convert::Into<crate::model::MigrationJob>,
1211        {
1212            self.0.request.migration_job = std::option::Option::Some(v.into());
1213            self
1214        }
1215
1216        /// Sets or clears the value of [migration_job][crate::model::VerifyMigrationJobRequest::migration_job].
1217        pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
1218        where
1219            T: std::convert::Into<crate::model::MigrationJob>,
1220        {
1221            self.0.request.migration_job = v.map(|x| x.into());
1222            self
1223        }
1224    }
1225
1226    #[doc(hidden)]
1227    impl gax::options::internal::RequestBuilder for VerifyMigrationJob {
1228        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1229            &mut self.0.options
1230        }
1231    }
1232
1233    /// The request builder for [DataMigrationService::restart_migration_job][crate::client::DataMigrationService::restart_migration_job] calls.
1234    ///
1235    /// # Example
1236    /// ```no_run
1237    /// # use google_cloud_clouddms_v1::builder;
1238    /// use builder::data_migration_service::RestartMigrationJob;
1239    /// # tokio_test::block_on(async {
1240    /// use lro::Poller;
1241    ///
1242    /// let builder = prepare_request_builder();
1243    /// let response = builder.poller().until_done().await?;
1244    /// # gax::Result::<()>::Ok(()) });
1245    ///
1246    /// fn prepare_request_builder() -> RestartMigrationJob {
1247    ///   # panic!();
1248    ///   // ... details omitted ...
1249    /// }
1250    /// ```
1251    #[derive(Clone, Debug)]
1252    pub struct RestartMigrationJob(RequestBuilder<crate::model::RestartMigrationJobRequest>);
1253
1254    impl RestartMigrationJob {
1255        pub(crate) fn new(
1256            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1257        ) -> Self {
1258            Self(RequestBuilder::new(stub))
1259        }
1260
1261        /// Sets the full request, replacing any prior values.
1262        pub fn with_request<V: Into<crate::model::RestartMigrationJobRequest>>(
1263            mut self,
1264            v: V,
1265        ) -> Self {
1266            self.0.request = v.into();
1267            self
1268        }
1269
1270        /// Sets all the options, replacing any prior values.
1271        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1272            self.0.options = v.into();
1273            self
1274        }
1275
1276        /// Sends the request.
1277        ///
1278        /// # Long running operations
1279        ///
1280        /// This starts, but does not poll, a longrunning operation. More information
1281        /// on [restart_migration_job][crate::client::DataMigrationService::restart_migration_job].
1282        pub async fn send(self) -> Result<longrunning::model::Operation> {
1283            (*self.0.stub)
1284                .restart_migration_job(self.0.request, self.0.options)
1285                .await
1286                .map(gax::response::Response::into_body)
1287        }
1288
1289        /// Creates a [Poller][lro::Poller] to work with `restart_migration_job`.
1290        pub fn poller(
1291            self,
1292        ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
1293            type Operation = lro::internal::Operation<
1294                crate::model::MigrationJob,
1295                crate::model::OperationMetadata,
1296            >;
1297            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1298            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1299
1300            let stub = self.0.stub.clone();
1301            let mut options = self.0.options.clone();
1302            options.set_retry_policy(gax::retry_policy::NeverRetry);
1303            let query = move |name| {
1304                let stub = stub.clone();
1305                let options = options.clone();
1306                async {
1307                    let op = GetOperation::new(stub)
1308                        .set_name(name)
1309                        .with_options(options)
1310                        .send()
1311                        .await?;
1312                    Ok(Operation::new(op))
1313                }
1314            };
1315
1316            let start = move || async {
1317                let op = self.send().await?;
1318                Ok(Operation::new(op))
1319            };
1320
1321            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1322        }
1323
1324        /// Sets the value of [name][crate::model::RestartMigrationJobRequest::name].
1325        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1326            self.0.request.name = v.into();
1327            self
1328        }
1329
1330        /// Sets the value of [skip_validation][crate::model::RestartMigrationJobRequest::skip_validation].
1331        pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
1332            self.0.request.skip_validation = v.into();
1333            self
1334        }
1335    }
1336
1337    #[doc(hidden)]
1338    impl gax::options::internal::RequestBuilder for RestartMigrationJob {
1339        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1340            &mut self.0.options
1341        }
1342    }
1343
1344    /// The request builder for [DataMigrationService::generate_ssh_script][crate::client::DataMigrationService::generate_ssh_script] calls.
1345    ///
1346    /// # Example
1347    /// ```no_run
1348    /// # use google_cloud_clouddms_v1::builder;
1349    /// use builder::data_migration_service::GenerateSshScript;
1350    /// # tokio_test::block_on(async {
1351    ///
1352    /// let builder = prepare_request_builder();
1353    /// let response = builder.send().await?;
1354    /// # gax::Result::<()>::Ok(()) });
1355    ///
1356    /// fn prepare_request_builder() -> GenerateSshScript {
1357    ///   # panic!();
1358    ///   // ... details omitted ...
1359    /// }
1360    /// ```
1361    #[derive(Clone, Debug)]
1362    pub struct GenerateSshScript(RequestBuilder<crate::model::GenerateSshScriptRequest>);
1363
1364    impl GenerateSshScript {
1365        pub(crate) fn new(
1366            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1367        ) -> Self {
1368            Self(RequestBuilder::new(stub))
1369        }
1370
1371        /// Sets the full request, replacing any prior values.
1372        pub fn with_request<V: Into<crate::model::GenerateSshScriptRequest>>(
1373            mut self,
1374            v: V,
1375        ) -> Self {
1376            self.0.request = v.into();
1377            self
1378        }
1379
1380        /// Sets all the options, replacing any prior values.
1381        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1382            self.0.options = v.into();
1383            self
1384        }
1385
1386        /// Sends the request.
1387        pub async fn send(self) -> Result<crate::model::SshScript> {
1388            (*self.0.stub)
1389                .generate_ssh_script(self.0.request, self.0.options)
1390                .await
1391                .map(gax::response::Response::into_body)
1392        }
1393
1394        /// Sets the value of [migration_job][crate::model::GenerateSshScriptRequest::migration_job].
1395        pub fn set_migration_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
1396            self.0.request.migration_job = v.into();
1397            self
1398        }
1399
1400        /// Sets the value of [vm][crate::model::GenerateSshScriptRequest::vm].
1401        ///
1402        /// This is a **required** field for requests.
1403        pub fn set_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
1404            self.0.request.vm = v.into();
1405            self
1406        }
1407
1408        /// Sets the value of [vm_port][crate::model::GenerateSshScriptRequest::vm_port].
1409        pub fn set_vm_port<T: Into<i32>>(mut self, v: T) -> Self {
1410            self.0.request.vm_port = v.into();
1411            self
1412        }
1413
1414        /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config].
1415        ///
1416        /// Note that all the setters affecting `vm_config` are
1417        /// mutually exclusive.
1418        pub fn set_vm_config<
1419            T: Into<Option<crate::model::generate_ssh_script_request::VmConfig>>,
1420        >(
1421            mut self,
1422            v: T,
1423        ) -> Self {
1424            self.0.request.vm_config = v.into();
1425            self
1426        }
1427
1428        /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
1429        /// to hold a `VmCreationConfig`.
1430        ///
1431        /// Note that all the setters affecting `vm_config` are
1432        /// mutually exclusive.
1433        pub fn set_vm_creation_config<
1434            T: std::convert::Into<std::boxed::Box<crate::model::VmCreationConfig>>,
1435        >(
1436            mut self,
1437            v: T,
1438        ) -> Self {
1439            self.0.request = self.0.request.set_vm_creation_config(v);
1440            self
1441        }
1442
1443        /// Sets the value of [vm_config][crate::model::GenerateSshScriptRequest::vm_config]
1444        /// to hold a `VmSelectionConfig`.
1445        ///
1446        /// Note that all the setters affecting `vm_config` are
1447        /// mutually exclusive.
1448        pub fn set_vm_selection_config<
1449            T: std::convert::Into<std::boxed::Box<crate::model::VmSelectionConfig>>,
1450        >(
1451            mut self,
1452            v: T,
1453        ) -> Self {
1454            self.0.request = self.0.request.set_vm_selection_config(v);
1455            self
1456        }
1457    }
1458
1459    #[doc(hidden)]
1460    impl gax::options::internal::RequestBuilder for GenerateSshScript {
1461        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1462            &mut self.0.options
1463        }
1464    }
1465
1466    /// The request builder for [DataMigrationService::generate_tcp_proxy_script][crate::client::DataMigrationService::generate_tcp_proxy_script] calls.
1467    ///
1468    /// # Example
1469    /// ```no_run
1470    /// # use google_cloud_clouddms_v1::builder;
1471    /// use builder::data_migration_service::GenerateTcpProxyScript;
1472    /// # tokio_test::block_on(async {
1473    ///
1474    /// let builder = prepare_request_builder();
1475    /// let response = builder.send().await?;
1476    /// # gax::Result::<()>::Ok(()) });
1477    ///
1478    /// fn prepare_request_builder() -> GenerateTcpProxyScript {
1479    ///   # panic!();
1480    ///   // ... details omitted ...
1481    /// }
1482    /// ```
1483    #[derive(Clone, Debug)]
1484    pub struct GenerateTcpProxyScript(RequestBuilder<crate::model::GenerateTcpProxyScriptRequest>);
1485
1486    impl GenerateTcpProxyScript {
1487        pub(crate) fn new(
1488            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1489        ) -> Self {
1490            Self(RequestBuilder::new(stub))
1491        }
1492
1493        /// Sets the full request, replacing any prior values.
1494        pub fn with_request<V: Into<crate::model::GenerateTcpProxyScriptRequest>>(
1495            mut self,
1496            v: V,
1497        ) -> Self {
1498            self.0.request = v.into();
1499            self
1500        }
1501
1502        /// Sets all the options, replacing any prior values.
1503        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1504            self.0.options = v.into();
1505            self
1506        }
1507
1508        /// Sends the request.
1509        pub async fn send(self) -> Result<crate::model::TcpProxyScript> {
1510            (*self.0.stub)
1511                .generate_tcp_proxy_script(self.0.request, self.0.options)
1512                .await
1513                .map(gax::response::Response::into_body)
1514        }
1515
1516        /// Sets the value of [migration_job][crate::model::GenerateTcpProxyScriptRequest::migration_job].
1517        pub fn set_migration_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
1518            self.0.request.migration_job = v.into();
1519            self
1520        }
1521
1522        /// Sets the value of [vm_name][crate::model::GenerateTcpProxyScriptRequest::vm_name].
1523        ///
1524        /// This is a **required** field for requests.
1525        pub fn set_vm_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1526            self.0.request.vm_name = v.into();
1527            self
1528        }
1529
1530        /// Sets the value of [vm_machine_type][crate::model::GenerateTcpProxyScriptRequest::vm_machine_type].
1531        ///
1532        /// This is a **required** field for requests.
1533        pub fn set_vm_machine_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
1534            self.0.request.vm_machine_type = v.into();
1535            self
1536        }
1537
1538        /// Sets the value of [vm_zone][crate::model::GenerateTcpProxyScriptRequest::vm_zone].
1539        pub fn set_vm_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540            self.0.request.vm_zone = v.into();
1541            self
1542        }
1543
1544        /// Sets the value of [vm_subnet][crate::model::GenerateTcpProxyScriptRequest::vm_subnet].
1545        ///
1546        /// This is a **required** field for requests.
1547        pub fn set_vm_subnet<T: Into<std::string::String>>(mut self, v: T) -> Self {
1548            self.0.request.vm_subnet = v.into();
1549            self
1550        }
1551    }
1552
1553    #[doc(hidden)]
1554    impl gax::options::internal::RequestBuilder for GenerateTcpProxyScript {
1555        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1556            &mut self.0.options
1557        }
1558    }
1559
1560    /// The request builder for [DataMigrationService::list_connection_profiles][crate::client::DataMigrationService::list_connection_profiles] calls.
1561    ///
1562    /// # Example
1563    /// ```no_run
1564    /// # use google_cloud_clouddms_v1::builder;
1565    /// use builder::data_migration_service::ListConnectionProfiles;
1566    /// # tokio_test::block_on(async {
1567    /// use gax::paginator::ItemPaginator;
1568    ///
1569    /// let builder = prepare_request_builder();
1570    /// let mut items = builder.by_item();
1571    /// while let Some(result) = items.next().await {
1572    ///   let item = result?;
1573    /// }
1574    /// # gax::Result::<()>::Ok(()) });
1575    ///
1576    /// fn prepare_request_builder() -> ListConnectionProfiles {
1577    ///   # panic!();
1578    ///   // ... details omitted ...
1579    /// }
1580    /// ```
1581    #[derive(Clone, Debug)]
1582    pub struct ListConnectionProfiles(RequestBuilder<crate::model::ListConnectionProfilesRequest>);
1583
1584    impl ListConnectionProfiles {
1585        pub(crate) fn new(
1586            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1587        ) -> Self {
1588            Self(RequestBuilder::new(stub))
1589        }
1590
1591        /// Sets the full request, replacing any prior values.
1592        pub fn with_request<V: Into<crate::model::ListConnectionProfilesRequest>>(
1593            mut self,
1594            v: V,
1595        ) -> Self {
1596            self.0.request = v.into();
1597            self
1598        }
1599
1600        /// Sets all the options, replacing any prior values.
1601        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1602            self.0.options = v.into();
1603            self
1604        }
1605
1606        /// Sends the request.
1607        pub async fn send(self) -> Result<crate::model::ListConnectionProfilesResponse> {
1608            (*self.0.stub)
1609                .list_connection_profiles(self.0.request, self.0.options)
1610                .await
1611                .map(gax::response::Response::into_body)
1612        }
1613
1614        /// Streams each page in the collection.
1615        pub fn by_page(
1616            self,
1617        ) -> impl gax::paginator::Paginator<
1618            crate::model::ListConnectionProfilesResponse,
1619            gax::error::Error,
1620        > {
1621            use std::clone::Clone;
1622            let token = self.0.request.page_token.clone();
1623            let execute = move |token: String| {
1624                let mut builder = self.clone();
1625                builder.0.request = builder.0.request.set_page_token(token);
1626                builder.send()
1627            };
1628            gax::paginator::internal::new_paginator(token, execute)
1629        }
1630
1631        /// Streams each item in the collection.
1632        pub fn by_item(
1633            self,
1634        ) -> impl gax::paginator::ItemPaginator<
1635            crate::model::ListConnectionProfilesResponse,
1636            gax::error::Error,
1637        > {
1638            use gax::paginator::Paginator;
1639            self.by_page().items()
1640        }
1641
1642        /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1643        ///
1644        /// This is a **required** field for requests.
1645        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1646            self.0.request.parent = v.into();
1647            self
1648        }
1649
1650        /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1651        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1652            self.0.request.page_size = v.into();
1653            self
1654        }
1655
1656        /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1657        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1658            self.0.request.page_token = v.into();
1659            self
1660        }
1661
1662        /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1663        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1664            self.0.request.filter = v.into();
1665            self
1666        }
1667
1668        /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1669        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1670            self.0.request.order_by = v.into();
1671            self
1672        }
1673    }
1674
1675    #[doc(hidden)]
1676    impl gax::options::internal::RequestBuilder for ListConnectionProfiles {
1677        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1678            &mut self.0.options
1679        }
1680    }
1681
1682    /// The request builder for [DataMigrationService::get_connection_profile][crate::client::DataMigrationService::get_connection_profile] calls.
1683    ///
1684    /// # Example
1685    /// ```no_run
1686    /// # use google_cloud_clouddms_v1::builder;
1687    /// use builder::data_migration_service::GetConnectionProfile;
1688    /// # tokio_test::block_on(async {
1689    ///
1690    /// let builder = prepare_request_builder();
1691    /// let response = builder.send().await?;
1692    /// # gax::Result::<()>::Ok(()) });
1693    ///
1694    /// fn prepare_request_builder() -> GetConnectionProfile {
1695    ///   # panic!();
1696    ///   // ... details omitted ...
1697    /// }
1698    /// ```
1699    #[derive(Clone, Debug)]
1700    pub struct GetConnectionProfile(RequestBuilder<crate::model::GetConnectionProfileRequest>);
1701
1702    impl GetConnectionProfile {
1703        pub(crate) fn new(
1704            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1705        ) -> Self {
1706            Self(RequestBuilder::new(stub))
1707        }
1708
1709        /// Sets the full request, replacing any prior values.
1710        pub fn with_request<V: Into<crate::model::GetConnectionProfileRequest>>(
1711            mut self,
1712            v: V,
1713        ) -> Self {
1714            self.0.request = v.into();
1715            self
1716        }
1717
1718        /// Sets all the options, replacing any prior values.
1719        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1720            self.0.options = v.into();
1721            self
1722        }
1723
1724        /// Sends the request.
1725        pub async fn send(self) -> Result<crate::model::ConnectionProfile> {
1726            (*self.0.stub)
1727                .get_connection_profile(self.0.request, self.0.options)
1728                .await
1729                .map(gax::response::Response::into_body)
1730        }
1731
1732        /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1733        ///
1734        /// This is a **required** field for requests.
1735        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1736            self.0.request.name = v.into();
1737            self
1738        }
1739    }
1740
1741    #[doc(hidden)]
1742    impl gax::options::internal::RequestBuilder for GetConnectionProfile {
1743        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1744            &mut self.0.options
1745        }
1746    }
1747
1748    /// The request builder for [DataMigrationService::create_connection_profile][crate::client::DataMigrationService::create_connection_profile] calls.
1749    ///
1750    /// # Example
1751    /// ```no_run
1752    /// # use google_cloud_clouddms_v1::builder;
1753    /// use builder::data_migration_service::CreateConnectionProfile;
1754    /// # tokio_test::block_on(async {
1755    /// use lro::Poller;
1756    ///
1757    /// let builder = prepare_request_builder();
1758    /// let response = builder.poller().until_done().await?;
1759    /// # gax::Result::<()>::Ok(()) });
1760    ///
1761    /// fn prepare_request_builder() -> CreateConnectionProfile {
1762    ///   # panic!();
1763    ///   // ... details omitted ...
1764    /// }
1765    /// ```
1766    #[derive(Clone, Debug)]
1767    pub struct CreateConnectionProfile(
1768        RequestBuilder<crate::model::CreateConnectionProfileRequest>,
1769    );
1770
1771    impl CreateConnectionProfile {
1772        pub(crate) fn new(
1773            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1774        ) -> Self {
1775            Self(RequestBuilder::new(stub))
1776        }
1777
1778        /// Sets the full request, replacing any prior values.
1779        pub fn with_request<V: Into<crate::model::CreateConnectionProfileRequest>>(
1780            mut self,
1781            v: V,
1782        ) -> Self {
1783            self.0.request = v.into();
1784            self
1785        }
1786
1787        /// Sets all the options, replacing any prior values.
1788        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1789            self.0.options = v.into();
1790            self
1791        }
1792
1793        /// Sends the request.
1794        ///
1795        /// # Long running operations
1796        ///
1797        /// This starts, but does not poll, a longrunning operation. More information
1798        /// on [create_connection_profile][crate::client::DataMigrationService::create_connection_profile].
1799        pub async fn send(self) -> Result<longrunning::model::Operation> {
1800            (*self.0.stub)
1801                .create_connection_profile(self.0.request, self.0.options)
1802                .await
1803                .map(gax::response::Response::into_body)
1804        }
1805
1806        /// Creates a [Poller][lro::Poller] to work with `create_connection_profile`.
1807        pub fn poller(
1808            self,
1809        ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
1810        {
1811            type Operation = lro::internal::Operation<
1812                crate::model::ConnectionProfile,
1813                crate::model::OperationMetadata,
1814            >;
1815            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1816            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1817
1818            let stub = self.0.stub.clone();
1819            let mut options = self.0.options.clone();
1820            options.set_retry_policy(gax::retry_policy::NeverRetry);
1821            let query = move |name| {
1822                let stub = stub.clone();
1823                let options = options.clone();
1824                async {
1825                    let op = GetOperation::new(stub)
1826                        .set_name(name)
1827                        .with_options(options)
1828                        .send()
1829                        .await?;
1830                    Ok(Operation::new(op))
1831                }
1832            };
1833
1834            let start = move || async {
1835                let op = self.send().await?;
1836                Ok(Operation::new(op))
1837            };
1838
1839            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1840        }
1841
1842        /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1843        ///
1844        /// This is a **required** field for requests.
1845        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1846            self.0.request.parent = v.into();
1847            self
1848        }
1849
1850        /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1851        ///
1852        /// This is a **required** field for requests.
1853        pub fn set_connection_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1854            self.0.request.connection_profile_id = v.into();
1855            self
1856        }
1857
1858        /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1859        ///
1860        /// This is a **required** field for requests.
1861        pub fn set_connection_profile<T>(mut self, v: T) -> Self
1862        where
1863            T: std::convert::Into<crate::model::ConnectionProfile>,
1864        {
1865            self.0.request.connection_profile = std::option::Option::Some(v.into());
1866            self
1867        }
1868
1869        /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1870        ///
1871        /// This is a **required** field for requests.
1872        pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1873        where
1874            T: std::convert::Into<crate::model::ConnectionProfile>,
1875        {
1876            self.0.request.connection_profile = v.map(|x| x.into());
1877            self
1878        }
1879
1880        /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1881        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882            self.0.request.request_id = v.into();
1883            self
1884        }
1885
1886        /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1887        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1888            self.0.request.validate_only = v.into();
1889            self
1890        }
1891
1892        /// Sets the value of [skip_validation][crate::model::CreateConnectionProfileRequest::skip_validation].
1893        pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
1894            self.0.request.skip_validation = v.into();
1895            self
1896        }
1897    }
1898
1899    #[doc(hidden)]
1900    impl gax::options::internal::RequestBuilder for CreateConnectionProfile {
1901        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1902            &mut self.0.options
1903        }
1904    }
1905
1906    /// The request builder for [DataMigrationService::update_connection_profile][crate::client::DataMigrationService::update_connection_profile] calls.
1907    ///
1908    /// # Example
1909    /// ```no_run
1910    /// # use google_cloud_clouddms_v1::builder;
1911    /// use builder::data_migration_service::UpdateConnectionProfile;
1912    /// # tokio_test::block_on(async {
1913    /// use lro::Poller;
1914    ///
1915    /// let builder = prepare_request_builder();
1916    /// let response = builder.poller().until_done().await?;
1917    /// # gax::Result::<()>::Ok(()) });
1918    ///
1919    /// fn prepare_request_builder() -> UpdateConnectionProfile {
1920    ///   # panic!();
1921    ///   // ... details omitted ...
1922    /// }
1923    /// ```
1924    #[derive(Clone, Debug)]
1925    pub struct UpdateConnectionProfile(
1926        RequestBuilder<crate::model::UpdateConnectionProfileRequest>,
1927    );
1928
1929    impl UpdateConnectionProfile {
1930        pub(crate) fn new(
1931            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1932        ) -> Self {
1933            Self(RequestBuilder::new(stub))
1934        }
1935
1936        /// Sets the full request, replacing any prior values.
1937        pub fn with_request<V: Into<crate::model::UpdateConnectionProfileRequest>>(
1938            mut self,
1939            v: V,
1940        ) -> Self {
1941            self.0.request = v.into();
1942            self
1943        }
1944
1945        /// Sets all the options, replacing any prior values.
1946        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1947            self.0.options = v.into();
1948            self
1949        }
1950
1951        /// Sends the request.
1952        ///
1953        /// # Long running operations
1954        ///
1955        /// This starts, but does not poll, a longrunning operation. More information
1956        /// on [update_connection_profile][crate::client::DataMigrationService::update_connection_profile].
1957        pub async fn send(self) -> Result<longrunning::model::Operation> {
1958            (*self.0.stub)
1959                .update_connection_profile(self.0.request, self.0.options)
1960                .await
1961                .map(gax::response::Response::into_body)
1962        }
1963
1964        /// Creates a [Poller][lro::Poller] to work with `update_connection_profile`.
1965        pub fn poller(
1966            self,
1967        ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
1968        {
1969            type Operation = lro::internal::Operation<
1970                crate::model::ConnectionProfile,
1971                crate::model::OperationMetadata,
1972            >;
1973            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1974            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1975
1976            let stub = self.0.stub.clone();
1977            let mut options = self.0.options.clone();
1978            options.set_retry_policy(gax::retry_policy::NeverRetry);
1979            let query = move |name| {
1980                let stub = stub.clone();
1981                let options = options.clone();
1982                async {
1983                    let op = GetOperation::new(stub)
1984                        .set_name(name)
1985                        .with_options(options)
1986                        .send()
1987                        .await?;
1988                    Ok(Operation::new(op))
1989                }
1990            };
1991
1992            let start = move || async {
1993                let op = self.send().await?;
1994                Ok(Operation::new(op))
1995            };
1996
1997            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1998        }
1999
2000        /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
2001        ///
2002        /// This is a **required** field for requests.
2003        pub fn set_update_mask<T>(mut self, v: T) -> Self
2004        where
2005            T: std::convert::Into<wkt::FieldMask>,
2006        {
2007            self.0.request.update_mask = std::option::Option::Some(v.into());
2008            self
2009        }
2010
2011        /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
2012        ///
2013        /// This is a **required** field for requests.
2014        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2015        where
2016            T: std::convert::Into<wkt::FieldMask>,
2017        {
2018            self.0.request.update_mask = v.map(|x| x.into());
2019            self
2020        }
2021
2022        /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
2023        ///
2024        /// This is a **required** field for requests.
2025        pub fn set_connection_profile<T>(mut self, v: T) -> Self
2026        where
2027            T: std::convert::Into<crate::model::ConnectionProfile>,
2028        {
2029            self.0.request.connection_profile = std::option::Option::Some(v.into());
2030            self
2031        }
2032
2033        /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
2034        ///
2035        /// This is a **required** field for requests.
2036        pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
2037        where
2038            T: std::convert::Into<crate::model::ConnectionProfile>,
2039        {
2040            self.0.request.connection_profile = v.map(|x| x.into());
2041            self
2042        }
2043
2044        /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
2045        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2046            self.0.request.request_id = v.into();
2047            self
2048        }
2049
2050        /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
2051        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2052            self.0.request.validate_only = v.into();
2053            self
2054        }
2055
2056        /// Sets the value of [skip_validation][crate::model::UpdateConnectionProfileRequest::skip_validation].
2057        pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
2058            self.0.request.skip_validation = v.into();
2059            self
2060        }
2061    }
2062
2063    #[doc(hidden)]
2064    impl gax::options::internal::RequestBuilder for UpdateConnectionProfile {
2065        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2066            &mut self.0.options
2067        }
2068    }
2069
2070    /// The request builder for [DataMigrationService::delete_connection_profile][crate::client::DataMigrationService::delete_connection_profile] calls.
2071    ///
2072    /// # Example
2073    /// ```no_run
2074    /// # use google_cloud_clouddms_v1::builder;
2075    /// use builder::data_migration_service::DeleteConnectionProfile;
2076    /// # tokio_test::block_on(async {
2077    /// use lro::Poller;
2078    ///
2079    /// let builder = prepare_request_builder();
2080    /// let response = builder.poller().until_done().await?;
2081    /// # gax::Result::<()>::Ok(()) });
2082    ///
2083    /// fn prepare_request_builder() -> DeleteConnectionProfile {
2084    ///   # panic!();
2085    ///   // ... details omitted ...
2086    /// }
2087    /// ```
2088    #[derive(Clone, Debug)]
2089    pub struct DeleteConnectionProfile(
2090        RequestBuilder<crate::model::DeleteConnectionProfileRequest>,
2091    );
2092
2093    impl DeleteConnectionProfile {
2094        pub(crate) fn new(
2095            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2096        ) -> Self {
2097            Self(RequestBuilder::new(stub))
2098        }
2099
2100        /// Sets the full request, replacing any prior values.
2101        pub fn with_request<V: Into<crate::model::DeleteConnectionProfileRequest>>(
2102            mut self,
2103            v: V,
2104        ) -> Self {
2105            self.0.request = v.into();
2106            self
2107        }
2108
2109        /// Sets all the options, replacing any prior values.
2110        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2111            self.0.options = v.into();
2112            self
2113        }
2114
2115        /// Sends the request.
2116        ///
2117        /// # Long running operations
2118        ///
2119        /// This starts, but does not poll, a longrunning operation. More information
2120        /// on [delete_connection_profile][crate::client::DataMigrationService::delete_connection_profile].
2121        pub async fn send(self) -> Result<longrunning::model::Operation> {
2122            (*self.0.stub)
2123                .delete_connection_profile(self.0.request, self.0.options)
2124                .await
2125                .map(gax::response::Response::into_body)
2126        }
2127
2128        /// Creates a [Poller][lro::Poller] to work with `delete_connection_profile`.
2129        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2130            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2131            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2132            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2133
2134            let stub = self.0.stub.clone();
2135            let mut options = self.0.options.clone();
2136            options.set_retry_policy(gax::retry_policy::NeverRetry);
2137            let query = move |name| {
2138                let stub = stub.clone();
2139                let options = options.clone();
2140                async {
2141                    let op = GetOperation::new(stub)
2142                        .set_name(name)
2143                        .with_options(options)
2144                        .send()
2145                        .await?;
2146                    Ok(Operation::new(op))
2147                }
2148            };
2149
2150            let start = move || async {
2151                let op = self.send().await?;
2152                Ok(Operation::new(op))
2153            };
2154
2155            lro::internal::new_unit_response_poller(
2156                polling_error_policy,
2157                polling_backoff_policy,
2158                start,
2159                query,
2160            )
2161        }
2162
2163        /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
2164        ///
2165        /// This is a **required** field for requests.
2166        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167            self.0.request.name = v.into();
2168            self
2169        }
2170
2171        /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
2172        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2173            self.0.request.request_id = v.into();
2174            self
2175        }
2176
2177        /// Sets the value of [force][crate::model::DeleteConnectionProfileRequest::force].
2178        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2179            self.0.request.force = v.into();
2180            self
2181        }
2182    }
2183
2184    #[doc(hidden)]
2185    impl gax::options::internal::RequestBuilder for DeleteConnectionProfile {
2186        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2187            &mut self.0.options
2188        }
2189    }
2190
2191    /// The request builder for [DataMigrationService::create_private_connection][crate::client::DataMigrationService::create_private_connection] calls.
2192    ///
2193    /// # Example
2194    /// ```no_run
2195    /// # use google_cloud_clouddms_v1::builder;
2196    /// use builder::data_migration_service::CreatePrivateConnection;
2197    /// # tokio_test::block_on(async {
2198    /// use lro::Poller;
2199    ///
2200    /// let builder = prepare_request_builder();
2201    /// let response = builder.poller().until_done().await?;
2202    /// # gax::Result::<()>::Ok(()) });
2203    ///
2204    /// fn prepare_request_builder() -> CreatePrivateConnection {
2205    ///   # panic!();
2206    ///   // ... details omitted ...
2207    /// }
2208    /// ```
2209    #[derive(Clone, Debug)]
2210    pub struct CreatePrivateConnection(
2211        RequestBuilder<crate::model::CreatePrivateConnectionRequest>,
2212    );
2213
2214    impl CreatePrivateConnection {
2215        pub(crate) fn new(
2216            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2217        ) -> Self {
2218            Self(RequestBuilder::new(stub))
2219        }
2220
2221        /// Sets the full request, replacing any prior values.
2222        pub fn with_request<V: Into<crate::model::CreatePrivateConnectionRequest>>(
2223            mut self,
2224            v: V,
2225        ) -> Self {
2226            self.0.request = v.into();
2227            self
2228        }
2229
2230        /// Sets all the options, replacing any prior values.
2231        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2232            self.0.options = v.into();
2233            self
2234        }
2235
2236        /// Sends the request.
2237        ///
2238        /// # Long running operations
2239        ///
2240        /// This starts, but does not poll, a longrunning operation. More information
2241        /// on [create_private_connection][crate::client::DataMigrationService::create_private_connection].
2242        pub async fn send(self) -> Result<longrunning::model::Operation> {
2243            (*self.0.stub)
2244                .create_private_connection(self.0.request, self.0.options)
2245                .await
2246                .map(gax::response::Response::into_body)
2247        }
2248
2249        /// Creates a [Poller][lro::Poller] to work with `create_private_connection`.
2250        pub fn poller(
2251            self,
2252        ) -> impl lro::Poller<crate::model::PrivateConnection, crate::model::OperationMetadata>
2253        {
2254            type Operation = lro::internal::Operation<
2255                crate::model::PrivateConnection,
2256                crate::model::OperationMetadata,
2257            >;
2258            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2259            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2260
2261            let stub = self.0.stub.clone();
2262            let mut options = self.0.options.clone();
2263            options.set_retry_policy(gax::retry_policy::NeverRetry);
2264            let query = move |name| {
2265                let stub = stub.clone();
2266                let options = options.clone();
2267                async {
2268                    let op = GetOperation::new(stub)
2269                        .set_name(name)
2270                        .with_options(options)
2271                        .send()
2272                        .await?;
2273                    Ok(Operation::new(op))
2274                }
2275            };
2276
2277            let start = move || async {
2278                let op = self.send().await?;
2279                Ok(Operation::new(op))
2280            };
2281
2282            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2283        }
2284
2285        /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
2286        ///
2287        /// This is a **required** field for requests.
2288        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2289            self.0.request.parent = v.into();
2290            self
2291        }
2292
2293        /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
2294        ///
2295        /// This is a **required** field for requests.
2296        pub fn set_private_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2297            self.0.request.private_connection_id = v.into();
2298            self
2299        }
2300
2301        /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2302        ///
2303        /// This is a **required** field for requests.
2304        pub fn set_private_connection<T>(mut self, v: T) -> Self
2305        where
2306            T: std::convert::Into<crate::model::PrivateConnection>,
2307        {
2308            self.0.request.private_connection = std::option::Option::Some(v.into());
2309            self
2310        }
2311
2312        /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2313        ///
2314        /// This is a **required** field for requests.
2315        pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2316        where
2317            T: std::convert::Into<crate::model::PrivateConnection>,
2318        {
2319            self.0.request.private_connection = v.map(|x| x.into());
2320            self
2321        }
2322
2323        /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
2324        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2325            self.0.request.request_id = v.into();
2326            self
2327        }
2328
2329        /// Sets the value of [skip_validation][crate::model::CreatePrivateConnectionRequest::skip_validation].
2330        pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
2331            self.0.request.skip_validation = v.into();
2332            self
2333        }
2334    }
2335
2336    #[doc(hidden)]
2337    impl gax::options::internal::RequestBuilder for CreatePrivateConnection {
2338        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2339            &mut self.0.options
2340        }
2341    }
2342
2343    /// The request builder for [DataMigrationService::get_private_connection][crate::client::DataMigrationService::get_private_connection] calls.
2344    ///
2345    /// # Example
2346    /// ```no_run
2347    /// # use google_cloud_clouddms_v1::builder;
2348    /// use builder::data_migration_service::GetPrivateConnection;
2349    /// # tokio_test::block_on(async {
2350    ///
2351    /// let builder = prepare_request_builder();
2352    /// let response = builder.send().await?;
2353    /// # gax::Result::<()>::Ok(()) });
2354    ///
2355    /// fn prepare_request_builder() -> GetPrivateConnection {
2356    ///   # panic!();
2357    ///   // ... details omitted ...
2358    /// }
2359    /// ```
2360    #[derive(Clone, Debug)]
2361    pub struct GetPrivateConnection(RequestBuilder<crate::model::GetPrivateConnectionRequest>);
2362
2363    impl GetPrivateConnection {
2364        pub(crate) fn new(
2365            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2366        ) -> Self {
2367            Self(RequestBuilder::new(stub))
2368        }
2369
2370        /// Sets the full request, replacing any prior values.
2371        pub fn with_request<V: Into<crate::model::GetPrivateConnectionRequest>>(
2372            mut self,
2373            v: V,
2374        ) -> Self {
2375            self.0.request = v.into();
2376            self
2377        }
2378
2379        /// Sets all the options, replacing any prior values.
2380        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2381            self.0.options = v.into();
2382            self
2383        }
2384
2385        /// Sends the request.
2386        pub async fn send(self) -> Result<crate::model::PrivateConnection> {
2387            (*self.0.stub)
2388                .get_private_connection(self.0.request, self.0.options)
2389                .await
2390                .map(gax::response::Response::into_body)
2391        }
2392
2393        /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
2394        ///
2395        /// This is a **required** field for requests.
2396        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2397            self.0.request.name = v.into();
2398            self
2399        }
2400    }
2401
2402    #[doc(hidden)]
2403    impl gax::options::internal::RequestBuilder for GetPrivateConnection {
2404        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2405            &mut self.0.options
2406        }
2407    }
2408
2409    /// The request builder for [DataMigrationService::list_private_connections][crate::client::DataMigrationService::list_private_connections] calls.
2410    ///
2411    /// # Example
2412    /// ```no_run
2413    /// # use google_cloud_clouddms_v1::builder;
2414    /// use builder::data_migration_service::ListPrivateConnections;
2415    /// # tokio_test::block_on(async {
2416    /// use gax::paginator::ItemPaginator;
2417    ///
2418    /// let builder = prepare_request_builder();
2419    /// let mut items = builder.by_item();
2420    /// while let Some(result) = items.next().await {
2421    ///   let item = result?;
2422    /// }
2423    /// # gax::Result::<()>::Ok(()) });
2424    ///
2425    /// fn prepare_request_builder() -> ListPrivateConnections {
2426    ///   # panic!();
2427    ///   // ... details omitted ...
2428    /// }
2429    /// ```
2430    #[derive(Clone, Debug)]
2431    pub struct ListPrivateConnections(RequestBuilder<crate::model::ListPrivateConnectionsRequest>);
2432
2433    impl ListPrivateConnections {
2434        pub(crate) fn new(
2435            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2436        ) -> Self {
2437            Self(RequestBuilder::new(stub))
2438        }
2439
2440        /// Sets the full request, replacing any prior values.
2441        pub fn with_request<V: Into<crate::model::ListPrivateConnectionsRequest>>(
2442            mut self,
2443            v: V,
2444        ) -> Self {
2445            self.0.request = v.into();
2446            self
2447        }
2448
2449        /// Sets all the options, replacing any prior values.
2450        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2451            self.0.options = v.into();
2452            self
2453        }
2454
2455        /// Sends the request.
2456        pub async fn send(self) -> Result<crate::model::ListPrivateConnectionsResponse> {
2457            (*self.0.stub)
2458                .list_private_connections(self.0.request, self.0.options)
2459                .await
2460                .map(gax::response::Response::into_body)
2461        }
2462
2463        /// Streams each page in the collection.
2464        pub fn by_page(
2465            self,
2466        ) -> impl gax::paginator::Paginator<
2467            crate::model::ListPrivateConnectionsResponse,
2468            gax::error::Error,
2469        > {
2470            use std::clone::Clone;
2471            let token = self.0.request.page_token.clone();
2472            let execute = move |token: String| {
2473                let mut builder = self.clone();
2474                builder.0.request = builder.0.request.set_page_token(token);
2475                builder.send()
2476            };
2477            gax::paginator::internal::new_paginator(token, execute)
2478        }
2479
2480        /// Streams each item in the collection.
2481        pub fn by_item(
2482            self,
2483        ) -> impl gax::paginator::ItemPaginator<
2484            crate::model::ListPrivateConnectionsResponse,
2485            gax::error::Error,
2486        > {
2487            use gax::paginator::Paginator;
2488            self.by_page().items()
2489        }
2490
2491        /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
2492        ///
2493        /// This is a **required** field for requests.
2494        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2495            self.0.request.parent = v.into();
2496            self
2497        }
2498
2499        /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
2500        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2501            self.0.request.page_size = v.into();
2502            self
2503        }
2504
2505        /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
2506        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2507            self.0.request.page_token = v.into();
2508            self
2509        }
2510
2511        /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
2512        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2513            self.0.request.filter = v.into();
2514            self
2515        }
2516
2517        /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
2518        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2519            self.0.request.order_by = v.into();
2520            self
2521        }
2522    }
2523
2524    #[doc(hidden)]
2525    impl gax::options::internal::RequestBuilder for ListPrivateConnections {
2526        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2527            &mut self.0.options
2528        }
2529    }
2530
2531    /// The request builder for [DataMigrationService::delete_private_connection][crate::client::DataMigrationService::delete_private_connection] calls.
2532    ///
2533    /// # Example
2534    /// ```no_run
2535    /// # use google_cloud_clouddms_v1::builder;
2536    /// use builder::data_migration_service::DeletePrivateConnection;
2537    /// # tokio_test::block_on(async {
2538    /// use lro::Poller;
2539    ///
2540    /// let builder = prepare_request_builder();
2541    /// let response = builder.poller().until_done().await?;
2542    /// # gax::Result::<()>::Ok(()) });
2543    ///
2544    /// fn prepare_request_builder() -> DeletePrivateConnection {
2545    ///   # panic!();
2546    ///   // ... details omitted ...
2547    /// }
2548    /// ```
2549    #[derive(Clone, Debug)]
2550    pub struct DeletePrivateConnection(
2551        RequestBuilder<crate::model::DeletePrivateConnectionRequest>,
2552    );
2553
2554    impl DeletePrivateConnection {
2555        pub(crate) fn new(
2556            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2557        ) -> Self {
2558            Self(RequestBuilder::new(stub))
2559        }
2560
2561        /// Sets the full request, replacing any prior values.
2562        pub fn with_request<V: Into<crate::model::DeletePrivateConnectionRequest>>(
2563            mut self,
2564            v: V,
2565        ) -> Self {
2566            self.0.request = v.into();
2567            self
2568        }
2569
2570        /// Sets all the options, replacing any prior values.
2571        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2572            self.0.options = v.into();
2573            self
2574        }
2575
2576        /// Sends the request.
2577        ///
2578        /// # Long running operations
2579        ///
2580        /// This starts, but does not poll, a longrunning operation. More information
2581        /// on [delete_private_connection][crate::client::DataMigrationService::delete_private_connection].
2582        pub async fn send(self) -> Result<longrunning::model::Operation> {
2583            (*self.0.stub)
2584                .delete_private_connection(self.0.request, self.0.options)
2585                .await
2586                .map(gax::response::Response::into_body)
2587        }
2588
2589        /// Creates a [Poller][lro::Poller] to work with `delete_private_connection`.
2590        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2591            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2592            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2593            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2594
2595            let stub = self.0.stub.clone();
2596            let mut options = self.0.options.clone();
2597            options.set_retry_policy(gax::retry_policy::NeverRetry);
2598            let query = move |name| {
2599                let stub = stub.clone();
2600                let options = options.clone();
2601                async {
2602                    let op = GetOperation::new(stub)
2603                        .set_name(name)
2604                        .with_options(options)
2605                        .send()
2606                        .await?;
2607                    Ok(Operation::new(op))
2608                }
2609            };
2610
2611            let start = move || async {
2612                let op = self.send().await?;
2613                Ok(Operation::new(op))
2614            };
2615
2616            lro::internal::new_unit_response_poller(
2617                polling_error_policy,
2618                polling_backoff_policy,
2619                start,
2620                query,
2621            )
2622        }
2623
2624        /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
2625        ///
2626        /// This is a **required** field for requests.
2627        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2628            self.0.request.name = v.into();
2629            self
2630        }
2631
2632        /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
2633        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2634            self.0.request.request_id = v.into();
2635            self
2636        }
2637    }
2638
2639    #[doc(hidden)]
2640    impl gax::options::internal::RequestBuilder for DeletePrivateConnection {
2641        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2642            &mut self.0.options
2643        }
2644    }
2645
2646    /// The request builder for [DataMigrationService::get_conversion_workspace][crate::client::DataMigrationService::get_conversion_workspace] calls.
2647    ///
2648    /// # Example
2649    /// ```no_run
2650    /// # use google_cloud_clouddms_v1::builder;
2651    /// use builder::data_migration_service::GetConversionWorkspace;
2652    /// # tokio_test::block_on(async {
2653    ///
2654    /// let builder = prepare_request_builder();
2655    /// let response = builder.send().await?;
2656    /// # gax::Result::<()>::Ok(()) });
2657    ///
2658    /// fn prepare_request_builder() -> GetConversionWorkspace {
2659    ///   # panic!();
2660    ///   // ... details omitted ...
2661    /// }
2662    /// ```
2663    #[derive(Clone, Debug)]
2664    pub struct GetConversionWorkspace(RequestBuilder<crate::model::GetConversionWorkspaceRequest>);
2665
2666    impl GetConversionWorkspace {
2667        pub(crate) fn new(
2668            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2669        ) -> Self {
2670            Self(RequestBuilder::new(stub))
2671        }
2672
2673        /// Sets the full request, replacing any prior values.
2674        pub fn with_request<V: Into<crate::model::GetConversionWorkspaceRequest>>(
2675            mut self,
2676            v: V,
2677        ) -> Self {
2678            self.0.request = v.into();
2679            self
2680        }
2681
2682        /// Sets all the options, replacing any prior values.
2683        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2684            self.0.options = v.into();
2685            self
2686        }
2687
2688        /// Sends the request.
2689        pub async fn send(self) -> Result<crate::model::ConversionWorkspace> {
2690            (*self.0.stub)
2691                .get_conversion_workspace(self.0.request, self.0.options)
2692                .await
2693                .map(gax::response::Response::into_body)
2694        }
2695
2696        /// Sets the value of [name][crate::model::GetConversionWorkspaceRequest::name].
2697        ///
2698        /// This is a **required** field for requests.
2699        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2700            self.0.request.name = v.into();
2701            self
2702        }
2703    }
2704
2705    #[doc(hidden)]
2706    impl gax::options::internal::RequestBuilder for GetConversionWorkspace {
2707        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2708            &mut self.0.options
2709        }
2710    }
2711
2712    /// The request builder for [DataMigrationService::list_conversion_workspaces][crate::client::DataMigrationService::list_conversion_workspaces] calls.
2713    ///
2714    /// # Example
2715    /// ```no_run
2716    /// # use google_cloud_clouddms_v1::builder;
2717    /// use builder::data_migration_service::ListConversionWorkspaces;
2718    /// # tokio_test::block_on(async {
2719    /// use gax::paginator::ItemPaginator;
2720    ///
2721    /// let builder = prepare_request_builder();
2722    /// let mut items = builder.by_item();
2723    /// while let Some(result) = items.next().await {
2724    ///   let item = result?;
2725    /// }
2726    /// # gax::Result::<()>::Ok(()) });
2727    ///
2728    /// fn prepare_request_builder() -> ListConversionWorkspaces {
2729    ///   # panic!();
2730    ///   // ... details omitted ...
2731    /// }
2732    /// ```
2733    #[derive(Clone, Debug)]
2734    pub struct ListConversionWorkspaces(
2735        RequestBuilder<crate::model::ListConversionWorkspacesRequest>,
2736    );
2737
2738    impl ListConversionWorkspaces {
2739        pub(crate) fn new(
2740            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2741        ) -> Self {
2742            Self(RequestBuilder::new(stub))
2743        }
2744
2745        /// Sets the full request, replacing any prior values.
2746        pub fn with_request<V: Into<crate::model::ListConversionWorkspacesRequest>>(
2747            mut self,
2748            v: V,
2749        ) -> Self {
2750            self.0.request = v.into();
2751            self
2752        }
2753
2754        /// Sets all the options, replacing any prior values.
2755        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2756            self.0.options = v.into();
2757            self
2758        }
2759
2760        /// Sends the request.
2761        pub async fn send(self) -> Result<crate::model::ListConversionWorkspacesResponse> {
2762            (*self.0.stub)
2763                .list_conversion_workspaces(self.0.request, self.0.options)
2764                .await
2765                .map(gax::response::Response::into_body)
2766        }
2767
2768        /// Streams each page in the collection.
2769        pub fn by_page(
2770            self,
2771        ) -> impl gax::paginator::Paginator<
2772            crate::model::ListConversionWorkspacesResponse,
2773            gax::error::Error,
2774        > {
2775            use std::clone::Clone;
2776            let token = self.0.request.page_token.clone();
2777            let execute = move |token: String| {
2778                let mut builder = self.clone();
2779                builder.0.request = builder.0.request.set_page_token(token);
2780                builder.send()
2781            };
2782            gax::paginator::internal::new_paginator(token, execute)
2783        }
2784
2785        /// Streams each item in the collection.
2786        pub fn by_item(
2787            self,
2788        ) -> impl gax::paginator::ItemPaginator<
2789            crate::model::ListConversionWorkspacesResponse,
2790            gax::error::Error,
2791        > {
2792            use gax::paginator::Paginator;
2793            self.by_page().items()
2794        }
2795
2796        /// Sets the value of [parent][crate::model::ListConversionWorkspacesRequest::parent].
2797        ///
2798        /// This is a **required** field for requests.
2799        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2800            self.0.request.parent = v.into();
2801            self
2802        }
2803
2804        /// Sets the value of [page_size][crate::model::ListConversionWorkspacesRequest::page_size].
2805        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2806            self.0.request.page_size = v.into();
2807            self
2808        }
2809
2810        /// Sets the value of [page_token][crate::model::ListConversionWorkspacesRequest::page_token].
2811        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2812            self.0.request.page_token = v.into();
2813            self
2814        }
2815
2816        /// Sets the value of [filter][crate::model::ListConversionWorkspacesRequest::filter].
2817        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818            self.0.request.filter = v.into();
2819            self
2820        }
2821    }
2822
2823    #[doc(hidden)]
2824    impl gax::options::internal::RequestBuilder for ListConversionWorkspaces {
2825        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2826            &mut self.0.options
2827        }
2828    }
2829
2830    /// The request builder for [DataMigrationService::create_conversion_workspace][crate::client::DataMigrationService::create_conversion_workspace] calls.
2831    ///
2832    /// # Example
2833    /// ```no_run
2834    /// # use google_cloud_clouddms_v1::builder;
2835    /// use builder::data_migration_service::CreateConversionWorkspace;
2836    /// # tokio_test::block_on(async {
2837    /// use lro::Poller;
2838    ///
2839    /// let builder = prepare_request_builder();
2840    /// let response = builder.poller().until_done().await?;
2841    /// # gax::Result::<()>::Ok(()) });
2842    ///
2843    /// fn prepare_request_builder() -> CreateConversionWorkspace {
2844    ///   # panic!();
2845    ///   // ... details omitted ...
2846    /// }
2847    /// ```
2848    #[derive(Clone, Debug)]
2849    pub struct CreateConversionWorkspace(
2850        RequestBuilder<crate::model::CreateConversionWorkspaceRequest>,
2851    );
2852
2853    impl CreateConversionWorkspace {
2854        pub(crate) fn new(
2855            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2856        ) -> Self {
2857            Self(RequestBuilder::new(stub))
2858        }
2859
2860        /// Sets the full request, replacing any prior values.
2861        pub fn with_request<V: Into<crate::model::CreateConversionWorkspaceRequest>>(
2862            mut self,
2863            v: V,
2864        ) -> Self {
2865            self.0.request = v.into();
2866            self
2867        }
2868
2869        /// Sets all the options, replacing any prior values.
2870        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2871            self.0.options = v.into();
2872            self
2873        }
2874
2875        /// Sends the request.
2876        ///
2877        /// # Long running operations
2878        ///
2879        /// This starts, but does not poll, a longrunning operation. More information
2880        /// on [create_conversion_workspace][crate::client::DataMigrationService::create_conversion_workspace].
2881        pub async fn send(self) -> Result<longrunning::model::Operation> {
2882            (*self.0.stub)
2883                .create_conversion_workspace(self.0.request, self.0.options)
2884                .await
2885                .map(gax::response::Response::into_body)
2886        }
2887
2888        /// Creates a [Poller][lro::Poller] to work with `create_conversion_workspace`.
2889        pub fn poller(
2890            self,
2891        ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
2892        {
2893            type Operation = lro::internal::Operation<
2894                crate::model::ConversionWorkspace,
2895                crate::model::OperationMetadata,
2896            >;
2897            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2898            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2899
2900            let stub = self.0.stub.clone();
2901            let mut options = self.0.options.clone();
2902            options.set_retry_policy(gax::retry_policy::NeverRetry);
2903            let query = move |name| {
2904                let stub = stub.clone();
2905                let options = options.clone();
2906                async {
2907                    let op = GetOperation::new(stub)
2908                        .set_name(name)
2909                        .with_options(options)
2910                        .send()
2911                        .await?;
2912                    Ok(Operation::new(op))
2913                }
2914            };
2915
2916            let start = move || async {
2917                let op = self.send().await?;
2918                Ok(Operation::new(op))
2919            };
2920
2921            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2922        }
2923
2924        /// Sets the value of [parent][crate::model::CreateConversionWorkspaceRequest::parent].
2925        ///
2926        /// This is a **required** field for requests.
2927        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2928            self.0.request.parent = v.into();
2929            self
2930        }
2931
2932        /// Sets the value of [conversion_workspace_id][crate::model::CreateConversionWorkspaceRequest::conversion_workspace_id].
2933        ///
2934        /// This is a **required** field for requests.
2935        pub fn set_conversion_workspace_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2936            self.0.request.conversion_workspace_id = v.into();
2937            self
2938        }
2939
2940        /// Sets the value of [conversion_workspace][crate::model::CreateConversionWorkspaceRequest::conversion_workspace].
2941        ///
2942        /// This is a **required** field for requests.
2943        pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
2944        where
2945            T: std::convert::Into<crate::model::ConversionWorkspace>,
2946        {
2947            self.0.request.conversion_workspace = std::option::Option::Some(v.into());
2948            self
2949        }
2950
2951        /// Sets or clears the value of [conversion_workspace][crate::model::CreateConversionWorkspaceRequest::conversion_workspace].
2952        ///
2953        /// This is a **required** field for requests.
2954        pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
2955        where
2956            T: std::convert::Into<crate::model::ConversionWorkspace>,
2957        {
2958            self.0.request.conversion_workspace = v.map(|x| x.into());
2959            self
2960        }
2961
2962        /// Sets the value of [request_id][crate::model::CreateConversionWorkspaceRequest::request_id].
2963        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2964            self.0.request.request_id = v.into();
2965            self
2966        }
2967    }
2968
2969    #[doc(hidden)]
2970    impl gax::options::internal::RequestBuilder for CreateConversionWorkspace {
2971        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2972            &mut self.0.options
2973        }
2974    }
2975
2976    /// The request builder for [DataMigrationService::update_conversion_workspace][crate::client::DataMigrationService::update_conversion_workspace] calls.
2977    ///
2978    /// # Example
2979    /// ```no_run
2980    /// # use google_cloud_clouddms_v1::builder;
2981    /// use builder::data_migration_service::UpdateConversionWorkspace;
2982    /// # tokio_test::block_on(async {
2983    /// use lro::Poller;
2984    ///
2985    /// let builder = prepare_request_builder();
2986    /// let response = builder.poller().until_done().await?;
2987    /// # gax::Result::<()>::Ok(()) });
2988    ///
2989    /// fn prepare_request_builder() -> UpdateConversionWorkspace {
2990    ///   # panic!();
2991    ///   // ... details omitted ...
2992    /// }
2993    /// ```
2994    #[derive(Clone, Debug)]
2995    pub struct UpdateConversionWorkspace(
2996        RequestBuilder<crate::model::UpdateConversionWorkspaceRequest>,
2997    );
2998
2999    impl UpdateConversionWorkspace {
3000        pub(crate) fn new(
3001            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3002        ) -> Self {
3003            Self(RequestBuilder::new(stub))
3004        }
3005
3006        /// Sets the full request, replacing any prior values.
3007        pub fn with_request<V: Into<crate::model::UpdateConversionWorkspaceRequest>>(
3008            mut self,
3009            v: V,
3010        ) -> Self {
3011            self.0.request = v.into();
3012            self
3013        }
3014
3015        /// Sets all the options, replacing any prior values.
3016        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3017            self.0.options = v.into();
3018            self
3019        }
3020
3021        /// Sends the request.
3022        ///
3023        /// # Long running operations
3024        ///
3025        /// This starts, but does not poll, a longrunning operation. More information
3026        /// on [update_conversion_workspace][crate::client::DataMigrationService::update_conversion_workspace].
3027        pub async fn send(self) -> Result<longrunning::model::Operation> {
3028            (*self.0.stub)
3029                .update_conversion_workspace(self.0.request, self.0.options)
3030                .await
3031                .map(gax::response::Response::into_body)
3032        }
3033
3034        /// Creates a [Poller][lro::Poller] to work with `update_conversion_workspace`.
3035        pub fn poller(
3036            self,
3037        ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
3038        {
3039            type Operation = lro::internal::Operation<
3040                crate::model::ConversionWorkspace,
3041                crate::model::OperationMetadata,
3042            >;
3043            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3044            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3045
3046            let stub = self.0.stub.clone();
3047            let mut options = self.0.options.clone();
3048            options.set_retry_policy(gax::retry_policy::NeverRetry);
3049            let query = move |name| {
3050                let stub = stub.clone();
3051                let options = options.clone();
3052                async {
3053                    let op = GetOperation::new(stub)
3054                        .set_name(name)
3055                        .with_options(options)
3056                        .send()
3057                        .await?;
3058                    Ok(Operation::new(op))
3059                }
3060            };
3061
3062            let start = move || async {
3063                let op = self.send().await?;
3064                Ok(Operation::new(op))
3065            };
3066
3067            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3068        }
3069
3070        /// Sets the value of [update_mask][crate::model::UpdateConversionWorkspaceRequest::update_mask].
3071        ///
3072        /// This is a **required** field for requests.
3073        pub fn set_update_mask<T>(mut self, v: T) -> Self
3074        where
3075            T: std::convert::Into<wkt::FieldMask>,
3076        {
3077            self.0.request.update_mask = std::option::Option::Some(v.into());
3078            self
3079        }
3080
3081        /// Sets or clears the value of [update_mask][crate::model::UpdateConversionWorkspaceRequest::update_mask].
3082        ///
3083        /// This is a **required** field for requests.
3084        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3085        where
3086            T: std::convert::Into<wkt::FieldMask>,
3087        {
3088            self.0.request.update_mask = v.map(|x| x.into());
3089            self
3090        }
3091
3092        /// Sets the value of [conversion_workspace][crate::model::UpdateConversionWorkspaceRequest::conversion_workspace].
3093        ///
3094        /// This is a **required** field for requests.
3095        pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
3096        where
3097            T: std::convert::Into<crate::model::ConversionWorkspace>,
3098        {
3099            self.0.request.conversion_workspace = std::option::Option::Some(v.into());
3100            self
3101        }
3102
3103        /// Sets or clears the value of [conversion_workspace][crate::model::UpdateConversionWorkspaceRequest::conversion_workspace].
3104        ///
3105        /// This is a **required** field for requests.
3106        pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
3107        where
3108            T: std::convert::Into<crate::model::ConversionWorkspace>,
3109        {
3110            self.0.request.conversion_workspace = v.map(|x| x.into());
3111            self
3112        }
3113
3114        /// Sets the value of [request_id][crate::model::UpdateConversionWorkspaceRequest::request_id].
3115        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3116            self.0.request.request_id = v.into();
3117            self
3118        }
3119    }
3120
3121    #[doc(hidden)]
3122    impl gax::options::internal::RequestBuilder for UpdateConversionWorkspace {
3123        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3124            &mut self.0.options
3125        }
3126    }
3127
3128    /// The request builder for [DataMigrationService::delete_conversion_workspace][crate::client::DataMigrationService::delete_conversion_workspace] calls.
3129    ///
3130    /// # Example
3131    /// ```no_run
3132    /// # use google_cloud_clouddms_v1::builder;
3133    /// use builder::data_migration_service::DeleteConversionWorkspace;
3134    /// # tokio_test::block_on(async {
3135    /// use lro::Poller;
3136    ///
3137    /// let builder = prepare_request_builder();
3138    /// let response = builder.poller().until_done().await?;
3139    /// # gax::Result::<()>::Ok(()) });
3140    ///
3141    /// fn prepare_request_builder() -> DeleteConversionWorkspace {
3142    ///   # panic!();
3143    ///   // ... details omitted ...
3144    /// }
3145    /// ```
3146    #[derive(Clone, Debug)]
3147    pub struct DeleteConversionWorkspace(
3148        RequestBuilder<crate::model::DeleteConversionWorkspaceRequest>,
3149    );
3150
3151    impl DeleteConversionWorkspace {
3152        pub(crate) fn new(
3153            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3154        ) -> Self {
3155            Self(RequestBuilder::new(stub))
3156        }
3157
3158        /// Sets the full request, replacing any prior values.
3159        pub fn with_request<V: Into<crate::model::DeleteConversionWorkspaceRequest>>(
3160            mut self,
3161            v: V,
3162        ) -> Self {
3163            self.0.request = v.into();
3164            self
3165        }
3166
3167        /// Sets all the options, replacing any prior values.
3168        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3169            self.0.options = v.into();
3170            self
3171        }
3172
3173        /// Sends the request.
3174        ///
3175        /// # Long running operations
3176        ///
3177        /// This starts, but does not poll, a longrunning operation. More information
3178        /// on [delete_conversion_workspace][crate::client::DataMigrationService::delete_conversion_workspace].
3179        pub async fn send(self) -> Result<longrunning::model::Operation> {
3180            (*self.0.stub)
3181                .delete_conversion_workspace(self.0.request, self.0.options)
3182                .await
3183                .map(gax::response::Response::into_body)
3184        }
3185
3186        /// Creates a [Poller][lro::Poller] to work with `delete_conversion_workspace`.
3187        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3188            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3189            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3190            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3191
3192            let stub = self.0.stub.clone();
3193            let mut options = self.0.options.clone();
3194            options.set_retry_policy(gax::retry_policy::NeverRetry);
3195            let query = move |name| {
3196                let stub = stub.clone();
3197                let options = options.clone();
3198                async {
3199                    let op = GetOperation::new(stub)
3200                        .set_name(name)
3201                        .with_options(options)
3202                        .send()
3203                        .await?;
3204                    Ok(Operation::new(op))
3205                }
3206            };
3207
3208            let start = move || async {
3209                let op = self.send().await?;
3210                Ok(Operation::new(op))
3211            };
3212
3213            lro::internal::new_unit_response_poller(
3214                polling_error_policy,
3215                polling_backoff_policy,
3216                start,
3217                query,
3218            )
3219        }
3220
3221        /// Sets the value of [name][crate::model::DeleteConversionWorkspaceRequest::name].
3222        ///
3223        /// This is a **required** field for requests.
3224        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3225            self.0.request.name = v.into();
3226            self
3227        }
3228
3229        /// Sets the value of [request_id][crate::model::DeleteConversionWorkspaceRequest::request_id].
3230        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3231            self.0.request.request_id = v.into();
3232            self
3233        }
3234
3235        /// Sets the value of [force][crate::model::DeleteConversionWorkspaceRequest::force].
3236        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3237            self.0.request.force = v.into();
3238            self
3239        }
3240    }
3241
3242    #[doc(hidden)]
3243    impl gax::options::internal::RequestBuilder for DeleteConversionWorkspace {
3244        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3245            &mut self.0.options
3246        }
3247    }
3248
3249    /// The request builder for [DataMigrationService::create_mapping_rule][crate::client::DataMigrationService::create_mapping_rule] calls.
3250    ///
3251    /// # Example
3252    /// ```no_run
3253    /// # use google_cloud_clouddms_v1::builder;
3254    /// use builder::data_migration_service::CreateMappingRule;
3255    /// # tokio_test::block_on(async {
3256    ///
3257    /// let builder = prepare_request_builder();
3258    /// let response = builder.send().await?;
3259    /// # gax::Result::<()>::Ok(()) });
3260    ///
3261    /// fn prepare_request_builder() -> CreateMappingRule {
3262    ///   # panic!();
3263    ///   // ... details omitted ...
3264    /// }
3265    /// ```
3266    #[derive(Clone, Debug)]
3267    pub struct CreateMappingRule(RequestBuilder<crate::model::CreateMappingRuleRequest>);
3268
3269    impl CreateMappingRule {
3270        pub(crate) fn new(
3271            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3272        ) -> Self {
3273            Self(RequestBuilder::new(stub))
3274        }
3275
3276        /// Sets the full request, replacing any prior values.
3277        pub fn with_request<V: Into<crate::model::CreateMappingRuleRequest>>(
3278            mut self,
3279            v: V,
3280        ) -> Self {
3281            self.0.request = v.into();
3282            self
3283        }
3284
3285        /// Sets all the options, replacing any prior values.
3286        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3287            self.0.options = v.into();
3288            self
3289        }
3290
3291        /// Sends the request.
3292        pub async fn send(self) -> Result<crate::model::MappingRule> {
3293            (*self.0.stub)
3294                .create_mapping_rule(self.0.request, self.0.options)
3295                .await
3296                .map(gax::response::Response::into_body)
3297        }
3298
3299        /// Sets the value of [parent][crate::model::CreateMappingRuleRequest::parent].
3300        ///
3301        /// This is a **required** field for requests.
3302        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3303            self.0.request.parent = v.into();
3304            self
3305        }
3306
3307        /// Sets the value of [mapping_rule_id][crate::model::CreateMappingRuleRequest::mapping_rule_id].
3308        ///
3309        /// This is a **required** field for requests.
3310        pub fn set_mapping_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3311            self.0.request.mapping_rule_id = v.into();
3312            self
3313        }
3314
3315        /// Sets the value of [mapping_rule][crate::model::CreateMappingRuleRequest::mapping_rule].
3316        ///
3317        /// This is a **required** field for requests.
3318        pub fn set_mapping_rule<T>(mut self, v: T) -> Self
3319        where
3320            T: std::convert::Into<crate::model::MappingRule>,
3321        {
3322            self.0.request.mapping_rule = std::option::Option::Some(v.into());
3323            self
3324        }
3325
3326        /// Sets or clears the value of [mapping_rule][crate::model::CreateMappingRuleRequest::mapping_rule].
3327        ///
3328        /// This is a **required** field for requests.
3329        pub fn set_or_clear_mapping_rule<T>(mut self, v: std::option::Option<T>) -> Self
3330        where
3331            T: std::convert::Into<crate::model::MappingRule>,
3332        {
3333            self.0.request.mapping_rule = v.map(|x| x.into());
3334            self
3335        }
3336
3337        /// Sets the value of [request_id][crate::model::CreateMappingRuleRequest::request_id].
3338        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3339            self.0.request.request_id = v.into();
3340            self
3341        }
3342    }
3343
3344    #[doc(hidden)]
3345    impl gax::options::internal::RequestBuilder for CreateMappingRule {
3346        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3347            &mut self.0.options
3348        }
3349    }
3350
3351    /// The request builder for [DataMigrationService::delete_mapping_rule][crate::client::DataMigrationService::delete_mapping_rule] calls.
3352    ///
3353    /// # Example
3354    /// ```no_run
3355    /// # use google_cloud_clouddms_v1::builder;
3356    /// use builder::data_migration_service::DeleteMappingRule;
3357    /// # tokio_test::block_on(async {
3358    ///
3359    /// let builder = prepare_request_builder();
3360    /// let response = builder.send().await?;
3361    /// # gax::Result::<()>::Ok(()) });
3362    ///
3363    /// fn prepare_request_builder() -> DeleteMappingRule {
3364    ///   # panic!();
3365    ///   // ... details omitted ...
3366    /// }
3367    /// ```
3368    #[derive(Clone, Debug)]
3369    pub struct DeleteMappingRule(RequestBuilder<crate::model::DeleteMappingRuleRequest>);
3370
3371    impl DeleteMappingRule {
3372        pub(crate) fn new(
3373            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3374        ) -> Self {
3375            Self(RequestBuilder::new(stub))
3376        }
3377
3378        /// Sets the full request, replacing any prior values.
3379        pub fn with_request<V: Into<crate::model::DeleteMappingRuleRequest>>(
3380            mut self,
3381            v: V,
3382        ) -> Self {
3383            self.0.request = v.into();
3384            self
3385        }
3386
3387        /// Sets all the options, replacing any prior values.
3388        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3389            self.0.options = v.into();
3390            self
3391        }
3392
3393        /// Sends the request.
3394        pub async fn send(self) -> Result<()> {
3395            (*self.0.stub)
3396                .delete_mapping_rule(self.0.request, self.0.options)
3397                .await
3398                .map(gax::response::Response::into_body)
3399        }
3400
3401        /// Sets the value of [name][crate::model::DeleteMappingRuleRequest::name].
3402        ///
3403        /// This is a **required** field for requests.
3404        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3405            self.0.request.name = v.into();
3406            self
3407        }
3408
3409        /// Sets the value of [request_id][crate::model::DeleteMappingRuleRequest::request_id].
3410        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411            self.0.request.request_id = v.into();
3412            self
3413        }
3414    }
3415
3416    #[doc(hidden)]
3417    impl gax::options::internal::RequestBuilder for DeleteMappingRule {
3418        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3419            &mut self.0.options
3420        }
3421    }
3422
3423    /// The request builder for [DataMigrationService::list_mapping_rules][crate::client::DataMigrationService::list_mapping_rules] calls.
3424    ///
3425    /// # Example
3426    /// ```no_run
3427    /// # use google_cloud_clouddms_v1::builder;
3428    /// use builder::data_migration_service::ListMappingRules;
3429    /// # tokio_test::block_on(async {
3430    /// use gax::paginator::ItemPaginator;
3431    ///
3432    /// let builder = prepare_request_builder();
3433    /// let mut items = builder.by_item();
3434    /// while let Some(result) = items.next().await {
3435    ///   let item = result?;
3436    /// }
3437    /// # gax::Result::<()>::Ok(()) });
3438    ///
3439    /// fn prepare_request_builder() -> ListMappingRules {
3440    ///   # panic!();
3441    ///   // ... details omitted ...
3442    /// }
3443    /// ```
3444    #[derive(Clone, Debug)]
3445    pub struct ListMappingRules(RequestBuilder<crate::model::ListMappingRulesRequest>);
3446
3447    impl ListMappingRules {
3448        pub(crate) fn new(
3449            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3450        ) -> Self {
3451            Self(RequestBuilder::new(stub))
3452        }
3453
3454        /// Sets the full request, replacing any prior values.
3455        pub fn with_request<V: Into<crate::model::ListMappingRulesRequest>>(
3456            mut self,
3457            v: V,
3458        ) -> Self {
3459            self.0.request = v.into();
3460            self
3461        }
3462
3463        /// Sets all the options, replacing any prior values.
3464        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3465            self.0.options = v.into();
3466            self
3467        }
3468
3469        /// Sends the request.
3470        pub async fn send(self) -> Result<crate::model::ListMappingRulesResponse> {
3471            (*self.0.stub)
3472                .list_mapping_rules(self.0.request, self.0.options)
3473                .await
3474                .map(gax::response::Response::into_body)
3475        }
3476
3477        /// Streams each page in the collection.
3478        pub fn by_page(
3479            self,
3480        ) -> impl gax::paginator::Paginator<crate::model::ListMappingRulesResponse, gax::error::Error>
3481        {
3482            use std::clone::Clone;
3483            let token = self.0.request.page_token.clone();
3484            let execute = move |token: String| {
3485                let mut builder = self.clone();
3486                builder.0.request = builder.0.request.set_page_token(token);
3487                builder.send()
3488            };
3489            gax::paginator::internal::new_paginator(token, execute)
3490        }
3491
3492        /// Streams each item in the collection.
3493        pub fn by_item(
3494            self,
3495        ) -> impl gax::paginator::ItemPaginator<crate::model::ListMappingRulesResponse, gax::error::Error>
3496        {
3497            use gax::paginator::Paginator;
3498            self.by_page().items()
3499        }
3500
3501        /// Sets the value of [parent][crate::model::ListMappingRulesRequest::parent].
3502        ///
3503        /// This is a **required** field for requests.
3504        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3505            self.0.request.parent = v.into();
3506            self
3507        }
3508
3509        /// Sets the value of [page_size][crate::model::ListMappingRulesRequest::page_size].
3510        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3511            self.0.request.page_size = v.into();
3512            self
3513        }
3514
3515        /// Sets the value of [page_token][crate::model::ListMappingRulesRequest::page_token].
3516        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3517            self.0.request.page_token = v.into();
3518            self
3519        }
3520    }
3521
3522    #[doc(hidden)]
3523    impl gax::options::internal::RequestBuilder for ListMappingRules {
3524        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3525            &mut self.0.options
3526        }
3527    }
3528
3529    /// The request builder for [DataMigrationService::get_mapping_rule][crate::client::DataMigrationService::get_mapping_rule] calls.
3530    ///
3531    /// # Example
3532    /// ```no_run
3533    /// # use google_cloud_clouddms_v1::builder;
3534    /// use builder::data_migration_service::GetMappingRule;
3535    /// # tokio_test::block_on(async {
3536    ///
3537    /// let builder = prepare_request_builder();
3538    /// let response = builder.send().await?;
3539    /// # gax::Result::<()>::Ok(()) });
3540    ///
3541    /// fn prepare_request_builder() -> GetMappingRule {
3542    ///   # panic!();
3543    ///   // ... details omitted ...
3544    /// }
3545    /// ```
3546    #[derive(Clone, Debug)]
3547    pub struct GetMappingRule(RequestBuilder<crate::model::GetMappingRuleRequest>);
3548
3549    impl GetMappingRule {
3550        pub(crate) fn new(
3551            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3552        ) -> Self {
3553            Self(RequestBuilder::new(stub))
3554        }
3555
3556        /// Sets the full request, replacing any prior values.
3557        pub fn with_request<V: Into<crate::model::GetMappingRuleRequest>>(mut self, v: V) -> Self {
3558            self.0.request = v.into();
3559            self
3560        }
3561
3562        /// Sets all the options, replacing any prior values.
3563        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3564            self.0.options = v.into();
3565            self
3566        }
3567
3568        /// Sends the request.
3569        pub async fn send(self) -> Result<crate::model::MappingRule> {
3570            (*self.0.stub)
3571                .get_mapping_rule(self.0.request, self.0.options)
3572                .await
3573                .map(gax::response::Response::into_body)
3574        }
3575
3576        /// Sets the value of [name][crate::model::GetMappingRuleRequest::name].
3577        ///
3578        /// This is a **required** field for requests.
3579        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3580            self.0.request.name = v.into();
3581            self
3582        }
3583    }
3584
3585    #[doc(hidden)]
3586    impl gax::options::internal::RequestBuilder for GetMappingRule {
3587        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3588            &mut self.0.options
3589        }
3590    }
3591
3592    /// The request builder for [DataMigrationService::seed_conversion_workspace][crate::client::DataMigrationService::seed_conversion_workspace] calls.
3593    ///
3594    /// # Example
3595    /// ```no_run
3596    /// # use google_cloud_clouddms_v1::builder;
3597    /// use builder::data_migration_service::SeedConversionWorkspace;
3598    /// # tokio_test::block_on(async {
3599    /// use lro::Poller;
3600    ///
3601    /// let builder = prepare_request_builder();
3602    /// let response = builder.poller().until_done().await?;
3603    /// # gax::Result::<()>::Ok(()) });
3604    ///
3605    /// fn prepare_request_builder() -> SeedConversionWorkspace {
3606    ///   # panic!();
3607    ///   // ... details omitted ...
3608    /// }
3609    /// ```
3610    #[derive(Clone, Debug)]
3611    pub struct SeedConversionWorkspace(
3612        RequestBuilder<crate::model::SeedConversionWorkspaceRequest>,
3613    );
3614
3615    impl SeedConversionWorkspace {
3616        pub(crate) fn new(
3617            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3618        ) -> Self {
3619            Self(RequestBuilder::new(stub))
3620        }
3621
3622        /// Sets the full request, replacing any prior values.
3623        pub fn with_request<V: Into<crate::model::SeedConversionWorkspaceRequest>>(
3624            mut self,
3625            v: V,
3626        ) -> Self {
3627            self.0.request = v.into();
3628            self
3629        }
3630
3631        /// Sets all the options, replacing any prior values.
3632        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3633            self.0.options = v.into();
3634            self
3635        }
3636
3637        /// Sends the request.
3638        ///
3639        /// # Long running operations
3640        ///
3641        /// This starts, but does not poll, a longrunning operation. More information
3642        /// on [seed_conversion_workspace][crate::client::DataMigrationService::seed_conversion_workspace].
3643        pub async fn send(self) -> Result<longrunning::model::Operation> {
3644            (*self.0.stub)
3645                .seed_conversion_workspace(self.0.request, self.0.options)
3646                .await
3647                .map(gax::response::Response::into_body)
3648        }
3649
3650        /// Creates a [Poller][lro::Poller] to work with `seed_conversion_workspace`.
3651        pub fn poller(
3652            self,
3653        ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
3654        {
3655            type Operation = lro::internal::Operation<
3656                crate::model::ConversionWorkspace,
3657                crate::model::OperationMetadata,
3658            >;
3659            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3660            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3661
3662            let stub = self.0.stub.clone();
3663            let mut options = self.0.options.clone();
3664            options.set_retry_policy(gax::retry_policy::NeverRetry);
3665            let query = move |name| {
3666                let stub = stub.clone();
3667                let options = options.clone();
3668                async {
3669                    let op = GetOperation::new(stub)
3670                        .set_name(name)
3671                        .with_options(options)
3672                        .send()
3673                        .await?;
3674                    Ok(Operation::new(op))
3675                }
3676            };
3677
3678            let start = move || async {
3679                let op = self.send().await?;
3680                Ok(Operation::new(op))
3681            };
3682
3683            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3684        }
3685
3686        /// Sets the value of [name][crate::model::SeedConversionWorkspaceRequest::name].
3687        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3688            self.0.request.name = v.into();
3689            self
3690        }
3691
3692        /// Sets the value of [auto_commit][crate::model::SeedConversionWorkspaceRequest::auto_commit].
3693        pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
3694            self.0.request.auto_commit = v.into();
3695            self
3696        }
3697
3698        /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from].
3699        ///
3700        /// Note that all the setters affecting `seed_from` are
3701        /// mutually exclusive.
3702        pub fn set_seed_from<
3703            T: Into<Option<crate::model::seed_conversion_workspace_request::SeedFrom>>,
3704        >(
3705            mut self,
3706            v: T,
3707        ) -> Self {
3708            self.0.request.seed_from = v.into();
3709            self
3710        }
3711
3712        /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
3713        /// to hold a `SourceConnectionProfile`.
3714        ///
3715        /// Note that all the setters affecting `seed_from` are
3716        /// mutually exclusive.
3717        pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
3718            mut self,
3719            v: T,
3720        ) -> Self {
3721            self.0.request = self.0.request.set_source_connection_profile(v);
3722            self
3723        }
3724
3725        /// Sets the value of [seed_from][crate::model::SeedConversionWorkspaceRequest::seed_from]
3726        /// to hold a `DestinationConnectionProfile`.
3727        ///
3728        /// Note that all the setters affecting `seed_from` are
3729        /// mutually exclusive.
3730        pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
3731            mut self,
3732            v: T,
3733        ) -> Self {
3734            self.0.request = self.0.request.set_destination_connection_profile(v);
3735            self
3736        }
3737    }
3738
3739    #[doc(hidden)]
3740    impl gax::options::internal::RequestBuilder for SeedConversionWorkspace {
3741        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3742            &mut self.0.options
3743        }
3744    }
3745
3746    /// The request builder for [DataMigrationService::import_mapping_rules][crate::client::DataMigrationService::import_mapping_rules] calls.
3747    ///
3748    /// # Example
3749    /// ```no_run
3750    /// # use google_cloud_clouddms_v1::builder;
3751    /// use builder::data_migration_service::ImportMappingRules;
3752    /// # tokio_test::block_on(async {
3753    /// use lro::Poller;
3754    ///
3755    /// let builder = prepare_request_builder();
3756    /// let response = builder.poller().until_done().await?;
3757    /// # gax::Result::<()>::Ok(()) });
3758    ///
3759    /// fn prepare_request_builder() -> ImportMappingRules {
3760    ///   # panic!();
3761    ///   // ... details omitted ...
3762    /// }
3763    /// ```
3764    #[derive(Clone, Debug)]
3765    pub struct ImportMappingRules(RequestBuilder<crate::model::ImportMappingRulesRequest>);
3766
3767    impl ImportMappingRules {
3768        pub(crate) fn new(
3769            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3770        ) -> Self {
3771            Self(RequestBuilder::new(stub))
3772        }
3773
3774        /// Sets the full request, replacing any prior values.
3775        pub fn with_request<V: Into<crate::model::ImportMappingRulesRequest>>(
3776            mut self,
3777            v: V,
3778        ) -> Self {
3779            self.0.request = v.into();
3780            self
3781        }
3782
3783        /// Sets all the options, replacing any prior values.
3784        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3785            self.0.options = v.into();
3786            self
3787        }
3788
3789        /// Sends the request.
3790        ///
3791        /// # Long running operations
3792        ///
3793        /// This starts, but does not poll, a longrunning operation. More information
3794        /// on [import_mapping_rules][crate::client::DataMigrationService::import_mapping_rules].
3795        pub async fn send(self) -> Result<longrunning::model::Operation> {
3796            (*self.0.stub)
3797                .import_mapping_rules(self.0.request, self.0.options)
3798                .await
3799                .map(gax::response::Response::into_body)
3800        }
3801
3802        /// Creates a [Poller][lro::Poller] to work with `import_mapping_rules`.
3803        pub fn poller(
3804            self,
3805        ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
3806        {
3807            type Operation = lro::internal::Operation<
3808                crate::model::ConversionWorkspace,
3809                crate::model::OperationMetadata,
3810            >;
3811            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3812            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3813
3814            let stub = self.0.stub.clone();
3815            let mut options = self.0.options.clone();
3816            options.set_retry_policy(gax::retry_policy::NeverRetry);
3817            let query = move |name| {
3818                let stub = stub.clone();
3819                let options = options.clone();
3820                async {
3821                    let op = GetOperation::new(stub)
3822                        .set_name(name)
3823                        .with_options(options)
3824                        .send()
3825                        .await?;
3826                    Ok(Operation::new(op))
3827                }
3828            };
3829
3830            let start = move || async {
3831                let op = self.send().await?;
3832                Ok(Operation::new(op))
3833            };
3834
3835            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3836        }
3837
3838        /// Sets the value of [parent][crate::model::ImportMappingRulesRequest::parent].
3839        ///
3840        /// This is a **required** field for requests.
3841        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3842            self.0.request.parent = v.into();
3843            self
3844        }
3845
3846        /// Sets the value of [rules_format][crate::model::ImportMappingRulesRequest::rules_format].
3847        ///
3848        /// This is a **required** field for requests.
3849        pub fn set_rules_format<T: Into<crate::model::ImportRulesFileFormat>>(
3850            mut self,
3851            v: T,
3852        ) -> Self {
3853            self.0.request.rules_format = v.into();
3854            self
3855        }
3856
3857        /// Sets the value of [rules_files][crate::model::ImportMappingRulesRequest::rules_files].
3858        ///
3859        /// This is a **required** field for requests.
3860        pub fn set_rules_files<T, V>(mut self, v: T) -> Self
3861        where
3862            T: std::iter::IntoIterator<Item = V>,
3863            V: std::convert::Into<crate::model::import_mapping_rules_request::RulesFile>,
3864        {
3865            use std::iter::Iterator;
3866            self.0.request.rules_files = v.into_iter().map(|i| i.into()).collect();
3867            self
3868        }
3869
3870        /// Sets the value of [auto_commit][crate::model::ImportMappingRulesRequest::auto_commit].
3871        ///
3872        /// This is a **required** field for requests.
3873        pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
3874            self.0.request.auto_commit = v.into();
3875            self
3876        }
3877    }
3878
3879    #[doc(hidden)]
3880    impl gax::options::internal::RequestBuilder for ImportMappingRules {
3881        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3882            &mut self.0.options
3883        }
3884    }
3885
3886    /// The request builder for [DataMigrationService::convert_conversion_workspace][crate::client::DataMigrationService::convert_conversion_workspace] calls.
3887    ///
3888    /// # Example
3889    /// ```no_run
3890    /// # use google_cloud_clouddms_v1::builder;
3891    /// use builder::data_migration_service::ConvertConversionWorkspace;
3892    /// # tokio_test::block_on(async {
3893    /// use lro::Poller;
3894    ///
3895    /// let builder = prepare_request_builder();
3896    /// let response = builder.poller().until_done().await?;
3897    /// # gax::Result::<()>::Ok(()) });
3898    ///
3899    /// fn prepare_request_builder() -> ConvertConversionWorkspace {
3900    ///   # panic!();
3901    ///   // ... details omitted ...
3902    /// }
3903    /// ```
3904    #[derive(Clone, Debug)]
3905    pub struct ConvertConversionWorkspace(
3906        RequestBuilder<crate::model::ConvertConversionWorkspaceRequest>,
3907    );
3908
3909    impl ConvertConversionWorkspace {
3910        pub(crate) fn new(
3911            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3912        ) -> Self {
3913            Self(RequestBuilder::new(stub))
3914        }
3915
3916        /// Sets the full request, replacing any prior values.
3917        pub fn with_request<V: Into<crate::model::ConvertConversionWorkspaceRequest>>(
3918            mut self,
3919            v: V,
3920        ) -> Self {
3921            self.0.request = v.into();
3922            self
3923        }
3924
3925        /// Sets all the options, replacing any prior values.
3926        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3927            self.0.options = v.into();
3928            self
3929        }
3930
3931        /// Sends the request.
3932        ///
3933        /// # Long running operations
3934        ///
3935        /// This starts, but does not poll, a longrunning operation. More information
3936        /// on [convert_conversion_workspace][crate::client::DataMigrationService::convert_conversion_workspace].
3937        pub async fn send(self) -> Result<longrunning::model::Operation> {
3938            (*self.0.stub)
3939                .convert_conversion_workspace(self.0.request, self.0.options)
3940                .await
3941                .map(gax::response::Response::into_body)
3942        }
3943
3944        /// Creates a [Poller][lro::Poller] to work with `convert_conversion_workspace`.
3945        pub fn poller(
3946            self,
3947        ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
3948        {
3949            type Operation = lro::internal::Operation<
3950                crate::model::ConversionWorkspace,
3951                crate::model::OperationMetadata,
3952            >;
3953            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3954            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3955
3956            let stub = self.0.stub.clone();
3957            let mut options = self.0.options.clone();
3958            options.set_retry_policy(gax::retry_policy::NeverRetry);
3959            let query = move |name| {
3960                let stub = stub.clone();
3961                let options = options.clone();
3962                async {
3963                    let op = GetOperation::new(stub)
3964                        .set_name(name)
3965                        .with_options(options)
3966                        .send()
3967                        .await?;
3968                    Ok(Operation::new(op))
3969                }
3970            };
3971
3972            let start = move || async {
3973                let op = self.send().await?;
3974                Ok(Operation::new(op))
3975            };
3976
3977            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3978        }
3979
3980        /// Sets the value of [name][crate::model::ConvertConversionWorkspaceRequest::name].
3981        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3982            self.0.request.name = v.into();
3983            self
3984        }
3985
3986        /// Sets the value of [auto_commit][crate::model::ConvertConversionWorkspaceRequest::auto_commit].
3987        pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
3988            self.0.request.auto_commit = v.into();
3989            self
3990        }
3991
3992        /// Sets the value of [filter][crate::model::ConvertConversionWorkspaceRequest::filter].
3993        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3994            self.0.request.filter = v.into();
3995            self
3996        }
3997
3998        /// Sets the value of [convert_full_path][crate::model::ConvertConversionWorkspaceRequest::convert_full_path].
3999        pub fn set_convert_full_path<T: Into<bool>>(mut self, v: T) -> Self {
4000            self.0.request.convert_full_path = v.into();
4001            self
4002        }
4003    }
4004
4005    #[doc(hidden)]
4006    impl gax::options::internal::RequestBuilder for ConvertConversionWorkspace {
4007        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4008            &mut self.0.options
4009        }
4010    }
4011
4012    /// The request builder for [DataMigrationService::commit_conversion_workspace][crate::client::DataMigrationService::commit_conversion_workspace] calls.
4013    ///
4014    /// # Example
4015    /// ```no_run
4016    /// # use google_cloud_clouddms_v1::builder;
4017    /// use builder::data_migration_service::CommitConversionWorkspace;
4018    /// # tokio_test::block_on(async {
4019    /// use lro::Poller;
4020    ///
4021    /// let builder = prepare_request_builder();
4022    /// let response = builder.poller().until_done().await?;
4023    /// # gax::Result::<()>::Ok(()) });
4024    ///
4025    /// fn prepare_request_builder() -> CommitConversionWorkspace {
4026    ///   # panic!();
4027    ///   // ... details omitted ...
4028    /// }
4029    /// ```
4030    #[derive(Clone, Debug)]
4031    pub struct CommitConversionWorkspace(
4032        RequestBuilder<crate::model::CommitConversionWorkspaceRequest>,
4033    );
4034
4035    impl CommitConversionWorkspace {
4036        pub(crate) fn new(
4037            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4038        ) -> Self {
4039            Self(RequestBuilder::new(stub))
4040        }
4041
4042        /// Sets the full request, replacing any prior values.
4043        pub fn with_request<V: Into<crate::model::CommitConversionWorkspaceRequest>>(
4044            mut self,
4045            v: V,
4046        ) -> Self {
4047            self.0.request = v.into();
4048            self
4049        }
4050
4051        /// Sets all the options, replacing any prior values.
4052        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4053            self.0.options = v.into();
4054            self
4055        }
4056
4057        /// Sends the request.
4058        ///
4059        /// # Long running operations
4060        ///
4061        /// This starts, but does not poll, a longrunning operation. More information
4062        /// on [commit_conversion_workspace][crate::client::DataMigrationService::commit_conversion_workspace].
4063        pub async fn send(self) -> Result<longrunning::model::Operation> {
4064            (*self.0.stub)
4065                .commit_conversion_workspace(self.0.request, self.0.options)
4066                .await
4067                .map(gax::response::Response::into_body)
4068        }
4069
4070        /// Creates a [Poller][lro::Poller] to work with `commit_conversion_workspace`.
4071        pub fn poller(
4072            self,
4073        ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
4074        {
4075            type Operation = lro::internal::Operation<
4076                crate::model::ConversionWorkspace,
4077                crate::model::OperationMetadata,
4078            >;
4079            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4080            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4081
4082            let stub = self.0.stub.clone();
4083            let mut options = self.0.options.clone();
4084            options.set_retry_policy(gax::retry_policy::NeverRetry);
4085            let query = move |name| {
4086                let stub = stub.clone();
4087                let options = options.clone();
4088                async {
4089                    let op = GetOperation::new(stub)
4090                        .set_name(name)
4091                        .with_options(options)
4092                        .send()
4093                        .await?;
4094                    Ok(Operation::new(op))
4095                }
4096            };
4097
4098            let start = move || async {
4099                let op = self.send().await?;
4100                Ok(Operation::new(op))
4101            };
4102
4103            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4104        }
4105
4106        /// Sets the value of [name][crate::model::CommitConversionWorkspaceRequest::name].
4107        ///
4108        /// This is a **required** field for requests.
4109        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110            self.0.request.name = v.into();
4111            self
4112        }
4113
4114        /// Sets the value of [commit_name][crate::model::CommitConversionWorkspaceRequest::commit_name].
4115        pub fn set_commit_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4116            self.0.request.commit_name = v.into();
4117            self
4118        }
4119    }
4120
4121    #[doc(hidden)]
4122    impl gax::options::internal::RequestBuilder for CommitConversionWorkspace {
4123        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4124            &mut self.0.options
4125        }
4126    }
4127
4128    /// The request builder for [DataMigrationService::rollback_conversion_workspace][crate::client::DataMigrationService::rollback_conversion_workspace] calls.
4129    ///
4130    /// # Example
4131    /// ```no_run
4132    /// # use google_cloud_clouddms_v1::builder;
4133    /// use builder::data_migration_service::RollbackConversionWorkspace;
4134    /// # tokio_test::block_on(async {
4135    /// use lro::Poller;
4136    ///
4137    /// let builder = prepare_request_builder();
4138    /// let response = builder.poller().until_done().await?;
4139    /// # gax::Result::<()>::Ok(()) });
4140    ///
4141    /// fn prepare_request_builder() -> RollbackConversionWorkspace {
4142    ///   # panic!();
4143    ///   // ... details omitted ...
4144    /// }
4145    /// ```
4146    #[derive(Clone, Debug)]
4147    pub struct RollbackConversionWorkspace(
4148        RequestBuilder<crate::model::RollbackConversionWorkspaceRequest>,
4149    );
4150
4151    impl RollbackConversionWorkspace {
4152        pub(crate) fn new(
4153            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4154        ) -> Self {
4155            Self(RequestBuilder::new(stub))
4156        }
4157
4158        /// Sets the full request, replacing any prior values.
4159        pub fn with_request<V: Into<crate::model::RollbackConversionWorkspaceRequest>>(
4160            mut self,
4161            v: V,
4162        ) -> Self {
4163            self.0.request = v.into();
4164            self
4165        }
4166
4167        /// Sets all the options, replacing any prior values.
4168        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4169            self.0.options = v.into();
4170            self
4171        }
4172
4173        /// Sends the request.
4174        ///
4175        /// # Long running operations
4176        ///
4177        /// This starts, but does not poll, a longrunning operation. More information
4178        /// on [rollback_conversion_workspace][crate::client::DataMigrationService::rollback_conversion_workspace].
4179        pub async fn send(self) -> Result<longrunning::model::Operation> {
4180            (*self.0.stub)
4181                .rollback_conversion_workspace(self.0.request, self.0.options)
4182                .await
4183                .map(gax::response::Response::into_body)
4184        }
4185
4186        /// Creates a [Poller][lro::Poller] to work with `rollback_conversion_workspace`.
4187        pub fn poller(
4188            self,
4189        ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
4190        {
4191            type Operation = lro::internal::Operation<
4192                crate::model::ConversionWorkspace,
4193                crate::model::OperationMetadata,
4194            >;
4195            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4196            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4197
4198            let stub = self.0.stub.clone();
4199            let mut options = self.0.options.clone();
4200            options.set_retry_policy(gax::retry_policy::NeverRetry);
4201            let query = move |name| {
4202                let stub = stub.clone();
4203                let options = options.clone();
4204                async {
4205                    let op = GetOperation::new(stub)
4206                        .set_name(name)
4207                        .with_options(options)
4208                        .send()
4209                        .await?;
4210                    Ok(Operation::new(op))
4211                }
4212            };
4213
4214            let start = move || async {
4215                let op = self.send().await?;
4216                Ok(Operation::new(op))
4217            };
4218
4219            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4220        }
4221
4222        /// Sets the value of [name][crate::model::RollbackConversionWorkspaceRequest::name].
4223        ///
4224        /// This is a **required** field for requests.
4225        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4226            self.0.request.name = v.into();
4227            self
4228        }
4229    }
4230
4231    #[doc(hidden)]
4232    impl gax::options::internal::RequestBuilder for RollbackConversionWorkspace {
4233        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4234            &mut self.0.options
4235        }
4236    }
4237
4238    /// The request builder for [DataMigrationService::apply_conversion_workspace][crate::client::DataMigrationService::apply_conversion_workspace] calls.
4239    ///
4240    /// # Example
4241    /// ```no_run
4242    /// # use google_cloud_clouddms_v1::builder;
4243    /// use builder::data_migration_service::ApplyConversionWorkspace;
4244    /// # tokio_test::block_on(async {
4245    /// use lro::Poller;
4246    ///
4247    /// let builder = prepare_request_builder();
4248    /// let response = builder.poller().until_done().await?;
4249    /// # gax::Result::<()>::Ok(()) });
4250    ///
4251    /// fn prepare_request_builder() -> ApplyConversionWorkspace {
4252    ///   # panic!();
4253    ///   // ... details omitted ...
4254    /// }
4255    /// ```
4256    #[derive(Clone, Debug)]
4257    pub struct ApplyConversionWorkspace(
4258        RequestBuilder<crate::model::ApplyConversionWorkspaceRequest>,
4259    );
4260
4261    impl ApplyConversionWorkspace {
4262        pub(crate) fn new(
4263            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4264        ) -> Self {
4265            Self(RequestBuilder::new(stub))
4266        }
4267
4268        /// Sets the full request, replacing any prior values.
4269        pub fn with_request<V: Into<crate::model::ApplyConversionWorkspaceRequest>>(
4270            mut self,
4271            v: V,
4272        ) -> Self {
4273            self.0.request = v.into();
4274            self
4275        }
4276
4277        /// Sets all the options, replacing any prior values.
4278        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4279            self.0.options = v.into();
4280            self
4281        }
4282
4283        /// Sends the request.
4284        ///
4285        /// # Long running operations
4286        ///
4287        /// This starts, but does not poll, a longrunning operation. More information
4288        /// on [apply_conversion_workspace][crate::client::DataMigrationService::apply_conversion_workspace].
4289        pub async fn send(self) -> Result<longrunning::model::Operation> {
4290            (*self.0.stub)
4291                .apply_conversion_workspace(self.0.request, self.0.options)
4292                .await
4293                .map(gax::response::Response::into_body)
4294        }
4295
4296        /// Creates a [Poller][lro::Poller] to work with `apply_conversion_workspace`.
4297        pub fn poller(
4298            self,
4299        ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
4300        {
4301            type Operation = lro::internal::Operation<
4302                crate::model::ConversionWorkspace,
4303                crate::model::OperationMetadata,
4304            >;
4305            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4306            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4307
4308            let stub = self.0.stub.clone();
4309            let mut options = self.0.options.clone();
4310            options.set_retry_policy(gax::retry_policy::NeverRetry);
4311            let query = move |name| {
4312                let stub = stub.clone();
4313                let options = options.clone();
4314                async {
4315                    let op = GetOperation::new(stub)
4316                        .set_name(name)
4317                        .with_options(options)
4318                        .send()
4319                        .await?;
4320                    Ok(Operation::new(op))
4321                }
4322            };
4323
4324            let start = move || async {
4325                let op = self.send().await?;
4326                Ok(Operation::new(op))
4327            };
4328
4329            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4330        }
4331
4332        /// Sets the value of [name][crate::model::ApplyConversionWorkspaceRequest::name].
4333        ///
4334        /// This is a **required** field for requests.
4335        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4336            self.0.request.name = v.into();
4337            self
4338        }
4339
4340        /// Sets the value of [filter][crate::model::ApplyConversionWorkspaceRequest::filter].
4341        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4342            self.0.request.filter = v.into();
4343            self
4344        }
4345
4346        /// Sets the value of [dry_run][crate::model::ApplyConversionWorkspaceRequest::dry_run].
4347        pub fn set_dry_run<T: Into<bool>>(mut self, v: T) -> Self {
4348            self.0.request.dry_run = v.into();
4349            self
4350        }
4351
4352        /// Sets the value of [auto_commit][crate::model::ApplyConversionWorkspaceRequest::auto_commit].
4353        pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
4354            self.0.request.auto_commit = v.into();
4355            self
4356        }
4357
4358        /// Sets the value of [destination][crate::model::ApplyConversionWorkspaceRequest::destination].
4359        ///
4360        /// Note that all the setters affecting `destination` are
4361        /// mutually exclusive.
4362        pub fn set_destination<
4363            T: Into<Option<crate::model::apply_conversion_workspace_request::Destination>>,
4364        >(
4365            mut self,
4366            v: T,
4367        ) -> Self {
4368            self.0.request.destination = v.into();
4369            self
4370        }
4371
4372        /// Sets the value of [destination][crate::model::ApplyConversionWorkspaceRequest::destination]
4373        /// to hold a `ConnectionProfile`.
4374        ///
4375        /// Note that all the setters affecting `destination` are
4376        /// mutually exclusive.
4377        pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
4378            mut self,
4379            v: T,
4380        ) -> Self {
4381            self.0.request = self.0.request.set_connection_profile(v);
4382            self
4383        }
4384    }
4385
4386    #[doc(hidden)]
4387    impl gax::options::internal::RequestBuilder for ApplyConversionWorkspace {
4388        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4389            &mut self.0.options
4390        }
4391    }
4392
4393    /// The request builder for [DataMigrationService::describe_database_entities][crate::client::DataMigrationService::describe_database_entities] calls.
4394    ///
4395    /// # Example
4396    /// ```no_run
4397    /// # use google_cloud_clouddms_v1::builder;
4398    /// use builder::data_migration_service::DescribeDatabaseEntities;
4399    /// # tokio_test::block_on(async {
4400    /// use gax::paginator::ItemPaginator;
4401    ///
4402    /// let builder = prepare_request_builder();
4403    /// let mut items = builder.by_item();
4404    /// while let Some(result) = items.next().await {
4405    ///   let item = result?;
4406    /// }
4407    /// # gax::Result::<()>::Ok(()) });
4408    ///
4409    /// fn prepare_request_builder() -> DescribeDatabaseEntities {
4410    ///   # panic!();
4411    ///   // ... details omitted ...
4412    /// }
4413    /// ```
4414    #[derive(Clone, Debug)]
4415    pub struct DescribeDatabaseEntities(
4416        RequestBuilder<crate::model::DescribeDatabaseEntitiesRequest>,
4417    );
4418
4419    impl DescribeDatabaseEntities {
4420        pub(crate) fn new(
4421            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4422        ) -> Self {
4423            Self(RequestBuilder::new(stub))
4424        }
4425
4426        /// Sets the full request, replacing any prior values.
4427        pub fn with_request<V: Into<crate::model::DescribeDatabaseEntitiesRequest>>(
4428            mut self,
4429            v: V,
4430        ) -> Self {
4431            self.0.request = v.into();
4432            self
4433        }
4434
4435        /// Sets all the options, replacing any prior values.
4436        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4437            self.0.options = v.into();
4438            self
4439        }
4440
4441        /// Sends the request.
4442        pub async fn send(self) -> Result<crate::model::DescribeDatabaseEntitiesResponse> {
4443            (*self.0.stub)
4444                .describe_database_entities(self.0.request, self.0.options)
4445                .await
4446                .map(gax::response::Response::into_body)
4447        }
4448
4449        /// Streams each page in the collection.
4450        pub fn by_page(
4451            self,
4452        ) -> impl gax::paginator::Paginator<
4453            crate::model::DescribeDatabaseEntitiesResponse,
4454            gax::error::Error,
4455        > {
4456            use std::clone::Clone;
4457            let token = self.0.request.page_token.clone();
4458            let execute = move |token: String| {
4459                let mut builder = self.clone();
4460                builder.0.request = builder.0.request.set_page_token(token);
4461                builder.send()
4462            };
4463            gax::paginator::internal::new_paginator(token, execute)
4464        }
4465
4466        /// Streams each item in the collection.
4467        pub fn by_item(
4468            self,
4469        ) -> impl gax::paginator::ItemPaginator<
4470            crate::model::DescribeDatabaseEntitiesResponse,
4471            gax::error::Error,
4472        > {
4473            use gax::paginator::Paginator;
4474            self.by_page().items()
4475        }
4476
4477        /// Sets the value of [conversion_workspace][crate::model::DescribeDatabaseEntitiesRequest::conversion_workspace].
4478        ///
4479        /// This is a **required** field for requests.
4480        pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4481            self.0.request.conversion_workspace = v.into();
4482            self
4483        }
4484
4485        /// Sets the value of [page_size][crate::model::DescribeDatabaseEntitiesRequest::page_size].
4486        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4487            self.0.request.page_size = v.into();
4488            self
4489        }
4490
4491        /// Sets the value of [page_token][crate::model::DescribeDatabaseEntitiesRequest::page_token].
4492        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4493            self.0.request.page_token = v.into();
4494            self
4495        }
4496
4497        /// Sets the value of [tree][crate::model::DescribeDatabaseEntitiesRequest::tree].
4498        ///
4499        /// This is a **required** field for requests.
4500        pub fn set_tree<T: Into<crate::model::describe_database_entities_request::DBTreeType>>(
4501            mut self,
4502            v: T,
4503        ) -> Self {
4504            self.0.request.tree = v.into();
4505            self
4506        }
4507
4508        /// Sets the value of [uncommitted][crate::model::DescribeDatabaseEntitiesRequest::uncommitted].
4509        pub fn set_uncommitted<T: Into<bool>>(mut self, v: T) -> Self {
4510            self.0.request.uncommitted = v.into();
4511            self
4512        }
4513
4514        /// Sets the value of [commit_id][crate::model::DescribeDatabaseEntitiesRequest::commit_id].
4515        pub fn set_commit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4516            self.0.request.commit_id = v.into();
4517            self
4518        }
4519
4520        /// Sets the value of [filter][crate::model::DescribeDatabaseEntitiesRequest::filter].
4521        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4522            self.0.request.filter = v.into();
4523            self
4524        }
4525
4526        /// Sets the value of [view][crate::model::DescribeDatabaseEntitiesRequest::view].
4527        pub fn set_view<T: Into<crate::model::DatabaseEntityView>>(mut self, v: T) -> Self {
4528            self.0.request.view = v.into();
4529            self
4530        }
4531    }
4532
4533    #[doc(hidden)]
4534    impl gax::options::internal::RequestBuilder for DescribeDatabaseEntities {
4535        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4536            &mut self.0.options
4537        }
4538    }
4539
4540    /// The request builder for [DataMigrationService::search_background_jobs][crate::client::DataMigrationService::search_background_jobs] calls.
4541    ///
4542    /// # Example
4543    /// ```no_run
4544    /// # use google_cloud_clouddms_v1::builder;
4545    /// use builder::data_migration_service::SearchBackgroundJobs;
4546    /// # tokio_test::block_on(async {
4547    ///
4548    /// let builder = prepare_request_builder();
4549    /// let response = builder.send().await?;
4550    /// # gax::Result::<()>::Ok(()) });
4551    ///
4552    /// fn prepare_request_builder() -> SearchBackgroundJobs {
4553    ///   # panic!();
4554    ///   // ... details omitted ...
4555    /// }
4556    /// ```
4557    #[derive(Clone, Debug)]
4558    pub struct SearchBackgroundJobs(RequestBuilder<crate::model::SearchBackgroundJobsRequest>);
4559
4560    impl SearchBackgroundJobs {
4561        pub(crate) fn new(
4562            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4563        ) -> Self {
4564            Self(RequestBuilder::new(stub))
4565        }
4566
4567        /// Sets the full request, replacing any prior values.
4568        pub fn with_request<V: Into<crate::model::SearchBackgroundJobsRequest>>(
4569            mut self,
4570            v: V,
4571        ) -> Self {
4572            self.0.request = v.into();
4573            self
4574        }
4575
4576        /// Sets all the options, replacing any prior values.
4577        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4578            self.0.options = v.into();
4579            self
4580        }
4581
4582        /// Sends the request.
4583        pub async fn send(self) -> Result<crate::model::SearchBackgroundJobsResponse> {
4584            (*self.0.stub)
4585                .search_background_jobs(self.0.request, self.0.options)
4586                .await
4587                .map(gax::response::Response::into_body)
4588        }
4589
4590        /// Sets the value of [conversion_workspace][crate::model::SearchBackgroundJobsRequest::conversion_workspace].
4591        ///
4592        /// This is a **required** field for requests.
4593        pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4594            self.0.request.conversion_workspace = v.into();
4595            self
4596        }
4597
4598        /// Sets the value of [return_most_recent_per_job_type][crate::model::SearchBackgroundJobsRequest::return_most_recent_per_job_type].
4599        pub fn set_return_most_recent_per_job_type<T: Into<bool>>(mut self, v: T) -> Self {
4600            self.0.request.return_most_recent_per_job_type = v.into();
4601            self
4602        }
4603
4604        /// Sets the value of [max_size][crate::model::SearchBackgroundJobsRequest::max_size].
4605        pub fn set_max_size<T: Into<i32>>(mut self, v: T) -> Self {
4606            self.0.request.max_size = v.into();
4607            self
4608        }
4609
4610        /// Sets the value of [completed_until_time][crate::model::SearchBackgroundJobsRequest::completed_until_time].
4611        pub fn set_completed_until_time<T>(mut self, v: T) -> Self
4612        where
4613            T: std::convert::Into<wkt::Timestamp>,
4614        {
4615            self.0.request.completed_until_time = std::option::Option::Some(v.into());
4616            self
4617        }
4618
4619        /// Sets or clears the value of [completed_until_time][crate::model::SearchBackgroundJobsRequest::completed_until_time].
4620        pub fn set_or_clear_completed_until_time<T>(mut self, v: std::option::Option<T>) -> Self
4621        where
4622            T: std::convert::Into<wkt::Timestamp>,
4623        {
4624            self.0.request.completed_until_time = v.map(|x| x.into());
4625            self
4626        }
4627    }
4628
4629    #[doc(hidden)]
4630    impl gax::options::internal::RequestBuilder for SearchBackgroundJobs {
4631        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4632            &mut self.0.options
4633        }
4634    }
4635
4636    /// The request builder for [DataMigrationService::describe_conversion_workspace_revisions][crate::client::DataMigrationService::describe_conversion_workspace_revisions] calls.
4637    ///
4638    /// # Example
4639    /// ```no_run
4640    /// # use google_cloud_clouddms_v1::builder;
4641    /// use builder::data_migration_service::DescribeConversionWorkspaceRevisions;
4642    /// # tokio_test::block_on(async {
4643    ///
4644    /// let builder = prepare_request_builder();
4645    /// let response = builder.send().await?;
4646    /// # gax::Result::<()>::Ok(()) });
4647    ///
4648    /// fn prepare_request_builder() -> DescribeConversionWorkspaceRevisions {
4649    ///   # panic!();
4650    ///   // ... details omitted ...
4651    /// }
4652    /// ```
4653    #[derive(Clone, Debug)]
4654    pub struct DescribeConversionWorkspaceRevisions(
4655        RequestBuilder<crate::model::DescribeConversionWorkspaceRevisionsRequest>,
4656    );
4657
4658    impl DescribeConversionWorkspaceRevisions {
4659        pub(crate) fn new(
4660            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4661        ) -> Self {
4662            Self(RequestBuilder::new(stub))
4663        }
4664
4665        /// Sets the full request, replacing any prior values.
4666        pub fn with_request<V: Into<crate::model::DescribeConversionWorkspaceRevisionsRequest>>(
4667            mut self,
4668            v: V,
4669        ) -> Self {
4670            self.0.request = v.into();
4671            self
4672        }
4673
4674        /// Sets all the options, replacing any prior values.
4675        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4676            self.0.options = v.into();
4677            self
4678        }
4679
4680        /// Sends the request.
4681        pub async fn send(
4682            self,
4683        ) -> Result<crate::model::DescribeConversionWorkspaceRevisionsResponse> {
4684            (*self.0.stub)
4685                .describe_conversion_workspace_revisions(self.0.request, self.0.options)
4686                .await
4687                .map(gax::response::Response::into_body)
4688        }
4689
4690        /// Sets the value of [conversion_workspace][crate::model::DescribeConversionWorkspaceRevisionsRequest::conversion_workspace].
4691        ///
4692        /// This is a **required** field for requests.
4693        pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4694            self.0.request.conversion_workspace = v.into();
4695            self
4696        }
4697
4698        /// Sets the value of [commit_id][crate::model::DescribeConversionWorkspaceRevisionsRequest::commit_id].
4699        pub fn set_commit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4700            self.0.request.commit_id = v.into();
4701            self
4702        }
4703    }
4704
4705    #[doc(hidden)]
4706    impl gax::options::internal::RequestBuilder for DescribeConversionWorkspaceRevisions {
4707        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4708            &mut self.0.options
4709        }
4710    }
4711
4712    /// The request builder for [DataMigrationService::fetch_static_ips][crate::client::DataMigrationService::fetch_static_ips] calls.
4713    ///
4714    /// # Example
4715    /// ```no_run
4716    /// # use google_cloud_clouddms_v1::builder;
4717    /// use builder::data_migration_service::FetchStaticIps;
4718    /// # tokio_test::block_on(async {
4719    ///
4720    /// let builder = prepare_request_builder();
4721    /// let response = builder.send().await?;
4722    /// # gax::Result::<()>::Ok(()) });
4723    ///
4724    /// fn prepare_request_builder() -> FetchStaticIps {
4725    ///   # panic!();
4726    ///   // ... details omitted ...
4727    /// }
4728    /// ```
4729    #[derive(Clone, Debug)]
4730    pub struct FetchStaticIps(RequestBuilder<crate::model::FetchStaticIpsRequest>);
4731
4732    impl FetchStaticIps {
4733        pub(crate) fn new(
4734            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4735        ) -> Self {
4736            Self(RequestBuilder::new(stub))
4737        }
4738
4739        /// Sets the full request, replacing any prior values.
4740        pub fn with_request<V: Into<crate::model::FetchStaticIpsRequest>>(mut self, v: V) -> Self {
4741            self.0.request = v.into();
4742            self
4743        }
4744
4745        /// Sets all the options, replacing any prior values.
4746        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4747            self.0.options = v.into();
4748            self
4749        }
4750
4751        /// Sends the request.
4752        pub async fn send(self) -> Result<crate::model::FetchStaticIpsResponse> {
4753            (*self.0.stub)
4754                .fetch_static_ips(self.0.request, self.0.options)
4755                .await
4756                .map(gax::response::Response::into_body)
4757        }
4758
4759        /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
4760        ///
4761        /// This is a **required** field for requests.
4762        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4763            self.0.request.name = v.into();
4764            self
4765        }
4766
4767        /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
4768        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4769            self.0.request.page_size = v.into();
4770            self
4771        }
4772
4773        /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
4774        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4775            self.0.request.page_token = v.into();
4776            self
4777        }
4778    }
4779
4780    #[doc(hidden)]
4781    impl gax::options::internal::RequestBuilder for FetchStaticIps {
4782        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4783            &mut self.0.options
4784        }
4785    }
4786
4787    /// The request builder for [DataMigrationService::list_locations][crate::client::DataMigrationService::list_locations] calls.
4788    ///
4789    /// # Example
4790    /// ```no_run
4791    /// # use google_cloud_clouddms_v1::builder;
4792    /// use builder::data_migration_service::ListLocations;
4793    /// # tokio_test::block_on(async {
4794    /// use gax::paginator::ItemPaginator;
4795    ///
4796    /// let builder = prepare_request_builder();
4797    /// let mut items = builder.by_item();
4798    /// while let Some(result) = items.next().await {
4799    ///   let item = result?;
4800    /// }
4801    /// # gax::Result::<()>::Ok(()) });
4802    ///
4803    /// fn prepare_request_builder() -> ListLocations {
4804    ///   # panic!();
4805    ///   // ... details omitted ...
4806    /// }
4807    /// ```
4808    #[derive(Clone, Debug)]
4809    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4810
4811    impl ListLocations {
4812        pub(crate) fn new(
4813            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4814        ) -> Self {
4815            Self(RequestBuilder::new(stub))
4816        }
4817
4818        /// Sets the full request, replacing any prior values.
4819        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4820            mut self,
4821            v: V,
4822        ) -> Self {
4823            self.0.request = v.into();
4824            self
4825        }
4826
4827        /// Sets all the options, replacing any prior values.
4828        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4829            self.0.options = v.into();
4830            self
4831        }
4832
4833        /// Sends the request.
4834        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4835            (*self.0.stub)
4836                .list_locations(self.0.request, self.0.options)
4837                .await
4838                .map(gax::response::Response::into_body)
4839        }
4840
4841        /// Streams each page in the collection.
4842        pub fn by_page(
4843            self,
4844        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4845        {
4846            use std::clone::Clone;
4847            let token = self.0.request.page_token.clone();
4848            let execute = move |token: String| {
4849                let mut builder = self.clone();
4850                builder.0.request = builder.0.request.set_page_token(token);
4851                builder.send()
4852            };
4853            gax::paginator::internal::new_paginator(token, execute)
4854        }
4855
4856        /// Streams each item in the collection.
4857        pub fn by_item(
4858            self,
4859        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4860        {
4861            use gax::paginator::Paginator;
4862            self.by_page().items()
4863        }
4864
4865        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4866        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4867            self.0.request.name = v.into();
4868            self
4869        }
4870
4871        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4872        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4873            self.0.request.filter = v.into();
4874            self
4875        }
4876
4877        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4878        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4879            self.0.request.page_size = v.into();
4880            self
4881        }
4882
4883        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
4884        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4885            self.0.request.page_token = v.into();
4886            self
4887        }
4888    }
4889
4890    #[doc(hidden)]
4891    impl gax::options::internal::RequestBuilder for ListLocations {
4892        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4893            &mut self.0.options
4894        }
4895    }
4896
4897    /// The request builder for [DataMigrationService::get_location][crate::client::DataMigrationService::get_location] calls.
4898    ///
4899    /// # Example
4900    /// ```no_run
4901    /// # use google_cloud_clouddms_v1::builder;
4902    /// use builder::data_migration_service::GetLocation;
4903    /// # tokio_test::block_on(async {
4904    ///
4905    /// let builder = prepare_request_builder();
4906    /// let response = builder.send().await?;
4907    /// # gax::Result::<()>::Ok(()) });
4908    ///
4909    /// fn prepare_request_builder() -> GetLocation {
4910    ///   # panic!();
4911    ///   // ... details omitted ...
4912    /// }
4913    /// ```
4914    #[derive(Clone, Debug)]
4915    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4916
4917    impl GetLocation {
4918        pub(crate) fn new(
4919            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4920        ) -> Self {
4921            Self(RequestBuilder::new(stub))
4922        }
4923
4924        /// Sets the full request, replacing any prior values.
4925        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4926            self.0.request = v.into();
4927            self
4928        }
4929
4930        /// Sets all the options, replacing any prior values.
4931        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4932            self.0.options = v.into();
4933            self
4934        }
4935
4936        /// Sends the request.
4937        pub async fn send(self) -> Result<location::model::Location> {
4938            (*self.0.stub)
4939                .get_location(self.0.request, self.0.options)
4940                .await
4941                .map(gax::response::Response::into_body)
4942        }
4943
4944        /// Sets the value of [name][location::model::GetLocationRequest::name].
4945        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4946            self.0.request.name = v.into();
4947            self
4948        }
4949    }
4950
4951    #[doc(hidden)]
4952    impl gax::options::internal::RequestBuilder for GetLocation {
4953        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4954            &mut self.0.options
4955        }
4956    }
4957
4958    /// The request builder for [DataMigrationService::set_iam_policy][crate::client::DataMigrationService::set_iam_policy] calls.
4959    ///
4960    /// # Example
4961    /// ```no_run
4962    /// # use google_cloud_clouddms_v1::builder;
4963    /// use builder::data_migration_service::SetIamPolicy;
4964    /// # tokio_test::block_on(async {
4965    ///
4966    /// let builder = prepare_request_builder();
4967    /// let response = builder.send().await?;
4968    /// # gax::Result::<()>::Ok(()) });
4969    ///
4970    /// fn prepare_request_builder() -> SetIamPolicy {
4971    ///   # panic!();
4972    ///   // ... details omitted ...
4973    /// }
4974    /// ```
4975    #[derive(Clone, Debug)]
4976    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4977
4978    impl SetIamPolicy {
4979        pub(crate) fn new(
4980            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4981        ) -> Self {
4982            Self(RequestBuilder::new(stub))
4983        }
4984
4985        /// Sets the full request, replacing any prior values.
4986        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4987            self.0.request = v.into();
4988            self
4989        }
4990
4991        /// Sets all the options, replacing any prior values.
4992        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4993            self.0.options = v.into();
4994            self
4995        }
4996
4997        /// Sends the request.
4998        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4999            (*self.0.stub)
5000                .set_iam_policy(self.0.request, self.0.options)
5001                .await
5002                .map(gax::response::Response::into_body)
5003        }
5004
5005        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
5006        ///
5007        /// This is a **required** field for requests.
5008        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5009            self.0.request.resource = v.into();
5010            self
5011        }
5012
5013        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5014        ///
5015        /// This is a **required** field for requests.
5016        pub fn set_policy<T>(mut self, v: T) -> Self
5017        where
5018            T: std::convert::Into<iam_v1::model::Policy>,
5019        {
5020            self.0.request.policy = std::option::Option::Some(v.into());
5021            self
5022        }
5023
5024        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5025        ///
5026        /// This is a **required** field for requests.
5027        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5028        where
5029            T: std::convert::Into<iam_v1::model::Policy>,
5030        {
5031            self.0.request.policy = v.map(|x| x.into());
5032            self
5033        }
5034
5035        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5036        pub fn set_update_mask<T>(mut self, v: T) -> Self
5037        where
5038            T: std::convert::Into<wkt::FieldMask>,
5039        {
5040            self.0.request.update_mask = std::option::Option::Some(v.into());
5041            self
5042        }
5043
5044        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5045        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5046        where
5047            T: std::convert::Into<wkt::FieldMask>,
5048        {
5049            self.0.request.update_mask = v.map(|x| x.into());
5050            self
5051        }
5052    }
5053
5054    #[doc(hidden)]
5055    impl gax::options::internal::RequestBuilder for SetIamPolicy {
5056        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5057            &mut self.0.options
5058        }
5059    }
5060
5061    /// The request builder for [DataMigrationService::get_iam_policy][crate::client::DataMigrationService::get_iam_policy] calls.
5062    ///
5063    /// # Example
5064    /// ```no_run
5065    /// # use google_cloud_clouddms_v1::builder;
5066    /// use builder::data_migration_service::GetIamPolicy;
5067    /// # tokio_test::block_on(async {
5068    ///
5069    /// let builder = prepare_request_builder();
5070    /// let response = builder.send().await?;
5071    /// # gax::Result::<()>::Ok(()) });
5072    ///
5073    /// fn prepare_request_builder() -> GetIamPolicy {
5074    ///   # panic!();
5075    ///   // ... details omitted ...
5076    /// }
5077    /// ```
5078    #[derive(Clone, Debug)]
5079    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5080
5081    impl GetIamPolicy {
5082        pub(crate) fn new(
5083            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5084        ) -> Self {
5085            Self(RequestBuilder::new(stub))
5086        }
5087
5088        /// Sets the full request, replacing any prior values.
5089        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5090            self.0.request = v.into();
5091            self
5092        }
5093
5094        /// Sets all the options, replacing any prior values.
5095        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5096            self.0.options = v.into();
5097            self
5098        }
5099
5100        /// Sends the request.
5101        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5102            (*self.0.stub)
5103                .get_iam_policy(self.0.request, self.0.options)
5104                .await
5105                .map(gax::response::Response::into_body)
5106        }
5107
5108        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
5109        ///
5110        /// This is a **required** field for requests.
5111        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5112            self.0.request.resource = v.into();
5113            self
5114        }
5115
5116        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5117        pub fn set_options<T>(mut self, v: T) -> Self
5118        where
5119            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5120        {
5121            self.0.request.options = std::option::Option::Some(v.into());
5122            self
5123        }
5124
5125        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5126        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5127        where
5128            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5129        {
5130            self.0.request.options = v.map(|x| x.into());
5131            self
5132        }
5133    }
5134
5135    #[doc(hidden)]
5136    impl gax::options::internal::RequestBuilder for GetIamPolicy {
5137        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5138            &mut self.0.options
5139        }
5140    }
5141
5142    /// The request builder for [DataMigrationService::test_iam_permissions][crate::client::DataMigrationService::test_iam_permissions] calls.
5143    ///
5144    /// # Example
5145    /// ```no_run
5146    /// # use google_cloud_clouddms_v1::builder;
5147    /// use builder::data_migration_service::TestIamPermissions;
5148    /// # tokio_test::block_on(async {
5149    ///
5150    /// let builder = prepare_request_builder();
5151    /// let response = builder.send().await?;
5152    /// # gax::Result::<()>::Ok(()) });
5153    ///
5154    /// fn prepare_request_builder() -> TestIamPermissions {
5155    ///   # panic!();
5156    ///   // ... details omitted ...
5157    /// }
5158    /// ```
5159    #[derive(Clone, Debug)]
5160    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5161
5162    impl TestIamPermissions {
5163        pub(crate) fn new(
5164            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5165        ) -> Self {
5166            Self(RequestBuilder::new(stub))
5167        }
5168
5169        /// Sets the full request, replacing any prior values.
5170        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5171            mut self,
5172            v: V,
5173        ) -> Self {
5174            self.0.request = v.into();
5175            self
5176        }
5177
5178        /// Sets all the options, replacing any prior values.
5179        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5180            self.0.options = v.into();
5181            self
5182        }
5183
5184        /// Sends the request.
5185        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5186            (*self.0.stub)
5187                .test_iam_permissions(self.0.request, self.0.options)
5188                .await
5189                .map(gax::response::Response::into_body)
5190        }
5191
5192        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
5193        ///
5194        /// This is a **required** field for requests.
5195        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5196            self.0.request.resource = v.into();
5197            self
5198        }
5199
5200        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
5201        ///
5202        /// This is a **required** field for requests.
5203        pub fn set_permissions<T, V>(mut self, v: T) -> Self
5204        where
5205            T: std::iter::IntoIterator<Item = V>,
5206            V: std::convert::Into<std::string::String>,
5207        {
5208            use std::iter::Iterator;
5209            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5210            self
5211        }
5212    }
5213
5214    #[doc(hidden)]
5215    impl gax::options::internal::RequestBuilder for TestIamPermissions {
5216        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5217            &mut self.0.options
5218        }
5219    }
5220
5221    /// The request builder for [DataMigrationService::list_operations][crate::client::DataMigrationService::list_operations] calls.
5222    ///
5223    /// # Example
5224    /// ```no_run
5225    /// # use google_cloud_clouddms_v1::builder;
5226    /// use builder::data_migration_service::ListOperations;
5227    /// # tokio_test::block_on(async {
5228    /// use gax::paginator::ItemPaginator;
5229    ///
5230    /// let builder = prepare_request_builder();
5231    /// let mut items = builder.by_item();
5232    /// while let Some(result) = items.next().await {
5233    ///   let item = result?;
5234    /// }
5235    /// # gax::Result::<()>::Ok(()) });
5236    ///
5237    /// fn prepare_request_builder() -> ListOperations {
5238    ///   # panic!();
5239    ///   // ... details omitted ...
5240    /// }
5241    /// ```
5242    #[derive(Clone, Debug)]
5243    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5244
5245    impl ListOperations {
5246        pub(crate) fn new(
5247            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5248        ) -> Self {
5249            Self(RequestBuilder::new(stub))
5250        }
5251
5252        /// Sets the full request, replacing any prior values.
5253        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5254            mut self,
5255            v: V,
5256        ) -> Self {
5257            self.0.request = v.into();
5258            self
5259        }
5260
5261        /// Sets all the options, replacing any prior values.
5262        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5263            self.0.options = v.into();
5264            self
5265        }
5266
5267        /// Sends the request.
5268        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5269            (*self.0.stub)
5270                .list_operations(self.0.request, self.0.options)
5271                .await
5272                .map(gax::response::Response::into_body)
5273        }
5274
5275        /// Streams each page in the collection.
5276        pub fn by_page(
5277            self,
5278        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5279        {
5280            use std::clone::Clone;
5281            let token = self.0.request.page_token.clone();
5282            let execute = move |token: String| {
5283                let mut builder = self.clone();
5284                builder.0.request = builder.0.request.set_page_token(token);
5285                builder.send()
5286            };
5287            gax::paginator::internal::new_paginator(token, execute)
5288        }
5289
5290        /// Streams each item in the collection.
5291        pub fn by_item(
5292            self,
5293        ) -> impl gax::paginator::ItemPaginator<
5294            longrunning::model::ListOperationsResponse,
5295            gax::error::Error,
5296        > {
5297            use gax::paginator::Paginator;
5298            self.by_page().items()
5299        }
5300
5301        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
5302        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5303            self.0.request.name = v.into();
5304            self
5305        }
5306
5307        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
5308        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5309            self.0.request.filter = v.into();
5310            self
5311        }
5312
5313        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
5314        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5315            self.0.request.page_size = v.into();
5316            self
5317        }
5318
5319        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
5320        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5321            self.0.request.page_token = v.into();
5322            self
5323        }
5324
5325        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
5326        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5327            self.0.request.return_partial_success = v.into();
5328            self
5329        }
5330    }
5331
5332    #[doc(hidden)]
5333    impl gax::options::internal::RequestBuilder for ListOperations {
5334        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5335            &mut self.0.options
5336        }
5337    }
5338
5339    /// The request builder for [DataMigrationService::get_operation][crate::client::DataMigrationService::get_operation] calls.
5340    ///
5341    /// # Example
5342    /// ```no_run
5343    /// # use google_cloud_clouddms_v1::builder;
5344    /// use builder::data_migration_service::GetOperation;
5345    /// # tokio_test::block_on(async {
5346    ///
5347    /// let builder = prepare_request_builder();
5348    /// let response = builder.send().await?;
5349    /// # gax::Result::<()>::Ok(()) });
5350    ///
5351    /// fn prepare_request_builder() -> GetOperation {
5352    ///   # panic!();
5353    ///   // ... details omitted ...
5354    /// }
5355    /// ```
5356    #[derive(Clone, Debug)]
5357    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5358
5359    impl GetOperation {
5360        pub(crate) fn new(
5361            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5362        ) -> Self {
5363            Self(RequestBuilder::new(stub))
5364        }
5365
5366        /// Sets the full request, replacing any prior values.
5367        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5368            mut self,
5369            v: V,
5370        ) -> Self {
5371            self.0.request = v.into();
5372            self
5373        }
5374
5375        /// Sets all the options, replacing any prior values.
5376        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5377            self.0.options = v.into();
5378            self
5379        }
5380
5381        /// Sends the request.
5382        pub async fn send(self) -> Result<longrunning::model::Operation> {
5383            (*self.0.stub)
5384                .get_operation(self.0.request, self.0.options)
5385                .await
5386                .map(gax::response::Response::into_body)
5387        }
5388
5389        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
5390        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5391            self.0.request.name = v.into();
5392            self
5393        }
5394    }
5395
5396    #[doc(hidden)]
5397    impl gax::options::internal::RequestBuilder for GetOperation {
5398        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5399            &mut self.0.options
5400        }
5401    }
5402
5403    /// The request builder for [DataMigrationService::delete_operation][crate::client::DataMigrationService::delete_operation] calls.
5404    ///
5405    /// # Example
5406    /// ```no_run
5407    /// # use google_cloud_clouddms_v1::builder;
5408    /// use builder::data_migration_service::DeleteOperation;
5409    /// # tokio_test::block_on(async {
5410    ///
5411    /// let builder = prepare_request_builder();
5412    /// let response = builder.send().await?;
5413    /// # gax::Result::<()>::Ok(()) });
5414    ///
5415    /// fn prepare_request_builder() -> DeleteOperation {
5416    ///   # panic!();
5417    ///   // ... details omitted ...
5418    /// }
5419    /// ```
5420    #[derive(Clone, Debug)]
5421    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5422
5423    impl DeleteOperation {
5424        pub(crate) fn new(
5425            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5426        ) -> Self {
5427            Self(RequestBuilder::new(stub))
5428        }
5429
5430        /// Sets the full request, replacing any prior values.
5431        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5432            mut self,
5433            v: V,
5434        ) -> Self {
5435            self.0.request = v.into();
5436            self
5437        }
5438
5439        /// Sets all the options, replacing any prior values.
5440        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5441            self.0.options = v.into();
5442            self
5443        }
5444
5445        /// Sends the request.
5446        pub async fn send(self) -> Result<()> {
5447            (*self.0.stub)
5448                .delete_operation(self.0.request, self.0.options)
5449                .await
5450                .map(gax::response::Response::into_body)
5451        }
5452
5453        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
5454        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5455            self.0.request.name = v.into();
5456            self
5457        }
5458    }
5459
5460    #[doc(hidden)]
5461    impl gax::options::internal::RequestBuilder for DeleteOperation {
5462        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5463            &mut self.0.options
5464        }
5465    }
5466
5467    /// The request builder for [DataMigrationService::cancel_operation][crate::client::DataMigrationService::cancel_operation] calls.
5468    ///
5469    /// # Example
5470    /// ```no_run
5471    /// # use google_cloud_clouddms_v1::builder;
5472    /// use builder::data_migration_service::CancelOperation;
5473    /// # tokio_test::block_on(async {
5474    ///
5475    /// let builder = prepare_request_builder();
5476    /// let response = builder.send().await?;
5477    /// # gax::Result::<()>::Ok(()) });
5478    ///
5479    /// fn prepare_request_builder() -> CancelOperation {
5480    ///   # panic!();
5481    ///   // ... details omitted ...
5482    /// }
5483    /// ```
5484    #[derive(Clone, Debug)]
5485    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5486
5487    impl CancelOperation {
5488        pub(crate) fn new(
5489            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5490        ) -> Self {
5491            Self(RequestBuilder::new(stub))
5492        }
5493
5494        /// Sets the full request, replacing any prior values.
5495        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5496            mut self,
5497            v: V,
5498        ) -> Self {
5499            self.0.request = v.into();
5500            self
5501        }
5502
5503        /// Sets all the options, replacing any prior values.
5504        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5505            self.0.options = v.into();
5506            self
5507        }
5508
5509        /// Sends the request.
5510        pub async fn send(self) -> Result<()> {
5511            (*self.0.stub)
5512                .cancel_operation(self.0.request, self.0.options)
5513                .await
5514                .map(gax::response::Response::into_body)
5515        }
5516
5517        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
5518        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5519            self.0.request.name = v.into();
5520            self
5521        }
5522    }
5523
5524    #[doc(hidden)]
5525    impl gax::options::internal::RequestBuilder for CancelOperation {
5526        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5527            &mut self.0.options
5528        }
5529    }
5530}