1pub mod data_migration_service {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::DataMigrationService;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = DataMigrationService;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListMigrationJobs(RequestBuilder<crate::model::ListMigrationJobsRequest>);
95
96 impl ListMigrationJobs {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListMigrationJobsRequest>>(
105 mut self,
106 v: V,
107 ) -> Self {
108 self.0.request = v.into();
109 self
110 }
111
112 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
114 self.0.options = v.into();
115 self
116 }
117
118 pub async fn send(self) -> Result<crate::model::ListMigrationJobsResponse> {
120 (*self.0.stub)
121 .list_migration_jobs(self.0.request, self.0.options)
122 .await
123 .map(crate::Response::into_body)
124 }
125
126 pub fn by_page(
128 self,
129 ) -> impl google_cloud_gax::paginator::Paginator<
130 crate::model::ListMigrationJobsResponse,
131 crate::Error,
132 > {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 google_cloud_gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl google_cloud_gax::paginator::ItemPaginator<
147 crate::model::ListMigrationJobsResponse,
148 crate::Error,
149 > {
150 use google_cloud_gax::paginator::Paginator;
151 self.by_page().items()
152 }
153
154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.parent = v.into();
159 self
160 }
161
162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164 self.0.request.page_size = v.into();
165 self
166 }
167
168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.page_token = v.into();
171 self
172 }
173
174 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.filter = v.into();
177 self
178 }
179
180 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
182 self.0.request.order_by = v.into();
183 self
184 }
185 }
186
187 #[doc(hidden)]
188 impl crate::RequestBuilder for ListMigrationJobs {
189 fn request_options(&mut self) -> &mut crate::RequestOptions {
190 &mut self.0.options
191 }
192 }
193
194 #[derive(Clone, Debug)]
211 pub struct GetMigrationJob(RequestBuilder<crate::model::GetMigrationJobRequest>);
212
213 impl GetMigrationJob {
214 pub(crate) fn new(
215 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
216 ) -> Self {
217 Self(RequestBuilder::new(stub))
218 }
219
220 pub fn with_request<V: Into<crate::model::GetMigrationJobRequest>>(mut self, v: V) -> Self {
222 self.0.request = v.into();
223 self
224 }
225
226 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
228 self.0.options = v.into();
229 self
230 }
231
232 pub async fn send(self) -> Result<crate::model::MigrationJob> {
234 (*self.0.stub)
235 .get_migration_job(self.0.request, self.0.options)
236 .await
237 .map(crate::Response::into_body)
238 }
239
240 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
244 self.0.request.name = v.into();
245 self
246 }
247 }
248
249 #[doc(hidden)]
250 impl crate::RequestBuilder for GetMigrationJob {
251 fn request_options(&mut self) -> &mut crate::RequestOptions {
252 &mut self.0.options
253 }
254 }
255
256 #[derive(Clone, Debug)]
274 pub struct CreateMigrationJob(RequestBuilder<crate::model::CreateMigrationJobRequest>);
275
276 impl CreateMigrationJob {
277 pub(crate) fn new(
278 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
279 ) -> Self {
280 Self(RequestBuilder::new(stub))
281 }
282
283 pub fn with_request<V: Into<crate::model::CreateMigrationJobRequest>>(
285 mut self,
286 v: V,
287 ) -> Self {
288 self.0.request = v.into();
289 self
290 }
291
292 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
294 self.0.options = v.into();
295 self
296 }
297
298 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
305 (*self.0.stub)
306 .create_migration_job(self.0.request, self.0.options)
307 .await
308 .map(crate::Response::into_body)
309 }
310
311 pub fn poller(
313 self,
314 ) -> impl google_cloud_lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata>
315 {
316 type Operation = google_cloud_lro::internal::Operation<
317 crate::model::MigrationJob,
318 crate::model::OperationMetadata,
319 >;
320 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
321 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
322
323 let stub = self.0.stub.clone();
324 let mut options = self.0.options.clone();
325 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
326 let query = move |name| {
327 let stub = stub.clone();
328 let options = options.clone();
329 async {
330 let op = GetOperation::new(stub)
331 .set_name(name)
332 .with_options(options)
333 .send()
334 .await?;
335 Ok(Operation::new(op))
336 }
337 };
338
339 let start = move || async {
340 let op = self.send().await?;
341 Ok(Operation::new(op))
342 };
343
344 google_cloud_lro::internal::new_poller(
345 polling_error_policy,
346 polling_backoff_policy,
347 start,
348 query,
349 )
350 }
351
352 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.parent = v.into();
357 self
358 }
359
360 pub fn set_migration_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
364 self.0.request.migration_job_id = v.into();
365 self
366 }
367
368 pub fn set_migration_job<T>(mut self, v: T) -> Self
372 where
373 T: std::convert::Into<crate::model::MigrationJob>,
374 {
375 self.0.request.migration_job = std::option::Option::Some(v.into());
376 self
377 }
378
379 pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
383 where
384 T: std::convert::Into<crate::model::MigrationJob>,
385 {
386 self.0.request.migration_job = v.map(|x| x.into());
387 self
388 }
389
390 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
392 self.0.request.request_id = v.into();
393 self
394 }
395 }
396
397 #[doc(hidden)]
398 impl crate::RequestBuilder for CreateMigrationJob {
399 fn request_options(&mut self) -> &mut crate::RequestOptions {
400 &mut self.0.options
401 }
402 }
403
404 #[derive(Clone, Debug)]
422 pub struct UpdateMigrationJob(RequestBuilder<crate::model::UpdateMigrationJobRequest>);
423
424 impl UpdateMigrationJob {
425 pub(crate) fn new(
426 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
427 ) -> Self {
428 Self(RequestBuilder::new(stub))
429 }
430
431 pub fn with_request<V: Into<crate::model::UpdateMigrationJobRequest>>(
433 mut self,
434 v: V,
435 ) -> Self {
436 self.0.request = v.into();
437 self
438 }
439
440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
442 self.0.options = v.into();
443 self
444 }
445
446 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
453 (*self.0.stub)
454 .update_migration_job(self.0.request, self.0.options)
455 .await
456 .map(crate::Response::into_body)
457 }
458
459 pub fn poller(
461 self,
462 ) -> impl google_cloud_lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata>
463 {
464 type Operation = google_cloud_lro::internal::Operation<
465 crate::model::MigrationJob,
466 crate::model::OperationMetadata,
467 >;
468 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
469 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
470
471 let stub = self.0.stub.clone();
472 let mut options = self.0.options.clone();
473 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
474 let query = move |name| {
475 let stub = stub.clone();
476 let options = options.clone();
477 async {
478 let op = GetOperation::new(stub)
479 .set_name(name)
480 .with_options(options)
481 .send()
482 .await?;
483 Ok(Operation::new(op))
484 }
485 };
486
487 let start = move || async {
488 let op = self.send().await?;
489 Ok(Operation::new(op))
490 };
491
492 google_cloud_lro::internal::new_poller(
493 polling_error_policy,
494 polling_backoff_policy,
495 start,
496 query,
497 )
498 }
499
500 pub fn set_update_mask<T>(mut self, v: T) -> Self
504 where
505 T: std::convert::Into<wkt::FieldMask>,
506 {
507 self.0.request.update_mask = std::option::Option::Some(v.into());
508 self
509 }
510
511 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
515 where
516 T: std::convert::Into<wkt::FieldMask>,
517 {
518 self.0.request.update_mask = v.map(|x| x.into());
519 self
520 }
521
522 pub fn set_migration_job<T>(mut self, v: T) -> Self
526 where
527 T: std::convert::Into<crate::model::MigrationJob>,
528 {
529 self.0.request.migration_job = std::option::Option::Some(v.into());
530 self
531 }
532
533 pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
537 where
538 T: std::convert::Into<crate::model::MigrationJob>,
539 {
540 self.0.request.migration_job = v.map(|x| x.into());
541 self
542 }
543
544 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
546 self.0.request.request_id = v.into();
547 self
548 }
549 }
550
551 #[doc(hidden)]
552 impl crate::RequestBuilder for UpdateMigrationJob {
553 fn request_options(&mut self) -> &mut crate::RequestOptions {
554 &mut self.0.options
555 }
556 }
557
558 #[derive(Clone, Debug)]
576 pub struct DeleteMigrationJob(RequestBuilder<crate::model::DeleteMigrationJobRequest>);
577
578 impl DeleteMigrationJob {
579 pub(crate) fn new(
580 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
581 ) -> Self {
582 Self(RequestBuilder::new(stub))
583 }
584
585 pub fn with_request<V: Into<crate::model::DeleteMigrationJobRequest>>(
587 mut self,
588 v: V,
589 ) -> Self {
590 self.0.request = v.into();
591 self
592 }
593
594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
596 self.0.options = v.into();
597 self
598 }
599
600 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
607 (*self.0.stub)
608 .delete_migration_job(self.0.request, self.0.options)
609 .await
610 .map(crate::Response::into_body)
611 }
612
613 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
615 type Operation =
616 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
617 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
618 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
619
620 let stub = self.0.stub.clone();
621 let mut options = self.0.options.clone();
622 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
623 let query = move |name| {
624 let stub = stub.clone();
625 let options = options.clone();
626 async {
627 let op = GetOperation::new(stub)
628 .set_name(name)
629 .with_options(options)
630 .send()
631 .await?;
632 Ok(Operation::new(op))
633 }
634 };
635
636 let start = move || async {
637 let op = self.send().await?;
638 Ok(Operation::new(op))
639 };
640
641 google_cloud_lro::internal::new_unit_response_poller(
642 polling_error_policy,
643 polling_backoff_policy,
644 start,
645 query,
646 )
647 }
648
649 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
653 self.0.request.name = v.into();
654 self
655 }
656
657 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
659 self.0.request.request_id = v.into();
660 self
661 }
662
663 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
665 self.0.request.force = v.into();
666 self
667 }
668 }
669
670 #[doc(hidden)]
671 impl crate::RequestBuilder for DeleteMigrationJob {
672 fn request_options(&mut self) -> &mut crate::RequestOptions {
673 &mut self.0.options
674 }
675 }
676
677 #[derive(Clone, Debug)]
695 pub struct StartMigrationJob(RequestBuilder<crate::model::StartMigrationJobRequest>);
696
697 impl StartMigrationJob {
698 pub(crate) fn new(
699 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
700 ) -> Self {
701 Self(RequestBuilder::new(stub))
702 }
703
704 pub fn with_request<V: Into<crate::model::StartMigrationJobRequest>>(
706 mut self,
707 v: V,
708 ) -> Self {
709 self.0.request = v.into();
710 self
711 }
712
713 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
715 self.0.options = v.into();
716 self
717 }
718
719 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
726 (*self.0.stub)
727 .start_migration_job(self.0.request, self.0.options)
728 .await
729 .map(crate::Response::into_body)
730 }
731
732 pub fn poller(
734 self,
735 ) -> impl google_cloud_lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata>
736 {
737 type Operation = google_cloud_lro::internal::Operation<
738 crate::model::MigrationJob,
739 crate::model::OperationMetadata,
740 >;
741 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
742 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
743
744 let stub = self.0.stub.clone();
745 let mut options = self.0.options.clone();
746 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
747 let query = move |name| {
748 let stub = stub.clone();
749 let options = options.clone();
750 async {
751 let op = GetOperation::new(stub)
752 .set_name(name)
753 .with_options(options)
754 .send()
755 .await?;
756 Ok(Operation::new(op))
757 }
758 };
759
760 let start = move || async {
761 let op = self.send().await?;
762 Ok(Operation::new(op))
763 };
764
765 google_cloud_lro::internal::new_poller(
766 polling_error_policy,
767 polling_backoff_policy,
768 start,
769 query,
770 )
771 }
772
773 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
775 self.0.request.name = v.into();
776 self
777 }
778
779 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
781 self.0.request.skip_validation = v.into();
782 self
783 }
784 }
785
786 #[doc(hidden)]
787 impl crate::RequestBuilder for StartMigrationJob {
788 fn request_options(&mut self) -> &mut crate::RequestOptions {
789 &mut self.0.options
790 }
791 }
792
793 #[derive(Clone, Debug)]
811 pub struct StopMigrationJob(RequestBuilder<crate::model::StopMigrationJobRequest>);
812
813 impl StopMigrationJob {
814 pub(crate) fn new(
815 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
816 ) -> Self {
817 Self(RequestBuilder::new(stub))
818 }
819
820 pub fn with_request<V: Into<crate::model::StopMigrationJobRequest>>(
822 mut self,
823 v: V,
824 ) -> Self {
825 self.0.request = v.into();
826 self
827 }
828
829 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
831 self.0.options = v.into();
832 self
833 }
834
835 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
842 (*self.0.stub)
843 .stop_migration_job(self.0.request, self.0.options)
844 .await
845 .map(crate::Response::into_body)
846 }
847
848 pub fn poller(
850 self,
851 ) -> impl google_cloud_lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata>
852 {
853 type Operation = google_cloud_lro::internal::Operation<
854 crate::model::MigrationJob,
855 crate::model::OperationMetadata,
856 >;
857 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
858 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
859
860 let stub = self.0.stub.clone();
861 let mut options = self.0.options.clone();
862 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
863 let query = move |name| {
864 let stub = stub.clone();
865 let options = options.clone();
866 async {
867 let op = GetOperation::new(stub)
868 .set_name(name)
869 .with_options(options)
870 .send()
871 .await?;
872 Ok(Operation::new(op))
873 }
874 };
875
876 let start = move || async {
877 let op = self.send().await?;
878 Ok(Operation::new(op))
879 };
880
881 google_cloud_lro::internal::new_poller(
882 polling_error_policy,
883 polling_backoff_policy,
884 start,
885 query,
886 )
887 }
888
889 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
891 self.0.request.name = v.into();
892 self
893 }
894 }
895
896 #[doc(hidden)]
897 impl crate::RequestBuilder for StopMigrationJob {
898 fn request_options(&mut self) -> &mut crate::RequestOptions {
899 &mut self.0.options
900 }
901 }
902
903 #[derive(Clone, Debug)]
921 pub struct ResumeMigrationJob(RequestBuilder<crate::model::ResumeMigrationJobRequest>);
922
923 impl ResumeMigrationJob {
924 pub(crate) fn new(
925 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
926 ) -> Self {
927 Self(RequestBuilder::new(stub))
928 }
929
930 pub fn with_request<V: Into<crate::model::ResumeMigrationJobRequest>>(
932 mut self,
933 v: V,
934 ) -> Self {
935 self.0.request = v.into();
936 self
937 }
938
939 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
941 self.0.options = v.into();
942 self
943 }
944
945 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
952 (*self.0.stub)
953 .resume_migration_job(self.0.request, self.0.options)
954 .await
955 .map(crate::Response::into_body)
956 }
957
958 pub fn poller(
960 self,
961 ) -> impl google_cloud_lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata>
962 {
963 type Operation = google_cloud_lro::internal::Operation<
964 crate::model::MigrationJob,
965 crate::model::OperationMetadata,
966 >;
967 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
968 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
969
970 let stub = self.0.stub.clone();
971 let mut options = self.0.options.clone();
972 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
973 let query = move |name| {
974 let stub = stub.clone();
975 let options = options.clone();
976 async {
977 let op = GetOperation::new(stub)
978 .set_name(name)
979 .with_options(options)
980 .send()
981 .await?;
982 Ok(Operation::new(op))
983 }
984 };
985
986 let start = move || async {
987 let op = self.send().await?;
988 Ok(Operation::new(op))
989 };
990
991 google_cloud_lro::internal::new_poller(
992 polling_error_policy,
993 polling_backoff_policy,
994 start,
995 query,
996 )
997 }
998
999 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1001 self.0.request.name = v.into();
1002 self
1003 }
1004 }
1005
1006 #[doc(hidden)]
1007 impl crate::RequestBuilder for ResumeMigrationJob {
1008 fn request_options(&mut self) -> &mut crate::RequestOptions {
1009 &mut self.0.options
1010 }
1011 }
1012
1013 #[derive(Clone, Debug)]
1031 pub struct PromoteMigrationJob(RequestBuilder<crate::model::PromoteMigrationJobRequest>);
1032
1033 impl PromoteMigrationJob {
1034 pub(crate) fn new(
1035 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1036 ) -> Self {
1037 Self(RequestBuilder::new(stub))
1038 }
1039
1040 pub fn with_request<V: Into<crate::model::PromoteMigrationJobRequest>>(
1042 mut self,
1043 v: V,
1044 ) -> Self {
1045 self.0.request = v.into();
1046 self
1047 }
1048
1049 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1051 self.0.options = v.into();
1052 self
1053 }
1054
1055 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1062 (*self.0.stub)
1063 .promote_migration_job(self.0.request, self.0.options)
1064 .await
1065 .map(crate::Response::into_body)
1066 }
1067
1068 pub fn poller(
1070 self,
1071 ) -> impl google_cloud_lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata>
1072 {
1073 type Operation = google_cloud_lro::internal::Operation<
1074 crate::model::MigrationJob,
1075 crate::model::OperationMetadata,
1076 >;
1077 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1078 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1079
1080 let stub = self.0.stub.clone();
1081 let mut options = self.0.options.clone();
1082 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1083 let query = move |name| {
1084 let stub = stub.clone();
1085 let options = options.clone();
1086 async {
1087 let op = GetOperation::new(stub)
1088 .set_name(name)
1089 .with_options(options)
1090 .send()
1091 .await?;
1092 Ok(Operation::new(op))
1093 }
1094 };
1095
1096 let start = move || async {
1097 let op = self.send().await?;
1098 Ok(Operation::new(op))
1099 };
1100
1101 google_cloud_lro::internal::new_poller(
1102 polling_error_policy,
1103 polling_backoff_policy,
1104 start,
1105 query,
1106 )
1107 }
1108
1109 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1111 self.0.request.name = v.into();
1112 self
1113 }
1114 }
1115
1116 #[doc(hidden)]
1117 impl crate::RequestBuilder for PromoteMigrationJob {
1118 fn request_options(&mut self) -> &mut crate::RequestOptions {
1119 &mut self.0.options
1120 }
1121 }
1122
1123 #[derive(Clone, Debug)]
1141 pub struct VerifyMigrationJob(RequestBuilder<crate::model::VerifyMigrationJobRequest>);
1142
1143 impl VerifyMigrationJob {
1144 pub(crate) fn new(
1145 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1146 ) -> Self {
1147 Self(RequestBuilder::new(stub))
1148 }
1149
1150 pub fn with_request<V: Into<crate::model::VerifyMigrationJobRequest>>(
1152 mut self,
1153 v: V,
1154 ) -> Self {
1155 self.0.request = v.into();
1156 self
1157 }
1158
1159 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1161 self.0.options = v.into();
1162 self
1163 }
1164
1165 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1172 (*self.0.stub)
1173 .verify_migration_job(self.0.request, self.0.options)
1174 .await
1175 .map(crate::Response::into_body)
1176 }
1177
1178 pub fn poller(
1180 self,
1181 ) -> impl google_cloud_lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata>
1182 {
1183 type Operation = google_cloud_lro::internal::Operation<
1184 crate::model::MigrationJob,
1185 crate::model::OperationMetadata,
1186 >;
1187 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1188 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1189
1190 let stub = self.0.stub.clone();
1191 let mut options = self.0.options.clone();
1192 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1193 let query = move |name| {
1194 let stub = stub.clone();
1195 let options = options.clone();
1196 async {
1197 let op = GetOperation::new(stub)
1198 .set_name(name)
1199 .with_options(options)
1200 .send()
1201 .await?;
1202 Ok(Operation::new(op))
1203 }
1204 };
1205
1206 let start = move || async {
1207 let op = self.send().await?;
1208 Ok(Operation::new(op))
1209 };
1210
1211 google_cloud_lro::internal::new_poller(
1212 polling_error_policy,
1213 polling_backoff_policy,
1214 start,
1215 query,
1216 )
1217 }
1218
1219 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1221 self.0.request.name = v.into();
1222 self
1223 }
1224
1225 pub fn set_update_mask<T>(mut self, v: T) -> Self
1227 where
1228 T: std::convert::Into<wkt::FieldMask>,
1229 {
1230 self.0.request.update_mask = std::option::Option::Some(v.into());
1231 self
1232 }
1233
1234 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1236 where
1237 T: std::convert::Into<wkt::FieldMask>,
1238 {
1239 self.0.request.update_mask = v.map(|x| x.into());
1240 self
1241 }
1242
1243 pub fn set_migration_job<T>(mut self, v: T) -> Self
1245 where
1246 T: std::convert::Into<crate::model::MigrationJob>,
1247 {
1248 self.0.request.migration_job = std::option::Option::Some(v.into());
1249 self
1250 }
1251
1252 pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
1254 where
1255 T: std::convert::Into<crate::model::MigrationJob>,
1256 {
1257 self.0.request.migration_job = v.map(|x| x.into());
1258 self
1259 }
1260 }
1261
1262 #[doc(hidden)]
1263 impl crate::RequestBuilder for VerifyMigrationJob {
1264 fn request_options(&mut self) -> &mut crate::RequestOptions {
1265 &mut self.0.options
1266 }
1267 }
1268
1269 #[derive(Clone, Debug)]
1287 pub struct RestartMigrationJob(RequestBuilder<crate::model::RestartMigrationJobRequest>);
1288
1289 impl RestartMigrationJob {
1290 pub(crate) fn new(
1291 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1292 ) -> Self {
1293 Self(RequestBuilder::new(stub))
1294 }
1295
1296 pub fn with_request<V: Into<crate::model::RestartMigrationJobRequest>>(
1298 mut self,
1299 v: V,
1300 ) -> Self {
1301 self.0.request = v.into();
1302 self
1303 }
1304
1305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1307 self.0.options = v.into();
1308 self
1309 }
1310
1311 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1318 (*self.0.stub)
1319 .restart_migration_job(self.0.request, self.0.options)
1320 .await
1321 .map(crate::Response::into_body)
1322 }
1323
1324 pub fn poller(
1326 self,
1327 ) -> impl google_cloud_lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata>
1328 {
1329 type Operation = google_cloud_lro::internal::Operation<
1330 crate::model::MigrationJob,
1331 crate::model::OperationMetadata,
1332 >;
1333 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1334 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1335
1336 let stub = self.0.stub.clone();
1337 let mut options = self.0.options.clone();
1338 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1339 let query = move |name| {
1340 let stub = stub.clone();
1341 let options = options.clone();
1342 async {
1343 let op = GetOperation::new(stub)
1344 .set_name(name)
1345 .with_options(options)
1346 .send()
1347 .await?;
1348 Ok(Operation::new(op))
1349 }
1350 };
1351
1352 let start = move || async {
1353 let op = self.send().await?;
1354 Ok(Operation::new(op))
1355 };
1356
1357 google_cloud_lro::internal::new_poller(
1358 polling_error_policy,
1359 polling_backoff_policy,
1360 start,
1361 query,
1362 )
1363 }
1364
1365 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1367 self.0.request.name = v.into();
1368 self
1369 }
1370
1371 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
1373 self.0.request.skip_validation = v.into();
1374 self
1375 }
1376 }
1377
1378 #[doc(hidden)]
1379 impl crate::RequestBuilder for RestartMigrationJob {
1380 fn request_options(&mut self) -> &mut crate::RequestOptions {
1381 &mut self.0.options
1382 }
1383 }
1384
1385 #[derive(Clone, Debug)]
1402 pub struct GenerateSshScript(RequestBuilder<crate::model::GenerateSshScriptRequest>);
1403
1404 impl GenerateSshScript {
1405 pub(crate) fn new(
1406 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1407 ) -> Self {
1408 Self(RequestBuilder::new(stub))
1409 }
1410
1411 pub fn with_request<V: Into<crate::model::GenerateSshScriptRequest>>(
1413 mut self,
1414 v: V,
1415 ) -> Self {
1416 self.0.request = v.into();
1417 self
1418 }
1419
1420 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1422 self.0.options = v.into();
1423 self
1424 }
1425
1426 pub async fn send(self) -> Result<crate::model::SshScript> {
1428 (*self.0.stub)
1429 .generate_ssh_script(self.0.request, self.0.options)
1430 .await
1431 .map(crate::Response::into_body)
1432 }
1433
1434 pub fn set_migration_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
1436 self.0.request.migration_job = v.into();
1437 self
1438 }
1439
1440 pub fn set_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
1444 self.0.request.vm = v.into();
1445 self
1446 }
1447
1448 pub fn set_vm_port<T: Into<i32>>(mut self, v: T) -> Self {
1450 self.0.request.vm_port = v.into();
1451 self
1452 }
1453
1454 pub fn set_vm_config<
1459 T: Into<Option<crate::model::generate_ssh_script_request::VmConfig>>,
1460 >(
1461 mut self,
1462 v: T,
1463 ) -> Self {
1464 self.0.request.vm_config = v.into();
1465 self
1466 }
1467
1468 pub fn set_vm_creation_config<
1474 T: std::convert::Into<std::boxed::Box<crate::model::VmCreationConfig>>,
1475 >(
1476 mut self,
1477 v: T,
1478 ) -> Self {
1479 self.0.request = self.0.request.set_vm_creation_config(v);
1480 self
1481 }
1482
1483 pub fn set_vm_selection_config<
1489 T: std::convert::Into<std::boxed::Box<crate::model::VmSelectionConfig>>,
1490 >(
1491 mut self,
1492 v: T,
1493 ) -> Self {
1494 self.0.request = self.0.request.set_vm_selection_config(v);
1495 self
1496 }
1497 }
1498
1499 #[doc(hidden)]
1500 impl crate::RequestBuilder for GenerateSshScript {
1501 fn request_options(&mut self) -> &mut crate::RequestOptions {
1502 &mut self.0.options
1503 }
1504 }
1505
1506 #[derive(Clone, Debug)]
1523 pub struct GenerateTcpProxyScript(RequestBuilder<crate::model::GenerateTcpProxyScriptRequest>);
1524
1525 impl GenerateTcpProxyScript {
1526 pub(crate) fn new(
1527 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1528 ) -> Self {
1529 Self(RequestBuilder::new(stub))
1530 }
1531
1532 pub fn with_request<V: Into<crate::model::GenerateTcpProxyScriptRequest>>(
1534 mut self,
1535 v: V,
1536 ) -> Self {
1537 self.0.request = v.into();
1538 self
1539 }
1540
1541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1543 self.0.options = v.into();
1544 self
1545 }
1546
1547 pub async fn send(self) -> Result<crate::model::TcpProxyScript> {
1549 (*self.0.stub)
1550 .generate_tcp_proxy_script(self.0.request, self.0.options)
1551 .await
1552 .map(crate::Response::into_body)
1553 }
1554
1555 pub fn set_migration_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
1557 self.0.request.migration_job = v.into();
1558 self
1559 }
1560
1561 pub fn set_vm_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1565 self.0.request.vm_name = v.into();
1566 self
1567 }
1568
1569 pub fn set_vm_machine_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
1573 self.0.request.vm_machine_type = v.into();
1574 self
1575 }
1576
1577 pub fn set_vm_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1579 self.0.request.vm_zone = v.into();
1580 self
1581 }
1582
1583 pub fn set_vm_subnet<T: Into<std::string::String>>(mut self, v: T) -> Self {
1587 self.0.request.vm_subnet = v.into();
1588 self
1589 }
1590 }
1591
1592 #[doc(hidden)]
1593 impl crate::RequestBuilder for GenerateTcpProxyScript {
1594 fn request_options(&mut self) -> &mut crate::RequestOptions {
1595 &mut self.0.options
1596 }
1597 }
1598
1599 #[derive(Clone, Debug)]
1620 pub struct ListConnectionProfiles(RequestBuilder<crate::model::ListConnectionProfilesRequest>);
1621
1622 impl ListConnectionProfiles {
1623 pub(crate) fn new(
1624 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1625 ) -> Self {
1626 Self(RequestBuilder::new(stub))
1627 }
1628
1629 pub fn with_request<V: Into<crate::model::ListConnectionProfilesRequest>>(
1631 mut self,
1632 v: V,
1633 ) -> Self {
1634 self.0.request = v.into();
1635 self
1636 }
1637
1638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1640 self.0.options = v.into();
1641 self
1642 }
1643
1644 pub async fn send(self) -> Result<crate::model::ListConnectionProfilesResponse> {
1646 (*self.0.stub)
1647 .list_connection_profiles(self.0.request, self.0.options)
1648 .await
1649 .map(crate::Response::into_body)
1650 }
1651
1652 pub fn by_page(
1654 self,
1655 ) -> impl google_cloud_gax::paginator::Paginator<
1656 crate::model::ListConnectionProfilesResponse,
1657 crate::Error,
1658 > {
1659 use std::clone::Clone;
1660 let token = self.0.request.page_token.clone();
1661 let execute = move |token: String| {
1662 let mut builder = self.clone();
1663 builder.0.request = builder.0.request.set_page_token(token);
1664 builder.send()
1665 };
1666 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1667 }
1668
1669 pub fn by_item(
1671 self,
1672 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1673 crate::model::ListConnectionProfilesResponse,
1674 crate::Error,
1675 > {
1676 use google_cloud_gax::paginator::Paginator;
1677 self.by_page().items()
1678 }
1679
1680 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1684 self.0.request.parent = v.into();
1685 self
1686 }
1687
1688 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1690 self.0.request.page_size = v.into();
1691 self
1692 }
1693
1694 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1696 self.0.request.page_token = v.into();
1697 self
1698 }
1699
1700 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1702 self.0.request.filter = v.into();
1703 self
1704 }
1705
1706 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1708 self.0.request.order_by = v.into();
1709 self
1710 }
1711 }
1712
1713 #[doc(hidden)]
1714 impl crate::RequestBuilder for ListConnectionProfiles {
1715 fn request_options(&mut self) -> &mut crate::RequestOptions {
1716 &mut self.0.options
1717 }
1718 }
1719
1720 #[derive(Clone, Debug)]
1737 pub struct GetConnectionProfile(RequestBuilder<crate::model::GetConnectionProfileRequest>);
1738
1739 impl GetConnectionProfile {
1740 pub(crate) fn new(
1741 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1742 ) -> Self {
1743 Self(RequestBuilder::new(stub))
1744 }
1745
1746 pub fn with_request<V: Into<crate::model::GetConnectionProfileRequest>>(
1748 mut self,
1749 v: V,
1750 ) -> Self {
1751 self.0.request = v.into();
1752 self
1753 }
1754
1755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1757 self.0.options = v.into();
1758 self
1759 }
1760
1761 pub async fn send(self) -> Result<crate::model::ConnectionProfile> {
1763 (*self.0.stub)
1764 .get_connection_profile(self.0.request, self.0.options)
1765 .await
1766 .map(crate::Response::into_body)
1767 }
1768
1769 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1773 self.0.request.name = v.into();
1774 self
1775 }
1776 }
1777
1778 #[doc(hidden)]
1779 impl crate::RequestBuilder for GetConnectionProfile {
1780 fn request_options(&mut self) -> &mut crate::RequestOptions {
1781 &mut self.0.options
1782 }
1783 }
1784
1785 #[derive(Clone, Debug)]
1803 pub struct CreateConnectionProfile(
1804 RequestBuilder<crate::model::CreateConnectionProfileRequest>,
1805 );
1806
1807 impl CreateConnectionProfile {
1808 pub(crate) fn new(
1809 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1810 ) -> Self {
1811 Self(RequestBuilder::new(stub))
1812 }
1813
1814 pub fn with_request<V: Into<crate::model::CreateConnectionProfileRequest>>(
1816 mut self,
1817 v: V,
1818 ) -> Self {
1819 self.0.request = v.into();
1820 self
1821 }
1822
1823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1825 self.0.options = v.into();
1826 self
1827 }
1828
1829 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1836 (*self.0.stub)
1837 .create_connection_profile(self.0.request, self.0.options)
1838 .await
1839 .map(crate::Response::into_body)
1840 }
1841
1842 pub fn poller(
1844 self,
1845 ) -> impl google_cloud_lro::Poller<
1846 crate::model::ConnectionProfile,
1847 crate::model::OperationMetadata,
1848 > {
1849 type Operation = google_cloud_lro::internal::Operation<
1850 crate::model::ConnectionProfile,
1851 crate::model::OperationMetadata,
1852 >;
1853 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1854 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1855
1856 let stub = self.0.stub.clone();
1857 let mut options = self.0.options.clone();
1858 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1859 let query = move |name| {
1860 let stub = stub.clone();
1861 let options = options.clone();
1862 async {
1863 let op = GetOperation::new(stub)
1864 .set_name(name)
1865 .with_options(options)
1866 .send()
1867 .await?;
1868 Ok(Operation::new(op))
1869 }
1870 };
1871
1872 let start = move || async {
1873 let op = self.send().await?;
1874 Ok(Operation::new(op))
1875 };
1876
1877 google_cloud_lro::internal::new_poller(
1878 polling_error_policy,
1879 polling_backoff_policy,
1880 start,
1881 query,
1882 )
1883 }
1884
1885 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1889 self.0.request.parent = v.into();
1890 self
1891 }
1892
1893 pub fn set_connection_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1897 self.0.request.connection_profile_id = v.into();
1898 self
1899 }
1900
1901 pub fn set_connection_profile<T>(mut self, v: T) -> Self
1905 where
1906 T: std::convert::Into<crate::model::ConnectionProfile>,
1907 {
1908 self.0.request.connection_profile = std::option::Option::Some(v.into());
1909 self
1910 }
1911
1912 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1916 where
1917 T: std::convert::Into<crate::model::ConnectionProfile>,
1918 {
1919 self.0.request.connection_profile = v.map(|x| x.into());
1920 self
1921 }
1922
1923 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1925 self.0.request.request_id = v.into();
1926 self
1927 }
1928
1929 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1931 self.0.request.validate_only = v.into();
1932 self
1933 }
1934
1935 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
1937 self.0.request.skip_validation = v.into();
1938 self
1939 }
1940 }
1941
1942 #[doc(hidden)]
1943 impl crate::RequestBuilder for CreateConnectionProfile {
1944 fn request_options(&mut self) -> &mut crate::RequestOptions {
1945 &mut self.0.options
1946 }
1947 }
1948
1949 #[derive(Clone, Debug)]
1967 pub struct UpdateConnectionProfile(
1968 RequestBuilder<crate::model::UpdateConnectionProfileRequest>,
1969 );
1970
1971 impl UpdateConnectionProfile {
1972 pub(crate) fn new(
1973 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1974 ) -> Self {
1975 Self(RequestBuilder::new(stub))
1976 }
1977
1978 pub fn with_request<V: Into<crate::model::UpdateConnectionProfileRequest>>(
1980 mut self,
1981 v: V,
1982 ) -> Self {
1983 self.0.request = v.into();
1984 self
1985 }
1986
1987 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1989 self.0.options = v.into();
1990 self
1991 }
1992
1993 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2000 (*self.0.stub)
2001 .update_connection_profile(self.0.request, self.0.options)
2002 .await
2003 .map(crate::Response::into_body)
2004 }
2005
2006 pub fn poller(
2008 self,
2009 ) -> impl google_cloud_lro::Poller<
2010 crate::model::ConnectionProfile,
2011 crate::model::OperationMetadata,
2012 > {
2013 type Operation = google_cloud_lro::internal::Operation<
2014 crate::model::ConnectionProfile,
2015 crate::model::OperationMetadata,
2016 >;
2017 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2018 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2019
2020 let stub = self.0.stub.clone();
2021 let mut options = self.0.options.clone();
2022 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2023 let query = move |name| {
2024 let stub = stub.clone();
2025 let options = options.clone();
2026 async {
2027 let op = GetOperation::new(stub)
2028 .set_name(name)
2029 .with_options(options)
2030 .send()
2031 .await?;
2032 Ok(Operation::new(op))
2033 }
2034 };
2035
2036 let start = move || async {
2037 let op = self.send().await?;
2038 Ok(Operation::new(op))
2039 };
2040
2041 google_cloud_lro::internal::new_poller(
2042 polling_error_policy,
2043 polling_backoff_policy,
2044 start,
2045 query,
2046 )
2047 }
2048
2049 pub fn set_update_mask<T>(mut self, v: T) -> Self
2053 where
2054 T: std::convert::Into<wkt::FieldMask>,
2055 {
2056 self.0.request.update_mask = std::option::Option::Some(v.into());
2057 self
2058 }
2059
2060 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2064 where
2065 T: std::convert::Into<wkt::FieldMask>,
2066 {
2067 self.0.request.update_mask = v.map(|x| x.into());
2068 self
2069 }
2070
2071 pub fn set_connection_profile<T>(mut self, v: T) -> Self
2075 where
2076 T: std::convert::Into<crate::model::ConnectionProfile>,
2077 {
2078 self.0.request.connection_profile = std::option::Option::Some(v.into());
2079 self
2080 }
2081
2082 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
2086 where
2087 T: std::convert::Into<crate::model::ConnectionProfile>,
2088 {
2089 self.0.request.connection_profile = v.map(|x| x.into());
2090 self
2091 }
2092
2093 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2095 self.0.request.request_id = v.into();
2096 self
2097 }
2098
2099 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2101 self.0.request.validate_only = v.into();
2102 self
2103 }
2104
2105 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
2107 self.0.request.skip_validation = v.into();
2108 self
2109 }
2110 }
2111
2112 #[doc(hidden)]
2113 impl crate::RequestBuilder for UpdateConnectionProfile {
2114 fn request_options(&mut self) -> &mut crate::RequestOptions {
2115 &mut self.0.options
2116 }
2117 }
2118
2119 #[derive(Clone, Debug)]
2137 pub struct DeleteConnectionProfile(
2138 RequestBuilder<crate::model::DeleteConnectionProfileRequest>,
2139 );
2140
2141 impl DeleteConnectionProfile {
2142 pub(crate) fn new(
2143 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2144 ) -> Self {
2145 Self(RequestBuilder::new(stub))
2146 }
2147
2148 pub fn with_request<V: Into<crate::model::DeleteConnectionProfileRequest>>(
2150 mut self,
2151 v: V,
2152 ) -> Self {
2153 self.0.request = v.into();
2154 self
2155 }
2156
2157 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2159 self.0.options = v.into();
2160 self
2161 }
2162
2163 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2170 (*self.0.stub)
2171 .delete_connection_profile(self.0.request, self.0.options)
2172 .await
2173 .map(crate::Response::into_body)
2174 }
2175
2176 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2178 type Operation =
2179 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2180 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2181 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2182
2183 let stub = self.0.stub.clone();
2184 let mut options = self.0.options.clone();
2185 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2186 let query = move |name| {
2187 let stub = stub.clone();
2188 let options = options.clone();
2189 async {
2190 let op = GetOperation::new(stub)
2191 .set_name(name)
2192 .with_options(options)
2193 .send()
2194 .await?;
2195 Ok(Operation::new(op))
2196 }
2197 };
2198
2199 let start = move || async {
2200 let op = self.send().await?;
2201 Ok(Operation::new(op))
2202 };
2203
2204 google_cloud_lro::internal::new_unit_response_poller(
2205 polling_error_policy,
2206 polling_backoff_policy,
2207 start,
2208 query,
2209 )
2210 }
2211
2212 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2216 self.0.request.name = v.into();
2217 self
2218 }
2219
2220 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2222 self.0.request.request_id = v.into();
2223 self
2224 }
2225
2226 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2228 self.0.request.force = v.into();
2229 self
2230 }
2231 }
2232
2233 #[doc(hidden)]
2234 impl crate::RequestBuilder for DeleteConnectionProfile {
2235 fn request_options(&mut self) -> &mut crate::RequestOptions {
2236 &mut self.0.options
2237 }
2238 }
2239
2240 #[derive(Clone, Debug)]
2258 pub struct CreatePrivateConnection(
2259 RequestBuilder<crate::model::CreatePrivateConnectionRequest>,
2260 );
2261
2262 impl CreatePrivateConnection {
2263 pub(crate) fn new(
2264 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2265 ) -> Self {
2266 Self(RequestBuilder::new(stub))
2267 }
2268
2269 pub fn with_request<V: Into<crate::model::CreatePrivateConnectionRequest>>(
2271 mut self,
2272 v: V,
2273 ) -> Self {
2274 self.0.request = v.into();
2275 self
2276 }
2277
2278 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2280 self.0.options = v.into();
2281 self
2282 }
2283
2284 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2291 (*self.0.stub)
2292 .create_private_connection(self.0.request, self.0.options)
2293 .await
2294 .map(crate::Response::into_body)
2295 }
2296
2297 pub fn poller(
2299 self,
2300 ) -> impl google_cloud_lro::Poller<
2301 crate::model::PrivateConnection,
2302 crate::model::OperationMetadata,
2303 > {
2304 type Operation = google_cloud_lro::internal::Operation<
2305 crate::model::PrivateConnection,
2306 crate::model::OperationMetadata,
2307 >;
2308 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2309 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2310
2311 let stub = self.0.stub.clone();
2312 let mut options = self.0.options.clone();
2313 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2314 let query = move |name| {
2315 let stub = stub.clone();
2316 let options = options.clone();
2317 async {
2318 let op = GetOperation::new(stub)
2319 .set_name(name)
2320 .with_options(options)
2321 .send()
2322 .await?;
2323 Ok(Operation::new(op))
2324 }
2325 };
2326
2327 let start = move || async {
2328 let op = self.send().await?;
2329 Ok(Operation::new(op))
2330 };
2331
2332 google_cloud_lro::internal::new_poller(
2333 polling_error_policy,
2334 polling_backoff_policy,
2335 start,
2336 query,
2337 )
2338 }
2339
2340 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2344 self.0.request.parent = v.into();
2345 self
2346 }
2347
2348 pub fn set_private_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2352 self.0.request.private_connection_id = v.into();
2353 self
2354 }
2355
2356 pub fn set_private_connection<T>(mut self, v: T) -> Self
2360 where
2361 T: std::convert::Into<crate::model::PrivateConnection>,
2362 {
2363 self.0.request.private_connection = std::option::Option::Some(v.into());
2364 self
2365 }
2366
2367 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2371 where
2372 T: std::convert::Into<crate::model::PrivateConnection>,
2373 {
2374 self.0.request.private_connection = v.map(|x| x.into());
2375 self
2376 }
2377
2378 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2380 self.0.request.request_id = v.into();
2381 self
2382 }
2383
2384 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
2386 self.0.request.skip_validation = v.into();
2387 self
2388 }
2389 }
2390
2391 #[doc(hidden)]
2392 impl crate::RequestBuilder for CreatePrivateConnection {
2393 fn request_options(&mut self) -> &mut crate::RequestOptions {
2394 &mut self.0.options
2395 }
2396 }
2397
2398 #[derive(Clone, Debug)]
2415 pub struct GetPrivateConnection(RequestBuilder<crate::model::GetPrivateConnectionRequest>);
2416
2417 impl GetPrivateConnection {
2418 pub(crate) fn new(
2419 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2420 ) -> Self {
2421 Self(RequestBuilder::new(stub))
2422 }
2423
2424 pub fn with_request<V: Into<crate::model::GetPrivateConnectionRequest>>(
2426 mut self,
2427 v: V,
2428 ) -> Self {
2429 self.0.request = v.into();
2430 self
2431 }
2432
2433 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2435 self.0.options = v.into();
2436 self
2437 }
2438
2439 pub async fn send(self) -> Result<crate::model::PrivateConnection> {
2441 (*self.0.stub)
2442 .get_private_connection(self.0.request, self.0.options)
2443 .await
2444 .map(crate::Response::into_body)
2445 }
2446
2447 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2451 self.0.request.name = v.into();
2452 self
2453 }
2454 }
2455
2456 #[doc(hidden)]
2457 impl crate::RequestBuilder for GetPrivateConnection {
2458 fn request_options(&mut self) -> &mut crate::RequestOptions {
2459 &mut self.0.options
2460 }
2461 }
2462
2463 #[derive(Clone, Debug)]
2484 pub struct ListPrivateConnections(RequestBuilder<crate::model::ListPrivateConnectionsRequest>);
2485
2486 impl ListPrivateConnections {
2487 pub(crate) fn new(
2488 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2489 ) -> Self {
2490 Self(RequestBuilder::new(stub))
2491 }
2492
2493 pub fn with_request<V: Into<crate::model::ListPrivateConnectionsRequest>>(
2495 mut self,
2496 v: V,
2497 ) -> Self {
2498 self.0.request = v.into();
2499 self
2500 }
2501
2502 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2504 self.0.options = v.into();
2505 self
2506 }
2507
2508 pub async fn send(self) -> Result<crate::model::ListPrivateConnectionsResponse> {
2510 (*self.0.stub)
2511 .list_private_connections(self.0.request, self.0.options)
2512 .await
2513 .map(crate::Response::into_body)
2514 }
2515
2516 pub fn by_page(
2518 self,
2519 ) -> impl google_cloud_gax::paginator::Paginator<
2520 crate::model::ListPrivateConnectionsResponse,
2521 crate::Error,
2522 > {
2523 use std::clone::Clone;
2524 let token = self.0.request.page_token.clone();
2525 let execute = move |token: String| {
2526 let mut builder = self.clone();
2527 builder.0.request = builder.0.request.set_page_token(token);
2528 builder.send()
2529 };
2530 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2531 }
2532
2533 pub fn by_item(
2535 self,
2536 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2537 crate::model::ListPrivateConnectionsResponse,
2538 crate::Error,
2539 > {
2540 use google_cloud_gax::paginator::Paginator;
2541 self.by_page().items()
2542 }
2543
2544 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2548 self.0.request.parent = v.into();
2549 self
2550 }
2551
2552 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2554 self.0.request.page_size = v.into();
2555 self
2556 }
2557
2558 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2560 self.0.request.page_token = v.into();
2561 self
2562 }
2563
2564 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2566 self.0.request.filter = v.into();
2567 self
2568 }
2569
2570 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2572 self.0.request.order_by = v.into();
2573 self
2574 }
2575 }
2576
2577 #[doc(hidden)]
2578 impl crate::RequestBuilder for ListPrivateConnections {
2579 fn request_options(&mut self) -> &mut crate::RequestOptions {
2580 &mut self.0.options
2581 }
2582 }
2583
2584 #[derive(Clone, Debug)]
2602 pub struct DeletePrivateConnection(
2603 RequestBuilder<crate::model::DeletePrivateConnectionRequest>,
2604 );
2605
2606 impl DeletePrivateConnection {
2607 pub(crate) fn new(
2608 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2609 ) -> Self {
2610 Self(RequestBuilder::new(stub))
2611 }
2612
2613 pub fn with_request<V: Into<crate::model::DeletePrivateConnectionRequest>>(
2615 mut self,
2616 v: V,
2617 ) -> Self {
2618 self.0.request = v.into();
2619 self
2620 }
2621
2622 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2624 self.0.options = v.into();
2625 self
2626 }
2627
2628 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2635 (*self.0.stub)
2636 .delete_private_connection(self.0.request, self.0.options)
2637 .await
2638 .map(crate::Response::into_body)
2639 }
2640
2641 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2643 type Operation =
2644 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2645 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2646 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2647
2648 let stub = self.0.stub.clone();
2649 let mut options = self.0.options.clone();
2650 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2651 let query = move |name| {
2652 let stub = stub.clone();
2653 let options = options.clone();
2654 async {
2655 let op = GetOperation::new(stub)
2656 .set_name(name)
2657 .with_options(options)
2658 .send()
2659 .await?;
2660 Ok(Operation::new(op))
2661 }
2662 };
2663
2664 let start = move || async {
2665 let op = self.send().await?;
2666 Ok(Operation::new(op))
2667 };
2668
2669 google_cloud_lro::internal::new_unit_response_poller(
2670 polling_error_policy,
2671 polling_backoff_policy,
2672 start,
2673 query,
2674 )
2675 }
2676
2677 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2681 self.0.request.name = v.into();
2682 self
2683 }
2684
2685 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2687 self.0.request.request_id = v.into();
2688 self
2689 }
2690 }
2691
2692 #[doc(hidden)]
2693 impl crate::RequestBuilder for DeletePrivateConnection {
2694 fn request_options(&mut self) -> &mut crate::RequestOptions {
2695 &mut self.0.options
2696 }
2697 }
2698
2699 #[derive(Clone, Debug)]
2716 pub struct GetConversionWorkspace(RequestBuilder<crate::model::GetConversionWorkspaceRequest>);
2717
2718 impl GetConversionWorkspace {
2719 pub(crate) fn new(
2720 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2721 ) -> Self {
2722 Self(RequestBuilder::new(stub))
2723 }
2724
2725 pub fn with_request<V: Into<crate::model::GetConversionWorkspaceRequest>>(
2727 mut self,
2728 v: V,
2729 ) -> Self {
2730 self.0.request = v.into();
2731 self
2732 }
2733
2734 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2736 self.0.options = v.into();
2737 self
2738 }
2739
2740 pub async fn send(self) -> Result<crate::model::ConversionWorkspace> {
2742 (*self.0.stub)
2743 .get_conversion_workspace(self.0.request, self.0.options)
2744 .await
2745 .map(crate::Response::into_body)
2746 }
2747
2748 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2752 self.0.request.name = v.into();
2753 self
2754 }
2755 }
2756
2757 #[doc(hidden)]
2758 impl crate::RequestBuilder for GetConversionWorkspace {
2759 fn request_options(&mut self) -> &mut crate::RequestOptions {
2760 &mut self.0.options
2761 }
2762 }
2763
2764 #[derive(Clone, Debug)]
2785 pub struct ListConversionWorkspaces(
2786 RequestBuilder<crate::model::ListConversionWorkspacesRequest>,
2787 );
2788
2789 impl ListConversionWorkspaces {
2790 pub(crate) fn new(
2791 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2792 ) -> Self {
2793 Self(RequestBuilder::new(stub))
2794 }
2795
2796 pub fn with_request<V: Into<crate::model::ListConversionWorkspacesRequest>>(
2798 mut self,
2799 v: V,
2800 ) -> Self {
2801 self.0.request = v.into();
2802 self
2803 }
2804
2805 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2807 self.0.options = v.into();
2808 self
2809 }
2810
2811 pub async fn send(self) -> Result<crate::model::ListConversionWorkspacesResponse> {
2813 (*self.0.stub)
2814 .list_conversion_workspaces(self.0.request, self.0.options)
2815 .await
2816 .map(crate::Response::into_body)
2817 }
2818
2819 pub fn by_page(
2821 self,
2822 ) -> impl google_cloud_gax::paginator::Paginator<
2823 crate::model::ListConversionWorkspacesResponse,
2824 crate::Error,
2825 > {
2826 use std::clone::Clone;
2827 let token = self.0.request.page_token.clone();
2828 let execute = move |token: String| {
2829 let mut builder = self.clone();
2830 builder.0.request = builder.0.request.set_page_token(token);
2831 builder.send()
2832 };
2833 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2834 }
2835
2836 pub fn by_item(
2838 self,
2839 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2840 crate::model::ListConversionWorkspacesResponse,
2841 crate::Error,
2842 > {
2843 use google_cloud_gax::paginator::Paginator;
2844 self.by_page().items()
2845 }
2846
2847 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2851 self.0.request.parent = v.into();
2852 self
2853 }
2854
2855 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2857 self.0.request.page_size = v.into();
2858 self
2859 }
2860
2861 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2863 self.0.request.page_token = v.into();
2864 self
2865 }
2866
2867 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2869 self.0.request.filter = v.into();
2870 self
2871 }
2872 }
2873
2874 #[doc(hidden)]
2875 impl crate::RequestBuilder for ListConversionWorkspaces {
2876 fn request_options(&mut self) -> &mut crate::RequestOptions {
2877 &mut self.0.options
2878 }
2879 }
2880
2881 #[derive(Clone, Debug)]
2899 pub struct CreateConversionWorkspace(
2900 RequestBuilder<crate::model::CreateConversionWorkspaceRequest>,
2901 );
2902
2903 impl CreateConversionWorkspace {
2904 pub(crate) fn new(
2905 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2906 ) -> Self {
2907 Self(RequestBuilder::new(stub))
2908 }
2909
2910 pub fn with_request<V: Into<crate::model::CreateConversionWorkspaceRequest>>(
2912 mut self,
2913 v: V,
2914 ) -> Self {
2915 self.0.request = v.into();
2916 self
2917 }
2918
2919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2921 self.0.options = v.into();
2922 self
2923 }
2924
2925 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2932 (*self.0.stub)
2933 .create_conversion_workspace(self.0.request, self.0.options)
2934 .await
2935 .map(crate::Response::into_body)
2936 }
2937
2938 pub fn poller(
2940 self,
2941 ) -> impl google_cloud_lro::Poller<
2942 crate::model::ConversionWorkspace,
2943 crate::model::OperationMetadata,
2944 > {
2945 type Operation = google_cloud_lro::internal::Operation<
2946 crate::model::ConversionWorkspace,
2947 crate::model::OperationMetadata,
2948 >;
2949 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2950 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2951
2952 let stub = self.0.stub.clone();
2953 let mut options = self.0.options.clone();
2954 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2955 let query = move |name| {
2956 let stub = stub.clone();
2957 let options = options.clone();
2958 async {
2959 let op = GetOperation::new(stub)
2960 .set_name(name)
2961 .with_options(options)
2962 .send()
2963 .await?;
2964 Ok(Operation::new(op))
2965 }
2966 };
2967
2968 let start = move || async {
2969 let op = self.send().await?;
2970 Ok(Operation::new(op))
2971 };
2972
2973 google_cloud_lro::internal::new_poller(
2974 polling_error_policy,
2975 polling_backoff_policy,
2976 start,
2977 query,
2978 )
2979 }
2980
2981 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2985 self.0.request.parent = v.into();
2986 self
2987 }
2988
2989 pub fn set_conversion_workspace_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2993 self.0.request.conversion_workspace_id = v.into();
2994 self
2995 }
2996
2997 pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
3001 where
3002 T: std::convert::Into<crate::model::ConversionWorkspace>,
3003 {
3004 self.0.request.conversion_workspace = std::option::Option::Some(v.into());
3005 self
3006 }
3007
3008 pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
3012 where
3013 T: std::convert::Into<crate::model::ConversionWorkspace>,
3014 {
3015 self.0.request.conversion_workspace = v.map(|x| x.into());
3016 self
3017 }
3018
3019 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3021 self.0.request.request_id = v.into();
3022 self
3023 }
3024 }
3025
3026 #[doc(hidden)]
3027 impl crate::RequestBuilder for CreateConversionWorkspace {
3028 fn request_options(&mut self) -> &mut crate::RequestOptions {
3029 &mut self.0.options
3030 }
3031 }
3032
3033 #[derive(Clone, Debug)]
3051 pub struct UpdateConversionWorkspace(
3052 RequestBuilder<crate::model::UpdateConversionWorkspaceRequest>,
3053 );
3054
3055 impl UpdateConversionWorkspace {
3056 pub(crate) fn new(
3057 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3058 ) -> Self {
3059 Self(RequestBuilder::new(stub))
3060 }
3061
3062 pub fn with_request<V: Into<crate::model::UpdateConversionWorkspaceRequest>>(
3064 mut self,
3065 v: V,
3066 ) -> Self {
3067 self.0.request = v.into();
3068 self
3069 }
3070
3071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3073 self.0.options = v.into();
3074 self
3075 }
3076
3077 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3084 (*self.0.stub)
3085 .update_conversion_workspace(self.0.request, self.0.options)
3086 .await
3087 .map(crate::Response::into_body)
3088 }
3089
3090 pub fn poller(
3092 self,
3093 ) -> impl google_cloud_lro::Poller<
3094 crate::model::ConversionWorkspace,
3095 crate::model::OperationMetadata,
3096 > {
3097 type Operation = google_cloud_lro::internal::Operation<
3098 crate::model::ConversionWorkspace,
3099 crate::model::OperationMetadata,
3100 >;
3101 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3102 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3103
3104 let stub = self.0.stub.clone();
3105 let mut options = self.0.options.clone();
3106 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3107 let query = move |name| {
3108 let stub = stub.clone();
3109 let options = options.clone();
3110 async {
3111 let op = GetOperation::new(stub)
3112 .set_name(name)
3113 .with_options(options)
3114 .send()
3115 .await?;
3116 Ok(Operation::new(op))
3117 }
3118 };
3119
3120 let start = move || async {
3121 let op = self.send().await?;
3122 Ok(Operation::new(op))
3123 };
3124
3125 google_cloud_lro::internal::new_poller(
3126 polling_error_policy,
3127 polling_backoff_policy,
3128 start,
3129 query,
3130 )
3131 }
3132
3133 pub fn set_update_mask<T>(mut self, v: T) -> Self
3137 where
3138 T: std::convert::Into<wkt::FieldMask>,
3139 {
3140 self.0.request.update_mask = std::option::Option::Some(v.into());
3141 self
3142 }
3143
3144 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3148 where
3149 T: std::convert::Into<wkt::FieldMask>,
3150 {
3151 self.0.request.update_mask = v.map(|x| x.into());
3152 self
3153 }
3154
3155 pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
3159 where
3160 T: std::convert::Into<crate::model::ConversionWorkspace>,
3161 {
3162 self.0.request.conversion_workspace = std::option::Option::Some(v.into());
3163 self
3164 }
3165
3166 pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
3170 where
3171 T: std::convert::Into<crate::model::ConversionWorkspace>,
3172 {
3173 self.0.request.conversion_workspace = v.map(|x| x.into());
3174 self
3175 }
3176
3177 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3179 self.0.request.request_id = v.into();
3180 self
3181 }
3182 }
3183
3184 #[doc(hidden)]
3185 impl crate::RequestBuilder for UpdateConversionWorkspace {
3186 fn request_options(&mut self) -> &mut crate::RequestOptions {
3187 &mut self.0.options
3188 }
3189 }
3190
3191 #[derive(Clone, Debug)]
3209 pub struct DeleteConversionWorkspace(
3210 RequestBuilder<crate::model::DeleteConversionWorkspaceRequest>,
3211 );
3212
3213 impl DeleteConversionWorkspace {
3214 pub(crate) fn new(
3215 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3216 ) -> Self {
3217 Self(RequestBuilder::new(stub))
3218 }
3219
3220 pub fn with_request<V: Into<crate::model::DeleteConversionWorkspaceRequest>>(
3222 mut self,
3223 v: V,
3224 ) -> Self {
3225 self.0.request = v.into();
3226 self
3227 }
3228
3229 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3231 self.0.options = v.into();
3232 self
3233 }
3234
3235 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3242 (*self.0.stub)
3243 .delete_conversion_workspace(self.0.request, self.0.options)
3244 .await
3245 .map(crate::Response::into_body)
3246 }
3247
3248 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3250 type Operation =
3251 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3252 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3253 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3254
3255 let stub = self.0.stub.clone();
3256 let mut options = self.0.options.clone();
3257 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3258 let query = move |name| {
3259 let stub = stub.clone();
3260 let options = options.clone();
3261 async {
3262 let op = GetOperation::new(stub)
3263 .set_name(name)
3264 .with_options(options)
3265 .send()
3266 .await?;
3267 Ok(Operation::new(op))
3268 }
3269 };
3270
3271 let start = move || async {
3272 let op = self.send().await?;
3273 Ok(Operation::new(op))
3274 };
3275
3276 google_cloud_lro::internal::new_unit_response_poller(
3277 polling_error_policy,
3278 polling_backoff_policy,
3279 start,
3280 query,
3281 )
3282 }
3283
3284 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3288 self.0.request.name = v.into();
3289 self
3290 }
3291
3292 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3294 self.0.request.request_id = v.into();
3295 self
3296 }
3297
3298 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3300 self.0.request.force = v.into();
3301 self
3302 }
3303 }
3304
3305 #[doc(hidden)]
3306 impl crate::RequestBuilder for DeleteConversionWorkspace {
3307 fn request_options(&mut self) -> &mut crate::RequestOptions {
3308 &mut self.0.options
3309 }
3310 }
3311
3312 #[derive(Clone, Debug)]
3329 pub struct CreateMappingRule(RequestBuilder<crate::model::CreateMappingRuleRequest>);
3330
3331 impl CreateMappingRule {
3332 pub(crate) fn new(
3333 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3334 ) -> Self {
3335 Self(RequestBuilder::new(stub))
3336 }
3337
3338 pub fn with_request<V: Into<crate::model::CreateMappingRuleRequest>>(
3340 mut self,
3341 v: V,
3342 ) -> Self {
3343 self.0.request = v.into();
3344 self
3345 }
3346
3347 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3349 self.0.options = v.into();
3350 self
3351 }
3352
3353 pub async fn send(self) -> Result<crate::model::MappingRule> {
3355 (*self.0.stub)
3356 .create_mapping_rule(self.0.request, self.0.options)
3357 .await
3358 .map(crate::Response::into_body)
3359 }
3360
3361 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3365 self.0.request.parent = v.into();
3366 self
3367 }
3368
3369 pub fn set_mapping_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3373 self.0.request.mapping_rule_id = v.into();
3374 self
3375 }
3376
3377 pub fn set_mapping_rule<T>(mut self, v: T) -> Self
3381 where
3382 T: std::convert::Into<crate::model::MappingRule>,
3383 {
3384 self.0.request.mapping_rule = std::option::Option::Some(v.into());
3385 self
3386 }
3387
3388 pub fn set_or_clear_mapping_rule<T>(mut self, v: std::option::Option<T>) -> Self
3392 where
3393 T: std::convert::Into<crate::model::MappingRule>,
3394 {
3395 self.0.request.mapping_rule = v.map(|x| x.into());
3396 self
3397 }
3398
3399 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3401 self.0.request.request_id = v.into();
3402 self
3403 }
3404 }
3405
3406 #[doc(hidden)]
3407 impl crate::RequestBuilder for CreateMappingRule {
3408 fn request_options(&mut self) -> &mut crate::RequestOptions {
3409 &mut self.0.options
3410 }
3411 }
3412
3413 #[derive(Clone, Debug)]
3430 pub struct DeleteMappingRule(RequestBuilder<crate::model::DeleteMappingRuleRequest>);
3431
3432 impl DeleteMappingRule {
3433 pub(crate) fn new(
3434 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3435 ) -> Self {
3436 Self(RequestBuilder::new(stub))
3437 }
3438
3439 pub fn with_request<V: Into<crate::model::DeleteMappingRuleRequest>>(
3441 mut self,
3442 v: V,
3443 ) -> Self {
3444 self.0.request = v.into();
3445 self
3446 }
3447
3448 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3450 self.0.options = v.into();
3451 self
3452 }
3453
3454 pub async fn send(self) -> Result<()> {
3456 (*self.0.stub)
3457 .delete_mapping_rule(self.0.request, self.0.options)
3458 .await
3459 .map(crate::Response::into_body)
3460 }
3461
3462 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.0.request.name = v.into();
3467 self
3468 }
3469
3470 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3472 self.0.request.request_id = v.into();
3473 self
3474 }
3475 }
3476
3477 #[doc(hidden)]
3478 impl crate::RequestBuilder for DeleteMappingRule {
3479 fn request_options(&mut self) -> &mut crate::RequestOptions {
3480 &mut self.0.options
3481 }
3482 }
3483
3484 #[derive(Clone, Debug)]
3505 pub struct ListMappingRules(RequestBuilder<crate::model::ListMappingRulesRequest>);
3506
3507 impl ListMappingRules {
3508 pub(crate) fn new(
3509 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3510 ) -> Self {
3511 Self(RequestBuilder::new(stub))
3512 }
3513
3514 pub fn with_request<V: Into<crate::model::ListMappingRulesRequest>>(
3516 mut self,
3517 v: V,
3518 ) -> Self {
3519 self.0.request = v.into();
3520 self
3521 }
3522
3523 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3525 self.0.options = v.into();
3526 self
3527 }
3528
3529 pub async fn send(self) -> Result<crate::model::ListMappingRulesResponse> {
3531 (*self.0.stub)
3532 .list_mapping_rules(self.0.request, self.0.options)
3533 .await
3534 .map(crate::Response::into_body)
3535 }
3536
3537 pub fn by_page(
3539 self,
3540 ) -> impl google_cloud_gax::paginator::Paginator<
3541 crate::model::ListMappingRulesResponse,
3542 crate::Error,
3543 > {
3544 use std::clone::Clone;
3545 let token = self.0.request.page_token.clone();
3546 let execute = move |token: String| {
3547 let mut builder = self.clone();
3548 builder.0.request = builder.0.request.set_page_token(token);
3549 builder.send()
3550 };
3551 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3552 }
3553
3554 pub fn by_item(
3556 self,
3557 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3558 crate::model::ListMappingRulesResponse,
3559 crate::Error,
3560 > {
3561 use google_cloud_gax::paginator::Paginator;
3562 self.by_page().items()
3563 }
3564
3565 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3569 self.0.request.parent = v.into();
3570 self
3571 }
3572
3573 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3575 self.0.request.page_size = v.into();
3576 self
3577 }
3578
3579 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3581 self.0.request.page_token = v.into();
3582 self
3583 }
3584 }
3585
3586 #[doc(hidden)]
3587 impl crate::RequestBuilder for ListMappingRules {
3588 fn request_options(&mut self) -> &mut crate::RequestOptions {
3589 &mut self.0.options
3590 }
3591 }
3592
3593 #[derive(Clone, Debug)]
3610 pub struct GetMappingRule(RequestBuilder<crate::model::GetMappingRuleRequest>);
3611
3612 impl GetMappingRule {
3613 pub(crate) fn new(
3614 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3615 ) -> Self {
3616 Self(RequestBuilder::new(stub))
3617 }
3618
3619 pub fn with_request<V: Into<crate::model::GetMappingRuleRequest>>(mut self, v: V) -> Self {
3621 self.0.request = v.into();
3622 self
3623 }
3624
3625 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3627 self.0.options = v.into();
3628 self
3629 }
3630
3631 pub async fn send(self) -> Result<crate::model::MappingRule> {
3633 (*self.0.stub)
3634 .get_mapping_rule(self.0.request, self.0.options)
3635 .await
3636 .map(crate::Response::into_body)
3637 }
3638
3639 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3643 self.0.request.name = v.into();
3644 self
3645 }
3646 }
3647
3648 #[doc(hidden)]
3649 impl crate::RequestBuilder for GetMappingRule {
3650 fn request_options(&mut self) -> &mut crate::RequestOptions {
3651 &mut self.0.options
3652 }
3653 }
3654
3655 #[derive(Clone, Debug)]
3673 pub struct SeedConversionWorkspace(
3674 RequestBuilder<crate::model::SeedConversionWorkspaceRequest>,
3675 );
3676
3677 impl SeedConversionWorkspace {
3678 pub(crate) fn new(
3679 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3680 ) -> Self {
3681 Self(RequestBuilder::new(stub))
3682 }
3683
3684 pub fn with_request<V: Into<crate::model::SeedConversionWorkspaceRequest>>(
3686 mut self,
3687 v: V,
3688 ) -> Self {
3689 self.0.request = v.into();
3690 self
3691 }
3692
3693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3695 self.0.options = v.into();
3696 self
3697 }
3698
3699 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3706 (*self.0.stub)
3707 .seed_conversion_workspace(self.0.request, self.0.options)
3708 .await
3709 .map(crate::Response::into_body)
3710 }
3711
3712 pub fn poller(
3714 self,
3715 ) -> impl google_cloud_lro::Poller<
3716 crate::model::ConversionWorkspace,
3717 crate::model::OperationMetadata,
3718 > {
3719 type Operation = google_cloud_lro::internal::Operation<
3720 crate::model::ConversionWorkspace,
3721 crate::model::OperationMetadata,
3722 >;
3723 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3724 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3725
3726 let stub = self.0.stub.clone();
3727 let mut options = self.0.options.clone();
3728 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3729 let query = move |name| {
3730 let stub = stub.clone();
3731 let options = options.clone();
3732 async {
3733 let op = GetOperation::new(stub)
3734 .set_name(name)
3735 .with_options(options)
3736 .send()
3737 .await?;
3738 Ok(Operation::new(op))
3739 }
3740 };
3741
3742 let start = move || async {
3743 let op = self.send().await?;
3744 Ok(Operation::new(op))
3745 };
3746
3747 google_cloud_lro::internal::new_poller(
3748 polling_error_policy,
3749 polling_backoff_policy,
3750 start,
3751 query,
3752 )
3753 }
3754
3755 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3757 self.0.request.name = v.into();
3758 self
3759 }
3760
3761 pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
3763 self.0.request.auto_commit = v.into();
3764 self
3765 }
3766
3767 pub fn set_seed_from<
3772 T: Into<Option<crate::model::seed_conversion_workspace_request::SeedFrom>>,
3773 >(
3774 mut self,
3775 v: T,
3776 ) -> Self {
3777 self.0.request.seed_from = v.into();
3778 self
3779 }
3780
3781 pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
3787 mut self,
3788 v: T,
3789 ) -> Self {
3790 self.0.request = self.0.request.set_source_connection_profile(v);
3791 self
3792 }
3793
3794 pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
3800 mut self,
3801 v: T,
3802 ) -> Self {
3803 self.0.request = self.0.request.set_destination_connection_profile(v);
3804 self
3805 }
3806 }
3807
3808 #[doc(hidden)]
3809 impl crate::RequestBuilder for SeedConversionWorkspace {
3810 fn request_options(&mut self) -> &mut crate::RequestOptions {
3811 &mut self.0.options
3812 }
3813 }
3814
3815 #[derive(Clone, Debug)]
3833 pub struct ImportMappingRules(RequestBuilder<crate::model::ImportMappingRulesRequest>);
3834
3835 impl ImportMappingRules {
3836 pub(crate) fn new(
3837 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3838 ) -> Self {
3839 Self(RequestBuilder::new(stub))
3840 }
3841
3842 pub fn with_request<V: Into<crate::model::ImportMappingRulesRequest>>(
3844 mut self,
3845 v: V,
3846 ) -> Self {
3847 self.0.request = v.into();
3848 self
3849 }
3850
3851 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3853 self.0.options = v.into();
3854 self
3855 }
3856
3857 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3864 (*self.0.stub)
3865 .import_mapping_rules(self.0.request, self.0.options)
3866 .await
3867 .map(crate::Response::into_body)
3868 }
3869
3870 pub fn poller(
3872 self,
3873 ) -> impl google_cloud_lro::Poller<
3874 crate::model::ConversionWorkspace,
3875 crate::model::OperationMetadata,
3876 > {
3877 type Operation = google_cloud_lro::internal::Operation<
3878 crate::model::ConversionWorkspace,
3879 crate::model::OperationMetadata,
3880 >;
3881 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3882 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3883
3884 let stub = self.0.stub.clone();
3885 let mut options = self.0.options.clone();
3886 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3887 let query = move |name| {
3888 let stub = stub.clone();
3889 let options = options.clone();
3890 async {
3891 let op = GetOperation::new(stub)
3892 .set_name(name)
3893 .with_options(options)
3894 .send()
3895 .await?;
3896 Ok(Operation::new(op))
3897 }
3898 };
3899
3900 let start = move || async {
3901 let op = self.send().await?;
3902 Ok(Operation::new(op))
3903 };
3904
3905 google_cloud_lro::internal::new_poller(
3906 polling_error_policy,
3907 polling_backoff_policy,
3908 start,
3909 query,
3910 )
3911 }
3912
3913 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3917 self.0.request.parent = v.into();
3918 self
3919 }
3920
3921 pub fn set_rules_format<T: Into<crate::model::ImportRulesFileFormat>>(
3925 mut self,
3926 v: T,
3927 ) -> Self {
3928 self.0.request.rules_format = v.into();
3929 self
3930 }
3931
3932 pub fn set_rules_files<T, V>(mut self, v: T) -> Self
3936 where
3937 T: std::iter::IntoIterator<Item = V>,
3938 V: std::convert::Into<crate::model::import_mapping_rules_request::RulesFile>,
3939 {
3940 use std::iter::Iterator;
3941 self.0.request.rules_files = v.into_iter().map(|i| i.into()).collect();
3942 self
3943 }
3944
3945 pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
3949 self.0.request.auto_commit = v.into();
3950 self
3951 }
3952 }
3953
3954 #[doc(hidden)]
3955 impl crate::RequestBuilder for ImportMappingRules {
3956 fn request_options(&mut self) -> &mut crate::RequestOptions {
3957 &mut self.0.options
3958 }
3959 }
3960
3961 #[derive(Clone, Debug)]
3979 pub struct ConvertConversionWorkspace(
3980 RequestBuilder<crate::model::ConvertConversionWorkspaceRequest>,
3981 );
3982
3983 impl ConvertConversionWorkspace {
3984 pub(crate) fn new(
3985 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3986 ) -> Self {
3987 Self(RequestBuilder::new(stub))
3988 }
3989
3990 pub fn with_request<V: Into<crate::model::ConvertConversionWorkspaceRequest>>(
3992 mut self,
3993 v: V,
3994 ) -> Self {
3995 self.0.request = v.into();
3996 self
3997 }
3998
3999 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4001 self.0.options = v.into();
4002 self
4003 }
4004
4005 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4012 (*self.0.stub)
4013 .convert_conversion_workspace(self.0.request, self.0.options)
4014 .await
4015 .map(crate::Response::into_body)
4016 }
4017
4018 pub fn poller(
4020 self,
4021 ) -> impl google_cloud_lro::Poller<
4022 crate::model::ConversionWorkspace,
4023 crate::model::OperationMetadata,
4024 > {
4025 type Operation = google_cloud_lro::internal::Operation<
4026 crate::model::ConversionWorkspace,
4027 crate::model::OperationMetadata,
4028 >;
4029 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4030 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4031
4032 let stub = self.0.stub.clone();
4033 let mut options = self.0.options.clone();
4034 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4035 let query = move |name| {
4036 let stub = stub.clone();
4037 let options = options.clone();
4038 async {
4039 let op = GetOperation::new(stub)
4040 .set_name(name)
4041 .with_options(options)
4042 .send()
4043 .await?;
4044 Ok(Operation::new(op))
4045 }
4046 };
4047
4048 let start = move || async {
4049 let op = self.send().await?;
4050 Ok(Operation::new(op))
4051 };
4052
4053 google_cloud_lro::internal::new_poller(
4054 polling_error_policy,
4055 polling_backoff_policy,
4056 start,
4057 query,
4058 )
4059 }
4060
4061 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4063 self.0.request.name = v.into();
4064 self
4065 }
4066
4067 pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
4069 self.0.request.auto_commit = v.into();
4070 self
4071 }
4072
4073 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4075 self.0.request.filter = v.into();
4076 self
4077 }
4078
4079 pub fn set_convert_full_path<T: Into<bool>>(mut self, v: T) -> Self {
4081 self.0.request.convert_full_path = v.into();
4082 self
4083 }
4084 }
4085
4086 #[doc(hidden)]
4087 impl crate::RequestBuilder for ConvertConversionWorkspace {
4088 fn request_options(&mut self) -> &mut crate::RequestOptions {
4089 &mut self.0.options
4090 }
4091 }
4092
4093 #[derive(Clone, Debug)]
4111 pub struct CommitConversionWorkspace(
4112 RequestBuilder<crate::model::CommitConversionWorkspaceRequest>,
4113 );
4114
4115 impl CommitConversionWorkspace {
4116 pub(crate) fn new(
4117 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4118 ) -> Self {
4119 Self(RequestBuilder::new(stub))
4120 }
4121
4122 pub fn with_request<V: Into<crate::model::CommitConversionWorkspaceRequest>>(
4124 mut self,
4125 v: V,
4126 ) -> Self {
4127 self.0.request = v.into();
4128 self
4129 }
4130
4131 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4133 self.0.options = v.into();
4134 self
4135 }
4136
4137 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4144 (*self.0.stub)
4145 .commit_conversion_workspace(self.0.request, self.0.options)
4146 .await
4147 .map(crate::Response::into_body)
4148 }
4149
4150 pub fn poller(
4152 self,
4153 ) -> impl google_cloud_lro::Poller<
4154 crate::model::ConversionWorkspace,
4155 crate::model::OperationMetadata,
4156 > {
4157 type Operation = google_cloud_lro::internal::Operation<
4158 crate::model::ConversionWorkspace,
4159 crate::model::OperationMetadata,
4160 >;
4161 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4162 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4163
4164 let stub = self.0.stub.clone();
4165 let mut options = self.0.options.clone();
4166 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4167 let query = move |name| {
4168 let stub = stub.clone();
4169 let options = options.clone();
4170 async {
4171 let op = GetOperation::new(stub)
4172 .set_name(name)
4173 .with_options(options)
4174 .send()
4175 .await?;
4176 Ok(Operation::new(op))
4177 }
4178 };
4179
4180 let start = move || async {
4181 let op = self.send().await?;
4182 Ok(Operation::new(op))
4183 };
4184
4185 google_cloud_lro::internal::new_poller(
4186 polling_error_policy,
4187 polling_backoff_policy,
4188 start,
4189 query,
4190 )
4191 }
4192
4193 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4197 self.0.request.name = v.into();
4198 self
4199 }
4200
4201 pub fn set_commit_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4203 self.0.request.commit_name = v.into();
4204 self
4205 }
4206 }
4207
4208 #[doc(hidden)]
4209 impl crate::RequestBuilder for CommitConversionWorkspace {
4210 fn request_options(&mut self) -> &mut crate::RequestOptions {
4211 &mut self.0.options
4212 }
4213 }
4214
4215 #[derive(Clone, Debug)]
4233 pub struct RollbackConversionWorkspace(
4234 RequestBuilder<crate::model::RollbackConversionWorkspaceRequest>,
4235 );
4236
4237 impl RollbackConversionWorkspace {
4238 pub(crate) fn new(
4239 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4240 ) -> Self {
4241 Self(RequestBuilder::new(stub))
4242 }
4243
4244 pub fn with_request<V: Into<crate::model::RollbackConversionWorkspaceRequest>>(
4246 mut self,
4247 v: V,
4248 ) -> Self {
4249 self.0.request = v.into();
4250 self
4251 }
4252
4253 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4255 self.0.options = v.into();
4256 self
4257 }
4258
4259 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4266 (*self.0.stub)
4267 .rollback_conversion_workspace(self.0.request, self.0.options)
4268 .await
4269 .map(crate::Response::into_body)
4270 }
4271
4272 pub fn poller(
4274 self,
4275 ) -> impl google_cloud_lro::Poller<
4276 crate::model::ConversionWorkspace,
4277 crate::model::OperationMetadata,
4278 > {
4279 type Operation = google_cloud_lro::internal::Operation<
4280 crate::model::ConversionWorkspace,
4281 crate::model::OperationMetadata,
4282 >;
4283 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4284 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4285
4286 let stub = self.0.stub.clone();
4287 let mut options = self.0.options.clone();
4288 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4289 let query = move |name| {
4290 let stub = stub.clone();
4291 let options = options.clone();
4292 async {
4293 let op = GetOperation::new(stub)
4294 .set_name(name)
4295 .with_options(options)
4296 .send()
4297 .await?;
4298 Ok(Operation::new(op))
4299 }
4300 };
4301
4302 let start = move || async {
4303 let op = self.send().await?;
4304 Ok(Operation::new(op))
4305 };
4306
4307 google_cloud_lro::internal::new_poller(
4308 polling_error_policy,
4309 polling_backoff_policy,
4310 start,
4311 query,
4312 )
4313 }
4314
4315 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4319 self.0.request.name = v.into();
4320 self
4321 }
4322 }
4323
4324 #[doc(hidden)]
4325 impl crate::RequestBuilder for RollbackConversionWorkspace {
4326 fn request_options(&mut self) -> &mut crate::RequestOptions {
4327 &mut self.0.options
4328 }
4329 }
4330
4331 #[derive(Clone, Debug)]
4349 pub struct ApplyConversionWorkspace(
4350 RequestBuilder<crate::model::ApplyConversionWorkspaceRequest>,
4351 );
4352
4353 impl ApplyConversionWorkspace {
4354 pub(crate) fn new(
4355 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4356 ) -> Self {
4357 Self(RequestBuilder::new(stub))
4358 }
4359
4360 pub fn with_request<V: Into<crate::model::ApplyConversionWorkspaceRequest>>(
4362 mut self,
4363 v: V,
4364 ) -> Self {
4365 self.0.request = v.into();
4366 self
4367 }
4368
4369 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4371 self.0.options = v.into();
4372 self
4373 }
4374
4375 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4382 (*self.0.stub)
4383 .apply_conversion_workspace(self.0.request, self.0.options)
4384 .await
4385 .map(crate::Response::into_body)
4386 }
4387
4388 pub fn poller(
4390 self,
4391 ) -> impl google_cloud_lro::Poller<
4392 crate::model::ConversionWorkspace,
4393 crate::model::OperationMetadata,
4394 > {
4395 type Operation = google_cloud_lro::internal::Operation<
4396 crate::model::ConversionWorkspace,
4397 crate::model::OperationMetadata,
4398 >;
4399 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4400 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4401
4402 let stub = self.0.stub.clone();
4403 let mut options = self.0.options.clone();
4404 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4405 let query = move |name| {
4406 let stub = stub.clone();
4407 let options = options.clone();
4408 async {
4409 let op = GetOperation::new(stub)
4410 .set_name(name)
4411 .with_options(options)
4412 .send()
4413 .await?;
4414 Ok(Operation::new(op))
4415 }
4416 };
4417
4418 let start = move || async {
4419 let op = self.send().await?;
4420 Ok(Operation::new(op))
4421 };
4422
4423 google_cloud_lro::internal::new_poller(
4424 polling_error_policy,
4425 polling_backoff_policy,
4426 start,
4427 query,
4428 )
4429 }
4430
4431 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4435 self.0.request.name = v.into();
4436 self
4437 }
4438
4439 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4441 self.0.request.filter = v.into();
4442 self
4443 }
4444
4445 pub fn set_dry_run<T: Into<bool>>(mut self, v: T) -> Self {
4447 self.0.request.dry_run = v.into();
4448 self
4449 }
4450
4451 pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
4453 self.0.request.auto_commit = v.into();
4454 self
4455 }
4456
4457 pub fn set_destination<
4462 T: Into<Option<crate::model::apply_conversion_workspace_request::Destination>>,
4463 >(
4464 mut self,
4465 v: T,
4466 ) -> Self {
4467 self.0.request.destination = v.into();
4468 self
4469 }
4470
4471 pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
4477 mut self,
4478 v: T,
4479 ) -> Self {
4480 self.0.request = self.0.request.set_connection_profile(v);
4481 self
4482 }
4483 }
4484
4485 #[doc(hidden)]
4486 impl crate::RequestBuilder for ApplyConversionWorkspace {
4487 fn request_options(&mut self) -> &mut crate::RequestOptions {
4488 &mut self.0.options
4489 }
4490 }
4491
4492 #[derive(Clone, Debug)]
4513 pub struct DescribeDatabaseEntities(
4514 RequestBuilder<crate::model::DescribeDatabaseEntitiesRequest>,
4515 );
4516
4517 impl DescribeDatabaseEntities {
4518 pub(crate) fn new(
4519 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4520 ) -> Self {
4521 Self(RequestBuilder::new(stub))
4522 }
4523
4524 pub fn with_request<V: Into<crate::model::DescribeDatabaseEntitiesRequest>>(
4526 mut self,
4527 v: V,
4528 ) -> Self {
4529 self.0.request = v.into();
4530 self
4531 }
4532
4533 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4535 self.0.options = v.into();
4536 self
4537 }
4538
4539 pub async fn send(self) -> Result<crate::model::DescribeDatabaseEntitiesResponse> {
4541 (*self.0.stub)
4542 .describe_database_entities(self.0.request, self.0.options)
4543 .await
4544 .map(crate::Response::into_body)
4545 }
4546
4547 pub fn by_page(
4549 self,
4550 ) -> impl google_cloud_gax::paginator::Paginator<
4551 crate::model::DescribeDatabaseEntitiesResponse,
4552 crate::Error,
4553 > {
4554 use std::clone::Clone;
4555 let token = self.0.request.page_token.clone();
4556 let execute = move |token: String| {
4557 let mut builder = self.clone();
4558 builder.0.request = builder.0.request.set_page_token(token);
4559 builder.send()
4560 };
4561 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4562 }
4563
4564 pub fn by_item(
4566 self,
4567 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4568 crate::model::DescribeDatabaseEntitiesResponse,
4569 crate::Error,
4570 > {
4571 use google_cloud_gax::paginator::Paginator;
4572 self.by_page().items()
4573 }
4574
4575 pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4579 self.0.request.conversion_workspace = v.into();
4580 self
4581 }
4582
4583 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4585 self.0.request.page_size = v.into();
4586 self
4587 }
4588
4589 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4591 self.0.request.page_token = v.into();
4592 self
4593 }
4594
4595 pub fn set_tree<T: Into<crate::model::describe_database_entities_request::DBTreeType>>(
4599 mut self,
4600 v: T,
4601 ) -> Self {
4602 self.0.request.tree = v.into();
4603 self
4604 }
4605
4606 pub fn set_uncommitted<T: Into<bool>>(mut self, v: T) -> Self {
4608 self.0.request.uncommitted = v.into();
4609 self
4610 }
4611
4612 pub fn set_commit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4614 self.0.request.commit_id = v.into();
4615 self
4616 }
4617
4618 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4620 self.0.request.filter = v.into();
4621 self
4622 }
4623
4624 pub fn set_view<T: Into<crate::model::DatabaseEntityView>>(mut self, v: T) -> Self {
4626 self.0.request.view = v.into();
4627 self
4628 }
4629 }
4630
4631 #[doc(hidden)]
4632 impl crate::RequestBuilder for DescribeDatabaseEntities {
4633 fn request_options(&mut self) -> &mut crate::RequestOptions {
4634 &mut self.0.options
4635 }
4636 }
4637
4638 #[derive(Clone, Debug)]
4655 pub struct SearchBackgroundJobs(RequestBuilder<crate::model::SearchBackgroundJobsRequest>);
4656
4657 impl SearchBackgroundJobs {
4658 pub(crate) fn new(
4659 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4660 ) -> Self {
4661 Self(RequestBuilder::new(stub))
4662 }
4663
4664 pub fn with_request<V: Into<crate::model::SearchBackgroundJobsRequest>>(
4666 mut self,
4667 v: V,
4668 ) -> Self {
4669 self.0.request = v.into();
4670 self
4671 }
4672
4673 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4675 self.0.options = v.into();
4676 self
4677 }
4678
4679 pub async fn send(self) -> Result<crate::model::SearchBackgroundJobsResponse> {
4681 (*self.0.stub)
4682 .search_background_jobs(self.0.request, self.0.options)
4683 .await
4684 .map(crate::Response::into_body)
4685 }
4686
4687 pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4691 self.0.request.conversion_workspace = v.into();
4692 self
4693 }
4694
4695 pub fn set_return_most_recent_per_job_type<T: Into<bool>>(mut self, v: T) -> Self {
4697 self.0.request.return_most_recent_per_job_type = v.into();
4698 self
4699 }
4700
4701 pub fn set_max_size<T: Into<i32>>(mut self, v: T) -> Self {
4703 self.0.request.max_size = v.into();
4704 self
4705 }
4706
4707 pub fn set_completed_until_time<T>(mut self, v: T) -> Self
4709 where
4710 T: std::convert::Into<wkt::Timestamp>,
4711 {
4712 self.0.request.completed_until_time = std::option::Option::Some(v.into());
4713 self
4714 }
4715
4716 pub fn set_or_clear_completed_until_time<T>(mut self, v: std::option::Option<T>) -> Self
4718 where
4719 T: std::convert::Into<wkt::Timestamp>,
4720 {
4721 self.0.request.completed_until_time = v.map(|x| x.into());
4722 self
4723 }
4724 }
4725
4726 #[doc(hidden)]
4727 impl crate::RequestBuilder for SearchBackgroundJobs {
4728 fn request_options(&mut self) -> &mut crate::RequestOptions {
4729 &mut self.0.options
4730 }
4731 }
4732
4733 #[derive(Clone, Debug)]
4750 pub struct DescribeConversionWorkspaceRevisions(
4751 RequestBuilder<crate::model::DescribeConversionWorkspaceRevisionsRequest>,
4752 );
4753
4754 impl DescribeConversionWorkspaceRevisions {
4755 pub(crate) fn new(
4756 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4757 ) -> Self {
4758 Self(RequestBuilder::new(stub))
4759 }
4760
4761 pub fn with_request<V: Into<crate::model::DescribeConversionWorkspaceRevisionsRequest>>(
4763 mut self,
4764 v: V,
4765 ) -> Self {
4766 self.0.request = v.into();
4767 self
4768 }
4769
4770 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4772 self.0.options = v.into();
4773 self
4774 }
4775
4776 pub async fn send(
4778 self,
4779 ) -> Result<crate::model::DescribeConversionWorkspaceRevisionsResponse> {
4780 (*self.0.stub)
4781 .describe_conversion_workspace_revisions(self.0.request, self.0.options)
4782 .await
4783 .map(crate::Response::into_body)
4784 }
4785
4786 pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4790 self.0.request.conversion_workspace = v.into();
4791 self
4792 }
4793
4794 pub fn set_commit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4796 self.0.request.commit_id = v.into();
4797 self
4798 }
4799 }
4800
4801 #[doc(hidden)]
4802 impl crate::RequestBuilder for DescribeConversionWorkspaceRevisions {
4803 fn request_options(&mut self) -> &mut crate::RequestOptions {
4804 &mut self.0.options
4805 }
4806 }
4807
4808 #[derive(Clone, Debug)]
4825 pub struct FetchStaticIps(RequestBuilder<crate::model::FetchStaticIpsRequest>);
4826
4827 impl FetchStaticIps {
4828 pub(crate) fn new(
4829 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4830 ) -> Self {
4831 Self(RequestBuilder::new(stub))
4832 }
4833
4834 pub fn with_request<V: Into<crate::model::FetchStaticIpsRequest>>(mut self, v: V) -> Self {
4836 self.0.request = v.into();
4837 self
4838 }
4839
4840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4842 self.0.options = v.into();
4843 self
4844 }
4845
4846 pub async fn send(self) -> Result<crate::model::FetchStaticIpsResponse> {
4848 (*self.0.stub)
4849 .fetch_static_ips(self.0.request, self.0.options)
4850 .await
4851 .map(crate::Response::into_body)
4852 }
4853
4854 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4858 self.0.request.name = v.into();
4859 self
4860 }
4861
4862 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4864 self.0.request.page_size = v.into();
4865 self
4866 }
4867
4868 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4870 self.0.request.page_token = v.into();
4871 self
4872 }
4873 }
4874
4875 #[doc(hidden)]
4876 impl crate::RequestBuilder for FetchStaticIps {
4877 fn request_options(&mut self) -> &mut crate::RequestOptions {
4878 &mut self.0.options
4879 }
4880 }
4881
4882 #[derive(Clone, Debug)]
4903 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4904
4905 impl ListLocations {
4906 pub(crate) fn new(
4907 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4908 ) -> Self {
4909 Self(RequestBuilder::new(stub))
4910 }
4911
4912 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4914 mut self,
4915 v: V,
4916 ) -> Self {
4917 self.0.request = v.into();
4918 self
4919 }
4920
4921 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4923 self.0.options = v.into();
4924 self
4925 }
4926
4927 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4929 (*self.0.stub)
4930 .list_locations(self.0.request, self.0.options)
4931 .await
4932 .map(crate::Response::into_body)
4933 }
4934
4935 pub fn by_page(
4937 self,
4938 ) -> impl google_cloud_gax::paginator::Paginator<
4939 google_cloud_location::model::ListLocationsResponse,
4940 crate::Error,
4941 > {
4942 use std::clone::Clone;
4943 let token = self.0.request.page_token.clone();
4944 let execute = move |token: String| {
4945 let mut builder = self.clone();
4946 builder.0.request = builder.0.request.set_page_token(token);
4947 builder.send()
4948 };
4949 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4950 }
4951
4952 pub fn by_item(
4954 self,
4955 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4956 google_cloud_location::model::ListLocationsResponse,
4957 crate::Error,
4958 > {
4959 use google_cloud_gax::paginator::Paginator;
4960 self.by_page().items()
4961 }
4962
4963 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4965 self.0.request.name = v.into();
4966 self
4967 }
4968
4969 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4971 self.0.request.filter = v.into();
4972 self
4973 }
4974
4975 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4977 self.0.request.page_size = v.into();
4978 self
4979 }
4980
4981 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4983 self.0.request.page_token = v.into();
4984 self
4985 }
4986 }
4987
4988 #[doc(hidden)]
4989 impl crate::RequestBuilder for ListLocations {
4990 fn request_options(&mut self) -> &mut crate::RequestOptions {
4991 &mut self.0.options
4992 }
4993 }
4994
4995 #[derive(Clone, Debug)]
5012 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5013
5014 impl GetLocation {
5015 pub(crate) fn new(
5016 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5017 ) -> Self {
5018 Self(RequestBuilder::new(stub))
5019 }
5020
5021 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5023 mut self,
5024 v: V,
5025 ) -> Self {
5026 self.0.request = v.into();
5027 self
5028 }
5029
5030 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5032 self.0.options = v.into();
5033 self
5034 }
5035
5036 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5038 (*self.0.stub)
5039 .get_location(self.0.request, self.0.options)
5040 .await
5041 .map(crate::Response::into_body)
5042 }
5043
5044 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5046 self.0.request.name = v.into();
5047 self
5048 }
5049 }
5050
5051 #[doc(hidden)]
5052 impl crate::RequestBuilder for GetLocation {
5053 fn request_options(&mut self) -> &mut crate::RequestOptions {
5054 &mut self.0.options
5055 }
5056 }
5057
5058 #[derive(Clone, Debug)]
5075 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
5076
5077 impl SetIamPolicy {
5078 pub(crate) fn new(
5079 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5080 ) -> Self {
5081 Self(RequestBuilder::new(stub))
5082 }
5083
5084 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
5086 mut self,
5087 v: V,
5088 ) -> Self {
5089 self.0.request = v.into();
5090 self
5091 }
5092
5093 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5095 self.0.options = v.into();
5096 self
5097 }
5098
5099 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5101 (*self.0.stub)
5102 .set_iam_policy(self.0.request, self.0.options)
5103 .await
5104 .map(crate::Response::into_body)
5105 }
5106
5107 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5111 self.0.request.resource = v.into();
5112 self
5113 }
5114
5115 pub fn set_policy<T>(mut self, v: T) -> Self
5119 where
5120 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5121 {
5122 self.0.request.policy = std::option::Option::Some(v.into());
5123 self
5124 }
5125
5126 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5130 where
5131 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5132 {
5133 self.0.request.policy = v.map(|x| x.into());
5134 self
5135 }
5136
5137 pub fn set_update_mask<T>(mut self, v: T) -> Self
5139 where
5140 T: std::convert::Into<wkt::FieldMask>,
5141 {
5142 self.0.request.update_mask = std::option::Option::Some(v.into());
5143 self
5144 }
5145
5146 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5148 where
5149 T: std::convert::Into<wkt::FieldMask>,
5150 {
5151 self.0.request.update_mask = v.map(|x| x.into());
5152 self
5153 }
5154 }
5155
5156 #[doc(hidden)]
5157 impl crate::RequestBuilder for SetIamPolicy {
5158 fn request_options(&mut self) -> &mut crate::RequestOptions {
5159 &mut self.0.options
5160 }
5161 }
5162
5163 #[derive(Clone, Debug)]
5180 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
5181
5182 impl GetIamPolicy {
5183 pub(crate) fn new(
5184 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5185 ) -> Self {
5186 Self(RequestBuilder::new(stub))
5187 }
5188
5189 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
5191 mut self,
5192 v: V,
5193 ) -> Self {
5194 self.0.request = v.into();
5195 self
5196 }
5197
5198 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5200 self.0.options = v.into();
5201 self
5202 }
5203
5204 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5206 (*self.0.stub)
5207 .get_iam_policy(self.0.request, self.0.options)
5208 .await
5209 .map(crate::Response::into_body)
5210 }
5211
5212 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5216 self.0.request.resource = v.into();
5217 self
5218 }
5219
5220 pub fn set_options<T>(mut self, v: T) -> Self
5222 where
5223 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5224 {
5225 self.0.request.options = std::option::Option::Some(v.into());
5226 self
5227 }
5228
5229 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5231 where
5232 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5233 {
5234 self.0.request.options = v.map(|x| x.into());
5235 self
5236 }
5237 }
5238
5239 #[doc(hidden)]
5240 impl crate::RequestBuilder for GetIamPolicy {
5241 fn request_options(&mut self) -> &mut crate::RequestOptions {
5242 &mut self.0.options
5243 }
5244 }
5245
5246 #[derive(Clone, Debug)]
5263 pub struct TestIamPermissions(
5264 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5265 );
5266
5267 impl TestIamPermissions {
5268 pub(crate) fn new(
5269 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5270 ) -> Self {
5271 Self(RequestBuilder::new(stub))
5272 }
5273
5274 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5276 mut self,
5277 v: V,
5278 ) -> Self {
5279 self.0.request = v.into();
5280 self
5281 }
5282
5283 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5285 self.0.options = v.into();
5286 self
5287 }
5288
5289 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
5291 (*self.0.stub)
5292 .test_iam_permissions(self.0.request, self.0.options)
5293 .await
5294 .map(crate::Response::into_body)
5295 }
5296
5297 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5301 self.0.request.resource = v.into();
5302 self
5303 }
5304
5305 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5309 where
5310 T: std::iter::IntoIterator<Item = V>,
5311 V: std::convert::Into<std::string::String>,
5312 {
5313 use std::iter::Iterator;
5314 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5315 self
5316 }
5317 }
5318
5319 #[doc(hidden)]
5320 impl crate::RequestBuilder for TestIamPermissions {
5321 fn request_options(&mut self) -> &mut crate::RequestOptions {
5322 &mut self.0.options
5323 }
5324 }
5325
5326 #[derive(Clone, Debug)]
5347 pub struct ListOperations(
5348 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5349 );
5350
5351 impl ListOperations {
5352 pub(crate) fn new(
5353 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5354 ) -> Self {
5355 Self(RequestBuilder::new(stub))
5356 }
5357
5358 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5360 mut self,
5361 v: V,
5362 ) -> Self {
5363 self.0.request = v.into();
5364 self
5365 }
5366
5367 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5369 self.0.options = v.into();
5370 self
5371 }
5372
5373 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5375 (*self.0.stub)
5376 .list_operations(self.0.request, self.0.options)
5377 .await
5378 .map(crate::Response::into_body)
5379 }
5380
5381 pub fn by_page(
5383 self,
5384 ) -> impl google_cloud_gax::paginator::Paginator<
5385 google_cloud_longrunning::model::ListOperationsResponse,
5386 crate::Error,
5387 > {
5388 use std::clone::Clone;
5389 let token = self.0.request.page_token.clone();
5390 let execute = move |token: String| {
5391 let mut builder = self.clone();
5392 builder.0.request = builder.0.request.set_page_token(token);
5393 builder.send()
5394 };
5395 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5396 }
5397
5398 pub fn by_item(
5400 self,
5401 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5402 google_cloud_longrunning::model::ListOperationsResponse,
5403 crate::Error,
5404 > {
5405 use google_cloud_gax::paginator::Paginator;
5406 self.by_page().items()
5407 }
5408
5409 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5411 self.0.request.name = v.into();
5412 self
5413 }
5414
5415 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5417 self.0.request.filter = v.into();
5418 self
5419 }
5420
5421 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5423 self.0.request.page_size = v.into();
5424 self
5425 }
5426
5427 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5429 self.0.request.page_token = v.into();
5430 self
5431 }
5432
5433 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5435 self.0.request.return_partial_success = v.into();
5436 self
5437 }
5438 }
5439
5440 #[doc(hidden)]
5441 impl crate::RequestBuilder for ListOperations {
5442 fn request_options(&mut self) -> &mut crate::RequestOptions {
5443 &mut self.0.options
5444 }
5445 }
5446
5447 #[derive(Clone, Debug)]
5464 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5465
5466 impl GetOperation {
5467 pub(crate) fn new(
5468 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5469 ) -> Self {
5470 Self(RequestBuilder::new(stub))
5471 }
5472
5473 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5475 mut self,
5476 v: V,
5477 ) -> Self {
5478 self.0.request = v.into();
5479 self
5480 }
5481
5482 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5484 self.0.options = v.into();
5485 self
5486 }
5487
5488 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5490 (*self.0.stub)
5491 .get_operation(self.0.request, self.0.options)
5492 .await
5493 .map(crate::Response::into_body)
5494 }
5495
5496 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5498 self.0.request.name = v.into();
5499 self
5500 }
5501 }
5502
5503 #[doc(hidden)]
5504 impl crate::RequestBuilder for GetOperation {
5505 fn request_options(&mut self) -> &mut crate::RequestOptions {
5506 &mut self.0.options
5507 }
5508 }
5509
5510 #[derive(Clone, Debug)]
5527 pub struct DeleteOperation(
5528 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5529 );
5530
5531 impl DeleteOperation {
5532 pub(crate) fn new(
5533 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5534 ) -> Self {
5535 Self(RequestBuilder::new(stub))
5536 }
5537
5538 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5540 mut self,
5541 v: V,
5542 ) -> Self {
5543 self.0.request = v.into();
5544 self
5545 }
5546
5547 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5549 self.0.options = v.into();
5550 self
5551 }
5552
5553 pub async fn send(self) -> Result<()> {
5555 (*self.0.stub)
5556 .delete_operation(self.0.request, self.0.options)
5557 .await
5558 .map(crate::Response::into_body)
5559 }
5560
5561 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5563 self.0.request.name = v.into();
5564 self
5565 }
5566 }
5567
5568 #[doc(hidden)]
5569 impl crate::RequestBuilder for DeleteOperation {
5570 fn request_options(&mut self) -> &mut crate::RequestOptions {
5571 &mut self.0.options
5572 }
5573 }
5574
5575 #[derive(Clone, Debug)]
5592 pub struct CancelOperation(
5593 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5594 );
5595
5596 impl CancelOperation {
5597 pub(crate) fn new(
5598 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5599 ) -> Self {
5600 Self(RequestBuilder::new(stub))
5601 }
5602
5603 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5605 mut self,
5606 v: V,
5607 ) -> Self {
5608 self.0.request = v.into();
5609 self
5610 }
5611
5612 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5614 self.0.options = v.into();
5615 self
5616 }
5617
5618 pub async fn send(self) -> Result<()> {
5620 (*self.0.stub)
5621 .cancel_operation(self.0.request, self.0.options)
5622 .await
5623 .map(crate::Response::into_body)
5624 }
5625
5626 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5628 self.0.request.name = v.into();
5629 self
5630 }
5631 }
5632
5633 #[doc(hidden)]
5634 impl crate::RequestBuilder for CancelOperation {
5635 fn request_options(&mut self) -> &mut crate::RequestOptions {
5636 &mut self.0.options
5637 }
5638 }
5639}