Skip to main content

google_cloud_vmmigration_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
17/// Request and client builders for [VmMigration][crate::client::VmMigration].
18pub mod vm_migration {
19    use crate::Result;
20
21    /// A builder for [VmMigration][crate::client::VmMigration].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_vmmigration_v1::*;
26    /// # use builder::vm_migration::ClientBuilder;
27    /// # use client::VmMigration;
28    /// let builder : ClientBuilder = VmMigration::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://vmmigration.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::VmMigration;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = VmMigration;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::VmMigration] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [VmMigration::list_sources][crate::client::VmMigration::list_sources] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListSources;
79    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListSources {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListSources(RequestBuilder<crate::model::ListSourcesRequest>);
96
97    impl ListSources {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListSourcesRequest>>(mut self, v: V) -> Self {
106            self.0.request = v.into();
107            self
108        }
109
110        /// Sets all the options, replacing any prior values.
111        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112            self.0.options = v.into();
113            self
114        }
115
116        /// Sends the request.
117        pub async fn send(self) -> Result<crate::model::ListSourcesResponse> {
118            (*self.0.stub)
119                .list_sources(self.0.request, self.0.options)
120                .await
121                .map(crate::Response::into_body)
122        }
123
124        /// Streams each page in the collection.
125        pub fn by_page(
126            self,
127        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSourcesResponse, crate::Error>
128        {
129            use std::clone::Clone;
130            let token = self.0.request.page_token.clone();
131            let execute = move |token: String| {
132                let mut builder = self.clone();
133                builder.0.request = builder.0.request.set_page_token(token);
134                builder.send()
135            };
136            google_cloud_gax::paginator::internal::new_paginator(token, execute)
137        }
138
139        /// Streams each item in the collection.
140        pub fn by_item(
141            self,
142        ) -> impl google_cloud_gax::paginator::ItemPaginator<
143            crate::model::ListSourcesResponse,
144            crate::Error,
145        > {
146            use google_cloud_gax::paginator::Paginator;
147            self.by_page().items()
148        }
149
150        /// Sets the value of [parent][crate::model::ListSourcesRequest::parent].
151        ///
152        /// This is a **required** field for requests.
153        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154            self.0.request.parent = v.into();
155            self
156        }
157
158        /// Sets the value of [page_size][crate::model::ListSourcesRequest::page_size].
159        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160            self.0.request.page_size = v.into();
161            self
162        }
163
164        /// Sets the value of [page_token][crate::model::ListSourcesRequest::page_token].
165        ///
166        /// This is a **required** field for requests.
167        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
168            self.0.request.page_token = v.into();
169            self
170        }
171
172        /// Sets the value of [filter][crate::model::ListSourcesRequest::filter].
173        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
174            self.0.request.filter = v.into();
175            self
176        }
177
178        /// Sets the value of [order_by][crate::model::ListSourcesRequest::order_by].
179        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
180            self.0.request.order_by = v.into();
181            self
182        }
183    }
184
185    #[doc(hidden)]
186    impl crate::RequestBuilder for ListSources {
187        fn request_options(&mut self) -> &mut crate::RequestOptions {
188            &mut self.0.options
189        }
190    }
191
192    /// The request builder for [VmMigration::get_source][crate::client::VmMigration::get_source] calls.
193    ///
194    /// # Example
195    /// ```
196    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetSource;
197    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
198    ///
199    /// let builder = prepare_request_builder();
200    /// let response = builder.send().await?;
201    /// # Ok(()) }
202    ///
203    /// fn prepare_request_builder() -> GetSource {
204    ///   # panic!();
205    ///   // ... details omitted ...
206    /// }
207    /// ```
208    #[derive(Clone, Debug)]
209    pub struct GetSource(RequestBuilder<crate::model::GetSourceRequest>);
210
211    impl GetSource {
212        pub(crate) fn new(
213            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
214        ) -> Self {
215            Self(RequestBuilder::new(stub))
216        }
217
218        /// Sets the full request, replacing any prior values.
219        pub fn with_request<V: Into<crate::model::GetSourceRequest>>(mut self, v: V) -> Self {
220            self.0.request = v.into();
221            self
222        }
223
224        /// Sets all the options, replacing any prior values.
225        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
226            self.0.options = v.into();
227            self
228        }
229
230        /// Sends the request.
231        pub async fn send(self) -> Result<crate::model::Source> {
232            (*self.0.stub)
233                .get_source(self.0.request, self.0.options)
234                .await
235                .map(crate::Response::into_body)
236        }
237
238        /// Sets the value of [name][crate::model::GetSourceRequest::name].
239        ///
240        /// This is a **required** field for requests.
241        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
242            self.0.request.name = v.into();
243            self
244        }
245    }
246
247    #[doc(hidden)]
248    impl crate::RequestBuilder for GetSource {
249        fn request_options(&mut self) -> &mut crate::RequestOptions {
250            &mut self.0.options
251        }
252    }
253
254    /// The request builder for [VmMigration::create_source][crate::client::VmMigration::create_source] calls.
255    ///
256    /// # Example
257    /// ```
258    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateSource;
259    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
260    /// use google_cloud_lro::Poller;
261    ///
262    /// let builder = prepare_request_builder();
263    /// let response = builder.poller().until_done().await?;
264    /// # Ok(()) }
265    ///
266    /// fn prepare_request_builder() -> CreateSource {
267    ///   # panic!();
268    ///   // ... details omitted ...
269    /// }
270    /// ```
271    #[derive(Clone, Debug)]
272    pub struct CreateSource(RequestBuilder<crate::model::CreateSourceRequest>);
273
274    impl CreateSource {
275        pub(crate) fn new(
276            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
277        ) -> Self {
278            Self(RequestBuilder::new(stub))
279        }
280
281        /// Sets the full request, replacing any prior values.
282        pub fn with_request<V: Into<crate::model::CreateSourceRequest>>(mut self, v: V) -> Self {
283            self.0.request = v.into();
284            self
285        }
286
287        /// Sets all the options, replacing any prior values.
288        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
289            self.0.options = v.into();
290            self
291        }
292
293        /// Sends the request.
294        ///
295        /// # Long running operations
296        ///
297        /// This starts, but does not poll, a longrunning operation. More information
298        /// on [create_source][crate::client::VmMigration::create_source].
299        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
300            (*self.0.stub)
301                .create_source(self.0.request, self.0.options)
302                .await
303                .map(crate::Response::into_body)
304        }
305
306        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_source`.
307        pub fn poller(
308            self,
309        ) -> impl google_cloud_lro::Poller<crate::model::Source, crate::model::OperationMetadata>
310        {
311            type Operation = google_cloud_lro::internal::Operation<
312                crate::model::Source,
313                crate::model::OperationMetadata,
314            >;
315            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
316            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
317
318            let stub = self.0.stub.clone();
319            let mut options = self.0.options.clone();
320            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
321            let query = move |name| {
322                let stub = stub.clone();
323                let options = options.clone();
324                async {
325                    let op = GetOperation::new(stub)
326                        .set_name(name)
327                        .with_options(options)
328                        .send()
329                        .await?;
330                    Ok(Operation::new(op))
331                }
332            };
333
334            let start = move || async {
335                let op = self.send().await?;
336                Ok(Operation::new(op))
337            };
338
339            google_cloud_lro::internal::new_poller(
340                polling_error_policy,
341                polling_backoff_policy,
342                start,
343                query,
344            )
345        }
346
347        /// Sets the value of [parent][crate::model::CreateSourceRequest::parent].
348        ///
349        /// This is a **required** field for requests.
350        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
351            self.0.request.parent = v.into();
352            self
353        }
354
355        /// Sets the value of [source_id][crate::model::CreateSourceRequest::source_id].
356        ///
357        /// This is a **required** field for requests.
358        pub fn set_source_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
359            self.0.request.source_id = v.into();
360            self
361        }
362
363        /// Sets the value of [source][crate::model::CreateSourceRequest::source].
364        ///
365        /// This is a **required** field for requests.
366        pub fn set_source<T>(mut self, v: T) -> Self
367        where
368            T: std::convert::Into<crate::model::Source>,
369        {
370            self.0.request.source = std::option::Option::Some(v.into());
371            self
372        }
373
374        /// Sets or clears the value of [source][crate::model::CreateSourceRequest::source].
375        ///
376        /// This is a **required** field for requests.
377        pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
378        where
379            T: std::convert::Into<crate::model::Source>,
380        {
381            self.0.request.source = v.map(|x| x.into());
382            self
383        }
384
385        /// Sets the value of [request_id][crate::model::CreateSourceRequest::request_id].
386        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
387            self.0.request.request_id = v.into();
388            self
389        }
390    }
391
392    #[doc(hidden)]
393    impl crate::RequestBuilder for CreateSource {
394        fn request_options(&mut self) -> &mut crate::RequestOptions {
395            &mut self.0.options
396        }
397    }
398
399    /// The request builder for [VmMigration::update_source][crate::client::VmMigration::update_source] calls.
400    ///
401    /// # Example
402    /// ```
403    /// # use google_cloud_vmmigration_v1::builder::vm_migration::UpdateSource;
404    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
405    /// use google_cloud_lro::Poller;
406    ///
407    /// let builder = prepare_request_builder();
408    /// let response = builder.poller().until_done().await?;
409    /// # Ok(()) }
410    ///
411    /// fn prepare_request_builder() -> UpdateSource {
412    ///   # panic!();
413    ///   // ... details omitted ...
414    /// }
415    /// ```
416    #[derive(Clone, Debug)]
417    pub struct UpdateSource(RequestBuilder<crate::model::UpdateSourceRequest>);
418
419    impl UpdateSource {
420        pub(crate) fn new(
421            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
422        ) -> Self {
423            Self(RequestBuilder::new(stub))
424        }
425
426        /// Sets the full request, replacing any prior values.
427        pub fn with_request<V: Into<crate::model::UpdateSourceRequest>>(mut self, v: V) -> Self {
428            self.0.request = v.into();
429            self
430        }
431
432        /// Sets all the options, replacing any prior values.
433        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
434            self.0.options = v.into();
435            self
436        }
437
438        /// Sends the request.
439        ///
440        /// # Long running operations
441        ///
442        /// This starts, but does not poll, a longrunning operation. More information
443        /// on [update_source][crate::client::VmMigration::update_source].
444        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
445            (*self.0.stub)
446                .update_source(self.0.request, self.0.options)
447                .await
448                .map(crate::Response::into_body)
449        }
450
451        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_source`.
452        pub fn poller(
453            self,
454        ) -> impl google_cloud_lro::Poller<crate::model::Source, crate::model::OperationMetadata>
455        {
456            type Operation = google_cloud_lro::internal::Operation<
457                crate::model::Source,
458                crate::model::OperationMetadata,
459            >;
460            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
461            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
462
463            let stub = self.0.stub.clone();
464            let mut options = self.0.options.clone();
465            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
466            let query = move |name| {
467                let stub = stub.clone();
468                let options = options.clone();
469                async {
470                    let op = GetOperation::new(stub)
471                        .set_name(name)
472                        .with_options(options)
473                        .send()
474                        .await?;
475                    Ok(Operation::new(op))
476                }
477            };
478
479            let start = move || async {
480                let op = self.send().await?;
481                Ok(Operation::new(op))
482            };
483
484            google_cloud_lro::internal::new_poller(
485                polling_error_policy,
486                polling_backoff_policy,
487                start,
488                query,
489            )
490        }
491
492        /// Sets the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
493        pub fn set_update_mask<T>(mut self, v: T) -> Self
494        where
495            T: std::convert::Into<wkt::FieldMask>,
496        {
497            self.0.request.update_mask = std::option::Option::Some(v.into());
498            self
499        }
500
501        /// Sets or clears the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
502        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
503        where
504            T: std::convert::Into<wkt::FieldMask>,
505        {
506            self.0.request.update_mask = v.map(|x| x.into());
507            self
508        }
509
510        /// Sets the value of [source][crate::model::UpdateSourceRequest::source].
511        ///
512        /// This is a **required** field for requests.
513        pub fn set_source<T>(mut self, v: T) -> Self
514        where
515            T: std::convert::Into<crate::model::Source>,
516        {
517            self.0.request.source = std::option::Option::Some(v.into());
518            self
519        }
520
521        /// Sets or clears the value of [source][crate::model::UpdateSourceRequest::source].
522        ///
523        /// This is a **required** field for requests.
524        pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
525        where
526            T: std::convert::Into<crate::model::Source>,
527        {
528            self.0.request.source = v.map(|x| x.into());
529            self
530        }
531
532        /// Sets the value of [request_id][crate::model::UpdateSourceRequest::request_id].
533        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
534            self.0.request.request_id = v.into();
535            self
536        }
537    }
538
539    #[doc(hidden)]
540    impl crate::RequestBuilder for UpdateSource {
541        fn request_options(&mut self) -> &mut crate::RequestOptions {
542            &mut self.0.options
543        }
544    }
545
546    /// The request builder for [VmMigration::delete_source][crate::client::VmMigration::delete_source] calls.
547    ///
548    /// # Example
549    /// ```
550    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteSource;
551    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
552    /// use google_cloud_lro::Poller;
553    ///
554    /// let builder = prepare_request_builder();
555    /// let response = builder.poller().until_done().await?;
556    /// # Ok(()) }
557    ///
558    /// fn prepare_request_builder() -> DeleteSource {
559    ///   # panic!();
560    ///   // ... details omitted ...
561    /// }
562    /// ```
563    #[derive(Clone, Debug)]
564    pub struct DeleteSource(RequestBuilder<crate::model::DeleteSourceRequest>);
565
566    impl DeleteSource {
567        pub(crate) fn new(
568            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
569        ) -> Self {
570            Self(RequestBuilder::new(stub))
571        }
572
573        /// Sets the full request, replacing any prior values.
574        pub fn with_request<V: Into<crate::model::DeleteSourceRequest>>(mut self, v: V) -> Self {
575            self.0.request = v.into();
576            self
577        }
578
579        /// Sets all the options, replacing any prior values.
580        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
581            self.0.options = v.into();
582            self
583        }
584
585        /// Sends the request.
586        ///
587        /// # Long running operations
588        ///
589        /// This starts, but does not poll, a longrunning operation. More information
590        /// on [delete_source][crate::client::VmMigration::delete_source].
591        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
592            (*self.0.stub)
593                .delete_source(self.0.request, self.0.options)
594                .await
595                .map(crate::Response::into_body)
596        }
597
598        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_source`.
599        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
600            type Operation =
601                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
602            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
603            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
604
605            let stub = self.0.stub.clone();
606            let mut options = self.0.options.clone();
607            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
608            let query = move |name| {
609                let stub = stub.clone();
610                let options = options.clone();
611                async {
612                    let op = GetOperation::new(stub)
613                        .set_name(name)
614                        .with_options(options)
615                        .send()
616                        .await?;
617                    Ok(Operation::new(op))
618                }
619            };
620
621            let start = move || async {
622                let op = self.send().await?;
623                Ok(Operation::new(op))
624            };
625
626            google_cloud_lro::internal::new_unit_response_poller(
627                polling_error_policy,
628                polling_backoff_policy,
629                start,
630                query,
631            )
632        }
633
634        /// Sets the value of [name][crate::model::DeleteSourceRequest::name].
635        ///
636        /// This is a **required** field for requests.
637        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
638            self.0.request.name = v.into();
639            self
640        }
641
642        /// Sets the value of [request_id][crate::model::DeleteSourceRequest::request_id].
643        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
644            self.0.request.request_id = v.into();
645            self
646        }
647    }
648
649    #[doc(hidden)]
650    impl crate::RequestBuilder for DeleteSource {
651        fn request_options(&mut self) -> &mut crate::RequestOptions {
652            &mut self.0.options
653        }
654    }
655
656    /// The request builder for [VmMigration::fetch_inventory][crate::client::VmMigration::fetch_inventory] calls.
657    ///
658    /// # Example
659    /// ```
660    /// # use google_cloud_vmmigration_v1::builder::vm_migration::FetchInventory;
661    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
662    ///
663    /// let builder = prepare_request_builder();
664    /// let response = builder.send().await?;
665    /// # Ok(()) }
666    ///
667    /// fn prepare_request_builder() -> FetchInventory {
668    ///   # panic!();
669    ///   // ... details omitted ...
670    /// }
671    /// ```
672    #[derive(Clone, Debug)]
673    pub struct FetchInventory(RequestBuilder<crate::model::FetchInventoryRequest>);
674
675    impl FetchInventory {
676        pub(crate) fn new(
677            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
678        ) -> Self {
679            Self(RequestBuilder::new(stub))
680        }
681
682        /// Sets the full request, replacing any prior values.
683        pub fn with_request<V: Into<crate::model::FetchInventoryRequest>>(mut self, v: V) -> Self {
684            self.0.request = v.into();
685            self
686        }
687
688        /// Sets all the options, replacing any prior values.
689        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
690            self.0.options = v.into();
691            self
692        }
693
694        /// Sends the request.
695        pub async fn send(self) -> Result<crate::model::FetchInventoryResponse> {
696            (*self.0.stub)
697                .fetch_inventory(self.0.request, self.0.options)
698                .await
699                .map(crate::Response::into_body)
700        }
701
702        /// Sets the value of [source][crate::model::FetchInventoryRequest::source].
703        ///
704        /// This is a **required** field for requests.
705        pub fn set_source<T: Into<std::string::String>>(mut self, v: T) -> Self {
706            self.0.request.source = v.into();
707            self
708        }
709
710        /// Sets the value of [force_refresh][crate::model::FetchInventoryRequest::force_refresh].
711        pub fn set_force_refresh<T: Into<bool>>(mut self, v: T) -> Self {
712            self.0.request.force_refresh = v.into();
713            self
714        }
715    }
716
717    #[doc(hidden)]
718    impl crate::RequestBuilder for FetchInventory {
719        fn request_options(&mut self) -> &mut crate::RequestOptions {
720            &mut self.0.options
721        }
722    }
723
724    /// The request builder for [VmMigration::fetch_storage_inventory][crate::client::VmMigration::fetch_storage_inventory] calls.
725    ///
726    /// # Example
727    /// ```
728    /// # use google_cloud_vmmigration_v1::builder::vm_migration::FetchStorageInventory;
729    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
730    /// use google_cloud_gax::paginator::ItemPaginator;
731    ///
732    /// let builder = prepare_request_builder();
733    /// let mut items = builder.by_item();
734    /// while let Some(result) = items.next().await {
735    ///   let item = result?;
736    /// }
737    /// # Ok(()) }
738    ///
739    /// fn prepare_request_builder() -> FetchStorageInventory {
740    ///   # panic!();
741    ///   // ... details omitted ...
742    /// }
743    /// ```
744    #[derive(Clone, Debug)]
745    pub struct FetchStorageInventory(RequestBuilder<crate::model::FetchStorageInventoryRequest>);
746
747    impl FetchStorageInventory {
748        pub(crate) fn new(
749            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
750        ) -> Self {
751            Self(RequestBuilder::new(stub))
752        }
753
754        /// Sets the full request, replacing any prior values.
755        pub fn with_request<V: Into<crate::model::FetchStorageInventoryRequest>>(
756            mut self,
757            v: V,
758        ) -> Self {
759            self.0.request = v.into();
760            self
761        }
762
763        /// Sets all the options, replacing any prior values.
764        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
765            self.0.options = v.into();
766            self
767        }
768
769        /// Sends the request.
770        pub async fn send(self) -> Result<crate::model::FetchStorageInventoryResponse> {
771            (*self.0.stub)
772                .fetch_storage_inventory(self.0.request, self.0.options)
773                .await
774                .map(crate::Response::into_body)
775        }
776
777        /// Streams each page in the collection.
778        pub fn by_page(
779            self,
780        ) -> impl google_cloud_gax::paginator::Paginator<
781            crate::model::FetchStorageInventoryResponse,
782            crate::Error,
783        > {
784            use std::clone::Clone;
785            let token = self.0.request.page_token.clone();
786            let execute = move |token: String| {
787                let mut builder = self.clone();
788                builder.0.request = builder.0.request.set_page_token(token);
789                builder.send()
790            };
791            google_cloud_gax::paginator::internal::new_paginator(token, execute)
792        }
793
794        /// Streams each item in the collection.
795        pub fn by_item(
796            self,
797        ) -> impl google_cloud_gax::paginator::ItemPaginator<
798            crate::model::FetchStorageInventoryResponse,
799            crate::Error,
800        > {
801            use google_cloud_gax::paginator::Paginator;
802            self.by_page().items()
803        }
804
805        /// Sets the value of [source][crate::model::FetchStorageInventoryRequest::source].
806        ///
807        /// This is a **required** field for requests.
808        pub fn set_source<T: Into<std::string::String>>(mut self, v: T) -> Self {
809            self.0.request.source = v.into();
810            self
811        }
812
813        /// Sets the value of [r#type][crate::model::FetchStorageInventoryRequest::type].
814        ///
815        /// This is a **required** field for requests.
816        pub fn set_type<T: Into<crate::model::fetch_storage_inventory_request::StorageType>>(
817            mut self,
818            v: T,
819        ) -> Self {
820            self.0.request.r#type = v.into();
821            self
822        }
823
824        /// Sets the value of [force_refresh][crate::model::FetchStorageInventoryRequest::force_refresh].
825        pub fn set_force_refresh<T: Into<bool>>(mut self, v: T) -> Self {
826            self.0.request.force_refresh = v.into();
827            self
828        }
829
830        /// Sets the value of [page_size][crate::model::FetchStorageInventoryRequest::page_size].
831        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
832            self.0.request.page_size = v.into();
833            self
834        }
835
836        /// Sets the value of [page_token][crate::model::FetchStorageInventoryRequest::page_token].
837        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
838            self.0.request.page_token = v.into();
839            self
840        }
841    }
842
843    #[doc(hidden)]
844    impl crate::RequestBuilder for FetchStorageInventory {
845        fn request_options(&mut self) -> &mut crate::RequestOptions {
846            &mut self.0.options
847        }
848    }
849
850    /// The request builder for [VmMigration::list_utilization_reports][crate::client::VmMigration::list_utilization_reports] calls.
851    ///
852    /// # Example
853    /// ```
854    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListUtilizationReports;
855    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
856    /// use google_cloud_gax::paginator::ItemPaginator;
857    ///
858    /// let builder = prepare_request_builder();
859    /// let mut items = builder.by_item();
860    /// while let Some(result) = items.next().await {
861    ///   let item = result?;
862    /// }
863    /// # Ok(()) }
864    ///
865    /// fn prepare_request_builder() -> ListUtilizationReports {
866    ///   # panic!();
867    ///   // ... details omitted ...
868    /// }
869    /// ```
870    #[derive(Clone, Debug)]
871    pub struct ListUtilizationReports(RequestBuilder<crate::model::ListUtilizationReportsRequest>);
872
873    impl ListUtilizationReports {
874        pub(crate) fn new(
875            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
876        ) -> Self {
877            Self(RequestBuilder::new(stub))
878        }
879
880        /// Sets the full request, replacing any prior values.
881        pub fn with_request<V: Into<crate::model::ListUtilizationReportsRequest>>(
882            mut self,
883            v: V,
884        ) -> Self {
885            self.0.request = v.into();
886            self
887        }
888
889        /// Sets all the options, replacing any prior values.
890        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
891            self.0.options = v.into();
892            self
893        }
894
895        /// Sends the request.
896        pub async fn send(self) -> Result<crate::model::ListUtilizationReportsResponse> {
897            (*self.0.stub)
898                .list_utilization_reports(self.0.request, self.0.options)
899                .await
900                .map(crate::Response::into_body)
901        }
902
903        /// Streams each page in the collection.
904        pub fn by_page(
905            self,
906        ) -> impl google_cloud_gax::paginator::Paginator<
907            crate::model::ListUtilizationReportsResponse,
908            crate::Error,
909        > {
910            use std::clone::Clone;
911            let token = self.0.request.page_token.clone();
912            let execute = move |token: String| {
913                let mut builder = self.clone();
914                builder.0.request = builder.0.request.set_page_token(token);
915                builder.send()
916            };
917            google_cloud_gax::paginator::internal::new_paginator(token, execute)
918        }
919
920        /// Streams each item in the collection.
921        pub fn by_item(
922            self,
923        ) -> impl google_cloud_gax::paginator::ItemPaginator<
924            crate::model::ListUtilizationReportsResponse,
925            crate::Error,
926        > {
927            use google_cloud_gax::paginator::Paginator;
928            self.by_page().items()
929        }
930
931        /// Sets the value of [parent][crate::model::ListUtilizationReportsRequest::parent].
932        ///
933        /// This is a **required** field for requests.
934        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
935            self.0.request.parent = v.into();
936            self
937        }
938
939        /// Sets the value of [view][crate::model::ListUtilizationReportsRequest::view].
940        pub fn set_view<T: Into<crate::model::UtilizationReportView>>(mut self, v: T) -> Self {
941            self.0.request.view = v.into();
942            self
943        }
944
945        /// Sets the value of [page_size][crate::model::ListUtilizationReportsRequest::page_size].
946        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
947            self.0.request.page_size = v.into();
948            self
949        }
950
951        /// Sets the value of [page_token][crate::model::ListUtilizationReportsRequest::page_token].
952        ///
953        /// This is a **required** field for requests.
954        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
955            self.0.request.page_token = v.into();
956            self
957        }
958
959        /// Sets the value of [filter][crate::model::ListUtilizationReportsRequest::filter].
960        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
961            self.0.request.filter = v.into();
962            self
963        }
964
965        /// Sets the value of [order_by][crate::model::ListUtilizationReportsRequest::order_by].
966        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
967            self.0.request.order_by = v.into();
968            self
969        }
970    }
971
972    #[doc(hidden)]
973    impl crate::RequestBuilder for ListUtilizationReports {
974        fn request_options(&mut self) -> &mut crate::RequestOptions {
975            &mut self.0.options
976        }
977    }
978
979    /// The request builder for [VmMigration::get_utilization_report][crate::client::VmMigration::get_utilization_report] calls.
980    ///
981    /// # Example
982    /// ```
983    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetUtilizationReport;
984    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
985    ///
986    /// let builder = prepare_request_builder();
987    /// let response = builder.send().await?;
988    /// # Ok(()) }
989    ///
990    /// fn prepare_request_builder() -> GetUtilizationReport {
991    ///   # panic!();
992    ///   // ... details omitted ...
993    /// }
994    /// ```
995    #[derive(Clone, Debug)]
996    pub struct GetUtilizationReport(RequestBuilder<crate::model::GetUtilizationReportRequest>);
997
998    impl GetUtilizationReport {
999        pub(crate) fn new(
1000            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1001        ) -> Self {
1002            Self(RequestBuilder::new(stub))
1003        }
1004
1005        /// Sets the full request, replacing any prior values.
1006        pub fn with_request<V: Into<crate::model::GetUtilizationReportRequest>>(
1007            mut self,
1008            v: V,
1009        ) -> Self {
1010            self.0.request = v.into();
1011            self
1012        }
1013
1014        /// Sets all the options, replacing any prior values.
1015        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1016            self.0.options = v.into();
1017            self
1018        }
1019
1020        /// Sends the request.
1021        pub async fn send(self) -> Result<crate::model::UtilizationReport> {
1022            (*self.0.stub)
1023                .get_utilization_report(self.0.request, self.0.options)
1024                .await
1025                .map(crate::Response::into_body)
1026        }
1027
1028        /// Sets the value of [name][crate::model::GetUtilizationReportRequest::name].
1029        ///
1030        /// This is a **required** field for requests.
1031        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032            self.0.request.name = v.into();
1033            self
1034        }
1035
1036        /// Sets the value of [view][crate::model::GetUtilizationReportRequest::view].
1037        pub fn set_view<T: Into<crate::model::UtilizationReportView>>(mut self, v: T) -> Self {
1038            self.0.request.view = v.into();
1039            self
1040        }
1041    }
1042
1043    #[doc(hidden)]
1044    impl crate::RequestBuilder for GetUtilizationReport {
1045        fn request_options(&mut self) -> &mut crate::RequestOptions {
1046            &mut self.0.options
1047        }
1048    }
1049
1050    /// The request builder for [VmMigration::create_utilization_report][crate::client::VmMigration::create_utilization_report] calls.
1051    ///
1052    /// # Example
1053    /// ```
1054    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateUtilizationReport;
1055    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
1056    /// use google_cloud_lro::Poller;
1057    ///
1058    /// let builder = prepare_request_builder();
1059    /// let response = builder.poller().until_done().await?;
1060    /// # Ok(()) }
1061    ///
1062    /// fn prepare_request_builder() -> CreateUtilizationReport {
1063    ///   # panic!();
1064    ///   // ... details omitted ...
1065    /// }
1066    /// ```
1067    #[derive(Clone, Debug)]
1068    pub struct CreateUtilizationReport(
1069        RequestBuilder<crate::model::CreateUtilizationReportRequest>,
1070    );
1071
1072    impl CreateUtilizationReport {
1073        pub(crate) fn new(
1074            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1075        ) -> Self {
1076            Self(RequestBuilder::new(stub))
1077        }
1078
1079        /// Sets the full request, replacing any prior values.
1080        pub fn with_request<V: Into<crate::model::CreateUtilizationReportRequest>>(
1081            mut self,
1082            v: V,
1083        ) -> Self {
1084            self.0.request = v.into();
1085            self
1086        }
1087
1088        /// Sets all the options, replacing any prior values.
1089        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1090            self.0.options = v.into();
1091            self
1092        }
1093
1094        /// Sends the request.
1095        ///
1096        /// # Long running operations
1097        ///
1098        /// This starts, but does not poll, a longrunning operation. More information
1099        /// on [create_utilization_report][crate::client::VmMigration::create_utilization_report].
1100        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1101            (*self.0.stub)
1102                .create_utilization_report(self.0.request, self.0.options)
1103                .await
1104                .map(crate::Response::into_body)
1105        }
1106
1107        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_utilization_report`.
1108        pub fn poller(
1109            self,
1110        ) -> impl google_cloud_lro::Poller<
1111            crate::model::UtilizationReport,
1112            crate::model::OperationMetadata,
1113        > {
1114            type Operation = google_cloud_lro::internal::Operation<
1115                crate::model::UtilizationReport,
1116                crate::model::OperationMetadata,
1117            >;
1118            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1119            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1120
1121            let stub = self.0.stub.clone();
1122            let mut options = self.0.options.clone();
1123            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1124            let query = move |name| {
1125                let stub = stub.clone();
1126                let options = options.clone();
1127                async {
1128                    let op = GetOperation::new(stub)
1129                        .set_name(name)
1130                        .with_options(options)
1131                        .send()
1132                        .await?;
1133                    Ok(Operation::new(op))
1134                }
1135            };
1136
1137            let start = move || async {
1138                let op = self.send().await?;
1139                Ok(Operation::new(op))
1140            };
1141
1142            google_cloud_lro::internal::new_poller(
1143                polling_error_policy,
1144                polling_backoff_policy,
1145                start,
1146                query,
1147            )
1148        }
1149
1150        /// Sets the value of [parent][crate::model::CreateUtilizationReportRequest::parent].
1151        ///
1152        /// This is a **required** field for requests.
1153        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1154            self.0.request.parent = v.into();
1155            self
1156        }
1157
1158        /// Sets the value of [utilization_report][crate::model::CreateUtilizationReportRequest::utilization_report].
1159        ///
1160        /// This is a **required** field for requests.
1161        pub fn set_utilization_report<T>(mut self, v: T) -> Self
1162        where
1163            T: std::convert::Into<crate::model::UtilizationReport>,
1164        {
1165            self.0.request.utilization_report = std::option::Option::Some(v.into());
1166            self
1167        }
1168
1169        /// Sets or clears the value of [utilization_report][crate::model::CreateUtilizationReportRequest::utilization_report].
1170        ///
1171        /// This is a **required** field for requests.
1172        pub fn set_or_clear_utilization_report<T>(mut self, v: std::option::Option<T>) -> Self
1173        where
1174            T: std::convert::Into<crate::model::UtilizationReport>,
1175        {
1176            self.0.request.utilization_report = v.map(|x| x.into());
1177            self
1178        }
1179
1180        /// Sets the value of [utilization_report_id][crate::model::CreateUtilizationReportRequest::utilization_report_id].
1181        ///
1182        /// This is a **required** field for requests.
1183        pub fn set_utilization_report_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1184            self.0.request.utilization_report_id = v.into();
1185            self
1186        }
1187
1188        /// Sets the value of [request_id][crate::model::CreateUtilizationReportRequest::request_id].
1189        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1190            self.0.request.request_id = v.into();
1191            self
1192        }
1193    }
1194
1195    #[doc(hidden)]
1196    impl crate::RequestBuilder for CreateUtilizationReport {
1197        fn request_options(&mut self) -> &mut crate::RequestOptions {
1198            &mut self.0.options
1199        }
1200    }
1201
1202    /// The request builder for [VmMigration::delete_utilization_report][crate::client::VmMigration::delete_utilization_report] calls.
1203    ///
1204    /// # Example
1205    /// ```
1206    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteUtilizationReport;
1207    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
1208    /// use google_cloud_lro::Poller;
1209    ///
1210    /// let builder = prepare_request_builder();
1211    /// let response = builder.poller().until_done().await?;
1212    /// # Ok(()) }
1213    ///
1214    /// fn prepare_request_builder() -> DeleteUtilizationReport {
1215    ///   # panic!();
1216    ///   // ... details omitted ...
1217    /// }
1218    /// ```
1219    #[derive(Clone, Debug)]
1220    pub struct DeleteUtilizationReport(
1221        RequestBuilder<crate::model::DeleteUtilizationReportRequest>,
1222    );
1223
1224    impl DeleteUtilizationReport {
1225        pub(crate) fn new(
1226            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1227        ) -> Self {
1228            Self(RequestBuilder::new(stub))
1229        }
1230
1231        /// Sets the full request, replacing any prior values.
1232        pub fn with_request<V: Into<crate::model::DeleteUtilizationReportRequest>>(
1233            mut self,
1234            v: V,
1235        ) -> Self {
1236            self.0.request = v.into();
1237            self
1238        }
1239
1240        /// Sets all the options, replacing any prior values.
1241        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1242            self.0.options = v.into();
1243            self
1244        }
1245
1246        /// Sends the request.
1247        ///
1248        /// # Long running operations
1249        ///
1250        /// This starts, but does not poll, a longrunning operation. More information
1251        /// on [delete_utilization_report][crate::client::VmMigration::delete_utilization_report].
1252        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1253            (*self.0.stub)
1254                .delete_utilization_report(self.0.request, self.0.options)
1255                .await
1256                .map(crate::Response::into_body)
1257        }
1258
1259        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_utilization_report`.
1260        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1261            type Operation =
1262                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1263            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1264            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1265
1266            let stub = self.0.stub.clone();
1267            let mut options = self.0.options.clone();
1268            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1269            let query = move |name| {
1270                let stub = stub.clone();
1271                let options = options.clone();
1272                async {
1273                    let op = GetOperation::new(stub)
1274                        .set_name(name)
1275                        .with_options(options)
1276                        .send()
1277                        .await?;
1278                    Ok(Operation::new(op))
1279                }
1280            };
1281
1282            let start = move || async {
1283                let op = self.send().await?;
1284                Ok(Operation::new(op))
1285            };
1286
1287            google_cloud_lro::internal::new_unit_response_poller(
1288                polling_error_policy,
1289                polling_backoff_policy,
1290                start,
1291                query,
1292            )
1293        }
1294
1295        /// Sets the value of [name][crate::model::DeleteUtilizationReportRequest::name].
1296        ///
1297        /// This is a **required** field for requests.
1298        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1299            self.0.request.name = v.into();
1300            self
1301        }
1302
1303        /// Sets the value of [request_id][crate::model::DeleteUtilizationReportRequest::request_id].
1304        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1305            self.0.request.request_id = v.into();
1306            self
1307        }
1308    }
1309
1310    #[doc(hidden)]
1311    impl crate::RequestBuilder for DeleteUtilizationReport {
1312        fn request_options(&mut self) -> &mut crate::RequestOptions {
1313            &mut self.0.options
1314        }
1315    }
1316
1317    /// The request builder for [VmMigration::list_datacenter_connectors][crate::client::VmMigration::list_datacenter_connectors] calls.
1318    ///
1319    /// # Example
1320    /// ```
1321    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListDatacenterConnectors;
1322    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
1323    /// use google_cloud_gax::paginator::ItemPaginator;
1324    ///
1325    /// let builder = prepare_request_builder();
1326    /// let mut items = builder.by_item();
1327    /// while let Some(result) = items.next().await {
1328    ///   let item = result?;
1329    /// }
1330    /// # Ok(()) }
1331    ///
1332    /// fn prepare_request_builder() -> ListDatacenterConnectors {
1333    ///   # panic!();
1334    ///   // ... details omitted ...
1335    /// }
1336    /// ```
1337    #[derive(Clone, Debug)]
1338    pub struct ListDatacenterConnectors(
1339        RequestBuilder<crate::model::ListDatacenterConnectorsRequest>,
1340    );
1341
1342    impl ListDatacenterConnectors {
1343        pub(crate) fn new(
1344            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1345        ) -> Self {
1346            Self(RequestBuilder::new(stub))
1347        }
1348
1349        /// Sets the full request, replacing any prior values.
1350        pub fn with_request<V: Into<crate::model::ListDatacenterConnectorsRequest>>(
1351            mut self,
1352            v: V,
1353        ) -> Self {
1354            self.0.request = v.into();
1355            self
1356        }
1357
1358        /// Sets all the options, replacing any prior values.
1359        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1360            self.0.options = v.into();
1361            self
1362        }
1363
1364        /// Sends the request.
1365        pub async fn send(self) -> Result<crate::model::ListDatacenterConnectorsResponse> {
1366            (*self.0.stub)
1367                .list_datacenter_connectors(self.0.request, self.0.options)
1368                .await
1369                .map(crate::Response::into_body)
1370        }
1371
1372        /// Streams each page in the collection.
1373        pub fn by_page(
1374            self,
1375        ) -> impl google_cloud_gax::paginator::Paginator<
1376            crate::model::ListDatacenterConnectorsResponse,
1377            crate::Error,
1378        > {
1379            use std::clone::Clone;
1380            let token = self.0.request.page_token.clone();
1381            let execute = move |token: String| {
1382                let mut builder = self.clone();
1383                builder.0.request = builder.0.request.set_page_token(token);
1384                builder.send()
1385            };
1386            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1387        }
1388
1389        /// Streams each item in the collection.
1390        pub fn by_item(
1391            self,
1392        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1393            crate::model::ListDatacenterConnectorsResponse,
1394            crate::Error,
1395        > {
1396            use google_cloud_gax::paginator::Paginator;
1397            self.by_page().items()
1398        }
1399
1400        /// Sets the value of [parent][crate::model::ListDatacenterConnectorsRequest::parent].
1401        ///
1402        /// This is a **required** field for requests.
1403        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1404            self.0.request.parent = v.into();
1405            self
1406        }
1407
1408        /// Sets the value of [page_size][crate::model::ListDatacenterConnectorsRequest::page_size].
1409        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1410            self.0.request.page_size = v.into();
1411            self
1412        }
1413
1414        /// Sets the value of [page_token][crate::model::ListDatacenterConnectorsRequest::page_token].
1415        ///
1416        /// This is a **required** field for requests.
1417        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1418            self.0.request.page_token = v.into();
1419            self
1420        }
1421
1422        /// Sets the value of [filter][crate::model::ListDatacenterConnectorsRequest::filter].
1423        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1424            self.0.request.filter = v.into();
1425            self
1426        }
1427
1428        /// Sets the value of [order_by][crate::model::ListDatacenterConnectorsRequest::order_by].
1429        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1430            self.0.request.order_by = v.into();
1431            self
1432        }
1433    }
1434
1435    #[doc(hidden)]
1436    impl crate::RequestBuilder for ListDatacenterConnectors {
1437        fn request_options(&mut self) -> &mut crate::RequestOptions {
1438            &mut self.0.options
1439        }
1440    }
1441
1442    /// The request builder for [VmMigration::get_datacenter_connector][crate::client::VmMigration::get_datacenter_connector] calls.
1443    ///
1444    /// # Example
1445    /// ```
1446    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetDatacenterConnector;
1447    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
1448    ///
1449    /// let builder = prepare_request_builder();
1450    /// let response = builder.send().await?;
1451    /// # Ok(()) }
1452    ///
1453    /// fn prepare_request_builder() -> GetDatacenterConnector {
1454    ///   # panic!();
1455    ///   // ... details omitted ...
1456    /// }
1457    /// ```
1458    #[derive(Clone, Debug)]
1459    pub struct GetDatacenterConnector(RequestBuilder<crate::model::GetDatacenterConnectorRequest>);
1460
1461    impl GetDatacenterConnector {
1462        pub(crate) fn new(
1463            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1464        ) -> Self {
1465            Self(RequestBuilder::new(stub))
1466        }
1467
1468        /// Sets the full request, replacing any prior values.
1469        pub fn with_request<V: Into<crate::model::GetDatacenterConnectorRequest>>(
1470            mut self,
1471            v: V,
1472        ) -> Self {
1473            self.0.request = v.into();
1474            self
1475        }
1476
1477        /// Sets all the options, replacing any prior values.
1478        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1479            self.0.options = v.into();
1480            self
1481        }
1482
1483        /// Sends the request.
1484        pub async fn send(self) -> Result<crate::model::DatacenterConnector> {
1485            (*self.0.stub)
1486                .get_datacenter_connector(self.0.request, self.0.options)
1487                .await
1488                .map(crate::Response::into_body)
1489        }
1490
1491        /// Sets the value of [name][crate::model::GetDatacenterConnectorRequest::name].
1492        ///
1493        /// This is a **required** field for requests.
1494        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1495            self.0.request.name = v.into();
1496            self
1497        }
1498    }
1499
1500    #[doc(hidden)]
1501    impl crate::RequestBuilder for GetDatacenterConnector {
1502        fn request_options(&mut self) -> &mut crate::RequestOptions {
1503            &mut self.0.options
1504        }
1505    }
1506
1507    /// The request builder for [VmMigration::create_datacenter_connector][crate::client::VmMigration::create_datacenter_connector] calls.
1508    ///
1509    /// # Example
1510    /// ```
1511    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateDatacenterConnector;
1512    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
1513    /// use google_cloud_lro::Poller;
1514    ///
1515    /// let builder = prepare_request_builder();
1516    /// let response = builder.poller().until_done().await?;
1517    /// # Ok(()) }
1518    ///
1519    /// fn prepare_request_builder() -> CreateDatacenterConnector {
1520    ///   # panic!();
1521    ///   // ... details omitted ...
1522    /// }
1523    /// ```
1524    #[derive(Clone, Debug)]
1525    pub struct CreateDatacenterConnector(
1526        RequestBuilder<crate::model::CreateDatacenterConnectorRequest>,
1527    );
1528
1529    impl CreateDatacenterConnector {
1530        pub(crate) fn new(
1531            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1532        ) -> Self {
1533            Self(RequestBuilder::new(stub))
1534        }
1535
1536        /// Sets the full request, replacing any prior values.
1537        pub fn with_request<V: Into<crate::model::CreateDatacenterConnectorRequest>>(
1538            mut self,
1539            v: V,
1540        ) -> Self {
1541            self.0.request = v.into();
1542            self
1543        }
1544
1545        /// Sets all the options, replacing any prior values.
1546        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1547            self.0.options = v.into();
1548            self
1549        }
1550
1551        /// Sends the request.
1552        ///
1553        /// # Long running operations
1554        ///
1555        /// This starts, but does not poll, a longrunning operation. More information
1556        /// on [create_datacenter_connector][crate::client::VmMigration::create_datacenter_connector].
1557        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1558            (*self.0.stub)
1559                .create_datacenter_connector(self.0.request, self.0.options)
1560                .await
1561                .map(crate::Response::into_body)
1562        }
1563
1564        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_datacenter_connector`.
1565        pub fn poller(
1566            self,
1567        ) -> impl google_cloud_lro::Poller<
1568            crate::model::DatacenterConnector,
1569            crate::model::OperationMetadata,
1570        > {
1571            type Operation = google_cloud_lro::internal::Operation<
1572                crate::model::DatacenterConnector,
1573                crate::model::OperationMetadata,
1574            >;
1575            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1576            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1577
1578            let stub = self.0.stub.clone();
1579            let mut options = self.0.options.clone();
1580            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1581            let query = move |name| {
1582                let stub = stub.clone();
1583                let options = options.clone();
1584                async {
1585                    let op = GetOperation::new(stub)
1586                        .set_name(name)
1587                        .with_options(options)
1588                        .send()
1589                        .await?;
1590                    Ok(Operation::new(op))
1591                }
1592            };
1593
1594            let start = move || async {
1595                let op = self.send().await?;
1596                Ok(Operation::new(op))
1597            };
1598
1599            google_cloud_lro::internal::new_poller(
1600                polling_error_policy,
1601                polling_backoff_policy,
1602                start,
1603                query,
1604            )
1605        }
1606
1607        /// Sets the value of [parent][crate::model::CreateDatacenterConnectorRequest::parent].
1608        ///
1609        /// This is a **required** field for requests.
1610        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1611            self.0.request.parent = v.into();
1612            self
1613        }
1614
1615        /// Sets the value of [datacenter_connector_id][crate::model::CreateDatacenterConnectorRequest::datacenter_connector_id].
1616        ///
1617        /// This is a **required** field for requests.
1618        pub fn set_datacenter_connector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1619            self.0.request.datacenter_connector_id = v.into();
1620            self
1621        }
1622
1623        /// Sets the value of [datacenter_connector][crate::model::CreateDatacenterConnectorRequest::datacenter_connector].
1624        ///
1625        /// This is a **required** field for requests.
1626        pub fn set_datacenter_connector<T>(mut self, v: T) -> Self
1627        where
1628            T: std::convert::Into<crate::model::DatacenterConnector>,
1629        {
1630            self.0.request.datacenter_connector = std::option::Option::Some(v.into());
1631            self
1632        }
1633
1634        /// Sets or clears the value of [datacenter_connector][crate::model::CreateDatacenterConnectorRequest::datacenter_connector].
1635        ///
1636        /// This is a **required** field for requests.
1637        pub fn set_or_clear_datacenter_connector<T>(mut self, v: std::option::Option<T>) -> Self
1638        where
1639            T: std::convert::Into<crate::model::DatacenterConnector>,
1640        {
1641            self.0.request.datacenter_connector = v.map(|x| x.into());
1642            self
1643        }
1644
1645        /// Sets the value of [request_id][crate::model::CreateDatacenterConnectorRequest::request_id].
1646        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1647            self.0.request.request_id = v.into();
1648            self
1649        }
1650    }
1651
1652    #[doc(hidden)]
1653    impl crate::RequestBuilder for CreateDatacenterConnector {
1654        fn request_options(&mut self) -> &mut crate::RequestOptions {
1655            &mut self.0.options
1656        }
1657    }
1658
1659    /// The request builder for [VmMigration::delete_datacenter_connector][crate::client::VmMigration::delete_datacenter_connector] calls.
1660    ///
1661    /// # Example
1662    /// ```
1663    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteDatacenterConnector;
1664    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
1665    /// use google_cloud_lro::Poller;
1666    ///
1667    /// let builder = prepare_request_builder();
1668    /// let response = builder.poller().until_done().await?;
1669    /// # Ok(()) }
1670    ///
1671    /// fn prepare_request_builder() -> DeleteDatacenterConnector {
1672    ///   # panic!();
1673    ///   // ... details omitted ...
1674    /// }
1675    /// ```
1676    #[derive(Clone, Debug)]
1677    pub struct DeleteDatacenterConnector(
1678        RequestBuilder<crate::model::DeleteDatacenterConnectorRequest>,
1679    );
1680
1681    impl DeleteDatacenterConnector {
1682        pub(crate) fn new(
1683            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1684        ) -> Self {
1685            Self(RequestBuilder::new(stub))
1686        }
1687
1688        /// Sets the full request, replacing any prior values.
1689        pub fn with_request<V: Into<crate::model::DeleteDatacenterConnectorRequest>>(
1690            mut self,
1691            v: V,
1692        ) -> Self {
1693            self.0.request = v.into();
1694            self
1695        }
1696
1697        /// Sets all the options, replacing any prior values.
1698        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1699            self.0.options = v.into();
1700            self
1701        }
1702
1703        /// Sends the request.
1704        ///
1705        /// # Long running operations
1706        ///
1707        /// This starts, but does not poll, a longrunning operation. More information
1708        /// on [delete_datacenter_connector][crate::client::VmMigration::delete_datacenter_connector].
1709        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1710            (*self.0.stub)
1711                .delete_datacenter_connector(self.0.request, self.0.options)
1712                .await
1713                .map(crate::Response::into_body)
1714        }
1715
1716        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_datacenter_connector`.
1717        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1718            type Operation =
1719                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1720            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1721            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1722
1723            let stub = self.0.stub.clone();
1724            let mut options = self.0.options.clone();
1725            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1726            let query = move |name| {
1727                let stub = stub.clone();
1728                let options = options.clone();
1729                async {
1730                    let op = GetOperation::new(stub)
1731                        .set_name(name)
1732                        .with_options(options)
1733                        .send()
1734                        .await?;
1735                    Ok(Operation::new(op))
1736                }
1737            };
1738
1739            let start = move || async {
1740                let op = self.send().await?;
1741                Ok(Operation::new(op))
1742            };
1743
1744            google_cloud_lro::internal::new_unit_response_poller(
1745                polling_error_policy,
1746                polling_backoff_policy,
1747                start,
1748                query,
1749            )
1750        }
1751
1752        /// Sets the value of [name][crate::model::DeleteDatacenterConnectorRequest::name].
1753        ///
1754        /// This is a **required** field for requests.
1755        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1756            self.0.request.name = v.into();
1757            self
1758        }
1759
1760        /// Sets the value of [request_id][crate::model::DeleteDatacenterConnectorRequest::request_id].
1761        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1762            self.0.request.request_id = v.into();
1763            self
1764        }
1765    }
1766
1767    #[doc(hidden)]
1768    impl crate::RequestBuilder for DeleteDatacenterConnector {
1769        fn request_options(&mut self) -> &mut crate::RequestOptions {
1770            &mut self.0.options
1771        }
1772    }
1773
1774    /// The request builder for [VmMigration::upgrade_appliance][crate::client::VmMigration::upgrade_appliance] calls.
1775    ///
1776    /// # Example
1777    /// ```
1778    /// # use google_cloud_vmmigration_v1::builder::vm_migration::UpgradeAppliance;
1779    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
1780    /// use google_cloud_lro::Poller;
1781    ///
1782    /// let builder = prepare_request_builder();
1783    /// let response = builder.poller().until_done().await?;
1784    /// # Ok(()) }
1785    ///
1786    /// fn prepare_request_builder() -> UpgradeAppliance {
1787    ///   # panic!();
1788    ///   // ... details omitted ...
1789    /// }
1790    /// ```
1791    #[derive(Clone, Debug)]
1792    pub struct UpgradeAppliance(RequestBuilder<crate::model::UpgradeApplianceRequest>);
1793
1794    impl UpgradeAppliance {
1795        pub(crate) fn new(
1796            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1797        ) -> Self {
1798            Self(RequestBuilder::new(stub))
1799        }
1800
1801        /// Sets the full request, replacing any prior values.
1802        pub fn with_request<V: Into<crate::model::UpgradeApplianceRequest>>(
1803            mut self,
1804            v: V,
1805        ) -> Self {
1806            self.0.request = v.into();
1807            self
1808        }
1809
1810        /// Sets all the options, replacing any prior values.
1811        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1812            self.0.options = v.into();
1813            self
1814        }
1815
1816        /// Sends the request.
1817        ///
1818        /// # Long running operations
1819        ///
1820        /// This starts, but does not poll, a longrunning operation. More information
1821        /// on [upgrade_appliance][crate::client::VmMigration::upgrade_appliance].
1822        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1823            (*self.0.stub)
1824                .upgrade_appliance(self.0.request, self.0.options)
1825                .await
1826                .map(crate::Response::into_body)
1827        }
1828
1829        /// Creates a [Poller][google_cloud_lro::Poller] to work with `upgrade_appliance`.
1830        pub fn poller(
1831            self,
1832        ) -> impl google_cloud_lro::Poller<
1833            crate::model::UpgradeApplianceResponse,
1834            crate::model::OperationMetadata,
1835        > {
1836            type Operation = google_cloud_lro::internal::Operation<
1837                crate::model::UpgradeApplianceResponse,
1838                crate::model::OperationMetadata,
1839            >;
1840            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1841            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1842
1843            let stub = self.0.stub.clone();
1844            let mut options = self.0.options.clone();
1845            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1846            let query = move |name| {
1847                let stub = stub.clone();
1848                let options = options.clone();
1849                async {
1850                    let op = GetOperation::new(stub)
1851                        .set_name(name)
1852                        .with_options(options)
1853                        .send()
1854                        .await?;
1855                    Ok(Operation::new(op))
1856                }
1857            };
1858
1859            let start = move || async {
1860                let op = self.send().await?;
1861                Ok(Operation::new(op))
1862            };
1863
1864            google_cloud_lro::internal::new_poller(
1865                polling_error_policy,
1866                polling_backoff_policy,
1867                start,
1868                query,
1869            )
1870        }
1871
1872        /// Sets the value of [datacenter_connector][crate::model::UpgradeApplianceRequest::datacenter_connector].
1873        ///
1874        /// This is a **required** field for requests.
1875        pub fn set_datacenter_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
1876            self.0.request.datacenter_connector = v.into();
1877            self
1878        }
1879
1880        /// Sets the value of [request_id][crate::model::UpgradeApplianceRequest::request_id].
1881        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882            self.0.request.request_id = v.into();
1883            self
1884        }
1885    }
1886
1887    #[doc(hidden)]
1888    impl crate::RequestBuilder for UpgradeAppliance {
1889        fn request_options(&mut self) -> &mut crate::RequestOptions {
1890            &mut self.0.options
1891        }
1892    }
1893
1894    /// The request builder for [VmMigration::create_migrating_vm][crate::client::VmMigration::create_migrating_vm] calls.
1895    ///
1896    /// # Example
1897    /// ```
1898    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateMigratingVm;
1899    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
1900    /// use google_cloud_lro::Poller;
1901    ///
1902    /// let builder = prepare_request_builder();
1903    /// let response = builder.poller().until_done().await?;
1904    /// # Ok(()) }
1905    ///
1906    /// fn prepare_request_builder() -> CreateMigratingVm {
1907    ///   # panic!();
1908    ///   // ... details omitted ...
1909    /// }
1910    /// ```
1911    #[derive(Clone, Debug)]
1912    pub struct CreateMigratingVm(RequestBuilder<crate::model::CreateMigratingVmRequest>);
1913
1914    impl CreateMigratingVm {
1915        pub(crate) fn new(
1916            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
1917        ) -> Self {
1918            Self(RequestBuilder::new(stub))
1919        }
1920
1921        /// Sets the full request, replacing any prior values.
1922        pub fn with_request<V: Into<crate::model::CreateMigratingVmRequest>>(
1923            mut self,
1924            v: V,
1925        ) -> Self {
1926            self.0.request = v.into();
1927            self
1928        }
1929
1930        /// Sets all the options, replacing any prior values.
1931        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1932            self.0.options = v.into();
1933            self
1934        }
1935
1936        /// Sends the request.
1937        ///
1938        /// # Long running operations
1939        ///
1940        /// This starts, but does not poll, a longrunning operation. More information
1941        /// on [create_migrating_vm][crate::client::VmMigration::create_migrating_vm].
1942        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1943            (*self.0.stub)
1944                .create_migrating_vm(self.0.request, self.0.options)
1945                .await
1946                .map(crate::Response::into_body)
1947        }
1948
1949        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_migrating_vm`.
1950        pub fn poller(
1951            self,
1952        ) -> impl google_cloud_lro::Poller<crate::model::MigratingVm, crate::model::OperationMetadata>
1953        {
1954            type Operation = google_cloud_lro::internal::Operation<
1955                crate::model::MigratingVm,
1956                crate::model::OperationMetadata,
1957            >;
1958            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1959            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1960
1961            let stub = self.0.stub.clone();
1962            let mut options = self.0.options.clone();
1963            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1964            let query = move |name| {
1965                let stub = stub.clone();
1966                let options = options.clone();
1967                async {
1968                    let op = GetOperation::new(stub)
1969                        .set_name(name)
1970                        .with_options(options)
1971                        .send()
1972                        .await?;
1973                    Ok(Operation::new(op))
1974                }
1975            };
1976
1977            let start = move || async {
1978                let op = self.send().await?;
1979                Ok(Operation::new(op))
1980            };
1981
1982            google_cloud_lro::internal::new_poller(
1983                polling_error_policy,
1984                polling_backoff_policy,
1985                start,
1986                query,
1987            )
1988        }
1989
1990        /// Sets the value of [parent][crate::model::CreateMigratingVmRequest::parent].
1991        ///
1992        /// This is a **required** field for requests.
1993        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1994            self.0.request.parent = v.into();
1995            self
1996        }
1997
1998        /// Sets the value of [migrating_vm_id][crate::model::CreateMigratingVmRequest::migrating_vm_id].
1999        ///
2000        /// This is a **required** field for requests.
2001        pub fn set_migrating_vm_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2002            self.0.request.migrating_vm_id = v.into();
2003            self
2004        }
2005
2006        /// Sets the value of [migrating_vm][crate::model::CreateMigratingVmRequest::migrating_vm].
2007        ///
2008        /// This is a **required** field for requests.
2009        pub fn set_migrating_vm<T>(mut self, v: T) -> Self
2010        where
2011            T: std::convert::Into<crate::model::MigratingVm>,
2012        {
2013            self.0.request.migrating_vm = std::option::Option::Some(v.into());
2014            self
2015        }
2016
2017        /// Sets or clears the value of [migrating_vm][crate::model::CreateMigratingVmRequest::migrating_vm].
2018        ///
2019        /// This is a **required** field for requests.
2020        pub fn set_or_clear_migrating_vm<T>(mut self, v: std::option::Option<T>) -> Self
2021        where
2022            T: std::convert::Into<crate::model::MigratingVm>,
2023        {
2024            self.0.request.migrating_vm = v.map(|x| x.into());
2025            self
2026        }
2027
2028        /// Sets the value of [request_id][crate::model::CreateMigratingVmRequest::request_id].
2029        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2030            self.0.request.request_id = v.into();
2031            self
2032        }
2033    }
2034
2035    #[doc(hidden)]
2036    impl crate::RequestBuilder for CreateMigratingVm {
2037        fn request_options(&mut self) -> &mut crate::RequestOptions {
2038            &mut self.0.options
2039        }
2040    }
2041
2042    /// The request builder for [VmMigration::list_migrating_vms][crate::client::VmMigration::list_migrating_vms] calls.
2043    ///
2044    /// # Example
2045    /// ```
2046    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListMigratingVms;
2047    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2048    /// use google_cloud_gax::paginator::ItemPaginator;
2049    ///
2050    /// let builder = prepare_request_builder();
2051    /// let mut items = builder.by_item();
2052    /// while let Some(result) = items.next().await {
2053    ///   let item = result?;
2054    /// }
2055    /// # Ok(()) }
2056    ///
2057    /// fn prepare_request_builder() -> ListMigratingVms {
2058    ///   # panic!();
2059    ///   // ... details omitted ...
2060    /// }
2061    /// ```
2062    #[derive(Clone, Debug)]
2063    pub struct ListMigratingVms(RequestBuilder<crate::model::ListMigratingVmsRequest>);
2064
2065    impl ListMigratingVms {
2066        pub(crate) fn new(
2067            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2068        ) -> Self {
2069            Self(RequestBuilder::new(stub))
2070        }
2071
2072        /// Sets the full request, replacing any prior values.
2073        pub fn with_request<V: Into<crate::model::ListMigratingVmsRequest>>(
2074            mut self,
2075            v: V,
2076        ) -> Self {
2077            self.0.request = v.into();
2078            self
2079        }
2080
2081        /// Sets all the options, replacing any prior values.
2082        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2083            self.0.options = v.into();
2084            self
2085        }
2086
2087        /// Sends the request.
2088        pub async fn send(self) -> Result<crate::model::ListMigratingVmsResponse> {
2089            (*self.0.stub)
2090                .list_migrating_vms(self.0.request, self.0.options)
2091                .await
2092                .map(crate::Response::into_body)
2093        }
2094
2095        /// Streams each page in the collection.
2096        pub fn by_page(
2097            self,
2098        ) -> impl google_cloud_gax::paginator::Paginator<
2099            crate::model::ListMigratingVmsResponse,
2100            crate::Error,
2101        > {
2102            use std::clone::Clone;
2103            let token = self.0.request.page_token.clone();
2104            let execute = move |token: String| {
2105                let mut builder = self.clone();
2106                builder.0.request = builder.0.request.set_page_token(token);
2107                builder.send()
2108            };
2109            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2110        }
2111
2112        /// Streams each item in the collection.
2113        pub fn by_item(
2114            self,
2115        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2116            crate::model::ListMigratingVmsResponse,
2117            crate::Error,
2118        > {
2119            use google_cloud_gax::paginator::Paginator;
2120            self.by_page().items()
2121        }
2122
2123        /// Sets the value of [parent][crate::model::ListMigratingVmsRequest::parent].
2124        ///
2125        /// This is a **required** field for requests.
2126        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2127            self.0.request.parent = v.into();
2128            self
2129        }
2130
2131        /// Sets the value of [page_size][crate::model::ListMigratingVmsRequest::page_size].
2132        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2133            self.0.request.page_size = v.into();
2134            self
2135        }
2136
2137        /// Sets the value of [page_token][crate::model::ListMigratingVmsRequest::page_token].
2138        ///
2139        /// This is a **required** field for requests.
2140        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2141            self.0.request.page_token = v.into();
2142            self
2143        }
2144
2145        /// Sets the value of [filter][crate::model::ListMigratingVmsRequest::filter].
2146        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2147            self.0.request.filter = v.into();
2148            self
2149        }
2150
2151        /// Sets the value of [order_by][crate::model::ListMigratingVmsRequest::order_by].
2152        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2153            self.0.request.order_by = v.into();
2154            self
2155        }
2156
2157        /// Sets the value of [view][crate::model::ListMigratingVmsRequest::view].
2158        pub fn set_view<T: Into<crate::model::MigratingVmView>>(mut self, v: T) -> Self {
2159            self.0.request.view = v.into();
2160            self
2161        }
2162    }
2163
2164    #[doc(hidden)]
2165    impl crate::RequestBuilder for ListMigratingVms {
2166        fn request_options(&mut self) -> &mut crate::RequestOptions {
2167            &mut self.0.options
2168        }
2169    }
2170
2171    /// The request builder for [VmMigration::get_migrating_vm][crate::client::VmMigration::get_migrating_vm] calls.
2172    ///
2173    /// # Example
2174    /// ```
2175    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetMigratingVm;
2176    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2177    ///
2178    /// let builder = prepare_request_builder();
2179    /// let response = builder.send().await?;
2180    /// # Ok(()) }
2181    ///
2182    /// fn prepare_request_builder() -> GetMigratingVm {
2183    ///   # panic!();
2184    ///   // ... details omitted ...
2185    /// }
2186    /// ```
2187    #[derive(Clone, Debug)]
2188    pub struct GetMigratingVm(RequestBuilder<crate::model::GetMigratingVmRequest>);
2189
2190    impl GetMigratingVm {
2191        pub(crate) fn new(
2192            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2193        ) -> Self {
2194            Self(RequestBuilder::new(stub))
2195        }
2196
2197        /// Sets the full request, replacing any prior values.
2198        pub fn with_request<V: Into<crate::model::GetMigratingVmRequest>>(mut self, v: V) -> Self {
2199            self.0.request = v.into();
2200            self
2201        }
2202
2203        /// Sets all the options, replacing any prior values.
2204        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2205            self.0.options = v.into();
2206            self
2207        }
2208
2209        /// Sends the request.
2210        pub async fn send(self) -> Result<crate::model::MigratingVm> {
2211            (*self.0.stub)
2212                .get_migrating_vm(self.0.request, self.0.options)
2213                .await
2214                .map(crate::Response::into_body)
2215        }
2216
2217        /// Sets the value of [name][crate::model::GetMigratingVmRequest::name].
2218        ///
2219        /// This is a **required** field for requests.
2220        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221            self.0.request.name = v.into();
2222            self
2223        }
2224
2225        /// Sets the value of [view][crate::model::GetMigratingVmRequest::view].
2226        pub fn set_view<T: Into<crate::model::MigratingVmView>>(mut self, v: T) -> Self {
2227            self.0.request.view = v.into();
2228            self
2229        }
2230    }
2231
2232    #[doc(hidden)]
2233    impl crate::RequestBuilder for GetMigratingVm {
2234        fn request_options(&mut self) -> &mut crate::RequestOptions {
2235            &mut self.0.options
2236        }
2237    }
2238
2239    /// The request builder for [VmMigration::update_migrating_vm][crate::client::VmMigration::update_migrating_vm] calls.
2240    ///
2241    /// # Example
2242    /// ```
2243    /// # use google_cloud_vmmigration_v1::builder::vm_migration::UpdateMigratingVm;
2244    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2245    /// use google_cloud_lro::Poller;
2246    ///
2247    /// let builder = prepare_request_builder();
2248    /// let response = builder.poller().until_done().await?;
2249    /// # Ok(()) }
2250    ///
2251    /// fn prepare_request_builder() -> UpdateMigratingVm {
2252    ///   # panic!();
2253    ///   // ... details omitted ...
2254    /// }
2255    /// ```
2256    #[derive(Clone, Debug)]
2257    pub struct UpdateMigratingVm(RequestBuilder<crate::model::UpdateMigratingVmRequest>);
2258
2259    impl UpdateMigratingVm {
2260        pub(crate) fn new(
2261            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2262        ) -> Self {
2263            Self(RequestBuilder::new(stub))
2264        }
2265
2266        /// Sets the full request, replacing any prior values.
2267        pub fn with_request<V: Into<crate::model::UpdateMigratingVmRequest>>(
2268            mut self,
2269            v: V,
2270        ) -> Self {
2271            self.0.request = v.into();
2272            self
2273        }
2274
2275        /// Sets all the options, replacing any prior values.
2276        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2277            self.0.options = v.into();
2278            self
2279        }
2280
2281        /// Sends the request.
2282        ///
2283        /// # Long running operations
2284        ///
2285        /// This starts, but does not poll, a longrunning operation. More information
2286        /// on [update_migrating_vm][crate::client::VmMigration::update_migrating_vm].
2287        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2288            (*self.0.stub)
2289                .update_migrating_vm(self.0.request, self.0.options)
2290                .await
2291                .map(crate::Response::into_body)
2292        }
2293
2294        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_migrating_vm`.
2295        pub fn poller(
2296            self,
2297        ) -> impl google_cloud_lro::Poller<crate::model::MigratingVm, crate::model::OperationMetadata>
2298        {
2299            type Operation = google_cloud_lro::internal::Operation<
2300                crate::model::MigratingVm,
2301                crate::model::OperationMetadata,
2302            >;
2303            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2304            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2305
2306            let stub = self.0.stub.clone();
2307            let mut options = self.0.options.clone();
2308            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2309            let query = move |name| {
2310                let stub = stub.clone();
2311                let options = options.clone();
2312                async {
2313                    let op = GetOperation::new(stub)
2314                        .set_name(name)
2315                        .with_options(options)
2316                        .send()
2317                        .await?;
2318                    Ok(Operation::new(op))
2319                }
2320            };
2321
2322            let start = move || async {
2323                let op = self.send().await?;
2324                Ok(Operation::new(op))
2325            };
2326
2327            google_cloud_lro::internal::new_poller(
2328                polling_error_policy,
2329                polling_backoff_policy,
2330                start,
2331                query,
2332            )
2333        }
2334
2335        /// Sets the value of [update_mask][crate::model::UpdateMigratingVmRequest::update_mask].
2336        pub fn set_update_mask<T>(mut self, v: T) -> Self
2337        where
2338            T: std::convert::Into<wkt::FieldMask>,
2339        {
2340            self.0.request.update_mask = std::option::Option::Some(v.into());
2341            self
2342        }
2343
2344        /// Sets or clears the value of [update_mask][crate::model::UpdateMigratingVmRequest::update_mask].
2345        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2346        where
2347            T: std::convert::Into<wkt::FieldMask>,
2348        {
2349            self.0.request.update_mask = v.map(|x| x.into());
2350            self
2351        }
2352
2353        /// Sets the value of [migrating_vm][crate::model::UpdateMigratingVmRequest::migrating_vm].
2354        ///
2355        /// This is a **required** field for requests.
2356        pub fn set_migrating_vm<T>(mut self, v: T) -> Self
2357        where
2358            T: std::convert::Into<crate::model::MigratingVm>,
2359        {
2360            self.0.request.migrating_vm = std::option::Option::Some(v.into());
2361            self
2362        }
2363
2364        /// Sets or clears the value of [migrating_vm][crate::model::UpdateMigratingVmRequest::migrating_vm].
2365        ///
2366        /// This is a **required** field for requests.
2367        pub fn set_or_clear_migrating_vm<T>(mut self, v: std::option::Option<T>) -> Self
2368        where
2369            T: std::convert::Into<crate::model::MigratingVm>,
2370        {
2371            self.0.request.migrating_vm = v.map(|x| x.into());
2372            self
2373        }
2374
2375        /// Sets the value of [request_id][crate::model::UpdateMigratingVmRequest::request_id].
2376        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2377            self.0.request.request_id = v.into();
2378            self
2379        }
2380    }
2381
2382    #[doc(hidden)]
2383    impl crate::RequestBuilder for UpdateMigratingVm {
2384        fn request_options(&mut self) -> &mut crate::RequestOptions {
2385            &mut self.0.options
2386        }
2387    }
2388
2389    /// The request builder for [VmMigration::delete_migrating_vm][crate::client::VmMigration::delete_migrating_vm] calls.
2390    ///
2391    /// # Example
2392    /// ```
2393    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteMigratingVm;
2394    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2395    /// use google_cloud_lro::Poller;
2396    ///
2397    /// let builder = prepare_request_builder();
2398    /// let response = builder.poller().until_done().await?;
2399    /// # Ok(()) }
2400    ///
2401    /// fn prepare_request_builder() -> DeleteMigratingVm {
2402    ///   # panic!();
2403    ///   // ... details omitted ...
2404    /// }
2405    /// ```
2406    #[derive(Clone, Debug)]
2407    pub struct DeleteMigratingVm(RequestBuilder<crate::model::DeleteMigratingVmRequest>);
2408
2409    impl DeleteMigratingVm {
2410        pub(crate) fn new(
2411            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2412        ) -> Self {
2413            Self(RequestBuilder::new(stub))
2414        }
2415
2416        /// Sets the full request, replacing any prior values.
2417        pub fn with_request<V: Into<crate::model::DeleteMigratingVmRequest>>(
2418            mut self,
2419            v: V,
2420        ) -> Self {
2421            self.0.request = v.into();
2422            self
2423        }
2424
2425        /// Sets all the options, replacing any prior values.
2426        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2427            self.0.options = v.into();
2428            self
2429        }
2430
2431        /// Sends the request.
2432        ///
2433        /// # Long running operations
2434        ///
2435        /// This starts, but does not poll, a longrunning operation. More information
2436        /// on [delete_migrating_vm][crate::client::VmMigration::delete_migrating_vm].
2437        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2438            (*self.0.stub)
2439                .delete_migrating_vm(self.0.request, self.0.options)
2440                .await
2441                .map(crate::Response::into_body)
2442        }
2443
2444        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_migrating_vm`.
2445        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2446            type Operation =
2447                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2448            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2449            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2450
2451            let stub = self.0.stub.clone();
2452            let mut options = self.0.options.clone();
2453            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2454            let query = move |name| {
2455                let stub = stub.clone();
2456                let options = options.clone();
2457                async {
2458                    let op = GetOperation::new(stub)
2459                        .set_name(name)
2460                        .with_options(options)
2461                        .send()
2462                        .await?;
2463                    Ok(Operation::new(op))
2464                }
2465            };
2466
2467            let start = move || async {
2468                let op = self.send().await?;
2469                Ok(Operation::new(op))
2470            };
2471
2472            google_cloud_lro::internal::new_unit_response_poller(
2473                polling_error_policy,
2474                polling_backoff_policy,
2475                start,
2476                query,
2477            )
2478        }
2479
2480        /// Sets the value of [name][crate::model::DeleteMigratingVmRequest::name].
2481        ///
2482        /// This is a **required** field for requests.
2483        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2484            self.0.request.name = v.into();
2485            self
2486        }
2487    }
2488
2489    #[doc(hidden)]
2490    impl crate::RequestBuilder for DeleteMigratingVm {
2491        fn request_options(&mut self) -> &mut crate::RequestOptions {
2492            &mut self.0.options
2493        }
2494    }
2495
2496    /// The request builder for [VmMigration::start_migration][crate::client::VmMigration::start_migration] calls.
2497    ///
2498    /// # Example
2499    /// ```
2500    /// # use google_cloud_vmmigration_v1::builder::vm_migration::StartMigration;
2501    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2502    /// use google_cloud_lro::Poller;
2503    ///
2504    /// let builder = prepare_request_builder();
2505    /// let response = builder.poller().until_done().await?;
2506    /// # Ok(()) }
2507    ///
2508    /// fn prepare_request_builder() -> StartMigration {
2509    ///   # panic!();
2510    ///   // ... details omitted ...
2511    /// }
2512    /// ```
2513    #[derive(Clone, Debug)]
2514    pub struct StartMigration(RequestBuilder<crate::model::StartMigrationRequest>);
2515
2516    impl StartMigration {
2517        pub(crate) fn new(
2518            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2519        ) -> Self {
2520            Self(RequestBuilder::new(stub))
2521        }
2522
2523        /// Sets the full request, replacing any prior values.
2524        pub fn with_request<V: Into<crate::model::StartMigrationRequest>>(mut self, v: V) -> Self {
2525            self.0.request = v.into();
2526            self
2527        }
2528
2529        /// Sets all the options, replacing any prior values.
2530        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2531            self.0.options = v.into();
2532            self
2533        }
2534
2535        /// Sends the request.
2536        ///
2537        /// # Long running operations
2538        ///
2539        /// This starts, but does not poll, a longrunning operation. More information
2540        /// on [start_migration][crate::client::VmMigration::start_migration].
2541        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2542            (*self.0.stub)
2543                .start_migration(self.0.request, self.0.options)
2544                .await
2545                .map(crate::Response::into_body)
2546        }
2547
2548        /// Creates a [Poller][google_cloud_lro::Poller] to work with `start_migration`.
2549        pub fn poller(
2550            self,
2551        ) -> impl google_cloud_lro::Poller<
2552            crate::model::StartMigrationResponse,
2553            crate::model::OperationMetadata,
2554        > {
2555            type Operation = google_cloud_lro::internal::Operation<
2556                crate::model::StartMigrationResponse,
2557                crate::model::OperationMetadata,
2558            >;
2559            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2560            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2561
2562            let stub = self.0.stub.clone();
2563            let mut options = self.0.options.clone();
2564            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2565            let query = move |name| {
2566                let stub = stub.clone();
2567                let options = options.clone();
2568                async {
2569                    let op = GetOperation::new(stub)
2570                        .set_name(name)
2571                        .with_options(options)
2572                        .send()
2573                        .await?;
2574                    Ok(Operation::new(op))
2575                }
2576            };
2577
2578            let start = move || async {
2579                let op = self.send().await?;
2580                Ok(Operation::new(op))
2581            };
2582
2583            google_cloud_lro::internal::new_poller(
2584                polling_error_policy,
2585                polling_backoff_policy,
2586                start,
2587                query,
2588            )
2589        }
2590
2591        /// Sets the value of [migrating_vm][crate::model::StartMigrationRequest::migrating_vm].
2592        ///
2593        /// This is a **required** field for requests.
2594        pub fn set_migrating_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
2595            self.0.request.migrating_vm = v.into();
2596            self
2597        }
2598    }
2599
2600    #[doc(hidden)]
2601    impl crate::RequestBuilder for StartMigration {
2602        fn request_options(&mut self) -> &mut crate::RequestOptions {
2603            &mut self.0.options
2604        }
2605    }
2606
2607    /// The request builder for [VmMigration::resume_migration][crate::client::VmMigration::resume_migration] calls.
2608    ///
2609    /// # Example
2610    /// ```
2611    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ResumeMigration;
2612    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2613    /// use google_cloud_lro::Poller;
2614    ///
2615    /// let builder = prepare_request_builder();
2616    /// let response = builder.poller().until_done().await?;
2617    /// # Ok(()) }
2618    ///
2619    /// fn prepare_request_builder() -> ResumeMigration {
2620    ///   # panic!();
2621    ///   // ... details omitted ...
2622    /// }
2623    /// ```
2624    #[derive(Clone, Debug)]
2625    pub struct ResumeMigration(RequestBuilder<crate::model::ResumeMigrationRequest>);
2626
2627    impl ResumeMigration {
2628        pub(crate) fn new(
2629            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2630        ) -> Self {
2631            Self(RequestBuilder::new(stub))
2632        }
2633
2634        /// Sets the full request, replacing any prior values.
2635        pub fn with_request<V: Into<crate::model::ResumeMigrationRequest>>(mut self, v: V) -> Self {
2636            self.0.request = v.into();
2637            self
2638        }
2639
2640        /// Sets all the options, replacing any prior values.
2641        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2642            self.0.options = v.into();
2643            self
2644        }
2645
2646        /// Sends the request.
2647        ///
2648        /// # Long running operations
2649        ///
2650        /// This starts, but does not poll, a longrunning operation. More information
2651        /// on [resume_migration][crate::client::VmMigration::resume_migration].
2652        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2653            (*self.0.stub)
2654                .resume_migration(self.0.request, self.0.options)
2655                .await
2656                .map(crate::Response::into_body)
2657        }
2658
2659        /// Creates a [Poller][google_cloud_lro::Poller] to work with `resume_migration`.
2660        pub fn poller(
2661            self,
2662        ) -> impl google_cloud_lro::Poller<
2663            crate::model::ResumeMigrationResponse,
2664            crate::model::OperationMetadata,
2665        > {
2666            type Operation = google_cloud_lro::internal::Operation<
2667                crate::model::ResumeMigrationResponse,
2668                crate::model::OperationMetadata,
2669            >;
2670            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2671            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2672
2673            let stub = self.0.stub.clone();
2674            let mut options = self.0.options.clone();
2675            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2676            let query = move |name| {
2677                let stub = stub.clone();
2678                let options = options.clone();
2679                async {
2680                    let op = GetOperation::new(stub)
2681                        .set_name(name)
2682                        .with_options(options)
2683                        .send()
2684                        .await?;
2685                    Ok(Operation::new(op))
2686                }
2687            };
2688
2689            let start = move || async {
2690                let op = self.send().await?;
2691                Ok(Operation::new(op))
2692            };
2693
2694            google_cloud_lro::internal::new_poller(
2695                polling_error_policy,
2696                polling_backoff_policy,
2697                start,
2698                query,
2699            )
2700        }
2701
2702        /// Sets the value of [migrating_vm][crate::model::ResumeMigrationRequest::migrating_vm].
2703        ///
2704        /// This is a **required** field for requests.
2705        pub fn set_migrating_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
2706            self.0.request.migrating_vm = v.into();
2707            self
2708        }
2709    }
2710
2711    #[doc(hidden)]
2712    impl crate::RequestBuilder for ResumeMigration {
2713        fn request_options(&mut self) -> &mut crate::RequestOptions {
2714            &mut self.0.options
2715        }
2716    }
2717
2718    /// The request builder for [VmMigration::pause_migration][crate::client::VmMigration::pause_migration] calls.
2719    ///
2720    /// # Example
2721    /// ```
2722    /// # use google_cloud_vmmigration_v1::builder::vm_migration::PauseMigration;
2723    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2724    /// use google_cloud_lro::Poller;
2725    ///
2726    /// let builder = prepare_request_builder();
2727    /// let response = builder.poller().until_done().await?;
2728    /// # Ok(()) }
2729    ///
2730    /// fn prepare_request_builder() -> PauseMigration {
2731    ///   # panic!();
2732    ///   // ... details omitted ...
2733    /// }
2734    /// ```
2735    #[derive(Clone, Debug)]
2736    pub struct PauseMigration(RequestBuilder<crate::model::PauseMigrationRequest>);
2737
2738    impl PauseMigration {
2739        pub(crate) fn new(
2740            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2741        ) -> Self {
2742            Self(RequestBuilder::new(stub))
2743        }
2744
2745        /// Sets the full request, replacing any prior values.
2746        pub fn with_request<V: Into<crate::model::PauseMigrationRequest>>(mut self, v: V) -> Self {
2747            self.0.request = v.into();
2748            self
2749        }
2750
2751        /// Sets all the options, replacing any prior values.
2752        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2753            self.0.options = v.into();
2754            self
2755        }
2756
2757        /// Sends the request.
2758        ///
2759        /// # Long running operations
2760        ///
2761        /// This starts, but does not poll, a longrunning operation. More information
2762        /// on [pause_migration][crate::client::VmMigration::pause_migration].
2763        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2764            (*self.0.stub)
2765                .pause_migration(self.0.request, self.0.options)
2766                .await
2767                .map(crate::Response::into_body)
2768        }
2769
2770        /// Creates a [Poller][google_cloud_lro::Poller] to work with `pause_migration`.
2771        pub fn poller(
2772            self,
2773        ) -> impl google_cloud_lro::Poller<
2774            crate::model::PauseMigrationResponse,
2775            crate::model::OperationMetadata,
2776        > {
2777            type Operation = google_cloud_lro::internal::Operation<
2778                crate::model::PauseMigrationResponse,
2779                crate::model::OperationMetadata,
2780            >;
2781            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2782            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2783
2784            let stub = self.0.stub.clone();
2785            let mut options = self.0.options.clone();
2786            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2787            let query = move |name| {
2788                let stub = stub.clone();
2789                let options = options.clone();
2790                async {
2791                    let op = GetOperation::new(stub)
2792                        .set_name(name)
2793                        .with_options(options)
2794                        .send()
2795                        .await?;
2796                    Ok(Operation::new(op))
2797                }
2798            };
2799
2800            let start = move || async {
2801                let op = self.send().await?;
2802                Ok(Operation::new(op))
2803            };
2804
2805            google_cloud_lro::internal::new_poller(
2806                polling_error_policy,
2807                polling_backoff_policy,
2808                start,
2809                query,
2810            )
2811        }
2812
2813        /// Sets the value of [migrating_vm][crate::model::PauseMigrationRequest::migrating_vm].
2814        ///
2815        /// This is a **required** field for requests.
2816        pub fn set_migrating_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
2817            self.0.request.migrating_vm = v.into();
2818            self
2819        }
2820    }
2821
2822    #[doc(hidden)]
2823    impl crate::RequestBuilder for PauseMigration {
2824        fn request_options(&mut self) -> &mut crate::RequestOptions {
2825            &mut self.0.options
2826        }
2827    }
2828
2829    /// The request builder for [VmMigration::finalize_migration][crate::client::VmMigration::finalize_migration] calls.
2830    ///
2831    /// # Example
2832    /// ```
2833    /// # use google_cloud_vmmigration_v1::builder::vm_migration::FinalizeMigration;
2834    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2835    /// use google_cloud_lro::Poller;
2836    ///
2837    /// let builder = prepare_request_builder();
2838    /// let response = builder.poller().until_done().await?;
2839    /// # Ok(()) }
2840    ///
2841    /// fn prepare_request_builder() -> FinalizeMigration {
2842    ///   # panic!();
2843    ///   // ... details omitted ...
2844    /// }
2845    /// ```
2846    #[derive(Clone, Debug)]
2847    pub struct FinalizeMigration(RequestBuilder<crate::model::FinalizeMigrationRequest>);
2848
2849    impl FinalizeMigration {
2850        pub(crate) fn new(
2851            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2852        ) -> Self {
2853            Self(RequestBuilder::new(stub))
2854        }
2855
2856        /// Sets the full request, replacing any prior values.
2857        pub fn with_request<V: Into<crate::model::FinalizeMigrationRequest>>(
2858            mut self,
2859            v: V,
2860        ) -> Self {
2861            self.0.request = v.into();
2862            self
2863        }
2864
2865        /// Sets all the options, replacing any prior values.
2866        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2867            self.0.options = v.into();
2868            self
2869        }
2870
2871        /// Sends the request.
2872        ///
2873        /// # Long running operations
2874        ///
2875        /// This starts, but does not poll, a longrunning operation. More information
2876        /// on [finalize_migration][crate::client::VmMigration::finalize_migration].
2877        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2878            (*self.0.stub)
2879                .finalize_migration(self.0.request, self.0.options)
2880                .await
2881                .map(crate::Response::into_body)
2882        }
2883
2884        /// Creates a [Poller][google_cloud_lro::Poller] to work with `finalize_migration`.
2885        pub fn poller(
2886            self,
2887        ) -> impl google_cloud_lro::Poller<
2888            crate::model::FinalizeMigrationResponse,
2889            crate::model::OperationMetadata,
2890        > {
2891            type Operation = google_cloud_lro::internal::Operation<
2892                crate::model::FinalizeMigrationResponse,
2893                crate::model::OperationMetadata,
2894            >;
2895            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2896            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2897
2898            let stub = self.0.stub.clone();
2899            let mut options = self.0.options.clone();
2900            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2901            let query = move |name| {
2902                let stub = stub.clone();
2903                let options = options.clone();
2904                async {
2905                    let op = GetOperation::new(stub)
2906                        .set_name(name)
2907                        .with_options(options)
2908                        .send()
2909                        .await?;
2910                    Ok(Operation::new(op))
2911                }
2912            };
2913
2914            let start = move || async {
2915                let op = self.send().await?;
2916                Ok(Operation::new(op))
2917            };
2918
2919            google_cloud_lro::internal::new_poller(
2920                polling_error_policy,
2921                polling_backoff_policy,
2922                start,
2923                query,
2924            )
2925        }
2926
2927        /// Sets the value of [migrating_vm][crate::model::FinalizeMigrationRequest::migrating_vm].
2928        ///
2929        /// This is a **required** field for requests.
2930        pub fn set_migrating_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
2931            self.0.request.migrating_vm = v.into();
2932            self
2933        }
2934    }
2935
2936    #[doc(hidden)]
2937    impl crate::RequestBuilder for FinalizeMigration {
2938        fn request_options(&mut self) -> &mut crate::RequestOptions {
2939            &mut self.0.options
2940        }
2941    }
2942
2943    /// The request builder for [VmMigration::extend_migration][crate::client::VmMigration::extend_migration] calls.
2944    ///
2945    /// # Example
2946    /// ```
2947    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ExtendMigration;
2948    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
2949    /// use google_cloud_lro::Poller;
2950    ///
2951    /// let builder = prepare_request_builder();
2952    /// let response = builder.poller().until_done().await?;
2953    /// # Ok(()) }
2954    ///
2955    /// fn prepare_request_builder() -> ExtendMigration {
2956    ///   # panic!();
2957    ///   // ... details omitted ...
2958    /// }
2959    /// ```
2960    #[derive(Clone, Debug)]
2961    pub struct ExtendMigration(RequestBuilder<crate::model::ExtendMigrationRequest>);
2962
2963    impl ExtendMigration {
2964        pub(crate) fn new(
2965            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
2966        ) -> Self {
2967            Self(RequestBuilder::new(stub))
2968        }
2969
2970        /// Sets the full request, replacing any prior values.
2971        pub fn with_request<V: Into<crate::model::ExtendMigrationRequest>>(mut self, v: V) -> Self {
2972            self.0.request = v.into();
2973            self
2974        }
2975
2976        /// Sets all the options, replacing any prior values.
2977        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2978            self.0.options = v.into();
2979            self
2980        }
2981
2982        /// Sends the request.
2983        ///
2984        /// # Long running operations
2985        ///
2986        /// This starts, but does not poll, a longrunning operation. More information
2987        /// on [extend_migration][crate::client::VmMigration::extend_migration].
2988        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2989            (*self.0.stub)
2990                .extend_migration(self.0.request, self.0.options)
2991                .await
2992                .map(crate::Response::into_body)
2993        }
2994
2995        /// Creates a [Poller][google_cloud_lro::Poller] to work with `extend_migration`.
2996        pub fn poller(
2997            self,
2998        ) -> impl google_cloud_lro::Poller<
2999            crate::model::ExtendMigrationResponse,
3000            crate::model::OperationMetadata,
3001        > {
3002            type Operation = google_cloud_lro::internal::Operation<
3003                crate::model::ExtendMigrationResponse,
3004                crate::model::OperationMetadata,
3005            >;
3006            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3007            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3008
3009            let stub = self.0.stub.clone();
3010            let mut options = self.0.options.clone();
3011            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3012            let query = move |name| {
3013                let stub = stub.clone();
3014                let options = options.clone();
3015                async {
3016                    let op = GetOperation::new(stub)
3017                        .set_name(name)
3018                        .with_options(options)
3019                        .send()
3020                        .await?;
3021                    Ok(Operation::new(op))
3022                }
3023            };
3024
3025            let start = move || async {
3026                let op = self.send().await?;
3027                Ok(Operation::new(op))
3028            };
3029
3030            google_cloud_lro::internal::new_poller(
3031                polling_error_policy,
3032                polling_backoff_policy,
3033                start,
3034                query,
3035            )
3036        }
3037
3038        /// Sets the value of [migrating_vm][crate::model::ExtendMigrationRequest::migrating_vm].
3039        ///
3040        /// This is a **required** field for requests.
3041        pub fn set_migrating_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
3042            self.0.request.migrating_vm = v.into();
3043            self
3044        }
3045    }
3046
3047    #[doc(hidden)]
3048    impl crate::RequestBuilder for ExtendMigration {
3049        fn request_options(&mut self) -> &mut crate::RequestOptions {
3050            &mut self.0.options
3051        }
3052    }
3053
3054    /// The request builder for [VmMigration::create_clone_job][crate::client::VmMigration::create_clone_job] calls.
3055    ///
3056    /// # Example
3057    /// ```
3058    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateCloneJob;
3059    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3060    /// use google_cloud_lro::Poller;
3061    ///
3062    /// let builder = prepare_request_builder();
3063    /// let response = builder.poller().until_done().await?;
3064    /// # Ok(()) }
3065    ///
3066    /// fn prepare_request_builder() -> CreateCloneJob {
3067    ///   # panic!();
3068    ///   // ... details omitted ...
3069    /// }
3070    /// ```
3071    #[derive(Clone, Debug)]
3072    pub struct CreateCloneJob(RequestBuilder<crate::model::CreateCloneJobRequest>);
3073
3074    impl CreateCloneJob {
3075        pub(crate) fn new(
3076            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3077        ) -> Self {
3078            Self(RequestBuilder::new(stub))
3079        }
3080
3081        /// Sets the full request, replacing any prior values.
3082        pub fn with_request<V: Into<crate::model::CreateCloneJobRequest>>(mut self, v: V) -> Self {
3083            self.0.request = v.into();
3084            self
3085        }
3086
3087        /// Sets all the options, replacing any prior values.
3088        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3089            self.0.options = v.into();
3090            self
3091        }
3092
3093        /// Sends the request.
3094        ///
3095        /// # Long running operations
3096        ///
3097        /// This starts, but does not poll, a longrunning operation. More information
3098        /// on [create_clone_job][crate::client::VmMigration::create_clone_job].
3099        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3100            (*self.0.stub)
3101                .create_clone_job(self.0.request, self.0.options)
3102                .await
3103                .map(crate::Response::into_body)
3104        }
3105
3106        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_clone_job`.
3107        pub fn poller(
3108            self,
3109        ) -> impl google_cloud_lro::Poller<crate::model::CloneJob, crate::model::OperationMetadata>
3110        {
3111            type Operation = google_cloud_lro::internal::Operation<
3112                crate::model::CloneJob,
3113                crate::model::OperationMetadata,
3114            >;
3115            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3116            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3117
3118            let stub = self.0.stub.clone();
3119            let mut options = self.0.options.clone();
3120            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3121            let query = move |name| {
3122                let stub = stub.clone();
3123                let options = options.clone();
3124                async {
3125                    let op = GetOperation::new(stub)
3126                        .set_name(name)
3127                        .with_options(options)
3128                        .send()
3129                        .await?;
3130                    Ok(Operation::new(op))
3131                }
3132            };
3133
3134            let start = move || async {
3135                let op = self.send().await?;
3136                Ok(Operation::new(op))
3137            };
3138
3139            google_cloud_lro::internal::new_poller(
3140                polling_error_policy,
3141                polling_backoff_policy,
3142                start,
3143                query,
3144            )
3145        }
3146
3147        /// Sets the value of [parent][crate::model::CreateCloneJobRequest::parent].
3148        ///
3149        /// This is a **required** field for requests.
3150        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3151            self.0.request.parent = v.into();
3152            self
3153        }
3154
3155        /// Sets the value of [clone_job_id][crate::model::CreateCloneJobRequest::clone_job_id].
3156        ///
3157        /// This is a **required** field for requests.
3158        pub fn set_clone_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3159            self.0.request.clone_job_id = v.into();
3160            self
3161        }
3162
3163        /// Sets the value of [clone_job][crate::model::CreateCloneJobRequest::clone_job].
3164        ///
3165        /// This is a **required** field for requests.
3166        pub fn set_clone_job<T>(mut self, v: T) -> Self
3167        where
3168            T: std::convert::Into<crate::model::CloneJob>,
3169        {
3170            self.0.request.clone_job = std::option::Option::Some(v.into());
3171            self
3172        }
3173
3174        /// Sets or clears the value of [clone_job][crate::model::CreateCloneJobRequest::clone_job].
3175        ///
3176        /// This is a **required** field for requests.
3177        pub fn set_or_clear_clone_job<T>(mut self, v: std::option::Option<T>) -> Self
3178        where
3179            T: std::convert::Into<crate::model::CloneJob>,
3180        {
3181            self.0.request.clone_job = v.map(|x| x.into());
3182            self
3183        }
3184
3185        /// Sets the value of [request_id][crate::model::CreateCloneJobRequest::request_id].
3186        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3187            self.0.request.request_id = v.into();
3188            self
3189        }
3190    }
3191
3192    #[doc(hidden)]
3193    impl crate::RequestBuilder for CreateCloneJob {
3194        fn request_options(&mut self) -> &mut crate::RequestOptions {
3195            &mut self.0.options
3196        }
3197    }
3198
3199    /// The request builder for [VmMigration::cancel_clone_job][crate::client::VmMigration::cancel_clone_job] calls.
3200    ///
3201    /// # Example
3202    /// ```
3203    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CancelCloneJob;
3204    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3205    /// use google_cloud_lro::Poller;
3206    ///
3207    /// let builder = prepare_request_builder();
3208    /// let response = builder.poller().until_done().await?;
3209    /// # Ok(()) }
3210    ///
3211    /// fn prepare_request_builder() -> CancelCloneJob {
3212    ///   # panic!();
3213    ///   // ... details omitted ...
3214    /// }
3215    /// ```
3216    #[derive(Clone, Debug)]
3217    pub struct CancelCloneJob(RequestBuilder<crate::model::CancelCloneJobRequest>);
3218
3219    impl CancelCloneJob {
3220        pub(crate) fn new(
3221            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3222        ) -> Self {
3223            Self(RequestBuilder::new(stub))
3224        }
3225
3226        /// Sets the full request, replacing any prior values.
3227        pub fn with_request<V: Into<crate::model::CancelCloneJobRequest>>(mut self, v: V) -> Self {
3228            self.0.request = v.into();
3229            self
3230        }
3231
3232        /// Sets all the options, replacing any prior values.
3233        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3234            self.0.options = v.into();
3235            self
3236        }
3237
3238        /// Sends the request.
3239        ///
3240        /// # Long running operations
3241        ///
3242        /// This starts, but does not poll, a longrunning operation. More information
3243        /// on [cancel_clone_job][crate::client::VmMigration::cancel_clone_job].
3244        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3245            (*self.0.stub)
3246                .cancel_clone_job(self.0.request, self.0.options)
3247                .await
3248                .map(crate::Response::into_body)
3249        }
3250
3251        /// Creates a [Poller][google_cloud_lro::Poller] to work with `cancel_clone_job`.
3252        pub fn poller(
3253            self,
3254        ) -> impl google_cloud_lro::Poller<
3255            crate::model::CancelCloneJobResponse,
3256            crate::model::OperationMetadata,
3257        > {
3258            type Operation = google_cloud_lro::internal::Operation<
3259                crate::model::CancelCloneJobResponse,
3260                crate::model::OperationMetadata,
3261            >;
3262            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3263            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3264
3265            let stub = self.0.stub.clone();
3266            let mut options = self.0.options.clone();
3267            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3268            let query = move |name| {
3269                let stub = stub.clone();
3270                let options = options.clone();
3271                async {
3272                    let op = GetOperation::new(stub)
3273                        .set_name(name)
3274                        .with_options(options)
3275                        .send()
3276                        .await?;
3277                    Ok(Operation::new(op))
3278                }
3279            };
3280
3281            let start = move || async {
3282                let op = self.send().await?;
3283                Ok(Operation::new(op))
3284            };
3285
3286            google_cloud_lro::internal::new_poller(
3287                polling_error_policy,
3288                polling_backoff_policy,
3289                start,
3290                query,
3291            )
3292        }
3293
3294        /// Sets the value of [name][crate::model::CancelCloneJobRequest::name].
3295        ///
3296        /// This is a **required** field for requests.
3297        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3298            self.0.request.name = v.into();
3299            self
3300        }
3301    }
3302
3303    #[doc(hidden)]
3304    impl crate::RequestBuilder for CancelCloneJob {
3305        fn request_options(&mut self) -> &mut crate::RequestOptions {
3306            &mut self.0.options
3307        }
3308    }
3309
3310    /// The request builder for [VmMigration::list_clone_jobs][crate::client::VmMigration::list_clone_jobs] calls.
3311    ///
3312    /// # Example
3313    /// ```
3314    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListCloneJobs;
3315    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3316    /// use google_cloud_gax::paginator::ItemPaginator;
3317    ///
3318    /// let builder = prepare_request_builder();
3319    /// let mut items = builder.by_item();
3320    /// while let Some(result) = items.next().await {
3321    ///   let item = result?;
3322    /// }
3323    /// # Ok(()) }
3324    ///
3325    /// fn prepare_request_builder() -> ListCloneJobs {
3326    ///   # panic!();
3327    ///   // ... details omitted ...
3328    /// }
3329    /// ```
3330    #[derive(Clone, Debug)]
3331    pub struct ListCloneJobs(RequestBuilder<crate::model::ListCloneJobsRequest>);
3332
3333    impl ListCloneJobs {
3334        pub(crate) fn new(
3335            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3336        ) -> Self {
3337            Self(RequestBuilder::new(stub))
3338        }
3339
3340        /// Sets the full request, replacing any prior values.
3341        pub fn with_request<V: Into<crate::model::ListCloneJobsRequest>>(mut self, v: V) -> Self {
3342            self.0.request = v.into();
3343            self
3344        }
3345
3346        /// Sets all the options, replacing any prior values.
3347        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3348            self.0.options = v.into();
3349            self
3350        }
3351
3352        /// Sends the request.
3353        pub async fn send(self) -> Result<crate::model::ListCloneJobsResponse> {
3354            (*self.0.stub)
3355                .list_clone_jobs(self.0.request, self.0.options)
3356                .await
3357                .map(crate::Response::into_body)
3358        }
3359
3360        /// Streams each page in the collection.
3361        pub fn by_page(
3362            self,
3363        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListCloneJobsResponse, crate::Error>
3364        {
3365            use std::clone::Clone;
3366            let token = self.0.request.page_token.clone();
3367            let execute = move |token: String| {
3368                let mut builder = self.clone();
3369                builder.0.request = builder.0.request.set_page_token(token);
3370                builder.send()
3371            };
3372            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3373        }
3374
3375        /// Streams each item in the collection.
3376        pub fn by_item(
3377            self,
3378        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3379            crate::model::ListCloneJobsResponse,
3380            crate::Error,
3381        > {
3382            use google_cloud_gax::paginator::Paginator;
3383            self.by_page().items()
3384        }
3385
3386        /// Sets the value of [parent][crate::model::ListCloneJobsRequest::parent].
3387        ///
3388        /// This is a **required** field for requests.
3389        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3390            self.0.request.parent = v.into();
3391            self
3392        }
3393
3394        /// Sets the value of [page_size][crate::model::ListCloneJobsRequest::page_size].
3395        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3396            self.0.request.page_size = v.into();
3397            self
3398        }
3399
3400        /// Sets the value of [page_token][crate::model::ListCloneJobsRequest::page_token].
3401        ///
3402        /// This is a **required** field for requests.
3403        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3404            self.0.request.page_token = v.into();
3405            self
3406        }
3407
3408        /// Sets the value of [filter][crate::model::ListCloneJobsRequest::filter].
3409        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3410            self.0.request.filter = v.into();
3411            self
3412        }
3413
3414        /// Sets the value of [order_by][crate::model::ListCloneJobsRequest::order_by].
3415        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3416            self.0.request.order_by = v.into();
3417            self
3418        }
3419    }
3420
3421    #[doc(hidden)]
3422    impl crate::RequestBuilder for ListCloneJobs {
3423        fn request_options(&mut self) -> &mut crate::RequestOptions {
3424            &mut self.0.options
3425        }
3426    }
3427
3428    /// The request builder for [VmMigration::get_clone_job][crate::client::VmMigration::get_clone_job] calls.
3429    ///
3430    /// # Example
3431    /// ```
3432    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetCloneJob;
3433    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3434    ///
3435    /// let builder = prepare_request_builder();
3436    /// let response = builder.send().await?;
3437    /// # Ok(()) }
3438    ///
3439    /// fn prepare_request_builder() -> GetCloneJob {
3440    ///   # panic!();
3441    ///   // ... details omitted ...
3442    /// }
3443    /// ```
3444    #[derive(Clone, Debug)]
3445    pub struct GetCloneJob(RequestBuilder<crate::model::GetCloneJobRequest>);
3446
3447    impl GetCloneJob {
3448        pub(crate) fn new(
3449            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3450        ) -> Self {
3451            Self(RequestBuilder::new(stub))
3452        }
3453
3454        /// Sets the full request, replacing any prior values.
3455        pub fn with_request<V: Into<crate::model::GetCloneJobRequest>>(mut self, v: V) -> Self {
3456            self.0.request = v.into();
3457            self
3458        }
3459
3460        /// Sets all the options, replacing any prior values.
3461        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3462            self.0.options = v.into();
3463            self
3464        }
3465
3466        /// Sends the request.
3467        pub async fn send(self) -> Result<crate::model::CloneJob> {
3468            (*self.0.stub)
3469                .get_clone_job(self.0.request, self.0.options)
3470                .await
3471                .map(crate::Response::into_body)
3472        }
3473
3474        /// Sets the value of [name][crate::model::GetCloneJobRequest::name].
3475        ///
3476        /// This is a **required** field for requests.
3477        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3478            self.0.request.name = v.into();
3479            self
3480        }
3481    }
3482
3483    #[doc(hidden)]
3484    impl crate::RequestBuilder for GetCloneJob {
3485        fn request_options(&mut self) -> &mut crate::RequestOptions {
3486            &mut self.0.options
3487        }
3488    }
3489
3490    /// The request builder for [VmMigration::create_cutover_job][crate::client::VmMigration::create_cutover_job] calls.
3491    ///
3492    /// # Example
3493    /// ```
3494    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateCutoverJob;
3495    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3496    /// use google_cloud_lro::Poller;
3497    ///
3498    /// let builder = prepare_request_builder();
3499    /// let response = builder.poller().until_done().await?;
3500    /// # Ok(()) }
3501    ///
3502    /// fn prepare_request_builder() -> CreateCutoverJob {
3503    ///   # panic!();
3504    ///   // ... details omitted ...
3505    /// }
3506    /// ```
3507    #[derive(Clone, Debug)]
3508    pub struct CreateCutoverJob(RequestBuilder<crate::model::CreateCutoverJobRequest>);
3509
3510    impl CreateCutoverJob {
3511        pub(crate) fn new(
3512            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3513        ) -> Self {
3514            Self(RequestBuilder::new(stub))
3515        }
3516
3517        /// Sets the full request, replacing any prior values.
3518        pub fn with_request<V: Into<crate::model::CreateCutoverJobRequest>>(
3519            mut self,
3520            v: V,
3521        ) -> Self {
3522            self.0.request = v.into();
3523            self
3524        }
3525
3526        /// Sets all the options, replacing any prior values.
3527        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3528            self.0.options = v.into();
3529            self
3530        }
3531
3532        /// Sends the request.
3533        ///
3534        /// # Long running operations
3535        ///
3536        /// This starts, but does not poll, a longrunning operation. More information
3537        /// on [create_cutover_job][crate::client::VmMigration::create_cutover_job].
3538        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3539            (*self.0.stub)
3540                .create_cutover_job(self.0.request, self.0.options)
3541                .await
3542                .map(crate::Response::into_body)
3543        }
3544
3545        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_cutover_job`.
3546        pub fn poller(
3547            self,
3548        ) -> impl google_cloud_lro::Poller<crate::model::CutoverJob, crate::model::OperationMetadata>
3549        {
3550            type Operation = google_cloud_lro::internal::Operation<
3551                crate::model::CutoverJob,
3552                crate::model::OperationMetadata,
3553            >;
3554            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3555            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3556
3557            let stub = self.0.stub.clone();
3558            let mut options = self.0.options.clone();
3559            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3560            let query = move |name| {
3561                let stub = stub.clone();
3562                let options = options.clone();
3563                async {
3564                    let op = GetOperation::new(stub)
3565                        .set_name(name)
3566                        .with_options(options)
3567                        .send()
3568                        .await?;
3569                    Ok(Operation::new(op))
3570                }
3571            };
3572
3573            let start = move || async {
3574                let op = self.send().await?;
3575                Ok(Operation::new(op))
3576            };
3577
3578            google_cloud_lro::internal::new_poller(
3579                polling_error_policy,
3580                polling_backoff_policy,
3581                start,
3582                query,
3583            )
3584        }
3585
3586        /// Sets the value of [parent][crate::model::CreateCutoverJobRequest::parent].
3587        ///
3588        /// This is a **required** field for requests.
3589        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3590            self.0.request.parent = v.into();
3591            self
3592        }
3593
3594        /// Sets the value of [cutover_job_id][crate::model::CreateCutoverJobRequest::cutover_job_id].
3595        ///
3596        /// This is a **required** field for requests.
3597        pub fn set_cutover_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3598            self.0.request.cutover_job_id = v.into();
3599            self
3600        }
3601
3602        /// Sets the value of [cutover_job][crate::model::CreateCutoverJobRequest::cutover_job].
3603        ///
3604        /// This is a **required** field for requests.
3605        pub fn set_cutover_job<T>(mut self, v: T) -> Self
3606        where
3607            T: std::convert::Into<crate::model::CutoverJob>,
3608        {
3609            self.0.request.cutover_job = std::option::Option::Some(v.into());
3610            self
3611        }
3612
3613        /// Sets or clears the value of [cutover_job][crate::model::CreateCutoverJobRequest::cutover_job].
3614        ///
3615        /// This is a **required** field for requests.
3616        pub fn set_or_clear_cutover_job<T>(mut self, v: std::option::Option<T>) -> Self
3617        where
3618            T: std::convert::Into<crate::model::CutoverJob>,
3619        {
3620            self.0.request.cutover_job = v.map(|x| x.into());
3621            self
3622        }
3623
3624        /// Sets the value of [request_id][crate::model::CreateCutoverJobRequest::request_id].
3625        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3626            self.0.request.request_id = v.into();
3627            self
3628        }
3629    }
3630
3631    #[doc(hidden)]
3632    impl crate::RequestBuilder for CreateCutoverJob {
3633        fn request_options(&mut self) -> &mut crate::RequestOptions {
3634            &mut self.0.options
3635        }
3636    }
3637
3638    /// The request builder for [VmMigration::cancel_cutover_job][crate::client::VmMigration::cancel_cutover_job] calls.
3639    ///
3640    /// # Example
3641    /// ```
3642    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CancelCutoverJob;
3643    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3644    /// use google_cloud_lro::Poller;
3645    ///
3646    /// let builder = prepare_request_builder();
3647    /// let response = builder.poller().until_done().await?;
3648    /// # Ok(()) }
3649    ///
3650    /// fn prepare_request_builder() -> CancelCutoverJob {
3651    ///   # panic!();
3652    ///   // ... details omitted ...
3653    /// }
3654    /// ```
3655    #[derive(Clone, Debug)]
3656    pub struct CancelCutoverJob(RequestBuilder<crate::model::CancelCutoverJobRequest>);
3657
3658    impl CancelCutoverJob {
3659        pub(crate) fn new(
3660            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3661        ) -> Self {
3662            Self(RequestBuilder::new(stub))
3663        }
3664
3665        /// Sets the full request, replacing any prior values.
3666        pub fn with_request<V: Into<crate::model::CancelCutoverJobRequest>>(
3667            mut self,
3668            v: V,
3669        ) -> Self {
3670            self.0.request = v.into();
3671            self
3672        }
3673
3674        /// Sets all the options, replacing any prior values.
3675        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3676            self.0.options = v.into();
3677            self
3678        }
3679
3680        /// Sends the request.
3681        ///
3682        /// # Long running operations
3683        ///
3684        /// This starts, but does not poll, a longrunning operation. More information
3685        /// on [cancel_cutover_job][crate::client::VmMigration::cancel_cutover_job].
3686        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3687            (*self.0.stub)
3688                .cancel_cutover_job(self.0.request, self.0.options)
3689                .await
3690                .map(crate::Response::into_body)
3691        }
3692
3693        /// Creates a [Poller][google_cloud_lro::Poller] to work with `cancel_cutover_job`.
3694        pub fn poller(
3695            self,
3696        ) -> impl google_cloud_lro::Poller<
3697            crate::model::CancelCutoverJobResponse,
3698            crate::model::OperationMetadata,
3699        > {
3700            type Operation = google_cloud_lro::internal::Operation<
3701                crate::model::CancelCutoverJobResponse,
3702                crate::model::OperationMetadata,
3703            >;
3704            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3705            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3706
3707            let stub = self.0.stub.clone();
3708            let mut options = self.0.options.clone();
3709            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3710            let query = move |name| {
3711                let stub = stub.clone();
3712                let options = options.clone();
3713                async {
3714                    let op = GetOperation::new(stub)
3715                        .set_name(name)
3716                        .with_options(options)
3717                        .send()
3718                        .await?;
3719                    Ok(Operation::new(op))
3720                }
3721            };
3722
3723            let start = move || async {
3724                let op = self.send().await?;
3725                Ok(Operation::new(op))
3726            };
3727
3728            google_cloud_lro::internal::new_poller(
3729                polling_error_policy,
3730                polling_backoff_policy,
3731                start,
3732                query,
3733            )
3734        }
3735
3736        /// Sets the value of [name][crate::model::CancelCutoverJobRequest::name].
3737        ///
3738        /// This is a **required** field for requests.
3739        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3740            self.0.request.name = v.into();
3741            self
3742        }
3743    }
3744
3745    #[doc(hidden)]
3746    impl crate::RequestBuilder for CancelCutoverJob {
3747        fn request_options(&mut self) -> &mut crate::RequestOptions {
3748            &mut self.0.options
3749        }
3750    }
3751
3752    /// The request builder for [VmMigration::list_cutover_jobs][crate::client::VmMigration::list_cutover_jobs] calls.
3753    ///
3754    /// # Example
3755    /// ```
3756    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListCutoverJobs;
3757    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3758    /// use google_cloud_gax::paginator::ItemPaginator;
3759    ///
3760    /// let builder = prepare_request_builder();
3761    /// let mut items = builder.by_item();
3762    /// while let Some(result) = items.next().await {
3763    ///   let item = result?;
3764    /// }
3765    /// # Ok(()) }
3766    ///
3767    /// fn prepare_request_builder() -> ListCutoverJobs {
3768    ///   # panic!();
3769    ///   // ... details omitted ...
3770    /// }
3771    /// ```
3772    #[derive(Clone, Debug)]
3773    pub struct ListCutoverJobs(RequestBuilder<crate::model::ListCutoverJobsRequest>);
3774
3775    impl ListCutoverJobs {
3776        pub(crate) fn new(
3777            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3778        ) -> Self {
3779            Self(RequestBuilder::new(stub))
3780        }
3781
3782        /// Sets the full request, replacing any prior values.
3783        pub fn with_request<V: Into<crate::model::ListCutoverJobsRequest>>(mut self, v: V) -> Self {
3784            self.0.request = v.into();
3785            self
3786        }
3787
3788        /// Sets all the options, replacing any prior values.
3789        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3790            self.0.options = v.into();
3791            self
3792        }
3793
3794        /// Sends the request.
3795        pub async fn send(self) -> Result<crate::model::ListCutoverJobsResponse> {
3796            (*self.0.stub)
3797                .list_cutover_jobs(self.0.request, self.0.options)
3798                .await
3799                .map(crate::Response::into_body)
3800        }
3801
3802        /// Streams each page in the collection.
3803        pub fn by_page(
3804            self,
3805        ) -> impl google_cloud_gax::paginator::Paginator<
3806            crate::model::ListCutoverJobsResponse,
3807            crate::Error,
3808        > {
3809            use std::clone::Clone;
3810            let token = self.0.request.page_token.clone();
3811            let execute = move |token: String| {
3812                let mut builder = self.clone();
3813                builder.0.request = builder.0.request.set_page_token(token);
3814                builder.send()
3815            };
3816            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3817        }
3818
3819        /// Streams each item in the collection.
3820        pub fn by_item(
3821            self,
3822        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3823            crate::model::ListCutoverJobsResponse,
3824            crate::Error,
3825        > {
3826            use google_cloud_gax::paginator::Paginator;
3827            self.by_page().items()
3828        }
3829
3830        /// Sets the value of [parent][crate::model::ListCutoverJobsRequest::parent].
3831        ///
3832        /// This is a **required** field for requests.
3833        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3834            self.0.request.parent = v.into();
3835            self
3836        }
3837
3838        /// Sets the value of [page_size][crate::model::ListCutoverJobsRequest::page_size].
3839        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3840            self.0.request.page_size = v.into();
3841            self
3842        }
3843
3844        /// Sets the value of [page_token][crate::model::ListCutoverJobsRequest::page_token].
3845        ///
3846        /// This is a **required** field for requests.
3847        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3848            self.0.request.page_token = v.into();
3849            self
3850        }
3851
3852        /// Sets the value of [filter][crate::model::ListCutoverJobsRequest::filter].
3853        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3854            self.0.request.filter = v.into();
3855            self
3856        }
3857
3858        /// Sets the value of [order_by][crate::model::ListCutoverJobsRequest::order_by].
3859        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3860            self.0.request.order_by = v.into();
3861            self
3862        }
3863    }
3864
3865    #[doc(hidden)]
3866    impl crate::RequestBuilder for ListCutoverJobs {
3867        fn request_options(&mut self) -> &mut crate::RequestOptions {
3868            &mut self.0.options
3869        }
3870    }
3871
3872    /// The request builder for [VmMigration::get_cutover_job][crate::client::VmMigration::get_cutover_job] calls.
3873    ///
3874    /// # Example
3875    /// ```
3876    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetCutoverJob;
3877    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3878    ///
3879    /// let builder = prepare_request_builder();
3880    /// let response = builder.send().await?;
3881    /// # Ok(()) }
3882    ///
3883    /// fn prepare_request_builder() -> GetCutoverJob {
3884    ///   # panic!();
3885    ///   // ... details omitted ...
3886    /// }
3887    /// ```
3888    #[derive(Clone, Debug)]
3889    pub struct GetCutoverJob(RequestBuilder<crate::model::GetCutoverJobRequest>);
3890
3891    impl GetCutoverJob {
3892        pub(crate) fn new(
3893            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3894        ) -> Self {
3895            Self(RequestBuilder::new(stub))
3896        }
3897
3898        /// Sets the full request, replacing any prior values.
3899        pub fn with_request<V: Into<crate::model::GetCutoverJobRequest>>(mut self, v: V) -> Self {
3900            self.0.request = v.into();
3901            self
3902        }
3903
3904        /// Sets all the options, replacing any prior values.
3905        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3906            self.0.options = v.into();
3907            self
3908        }
3909
3910        /// Sends the request.
3911        pub async fn send(self) -> Result<crate::model::CutoverJob> {
3912            (*self.0.stub)
3913                .get_cutover_job(self.0.request, self.0.options)
3914                .await
3915                .map(crate::Response::into_body)
3916        }
3917
3918        /// Sets the value of [name][crate::model::GetCutoverJobRequest::name].
3919        ///
3920        /// This is a **required** field for requests.
3921        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3922            self.0.request.name = v.into();
3923            self
3924        }
3925    }
3926
3927    #[doc(hidden)]
3928    impl crate::RequestBuilder for GetCutoverJob {
3929        fn request_options(&mut self) -> &mut crate::RequestOptions {
3930            &mut self.0.options
3931        }
3932    }
3933
3934    /// The request builder for [VmMigration::list_groups][crate::client::VmMigration::list_groups] calls.
3935    ///
3936    /// # Example
3937    /// ```
3938    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListGroups;
3939    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
3940    /// use google_cloud_gax::paginator::ItemPaginator;
3941    ///
3942    /// let builder = prepare_request_builder();
3943    /// let mut items = builder.by_item();
3944    /// while let Some(result) = items.next().await {
3945    ///   let item = result?;
3946    /// }
3947    /// # Ok(()) }
3948    ///
3949    /// fn prepare_request_builder() -> ListGroups {
3950    ///   # panic!();
3951    ///   // ... details omitted ...
3952    /// }
3953    /// ```
3954    #[derive(Clone, Debug)]
3955    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
3956
3957    impl ListGroups {
3958        pub(crate) fn new(
3959            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
3960        ) -> Self {
3961            Self(RequestBuilder::new(stub))
3962        }
3963
3964        /// Sets the full request, replacing any prior values.
3965        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
3966            self.0.request = v.into();
3967            self
3968        }
3969
3970        /// Sets all the options, replacing any prior values.
3971        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3972            self.0.options = v.into();
3973            self
3974        }
3975
3976        /// Sends the request.
3977        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
3978            (*self.0.stub)
3979                .list_groups(self.0.request, self.0.options)
3980                .await
3981                .map(crate::Response::into_body)
3982        }
3983
3984        /// Streams each page in the collection.
3985        pub fn by_page(
3986            self,
3987        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListGroupsResponse, crate::Error>
3988        {
3989            use std::clone::Clone;
3990            let token = self.0.request.page_token.clone();
3991            let execute = move |token: String| {
3992                let mut builder = self.clone();
3993                builder.0.request = builder.0.request.set_page_token(token);
3994                builder.send()
3995            };
3996            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3997        }
3998
3999        /// Streams each item in the collection.
4000        pub fn by_item(
4001            self,
4002        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4003            crate::model::ListGroupsResponse,
4004            crate::Error,
4005        > {
4006            use google_cloud_gax::paginator::Paginator;
4007            self.by_page().items()
4008        }
4009
4010        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
4011        ///
4012        /// This is a **required** field for requests.
4013        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4014            self.0.request.parent = v.into();
4015            self
4016        }
4017
4018        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
4019        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4020            self.0.request.page_size = v.into();
4021            self
4022        }
4023
4024        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
4025        ///
4026        /// This is a **required** field for requests.
4027        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4028            self.0.request.page_token = v.into();
4029            self
4030        }
4031
4032        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
4033        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4034            self.0.request.filter = v.into();
4035            self
4036        }
4037
4038        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
4039        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4040            self.0.request.order_by = v.into();
4041            self
4042        }
4043    }
4044
4045    #[doc(hidden)]
4046    impl crate::RequestBuilder for ListGroups {
4047        fn request_options(&mut self) -> &mut crate::RequestOptions {
4048            &mut self.0.options
4049        }
4050    }
4051
4052    /// The request builder for [VmMigration::get_group][crate::client::VmMigration::get_group] calls.
4053    ///
4054    /// # Example
4055    /// ```
4056    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetGroup;
4057    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4058    ///
4059    /// let builder = prepare_request_builder();
4060    /// let response = builder.send().await?;
4061    /// # Ok(()) }
4062    ///
4063    /// fn prepare_request_builder() -> GetGroup {
4064    ///   # panic!();
4065    ///   // ... details omitted ...
4066    /// }
4067    /// ```
4068    #[derive(Clone, Debug)]
4069    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
4070
4071    impl GetGroup {
4072        pub(crate) fn new(
4073            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4074        ) -> Self {
4075            Self(RequestBuilder::new(stub))
4076        }
4077
4078        /// Sets the full request, replacing any prior values.
4079        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
4080            self.0.request = v.into();
4081            self
4082        }
4083
4084        /// Sets all the options, replacing any prior values.
4085        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4086            self.0.options = v.into();
4087            self
4088        }
4089
4090        /// Sends the request.
4091        pub async fn send(self) -> Result<crate::model::Group> {
4092            (*self.0.stub)
4093                .get_group(self.0.request, self.0.options)
4094                .await
4095                .map(crate::Response::into_body)
4096        }
4097
4098        /// Sets the value of [name][crate::model::GetGroupRequest::name].
4099        ///
4100        /// This is a **required** field for requests.
4101        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4102            self.0.request.name = v.into();
4103            self
4104        }
4105    }
4106
4107    #[doc(hidden)]
4108    impl crate::RequestBuilder for GetGroup {
4109        fn request_options(&mut self) -> &mut crate::RequestOptions {
4110            &mut self.0.options
4111        }
4112    }
4113
4114    /// The request builder for [VmMigration::create_group][crate::client::VmMigration::create_group] calls.
4115    ///
4116    /// # Example
4117    /// ```
4118    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateGroup;
4119    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4120    /// use google_cloud_lro::Poller;
4121    ///
4122    /// let builder = prepare_request_builder();
4123    /// let response = builder.poller().until_done().await?;
4124    /// # Ok(()) }
4125    ///
4126    /// fn prepare_request_builder() -> CreateGroup {
4127    ///   # panic!();
4128    ///   // ... details omitted ...
4129    /// }
4130    /// ```
4131    #[derive(Clone, Debug)]
4132    pub struct CreateGroup(RequestBuilder<crate::model::CreateGroupRequest>);
4133
4134    impl CreateGroup {
4135        pub(crate) fn new(
4136            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4137        ) -> Self {
4138            Self(RequestBuilder::new(stub))
4139        }
4140
4141        /// Sets the full request, replacing any prior values.
4142        pub fn with_request<V: Into<crate::model::CreateGroupRequest>>(mut self, v: V) -> Self {
4143            self.0.request = v.into();
4144            self
4145        }
4146
4147        /// Sets all the options, replacing any prior values.
4148        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4149            self.0.options = v.into();
4150            self
4151        }
4152
4153        /// Sends the request.
4154        ///
4155        /// # Long running operations
4156        ///
4157        /// This starts, but does not poll, a longrunning operation. More information
4158        /// on [create_group][crate::client::VmMigration::create_group].
4159        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4160            (*self.0.stub)
4161                .create_group(self.0.request, self.0.options)
4162                .await
4163                .map(crate::Response::into_body)
4164        }
4165
4166        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_group`.
4167        pub fn poller(
4168            self,
4169        ) -> impl google_cloud_lro::Poller<crate::model::Group, crate::model::OperationMetadata>
4170        {
4171            type Operation = google_cloud_lro::internal::Operation<
4172                crate::model::Group,
4173                crate::model::OperationMetadata,
4174            >;
4175            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4176            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4177
4178            let stub = self.0.stub.clone();
4179            let mut options = self.0.options.clone();
4180            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4181            let query = move |name| {
4182                let stub = stub.clone();
4183                let options = options.clone();
4184                async {
4185                    let op = GetOperation::new(stub)
4186                        .set_name(name)
4187                        .with_options(options)
4188                        .send()
4189                        .await?;
4190                    Ok(Operation::new(op))
4191                }
4192            };
4193
4194            let start = move || async {
4195                let op = self.send().await?;
4196                Ok(Operation::new(op))
4197            };
4198
4199            google_cloud_lro::internal::new_poller(
4200                polling_error_policy,
4201                polling_backoff_policy,
4202                start,
4203                query,
4204            )
4205        }
4206
4207        /// Sets the value of [parent][crate::model::CreateGroupRequest::parent].
4208        ///
4209        /// This is a **required** field for requests.
4210        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4211            self.0.request.parent = v.into();
4212            self
4213        }
4214
4215        /// Sets the value of [group_id][crate::model::CreateGroupRequest::group_id].
4216        ///
4217        /// This is a **required** field for requests.
4218        pub fn set_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4219            self.0.request.group_id = v.into();
4220            self
4221        }
4222
4223        /// Sets the value of [group][crate::model::CreateGroupRequest::group].
4224        ///
4225        /// This is a **required** field for requests.
4226        pub fn set_group<T>(mut self, v: T) -> Self
4227        where
4228            T: std::convert::Into<crate::model::Group>,
4229        {
4230            self.0.request.group = std::option::Option::Some(v.into());
4231            self
4232        }
4233
4234        /// Sets or clears the value of [group][crate::model::CreateGroupRequest::group].
4235        ///
4236        /// This is a **required** field for requests.
4237        pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
4238        where
4239            T: std::convert::Into<crate::model::Group>,
4240        {
4241            self.0.request.group = v.map(|x| x.into());
4242            self
4243        }
4244
4245        /// Sets the value of [request_id][crate::model::CreateGroupRequest::request_id].
4246        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4247            self.0.request.request_id = v.into();
4248            self
4249        }
4250    }
4251
4252    #[doc(hidden)]
4253    impl crate::RequestBuilder for CreateGroup {
4254        fn request_options(&mut self) -> &mut crate::RequestOptions {
4255            &mut self.0.options
4256        }
4257    }
4258
4259    /// The request builder for [VmMigration::update_group][crate::client::VmMigration::update_group] calls.
4260    ///
4261    /// # Example
4262    /// ```
4263    /// # use google_cloud_vmmigration_v1::builder::vm_migration::UpdateGroup;
4264    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4265    /// use google_cloud_lro::Poller;
4266    ///
4267    /// let builder = prepare_request_builder();
4268    /// let response = builder.poller().until_done().await?;
4269    /// # Ok(()) }
4270    ///
4271    /// fn prepare_request_builder() -> UpdateGroup {
4272    ///   # panic!();
4273    ///   // ... details omitted ...
4274    /// }
4275    /// ```
4276    #[derive(Clone, Debug)]
4277    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
4278
4279    impl UpdateGroup {
4280        pub(crate) fn new(
4281            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4282        ) -> Self {
4283            Self(RequestBuilder::new(stub))
4284        }
4285
4286        /// Sets the full request, replacing any prior values.
4287        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
4288            self.0.request = v.into();
4289            self
4290        }
4291
4292        /// Sets all the options, replacing any prior values.
4293        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4294            self.0.options = v.into();
4295            self
4296        }
4297
4298        /// Sends the request.
4299        ///
4300        /// # Long running operations
4301        ///
4302        /// This starts, but does not poll, a longrunning operation. More information
4303        /// on [update_group][crate::client::VmMigration::update_group].
4304        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4305            (*self.0.stub)
4306                .update_group(self.0.request, self.0.options)
4307                .await
4308                .map(crate::Response::into_body)
4309        }
4310
4311        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_group`.
4312        pub fn poller(
4313            self,
4314        ) -> impl google_cloud_lro::Poller<crate::model::Group, crate::model::OperationMetadata>
4315        {
4316            type Operation = google_cloud_lro::internal::Operation<
4317                crate::model::Group,
4318                crate::model::OperationMetadata,
4319            >;
4320            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4321            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4322
4323            let stub = self.0.stub.clone();
4324            let mut options = self.0.options.clone();
4325            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4326            let query = move |name| {
4327                let stub = stub.clone();
4328                let options = options.clone();
4329                async {
4330                    let op = GetOperation::new(stub)
4331                        .set_name(name)
4332                        .with_options(options)
4333                        .send()
4334                        .await?;
4335                    Ok(Operation::new(op))
4336                }
4337            };
4338
4339            let start = move || async {
4340                let op = self.send().await?;
4341                Ok(Operation::new(op))
4342            };
4343
4344            google_cloud_lro::internal::new_poller(
4345                polling_error_policy,
4346                polling_backoff_policy,
4347                start,
4348                query,
4349            )
4350        }
4351
4352        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
4353        pub fn set_update_mask<T>(mut self, v: T) -> Self
4354        where
4355            T: std::convert::Into<wkt::FieldMask>,
4356        {
4357            self.0.request.update_mask = std::option::Option::Some(v.into());
4358            self
4359        }
4360
4361        /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
4362        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4363        where
4364            T: std::convert::Into<wkt::FieldMask>,
4365        {
4366            self.0.request.update_mask = v.map(|x| x.into());
4367            self
4368        }
4369
4370        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
4371        ///
4372        /// This is a **required** field for requests.
4373        pub fn set_group<T>(mut self, v: T) -> Self
4374        where
4375            T: std::convert::Into<crate::model::Group>,
4376        {
4377            self.0.request.group = std::option::Option::Some(v.into());
4378            self
4379        }
4380
4381        /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
4382        ///
4383        /// This is a **required** field for requests.
4384        pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
4385        where
4386            T: std::convert::Into<crate::model::Group>,
4387        {
4388            self.0.request.group = v.map(|x| x.into());
4389            self
4390        }
4391
4392        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
4393        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4394            self.0.request.request_id = v.into();
4395            self
4396        }
4397    }
4398
4399    #[doc(hidden)]
4400    impl crate::RequestBuilder for UpdateGroup {
4401        fn request_options(&mut self) -> &mut crate::RequestOptions {
4402            &mut self.0.options
4403        }
4404    }
4405
4406    /// The request builder for [VmMigration::delete_group][crate::client::VmMigration::delete_group] calls.
4407    ///
4408    /// # Example
4409    /// ```
4410    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteGroup;
4411    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4412    /// use google_cloud_lro::Poller;
4413    ///
4414    /// let builder = prepare_request_builder();
4415    /// let response = builder.poller().until_done().await?;
4416    /// # Ok(()) }
4417    ///
4418    /// fn prepare_request_builder() -> DeleteGroup {
4419    ///   # panic!();
4420    ///   // ... details omitted ...
4421    /// }
4422    /// ```
4423    #[derive(Clone, Debug)]
4424    pub struct DeleteGroup(RequestBuilder<crate::model::DeleteGroupRequest>);
4425
4426    impl DeleteGroup {
4427        pub(crate) fn new(
4428            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4429        ) -> Self {
4430            Self(RequestBuilder::new(stub))
4431        }
4432
4433        /// Sets the full request, replacing any prior values.
4434        pub fn with_request<V: Into<crate::model::DeleteGroupRequest>>(mut self, v: V) -> Self {
4435            self.0.request = v.into();
4436            self
4437        }
4438
4439        /// Sets all the options, replacing any prior values.
4440        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4441            self.0.options = v.into();
4442            self
4443        }
4444
4445        /// Sends the request.
4446        ///
4447        /// # Long running operations
4448        ///
4449        /// This starts, but does not poll, a longrunning operation. More information
4450        /// on [delete_group][crate::client::VmMigration::delete_group].
4451        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4452            (*self.0.stub)
4453                .delete_group(self.0.request, self.0.options)
4454                .await
4455                .map(crate::Response::into_body)
4456        }
4457
4458        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_group`.
4459        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4460            type Operation =
4461                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4462            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4463            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4464
4465            let stub = self.0.stub.clone();
4466            let mut options = self.0.options.clone();
4467            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4468            let query = move |name| {
4469                let stub = stub.clone();
4470                let options = options.clone();
4471                async {
4472                    let op = GetOperation::new(stub)
4473                        .set_name(name)
4474                        .with_options(options)
4475                        .send()
4476                        .await?;
4477                    Ok(Operation::new(op))
4478                }
4479            };
4480
4481            let start = move || async {
4482                let op = self.send().await?;
4483                Ok(Operation::new(op))
4484            };
4485
4486            google_cloud_lro::internal::new_unit_response_poller(
4487                polling_error_policy,
4488                polling_backoff_policy,
4489                start,
4490                query,
4491            )
4492        }
4493
4494        /// Sets the value of [name][crate::model::DeleteGroupRequest::name].
4495        ///
4496        /// This is a **required** field for requests.
4497        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4498            self.0.request.name = v.into();
4499            self
4500        }
4501
4502        /// Sets the value of [request_id][crate::model::DeleteGroupRequest::request_id].
4503        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504            self.0.request.request_id = v.into();
4505            self
4506        }
4507    }
4508
4509    #[doc(hidden)]
4510    impl crate::RequestBuilder for DeleteGroup {
4511        fn request_options(&mut self) -> &mut crate::RequestOptions {
4512            &mut self.0.options
4513        }
4514    }
4515
4516    /// The request builder for [VmMigration::add_group_migration][crate::client::VmMigration::add_group_migration] calls.
4517    ///
4518    /// # Example
4519    /// ```
4520    /// # use google_cloud_vmmigration_v1::builder::vm_migration::AddGroupMigration;
4521    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4522    /// use google_cloud_lro::Poller;
4523    ///
4524    /// let builder = prepare_request_builder();
4525    /// let response = builder.poller().until_done().await?;
4526    /// # Ok(()) }
4527    ///
4528    /// fn prepare_request_builder() -> AddGroupMigration {
4529    ///   # panic!();
4530    ///   // ... details omitted ...
4531    /// }
4532    /// ```
4533    #[derive(Clone, Debug)]
4534    pub struct AddGroupMigration(RequestBuilder<crate::model::AddGroupMigrationRequest>);
4535
4536    impl AddGroupMigration {
4537        pub(crate) fn new(
4538            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4539        ) -> Self {
4540            Self(RequestBuilder::new(stub))
4541        }
4542
4543        /// Sets the full request, replacing any prior values.
4544        pub fn with_request<V: Into<crate::model::AddGroupMigrationRequest>>(
4545            mut self,
4546            v: V,
4547        ) -> Self {
4548            self.0.request = v.into();
4549            self
4550        }
4551
4552        /// Sets all the options, replacing any prior values.
4553        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4554            self.0.options = v.into();
4555            self
4556        }
4557
4558        /// Sends the request.
4559        ///
4560        /// # Long running operations
4561        ///
4562        /// This starts, but does not poll, a longrunning operation. More information
4563        /// on [add_group_migration][crate::client::VmMigration::add_group_migration].
4564        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4565            (*self.0.stub)
4566                .add_group_migration(self.0.request, self.0.options)
4567                .await
4568                .map(crate::Response::into_body)
4569        }
4570
4571        /// Creates a [Poller][google_cloud_lro::Poller] to work with `add_group_migration`.
4572        pub fn poller(
4573            self,
4574        ) -> impl google_cloud_lro::Poller<
4575            crate::model::AddGroupMigrationResponse,
4576            crate::model::OperationMetadata,
4577        > {
4578            type Operation = google_cloud_lro::internal::Operation<
4579                crate::model::AddGroupMigrationResponse,
4580                crate::model::OperationMetadata,
4581            >;
4582            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4583            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4584
4585            let stub = self.0.stub.clone();
4586            let mut options = self.0.options.clone();
4587            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4588            let query = move |name| {
4589                let stub = stub.clone();
4590                let options = options.clone();
4591                async {
4592                    let op = GetOperation::new(stub)
4593                        .set_name(name)
4594                        .with_options(options)
4595                        .send()
4596                        .await?;
4597                    Ok(Operation::new(op))
4598                }
4599            };
4600
4601            let start = move || async {
4602                let op = self.send().await?;
4603                Ok(Operation::new(op))
4604            };
4605
4606            google_cloud_lro::internal::new_poller(
4607                polling_error_policy,
4608                polling_backoff_policy,
4609                start,
4610                query,
4611            )
4612        }
4613
4614        /// Sets the value of [group][crate::model::AddGroupMigrationRequest::group].
4615        ///
4616        /// This is a **required** field for requests.
4617        pub fn set_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
4618            self.0.request.group = v.into();
4619            self
4620        }
4621
4622        /// Sets the value of [migrating_vm][crate::model::AddGroupMigrationRequest::migrating_vm].
4623        pub fn set_migrating_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
4624            self.0.request.migrating_vm = v.into();
4625            self
4626        }
4627    }
4628
4629    #[doc(hidden)]
4630    impl crate::RequestBuilder for AddGroupMigration {
4631        fn request_options(&mut self) -> &mut crate::RequestOptions {
4632            &mut self.0.options
4633        }
4634    }
4635
4636    /// The request builder for [VmMigration::remove_group_migration][crate::client::VmMigration::remove_group_migration] calls.
4637    ///
4638    /// # Example
4639    /// ```
4640    /// # use google_cloud_vmmigration_v1::builder::vm_migration::RemoveGroupMigration;
4641    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4642    /// use google_cloud_lro::Poller;
4643    ///
4644    /// let builder = prepare_request_builder();
4645    /// let response = builder.poller().until_done().await?;
4646    /// # Ok(()) }
4647    ///
4648    /// fn prepare_request_builder() -> RemoveGroupMigration {
4649    ///   # panic!();
4650    ///   // ... details omitted ...
4651    /// }
4652    /// ```
4653    #[derive(Clone, Debug)]
4654    pub struct RemoveGroupMigration(RequestBuilder<crate::model::RemoveGroupMigrationRequest>);
4655
4656    impl RemoveGroupMigration {
4657        pub(crate) fn new(
4658            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4659        ) -> Self {
4660            Self(RequestBuilder::new(stub))
4661        }
4662
4663        /// Sets the full request, replacing any prior values.
4664        pub fn with_request<V: Into<crate::model::RemoveGroupMigrationRequest>>(
4665            mut self,
4666            v: V,
4667        ) -> Self {
4668            self.0.request = v.into();
4669            self
4670        }
4671
4672        /// Sets all the options, replacing any prior values.
4673        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4674            self.0.options = v.into();
4675            self
4676        }
4677
4678        /// Sends the request.
4679        ///
4680        /// # Long running operations
4681        ///
4682        /// This starts, but does not poll, a longrunning operation. More information
4683        /// on [remove_group_migration][crate::client::VmMigration::remove_group_migration].
4684        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4685            (*self.0.stub)
4686                .remove_group_migration(self.0.request, self.0.options)
4687                .await
4688                .map(crate::Response::into_body)
4689        }
4690
4691        /// Creates a [Poller][google_cloud_lro::Poller] to work with `remove_group_migration`.
4692        pub fn poller(
4693            self,
4694        ) -> impl google_cloud_lro::Poller<
4695            crate::model::RemoveGroupMigrationResponse,
4696            crate::model::OperationMetadata,
4697        > {
4698            type Operation = google_cloud_lro::internal::Operation<
4699                crate::model::RemoveGroupMigrationResponse,
4700                crate::model::OperationMetadata,
4701            >;
4702            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4703            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4704
4705            let stub = self.0.stub.clone();
4706            let mut options = self.0.options.clone();
4707            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4708            let query = move |name| {
4709                let stub = stub.clone();
4710                let options = options.clone();
4711                async {
4712                    let op = GetOperation::new(stub)
4713                        .set_name(name)
4714                        .with_options(options)
4715                        .send()
4716                        .await?;
4717                    Ok(Operation::new(op))
4718                }
4719            };
4720
4721            let start = move || async {
4722                let op = self.send().await?;
4723                Ok(Operation::new(op))
4724            };
4725
4726            google_cloud_lro::internal::new_poller(
4727                polling_error_policy,
4728                polling_backoff_policy,
4729                start,
4730                query,
4731            )
4732        }
4733
4734        /// Sets the value of [group][crate::model::RemoveGroupMigrationRequest::group].
4735        ///
4736        /// This is a **required** field for requests.
4737        pub fn set_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
4738            self.0.request.group = v.into();
4739            self
4740        }
4741
4742        /// Sets the value of [migrating_vm][crate::model::RemoveGroupMigrationRequest::migrating_vm].
4743        pub fn set_migrating_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
4744            self.0.request.migrating_vm = v.into();
4745            self
4746        }
4747    }
4748
4749    #[doc(hidden)]
4750    impl crate::RequestBuilder for RemoveGroupMigration {
4751        fn request_options(&mut self) -> &mut crate::RequestOptions {
4752            &mut self.0.options
4753        }
4754    }
4755
4756    /// The request builder for [VmMigration::list_target_projects][crate::client::VmMigration::list_target_projects] calls.
4757    ///
4758    /// # Example
4759    /// ```
4760    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListTargetProjects;
4761    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4762    /// use google_cloud_gax::paginator::ItemPaginator;
4763    ///
4764    /// let builder = prepare_request_builder();
4765    /// let mut items = builder.by_item();
4766    /// while let Some(result) = items.next().await {
4767    ///   let item = result?;
4768    /// }
4769    /// # Ok(()) }
4770    ///
4771    /// fn prepare_request_builder() -> ListTargetProjects {
4772    ///   # panic!();
4773    ///   // ... details omitted ...
4774    /// }
4775    /// ```
4776    #[derive(Clone, Debug)]
4777    pub struct ListTargetProjects(RequestBuilder<crate::model::ListTargetProjectsRequest>);
4778
4779    impl ListTargetProjects {
4780        pub(crate) fn new(
4781            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4782        ) -> Self {
4783            Self(RequestBuilder::new(stub))
4784        }
4785
4786        /// Sets the full request, replacing any prior values.
4787        pub fn with_request<V: Into<crate::model::ListTargetProjectsRequest>>(
4788            mut self,
4789            v: V,
4790        ) -> Self {
4791            self.0.request = v.into();
4792            self
4793        }
4794
4795        /// Sets all the options, replacing any prior values.
4796        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4797            self.0.options = v.into();
4798            self
4799        }
4800
4801        /// Sends the request.
4802        pub async fn send(self) -> Result<crate::model::ListTargetProjectsResponse> {
4803            (*self.0.stub)
4804                .list_target_projects(self.0.request, self.0.options)
4805                .await
4806                .map(crate::Response::into_body)
4807        }
4808
4809        /// Streams each page in the collection.
4810        pub fn by_page(
4811            self,
4812        ) -> impl google_cloud_gax::paginator::Paginator<
4813            crate::model::ListTargetProjectsResponse,
4814            crate::Error,
4815        > {
4816            use std::clone::Clone;
4817            let token = self.0.request.page_token.clone();
4818            let execute = move |token: String| {
4819                let mut builder = self.clone();
4820                builder.0.request = builder.0.request.set_page_token(token);
4821                builder.send()
4822            };
4823            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4824        }
4825
4826        /// Streams each item in the collection.
4827        pub fn by_item(
4828            self,
4829        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4830            crate::model::ListTargetProjectsResponse,
4831            crate::Error,
4832        > {
4833            use google_cloud_gax::paginator::Paginator;
4834            self.by_page().items()
4835        }
4836
4837        /// Sets the value of [parent][crate::model::ListTargetProjectsRequest::parent].
4838        ///
4839        /// This is a **required** field for requests.
4840        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4841            self.0.request.parent = v.into();
4842            self
4843        }
4844
4845        /// Sets the value of [page_size][crate::model::ListTargetProjectsRequest::page_size].
4846        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4847            self.0.request.page_size = v.into();
4848            self
4849        }
4850
4851        /// Sets the value of [page_token][crate::model::ListTargetProjectsRequest::page_token].
4852        ///
4853        /// This is a **required** field for requests.
4854        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4855            self.0.request.page_token = v.into();
4856            self
4857        }
4858
4859        /// Sets the value of [filter][crate::model::ListTargetProjectsRequest::filter].
4860        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4861            self.0.request.filter = v.into();
4862            self
4863        }
4864
4865        /// Sets the value of [order_by][crate::model::ListTargetProjectsRequest::order_by].
4866        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4867            self.0.request.order_by = v.into();
4868            self
4869        }
4870    }
4871
4872    #[doc(hidden)]
4873    impl crate::RequestBuilder for ListTargetProjects {
4874        fn request_options(&mut self) -> &mut crate::RequestOptions {
4875            &mut self.0.options
4876        }
4877    }
4878
4879    /// The request builder for [VmMigration::get_target_project][crate::client::VmMigration::get_target_project] calls.
4880    ///
4881    /// # Example
4882    /// ```
4883    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetTargetProject;
4884    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4885    ///
4886    /// let builder = prepare_request_builder();
4887    /// let response = builder.send().await?;
4888    /// # Ok(()) }
4889    ///
4890    /// fn prepare_request_builder() -> GetTargetProject {
4891    ///   # panic!();
4892    ///   // ... details omitted ...
4893    /// }
4894    /// ```
4895    #[derive(Clone, Debug)]
4896    pub struct GetTargetProject(RequestBuilder<crate::model::GetTargetProjectRequest>);
4897
4898    impl GetTargetProject {
4899        pub(crate) fn new(
4900            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4901        ) -> Self {
4902            Self(RequestBuilder::new(stub))
4903        }
4904
4905        /// Sets the full request, replacing any prior values.
4906        pub fn with_request<V: Into<crate::model::GetTargetProjectRequest>>(
4907            mut self,
4908            v: V,
4909        ) -> Self {
4910            self.0.request = v.into();
4911            self
4912        }
4913
4914        /// Sets all the options, replacing any prior values.
4915        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4916            self.0.options = v.into();
4917            self
4918        }
4919
4920        /// Sends the request.
4921        pub async fn send(self) -> Result<crate::model::TargetProject> {
4922            (*self.0.stub)
4923                .get_target_project(self.0.request, self.0.options)
4924                .await
4925                .map(crate::Response::into_body)
4926        }
4927
4928        /// Sets the value of [name][crate::model::GetTargetProjectRequest::name].
4929        ///
4930        /// This is a **required** field for requests.
4931        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4932            self.0.request.name = v.into();
4933            self
4934        }
4935    }
4936
4937    #[doc(hidden)]
4938    impl crate::RequestBuilder for GetTargetProject {
4939        fn request_options(&mut self) -> &mut crate::RequestOptions {
4940            &mut self.0.options
4941        }
4942    }
4943
4944    /// The request builder for [VmMigration::create_target_project][crate::client::VmMigration::create_target_project] calls.
4945    ///
4946    /// # Example
4947    /// ```
4948    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateTargetProject;
4949    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
4950    /// use google_cloud_lro::Poller;
4951    ///
4952    /// let builder = prepare_request_builder();
4953    /// let response = builder.poller().until_done().await?;
4954    /// # Ok(()) }
4955    ///
4956    /// fn prepare_request_builder() -> CreateTargetProject {
4957    ///   # panic!();
4958    ///   // ... details omitted ...
4959    /// }
4960    /// ```
4961    #[derive(Clone, Debug)]
4962    pub struct CreateTargetProject(RequestBuilder<crate::model::CreateTargetProjectRequest>);
4963
4964    impl CreateTargetProject {
4965        pub(crate) fn new(
4966            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
4967        ) -> Self {
4968            Self(RequestBuilder::new(stub))
4969        }
4970
4971        /// Sets the full request, replacing any prior values.
4972        pub fn with_request<V: Into<crate::model::CreateTargetProjectRequest>>(
4973            mut self,
4974            v: V,
4975        ) -> Self {
4976            self.0.request = v.into();
4977            self
4978        }
4979
4980        /// Sets all the options, replacing any prior values.
4981        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4982            self.0.options = v.into();
4983            self
4984        }
4985
4986        /// Sends the request.
4987        ///
4988        /// # Long running operations
4989        ///
4990        /// This starts, but does not poll, a longrunning operation. More information
4991        /// on [create_target_project][crate::client::VmMigration::create_target_project].
4992        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4993            (*self.0.stub)
4994                .create_target_project(self.0.request, self.0.options)
4995                .await
4996                .map(crate::Response::into_body)
4997        }
4998
4999        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_target_project`.
5000        pub fn poller(
5001            self,
5002        ) -> impl google_cloud_lro::Poller<crate::model::TargetProject, crate::model::OperationMetadata>
5003        {
5004            type Operation = google_cloud_lro::internal::Operation<
5005                crate::model::TargetProject,
5006                crate::model::OperationMetadata,
5007            >;
5008            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5009            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5010
5011            let stub = self.0.stub.clone();
5012            let mut options = self.0.options.clone();
5013            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5014            let query = move |name| {
5015                let stub = stub.clone();
5016                let options = options.clone();
5017                async {
5018                    let op = GetOperation::new(stub)
5019                        .set_name(name)
5020                        .with_options(options)
5021                        .send()
5022                        .await?;
5023                    Ok(Operation::new(op))
5024                }
5025            };
5026
5027            let start = move || async {
5028                let op = self.send().await?;
5029                Ok(Operation::new(op))
5030            };
5031
5032            google_cloud_lro::internal::new_poller(
5033                polling_error_policy,
5034                polling_backoff_policy,
5035                start,
5036                query,
5037            )
5038        }
5039
5040        /// Sets the value of [parent][crate::model::CreateTargetProjectRequest::parent].
5041        ///
5042        /// This is a **required** field for requests.
5043        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5044            self.0.request.parent = v.into();
5045            self
5046        }
5047
5048        /// Sets the value of [target_project_id][crate::model::CreateTargetProjectRequest::target_project_id].
5049        ///
5050        /// This is a **required** field for requests.
5051        pub fn set_target_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5052            self.0.request.target_project_id = v.into();
5053            self
5054        }
5055
5056        /// Sets the value of [target_project][crate::model::CreateTargetProjectRequest::target_project].
5057        ///
5058        /// This is a **required** field for requests.
5059        pub fn set_target_project<T>(mut self, v: T) -> Self
5060        where
5061            T: std::convert::Into<crate::model::TargetProject>,
5062        {
5063            self.0.request.target_project = std::option::Option::Some(v.into());
5064            self
5065        }
5066
5067        /// Sets or clears the value of [target_project][crate::model::CreateTargetProjectRequest::target_project].
5068        ///
5069        /// This is a **required** field for requests.
5070        pub fn set_or_clear_target_project<T>(mut self, v: std::option::Option<T>) -> Self
5071        where
5072            T: std::convert::Into<crate::model::TargetProject>,
5073        {
5074            self.0.request.target_project = v.map(|x| x.into());
5075            self
5076        }
5077
5078        /// Sets the value of [request_id][crate::model::CreateTargetProjectRequest::request_id].
5079        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5080            self.0.request.request_id = v.into();
5081            self
5082        }
5083    }
5084
5085    #[doc(hidden)]
5086    impl crate::RequestBuilder for CreateTargetProject {
5087        fn request_options(&mut self) -> &mut crate::RequestOptions {
5088            &mut self.0.options
5089        }
5090    }
5091
5092    /// The request builder for [VmMigration::update_target_project][crate::client::VmMigration::update_target_project] calls.
5093    ///
5094    /// # Example
5095    /// ```
5096    /// # use google_cloud_vmmigration_v1::builder::vm_migration::UpdateTargetProject;
5097    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5098    /// use google_cloud_lro::Poller;
5099    ///
5100    /// let builder = prepare_request_builder();
5101    /// let response = builder.poller().until_done().await?;
5102    /// # Ok(()) }
5103    ///
5104    /// fn prepare_request_builder() -> UpdateTargetProject {
5105    ///   # panic!();
5106    ///   // ... details omitted ...
5107    /// }
5108    /// ```
5109    #[derive(Clone, Debug)]
5110    pub struct UpdateTargetProject(RequestBuilder<crate::model::UpdateTargetProjectRequest>);
5111
5112    impl UpdateTargetProject {
5113        pub(crate) fn new(
5114            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
5115        ) -> Self {
5116            Self(RequestBuilder::new(stub))
5117        }
5118
5119        /// Sets the full request, replacing any prior values.
5120        pub fn with_request<V: Into<crate::model::UpdateTargetProjectRequest>>(
5121            mut self,
5122            v: V,
5123        ) -> Self {
5124            self.0.request = v.into();
5125            self
5126        }
5127
5128        /// Sets all the options, replacing any prior values.
5129        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5130            self.0.options = v.into();
5131            self
5132        }
5133
5134        /// Sends the request.
5135        ///
5136        /// # Long running operations
5137        ///
5138        /// This starts, but does not poll, a longrunning operation. More information
5139        /// on [update_target_project][crate::client::VmMigration::update_target_project].
5140        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5141            (*self.0.stub)
5142                .update_target_project(self.0.request, self.0.options)
5143                .await
5144                .map(crate::Response::into_body)
5145        }
5146
5147        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_target_project`.
5148        pub fn poller(
5149            self,
5150        ) -> impl google_cloud_lro::Poller<crate::model::TargetProject, crate::model::OperationMetadata>
5151        {
5152            type Operation = google_cloud_lro::internal::Operation<
5153                crate::model::TargetProject,
5154                crate::model::OperationMetadata,
5155            >;
5156            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5157            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5158
5159            let stub = self.0.stub.clone();
5160            let mut options = self.0.options.clone();
5161            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5162            let query = move |name| {
5163                let stub = stub.clone();
5164                let options = options.clone();
5165                async {
5166                    let op = GetOperation::new(stub)
5167                        .set_name(name)
5168                        .with_options(options)
5169                        .send()
5170                        .await?;
5171                    Ok(Operation::new(op))
5172                }
5173            };
5174
5175            let start = move || async {
5176                let op = self.send().await?;
5177                Ok(Operation::new(op))
5178            };
5179
5180            google_cloud_lro::internal::new_poller(
5181                polling_error_policy,
5182                polling_backoff_policy,
5183                start,
5184                query,
5185            )
5186        }
5187
5188        /// Sets the value of [update_mask][crate::model::UpdateTargetProjectRequest::update_mask].
5189        pub fn set_update_mask<T>(mut self, v: T) -> Self
5190        where
5191            T: std::convert::Into<wkt::FieldMask>,
5192        {
5193            self.0.request.update_mask = std::option::Option::Some(v.into());
5194            self
5195        }
5196
5197        /// Sets or clears the value of [update_mask][crate::model::UpdateTargetProjectRequest::update_mask].
5198        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5199        where
5200            T: std::convert::Into<wkt::FieldMask>,
5201        {
5202            self.0.request.update_mask = v.map(|x| x.into());
5203            self
5204        }
5205
5206        /// Sets the value of [target_project][crate::model::UpdateTargetProjectRequest::target_project].
5207        ///
5208        /// This is a **required** field for requests.
5209        pub fn set_target_project<T>(mut self, v: T) -> Self
5210        where
5211            T: std::convert::Into<crate::model::TargetProject>,
5212        {
5213            self.0.request.target_project = std::option::Option::Some(v.into());
5214            self
5215        }
5216
5217        /// Sets or clears the value of [target_project][crate::model::UpdateTargetProjectRequest::target_project].
5218        ///
5219        /// This is a **required** field for requests.
5220        pub fn set_or_clear_target_project<T>(mut self, v: std::option::Option<T>) -> Self
5221        where
5222            T: std::convert::Into<crate::model::TargetProject>,
5223        {
5224            self.0.request.target_project = v.map(|x| x.into());
5225            self
5226        }
5227
5228        /// Sets the value of [request_id][crate::model::UpdateTargetProjectRequest::request_id].
5229        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5230            self.0.request.request_id = v.into();
5231            self
5232        }
5233    }
5234
5235    #[doc(hidden)]
5236    impl crate::RequestBuilder for UpdateTargetProject {
5237        fn request_options(&mut self) -> &mut crate::RequestOptions {
5238            &mut self.0.options
5239        }
5240    }
5241
5242    /// The request builder for [VmMigration::delete_target_project][crate::client::VmMigration::delete_target_project] calls.
5243    ///
5244    /// # Example
5245    /// ```
5246    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteTargetProject;
5247    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5248    /// use google_cloud_lro::Poller;
5249    ///
5250    /// let builder = prepare_request_builder();
5251    /// let response = builder.poller().until_done().await?;
5252    /// # Ok(()) }
5253    ///
5254    /// fn prepare_request_builder() -> DeleteTargetProject {
5255    ///   # panic!();
5256    ///   // ... details omitted ...
5257    /// }
5258    /// ```
5259    #[derive(Clone, Debug)]
5260    pub struct DeleteTargetProject(RequestBuilder<crate::model::DeleteTargetProjectRequest>);
5261
5262    impl DeleteTargetProject {
5263        pub(crate) fn new(
5264            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
5265        ) -> Self {
5266            Self(RequestBuilder::new(stub))
5267        }
5268
5269        /// Sets the full request, replacing any prior values.
5270        pub fn with_request<V: Into<crate::model::DeleteTargetProjectRequest>>(
5271            mut self,
5272            v: V,
5273        ) -> Self {
5274            self.0.request = v.into();
5275            self
5276        }
5277
5278        /// Sets all the options, replacing any prior values.
5279        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5280            self.0.options = v.into();
5281            self
5282        }
5283
5284        /// Sends the request.
5285        ///
5286        /// # Long running operations
5287        ///
5288        /// This starts, but does not poll, a longrunning operation. More information
5289        /// on [delete_target_project][crate::client::VmMigration::delete_target_project].
5290        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5291            (*self.0.stub)
5292                .delete_target_project(self.0.request, self.0.options)
5293                .await
5294                .map(crate::Response::into_body)
5295        }
5296
5297        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_target_project`.
5298        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5299            type Operation =
5300                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5301            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5302            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5303
5304            let stub = self.0.stub.clone();
5305            let mut options = self.0.options.clone();
5306            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5307            let query = move |name| {
5308                let stub = stub.clone();
5309                let options = options.clone();
5310                async {
5311                    let op = GetOperation::new(stub)
5312                        .set_name(name)
5313                        .with_options(options)
5314                        .send()
5315                        .await?;
5316                    Ok(Operation::new(op))
5317                }
5318            };
5319
5320            let start = move || async {
5321                let op = self.send().await?;
5322                Ok(Operation::new(op))
5323            };
5324
5325            google_cloud_lro::internal::new_unit_response_poller(
5326                polling_error_policy,
5327                polling_backoff_policy,
5328                start,
5329                query,
5330            )
5331        }
5332
5333        /// Sets the value of [name][crate::model::DeleteTargetProjectRequest::name].
5334        ///
5335        /// This is a **required** field for requests.
5336        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5337            self.0.request.name = v.into();
5338            self
5339        }
5340
5341        /// Sets the value of [request_id][crate::model::DeleteTargetProjectRequest::request_id].
5342        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5343            self.0.request.request_id = v.into();
5344            self
5345        }
5346    }
5347
5348    #[doc(hidden)]
5349    impl crate::RequestBuilder for DeleteTargetProject {
5350        fn request_options(&mut self) -> &mut crate::RequestOptions {
5351            &mut self.0.options
5352        }
5353    }
5354
5355    /// The request builder for [VmMigration::list_replication_cycles][crate::client::VmMigration::list_replication_cycles] calls.
5356    ///
5357    /// # Example
5358    /// ```
5359    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListReplicationCycles;
5360    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5361    /// use google_cloud_gax::paginator::ItemPaginator;
5362    ///
5363    /// let builder = prepare_request_builder();
5364    /// let mut items = builder.by_item();
5365    /// while let Some(result) = items.next().await {
5366    ///   let item = result?;
5367    /// }
5368    /// # Ok(()) }
5369    ///
5370    /// fn prepare_request_builder() -> ListReplicationCycles {
5371    ///   # panic!();
5372    ///   // ... details omitted ...
5373    /// }
5374    /// ```
5375    #[derive(Clone, Debug)]
5376    pub struct ListReplicationCycles(RequestBuilder<crate::model::ListReplicationCyclesRequest>);
5377
5378    impl ListReplicationCycles {
5379        pub(crate) fn new(
5380            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
5381        ) -> Self {
5382            Self(RequestBuilder::new(stub))
5383        }
5384
5385        /// Sets the full request, replacing any prior values.
5386        pub fn with_request<V: Into<crate::model::ListReplicationCyclesRequest>>(
5387            mut self,
5388            v: V,
5389        ) -> Self {
5390            self.0.request = v.into();
5391            self
5392        }
5393
5394        /// Sets all the options, replacing any prior values.
5395        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5396            self.0.options = v.into();
5397            self
5398        }
5399
5400        /// Sends the request.
5401        pub async fn send(self) -> Result<crate::model::ListReplicationCyclesResponse> {
5402            (*self.0.stub)
5403                .list_replication_cycles(self.0.request, self.0.options)
5404                .await
5405                .map(crate::Response::into_body)
5406        }
5407
5408        /// Streams each page in the collection.
5409        pub fn by_page(
5410            self,
5411        ) -> impl google_cloud_gax::paginator::Paginator<
5412            crate::model::ListReplicationCyclesResponse,
5413            crate::Error,
5414        > {
5415            use std::clone::Clone;
5416            let token = self.0.request.page_token.clone();
5417            let execute = move |token: String| {
5418                let mut builder = self.clone();
5419                builder.0.request = builder.0.request.set_page_token(token);
5420                builder.send()
5421            };
5422            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5423        }
5424
5425        /// Streams each item in the collection.
5426        pub fn by_item(
5427            self,
5428        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5429            crate::model::ListReplicationCyclesResponse,
5430            crate::Error,
5431        > {
5432            use google_cloud_gax::paginator::Paginator;
5433            self.by_page().items()
5434        }
5435
5436        /// Sets the value of [parent][crate::model::ListReplicationCyclesRequest::parent].
5437        ///
5438        /// This is a **required** field for requests.
5439        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5440            self.0.request.parent = v.into();
5441            self
5442        }
5443
5444        /// Sets the value of [page_size][crate::model::ListReplicationCyclesRequest::page_size].
5445        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5446            self.0.request.page_size = v.into();
5447            self
5448        }
5449
5450        /// Sets the value of [page_token][crate::model::ListReplicationCyclesRequest::page_token].
5451        ///
5452        /// This is a **required** field for requests.
5453        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5454            self.0.request.page_token = v.into();
5455            self
5456        }
5457
5458        /// Sets the value of [filter][crate::model::ListReplicationCyclesRequest::filter].
5459        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5460            self.0.request.filter = v.into();
5461            self
5462        }
5463
5464        /// Sets the value of [order_by][crate::model::ListReplicationCyclesRequest::order_by].
5465        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5466            self.0.request.order_by = v.into();
5467            self
5468        }
5469    }
5470
5471    #[doc(hidden)]
5472    impl crate::RequestBuilder for ListReplicationCycles {
5473        fn request_options(&mut self) -> &mut crate::RequestOptions {
5474            &mut self.0.options
5475        }
5476    }
5477
5478    /// The request builder for [VmMigration::get_replication_cycle][crate::client::VmMigration::get_replication_cycle] calls.
5479    ///
5480    /// # Example
5481    /// ```
5482    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetReplicationCycle;
5483    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5484    ///
5485    /// let builder = prepare_request_builder();
5486    /// let response = builder.send().await?;
5487    /// # Ok(()) }
5488    ///
5489    /// fn prepare_request_builder() -> GetReplicationCycle {
5490    ///   # panic!();
5491    ///   // ... details omitted ...
5492    /// }
5493    /// ```
5494    #[derive(Clone, Debug)]
5495    pub struct GetReplicationCycle(RequestBuilder<crate::model::GetReplicationCycleRequest>);
5496
5497    impl GetReplicationCycle {
5498        pub(crate) fn new(
5499            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
5500        ) -> Self {
5501            Self(RequestBuilder::new(stub))
5502        }
5503
5504        /// Sets the full request, replacing any prior values.
5505        pub fn with_request<V: Into<crate::model::GetReplicationCycleRequest>>(
5506            mut self,
5507            v: V,
5508        ) -> Self {
5509            self.0.request = v.into();
5510            self
5511        }
5512
5513        /// Sets all the options, replacing any prior values.
5514        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5515            self.0.options = v.into();
5516            self
5517        }
5518
5519        /// Sends the request.
5520        pub async fn send(self) -> Result<crate::model::ReplicationCycle> {
5521            (*self.0.stub)
5522                .get_replication_cycle(self.0.request, self.0.options)
5523                .await
5524                .map(crate::Response::into_body)
5525        }
5526
5527        /// Sets the value of [name][crate::model::GetReplicationCycleRequest::name].
5528        ///
5529        /// This is a **required** field for requests.
5530        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5531            self.0.request.name = v.into();
5532            self
5533        }
5534    }
5535
5536    #[doc(hidden)]
5537    impl crate::RequestBuilder for GetReplicationCycle {
5538        fn request_options(&mut self) -> &mut crate::RequestOptions {
5539            &mut self.0.options
5540        }
5541    }
5542
5543    /// The request builder for [VmMigration::list_image_imports][crate::client::VmMigration::list_image_imports] calls.
5544    ///
5545    /// # Example
5546    /// ```
5547    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListImageImports;
5548    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5549    /// use google_cloud_gax::paginator::ItemPaginator;
5550    ///
5551    /// let builder = prepare_request_builder();
5552    /// let mut items = builder.by_item();
5553    /// while let Some(result) = items.next().await {
5554    ///   let item = result?;
5555    /// }
5556    /// # Ok(()) }
5557    ///
5558    /// fn prepare_request_builder() -> ListImageImports {
5559    ///   # panic!();
5560    ///   // ... details omitted ...
5561    /// }
5562    /// ```
5563    #[derive(Clone, Debug)]
5564    pub struct ListImageImports(RequestBuilder<crate::model::ListImageImportsRequest>);
5565
5566    impl ListImageImports {
5567        pub(crate) fn new(
5568            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
5569        ) -> Self {
5570            Self(RequestBuilder::new(stub))
5571        }
5572
5573        /// Sets the full request, replacing any prior values.
5574        pub fn with_request<V: Into<crate::model::ListImageImportsRequest>>(
5575            mut self,
5576            v: V,
5577        ) -> Self {
5578            self.0.request = v.into();
5579            self
5580        }
5581
5582        /// Sets all the options, replacing any prior values.
5583        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5584            self.0.options = v.into();
5585            self
5586        }
5587
5588        /// Sends the request.
5589        pub async fn send(self) -> Result<crate::model::ListImageImportsResponse> {
5590            (*self.0.stub)
5591                .list_image_imports(self.0.request, self.0.options)
5592                .await
5593                .map(crate::Response::into_body)
5594        }
5595
5596        /// Streams each page in the collection.
5597        pub fn by_page(
5598            self,
5599        ) -> impl google_cloud_gax::paginator::Paginator<
5600            crate::model::ListImageImportsResponse,
5601            crate::Error,
5602        > {
5603            use std::clone::Clone;
5604            let token = self.0.request.page_token.clone();
5605            let execute = move |token: String| {
5606                let mut builder = self.clone();
5607                builder.0.request = builder.0.request.set_page_token(token);
5608                builder.send()
5609            };
5610            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5611        }
5612
5613        /// Streams each item in the collection.
5614        pub fn by_item(
5615            self,
5616        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5617            crate::model::ListImageImportsResponse,
5618            crate::Error,
5619        > {
5620            use google_cloud_gax::paginator::Paginator;
5621            self.by_page().items()
5622        }
5623
5624        /// Sets the value of [parent][crate::model::ListImageImportsRequest::parent].
5625        ///
5626        /// This is a **required** field for requests.
5627        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5628            self.0.request.parent = v.into();
5629            self
5630        }
5631
5632        /// Sets the value of [page_size][crate::model::ListImageImportsRequest::page_size].
5633        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5634            self.0.request.page_size = v.into();
5635            self
5636        }
5637
5638        /// Sets the value of [page_token][crate::model::ListImageImportsRequest::page_token].
5639        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5640            self.0.request.page_token = v.into();
5641            self
5642        }
5643
5644        /// Sets the value of [filter][crate::model::ListImageImportsRequest::filter].
5645        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5646            self.0.request.filter = v.into();
5647            self
5648        }
5649
5650        /// Sets the value of [order_by][crate::model::ListImageImportsRequest::order_by].
5651        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5652            self.0.request.order_by = v.into();
5653            self
5654        }
5655    }
5656
5657    #[doc(hidden)]
5658    impl crate::RequestBuilder for ListImageImports {
5659        fn request_options(&mut self) -> &mut crate::RequestOptions {
5660            &mut self.0.options
5661        }
5662    }
5663
5664    /// The request builder for [VmMigration::get_image_import][crate::client::VmMigration::get_image_import] calls.
5665    ///
5666    /// # Example
5667    /// ```
5668    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetImageImport;
5669    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5670    ///
5671    /// let builder = prepare_request_builder();
5672    /// let response = builder.send().await?;
5673    /// # Ok(()) }
5674    ///
5675    /// fn prepare_request_builder() -> GetImageImport {
5676    ///   # panic!();
5677    ///   // ... details omitted ...
5678    /// }
5679    /// ```
5680    #[derive(Clone, Debug)]
5681    pub struct GetImageImport(RequestBuilder<crate::model::GetImageImportRequest>);
5682
5683    impl GetImageImport {
5684        pub(crate) fn new(
5685            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
5686        ) -> Self {
5687            Self(RequestBuilder::new(stub))
5688        }
5689
5690        /// Sets the full request, replacing any prior values.
5691        pub fn with_request<V: Into<crate::model::GetImageImportRequest>>(mut self, v: V) -> Self {
5692            self.0.request = v.into();
5693            self
5694        }
5695
5696        /// Sets all the options, replacing any prior values.
5697        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5698            self.0.options = v.into();
5699            self
5700        }
5701
5702        /// Sends the request.
5703        pub async fn send(self) -> Result<crate::model::ImageImport> {
5704            (*self.0.stub)
5705                .get_image_import(self.0.request, self.0.options)
5706                .await
5707                .map(crate::Response::into_body)
5708        }
5709
5710        /// Sets the value of [name][crate::model::GetImageImportRequest::name].
5711        ///
5712        /// This is a **required** field for requests.
5713        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5714            self.0.request.name = v.into();
5715            self
5716        }
5717    }
5718
5719    #[doc(hidden)]
5720    impl crate::RequestBuilder for GetImageImport {
5721        fn request_options(&mut self) -> &mut crate::RequestOptions {
5722            &mut self.0.options
5723        }
5724    }
5725
5726    /// The request builder for [VmMigration::create_image_import][crate::client::VmMigration::create_image_import] calls.
5727    ///
5728    /// # Example
5729    /// ```
5730    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateImageImport;
5731    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5732    /// use google_cloud_lro::Poller;
5733    ///
5734    /// let builder = prepare_request_builder();
5735    /// let response = builder.poller().until_done().await?;
5736    /// # Ok(()) }
5737    ///
5738    /// fn prepare_request_builder() -> CreateImageImport {
5739    ///   # panic!();
5740    ///   // ... details omitted ...
5741    /// }
5742    /// ```
5743    #[derive(Clone, Debug)]
5744    pub struct CreateImageImport(RequestBuilder<crate::model::CreateImageImportRequest>);
5745
5746    impl CreateImageImport {
5747        pub(crate) fn new(
5748            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
5749        ) -> Self {
5750            Self(RequestBuilder::new(stub))
5751        }
5752
5753        /// Sets the full request, replacing any prior values.
5754        pub fn with_request<V: Into<crate::model::CreateImageImportRequest>>(
5755            mut self,
5756            v: V,
5757        ) -> Self {
5758            self.0.request = v.into();
5759            self
5760        }
5761
5762        /// Sets all the options, replacing any prior values.
5763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5764            self.0.options = v.into();
5765            self
5766        }
5767
5768        /// Sends the request.
5769        ///
5770        /// # Long running operations
5771        ///
5772        /// This starts, but does not poll, a longrunning operation. More information
5773        /// on [create_image_import][crate::client::VmMigration::create_image_import].
5774        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5775            (*self.0.stub)
5776                .create_image_import(self.0.request, self.0.options)
5777                .await
5778                .map(crate::Response::into_body)
5779        }
5780
5781        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_image_import`.
5782        pub fn poller(
5783            self,
5784        ) -> impl google_cloud_lro::Poller<crate::model::ImageImport, crate::model::OperationMetadata>
5785        {
5786            type Operation = google_cloud_lro::internal::Operation<
5787                crate::model::ImageImport,
5788                crate::model::OperationMetadata,
5789            >;
5790            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5791            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5792
5793            let stub = self.0.stub.clone();
5794            let mut options = self.0.options.clone();
5795            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5796            let query = move |name| {
5797                let stub = stub.clone();
5798                let options = options.clone();
5799                async {
5800                    let op = GetOperation::new(stub)
5801                        .set_name(name)
5802                        .with_options(options)
5803                        .send()
5804                        .await?;
5805                    Ok(Operation::new(op))
5806                }
5807            };
5808
5809            let start = move || async {
5810                let op = self.send().await?;
5811                Ok(Operation::new(op))
5812            };
5813
5814            google_cloud_lro::internal::new_poller(
5815                polling_error_policy,
5816                polling_backoff_policy,
5817                start,
5818                query,
5819            )
5820        }
5821
5822        /// Sets the value of [parent][crate::model::CreateImageImportRequest::parent].
5823        ///
5824        /// This is a **required** field for requests.
5825        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5826            self.0.request.parent = v.into();
5827            self
5828        }
5829
5830        /// Sets the value of [image_import_id][crate::model::CreateImageImportRequest::image_import_id].
5831        ///
5832        /// This is a **required** field for requests.
5833        pub fn set_image_import_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5834            self.0.request.image_import_id = v.into();
5835            self
5836        }
5837
5838        /// Sets the value of [image_import][crate::model::CreateImageImportRequest::image_import].
5839        ///
5840        /// This is a **required** field for requests.
5841        pub fn set_image_import<T>(mut self, v: T) -> Self
5842        where
5843            T: std::convert::Into<crate::model::ImageImport>,
5844        {
5845            self.0.request.image_import = std::option::Option::Some(v.into());
5846            self
5847        }
5848
5849        /// Sets or clears the value of [image_import][crate::model::CreateImageImportRequest::image_import].
5850        ///
5851        /// This is a **required** field for requests.
5852        pub fn set_or_clear_image_import<T>(mut self, v: std::option::Option<T>) -> Self
5853        where
5854            T: std::convert::Into<crate::model::ImageImport>,
5855        {
5856            self.0.request.image_import = v.map(|x| x.into());
5857            self
5858        }
5859
5860        /// Sets the value of [request_id][crate::model::CreateImageImportRequest::request_id].
5861        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5862            self.0.request.request_id = v.into();
5863            self
5864        }
5865    }
5866
5867    #[doc(hidden)]
5868    impl crate::RequestBuilder for CreateImageImport {
5869        fn request_options(&mut self) -> &mut crate::RequestOptions {
5870            &mut self.0.options
5871        }
5872    }
5873
5874    /// The request builder for [VmMigration::delete_image_import][crate::client::VmMigration::delete_image_import] calls.
5875    ///
5876    /// # Example
5877    /// ```
5878    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteImageImport;
5879    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5880    /// use google_cloud_lro::Poller;
5881    ///
5882    /// let builder = prepare_request_builder();
5883    /// let response = builder.poller().until_done().await?;
5884    /// # Ok(()) }
5885    ///
5886    /// fn prepare_request_builder() -> DeleteImageImport {
5887    ///   # panic!();
5888    ///   // ... details omitted ...
5889    /// }
5890    /// ```
5891    #[derive(Clone, Debug)]
5892    pub struct DeleteImageImport(RequestBuilder<crate::model::DeleteImageImportRequest>);
5893
5894    impl DeleteImageImport {
5895        pub(crate) fn new(
5896            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
5897        ) -> Self {
5898            Self(RequestBuilder::new(stub))
5899        }
5900
5901        /// Sets the full request, replacing any prior values.
5902        pub fn with_request<V: Into<crate::model::DeleteImageImportRequest>>(
5903            mut self,
5904            v: V,
5905        ) -> Self {
5906            self.0.request = v.into();
5907            self
5908        }
5909
5910        /// Sets all the options, replacing any prior values.
5911        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5912            self.0.options = v.into();
5913            self
5914        }
5915
5916        /// Sends the request.
5917        ///
5918        /// # Long running operations
5919        ///
5920        /// This starts, but does not poll, a longrunning operation. More information
5921        /// on [delete_image_import][crate::client::VmMigration::delete_image_import].
5922        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5923            (*self.0.stub)
5924                .delete_image_import(self.0.request, self.0.options)
5925                .await
5926                .map(crate::Response::into_body)
5927        }
5928
5929        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_image_import`.
5930        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5931            type Operation =
5932                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5933            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5934            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5935
5936            let stub = self.0.stub.clone();
5937            let mut options = self.0.options.clone();
5938            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5939            let query = move |name| {
5940                let stub = stub.clone();
5941                let options = options.clone();
5942                async {
5943                    let op = GetOperation::new(stub)
5944                        .set_name(name)
5945                        .with_options(options)
5946                        .send()
5947                        .await?;
5948                    Ok(Operation::new(op))
5949                }
5950            };
5951
5952            let start = move || async {
5953                let op = self.send().await?;
5954                Ok(Operation::new(op))
5955            };
5956
5957            google_cloud_lro::internal::new_unit_response_poller(
5958                polling_error_policy,
5959                polling_backoff_policy,
5960                start,
5961                query,
5962            )
5963        }
5964
5965        /// Sets the value of [name][crate::model::DeleteImageImportRequest::name].
5966        ///
5967        /// This is a **required** field for requests.
5968        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5969            self.0.request.name = v.into();
5970            self
5971        }
5972
5973        /// Sets the value of [request_id][crate::model::DeleteImageImportRequest::request_id].
5974        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5975            self.0.request.request_id = v.into();
5976            self
5977        }
5978    }
5979
5980    #[doc(hidden)]
5981    impl crate::RequestBuilder for DeleteImageImport {
5982        fn request_options(&mut self) -> &mut crate::RequestOptions {
5983            &mut self.0.options
5984        }
5985    }
5986
5987    /// The request builder for [VmMigration::list_image_import_jobs][crate::client::VmMigration::list_image_import_jobs] calls.
5988    ///
5989    /// # Example
5990    /// ```
5991    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListImageImportJobs;
5992    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
5993    /// use google_cloud_gax::paginator::ItemPaginator;
5994    ///
5995    /// let builder = prepare_request_builder();
5996    /// let mut items = builder.by_item();
5997    /// while let Some(result) = items.next().await {
5998    ///   let item = result?;
5999    /// }
6000    /// # Ok(()) }
6001    ///
6002    /// fn prepare_request_builder() -> ListImageImportJobs {
6003    ///   # panic!();
6004    ///   // ... details omitted ...
6005    /// }
6006    /// ```
6007    #[derive(Clone, Debug)]
6008    pub struct ListImageImportJobs(RequestBuilder<crate::model::ListImageImportJobsRequest>);
6009
6010    impl ListImageImportJobs {
6011        pub(crate) fn new(
6012            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6013        ) -> Self {
6014            Self(RequestBuilder::new(stub))
6015        }
6016
6017        /// Sets the full request, replacing any prior values.
6018        pub fn with_request<V: Into<crate::model::ListImageImportJobsRequest>>(
6019            mut self,
6020            v: V,
6021        ) -> Self {
6022            self.0.request = v.into();
6023            self
6024        }
6025
6026        /// Sets all the options, replacing any prior values.
6027        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6028            self.0.options = v.into();
6029            self
6030        }
6031
6032        /// Sends the request.
6033        pub async fn send(self) -> Result<crate::model::ListImageImportJobsResponse> {
6034            (*self.0.stub)
6035                .list_image_import_jobs(self.0.request, self.0.options)
6036                .await
6037                .map(crate::Response::into_body)
6038        }
6039
6040        /// Streams each page in the collection.
6041        pub fn by_page(
6042            self,
6043        ) -> impl google_cloud_gax::paginator::Paginator<
6044            crate::model::ListImageImportJobsResponse,
6045            crate::Error,
6046        > {
6047            use std::clone::Clone;
6048            let token = self.0.request.page_token.clone();
6049            let execute = move |token: String| {
6050                let mut builder = self.clone();
6051                builder.0.request = builder.0.request.set_page_token(token);
6052                builder.send()
6053            };
6054            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6055        }
6056
6057        /// Streams each item in the collection.
6058        pub fn by_item(
6059            self,
6060        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6061            crate::model::ListImageImportJobsResponse,
6062            crate::Error,
6063        > {
6064            use google_cloud_gax::paginator::Paginator;
6065            self.by_page().items()
6066        }
6067
6068        /// Sets the value of [parent][crate::model::ListImageImportJobsRequest::parent].
6069        ///
6070        /// This is a **required** field for requests.
6071        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6072            self.0.request.parent = v.into();
6073            self
6074        }
6075
6076        /// Sets the value of [page_size][crate::model::ListImageImportJobsRequest::page_size].
6077        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6078            self.0.request.page_size = v.into();
6079            self
6080        }
6081
6082        /// Sets the value of [page_token][crate::model::ListImageImportJobsRequest::page_token].
6083        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6084            self.0.request.page_token = v.into();
6085            self
6086        }
6087
6088        /// Sets the value of [filter][crate::model::ListImageImportJobsRequest::filter].
6089        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6090            self.0.request.filter = v.into();
6091            self
6092        }
6093
6094        /// Sets the value of [order_by][crate::model::ListImageImportJobsRequest::order_by].
6095        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6096            self.0.request.order_by = v.into();
6097            self
6098        }
6099    }
6100
6101    #[doc(hidden)]
6102    impl crate::RequestBuilder for ListImageImportJobs {
6103        fn request_options(&mut self) -> &mut crate::RequestOptions {
6104            &mut self.0.options
6105        }
6106    }
6107
6108    /// The request builder for [VmMigration::get_image_import_job][crate::client::VmMigration::get_image_import_job] calls.
6109    ///
6110    /// # Example
6111    /// ```
6112    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetImageImportJob;
6113    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6114    ///
6115    /// let builder = prepare_request_builder();
6116    /// let response = builder.send().await?;
6117    /// # Ok(()) }
6118    ///
6119    /// fn prepare_request_builder() -> GetImageImportJob {
6120    ///   # panic!();
6121    ///   // ... details omitted ...
6122    /// }
6123    /// ```
6124    #[derive(Clone, Debug)]
6125    pub struct GetImageImportJob(RequestBuilder<crate::model::GetImageImportJobRequest>);
6126
6127    impl GetImageImportJob {
6128        pub(crate) fn new(
6129            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6130        ) -> Self {
6131            Self(RequestBuilder::new(stub))
6132        }
6133
6134        /// Sets the full request, replacing any prior values.
6135        pub fn with_request<V: Into<crate::model::GetImageImportJobRequest>>(
6136            mut self,
6137            v: V,
6138        ) -> Self {
6139            self.0.request = v.into();
6140            self
6141        }
6142
6143        /// Sets all the options, replacing any prior values.
6144        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6145            self.0.options = v.into();
6146            self
6147        }
6148
6149        /// Sends the request.
6150        pub async fn send(self) -> Result<crate::model::ImageImportJob> {
6151            (*self.0.stub)
6152                .get_image_import_job(self.0.request, self.0.options)
6153                .await
6154                .map(crate::Response::into_body)
6155        }
6156
6157        /// Sets the value of [name][crate::model::GetImageImportJobRequest::name].
6158        ///
6159        /// This is a **required** field for requests.
6160        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6161            self.0.request.name = v.into();
6162            self
6163        }
6164    }
6165
6166    #[doc(hidden)]
6167    impl crate::RequestBuilder for GetImageImportJob {
6168        fn request_options(&mut self) -> &mut crate::RequestOptions {
6169            &mut self.0.options
6170        }
6171    }
6172
6173    /// The request builder for [VmMigration::cancel_image_import_job][crate::client::VmMigration::cancel_image_import_job] calls.
6174    ///
6175    /// # Example
6176    /// ```
6177    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CancelImageImportJob;
6178    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6179    /// use google_cloud_lro::Poller;
6180    ///
6181    /// let builder = prepare_request_builder();
6182    /// let response = builder.poller().until_done().await?;
6183    /// # Ok(()) }
6184    ///
6185    /// fn prepare_request_builder() -> CancelImageImportJob {
6186    ///   # panic!();
6187    ///   // ... details omitted ...
6188    /// }
6189    /// ```
6190    #[derive(Clone, Debug)]
6191    pub struct CancelImageImportJob(RequestBuilder<crate::model::CancelImageImportJobRequest>);
6192
6193    impl CancelImageImportJob {
6194        pub(crate) fn new(
6195            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6196        ) -> Self {
6197            Self(RequestBuilder::new(stub))
6198        }
6199
6200        /// Sets the full request, replacing any prior values.
6201        pub fn with_request<V: Into<crate::model::CancelImageImportJobRequest>>(
6202            mut self,
6203            v: V,
6204        ) -> Self {
6205            self.0.request = v.into();
6206            self
6207        }
6208
6209        /// Sets all the options, replacing any prior values.
6210        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6211            self.0.options = v.into();
6212            self
6213        }
6214
6215        /// Sends the request.
6216        ///
6217        /// # Long running operations
6218        ///
6219        /// This starts, but does not poll, a longrunning operation. More information
6220        /// on [cancel_image_import_job][crate::client::VmMigration::cancel_image_import_job].
6221        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6222            (*self.0.stub)
6223                .cancel_image_import_job(self.0.request, self.0.options)
6224                .await
6225                .map(crate::Response::into_body)
6226        }
6227
6228        /// Creates a [Poller][google_cloud_lro::Poller] to work with `cancel_image_import_job`.
6229        pub fn poller(
6230            self,
6231        ) -> impl google_cloud_lro::Poller<
6232            crate::model::CancelImageImportJobResponse,
6233            crate::model::OperationMetadata,
6234        > {
6235            type Operation = google_cloud_lro::internal::Operation<
6236                crate::model::CancelImageImportJobResponse,
6237                crate::model::OperationMetadata,
6238            >;
6239            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6240            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6241
6242            let stub = self.0.stub.clone();
6243            let mut options = self.0.options.clone();
6244            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6245            let query = move |name| {
6246                let stub = stub.clone();
6247                let options = options.clone();
6248                async {
6249                    let op = GetOperation::new(stub)
6250                        .set_name(name)
6251                        .with_options(options)
6252                        .send()
6253                        .await?;
6254                    Ok(Operation::new(op))
6255                }
6256            };
6257
6258            let start = move || async {
6259                let op = self.send().await?;
6260                Ok(Operation::new(op))
6261            };
6262
6263            google_cloud_lro::internal::new_poller(
6264                polling_error_policy,
6265                polling_backoff_policy,
6266                start,
6267                query,
6268            )
6269        }
6270
6271        /// Sets the value of [name][crate::model::CancelImageImportJobRequest::name].
6272        ///
6273        /// This is a **required** field for requests.
6274        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6275            self.0.request.name = v.into();
6276            self
6277        }
6278    }
6279
6280    #[doc(hidden)]
6281    impl crate::RequestBuilder for CancelImageImportJob {
6282        fn request_options(&mut self) -> &mut crate::RequestOptions {
6283            &mut self.0.options
6284        }
6285    }
6286
6287    /// The request builder for [VmMigration::create_disk_migration_job][crate::client::VmMigration::create_disk_migration_job] calls.
6288    ///
6289    /// # Example
6290    /// ```
6291    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CreateDiskMigrationJob;
6292    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6293    /// use google_cloud_lro::Poller;
6294    ///
6295    /// let builder = prepare_request_builder();
6296    /// let response = builder.poller().until_done().await?;
6297    /// # Ok(()) }
6298    ///
6299    /// fn prepare_request_builder() -> CreateDiskMigrationJob {
6300    ///   # panic!();
6301    ///   // ... details omitted ...
6302    /// }
6303    /// ```
6304    #[derive(Clone, Debug)]
6305    pub struct CreateDiskMigrationJob(RequestBuilder<crate::model::CreateDiskMigrationJobRequest>);
6306
6307    impl CreateDiskMigrationJob {
6308        pub(crate) fn new(
6309            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6310        ) -> Self {
6311            Self(RequestBuilder::new(stub))
6312        }
6313
6314        /// Sets the full request, replacing any prior values.
6315        pub fn with_request<V: Into<crate::model::CreateDiskMigrationJobRequest>>(
6316            mut self,
6317            v: V,
6318        ) -> Self {
6319            self.0.request = v.into();
6320            self
6321        }
6322
6323        /// Sets all the options, replacing any prior values.
6324        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6325            self.0.options = v.into();
6326            self
6327        }
6328
6329        /// Sends the request.
6330        ///
6331        /// # Long running operations
6332        ///
6333        /// This starts, but does not poll, a longrunning operation. More information
6334        /// on [create_disk_migration_job][crate::client::VmMigration::create_disk_migration_job].
6335        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6336            (*self.0.stub)
6337                .create_disk_migration_job(self.0.request, self.0.options)
6338                .await
6339                .map(crate::Response::into_body)
6340        }
6341
6342        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_disk_migration_job`.
6343        pub fn poller(
6344            self,
6345        ) -> impl google_cloud_lro::Poller<crate::model::DiskMigrationJob, crate::model::OperationMetadata>
6346        {
6347            type Operation = google_cloud_lro::internal::Operation<
6348                crate::model::DiskMigrationJob,
6349                crate::model::OperationMetadata,
6350            >;
6351            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6352            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6353
6354            let stub = self.0.stub.clone();
6355            let mut options = self.0.options.clone();
6356            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6357            let query = move |name| {
6358                let stub = stub.clone();
6359                let options = options.clone();
6360                async {
6361                    let op = GetOperation::new(stub)
6362                        .set_name(name)
6363                        .with_options(options)
6364                        .send()
6365                        .await?;
6366                    Ok(Operation::new(op))
6367                }
6368            };
6369
6370            let start = move || async {
6371                let op = self.send().await?;
6372                Ok(Operation::new(op))
6373            };
6374
6375            google_cloud_lro::internal::new_poller(
6376                polling_error_policy,
6377                polling_backoff_policy,
6378                start,
6379                query,
6380            )
6381        }
6382
6383        /// Sets the value of [parent][crate::model::CreateDiskMigrationJobRequest::parent].
6384        ///
6385        /// This is a **required** field for requests.
6386        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6387            self.0.request.parent = v.into();
6388            self
6389        }
6390
6391        /// Sets the value of [disk_migration_job_id][crate::model::CreateDiskMigrationJobRequest::disk_migration_job_id].
6392        ///
6393        /// This is a **required** field for requests.
6394        pub fn set_disk_migration_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6395            self.0.request.disk_migration_job_id = v.into();
6396            self
6397        }
6398
6399        /// Sets the value of [disk_migration_job][crate::model::CreateDiskMigrationJobRequest::disk_migration_job].
6400        ///
6401        /// This is a **required** field for requests.
6402        pub fn set_disk_migration_job<T>(mut self, v: T) -> Self
6403        where
6404            T: std::convert::Into<crate::model::DiskMigrationJob>,
6405        {
6406            self.0.request.disk_migration_job = std::option::Option::Some(v.into());
6407            self
6408        }
6409
6410        /// Sets or clears the value of [disk_migration_job][crate::model::CreateDiskMigrationJobRequest::disk_migration_job].
6411        ///
6412        /// This is a **required** field for requests.
6413        pub fn set_or_clear_disk_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
6414        where
6415            T: std::convert::Into<crate::model::DiskMigrationJob>,
6416        {
6417            self.0.request.disk_migration_job = v.map(|x| x.into());
6418            self
6419        }
6420
6421        /// Sets the value of [request_id][crate::model::CreateDiskMigrationJobRequest::request_id].
6422        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6423            self.0.request.request_id = v.into();
6424            self
6425        }
6426    }
6427
6428    #[doc(hidden)]
6429    impl crate::RequestBuilder for CreateDiskMigrationJob {
6430        fn request_options(&mut self) -> &mut crate::RequestOptions {
6431            &mut self.0.options
6432        }
6433    }
6434
6435    /// The request builder for [VmMigration::list_disk_migration_jobs][crate::client::VmMigration::list_disk_migration_jobs] calls.
6436    ///
6437    /// # Example
6438    /// ```
6439    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListDiskMigrationJobs;
6440    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6441    /// use google_cloud_gax::paginator::ItemPaginator;
6442    ///
6443    /// let builder = prepare_request_builder();
6444    /// let mut items = builder.by_item();
6445    /// while let Some(result) = items.next().await {
6446    ///   let item = result?;
6447    /// }
6448    /// # Ok(()) }
6449    ///
6450    /// fn prepare_request_builder() -> ListDiskMigrationJobs {
6451    ///   # panic!();
6452    ///   // ... details omitted ...
6453    /// }
6454    /// ```
6455    #[derive(Clone, Debug)]
6456    pub struct ListDiskMigrationJobs(RequestBuilder<crate::model::ListDiskMigrationJobsRequest>);
6457
6458    impl ListDiskMigrationJobs {
6459        pub(crate) fn new(
6460            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6461        ) -> Self {
6462            Self(RequestBuilder::new(stub))
6463        }
6464
6465        /// Sets the full request, replacing any prior values.
6466        pub fn with_request<V: Into<crate::model::ListDiskMigrationJobsRequest>>(
6467            mut self,
6468            v: V,
6469        ) -> Self {
6470            self.0.request = v.into();
6471            self
6472        }
6473
6474        /// Sets all the options, replacing any prior values.
6475        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6476            self.0.options = v.into();
6477            self
6478        }
6479
6480        /// Sends the request.
6481        pub async fn send(self) -> Result<crate::model::ListDiskMigrationJobsResponse> {
6482            (*self.0.stub)
6483                .list_disk_migration_jobs(self.0.request, self.0.options)
6484                .await
6485                .map(crate::Response::into_body)
6486        }
6487
6488        /// Streams each page in the collection.
6489        pub fn by_page(
6490            self,
6491        ) -> impl google_cloud_gax::paginator::Paginator<
6492            crate::model::ListDiskMigrationJobsResponse,
6493            crate::Error,
6494        > {
6495            use std::clone::Clone;
6496            let token = self.0.request.page_token.clone();
6497            let execute = move |token: String| {
6498                let mut builder = self.clone();
6499                builder.0.request = builder.0.request.set_page_token(token);
6500                builder.send()
6501            };
6502            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6503        }
6504
6505        /// Streams each item in the collection.
6506        pub fn by_item(
6507            self,
6508        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6509            crate::model::ListDiskMigrationJobsResponse,
6510            crate::Error,
6511        > {
6512            use google_cloud_gax::paginator::Paginator;
6513            self.by_page().items()
6514        }
6515
6516        /// Sets the value of [parent][crate::model::ListDiskMigrationJobsRequest::parent].
6517        ///
6518        /// This is a **required** field for requests.
6519        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6520            self.0.request.parent = v.into();
6521            self
6522        }
6523
6524        /// Sets the value of [page_size][crate::model::ListDiskMigrationJobsRequest::page_size].
6525        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6526            self.0.request.page_size = v.into();
6527            self
6528        }
6529
6530        /// Sets the value of [page_token][crate::model::ListDiskMigrationJobsRequest::page_token].
6531        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6532            self.0.request.page_token = v.into();
6533            self
6534        }
6535
6536        /// Sets the value of [filter][crate::model::ListDiskMigrationJobsRequest::filter].
6537        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6538            self.0.request.filter = v.into();
6539            self
6540        }
6541
6542        /// Sets the value of [order_by][crate::model::ListDiskMigrationJobsRequest::order_by].
6543        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6544            self.0.request.order_by = v.into();
6545            self
6546        }
6547    }
6548
6549    #[doc(hidden)]
6550    impl crate::RequestBuilder for ListDiskMigrationJobs {
6551        fn request_options(&mut self) -> &mut crate::RequestOptions {
6552            &mut self.0.options
6553        }
6554    }
6555
6556    /// The request builder for [VmMigration::get_disk_migration_job][crate::client::VmMigration::get_disk_migration_job] calls.
6557    ///
6558    /// # Example
6559    /// ```
6560    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetDiskMigrationJob;
6561    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6562    ///
6563    /// let builder = prepare_request_builder();
6564    /// let response = builder.send().await?;
6565    /// # Ok(()) }
6566    ///
6567    /// fn prepare_request_builder() -> GetDiskMigrationJob {
6568    ///   # panic!();
6569    ///   // ... details omitted ...
6570    /// }
6571    /// ```
6572    #[derive(Clone, Debug)]
6573    pub struct GetDiskMigrationJob(RequestBuilder<crate::model::GetDiskMigrationJobRequest>);
6574
6575    impl GetDiskMigrationJob {
6576        pub(crate) fn new(
6577            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6578        ) -> Self {
6579            Self(RequestBuilder::new(stub))
6580        }
6581
6582        /// Sets the full request, replacing any prior values.
6583        pub fn with_request<V: Into<crate::model::GetDiskMigrationJobRequest>>(
6584            mut self,
6585            v: V,
6586        ) -> Self {
6587            self.0.request = v.into();
6588            self
6589        }
6590
6591        /// Sets all the options, replacing any prior values.
6592        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6593            self.0.options = v.into();
6594            self
6595        }
6596
6597        /// Sends the request.
6598        pub async fn send(self) -> Result<crate::model::DiskMigrationJob> {
6599            (*self.0.stub)
6600                .get_disk_migration_job(self.0.request, self.0.options)
6601                .await
6602                .map(crate::Response::into_body)
6603        }
6604
6605        /// Sets the value of [name][crate::model::GetDiskMigrationJobRequest::name].
6606        ///
6607        /// This is a **required** field for requests.
6608        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6609            self.0.request.name = v.into();
6610            self
6611        }
6612    }
6613
6614    #[doc(hidden)]
6615    impl crate::RequestBuilder for GetDiskMigrationJob {
6616        fn request_options(&mut self) -> &mut crate::RequestOptions {
6617            &mut self.0.options
6618        }
6619    }
6620
6621    /// The request builder for [VmMigration::update_disk_migration_job][crate::client::VmMigration::update_disk_migration_job] calls.
6622    ///
6623    /// # Example
6624    /// ```
6625    /// # use google_cloud_vmmigration_v1::builder::vm_migration::UpdateDiskMigrationJob;
6626    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6627    /// use google_cloud_lro::Poller;
6628    ///
6629    /// let builder = prepare_request_builder();
6630    /// let response = builder.poller().until_done().await?;
6631    /// # Ok(()) }
6632    ///
6633    /// fn prepare_request_builder() -> UpdateDiskMigrationJob {
6634    ///   # panic!();
6635    ///   // ... details omitted ...
6636    /// }
6637    /// ```
6638    #[derive(Clone, Debug)]
6639    pub struct UpdateDiskMigrationJob(RequestBuilder<crate::model::UpdateDiskMigrationJobRequest>);
6640
6641    impl UpdateDiskMigrationJob {
6642        pub(crate) fn new(
6643            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6644        ) -> Self {
6645            Self(RequestBuilder::new(stub))
6646        }
6647
6648        /// Sets the full request, replacing any prior values.
6649        pub fn with_request<V: Into<crate::model::UpdateDiskMigrationJobRequest>>(
6650            mut self,
6651            v: V,
6652        ) -> Self {
6653            self.0.request = v.into();
6654            self
6655        }
6656
6657        /// Sets all the options, replacing any prior values.
6658        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6659            self.0.options = v.into();
6660            self
6661        }
6662
6663        /// Sends the request.
6664        ///
6665        /// # Long running operations
6666        ///
6667        /// This starts, but does not poll, a longrunning operation. More information
6668        /// on [update_disk_migration_job][crate::client::VmMigration::update_disk_migration_job].
6669        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6670            (*self.0.stub)
6671                .update_disk_migration_job(self.0.request, self.0.options)
6672                .await
6673                .map(crate::Response::into_body)
6674        }
6675
6676        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_disk_migration_job`.
6677        pub fn poller(
6678            self,
6679        ) -> impl google_cloud_lro::Poller<crate::model::DiskMigrationJob, crate::model::OperationMetadata>
6680        {
6681            type Operation = google_cloud_lro::internal::Operation<
6682                crate::model::DiskMigrationJob,
6683                crate::model::OperationMetadata,
6684            >;
6685            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6686            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6687
6688            let stub = self.0.stub.clone();
6689            let mut options = self.0.options.clone();
6690            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6691            let query = move |name| {
6692                let stub = stub.clone();
6693                let options = options.clone();
6694                async {
6695                    let op = GetOperation::new(stub)
6696                        .set_name(name)
6697                        .with_options(options)
6698                        .send()
6699                        .await?;
6700                    Ok(Operation::new(op))
6701                }
6702            };
6703
6704            let start = move || async {
6705                let op = self.send().await?;
6706                Ok(Operation::new(op))
6707            };
6708
6709            google_cloud_lro::internal::new_poller(
6710                polling_error_policy,
6711                polling_backoff_policy,
6712                start,
6713                query,
6714            )
6715        }
6716
6717        /// Sets the value of [update_mask][crate::model::UpdateDiskMigrationJobRequest::update_mask].
6718        pub fn set_update_mask<T>(mut self, v: T) -> Self
6719        where
6720            T: std::convert::Into<wkt::FieldMask>,
6721        {
6722            self.0.request.update_mask = std::option::Option::Some(v.into());
6723            self
6724        }
6725
6726        /// Sets or clears the value of [update_mask][crate::model::UpdateDiskMigrationJobRequest::update_mask].
6727        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6728        where
6729            T: std::convert::Into<wkt::FieldMask>,
6730        {
6731            self.0.request.update_mask = v.map(|x| x.into());
6732            self
6733        }
6734
6735        /// Sets the value of [disk_migration_job][crate::model::UpdateDiskMigrationJobRequest::disk_migration_job].
6736        ///
6737        /// This is a **required** field for requests.
6738        pub fn set_disk_migration_job<T>(mut self, v: T) -> Self
6739        where
6740            T: std::convert::Into<crate::model::DiskMigrationJob>,
6741        {
6742            self.0.request.disk_migration_job = std::option::Option::Some(v.into());
6743            self
6744        }
6745
6746        /// Sets or clears the value of [disk_migration_job][crate::model::UpdateDiskMigrationJobRequest::disk_migration_job].
6747        ///
6748        /// This is a **required** field for requests.
6749        pub fn set_or_clear_disk_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
6750        where
6751            T: std::convert::Into<crate::model::DiskMigrationJob>,
6752        {
6753            self.0.request.disk_migration_job = v.map(|x| x.into());
6754            self
6755        }
6756
6757        /// Sets the value of [request_id][crate::model::UpdateDiskMigrationJobRequest::request_id].
6758        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6759            self.0.request.request_id = v.into();
6760            self
6761        }
6762    }
6763
6764    #[doc(hidden)]
6765    impl crate::RequestBuilder for UpdateDiskMigrationJob {
6766        fn request_options(&mut self) -> &mut crate::RequestOptions {
6767            &mut self.0.options
6768        }
6769    }
6770
6771    /// The request builder for [VmMigration::delete_disk_migration_job][crate::client::VmMigration::delete_disk_migration_job] calls.
6772    ///
6773    /// # Example
6774    /// ```
6775    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteDiskMigrationJob;
6776    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6777    /// use google_cloud_lro::Poller;
6778    ///
6779    /// let builder = prepare_request_builder();
6780    /// let response = builder.poller().until_done().await?;
6781    /// # Ok(()) }
6782    ///
6783    /// fn prepare_request_builder() -> DeleteDiskMigrationJob {
6784    ///   # panic!();
6785    ///   // ... details omitted ...
6786    /// }
6787    /// ```
6788    #[derive(Clone, Debug)]
6789    pub struct DeleteDiskMigrationJob(RequestBuilder<crate::model::DeleteDiskMigrationJobRequest>);
6790
6791    impl DeleteDiskMigrationJob {
6792        pub(crate) fn new(
6793            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6794        ) -> Self {
6795            Self(RequestBuilder::new(stub))
6796        }
6797
6798        /// Sets the full request, replacing any prior values.
6799        pub fn with_request<V: Into<crate::model::DeleteDiskMigrationJobRequest>>(
6800            mut self,
6801            v: V,
6802        ) -> Self {
6803            self.0.request = v.into();
6804            self
6805        }
6806
6807        /// Sets all the options, replacing any prior values.
6808        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6809            self.0.options = v.into();
6810            self
6811        }
6812
6813        /// Sends the request.
6814        ///
6815        /// # Long running operations
6816        ///
6817        /// This starts, but does not poll, a longrunning operation. More information
6818        /// on [delete_disk_migration_job][crate::client::VmMigration::delete_disk_migration_job].
6819        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6820            (*self.0.stub)
6821                .delete_disk_migration_job(self.0.request, self.0.options)
6822                .await
6823                .map(crate::Response::into_body)
6824        }
6825
6826        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_disk_migration_job`.
6827        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6828            type Operation =
6829                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6830            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6831            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6832
6833            let stub = self.0.stub.clone();
6834            let mut options = self.0.options.clone();
6835            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6836            let query = move |name| {
6837                let stub = stub.clone();
6838                let options = options.clone();
6839                async {
6840                    let op = GetOperation::new(stub)
6841                        .set_name(name)
6842                        .with_options(options)
6843                        .send()
6844                        .await?;
6845                    Ok(Operation::new(op))
6846                }
6847            };
6848
6849            let start = move || async {
6850                let op = self.send().await?;
6851                Ok(Operation::new(op))
6852            };
6853
6854            google_cloud_lro::internal::new_unit_response_poller(
6855                polling_error_policy,
6856                polling_backoff_policy,
6857                start,
6858                query,
6859            )
6860        }
6861
6862        /// Sets the value of [name][crate::model::DeleteDiskMigrationJobRequest::name].
6863        ///
6864        /// This is a **required** field for requests.
6865        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6866            self.0.request.name = v.into();
6867            self
6868        }
6869    }
6870
6871    #[doc(hidden)]
6872    impl crate::RequestBuilder for DeleteDiskMigrationJob {
6873        fn request_options(&mut self) -> &mut crate::RequestOptions {
6874            &mut self.0.options
6875        }
6876    }
6877
6878    /// The request builder for [VmMigration::run_disk_migration_job][crate::client::VmMigration::run_disk_migration_job] calls.
6879    ///
6880    /// # Example
6881    /// ```
6882    /// # use google_cloud_vmmigration_v1::builder::vm_migration::RunDiskMigrationJob;
6883    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6884    /// use google_cloud_lro::Poller;
6885    ///
6886    /// let builder = prepare_request_builder();
6887    /// let response = builder.poller().until_done().await?;
6888    /// # Ok(()) }
6889    ///
6890    /// fn prepare_request_builder() -> RunDiskMigrationJob {
6891    ///   # panic!();
6892    ///   // ... details omitted ...
6893    /// }
6894    /// ```
6895    #[derive(Clone, Debug)]
6896    pub struct RunDiskMigrationJob(RequestBuilder<crate::model::RunDiskMigrationJobRequest>);
6897
6898    impl RunDiskMigrationJob {
6899        pub(crate) fn new(
6900            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
6901        ) -> Self {
6902            Self(RequestBuilder::new(stub))
6903        }
6904
6905        /// Sets the full request, replacing any prior values.
6906        pub fn with_request<V: Into<crate::model::RunDiskMigrationJobRequest>>(
6907            mut self,
6908            v: V,
6909        ) -> Self {
6910            self.0.request = v.into();
6911            self
6912        }
6913
6914        /// Sets all the options, replacing any prior values.
6915        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6916            self.0.options = v.into();
6917            self
6918        }
6919
6920        /// Sends the request.
6921        ///
6922        /// # Long running operations
6923        ///
6924        /// This starts, but does not poll, a longrunning operation. More information
6925        /// on [run_disk_migration_job][crate::client::VmMigration::run_disk_migration_job].
6926        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6927            (*self.0.stub)
6928                .run_disk_migration_job(self.0.request, self.0.options)
6929                .await
6930                .map(crate::Response::into_body)
6931        }
6932
6933        /// Creates a [Poller][google_cloud_lro::Poller] to work with `run_disk_migration_job`.
6934        pub fn poller(
6935            self,
6936        ) -> impl google_cloud_lro::Poller<
6937            crate::model::RunDiskMigrationJobResponse,
6938            crate::model::OperationMetadata,
6939        > {
6940            type Operation = google_cloud_lro::internal::Operation<
6941                crate::model::RunDiskMigrationJobResponse,
6942                crate::model::OperationMetadata,
6943            >;
6944            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6945            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6946
6947            let stub = self.0.stub.clone();
6948            let mut options = self.0.options.clone();
6949            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6950            let query = move |name| {
6951                let stub = stub.clone();
6952                let options = options.clone();
6953                async {
6954                    let op = GetOperation::new(stub)
6955                        .set_name(name)
6956                        .with_options(options)
6957                        .send()
6958                        .await?;
6959                    Ok(Operation::new(op))
6960                }
6961            };
6962
6963            let start = move || async {
6964                let op = self.send().await?;
6965                Ok(Operation::new(op))
6966            };
6967
6968            google_cloud_lro::internal::new_poller(
6969                polling_error_policy,
6970                polling_backoff_policy,
6971                start,
6972                query,
6973            )
6974        }
6975
6976        /// Sets the value of [name][crate::model::RunDiskMigrationJobRequest::name].
6977        ///
6978        /// This is a **required** field for requests.
6979        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6980            self.0.request.name = v.into();
6981            self
6982        }
6983    }
6984
6985    #[doc(hidden)]
6986    impl crate::RequestBuilder for RunDiskMigrationJob {
6987        fn request_options(&mut self) -> &mut crate::RequestOptions {
6988            &mut self.0.options
6989        }
6990    }
6991
6992    /// The request builder for [VmMigration::cancel_disk_migration_job][crate::client::VmMigration::cancel_disk_migration_job] calls.
6993    ///
6994    /// # Example
6995    /// ```
6996    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CancelDiskMigrationJob;
6997    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
6998    /// use google_cloud_lro::Poller;
6999    ///
7000    /// let builder = prepare_request_builder();
7001    /// let response = builder.poller().until_done().await?;
7002    /// # Ok(()) }
7003    ///
7004    /// fn prepare_request_builder() -> CancelDiskMigrationJob {
7005    ///   # panic!();
7006    ///   // ... details omitted ...
7007    /// }
7008    /// ```
7009    #[derive(Clone, Debug)]
7010    pub struct CancelDiskMigrationJob(RequestBuilder<crate::model::CancelDiskMigrationJobRequest>);
7011
7012    impl CancelDiskMigrationJob {
7013        pub(crate) fn new(
7014            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
7015        ) -> Self {
7016            Self(RequestBuilder::new(stub))
7017        }
7018
7019        /// Sets the full request, replacing any prior values.
7020        pub fn with_request<V: Into<crate::model::CancelDiskMigrationJobRequest>>(
7021            mut self,
7022            v: V,
7023        ) -> Self {
7024            self.0.request = v.into();
7025            self
7026        }
7027
7028        /// Sets all the options, replacing any prior values.
7029        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7030            self.0.options = v.into();
7031            self
7032        }
7033
7034        /// Sends the request.
7035        ///
7036        /// # Long running operations
7037        ///
7038        /// This starts, but does not poll, a longrunning operation. More information
7039        /// on [cancel_disk_migration_job][crate::client::VmMigration::cancel_disk_migration_job].
7040        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7041            (*self.0.stub)
7042                .cancel_disk_migration_job(self.0.request, self.0.options)
7043                .await
7044                .map(crate::Response::into_body)
7045        }
7046
7047        /// Creates a [Poller][google_cloud_lro::Poller] to work with `cancel_disk_migration_job`.
7048        pub fn poller(
7049            self,
7050        ) -> impl google_cloud_lro::Poller<
7051            crate::model::CancelDiskMigrationJobResponse,
7052            crate::model::OperationMetadata,
7053        > {
7054            type Operation = google_cloud_lro::internal::Operation<
7055                crate::model::CancelDiskMigrationJobResponse,
7056                crate::model::OperationMetadata,
7057            >;
7058            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7059            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7060
7061            let stub = self.0.stub.clone();
7062            let mut options = self.0.options.clone();
7063            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7064            let query = move |name| {
7065                let stub = stub.clone();
7066                let options = options.clone();
7067                async {
7068                    let op = GetOperation::new(stub)
7069                        .set_name(name)
7070                        .with_options(options)
7071                        .send()
7072                        .await?;
7073                    Ok(Operation::new(op))
7074                }
7075            };
7076
7077            let start = move || async {
7078                let op = self.send().await?;
7079                Ok(Operation::new(op))
7080            };
7081
7082            google_cloud_lro::internal::new_poller(
7083                polling_error_policy,
7084                polling_backoff_policy,
7085                start,
7086                query,
7087            )
7088        }
7089
7090        /// Sets the value of [name][crate::model::CancelDiskMigrationJobRequest::name].
7091        ///
7092        /// This is a **required** field for requests.
7093        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7094            self.0.request.name = v.into();
7095            self
7096        }
7097    }
7098
7099    #[doc(hidden)]
7100    impl crate::RequestBuilder for CancelDiskMigrationJob {
7101        fn request_options(&mut self) -> &mut crate::RequestOptions {
7102            &mut self.0.options
7103        }
7104    }
7105
7106    /// The request builder for [VmMigration::list_locations][crate::client::VmMigration::list_locations] calls.
7107    ///
7108    /// # Example
7109    /// ```
7110    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListLocations;
7111    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
7112    /// use google_cloud_gax::paginator::ItemPaginator;
7113    ///
7114    /// let builder = prepare_request_builder();
7115    /// let mut items = builder.by_item();
7116    /// while let Some(result) = items.next().await {
7117    ///   let item = result?;
7118    /// }
7119    /// # Ok(()) }
7120    ///
7121    /// fn prepare_request_builder() -> ListLocations {
7122    ///   # panic!();
7123    ///   // ... details omitted ...
7124    /// }
7125    /// ```
7126    #[derive(Clone, Debug)]
7127    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7128
7129    impl ListLocations {
7130        pub(crate) fn new(
7131            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
7132        ) -> Self {
7133            Self(RequestBuilder::new(stub))
7134        }
7135
7136        /// Sets the full request, replacing any prior values.
7137        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7138            mut self,
7139            v: V,
7140        ) -> Self {
7141            self.0.request = v.into();
7142            self
7143        }
7144
7145        /// Sets all the options, replacing any prior values.
7146        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7147            self.0.options = v.into();
7148            self
7149        }
7150
7151        /// Sends the request.
7152        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7153            (*self.0.stub)
7154                .list_locations(self.0.request, self.0.options)
7155                .await
7156                .map(crate::Response::into_body)
7157        }
7158
7159        /// Streams each page in the collection.
7160        pub fn by_page(
7161            self,
7162        ) -> impl google_cloud_gax::paginator::Paginator<
7163            google_cloud_location::model::ListLocationsResponse,
7164            crate::Error,
7165        > {
7166            use std::clone::Clone;
7167            let token = self.0.request.page_token.clone();
7168            let execute = move |token: String| {
7169                let mut builder = self.clone();
7170                builder.0.request = builder.0.request.set_page_token(token);
7171                builder.send()
7172            };
7173            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7174        }
7175
7176        /// Streams each item in the collection.
7177        pub fn by_item(
7178            self,
7179        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7180            google_cloud_location::model::ListLocationsResponse,
7181            crate::Error,
7182        > {
7183            use google_cloud_gax::paginator::Paginator;
7184            self.by_page().items()
7185        }
7186
7187        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
7188        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7189            self.0.request.name = v.into();
7190            self
7191        }
7192
7193        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
7194        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7195            self.0.request.filter = v.into();
7196            self
7197        }
7198
7199        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
7200        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7201            self.0.request.page_size = v.into();
7202            self
7203        }
7204
7205        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
7206        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7207            self.0.request.page_token = v.into();
7208            self
7209        }
7210    }
7211
7212    #[doc(hidden)]
7213    impl crate::RequestBuilder for ListLocations {
7214        fn request_options(&mut self) -> &mut crate::RequestOptions {
7215            &mut self.0.options
7216        }
7217    }
7218
7219    /// The request builder for [VmMigration::get_location][crate::client::VmMigration::get_location] calls.
7220    ///
7221    /// # Example
7222    /// ```
7223    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetLocation;
7224    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
7225    ///
7226    /// let builder = prepare_request_builder();
7227    /// let response = builder.send().await?;
7228    /// # Ok(()) }
7229    ///
7230    /// fn prepare_request_builder() -> GetLocation {
7231    ///   # panic!();
7232    ///   // ... details omitted ...
7233    /// }
7234    /// ```
7235    #[derive(Clone, Debug)]
7236    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7237
7238    impl GetLocation {
7239        pub(crate) fn new(
7240            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
7241        ) -> Self {
7242            Self(RequestBuilder::new(stub))
7243        }
7244
7245        /// Sets the full request, replacing any prior values.
7246        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7247            mut self,
7248            v: V,
7249        ) -> Self {
7250            self.0.request = v.into();
7251            self
7252        }
7253
7254        /// Sets all the options, replacing any prior values.
7255        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7256            self.0.options = v.into();
7257            self
7258        }
7259
7260        /// Sends the request.
7261        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7262            (*self.0.stub)
7263                .get_location(self.0.request, self.0.options)
7264                .await
7265                .map(crate::Response::into_body)
7266        }
7267
7268        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
7269        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7270            self.0.request.name = v.into();
7271            self
7272        }
7273    }
7274
7275    #[doc(hidden)]
7276    impl crate::RequestBuilder for GetLocation {
7277        fn request_options(&mut self) -> &mut crate::RequestOptions {
7278            &mut self.0.options
7279        }
7280    }
7281
7282    /// The request builder for [VmMigration::list_operations][crate::client::VmMigration::list_operations] calls.
7283    ///
7284    /// # Example
7285    /// ```
7286    /// # use google_cloud_vmmigration_v1::builder::vm_migration::ListOperations;
7287    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
7288    /// use google_cloud_gax::paginator::ItemPaginator;
7289    ///
7290    /// let builder = prepare_request_builder();
7291    /// let mut items = builder.by_item();
7292    /// while let Some(result) = items.next().await {
7293    ///   let item = result?;
7294    /// }
7295    /// # Ok(()) }
7296    ///
7297    /// fn prepare_request_builder() -> ListOperations {
7298    ///   # panic!();
7299    ///   // ... details omitted ...
7300    /// }
7301    /// ```
7302    #[derive(Clone, Debug)]
7303    pub struct ListOperations(
7304        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7305    );
7306
7307    impl ListOperations {
7308        pub(crate) fn new(
7309            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
7310        ) -> Self {
7311            Self(RequestBuilder::new(stub))
7312        }
7313
7314        /// Sets the full request, replacing any prior values.
7315        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7316            mut self,
7317            v: V,
7318        ) -> Self {
7319            self.0.request = v.into();
7320            self
7321        }
7322
7323        /// Sets all the options, replacing any prior values.
7324        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7325            self.0.options = v.into();
7326            self
7327        }
7328
7329        /// Sends the request.
7330        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7331            (*self.0.stub)
7332                .list_operations(self.0.request, self.0.options)
7333                .await
7334                .map(crate::Response::into_body)
7335        }
7336
7337        /// Streams each page in the collection.
7338        pub fn by_page(
7339            self,
7340        ) -> impl google_cloud_gax::paginator::Paginator<
7341            google_cloud_longrunning::model::ListOperationsResponse,
7342            crate::Error,
7343        > {
7344            use std::clone::Clone;
7345            let token = self.0.request.page_token.clone();
7346            let execute = move |token: String| {
7347                let mut builder = self.clone();
7348                builder.0.request = builder.0.request.set_page_token(token);
7349                builder.send()
7350            };
7351            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7352        }
7353
7354        /// Streams each item in the collection.
7355        pub fn by_item(
7356            self,
7357        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7358            google_cloud_longrunning::model::ListOperationsResponse,
7359            crate::Error,
7360        > {
7361            use google_cloud_gax::paginator::Paginator;
7362            self.by_page().items()
7363        }
7364
7365        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
7366        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7367            self.0.request.name = v.into();
7368            self
7369        }
7370
7371        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
7372        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7373            self.0.request.filter = v.into();
7374            self
7375        }
7376
7377        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
7378        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7379            self.0.request.page_size = v.into();
7380            self
7381        }
7382
7383        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
7384        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7385            self.0.request.page_token = v.into();
7386            self
7387        }
7388
7389        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
7390        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7391            self.0.request.return_partial_success = v.into();
7392            self
7393        }
7394    }
7395
7396    #[doc(hidden)]
7397    impl crate::RequestBuilder for ListOperations {
7398        fn request_options(&mut self) -> &mut crate::RequestOptions {
7399            &mut self.0.options
7400        }
7401    }
7402
7403    /// The request builder for [VmMigration::get_operation][crate::client::VmMigration::get_operation] calls.
7404    ///
7405    /// # Example
7406    /// ```
7407    /// # use google_cloud_vmmigration_v1::builder::vm_migration::GetOperation;
7408    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
7409    ///
7410    /// let builder = prepare_request_builder();
7411    /// let response = builder.send().await?;
7412    /// # Ok(()) }
7413    ///
7414    /// fn prepare_request_builder() -> GetOperation {
7415    ///   # panic!();
7416    ///   // ... details omitted ...
7417    /// }
7418    /// ```
7419    #[derive(Clone, Debug)]
7420    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7421
7422    impl GetOperation {
7423        pub(crate) fn new(
7424            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
7425        ) -> Self {
7426            Self(RequestBuilder::new(stub))
7427        }
7428
7429        /// Sets the full request, replacing any prior values.
7430        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7431            mut self,
7432            v: V,
7433        ) -> Self {
7434            self.0.request = v.into();
7435            self
7436        }
7437
7438        /// Sets all the options, replacing any prior values.
7439        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7440            self.0.options = v.into();
7441            self
7442        }
7443
7444        /// Sends the request.
7445        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7446            (*self.0.stub)
7447                .get_operation(self.0.request, self.0.options)
7448                .await
7449                .map(crate::Response::into_body)
7450        }
7451
7452        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7453        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7454            self.0.request.name = v.into();
7455            self
7456        }
7457    }
7458
7459    #[doc(hidden)]
7460    impl crate::RequestBuilder for GetOperation {
7461        fn request_options(&mut self) -> &mut crate::RequestOptions {
7462            &mut self.0.options
7463        }
7464    }
7465
7466    /// The request builder for [VmMigration::delete_operation][crate::client::VmMigration::delete_operation] calls.
7467    ///
7468    /// # Example
7469    /// ```
7470    /// # use google_cloud_vmmigration_v1::builder::vm_migration::DeleteOperation;
7471    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
7472    ///
7473    /// let builder = prepare_request_builder();
7474    /// let response = builder.send().await?;
7475    /// # Ok(()) }
7476    ///
7477    /// fn prepare_request_builder() -> DeleteOperation {
7478    ///   # panic!();
7479    ///   // ... details omitted ...
7480    /// }
7481    /// ```
7482    #[derive(Clone, Debug)]
7483    pub struct DeleteOperation(
7484        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7485    );
7486
7487    impl DeleteOperation {
7488        pub(crate) fn new(
7489            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
7490        ) -> Self {
7491            Self(RequestBuilder::new(stub))
7492        }
7493
7494        /// Sets the full request, replacing any prior values.
7495        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7496            mut self,
7497            v: V,
7498        ) -> Self {
7499            self.0.request = v.into();
7500            self
7501        }
7502
7503        /// Sets all the options, replacing any prior values.
7504        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7505            self.0.options = v.into();
7506            self
7507        }
7508
7509        /// Sends the request.
7510        pub async fn send(self) -> Result<()> {
7511            (*self.0.stub)
7512                .delete_operation(self.0.request, self.0.options)
7513                .await
7514                .map(crate::Response::into_body)
7515        }
7516
7517        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
7518        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7519            self.0.request.name = v.into();
7520            self
7521        }
7522    }
7523
7524    #[doc(hidden)]
7525    impl crate::RequestBuilder for DeleteOperation {
7526        fn request_options(&mut self) -> &mut crate::RequestOptions {
7527            &mut self.0.options
7528        }
7529    }
7530
7531    /// The request builder for [VmMigration::cancel_operation][crate::client::VmMigration::cancel_operation] calls.
7532    ///
7533    /// # Example
7534    /// ```
7535    /// # use google_cloud_vmmigration_v1::builder::vm_migration::CancelOperation;
7536    /// # async fn sample() -> google_cloud_vmmigration_v1::Result<()> {
7537    ///
7538    /// let builder = prepare_request_builder();
7539    /// let response = builder.send().await?;
7540    /// # Ok(()) }
7541    ///
7542    /// fn prepare_request_builder() -> CancelOperation {
7543    ///   # panic!();
7544    ///   // ... details omitted ...
7545    /// }
7546    /// ```
7547    #[derive(Clone, Debug)]
7548    pub struct CancelOperation(
7549        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7550    );
7551
7552    impl CancelOperation {
7553        pub(crate) fn new(
7554            stub: std::sync::Arc<dyn super::super::stub::dynamic::VmMigration>,
7555        ) -> Self {
7556            Self(RequestBuilder::new(stub))
7557        }
7558
7559        /// Sets the full request, replacing any prior values.
7560        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7561            mut self,
7562            v: V,
7563        ) -> Self {
7564            self.0.request = v.into();
7565            self
7566        }
7567
7568        /// Sets all the options, replacing any prior values.
7569        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7570            self.0.options = v.into();
7571            self
7572        }
7573
7574        /// Sends the request.
7575        pub async fn send(self) -> Result<()> {
7576            (*self.0.stub)
7577                .cancel_operation(self.0.request, self.0.options)
7578                .await
7579                .map(crate::Response::into_body)
7580        }
7581
7582        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7583        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7584            self.0.request.name = v.into();
7585            self
7586        }
7587    }
7588
7589    #[doc(hidden)]
7590    impl crate::RequestBuilder for CancelOperation {
7591        fn request_options(&mut self) -> &mut crate::RequestOptions {
7592            &mut self.0.options
7593        }
7594    }
7595}