1pub mod data_migration_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::DataMigrationService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = DataMigrationService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListMigrationJobs(RequestBuilder<crate::model::ListMigrationJobsRequest>);
97
98 impl ListMigrationJobs {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListMigrationJobsRequest>>(
107 mut self,
108 v: V,
109 ) -> Self {
110 self.0.request = v.into();
111 self
112 }
113
114 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116 self.0.options = v.into();
117 self
118 }
119
120 pub async fn send(self) -> Result<crate::model::ListMigrationJobsResponse> {
122 (*self.0.stub)
123 .list_migration_jobs(self.0.request, self.0.options)
124 .await
125 .map(gax::response::Response::into_body)
126 }
127
128 pub fn by_page(
130 self,
131 ) -> impl gax::paginator::Paginator<crate::model::ListMigrationJobsResponse, gax::error::Error>
132 {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl gax::paginator::ItemPaginator<crate::model::ListMigrationJobsResponse, gax::error::Error>
147 {
148 use gax::paginator::Paginator;
149 self.by_page().items()
150 }
151
152 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
156 self.0.request.parent = v.into();
157 self
158 }
159
160 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
162 self.0.request.page_size = v.into();
163 self
164 }
165
166 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
168 self.0.request.page_token = v.into();
169 self
170 }
171
172 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
174 self.0.request.filter = v.into();
175 self
176 }
177
178 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
180 self.0.request.order_by = v.into();
181 self
182 }
183 }
184
185 #[doc(hidden)]
186 impl gax::options::internal::RequestBuilder for ListMigrationJobs {
187 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
188 &mut self.0.options
189 }
190 }
191
192 #[derive(Clone, Debug)]
210 pub struct GetMigrationJob(RequestBuilder<crate::model::GetMigrationJobRequest>);
211
212 impl GetMigrationJob {
213 pub(crate) fn new(
214 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
215 ) -> Self {
216 Self(RequestBuilder::new(stub))
217 }
218
219 pub fn with_request<V: Into<crate::model::GetMigrationJobRequest>>(mut self, v: V) -> Self {
221 self.0.request = v.into();
222 self
223 }
224
225 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
227 self.0.options = v.into();
228 self
229 }
230
231 pub async fn send(self) -> Result<crate::model::MigrationJob> {
233 (*self.0.stub)
234 .get_migration_job(self.0.request, self.0.options)
235 .await
236 .map(gax::response::Response::into_body)
237 }
238
239 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
243 self.0.request.name = v.into();
244 self
245 }
246 }
247
248 #[doc(hidden)]
249 impl gax::options::internal::RequestBuilder for GetMigrationJob {
250 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
251 &mut self.0.options
252 }
253 }
254
255 #[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<gax::options::RequestOptions>>(mut self, v: V) -> Self {
294 self.0.options = v.into();
295 self
296 }
297
298 pub async fn send(self) -> Result<longrunning::model::Operation> {
305 (*self.0.stub)
306 .create_migration_job(self.0.request, self.0.options)
307 .await
308 .map(gax::response::Response::into_body)
309 }
310
311 pub fn poller(
313 self,
314 ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
315 type Operation = lro::internal::Operation<
316 crate::model::MigrationJob,
317 crate::model::OperationMetadata,
318 >;
319 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
320 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
321
322 let stub = self.0.stub.clone();
323 let mut options = self.0.options.clone();
324 options.set_retry_policy(gax::retry_policy::NeverRetry);
325 let query = move |name| {
326 let stub = stub.clone();
327 let options = options.clone();
328 async {
329 let op = GetOperation::new(stub)
330 .set_name(name)
331 .with_options(options)
332 .send()
333 .await?;
334 Ok(Operation::new(op))
335 }
336 };
337
338 let start = move || async {
339 let op = self.send().await?;
340 Ok(Operation::new(op))
341 };
342
343 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
344 }
345
346 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
350 self.0.request.parent = v.into();
351 self
352 }
353
354 pub fn set_migration_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
358 self.0.request.migration_job_id = v.into();
359 self
360 }
361
362 pub fn set_migration_job<T>(mut self, v: T) -> Self
366 where
367 T: std::convert::Into<crate::model::MigrationJob>,
368 {
369 self.0.request.migration_job = std::option::Option::Some(v.into());
370 self
371 }
372
373 pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
377 where
378 T: std::convert::Into<crate::model::MigrationJob>,
379 {
380 self.0.request.migration_job = v.map(|x| x.into());
381 self
382 }
383
384 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
386 self.0.request.request_id = v.into();
387 self
388 }
389 }
390
391 #[doc(hidden)]
392 impl gax::options::internal::RequestBuilder for CreateMigrationJob {
393 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
394 &mut self.0.options
395 }
396 }
397
398 #[derive(Clone, Debug)]
417 pub struct UpdateMigrationJob(RequestBuilder<crate::model::UpdateMigrationJobRequest>);
418
419 impl UpdateMigrationJob {
420 pub(crate) fn new(
421 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
422 ) -> Self {
423 Self(RequestBuilder::new(stub))
424 }
425
426 pub fn with_request<V: Into<crate::model::UpdateMigrationJobRequest>>(
428 mut self,
429 v: V,
430 ) -> Self {
431 self.0.request = v.into();
432 self
433 }
434
435 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
437 self.0.options = v.into();
438 self
439 }
440
441 pub async fn send(self) -> Result<longrunning::model::Operation> {
448 (*self.0.stub)
449 .update_migration_job(self.0.request, self.0.options)
450 .await
451 .map(gax::response::Response::into_body)
452 }
453
454 pub fn poller(
456 self,
457 ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
458 type Operation = lro::internal::Operation<
459 crate::model::MigrationJob,
460 crate::model::OperationMetadata,
461 >;
462 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
463 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
464
465 let stub = self.0.stub.clone();
466 let mut options = self.0.options.clone();
467 options.set_retry_policy(gax::retry_policy::NeverRetry);
468 let query = move |name| {
469 let stub = stub.clone();
470 let options = options.clone();
471 async {
472 let op = GetOperation::new(stub)
473 .set_name(name)
474 .with_options(options)
475 .send()
476 .await?;
477 Ok(Operation::new(op))
478 }
479 };
480
481 let start = move || async {
482 let op = self.send().await?;
483 Ok(Operation::new(op))
484 };
485
486 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
487 }
488
489 pub fn set_update_mask<T>(mut self, v: T) -> Self
493 where
494 T: std::convert::Into<wkt::FieldMask>,
495 {
496 self.0.request.update_mask = std::option::Option::Some(v.into());
497 self
498 }
499
500 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
504 where
505 T: std::convert::Into<wkt::FieldMask>,
506 {
507 self.0.request.update_mask = v.map(|x| x.into());
508 self
509 }
510
511 pub fn set_migration_job<T>(mut self, v: T) -> Self
515 where
516 T: std::convert::Into<crate::model::MigrationJob>,
517 {
518 self.0.request.migration_job = std::option::Option::Some(v.into());
519 self
520 }
521
522 pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
526 where
527 T: std::convert::Into<crate::model::MigrationJob>,
528 {
529 self.0.request.migration_job = v.map(|x| x.into());
530 self
531 }
532
533 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
535 self.0.request.request_id = v.into();
536 self
537 }
538 }
539
540 #[doc(hidden)]
541 impl gax::options::internal::RequestBuilder for UpdateMigrationJob {
542 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
543 &mut self.0.options
544 }
545 }
546
547 #[derive(Clone, Debug)]
566 pub struct DeleteMigrationJob(RequestBuilder<crate::model::DeleteMigrationJobRequest>);
567
568 impl DeleteMigrationJob {
569 pub(crate) fn new(
570 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
571 ) -> Self {
572 Self(RequestBuilder::new(stub))
573 }
574
575 pub fn with_request<V: Into<crate::model::DeleteMigrationJobRequest>>(
577 mut self,
578 v: V,
579 ) -> Self {
580 self.0.request = v.into();
581 self
582 }
583
584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
586 self.0.options = v.into();
587 self
588 }
589
590 pub async fn send(self) -> Result<longrunning::model::Operation> {
597 (*self.0.stub)
598 .delete_migration_job(self.0.request, self.0.options)
599 .await
600 .map(gax::response::Response::into_body)
601 }
602
603 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
605 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
606 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
607 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
608
609 let stub = self.0.stub.clone();
610 let mut options = self.0.options.clone();
611 options.set_retry_policy(gax::retry_policy::NeverRetry);
612 let query = move |name| {
613 let stub = stub.clone();
614 let options = options.clone();
615 async {
616 let op = GetOperation::new(stub)
617 .set_name(name)
618 .with_options(options)
619 .send()
620 .await?;
621 Ok(Operation::new(op))
622 }
623 };
624
625 let start = move || async {
626 let op = self.send().await?;
627 Ok(Operation::new(op))
628 };
629
630 lro::internal::new_unit_response_poller(
631 polling_error_policy,
632 polling_backoff_policy,
633 start,
634 query,
635 )
636 }
637
638 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
642 self.0.request.name = v.into();
643 self
644 }
645
646 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
648 self.0.request.request_id = v.into();
649 self
650 }
651
652 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
654 self.0.request.force = v.into();
655 self
656 }
657 }
658
659 #[doc(hidden)]
660 impl gax::options::internal::RequestBuilder for DeleteMigrationJob {
661 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
662 &mut self.0.options
663 }
664 }
665
666 #[derive(Clone, Debug)]
685 pub struct StartMigrationJob(RequestBuilder<crate::model::StartMigrationJobRequest>);
686
687 impl StartMigrationJob {
688 pub(crate) fn new(
689 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
690 ) -> Self {
691 Self(RequestBuilder::new(stub))
692 }
693
694 pub fn with_request<V: Into<crate::model::StartMigrationJobRequest>>(
696 mut self,
697 v: V,
698 ) -> Self {
699 self.0.request = v.into();
700 self
701 }
702
703 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
705 self.0.options = v.into();
706 self
707 }
708
709 pub async fn send(self) -> Result<longrunning::model::Operation> {
716 (*self.0.stub)
717 .start_migration_job(self.0.request, self.0.options)
718 .await
719 .map(gax::response::Response::into_body)
720 }
721
722 pub fn poller(
724 self,
725 ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
726 type Operation = lro::internal::Operation<
727 crate::model::MigrationJob,
728 crate::model::OperationMetadata,
729 >;
730 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
731 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
732
733 let stub = self.0.stub.clone();
734 let mut options = self.0.options.clone();
735 options.set_retry_policy(gax::retry_policy::NeverRetry);
736 let query = move |name| {
737 let stub = stub.clone();
738 let options = options.clone();
739 async {
740 let op = GetOperation::new(stub)
741 .set_name(name)
742 .with_options(options)
743 .send()
744 .await?;
745 Ok(Operation::new(op))
746 }
747 };
748
749 let start = move || async {
750 let op = self.send().await?;
751 Ok(Operation::new(op))
752 };
753
754 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
755 }
756
757 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
759 self.0.request.name = v.into();
760 self
761 }
762
763 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
765 self.0.request.skip_validation = v.into();
766 self
767 }
768 }
769
770 #[doc(hidden)]
771 impl gax::options::internal::RequestBuilder for StartMigrationJob {
772 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
773 &mut self.0.options
774 }
775 }
776
777 #[derive(Clone, Debug)]
796 pub struct StopMigrationJob(RequestBuilder<crate::model::StopMigrationJobRequest>);
797
798 impl StopMigrationJob {
799 pub(crate) fn new(
800 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
801 ) -> Self {
802 Self(RequestBuilder::new(stub))
803 }
804
805 pub fn with_request<V: Into<crate::model::StopMigrationJobRequest>>(
807 mut self,
808 v: V,
809 ) -> Self {
810 self.0.request = v.into();
811 self
812 }
813
814 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
816 self.0.options = v.into();
817 self
818 }
819
820 pub async fn send(self) -> Result<longrunning::model::Operation> {
827 (*self.0.stub)
828 .stop_migration_job(self.0.request, self.0.options)
829 .await
830 .map(gax::response::Response::into_body)
831 }
832
833 pub fn poller(
835 self,
836 ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
837 type Operation = lro::internal::Operation<
838 crate::model::MigrationJob,
839 crate::model::OperationMetadata,
840 >;
841 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
842 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
843
844 let stub = self.0.stub.clone();
845 let mut options = self.0.options.clone();
846 options.set_retry_policy(gax::retry_policy::NeverRetry);
847 let query = move |name| {
848 let stub = stub.clone();
849 let options = options.clone();
850 async {
851 let op = GetOperation::new(stub)
852 .set_name(name)
853 .with_options(options)
854 .send()
855 .await?;
856 Ok(Operation::new(op))
857 }
858 };
859
860 let start = move || async {
861 let op = self.send().await?;
862 Ok(Operation::new(op))
863 };
864
865 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
866 }
867
868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
870 self.0.request.name = v.into();
871 self
872 }
873 }
874
875 #[doc(hidden)]
876 impl gax::options::internal::RequestBuilder for StopMigrationJob {
877 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
878 &mut self.0.options
879 }
880 }
881
882 #[derive(Clone, Debug)]
901 pub struct ResumeMigrationJob(RequestBuilder<crate::model::ResumeMigrationJobRequest>);
902
903 impl ResumeMigrationJob {
904 pub(crate) fn new(
905 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
906 ) -> Self {
907 Self(RequestBuilder::new(stub))
908 }
909
910 pub fn with_request<V: Into<crate::model::ResumeMigrationJobRequest>>(
912 mut self,
913 v: V,
914 ) -> Self {
915 self.0.request = v.into();
916 self
917 }
918
919 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
921 self.0.options = v.into();
922 self
923 }
924
925 pub async fn send(self) -> Result<longrunning::model::Operation> {
932 (*self.0.stub)
933 .resume_migration_job(self.0.request, self.0.options)
934 .await
935 .map(gax::response::Response::into_body)
936 }
937
938 pub fn poller(
940 self,
941 ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
942 type Operation = lro::internal::Operation<
943 crate::model::MigrationJob,
944 crate::model::OperationMetadata,
945 >;
946 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
947 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
948
949 let stub = self.0.stub.clone();
950 let mut options = self.0.options.clone();
951 options.set_retry_policy(gax::retry_policy::NeverRetry);
952 let query = move |name| {
953 let stub = stub.clone();
954 let options = options.clone();
955 async {
956 let op = GetOperation::new(stub)
957 .set_name(name)
958 .with_options(options)
959 .send()
960 .await?;
961 Ok(Operation::new(op))
962 }
963 };
964
965 let start = move || async {
966 let op = self.send().await?;
967 Ok(Operation::new(op))
968 };
969
970 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
971 }
972
973 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
975 self.0.request.name = v.into();
976 self
977 }
978 }
979
980 #[doc(hidden)]
981 impl gax::options::internal::RequestBuilder for ResumeMigrationJob {
982 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
983 &mut self.0.options
984 }
985 }
986
987 #[derive(Clone, Debug)]
1006 pub struct PromoteMigrationJob(RequestBuilder<crate::model::PromoteMigrationJobRequest>);
1007
1008 impl PromoteMigrationJob {
1009 pub(crate) fn new(
1010 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1011 ) -> Self {
1012 Self(RequestBuilder::new(stub))
1013 }
1014
1015 pub fn with_request<V: Into<crate::model::PromoteMigrationJobRequest>>(
1017 mut self,
1018 v: V,
1019 ) -> Self {
1020 self.0.request = v.into();
1021 self
1022 }
1023
1024 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1026 self.0.options = v.into();
1027 self
1028 }
1029
1030 pub async fn send(self) -> Result<longrunning::model::Operation> {
1037 (*self.0.stub)
1038 .promote_migration_job(self.0.request, self.0.options)
1039 .await
1040 .map(gax::response::Response::into_body)
1041 }
1042
1043 pub fn poller(
1045 self,
1046 ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
1047 type Operation = lro::internal::Operation<
1048 crate::model::MigrationJob,
1049 crate::model::OperationMetadata,
1050 >;
1051 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1052 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1053
1054 let stub = self.0.stub.clone();
1055 let mut options = self.0.options.clone();
1056 options.set_retry_policy(gax::retry_policy::NeverRetry);
1057 let query = move |name| {
1058 let stub = stub.clone();
1059 let options = options.clone();
1060 async {
1061 let op = GetOperation::new(stub)
1062 .set_name(name)
1063 .with_options(options)
1064 .send()
1065 .await?;
1066 Ok(Operation::new(op))
1067 }
1068 };
1069
1070 let start = move || async {
1071 let op = self.send().await?;
1072 Ok(Operation::new(op))
1073 };
1074
1075 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1076 }
1077
1078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1080 self.0.request.name = v.into();
1081 self
1082 }
1083 }
1084
1085 #[doc(hidden)]
1086 impl gax::options::internal::RequestBuilder for PromoteMigrationJob {
1087 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1088 &mut self.0.options
1089 }
1090 }
1091
1092 #[derive(Clone, Debug)]
1111 pub struct VerifyMigrationJob(RequestBuilder<crate::model::VerifyMigrationJobRequest>);
1112
1113 impl VerifyMigrationJob {
1114 pub(crate) fn new(
1115 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1116 ) -> Self {
1117 Self(RequestBuilder::new(stub))
1118 }
1119
1120 pub fn with_request<V: Into<crate::model::VerifyMigrationJobRequest>>(
1122 mut self,
1123 v: V,
1124 ) -> Self {
1125 self.0.request = v.into();
1126 self
1127 }
1128
1129 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1131 self.0.options = v.into();
1132 self
1133 }
1134
1135 pub async fn send(self) -> Result<longrunning::model::Operation> {
1142 (*self.0.stub)
1143 .verify_migration_job(self.0.request, self.0.options)
1144 .await
1145 .map(gax::response::Response::into_body)
1146 }
1147
1148 pub fn poller(
1150 self,
1151 ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
1152 type Operation = lro::internal::Operation<
1153 crate::model::MigrationJob,
1154 crate::model::OperationMetadata,
1155 >;
1156 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1157 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1158
1159 let stub = self.0.stub.clone();
1160 let mut options = self.0.options.clone();
1161 options.set_retry_policy(gax::retry_policy::NeverRetry);
1162 let query = move |name| {
1163 let stub = stub.clone();
1164 let options = options.clone();
1165 async {
1166 let op = GetOperation::new(stub)
1167 .set_name(name)
1168 .with_options(options)
1169 .send()
1170 .await?;
1171 Ok(Operation::new(op))
1172 }
1173 };
1174
1175 let start = move || async {
1176 let op = self.send().await?;
1177 Ok(Operation::new(op))
1178 };
1179
1180 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1181 }
1182
1183 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185 self.0.request.name = v.into();
1186 self
1187 }
1188
1189 pub fn set_update_mask<T>(mut self, v: T) -> Self
1191 where
1192 T: std::convert::Into<wkt::FieldMask>,
1193 {
1194 self.0.request.update_mask = std::option::Option::Some(v.into());
1195 self
1196 }
1197
1198 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1200 where
1201 T: std::convert::Into<wkt::FieldMask>,
1202 {
1203 self.0.request.update_mask = v.map(|x| x.into());
1204 self
1205 }
1206
1207 pub fn set_migration_job<T>(mut self, v: T) -> Self
1209 where
1210 T: std::convert::Into<crate::model::MigrationJob>,
1211 {
1212 self.0.request.migration_job = std::option::Option::Some(v.into());
1213 self
1214 }
1215
1216 pub fn set_or_clear_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
1218 where
1219 T: std::convert::Into<crate::model::MigrationJob>,
1220 {
1221 self.0.request.migration_job = v.map(|x| x.into());
1222 self
1223 }
1224 }
1225
1226 #[doc(hidden)]
1227 impl gax::options::internal::RequestBuilder for VerifyMigrationJob {
1228 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1229 &mut self.0.options
1230 }
1231 }
1232
1233 #[derive(Clone, Debug)]
1252 pub struct RestartMigrationJob(RequestBuilder<crate::model::RestartMigrationJobRequest>);
1253
1254 impl RestartMigrationJob {
1255 pub(crate) fn new(
1256 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1257 ) -> Self {
1258 Self(RequestBuilder::new(stub))
1259 }
1260
1261 pub fn with_request<V: Into<crate::model::RestartMigrationJobRequest>>(
1263 mut self,
1264 v: V,
1265 ) -> Self {
1266 self.0.request = v.into();
1267 self
1268 }
1269
1270 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1272 self.0.options = v.into();
1273 self
1274 }
1275
1276 pub async fn send(self) -> Result<longrunning::model::Operation> {
1283 (*self.0.stub)
1284 .restart_migration_job(self.0.request, self.0.options)
1285 .await
1286 .map(gax::response::Response::into_body)
1287 }
1288
1289 pub fn poller(
1291 self,
1292 ) -> impl lro::Poller<crate::model::MigrationJob, crate::model::OperationMetadata> {
1293 type Operation = lro::internal::Operation<
1294 crate::model::MigrationJob,
1295 crate::model::OperationMetadata,
1296 >;
1297 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1298 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1299
1300 let stub = self.0.stub.clone();
1301 let mut options = self.0.options.clone();
1302 options.set_retry_policy(gax::retry_policy::NeverRetry);
1303 let query = move |name| {
1304 let stub = stub.clone();
1305 let options = options.clone();
1306 async {
1307 let op = GetOperation::new(stub)
1308 .set_name(name)
1309 .with_options(options)
1310 .send()
1311 .await?;
1312 Ok(Operation::new(op))
1313 }
1314 };
1315
1316 let start = move || async {
1317 let op = self.send().await?;
1318 Ok(Operation::new(op))
1319 };
1320
1321 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1322 }
1323
1324 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1326 self.0.request.name = v.into();
1327 self
1328 }
1329
1330 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
1332 self.0.request.skip_validation = v.into();
1333 self
1334 }
1335 }
1336
1337 #[doc(hidden)]
1338 impl gax::options::internal::RequestBuilder for RestartMigrationJob {
1339 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1340 &mut self.0.options
1341 }
1342 }
1343
1344 #[derive(Clone, Debug)]
1362 pub struct GenerateSshScript(RequestBuilder<crate::model::GenerateSshScriptRequest>);
1363
1364 impl GenerateSshScript {
1365 pub(crate) fn new(
1366 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1367 ) -> Self {
1368 Self(RequestBuilder::new(stub))
1369 }
1370
1371 pub fn with_request<V: Into<crate::model::GenerateSshScriptRequest>>(
1373 mut self,
1374 v: V,
1375 ) -> Self {
1376 self.0.request = v.into();
1377 self
1378 }
1379
1380 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1382 self.0.options = v.into();
1383 self
1384 }
1385
1386 pub async fn send(self) -> Result<crate::model::SshScript> {
1388 (*self.0.stub)
1389 .generate_ssh_script(self.0.request, self.0.options)
1390 .await
1391 .map(gax::response::Response::into_body)
1392 }
1393
1394 pub fn set_migration_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
1396 self.0.request.migration_job = v.into();
1397 self
1398 }
1399
1400 pub fn set_vm<T: Into<std::string::String>>(mut self, v: T) -> Self {
1404 self.0.request.vm = v.into();
1405 self
1406 }
1407
1408 pub fn set_vm_port<T: Into<i32>>(mut self, v: T) -> Self {
1410 self.0.request.vm_port = v.into();
1411 self
1412 }
1413
1414 pub fn set_vm_config<
1419 T: Into<Option<crate::model::generate_ssh_script_request::VmConfig>>,
1420 >(
1421 mut self,
1422 v: T,
1423 ) -> Self {
1424 self.0.request.vm_config = v.into();
1425 self
1426 }
1427
1428 pub fn set_vm_creation_config<
1434 T: std::convert::Into<std::boxed::Box<crate::model::VmCreationConfig>>,
1435 >(
1436 mut self,
1437 v: T,
1438 ) -> Self {
1439 self.0.request = self.0.request.set_vm_creation_config(v);
1440 self
1441 }
1442
1443 pub fn set_vm_selection_config<
1449 T: std::convert::Into<std::boxed::Box<crate::model::VmSelectionConfig>>,
1450 >(
1451 mut self,
1452 v: T,
1453 ) -> Self {
1454 self.0.request = self.0.request.set_vm_selection_config(v);
1455 self
1456 }
1457 }
1458
1459 #[doc(hidden)]
1460 impl gax::options::internal::RequestBuilder for GenerateSshScript {
1461 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1462 &mut self.0.options
1463 }
1464 }
1465
1466 #[derive(Clone, Debug)]
1484 pub struct GenerateTcpProxyScript(RequestBuilder<crate::model::GenerateTcpProxyScriptRequest>);
1485
1486 impl GenerateTcpProxyScript {
1487 pub(crate) fn new(
1488 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1489 ) -> Self {
1490 Self(RequestBuilder::new(stub))
1491 }
1492
1493 pub fn with_request<V: Into<crate::model::GenerateTcpProxyScriptRequest>>(
1495 mut self,
1496 v: V,
1497 ) -> Self {
1498 self.0.request = v.into();
1499 self
1500 }
1501
1502 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1504 self.0.options = v.into();
1505 self
1506 }
1507
1508 pub async fn send(self) -> Result<crate::model::TcpProxyScript> {
1510 (*self.0.stub)
1511 .generate_tcp_proxy_script(self.0.request, self.0.options)
1512 .await
1513 .map(gax::response::Response::into_body)
1514 }
1515
1516 pub fn set_migration_job<T: Into<std::string::String>>(mut self, v: T) -> Self {
1518 self.0.request.migration_job = v.into();
1519 self
1520 }
1521
1522 pub fn set_vm_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1526 self.0.request.vm_name = v.into();
1527 self
1528 }
1529
1530 pub fn set_vm_machine_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
1534 self.0.request.vm_machine_type = v.into();
1535 self
1536 }
1537
1538 pub fn set_vm_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540 self.0.request.vm_zone = v.into();
1541 self
1542 }
1543
1544 pub fn set_vm_subnet<T: Into<std::string::String>>(mut self, v: T) -> Self {
1548 self.0.request.vm_subnet = v.into();
1549 self
1550 }
1551 }
1552
1553 #[doc(hidden)]
1554 impl gax::options::internal::RequestBuilder for GenerateTcpProxyScript {
1555 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1556 &mut self.0.options
1557 }
1558 }
1559
1560 #[derive(Clone, Debug)]
1582 pub struct ListConnectionProfiles(RequestBuilder<crate::model::ListConnectionProfilesRequest>);
1583
1584 impl ListConnectionProfiles {
1585 pub(crate) fn new(
1586 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1587 ) -> Self {
1588 Self(RequestBuilder::new(stub))
1589 }
1590
1591 pub fn with_request<V: Into<crate::model::ListConnectionProfilesRequest>>(
1593 mut self,
1594 v: V,
1595 ) -> Self {
1596 self.0.request = v.into();
1597 self
1598 }
1599
1600 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1602 self.0.options = v.into();
1603 self
1604 }
1605
1606 pub async fn send(self) -> Result<crate::model::ListConnectionProfilesResponse> {
1608 (*self.0.stub)
1609 .list_connection_profiles(self.0.request, self.0.options)
1610 .await
1611 .map(gax::response::Response::into_body)
1612 }
1613
1614 pub fn by_page(
1616 self,
1617 ) -> impl gax::paginator::Paginator<
1618 crate::model::ListConnectionProfilesResponse,
1619 gax::error::Error,
1620 > {
1621 use std::clone::Clone;
1622 let token = self.0.request.page_token.clone();
1623 let execute = move |token: String| {
1624 let mut builder = self.clone();
1625 builder.0.request = builder.0.request.set_page_token(token);
1626 builder.send()
1627 };
1628 gax::paginator::internal::new_paginator(token, execute)
1629 }
1630
1631 pub fn by_item(
1633 self,
1634 ) -> impl gax::paginator::ItemPaginator<
1635 crate::model::ListConnectionProfilesResponse,
1636 gax::error::Error,
1637 > {
1638 use gax::paginator::Paginator;
1639 self.by_page().items()
1640 }
1641
1642 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1646 self.0.request.parent = v.into();
1647 self
1648 }
1649
1650 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1652 self.0.request.page_size = v.into();
1653 self
1654 }
1655
1656 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1658 self.0.request.page_token = v.into();
1659 self
1660 }
1661
1662 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1664 self.0.request.filter = v.into();
1665 self
1666 }
1667
1668 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1670 self.0.request.order_by = v.into();
1671 self
1672 }
1673 }
1674
1675 #[doc(hidden)]
1676 impl gax::options::internal::RequestBuilder for ListConnectionProfiles {
1677 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1678 &mut self.0.options
1679 }
1680 }
1681
1682 #[derive(Clone, Debug)]
1700 pub struct GetConnectionProfile(RequestBuilder<crate::model::GetConnectionProfileRequest>);
1701
1702 impl GetConnectionProfile {
1703 pub(crate) fn new(
1704 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1705 ) -> Self {
1706 Self(RequestBuilder::new(stub))
1707 }
1708
1709 pub fn with_request<V: Into<crate::model::GetConnectionProfileRequest>>(
1711 mut self,
1712 v: V,
1713 ) -> Self {
1714 self.0.request = v.into();
1715 self
1716 }
1717
1718 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1720 self.0.options = v.into();
1721 self
1722 }
1723
1724 pub async fn send(self) -> Result<crate::model::ConnectionProfile> {
1726 (*self.0.stub)
1727 .get_connection_profile(self.0.request, self.0.options)
1728 .await
1729 .map(gax::response::Response::into_body)
1730 }
1731
1732 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1736 self.0.request.name = v.into();
1737 self
1738 }
1739 }
1740
1741 #[doc(hidden)]
1742 impl gax::options::internal::RequestBuilder for GetConnectionProfile {
1743 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1744 &mut self.0.options
1745 }
1746 }
1747
1748 #[derive(Clone, Debug)]
1767 pub struct CreateConnectionProfile(
1768 RequestBuilder<crate::model::CreateConnectionProfileRequest>,
1769 );
1770
1771 impl CreateConnectionProfile {
1772 pub(crate) fn new(
1773 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1774 ) -> Self {
1775 Self(RequestBuilder::new(stub))
1776 }
1777
1778 pub fn with_request<V: Into<crate::model::CreateConnectionProfileRequest>>(
1780 mut self,
1781 v: V,
1782 ) -> Self {
1783 self.0.request = v.into();
1784 self
1785 }
1786
1787 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1789 self.0.options = v.into();
1790 self
1791 }
1792
1793 pub async fn send(self) -> Result<longrunning::model::Operation> {
1800 (*self.0.stub)
1801 .create_connection_profile(self.0.request, self.0.options)
1802 .await
1803 .map(gax::response::Response::into_body)
1804 }
1805
1806 pub fn poller(
1808 self,
1809 ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
1810 {
1811 type Operation = lro::internal::Operation<
1812 crate::model::ConnectionProfile,
1813 crate::model::OperationMetadata,
1814 >;
1815 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1816 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1817
1818 let stub = self.0.stub.clone();
1819 let mut options = self.0.options.clone();
1820 options.set_retry_policy(gax::retry_policy::NeverRetry);
1821 let query = move |name| {
1822 let stub = stub.clone();
1823 let options = options.clone();
1824 async {
1825 let op = GetOperation::new(stub)
1826 .set_name(name)
1827 .with_options(options)
1828 .send()
1829 .await?;
1830 Ok(Operation::new(op))
1831 }
1832 };
1833
1834 let start = move || async {
1835 let op = self.send().await?;
1836 Ok(Operation::new(op))
1837 };
1838
1839 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1840 }
1841
1842 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1846 self.0.request.parent = v.into();
1847 self
1848 }
1849
1850 pub fn set_connection_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1854 self.0.request.connection_profile_id = v.into();
1855 self
1856 }
1857
1858 pub fn set_connection_profile<T>(mut self, v: T) -> Self
1862 where
1863 T: std::convert::Into<crate::model::ConnectionProfile>,
1864 {
1865 self.0.request.connection_profile = std::option::Option::Some(v.into());
1866 self
1867 }
1868
1869 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1873 where
1874 T: std::convert::Into<crate::model::ConnectionProfile>,
1875 {
1876 self.0.request.connection_profile = v.map(|x| x.into());
1877 self
1878 }
1879
1880 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882 self.0.request.request_id = v.into();
1883 self
1884 }
1885
1886 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1888 self.0.request.validate_only = v.into();
1889 self
1890 }
1891
1892 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
1894 self.0.request.skip_validation = v.into();
1895 self
1896 }
1897 }
1898
1899 #[doc(hidden)]
1900 impl gax::options::internal::RequestBuilder for CreateConnectionProfile {
1901 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1902 &mut self.0.options
1903 }
1904 }
1905
1906 #[derive(Clone, Debug)]
1925 pub struct UpdateConnectionProfile(
1926 RequestBuilder<crate::model::UpdateConnectionProfileRequest>,
1927 );
1928
1929 impl UpdateConnectionProfile {
1930 pub(crate) fn new(
1931 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
1932 ) -> Self {
1933 Self(RequestBuilder::new(stub))
1934 }
1935
1936 pub fn with_request<V: Into<crate::model::UpdateConnectionProfileRequest>>(
1938 mut self,
1939 v: V,
1940 ) -> Self {
1941 self.0.request = v.into();
1942 self
1943 }
1944
1945 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1947 self.0.options = v.into();
1948 self
1949 }
1950
1951 pub async fn send(self) -> Result<longrunning::model::Operation> {
1958 (*self.0.stub)
1959 .update_connection_profile(self.0.request, self.0.options)
1960 .await
1961 .map(gax::response::Response::into_body)
1962 }
1963
1964 pub fn poller(
1966 self,
1967 ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
1968 {
1969 type Operation = lro::internal::Operation<
1970 crate::model::ConnectionProfile,
1971 crate::model::OperationMetadata,
1972 >;
1973 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1974 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1975
1976 let stub = self.0.stub.clone();
1977 let mut options = self.0.options.clone();
1978 options.set_retry_policy(gax::retry_policy::NeverRetry);
1979 let query = move |name| {
1980 let stub = stub.clone();
1981 let options = options.clone();
1982 async {
1983 let op = GetOperation::new(stub)
1984 .set_name(name)
1985 .with_options(options)
1986 .send()
1987 .await?;
1988 Ok(Operation::new(op))
1989 }
1990 };
1991
1992 let start = move || async {
1993 let op = self.send().await?;
1994 Ok(Operation::new(op))
1995 };
1996
1997 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1998 }
1999
2000 pub fn set_update_mask<T>(mut self, v: T) -> Self
2004 where
2005 T: std::convert::Into<wkt::FieldMask>,
2006 {
2007 self.0.request.update_mask = std::option::Option::Some(v.into());
2008 self
2009 }
2010
2011 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2015 where
2016 T: std::convert::Into<wkt::FieldMask>,
2017 {
2018 self.0.request.update_mask = v.map(|x| x.into());
2019 self
2020 }
2021
2022 pub fn set_connection_profile<T>(mut self, v: T) -> Self
2026 where
2027 T: std::convert::Into<crate::model::ConnectionProfile>,
2028 {
2029 self.0.request.connection_profile = std::option::Option::Some(v.into());
2030 self
2031 }
2032
2033 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
2037 where
2038 T: std::convert::Into<crate::model::ConnectionProfile>,
2039 {
2040 self.0.request.connection_profile = v.map(|x| x.into());
2041 self
2042 }
2043
2044 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2046 self.0.request.request_id = v.into();
2047 self
2048 }
2049
2050 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2052 self.0.request.validate_only = v.into();
2053 self
2054 }
2055
2056 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
2058 self.0.request.skip_validation = v.into();
2059 self
2060 }
2061 }
2062
2063 #[doc(hidden)]
2064 impl gax::options::internal::RequestBuilder for UpdateConnectionProfile {
2065 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2066 &mut self.0.options
2067 }
2068 }
2069
2070 #[derive(Clone, Debug)]
2089 pub struct DeleteConnectionProfile(
2090 RequestBuilder<crate::model::DeleteConnectionProfileRequest>,
2091 );
2092
2093 impl DeleteConnectionProfile {
2094 pub(crate) fn new(
2095 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2096 ) -> Self {
2097 Self(RequestBuilder::new(stub))
2098 }
2099
2100 pub fn with_request<V: Into<crate::model::DeleteConnectionProfileRequest>>(
2102 mut self,
2103 v: V,
2104 ) -> Self {
2105 self.0.request = v.into();
2106 self
2107 }
2108
2109 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2111 self.0.options = v.into();
2112 self
2113 }
2114
2115 pub async fn send(self) -> Result<longrunning::model::Operation> {
2122 (*self.0.stub)
2123 .delete_connection_profile(self.0.request, self.0.options)
2124 .await
2125 .map(gax::response::Response::into_body)
2126 }
2127
2128 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2130 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2131 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2132 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2133
2134 let stub = self.0.stub.clone();
2135 let mut options = self.0.options.clone();
2136 options.set_retry_policy(gax::retry_policy::NeverRetry);
2137 let query = move |name| {
2138 let stub = stub.clone();
2139 let options = options.clone();
2140 async {
2141 let op = GetOperation::new(stub)
2142 .set_name(name)
2143 .with_options(options)
2144 .send()
2145 .await?;
2146 Ok(Operation::new(op))
2147 }
2148 };
2149
2150 let start = move || async {
2151 let op = self.send().await?;
2152 Ok(Operation::new(op))
2153 };
2154
2155 lro::internal::new_unit_response_poller(
2156 polling_error_policy,
2157 polling_backoff_policy,
2158 start,
2159 query,
2160 )
2161 }
2162
2163 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.0.request.name = v.into();
2168 self
2169 }
2170
2171 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2173 self.0.request.request_id = v.into();
2174 self
2175 }
2176
2177 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2179 self.0.request.force = v.into();
2180 self
2181 }
2182 }
2183
2184 #[doc(hidden)]
2185 impl gax::options::internal::RequestBuilder for DeleteConnectionProfile {
2186 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2187 &mut self.0.options
2188 }
2189 }
2190
2191 #[derive(Clone, Debug)]
2210 pub struct CreatePrivateConnection(
2211 RequestBuilder<crate::model::CreatePrivateConnectionRequest>,
2212 );
2213
2214 impl CreatePrivateConnection {
2215 pub(crate) fn new(
2216 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2217 ) -> Self {
2218 Self(RequestBuilder::new(stub))
2219 }
2220
2221 pub fn with_request<V: Into<crate::model::CreatePrivateConnectionRequest>>(
2223 mut self,
2224 v: V,
2225 ) -> Self {
2226 self.0.request = v.into();
2227 self
2228 }
2229
2230 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2232 self.0.options = v.into();
2233 self
2234 }
2235
2236 pub async fn send(self) -> Result<longrunning::model::Operation> {
2243 (*self.0.stub)
2244 .create_private_connection(self.0.request, self.0.options)
2245 .await
2246 .map(gax::response::Response::into_body)
2247 }
2248
2249 pub fn poller(
2251 self,
2252 ) -> impl lro::Poller<crate::model::PrivateConnection, crate::model::OperationMetadata>
2253 {
2254 type Operation = lro::internal::Operation<
2255 crate::model::PrivateConnection,
2256 crate::model::OperationMetadata,
2257 >;
2258 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2259 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2260
2261 let stub = self.0.stub.clone();
2262 let mut options = self.0.options.clone();
2263 options.set_retry_policy(gax::retry_policy::NeverRetry);
2264 let query = move |name| {
2265 let stub = stub.clone();
2266 let options = options.clone();
2267 async {
2268 let op = GetOperation::new(stub)
2269 .set_name(name)
2270 .with_options(options)
2271 .send()
2272 .await?;
2273 Ok(Operation::new(op))
2274 }
2275 };
2276
2277 let start = move || async {
2278 let op = self.send().await?;
2279 Ok(Operation::new(op))
2280 };
2281
2282 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2283 }
2284
2285 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2289 self.0.request.parent = v.into();
2290 self
2291 }
2292
2293 pub fn set_private_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2297 self.0.request.private_connection_id = v.into();
2298 self
2299 }
2300
2301 pub fn set_private_connection<T>(mut self, v: T) -> Self
2305 where
2306 T: std::convert::Into<crate::model::PrivateConnection>,
2307 {
2308 self.0.request.private_connection = std::option::Option::Some(v.into());
2309 self
2310 }
2311
2312 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2316 where
2317 T: std::convert::Into<crate::model::PrivateConnection>,
2318 {
2319 self.0.request.private_connection = v.map(|x| x.into());
2320 self
2321 }
2322
2323 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2325 self.0.request.request_id = v.into();
2326 self
2327 }
2328
2329 pub fn set_skip_validation<T: Into<bool>>(mut self, v: T) -> Self {
2331 self.0.request.skip_validation = v.into();
2332 self
2333 }
2334 }
2335
2336 #[doc(hidden)]
2337 impl gax::options::internal::RequestBuilder for CreatePrivateConnection {
2338 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2339 &mut self.0.options
2340 }
2341 }
2342
2343 #[derive(Clone, Debug)]
2361 pub struct GetPrivateConnection(RequestBuilder<crate::model::GetPrivateConnectionRequest>);
2362
2363 impl GetPrivateConnection {
2364 pub(crate) fn new(
2365 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2366 ) -> Self {
2367 Self(RequestBuilder::new(stub))
2368 }
2369
2370 pub fn with_request<V: Into<crate::model::GetPrivateConnectionRequest>>(
2372 mut self,
2373 v: V,
2374 ) -> Self {
2375 self.0.request = v.into();
2376 self
2377 }
2378
2379 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2381 self.0.options = v.into();
2382 self
2383 }
2384
2385 pub async fn send(self) -> Result<crate::model::PrivateConnection> {
2387 (*self.0.stub)
2388 .get_private_connection(self.0.request, self.0.options)
2389 .await
2390 .map(gax::response::Response::into_body)
2391 }
2392
2393 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2397 self.0.request.name = v.into();
2398 self
2399 }
2400 }
2401
2402 #[doc(hidden)]
2403 impl gax::options::internal::RequestBuilder for GetPrivateConnection {
2404 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2405 &mut self.0.options
2406 }
2407 }
2408
2409 #[derive(Clone, Debug)]
2431 pub struct ListPrivateConnections(RequestBuilder<crate::model::ListPrivateConnectionsRequest>);
2432
2433 impl ListPrivateConnections {
2434 pub(crate) fn new(
2435 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2436 ) -> Self {
2437 Self(RequestBuilder::new(stub))
2438 }
2439
2440 pub fn with_request<V: Into<crate::model::ListPrivateConnectionsRequest>>(
2442 mut self,
2443 v: V,
2444 ) -> Self {
2445 self.0.request = v.into();
2446 self
2447 }
2448
2449 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2451 self.0.options = v.into();
2452 self
2453 }
2454
2455 pub async fn send(self) -> Result<crate::model::ListPrivateConnectionsResponse> {
2457 (*self.0.stub)
2458 .list_private_connections(self.0.request, self.0.options)
2459 .await
2460 .map(gax::response::Response::into_body)
2461 }
2462
2463 pub fn by_page(
2465 self,
2466 ) -> impl gax::paginator::Paginator<
2467 crate::model::ListPrivateConnectionsResponse,
2468 gax::error::Error,
2469 > {
2470 use std::clone::Clone;
2471 let token = self.0.request.page_token.clone();
2472 let execute = move |token: String| {
2473 let mut builder = self.clone();
2474 builder.0.request = builder.0.request.set_page_token(token);
2475 builder.send()
2476 };
2477 gax::paginator::internal::new_paginator(token, execute)
2478 }
2479
2480 pub fn by_item(
2482 self,
2483 ) -> impl gax::paginator::ItemPaginator<
2484 crate::model::ListPrivateConnectionsResponse,
2485 gax::error::Error,
2486 > {
2487 use gax::paginator::Paginator;
2488 self.by_page().items()
2489 }
2490
2491 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2495 self.0.request.parent = v.into();
2496 self
2497 }
2498
2499 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2501 self.0.request.page_size = v.into();
2502 self
2503 }
2504
2505 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2507 self.0.request.page_token = v.into();
2508 self
2509 }
2510
2511 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2513 self.0.request.filter = v.into();
2514 self
2515 }
2516
2517 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2519 self.0.request.order_by = v.into();
2520 self
2521 }
2522 }
2523
2524 #[doc(hidden)]
2525 impl gax::options::internal::RequestBuilder for ListPrivateConnections {
2526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2527 &mut self.0.options
2528 }
2529 }
2530
2531 #[derive(Clone, Debug)]
2550 pub struct DeletePrivateConnection(
2551 RequestBuilder<crate::model::DeletePrivateConnectionRequest>,
2552 );
2553
2554 impl DeletePrivateConnection {
2555 pub(crate) fn new(
2556 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2557 ) -> Self {
2558 Self(RequestBuilder::new(stub))
2559 }
2560
2561 pub fn with_request<V: Into<crate::model::DeletePrivateConnectionRequest>>(
2563 mut self,
2564 v: V,
2565 ) -> Self {
2566 self.0.request = v.into();
2567 self
2568 }
2569
2570 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2572 self.0.options = v.into();
2573 self
2574 }
2575
2576 pub async fn send(self) -> Result<longrunning::model::Operation> {
2583 (*self.0.stub)
2584 .delete_private_connection(self.0.request, self.0.options)
2585 .await
2586 .map(gax::response::Response::into_body)
2587 }
2588
2589 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2591 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2592 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2593 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2594
2595 let stub = self.0.stub.clone();
2596 let mut options = self.0.options.clone();
2597 options.set_retry_policy(gax::retry_policy::NeverRetry);
2598 let query = move |name| {
2599 let stub = stub.clone();
2600 let options = options.clone();
2601 async {
2602 let op = GetOperation::new(stub)
2603 .set_name(name)
2604 .with_options(options)
2605 .send()
2606 .await?;
2607 Ok(Operation::new(op))
2608 }
2609 };
2610
2611 let start = move || async {
2612 let op = self.send().await?;
2613 Ok(Operation::new(op))
2614 };
2615
2616 lro::internal::new_unit_response_poller(
2617 polling_error_policy,
2618 polling_backoff_policy,
2619 start,
2620 query,
2621 )
2622 }
2623
2624 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2628 self.0.request.name = v.into();
2629 self
2630 }
2631
2632 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2634 self.0.request.request_id = v.into();
2635 self
2636 }
2637 }
2638
2639 #[doc(hidden)]
2640 impl gax::options::internal::RequestBuilder for DeletePrivateConnection {
2641 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2642 &mut self.0.options
2643 }
2644 }
2645
2646 #[derive(Clone, Debug)]
2664 pub struct GetConversionWorkspace(RequestBuilder<crate::model::GetConversionWorkspaceRequest>);
2665
2666 impl GetConversionWorkspace {
2667 pub(crate) fn new(
2668 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2669 ) -> Self {
2670 Self(RequestBuilder::new(stub))
2671 }
2672
2673 pub fn with_request<V: Into<crate::model::GetConversionWorkspaceRequest>>(
2675 mut self,
2676 v: V,
2677 ) -> Self {
2678 self.0.request = v.into();
2679 self
2680 }
2681
2682 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2684 self.0.options = v.into();
2685 self
2686 }
2687
2688 pub async fn send(self) -> Result<crate::model::ConversionWorkspace> {
2690 (*self.0.stub)
2691 .get_conversion_workspace(self.0.request, self.0.options)
2692 .await
2693 .map(gax::response::Response::into_body)
2694 }
2695
2696 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2700 self.0.request.name = v.into();
2701 self
2702 }
2703 }
2704
2705 #[doc(hidden)]
2706 impl gax::options::internal::RequestBuilder for GetConversionWorkspace {
2707 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2708 &mut self.0.options
2709 }
2710 }
2711
2712 #[derive(Clone, Debug)]
2734 pub struct ListConversionWorkspaces(
2735 RequestBuilder<crate::model::ListConversionWorkspacesRequest>,
2736 );
2737
2738 impl ListConversionWorkspaces {
2739 pub(crate) fn new(
2740 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2741 ) -> Self {
2742 Self(RequestBuilder::new(stub))
2743 }
2744
2745 pub fn with_request<V: Into<crate::model::ListConversionWorkspacesRequest>>(
2747 mut self,
2748 v: V,
2749 ) -> Self {
2750 self.0.request = v.into();
2751 self
2752 }
2753
2754 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2756 self.0.options = v.into();
2757 self
2758 }
2759
2760 pub async fn send(self) -> Result<crate::model::ListConversionWorkspacesResponse> {
2762 (*self.0.stub)
2763 .list_conversion_workspaces(self.0.request, self.0.options)
2764 .await
2765 .map(gax::response::Response::into_body)
2766 }
2767
2768 pub fn by_page(
2770 self,
2771 ) -> impl gax::paginator::Paginator<
2772 crate::model::ListConversionWorkspacesResponse,
2773 gax::error::Error,
2774 > {
2775 use std::clone::Clone;
2776 let token = self.0.request.page_token.clone();
2777 let execute = move |token: String| {
2778 let mut builder = self.clone();
2779 builder.0.request = builder.0.request.set_page_token(token);
2780 builder.send()
2781 };
2782 gax::paginator::internal::new_paginator(token, execute)
2783 }
2784
2785 pub fn by_item(
2787 self,
2788 ) -> impl gax::paginator::ItemPaginator<
2789 crate::model::ListConversionWorkspacesResponse,
2790 gax::error::Error,
2791 > {
2792 use gax::paginator::Paginator;
2793 self.by_page().items()
2794 }
2795
2796 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2800 self.0.request.parent = v.into();
2801 self
2802 }
2803
2804 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2806 self.0.request.page_size = v.into();
2807 self
2808 }
2809
2810 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2812 self.0.request.page_token = v.into();
2813 self
2814 }
2815
2816 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818 self.0.request.filter = v.into();
2819 self
2820 }
2821 }
2822
2823 #[doc(hidden)]
2824 impl gax::options::internal::RequestBuilder for ListConversionWorkspaces {
2825 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2826 &mut self.0.options
2827 }
2828 }
2829
2830 #[derive(Clone, Debug)]
2849 pub struct CreateConversionWorkspace(
2850 RequestBuilder<crate::model::CreateConversionWorkspaceRequest>,
2851 );
2852
2853 impl CreateConversionWorkspace {
2854 pub(crate) fn new(
2855 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
2856 ) -> Self {
2857 Self(RequestBuilder::new(stub))
2858 }
2859
2860 pub fn with_request<V: Into<crate::model::CreateConversionWorkspaceRequest>>(
2862 mut self,
2863 v: V,
2864 ) -> Self {
2865 self.0.request = v.into();
2866 self
2867 }
2868
2869 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2871 self.0.options = v.into();
2872 self
2873 }
2874
2875 pub async fn send(self) -> Result<longrunning::model::Operation> {
2882 (*self.0.stub)
2883 .create_conversion_workspace(self.0.request, self.0.options)
2884 .await
2885 .map(gax::response::Response::into_body)
2886 }
2887
2888 pub fn poller(
2890 self,
2891 ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
2892 {
2893 type Operation = lro::internal::Operation<
2894 crate::model::ConversionWorkspace,
2895 crate::model::OperationMetadata,
2896 >;
2897 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2898 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2899
2900 let stub = self.0.stub.clone();
2901 let mut options = self.0.options.clone();
2902 options.set_retry_policy(gax::retry_policy::NeverRetry);
2903 let query = move |name| {
2904 let stub = stub.clone();
2905 let options = options.clone();
2906 async {
2907 let op = GetOperation::new(stub)
2908 .set_name(name)
2909 .with_options(options)
2910 .send()
2911 .await?;
2912 Ok(Operation::new(op))
2913 }
2914 };
2915
2916 let start = move || async {
2917 let op = self.send().await?;
2918 Ok(Operation::new(op))
2919 };
2920
2921 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2922 }
2923
2924 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2928 self.0.request.parent = v.into();
2929 self
2930 }
2931
2932 pub fn set_conversion_workspace_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2936 self.0.request.conversion_workspace_id = v.into();
2937 self
2938 }
2939
2940 pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
2944 where
2945 T: std::convert::Into<crate::model::ConversionWorkspace>,
2946 {
2947 self.0.request.conversion_workspace = std::option::Option::Some(v.into());
2948 self
2949 }
2950
2951 pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
2955 where
2956 T: std::convert::Into<crate::model::ConversionWorkspace>,
2957 {
2958 self.0.request.conversion_workspace = v.map(|x| x.into());
2959 self
2960 }
2961
2962 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2964 self.0.request.request_id = v.into();
2965 self
2966 }
2967 }
2968
2969 #[doc(hidden)]
2970 impl gax::options::internal::RequestBuilder for CreateConversionWorkspace {
2971 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2972 &mut self.0.options
2973 }
2974 }
2975
2976 #[derive(Clone, Debug)]
2995 pub struct UpdateConversionWorkspace(
2996 RequestBuilder<crate::model::UpdateConversionWorkspaceRequest>,
2997 );
2998
2999 impl UpdateConversionWorkspace {
3000 pub(crate) fn new(
3001 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3002 ) -> Self {
3003 Self(RequestBuilder::new(stub))
3004 }
3005
3006 pub fn with_request<V: Into<crate::model::UpdateConversionWorkspaceRequest>>(
3008 mut self,
3009 v: V,
3010 ) -> Self {
3011 self.0.request = v.into();
3012 self
3013 }
3014
3015 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3017 self.0.options = v.into();
3018 self
3019 }
3020
3021 pub async fn send(self) -> Result<longrunning::model::Operation> {
3028 (*self.0.stub)
3029 .update_conversion_workspace(self.0.request, self.0.options)
3030 .await
3031 .map(gax::response::Response::into_body)
3032 }
3033
3034 pub fn poller(
3036 self,
3037 ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
3038 {
3039 type Operation = lro::internal::Operation<
3040 crate::model::ConversionWorkspace,
3041 crate::model::OperationMetadata,
3042 >;
3043 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3044 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3045
3046 let stub = self.0.stub.clone();
3047 let mut options = self.0.options.clone();
3048 options.set_retry_policy(gax::retry_policy::NeverRetry);
3049 let query = move |name| {
3050 let stub = stub.clone();
3051 let options = options.clone();
3052 async {
3053 let op = GetOperation::new(stub)
3054 .set_name(name)
3055 .with_options(options)
3056 .send()
3057 .await?;
3058 Ok(Operation::new(op))
3059 }
3060 };
3061
3062 let start = move || async {
3063 let op = self.send().await?;
3064 Ok(Operation::new(op))
3065 };
3066
3067 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3068 }
3069
3070 pub fn set_update_mask<T>(mut self, v: T) -> Self
3074 where
3075 T: std::convert::Into<wkt::FieldMask>,
3076 {
3077 self.0.request.update_mask = std::option::Option::Some(v.into());
3078 self
3079 }
3080
3081 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3085 where
3086 T: std::convert::Into<wkt::FieldMask>,
3087 {
3088 self.0.request.update_mask = v.map(|x| x.into());
3089 self
3090 }
3091
3092 pub fn set_conversion_workspace<T>(mut self, v: T) -> Self
3096 where
3097 T: std::convert::Into<crate::model::ConversionWorkspace>,
3098 {
3099 self.0.request.conversion_workspace = std::option::Option::Some(v.into());
3100 self
3101 }
3102
3103 pub fn set_or_clear_conversion_workspace<T>(mut self, v: std::option::Option<T>) -> Self
3107 where
3108 T: std::convert::Into<crate::model::ConversionWorkspace>,
3109 {
3110 self.0.request.conversion_workspace = v.map(|x| x.into());
3111 self
3112 }
3113
3114 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3116 self.0.request.request_id = v.into();
3117 self
3118 }
3119 }
3120
3121 #[doc(hidden)]
3122 impl gax::options::internal::RequestBuilder for UpdateConversionWorkspace {
3123 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3124 &mut self.0.options
3125 }
3126 }
3127
3128 #[derive(Clone, Debug)]
3147 pub struct DeleteConversionWorkspace(
3148 RequestBuilder<crate::model::DeleteConversionWorkspaceRequest>,
3149 );
3150
3151 impl DeleteConversionWorkspace {
3152 pub(crate) fn new(
3153 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3154 ) -> Self {
3155 Self(RequestBuilder::new(stub))
3156 }
3157
3158 pub fn with_request<V: Into<crate::model::DeleteConversionWorkspaceRequest>>(
3160 mut self,
3161 v: V,
3162 ) -> Self {
3163 self.0.request = v.into();
3164 self
3165 }
3166
3167 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3169 self.0.options = v.into();
3170 self
3171 }
3172
3173 pub async fn send(self) -> Result<longrunning::model::Operation> {
3180 (*self.0.stub)
3181 .delete_conversion_workspace(self.0.request, self.0.options)
3182 .await
3183 .map(gax::response::Response::into_body)
3184 }
3185
3186 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3188 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3189 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3190 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3191
3192 let stub = self.0.stub.clone();
3193 let mut options = self.0.options.clone();
3194 options.set_retry_policy(gax::retry_policy::NeverRetry);
3195 let query = move |name| {
3196 let stub = stub.clone();
3197 let options = options.clone();
3198 async {
3199 let op = GetOperation::new(stub)
3200 .set_name(name)
3201 .with_options(options)
3202 .send()
3203 .await?;
3204 Ok(Operation::new(op))
3205 }
3206 };
3207
3208 let start = move || async {
3209 let op = self.send().await?;
3210 Ok(Operation::new(op))
3211 };
3212
3213 lro::internal::new_unit_response_poller(
3214 polling_error_policy,
3215 polling_backoff_policy,
3216 start,
3217 query,
3218 )
3219 }
3220
3221 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3225 self.0.request.name = v.into();
3226 self
3227 }
3228
3229 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3231 self.0.request.request_id = v.into();
3232 self
3233 }
3234
3235 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3237 self.0.request.force = v.into();
3238 self
3239 }
3240 }
3241
3242 #[doc(hidden)]
3243 impl gax::options::internal::RequestBuilder for DeleteConversionWorkspace {
3244 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3245 &mut self.0.options
3246 }
3247 }
3248
3249 #[derive(Clone, Debug)]
3267 pub struct CreateMappingRule(RequestBuilder<crate::model::CreateMappingRuleRequest>);
3268
3269 impl CreateMappingRule {
3270 pub(crate) fn new(
3271 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3272 ) -> Self {
3273 Self(RequestBuilder::new(stub))
3274 }
3275
3276 pub fn with_request<V: Into<crate::model::CreateMappingRuleRequest>>(
3278 mut self,
3279 v: V,
3280 ) -> Self {
3281 self.0.request = v.into();
3282 self
3283 }
3284
3285 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3287 self.0.options = v.into();
3288 self
3289 }
3290
3291 pub async fn send(self) -> Result<crate::model::MappingRule> {
3293 (*self.0.stub)
3294 .create_mapping_rule(self.0.request, self.0.options)
3295 .await
3296 .map(gax::response::Response::into_body)
3297 }
3298
3299 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3303 self.0.request.parent = v.into();
3304 self
3305 }
3306
3307 pub fn set_mapping_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3311 self.0.request.mapping_rule_id = v.into();
3312 self
3313 }
3314
3315 pub fn set_mapping_rule<T>(mut self, v: T) -> Self
3319 where
3320 T: std::convert::Into<crate::model::MappingRule>,
3321 {
3322 self.0.request.mapping_rule = std::option::Option::Some(v.into());
3323 self
3324 }
3325
3326 pub fn set_or_clear_mapping_rule<T>(mut self, v: std::option::Option<T>) -> Self
3330 where
3331 T: std::convert::Into<crate::model::MappingRule>,
3332 {
3333 self.0.request.mapping_rule = v.map(|x| x.into());
3334 self
3335 }
3336
3337 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3339 self.0.request.request_id = v.into();
3340 self
3341 }
3342 }
3343
3344 #[doc(hidden)]
3345 impl gax::options::internal::RequestBuilder for CreateMappingRule {
3346 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3347 &mut self.0.options
3348 }
3349 }
3350
3351 #[derive(Clone, Debug)]
3369 pub struct DeleteMappingRule(RequestBuilder<crate::model::DeleteMappingRuleRequest>);
3370
3371 impl DeleteMappingRule {
3372 pub(crate) fn new(
3373 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3374 ) -> Self {
3375 Self(RequestBuilder::new(stub))
3376 }
3377
3378 pub fn with_request<V: Into<crate::model::DeleteMappingRuleRequest>>(
3380 mut self,
3381 v: V,
3382 ) -> Self {
3383 self.0.request = v.into();
3384 self
3385 }
3386
3387 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3389 self.0.options = v.into();
3390 self
3391 }
3392
3393 pub async fn send(self) -> Result<()> {
3395 (*self.0.stub)
3396 .delete_mapping_rule(self.0.request, self.0.options)
3397 .await
3398 .map(gax::response::Response::into_body)
3399 }
3400
3401 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3405 self.0.request.name = v.into();
3406 self
3407 }
3408
3409 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.0.request.request_id = v.into();
3412 self
3413 }
3414 }
3415
3416 #[doc(hidden)]
3417 impl gax::options::internal::RequestBuilder for DeleteMappingRule {
3418 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3419 &mut self.0.options
3420 }
3421 }
3422
3423 #[derive(Clone, Debug)]
3445 pub struct ListMappingRules(RequestBuilder<crate::model::ListMappingRulesRequest>);
3446
3447 impl ListMappingRules {
3448 pub(crate) fn new(
3449 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3450 ) -> Self {
3451 Self(RequestBuilder::new(stub))
3452 }
3453
3454 pub fn with_request<V: Into<crate::model::ListMappingRulesRequest>>(
3456 mut self,
3457 v: V,
3458 ) -> Self {
3459 self.0.request = v.into();
3460 self
3461 }
3462
3463 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3465 self.0.options = v.into();
3466 self
3467 }
3468
3469 pub async fn send(self) -> Result<crate::model::ListMappingRulesResponse> {
3471 (*self.0.stub)
3472 .list_mapping_rules(self.0.request, self.0.options)
3473 .await
3474 .map(gax::response::Response::into_body)
3475 }
3476
3477 pub fn by_page(
3479 self,
3480 ) -> impl gax::paginator::Paginator<crate::model::ListMappingRulesResponse, gax::error::Error>
3481 {
3482 use std::clone::Clone;
3483 let token = self.0.request.page_token.clone();
3484 let execute = move |token: String| {
3485 let mut builder = self.clone();
3486 builder.0.request = builder.0.request.set_page_token(token);
3487 builder.send()
3488 };
3489 gax::paginator::internal::new_paginator(token, execute)
3490 }
3491
3492 pub fn by_item(
3494 self,
3495 ) -> impl gax::paginator::ItemPaginator<crate::model::ListMappingRulesResponse, gax::error::Error>
3496 {
3497 use gax::paginator::Paginator;
3498 self.by_page().items()
3499 }
3500
3501 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3505 self.0.request.parent = v.into();
3506 self
3507 }
3508
3509 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3511 self.0.request.page_size = v.into();
3512 self
3513 }
3514
3515 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3517 self.0.request.page_token = v.into();
3518 self
3519 }
3520 }
3521
3522 #[doc(hidden)]
3523 impl gax::options::internal::RequestBuilder for ListMappingRules {
3524 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3525 &mut self.0.options
3526 }
3527 }
3528
3529 #[derive(Clone, Debug)]
3547 pub struct GetMappingRule(RequestBuilder<crate::model::GetMappingRuleRequest>);
3548
3549 impl GetMappingRule {
3550 pub(crate) fn new(
3551 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3552 ) -> Self {
3553 Self(RequestBuilder::new(stub))
3554 }
3555
3556 pub fn with_request<V: Into<crate::model::GetMappingRuleRequest>>(mut self, v: V) -> Self {
3558 self.0.request = v.into();
3559 self
3560 }
3561
3562 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3564 self.0.options = v.into();
3565 self
3566 }
3567
3568 pub async fn send(self) -> Result<crate::model::MappingRule> {
3570 (*self.0.stub)
3571 .get_mapping_rule(self.0.request, self.0.options)
3572 .await
3573 .map(gax::response::Response::into_body)
3574 }
3575
3576 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3580 self.0.request.name = v.into();
3581 self
3582 }
3583 }
3584
3585 #[doc(hidden)]
3586 impl gax::options::internal::RequestBuilder for GetMappingRule {
3587 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3588 &mut self.0.options
3589 }
3590 }
3591
3592 #[derive(Clone, Debug)]
3611 pub struct SeedConversionWorkspace(
3612 RequestBuilder<crate::model::SeedConversionWorkspaceRequest>,
3613 );
3614
3615 impl SeedConversionWorkspace {
3616 pub(crate) fn new(
3617 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3618 ) -> Self {
3619 Self(RequestBuilder::new(stub))
3620 }
3621
3622 pub fn with_request<V: Into<crate::model::SeedConversionWorkspaceRequest>>(
3624 mut self,
3625 v: V,
3626 ) -> Self {
3627 self.0.request = v.into();
3628 self
3629 }
3630
3631 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3633 self.0.options = v.into();
3634 self
3635 }
3636
3637 pub async fn send(self) -> Result<longrunning::model::Operation> {
3644 (*self.0.stub)
3645 .seed_conversion_workspace(self.0.request, self.0.options)
3646 .await
3647 .map(gax::response::Response::into_body)
3648 }
3649
3650 pub fn poller(
3652 self,
3653 ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
3654 {
3655 type Operation = lro::internal::Operation<
3656 crate::model::ConversionWorkspace,
3657 crate::model::OperationMetadata,
3658 >;
3659 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3660 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3661
3662 let stub = self.0.stub.clone();
3663 let mut options = self.0.options.clone();
3664 options.set_retry_policy(gax::retry_policy::NeverRetry);
3665 let query = move |name| {
3666 let stub = stub.clone();
3667 let options = options.clone();
3668 async {
3669 let op = GetOperation::new(stub)
3670 .set_name(name)
3671 .with_options(options)
3672 .send()
3673 .await?;
3674 Ok(Operation::new(op))
3675 }
3676 };
3677
3678 let start = move || async {
3679 let op = self.send().await?;
3680 Ok(Operation::new(op))
3681 };
3682
3683 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3684 }
3685
3686 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3688 self.0.request.name = v.into();
3689 self
3690 }
3691
3692 pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
3694 self.0.request.auto_commit = v.into();
3695 self
3696 }
3697
3698 pub fn set_seed_from<
3703 T: Into<Option<crate::model::seed_conversion_workspace_request::SeedFrom>>,
3704 >(
3705 mut self,
3706 v: T,
3707 ) -> Self {
3708 self.0.request.seed_from = v.into();
3709 self
3710 }
3711
3712 pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
3718 mut self,
3719 v: T,
3720 ) -> Self {
3721 self.0.request = self.0.request.set_source_connection_profile(v);
3722 self
3723 }
3724
3725 pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
3731 mut self,
3732 v: T,
3733 ) -> Self {
3734 self.0.request = self.0.request.set_destination_connection_profile(v);
3735 self
3736 }
3737 }
3738
3739 #[doc(hidden)]
3740 impl gax::options::internal::RequestBuilder for SeedConversionWorkspace {
3741 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3742 &mut self.0.options
3743 }
3744 }
3745
3746 #[derive(Clone, Debug)]
3765 pub struct ImportMappingRules(RequestBuilder<crate::model::ImportMappingRulesRequest>);
3766
3767 impl ImportMappingRules {
3768 pub(crate) fn new(
3769 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3770 ) -> Self {
3771 Self(RequestBuilder::new(stub))
3772 }
3773
3774 pub fn with_request<V: Into<crate::model::ImportMappingRulesRequest>>(
3776 mut self,
3777 v: V,
3778 ) -> Self {
3779 self.0.request = v.into();
3780 self
3781 }
3782
3783 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3785 self.0.options = v.into();
3786 self
3787 }
3788
3789 pub async fn send(self) -> Result<longrunning::model::Operation> {
3796 (*self.0.stub)
3797 .import_mapping_rules(self.0.request, self.0.options)
3798 .await
3799 .map(gax::response::Response::into_body)
3800 }
3801
3802 pub fn poller(
3804 self,
3805 ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
3806 {
3807 type Operation = lro::internal::Operation<
3808 crate::model::ConversionWorkspace,
3809 crate::model::OperationMetadata,
3810 >;
3811 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3812 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3813
3814 let stub = self.0.stub.clone();
3815 let mut options = self.0.options.clone();
3816 options.set_retry_policy(gax::retry_policy::NeverRetry);
3817 let query = move |name| {
3818 let stub = stub.clone();
3819 let options = options.clone();
3820 async {
3821 let op = GetOperation::new(stub)
3822 .set_name(name)
3823 .with_options(options)
3824 .send()
3825 .await?;
3826 Ok(Operation::new(op))
3827 }
3828 };
3829
3830 let start = move || async {
3831 let op = self.send().await?;
3832 Ok(Operation::new(op))
3833 };
3834
3835 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3836 }
3837
3838 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3842 self.0.request.parent = v.into();
3843 self
3844 }
3845
3846 pub fn set_rules_format<T: Into<crate::model::ImportRulesFileFormat>>(
3850 mut self,
3851 v: T,
3852 ) -> Self {
3853 self.0.request.rules_format = v.into();
3854 self
3855 }
3856
3857 pub fn set_rules_files<T, V>(mut self, v: T) -> Self
3861 where
3862 T: std::iter::IntoIterator<Item = V>,
3863 V: std::convert::Into<crate::model::import_mapping_rules_request::RulesFile>,
3864 {
3865 use std::iter::Iterator;
3866 self.0.request.rules_files = v.into_iter().map(|i| i.into()).collect();
3867 self
3868 }
3869
3870 pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
3874 self.0.request.auto_commit = v.into();
3875 self
3876 }
3877 }
3878
3879 #[doc(hidden)]
3880 impl gax::options::internal::RequestBuilder for ImportMappingRules {
3881 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3882 &mut self.0.options
3883 }
3884 }
3885
3886 #[derive(Clone, Debug)]
3905 pub struct ConvertConversionWorkspace(
3906 RequestBuilder<crate::model::ConvertConversionWorkspaceRequest>,
3907 );
3908
3909 impl ConvertConversionWorkspace {
3910 pub(crate) fn new(
3911 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
3912 ) -> Self {
3913 Self(RequestBuilder::new(stub))
3914 }
3915
3916 pub fn with_request<V: Into<crate::model::ConvertConversionWorkspaceRequest>>(
3918 mut self,
3919 v: V,
3920 ) -> Self {
3921 self.0.request = v.into();
3922 self
3923 }
3924
3925 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3927 self.0.options = v.into();
3928 self
3929 }
3930
3931 pub async fn send(self) -> Result<longrunning::model::Operation> {
3938 (*self.0.stub)
3939 .convert_conversion_workspace(self.0.request, self.0.options)
3940 .await
3941 .map(gax::response::Response::into_body)
3942 }
3943
3944 pub fn poller(
3946 self,
3947 ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
3948 {
3949 type Operation = lro::internal::Operation<
3950 crate::model::ConversionWorkspace,
3951 crate::model::OperationMetadata,
3952 >;
3953 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3954 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3955
3956 let stub = self.0.stub.clone();
3957 let mut options = self.0.options.clone();
3958 options.set_retry_policy(gax::retry_policy::NeverRetry);
3959 let query = move |name| {
3960 let stub = stub.clone();
3961 let options = options.clone();
3962 async {
3963 let op = GetOperation::new(stub)
3964 .set_name(name)
3965 .with_options(options)
3966 .send()
3967 .await?;
3968 Ok(Operation::new(op))
3969 }
3970 };
3971
3972 let start = move || async {
3973 let op = self.send().await?;
3974 Ok(Operation::new(op))
3975 };
3976
3977 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3978 }
3979
3980 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3982 self.0.request.name = v.into();
3983 self
3984 }
3985
3986 pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
3988 self.0.request.auto_commit = v.into();
3989 self
3990 }
3991
3992 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3994 self.0.request.filter = v.into();
3995 self
3996 }
3997
3998 pub fn set_convert_full_path<T: Into<bool>>(mut self, v: T) -> Self {
4000 self.0.request.convert_full_path = v.into();
4001 self
4002 }
4003 }
4004
4005 #[doc(hidden)]
4006 impl gax::options::internal::RequestBuilder for ConvertConversionWorkspace {
4007 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4008 &mut self.0.options
4009 }
4010 }
4011
4012 #[derive(Clone, Debug)]
4031 pub struct CommitConversionWorkspace(
4032 RequestBuilder<crate::model::CommitConversionWorkspaceRequest>,
4033 );
4034
4035 impl CommitConversionWorkspace {
4036 pub(crate) fn new(
4037 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4038 ) -> Self {
4039 Self(RequestBuilder::new(stub))
4040 }
4041
4042 pub fn with_request<V: Into<crate::model::CommitConversionWorkspaceRequest>>(
4044 mut self,
4045 v: V,
4046 ) -> Self {
4047 self.0.request = v.into();
4048 self
4049 }
4050
4051 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4053 self.0.options = v.into();
4054 self
4055 }
4056
4057 pub async fn send(self) -> Result<longrunning::model::Operation> {
4064 (*self.0.stub)
4065 .commit_conversion_workspace(self.0.request, self.0.options)
4066 .await
4067 .map(gax::response::Response::into_body)
4068 }
4069
4070 pub fn poller(
4072 self,
4073 ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
4074 {
4075 type Operation = lro::internal::Operation<
4076 crate::model::ConversionWorkspace,
4077 crate::model::OperationMetadata,
4078 >;
4079 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4080 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4081
4082 let stub = self.0.stub.clone();
4083 let mut options = self.0.options.clone();
4084 options.set_retry_policy(gax::retry_policy::NeverRetry);
4085 let query = move |name| {
4086 let stub = stub.clone();
4087 let options = options.clone();
4088 async {
4089 let op = GetOperation::new(stub)
4090 .set_name(name)
4091 .with_options(options)
4092 .send()
4093 .await?;
4094 Ok(Operation::new(op))
4095 }
4096 };
4097
4098 let start = move || async {
4099 let op = self.send().await?;
4100 Ok(Operation::new(op))
4101 };
4102
4103 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4104 }
4105
4106 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110 self.0.request.name = v.into();
4111 self
4112 }
4113
4114 pub fn set_commit_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4116 self.0.request.commit_name = v.into();
4117 self
4118 }
4119 }
4120
4121 #[doc(hidden)]
4122 impl gax::options::internal::RequestBuilder for CommitConversionWorkspace {
4123 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4124 &mut self.0.options
4125 }
4126 }
4127
4128 #[derive(Clone, Debug)]
4147 pub struct RollbackConversionWorkspace(
4148 RequestBuilder<crate::model::RollbackConversionWorkspaceRequest>,
4149 );
4150
4151 impl RollbackConversionWorkspace {
4152 pub(crate) fn new(
4153 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4154 ) -> Self {
4155 Self(RequestBuilder::new(stub))
4156 }
4157
4158 pub fn with_request<V: Into<crate::model::RollbackConversionWorkspaceRequest>>(
4160 mut self,
4161 v: V,
4162 ) -> Self {
4163 self.0.request = v.into();
4164 self
4165 }
4166
4167 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4169 self.0.options = v.into();
4170 self
4171 }
4172
4173 pub async fn send(self) -> Result<longrunning::model::Operation> {
4180 (*self.0.stub)
4181 .rollback_conversion_workspace(self.0.request, self.0.options)
4182 .await
4183 .map(gax::response::Response::into_body)
4184 }
4185
4186 pub fn poller(
4188 self,
4189 ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
4190 {
4191 type Operation = lro::internal::Operation<
4192 crate::model::ConversionWorkspace,
4193 crate::model::OperationMetadata,
4194 >;
4195 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4196 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4197
4198 let stub = self.0.stub.clone();
4199 let mut options = self.0.options.clone();
4200 options.set_retry_policy(gax::retry_policy::NeverRetry);
4201 let query = move |name| {
4202 let stub = stub.clone();
4203 let options = options.clone();
4204 async {
4205 let op = GetOperation::new(stub)
4206 .set_name(name)
4207 .with_options(options)
4208 .send()
4209 .await?;
4210 Ok(Operation::new(op))
4211 }
4212 };
4213
4214 let start = move || async {
4215 let op = self.send().await?;
4216 Ok(Operation::new(op))
4217 };
4218
4219 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4220 }
4221
4222 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4226 self.0.request.name = v.into();
4227 self
4228 }
4229 }
4230
4231 #[doc(hidden)]
4232 impl gax::options::internal::RequestBuilder for RollbackConversionWorkspace {
4233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4234 &mut self.0.options
4235 }
4236 }
4237
4238 #[derive(Clone, Debug)]
4257 pub struct ApplyConversionWorkspace(
4258 RequestBuilder<crate::model::ApplyConversionWorkspaceRequest>,
4259 );
4260
4261 impl ApplyConversionWorkspace {
4262 pub(crate) fn new(
4263 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4264 ) -> Self {
4265 Self(RequestBuilder::new(stub))
4266 }
4267
4268 pub fn with_request<V: Into<crate::model::ApplyConversionWorkspaceRequest>>(
4270 mut self,
4271 v: V,
4272 ) -> Self {
4273 self.0.request = v.into();
4274 self
4275 }
4276
4277 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4279 self.0.options = v.into();
4280 self
4281 }
4282
4283 pub async fn send(self) -> Result<longrunning::model::Operation> {
4290 (*self.0.stub)
4291 .apply_conversion_workspace(self.0.request, self.0.options)
4292 .await
4293 .map(gax::response::Response::into_body)
4294 }
4295
4296 pub fn poller(
4298 self,
4299 ) -> impl lro::Poller<crate::model::ConversionWorkspace, crate::model::OperationMetadata>
4300 {
4301 type Operation = lro::internal::Operation<
4302 crate::model::ConversionWorkspace,
4303 crate::model::OperationMetadata,
4304 >;
4305 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4306 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4307
4308 let stub = self.0.stub.clone();
4309 let mut options = self.0.options.clone();
4310 options.set_retry_policy(gax::retry_policy::NeverRetry);
4311 let query = move |name| {
4312 let stub = stub.clone();
4313 let options = options.clone();
4314 async {
4315 let op = GetOperation::new(stub)
4316 .set_name(name)
4317 .with_options(options)
4318 .send()
4319 .await?;
4320 Ok(Operation::new(op))
4321 }
4322 };
4323
4324 let start = move || async {
4325 let op = self.send().await?;
4326 Ok(Operation::new(op))
4327 };
4328
4329 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4330 }
4331
4332 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4336 self.0.request.name = v.into();
4337 self
4338 }
4339
4340 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4342 self.0.request.filter = v.into();
4343 self
4344 }
4345
4346 pub fn set_dry_run<T: Into<bool>>(mut self, v: T) -> Self {
4348 self.0.request.dry_run = v.into();
4349 self
4350 }
4351
4352 pub fn set_auto_commit<T: Into<bool>>(mut self, v: T) -> Self {
4354 self.0.request.auto_commit = v.into();
4355 self
4356 }
4357
4358 pub fn set_destination<
4363 T: Into<Option<crate::model::apply_conversion_workspace_request::Destination>>,
4364 >(
4365 mut self,
4366 v: T,
4367 ) -> Self {
4368 self.0.request.destination = v.into();
4369 self
4370 }
4371
4372 pub fn set_connection_profile<T: std::convert::Into<std::string::String>>(
4378 mut self,
4379 v: T,
4380 ) -> Self {
4381 self.0.request = self.0.request.set_connection_profile(v);
4382 self
4383 }
4384 }
4385
4386 #[doc(hidden)]
4387 impl gax::options::internal::RequestBuilder for ApplyConversionWorkspace {
4388 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4389 &mut self.0.options
4390 }
4391 }
4392
4393 #[derive(Clone, Debug)]
4415 pub struct DescribeDatabaseEntities(
4416 RequestBuilder<crate::model::DescribeDatabaseEntitiesRequest>,
4417 );
4418
4419 impl DescribeDatabaseEntities {
4420 pub(crate) fn new(
4421 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4422 ) -> Self {
4423 Self(RequestBuilder::new(stub))
4424 }
4425
4426 pub fn with_request<V: Into<crate::model::DescribeDatabaseEntitiesRequest>>(
4428 mut self,
4429 v: V,
4430 ) -> Self {
4431 self.0.request = v.into();
4432 self
4433 }
4434
4435 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4437 self.0.options = v.into();
4438 self
4439 }
4440
4441 pub async fn send(self) -> Result<crate::model::DescribeDatabaseEntitiesResponse> {
4443 (*self.0.stub)
4444 .describe_database_entities(self.0.request, self.0.options)
4445 .await
4446 .map(gax::response::Response::into_body)
4447 }
4448
4449 pub fn by_page(
4451 self,
4452 ) -> impl gax::paginator::Paginator<
4453 crate::model::DescribeDatabaseEntitiesResponse,
4454 gax::error::Error,
4455 > {
4456 use std::clone::Clone;
4457 let token = self.0.request.page_token.clone();
4458 let execute = move |token: String| {
4459 let mut builder = self.clone();
4460 builder.0.request = builder.0.request.set_page_token(token);
4461 builder.send()
4462 };
4463 gax::paginator::internal::new_paginator(token, execute)
4464 }
4465
4466 pub fn by_item(
4468 self,
4469 ) -> impl gax::paginator::ItemPaginator<
4470 crate::model::DescribeDatabaseEntitiesResponse,
4471 gax::error::Error,
4472 > {
4473 use gax::paginator::Paginator;
4474 self.by_page().items()
4475 }
4476
4477 pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4481 self.0.request.conversion_workspace = v.into();
4482 self
4483 }
4484
4485 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4487 self.0.request.page_size = v.into();
4488 self
4489 }
4490
4491 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4493 self.0.request.page_token = v.into();
4494 self
4495 }
4496
4497 pub fn set_tree<T: Into<crate::model::describe_database_entities_request::DBTreeType>>(
4501 mut self,
4502 v: T,
4503 ) -> Self {
4504 self.0.request.tree = v.into();
4505 self
4506 }
4507
4508 pub fn set_uncommitted<T: Into<bool>>(mut self, v: T) -> Self {
4510 self.0.request.uncommitted = v.into();
4511 self
4512 }
4513
4514 pub fn set_commit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4516 self.0.request.commit_id = v.into();
4517 self
4518 }
4519
4520 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4522 self.0.request.filter = v.into();
4523 self
4524 }
4525
4526 pub fn set_view<T: Into<crate::model::DatabaseEntityView>>(mut self, v: T) -> Self {
4528 self.0.request.view = v.into();
4529 self
4530 }
4531 }
4532
4533 #[doc(hidden)]
4534 impl gax::options::internal::RequestBuilder for DescribeDatabaseEntities {
4535 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4536 &mut self.0.options
4537 }
4538 }
4539
4540 #[derive(Clone, Debug)]
4558 pub struct SearchBackgroundJobs(RequestBuilder<crate::model::SearchBackgroundJobsRequest>);
4559
4560 impl SearchBackgroundJobs {
4561 pub(crate) fn new(
4562 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4563 ) -> Self {
4564 Self(RequestBuilder::new(stub))
4565 }
4566
4567 pub fn with_request<V: Into<crate::model::SearchBackgroundJobsRequest>>(
4569 mut self,
4570 v: V,
4571 ) -> Self {
4572 self.0.request = v.into();
4573 self
4574 }
4575
4576 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4578 self.0.options = v.into();
4579 self
4580 }
4581
4582 pub async fn send(self) -> Result<crate::model::SearchBackgroundJobsResponse> {
4584 (*self.0.stub)
4585 .search_background_jobs(self.0.request, self.0.options)
4586 .await
4587 .map(gax::response::Response::into_body)
4588 }
4589
4590 pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4594 self.0.request.conversion_workspace = v.into();
4595 self
4596 }
4597
4598 pub fn set_return_most_recent_per_job_type<T: Into<bool>>(mut self, v: T) -> Self {
4600 self.0.request.return_most_recent_per_job_type = v.into();
4601 self
4602 }
4603
4604 pub fn set_max_size<T: Into<i32>>(mut self, v: T) -> Self {
4606 self.0.request.max_size = v.into();
4607 self
4608 }
4609
4610 pub fn set_completed_until_time<T>(mut self, v: T) -> Self
4612 where
4613 T: std::convert::Into<wkt::Timestamp>,
4614 {
4615 self.0.request.completed_until_time = std::option::Option::Some(v.into());
4616 self
4617 }
4618
4619 pub fn set_or_clear_completed_until_time<T>(mut self, v: std::option::Option<T>) -> Self
4621 where
4622 T: std::convert::Into<wkt::Timestamp>,
4623 {
4624 self.0.request.completed_until_time = v.map(|x| x.into());
4625 self
4626 }
4627 }
4628
4629 #[doc(hidden)]
4630 impl gax::options::internal::RequestBuilder for SearchBackgroundJobs {
4631 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4632 &mut self.0.options
4633 }
4634 }
4635
4636 #[derive(Clone, Debug)]
4654 pub struct DescribeConversionWorkspaceRevisions(
4655 RequestBuilder<crate::model::DescribeConversionWorkspaceRevisionsRequest>,
4656 );
4657
4658 impl DescribeConversionWorkspaceRevisions {
4659 pub(crate) fn new(
4660 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4661 ) -> Self {
4662 Self(RequestBuilder::new(stub))
4663 }
4664
4665 pub fn with_request<V: Into<crate::model::DescribeConversionWorkspaceRevisionsRequest>>(
4667 mut self,
4668 v: V,
4669 ) -> Self {
4670 self.0.request = v.into();
4671 self
4672 }
4673
4674 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4676 self.0.options = v.into();
4677 self
4678 }
4679
4680 pub async fn send(
4682 self,
4683 ) -> Result<crate::model::DescribeConversionWorkspaceRevisionsResponse> {
4684 (*self.0.stub)
4685 .describe_conversion_workspace_revisions(self.0.request, self.0.options)
4686 .await
4687 .map(gax::response::Response::into_body)
4688 }
4689
4690 pub fn set_conversion_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4694 self.0.request.conversion_workspace = v.into();
4695 self
4696 }
4697
4698 pub fn set_commit_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4700 self.0.request.commit_id = v.into();
4701 self
4702 }
4703 }
4704
4705 #[doc(hidden)]
4706 impl gax::options::internal::RequestBuilder for DescribeConversionWorkspaceRevisions {
4707 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4708 &mut self.0.options
4709 }
4710 }
4711
4712 #[derive(Clone, Debug)]
4730 pub struct FetchStaticIps(RequestBuilder<crate::model::FetchStaticIpsRequest>);
4731
4732 impl FetchStaticIps {
4733 pub(crate) fn new(
4734 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4735 ) -> Self {
4736 Self(RequestBuilder::new(stub))
4737 }
4738
4739 pub fn with_request<V: Into<crate::model::FetchStaticIpsRequest>>(mut self, v: V) -> Self {
4741 self.0.request = v.into();
4742 self
4743 }
4744
4745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4747 self.0.options = v.into();
4748 self
4749 }
4750
4751 pub async fn send(self) -> Result<crate::model::FetchStaticIpsResponse> {
4753 (*self.0.stub)
4754 .fetch_static_ips(self.0.request, self.0.options)
4755 .await
4756 .map(gax::response::Response::into_body)
4757 }
4758
4759 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4763 self.0.request.name = v.into();
4764 self
4765 }
4766
4767 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4769 self.0.request.page_size = v.into();
4770 self
4771 }
4772
4773 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4775 self.0.request.page_token = v.into();
4776 self
4777 }
4778 }
4779
4780 #[doc(hidden)]
4781 impl gax::options::internal::RequestBuilder for FetchStaticIps {
4782 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4783 &mut self.0.options
4784 }
4785 }
4786
4787 #[derive(Clone, Debug)]
4809 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4810
4811 impl ListLocations {
4812 pub(crate) fn new(
4813 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4814 ) -> Self {
4815 Self(RequestBuilder::new(stub))
4816 }
4817
4818 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4820 mut self,
4821 v: V,
4822 ) -> Self {
4823 self.0.request = v.into();
4824 self
4825 }
4826
4827 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4829 self.0.options = v.into();
4830 self
4831 }
4832
4833 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4835 (*self.0.stub)
4836 .list_locations(self.0.request, self.0.options)
4837 .await
4838 .map(gax::response::Response::into_body)
4839 }
4840
4841 pub fn by_page(
4843 self,
4844 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4845 {
4846 use std::clone::Clone;
4847 let token = self.0.request.page_token.clone();
4848 let execute = move |token: String| {
4849 let mut builder = self.clone();
4850 builder.0.request = builder.0.request.set_page_token(token);
4851 builder.send()
4852 };
4853 gax::paginator::internal::new_paginator(token, execute)
4854 }
4855
4856 pub fn by_item(
4858 self,
4859 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4860 {
4861 use gax::paginator::Paginator;
4862 self.by_page().items()
4863 }
4864
4865 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4867 self.0.request.name = v.into();
4868 self
4869 }
4870
4871 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4873 self.0.request.filter = v.into();
4874 self
4875 }
4876
4877 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4879 self.0.request.page_size = v.into();
4880 self
4881 }
4882
4883 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4885 self.0.request.page_token = v.into();
4886 self
4887 }
4888 }
4889
4890 #[doc(hidden)]
4891 impl gax::options::internal::RequestBuilder for ListLocations {
4892 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4893 &mut self.0.options
4894 }
4895 }
4896
4897 #[derive(Clone, Debug)]
4915 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4916
4917 impl GetLocation {
4918 pub(crate) fn new(
4919 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4920 ) -> Self {
4921 Self(RequestBuilder::new(stub))
4922 }
4923
4924 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4926 self.0.request = v.into();
4927 self
4928 }
4929
4930 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4932 self.0.options = v.into();
4933 self
4934 }
4935
4936 pub async fn send(self) -> Result<location::model::Location> {
4938 (*self.0.stub)
4939 .get_location(self.0.request, self.0.options)
4940 .await
4941 .map(gax::response::Response::into_body)
4942 }
4943
4944 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4946 self.0.request.name = v.into();
4947 self
4948 }
4949 }
4950
4951 #[doc(hidden)]
4952 impl gax::options::internal::RequestBuilder for GetLocation {
4953 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4954 &mut self.0.options
4955 }
4956 }
4957
4958 #[derive(Clone, Debug)]
4976 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4977
4978 impl SetIamPolicy {
4979 pub(crate) fn new(
4980 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
4981 ) -> Self {
4982 Self(RequestBuilder::new(stub))
4983 }
4984
4985 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4987 self.0.request = v.into();
4988 self
4989 }
4990
4991 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4993 self.0.options = v.into();
4994 self
4995 }
4996
4997 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4999 (*self.0.stub)
5000 .set_iam_policy(self.0.request, self.0.options)
5001 .await
5002 .map(gax::response::Response::into_body)
5003 }
5004
5005 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5009 self.0.request.resource = v.into();
5010 self
5011 }
5012
5013 pub fn set_policy<T>(mut self, v: T) -> Self
5017 where
5018 T: std::convert::Into<iam_v1::model::Policy>,
5019 {
5020 self.0.request.policy = std::option::Option::Some(v.into());
5021 self
5022 }
5023
5024 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5028 where
5029 T: std::convert::Into<iam_v1::model::Policy>,
5030 {
5031 self.0.request.policy = v.map(|x| x.into());
5032 self
5033 }
5034
5035 pub fn set_update_mask<T>(mut self, v: T) -> Self
5037 where
5038 T: std::convert::Into<wkt::FieldMask>,
5039 {
5040 self.0.request.update_mask = std::option::Option::Some(v.into());
5041 self
5042 }
5043
5044 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5046 where
5047 T: std::convert::Into<wkt::FieldMask>,
5048 {
5049 self.0.request.update_mask = v.map(|x| x.into());
5050 self
5051 }
5052 }
5053
5054 #[doc(hidden)]
5055 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5056 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5057 &mut self.0.options
5058 }
5059 }
5060
5061 #[derive(Clone, Debug)]
5079 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5080
5081 impl GetIamPolicy {
5082 pub(crate) fn new(
5083 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5084 ) -> Self {
5085 Self(RequestBuilder::new(stub))
5086 }
5087
5088 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5090 self.0.request = v.into();
5091 self
5092 }
5093
5094 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5096 self.0.options = v.into();
5097 self
5098 }
5099
5100 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5102 (*self.0.stub)
5103 .get_iam_policy(self.0.request, self.0.options)
5104 .await
5105 .map(gax::response::Response::into_body)
5106 }
5107
5108 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5112 self.0.request.resource = v.into();
5113 self
5114 }
5115
5116 pub fn set_options<T>(mut self, v: T) -> Self
5118 where
5119 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5120 {
5121 self.0.request.options = std::option::Option::Some(v.into());
5122 self
5123 }
5124
5125 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5127 where
5128 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5129 {
5130 self.0.request.options = v.map(|x| x.into());
5131 self
5132 }
5133 }
5134
5135 #[doc(hidden)]
5136 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5137 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5138 &mut self.0.options
5139 }
5140 }
5141
5142 #[derive(Clone, Debug)]
5160 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5161
5162 impl TestIamPermissions {
5163 pub(crate) fn new(
5164 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5165 ) -> Self {
5166 Self(RequestBuilder::new(stub))
5167 }
5168
5169 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5171 mut self,
5172 v: V,
5173 ) -> Self {
5174 self.0.request = v.into();
5175 self
5176 }
5177
5178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5180 self.0.options = v.into();
5181 self
5182 }
5183
5184 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5186 (*self.0.stub)
5187 .test_iam_permissions(self.0.request, self.0.options)
5188 .await
5189 .map(gax::response::Response::into_body)
5190 }
5191
5192 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5196 self.0.request.resource = v.into();
5197 self
5198 }
5199
5200 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5204 where
5205 T: std::iter::IntoIterator<Item = V>,
5206 V: std::convert::Into<std::string::String>,
5207 {
5208 use std::iter::Iterator;
5209 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5210 self
5211 }
5212 }
5213
5214 #[doc(hidden)]
5215 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5216 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5217 &mut self.0.options
5218 }
5219 }
5220
5221 #[derive(Clone, Debug)]
5243 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5244
5245 impl ListOperations {
5246 pub(crate) fn new(
5247 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5248 ) -> Self {
5249 Self(RequestBuilder::new(stub))
5250 }
5251
5252 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5254 mut self,
5255 v: V,
5256 ) -> Self {
5257 self.0.request = v.into();
5258 self
5259 }
5260
5261 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5263 self.0.options = v.into();
5264 self
5265 }
5266
5267 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5269 (*self.0.stub)
5270 .list_operations(self.0.request, self.0.options)
5271 .await
5272 .map(gax::response::Response::into_body)
5273 }
5274
5275 pub fn by_page(
5277 self,
5278 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5279 {
5280 use std::clone::Clone;
5281 let token = self.0.request.page_token.clone();
5282 let execute = move |token: String| {
5283 let mut builder = self.clone();
5284 builder.0.request = builder.0.request.set_page_token(token);
5285 builder.send()
5286 };
5287 gax::paginator::internal::new_paginator(token, execute)
5288 }
5289
5290 pub fn by_item(
5292 self,
5293 ) -> impl gax::paginator::ItemPaginator<
5294 longrunning::model::ListOperationsResponse,
5295 gax::error::Error,
5296 > {
5297 use gax::paginator::Paginator;
5298 self.by_page().items()
5299 }
5300
5301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5303 self.0.request.name = v.into();
5304 self
5305 }
5306
5307 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5309 self.0.request.filter = v.into();
5310 self
5311 }
5312
5313 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5315 self.0.request.page_size = v.into();
5316 self
5317 }
5318
5319 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5321 self.0.request.page_token = v.into();
5322 self
5323 }
5324
5325 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5327 self.0.request.return_partial_success = v.into();
5328 self
5329 }
5330 }
5331
5332 #[doc(hidden)]
5333 impl gax::options::internal::RequestBuilder for ListOperations {
5334 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5335 &mut self.0.options
5336 }
5337 }
5338
5339 #[derive(Clone, Debug)]
5357 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5358
5359 impl GetOperation {
5360 pub(crate) fn new(
5361 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5362 ) -> Self {
5363 Self(RequestBuilder::new(stub))
5364 }
5365
5366 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5368 mut self,
5369 v: V,
5370 ) -> Self {
5371 self.0.request = v.into();
5372 self
5373 }
5374
5375 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5377 self.0.options = v.into();
5378 self
5379 }
5380
5381 pub async fn send(self) -> Result<longrunning::model::Operation> {
5383 (*self.0.stub)
5384 .get_operation(self.0.request, self.0.options)
5385 .await
5386 .map(gax::response::Response::into_body)
5387 }
5388
5389 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5391 self.0.request.name = v.into();
5392 self
5393 }
5394 }
5395
5396 #[doc(hidden)]
5397 impl gax::options::internal::RequestBuilder for GetOperation {
5398 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5399 &mut self.0.options
5400 }
5401 }
5402
5403 #[derive(Clone, Debug)]
5421 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5422
5423 impl DeleteOperation {
5424 pub(crate) fn new(
5425 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5426 ) -> Self {
5427 Self(RequestBuilder::new(stub))
5428 }
5429
5430 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5432 mut self,
5433 v: V,
5434 ) -> Self {
5435 self.0.request = v.into();
5436 self
5437 }
5438
5439 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5441 self.0.options = v.into();
5442 self
5443 }
5444
5445 pub async fn send(self) -> Result<()> {
5447 (*self.0.stub)
5448 .delete_operation(self.0.request, self.0.options)
5449 .await
5450 .map(gax::response::Response::into_body)
5451 }
5452
5453 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5455 self.0.request.name = v.into();
5456 self
5457 }
5458 }
5459
5460 #[doc(hidden)]
5461 impl gax::options::internal::RequestBuilder for DeleteOperation {
5462 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5463 &mut self.0.options
5464 }
5465 }
5466
5467 #[derive(Clone, Debug)]
5485 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5486
5487 impl CancelOperation {
5488 pub(crate) fn new(
5489 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataMigrationService>,
5490 ) -> Self {
5491 Self(RequestBuilder::new(stub))
5492 }
5493
5494 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5496 mut self,
5497 v: V,
5498 ) -> Self {
5499 self.0.request = v.into();
5500 self
5501 }
5502
5503 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5505 self.0.options = v.into();
5506 self
5507 }
5508
5509 pub async fn send(self) -> Result<()> {
5511 (*self.0.stub)
5512 .cancel_operation(self.0.request, self.0.options)
5513 .await
5514 .map(gax::response::Response::into_body)
5515 }
5516
5517 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5519 self.0.request.name = v.into();
5520 self
5521 }
5522 }
5523
5524 #[doc(hidden)]
5525 impl gax::options::internal::RequestBuilder for CancelOperation {
5526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5527 &mut self.0.options
5528 }
5529 }
5530}