1pub mod vm_migration {
19 use crate::Result;
20
21 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 #[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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
226 self.0.options = v.into();
227 self
228 }
229
230 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
289 self.0.options = v.into();
290 self
291 }
292
293 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
434 self.0.options = v.into();
435 self
436 }
437
438 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
581 self.0.options = v.into();
582 self
583 }
584
585 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
690 self.0.options = v.into();
691 self
692 }
693
694 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
765 self.0.options = v.into();
766 self
767 }
768
769 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
891 self.0.options = v.into();
892 self
893 }
894
895 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 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1016 self.0.options = v.into();
1017 self
1018 }
1019
1020 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1090 self.0.options = v.into();
1091 self
1092 }
1093
1094 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1242 self.0.options = v.into();
1243 self
1244 }
1245
1246 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1360 self.0.options = v.into();
1361 self
1362 }
1363
1364 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1479 self.0.options = v.into();
1480 self
1481 }
1482
1483 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1547 self.0.options = v.into();
1548 self
1549 }
1550
1551 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1699 self.0.options = v.into();
1700 self
1701 }
1702
1703 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1812 self.0.options = v.into();
1813 self
1814 }
1815
1816 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1932 self.0.options = v.into();
1933 self
1934 }
1935
1936 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2083 self.0.options = v.into();
2084 self
2085 }
2086
2087 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 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2205 self.0.options = v.into();
2206 self
2207 }
2208
2209 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2277 self.0.options = v.into();
2278 self
2279 }
2280
2281 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2427 self.0.options = v.into();
2428 self
2429 }
2430
2431 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2531 self.0.options = v.into();
2532 self
2533 }
2534
2535 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2642 self.0.options = v.into();
2643 self
2644 }
2645
2646 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2753 self.0.options = v.into();
2754 self
2755 }
2756
2757 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2867 self.0.options = v.into();
2868 self
2869 }
2870
2871 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2978 self.0.options = v.into();
2979 self
2980 }
2981
2982 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3089 self.0.options = v.into();
3090 self
3091 }
3092
3093 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3234 self.0.options = v.into();
3235 self
3236 }
3237
3238 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3348 self.0.options = v.into();
3349 self
3350 }
3351
3352 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3462 self.0.options = v.into();
3463 self
3464 }
3465
3466 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3528 self.0.options = v.into();
3529 self
3530 }
3531
3532 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3676 self.0.options = v.into();
3677 self
3678 }
3679
3680 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3790 self.0.options = v.into();
3791 self
3792 }
3793
3794 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3906 self.0.options = v.into();
3907 self
3908 }
3909
3910 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3972 self.0.options = v.into();
3973 self
3974 }
3975
3976 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4086 self.0.options = v.into();
4087 self
4088 }
4089
4090 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4149 self.0.options = v.into();
4150 self
4151 }
4152
4153 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4294 self.0.options = v.into();
4295 self
4296 }
4297
4298 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4441 self.0.options = v.into();
4442 self
4443 }
4444
4445 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4554 self.0.options = v.into();
4555 self
4556 }
4557
4558 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4674 self.0.options = v.into();
4675 self
4676 }
4677
4678 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4797 self.0.options = v.into();
4798 self
4799 }
4800
4801 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4916 self.0.options = v.into();
4917 self
4918 }
4919
4920 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4982 self.0.options = v.into();
4983 self
4984 }
4985
4986 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5130 self.0.options = v.into();
5131 self
5132 }
5133
5134 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5280 self.0.options = v.into();
5281 self
5282 }
5283
5284 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5396 self.0.options = v.into();
5397 self
5398 }
5399
5400 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5515 self.0.options = v.into();
5516 self
5517 }
5518
5519 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5584 self.0.options = v.into();
5585 self
5586 }
5587
5588 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5698 self.0.options = v.into();
5699 self
5700 }
5701
5702 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5764 self.0.options = v.into();
5765 self
5766 }
5767
5768 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5912 self.0.options = v.into();
5913 self
5914 }
5915
5916 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6028 self.0.options = v.into();
6029 self
6030 }
6031
6032 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6145 self.0.options = v.into();
6146 self
6147 }
6148
6149 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6211 self.0.options = v.into();
6212 self
6213 }
6214
6215 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6325 self.0.options = v.into();
6326 self
6327 }
6328
6329 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6476 self.0.options = v.into();
6477 self
6478 }
6479
6480 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6593 self.0.options = v.into();
6594 self
6595 }
6596
6597 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6659 self.0.options = v.into();
6660 self
6661 }
6662
6663 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6809 self.0.options = v.into();
6810 self
6811 }
6812
6813 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6916 self.0.options = v.into();
6917 self
6918 }
6919
6920 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7030 self.0.options = v.into();
7031 self
7032 }
7033
7034 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7147 self.0.options = v.into();
7148 self
7149 }
7150
7151 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7256 self.0.options = v.into();
7257 self
7258 }
7259
7260 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7325 self.0.options = v.into();
7326 self
7327 }
7328
7329 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 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 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 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 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 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 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7440 self.0.options = v.into();
7441 self
7442 }
7443
7444 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7505 self.0.options = v.into();
7506 self
7507 }
7508
7509 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 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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7570 self.0.options = v.into();
7571 self
7572 }
7573
7574 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 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}