Skip to main content

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