Skip to main content

google_cloud_clouddms_v1/
client.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18
19/// Implements a client for the Database Migration API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_clouddms_v1::client::DataMigrationService;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// async fn sample(
26///    project_id: &str,
27///    location_id: &str,
28/// ) -> anyhow::Result<()> {
29///     let client = DataMigrationService::builder().build().await?;
30///     let mut list = client.list_migration_jobs()
31///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
32///         .by_item();
33///     while let Some(item) = list.next().await.transpose()? {
34///         println!("{:?}", item);
35///     }
36///     Ok(())
37/// }
38/// ```
39///
40/// # Service Description
41///
42/// Database Migration service
43///
44/// # Configuration
45///
46/// To configure `DataMigrationService` use the `with_*` methods in the type returned
47/// by [builder()][DataMigrationService::builder]. The default configuration should
48/// work for most applications. Common configuration changes include
49///
50/// * [with_endpoint()]: by default this client uses the global default endpoint
51///   (`https://datamigration.googleapis.com`). Applications using regional
52///   endpoints or running in restricted networks (e.g. a network configured
53//    with [Private Google Access with VPC Service Controls]) may want to
54///   override this default.
55/// * [with_credentials()]: by default this client uses
56///   [Application Default Credentials]. Applications using custom
57///   authentication may need to override this default.
58///
59/// [with_endpoint()]: super::builder::data_migration_service::ClientBuilder::with_endpoint
60/// [with_credentials()]: super::builder::data_migration_service::ClientBuilder::with_credentials
61/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
62/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
63///
64/// # Pooling and Cloning
65///
66/// `DataMigrationService` holds a connection pool internally, it is advised to
67/// create one and reuse it. You do not need to wrap `DataMigrationService` in
68/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
69/// already uses an `Arc` internally.
70#[derive(Clone, Debug)]
71pub struct DataMigrationService {
72    inner: std::sync::Arc<dyn super::stub::dynamic::DataMigrationService>,
73}
74
75impl DataMigrationService {
76    /// Returns a builder for [DataMigrationService].
77    ///
78    /// ```
79    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
80    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
81    /// let client = DataMigrationService::builder().build().await?;
82    /// # Ok(()) }
83    /// ```
84    pub fn builder() -> super::builder::data_migration_service::ClientBuilder {
85        crate::new_client_builder(super::builder::data_migration_service::client::Factory)
86    }
87
88    /// Creates a new client from the provided stub.
89    ///
90    /// The most common case for calling this function is in tests mocking the
91    /// client's behavior.
92    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
93    where
94        T: super::stub::DataMigrationService + 'static,
95    {
96        Self { inner: stub.into() }
97    }
98
99    pub(crate) async fn new(
100        config: gaxi::options::ClientConfig,
101    ) -> crate::ClientBuilderResult<Self> {
102        let inner = Self::build_inner(config).await?;
103        Ok(Self { inner })
104    }
105
106    async fn build_inner(
107        conf: gaxi::options::ClientConfig,
108    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataMigrationService>>
109    {
110        if gaxi::options::tracing_enabled(&conf) {
111            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
112        }
113        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
114    }
115
116    async fn build_transport(
117        conf: gaxi::options::ClientConfig,
118    ) -> crate::ClientBuilderResult<impl super::stub::DataMigrationService> {
119        super::transport::DataMigrationService::new(conf).await
120    }
121
122    async fn build_with_tracing(
123        conf: gaxi::options::ClientConfig,
124    ) -> crate::ClientBuilderResult<impl super::stub::DataMigrationService> {
125        Self::build_transport(conf)
126            .await
127            .map(super::tracing::DataMigrationService::new)
128    }
129
130    /// Lists migration jobs in a given project and location.
131    ///
132    /// # Example
133    /// ```
134    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
135    /// use google_cloud_gax::paginator::ItemPaginator as _;
136    /// use google_cloud_clouddms_v1::Result;
137    /// async fn sample(
138    ///    client: &DataMigrationService, project_id: &str, location_id: &str
139    /// ) -> Result<()> {
140    ///     let mut list = client.list_migration_jobs()
141    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
142    ///         .by_item();
143    ///     while let Some(item) = list.next().await.transpose()? {
144    ///         println!("{:?}", item);
145    ///     }
146    ///     Ok(())
147    /// }
148    /// ```
149    pub fn list_migration_jobs(&self) -> super::builder::data_migration_service::ListMigrationJobs {
150        super::builder::data_migration_service::ListMigrationJobs::new(self.inner.clone())
151    }
152
153    /// Gets details of a single migration job.
154    ///
155    /// # Example
156    /// ```
157    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
158    /// use google_cloud_clouddms_v1::Result;
159    /// async fn sample(
160    ///    client: &DataMigrationService, project_id: &str, location_id: &str, migration_job_id: &str
161    /// ) -> Result<()> {
162    ///     let response = client.get_migration_job()
163    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/migrationJobs/{migration_job_id}"))
164    ///         .send().await?;
165    ///     println!("response {:?}", response);
166    ///     Ok(())
167    /// }
168    /// ```
169    pub fn get_migration_job(&self) -> super::builder::data_migration_service::GetMigrationJob {
170        super::builder::data_migration_service::GetMigrationJob::new(self.inner.clone())
171    }
172
173    /// Creates a new migration job in a given project and location.
174    ///
175    /// # Long running operations
176    ///
177    /// This method is used to start, and/or poll a [long-running Operation].
178    /// The [Working with long-running operations] chapter in the [user guide]
179    /// covers these operations in detail.
180    ///
181    /// [long-running operation]: https://google.aip.dev/151
182    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
183    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
184    ///
185    /// # Example
186    /// ```
187    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
188    /// use google_cloud_lro::Poller;
189    /// use google_cloud_clouddms_v1::model::MigrationJob;
190    /// use google_cloud_clouddms_v1::Result;
191    /// async fn sample(
192    ///    client: &DataMigrationService, project_id: &str, location_id: &str
193    /// ) -> Result<()> {
194    ///     let response = client.create_migration_job()
195    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
196    ///         .set_migration_job(
197    ///             MigrationJob::new()/* set fields */
198    ///         )
199    ///         .poller().until_done().await?;
200    ///     println!("response {:?}", response);
201    ///     Ok(())
202    /// }
203    /// ```
204    pub fn create_migration_job(
205        &self,
206    ) -> super::builder::data_migration_service::CreateMigrationJob {
207        super::builder::data_migration_service::CreateMigrationJob::new(self.inner.clone())
208    }
209
210    /// Updates the parameters of a single migration job.
211    ///
212    /// # Long running operations
213    ///
214    /// This method is used to start, and/or poll a [long-running Operation].
215    /// The [Working with long-running operations] chapter in the [user guide]
216    /// covers these operations in detail.
217    ///
218    /// [long-running operation]: https://google.aip.dev/151
219    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
220    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
221    ///
222    /// # Example
223    /// ```
224    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
225    /// use google_cloud_lro::Poller;
226    /// # extern crate wkt as google_cloud_wkt;
227    /// use google_cloud_wkt::FieldMask;
228    /// use google_cloud_clouddms_v1::model::MigrationJob;
229    /// use google_cloud_clouddms_v1::Result;
230    /// async fn sample(
231    ///    client: &DataMigrationService, project_id: &str, location_id: &str, migration_job_id: &str
232    /// ) -> Result<()> {
233    ///     let response = client.update_migration_job()
234    ///         .set_migration_job(
235    ///             MigrationJob::new().set_name(format!("projects/{project_id}/locations/{location_id}/migrationJobs/{migration_job_id}"))/* set fields */
236    ///         )
237    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
238    ///         .poller().until_done().await?;
239    ///     println!("response {:?}", response);
240    ///     Ok(())
241    /// }
242    /// ```
243    pub fn update_migration_job(
244        &self,
245    ) -> super::builder::data_migration_service::UpdateMigrationJob {
246        super::builder::data_migration_service::UpdateMigrationJob::new(self.inner.clone())
247    }
248
249    /// Deletes a single migration job.
250    ///
251    /// # Long running operations
252    ///
253    /// This method is used to start, and/or poll a [long-running Operation].
254    /// The [Working with long-running operations] chapter in the [user guide]
255    /// covers these operations in detail.
256    ///
257    /// [long-running operation]: https://google.aip.dev/151
258    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
259    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
260    ///
261    /// # Example
262    /// ```
263    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
264    /// use google_cloud_lro::Poller;
265    /// use google_cloud_clouddms_v1::Result;
266    /// async fn sample(
267    ///    client: &DataMigrationService, project_id: &str, location_id: &str, migration_job_id: &str
268    /// ) -> Result<()> {
269    ///     client.delete_migration_job()
270    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/migrationJobs/{migration_job_id}"))
271    ///         .poller().until_done().await?;
272    ///     Ok(())
273    /// }
274    /// ```
275    pub fn delete_migration_job(
276        &self,
277    ) -> super::builder::data_migration_service::DeleteMigrationJob {
278        super::builder::data_migration_service::DeleteMigrationJob::new(self.inner.clone())
279    }
280
281    /// Start an already created migration job.
282    ///
283    /// # Long running operations
284    ///
285    /// This method is used to start, and/or poll a [long-running Operation].
286    /// The [Working with long-running operations] chapter in the [user guide]
287    /// covers these operations in detail.
288    ///
289    /// [long-running operation]: https://google.aip.dev/151
290    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
291    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
292    ///
293    /// # Example
294    /// ```
295    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
296    /// use google_cloud_lro::Poller;
297    /// use google_cloud_clouddms_v1::Result;
298    /// async fn sample(
299    ///    client: &DataMigrationService
300    /// ) -> Result<()> {
301    ///     let response = client.start_migration_job()
302    ///         /* set fields */
303    ///         .poller().until_done().await?;
304    ///     println!("response {:?}", response);
305    ///     Ok(())
306    /// }
307    /// ```
308    pub fn start_migration_job(&self) -> super::builder::data_migration_service::StartMigrationJob {
309        super::builder::data_migration_service::StartMigrationJob::new(self.inner.clone())
310    }
311
312    /// Stops a running migration job.
313    ///
314    /// # Long running operations
315    ///
316    /// This method is used to start, and/or poll a [long-running Operation].
317    /// The [Working with long-running operations] chapter in the [user guide]
318    /// covers these operations in detail.
319    ///
320    /// [long-running operation]: https://google.aip.dev/151
321    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
322    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
323    ///
324    /// # Example
325    /// ```
326    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
327    /// use google_cloud_lro::Poller;
328    /// use google_cloud_clouddms_v1::Result;
329    /// async fn sample(
330    ///    client: &DataMigrationService
331    /// ) -> Result<()> {
332    ///     let response = client.stop_migration_job()
333    ///         /* set fields */
334    ///         .poller().until_done().await?;
335    ///     println!("response {:?}", response);
336    ///     Ok(())
337    /// }
338    /// ```
339    pub fn stop_migration_job(&self) -> super::builder::data_migration_service::StopMigrationJob {
340        super::builder::data_migration_service::StopMigrationJob::new(self.inner.clone())
341    }
342
343    /// Resume a migration job that is currently stopped and is resumable (was
344    /// stopped during CDC phase).
345    ///
346    /// # Long running operations
347    ///
348    /// This method is used to start, and/or poll a [long-running Operation].
349    /// The [Working with long-running operations] chapter in the [user guide]
350    /// covers these operations in detail.
351    ///
352    /// [long-running operation]: https://google.aip.dev/151
353    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
354    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
355    ///
356    /// # Example
357    /// ```
358    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
359    /// use google_cloud_lro::Poller;
360    /// use google_cloud_clouddms_v1::Result;
361    /// async fn sample(
362    ///    client: &DataMigrationService
363    /// ) -> Result<()> {
364    ///     let response = client.resume_migration_job()
365    ///         /* set fields */
366    ///         .poller().until_done().await?;
367    ///     println!("response {:?}", response);
368    ///     Ok(())
369    /// }
370    /// ```
371    pub fn resume_migration_job(
372        &self,
373    ) -> super::builder::data_migration_service::ResumeMigrationJob {
374        super::builder::data_migration_service::ResumeMigrationJob::new(self.inner.clone())
375    }
376
377    /// Promote a migration job, stopping replication to the destination and
378    /// promoting the destination to be a standalone database.
379    ///
380    /// # Long running operations
381    ///
382    /// This method is used to start, and/or poll a [long-running Operation].
383    /// The [Working with long-running operations] chapter in the [user guide]
384    /// covers these operations in detail.
385    ///
386    /// [long-running operation]: https://google.aip.dev/151
387    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
388    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
389    ///
390    /// # Example
391    /// ```
392    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
393    /// use google_cloud_lro::Poller;
394    /// use google_cloud_clouddms_v1::Result;
395    /// async fn sample(
396    ///    client: &DataMigrationService
397    /// ) -> Result<()> {
398    ///     let response = client.promote_migration_job()
399    ///         /* set fields */
400    ///         .poller().until_done().await?;
401    ///     println!("response {:?}", response);
402    ///     Ok(())
403    /// }
404    /// ```
405    pub fn promote_migration_job(
406        &self,
407    ) -> super::builder::data_migration_service::PromoteMigrationJob {
408        super::builder::data_migration_service::PromoteMigrationJob::new(self.inner.clone())
409    }
410
411    /// Verify a migration job, making sure the destination can reach the source
412    /// and that all configuration and prerequisites are met.
413    ///
414    /// # Long running operations
415    ///
416    /// This method is used to start, and/or poll a [long-running Operation].
417    /// The [Working with long-running operations] chapter in the [user guide]
418    /// covers these operations in detail.
419    ///
420    /// [long-running operation]: https://google.aip.dev/151
421    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
422    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
423    ///
424    /// # Example
425    /// ```
426    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
427    /// use google_cloud_lro::Poller;
428    /// use google_cloud_clouddms_v1::Result;
429    /// async fn sample(
430    ///    client: &DataMigrationService
431    /// ) -> Result<()> {
432    ///     let response = client.verify_migration_job()
433    ///         /* set fields */
434    ///         .poller().until_done().await?;
435    ///     println!("response {:?}", response);
436    ///     Ok(())
437    /// }
438    /// ```
439    pub fn verify_migration_job(
440        &self,
441    ) -> super::builder::data_migration_service::VerifyMigrationJob {
442        super::builder::data_migration_service::VerifyMigrationJob::new(self.inner.clone())
443    }
444
445    /// Restart a stopped or failed migration job, resetting the destination
446    /// instance to its original state and starting the migration process from
447    /// scratch.
448    ///
449    /// # Long running operations
450    ///
451    /// This method is used to start, and/or poll a [long-running Operation].
452    /// The [Working with long-running operations] chapter in the [user guide]
453    /// covers these operations in detail.
454    ///
455    /// [long-running operation]: https://google.aip.dev/151
456    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
457    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
458    ///
459    /// # Example
460    /// ```
461    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
462    /// use google_cloud_lro::Poller;
463    /// use google_cloud_clouddms_v1::Result;
464    /// async fn sample(
465    ///    client: &DataMigrationService
466    /// ) -> Result<()> {
467    ///     let response = client.restart_migration_job()
468    ///         /* set fields */
469    ///         .poller().until_done().await?;
470    ///     println!("response {:?}", response);
471    ///     Ok(())
472    /// }
473    /// ```
474    pub fn restart_migration_job(
475        &self,
476    ) -> super::builder::data_migration_service::RestartMigrationJob {
477        super::builder::data_migration_service::RestartMigrationJob::new(self.inner.clone())
478    }
479
480    /// Generate a SSH configuration script to configure the reverse SSH
481    /// connectivity.
482    ///
483    /// # Example
484    /// ```
485    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
486    /// use google_cloud_clouddms_v1::Result;
487    /// async fn sample(
488    ///    client: &DataMigrationService
489    /// ) -> Result<()> {
490    ///     let response = client.generate_ssh_script()
491    ///         /* set fields */
492    ///         .send().await?;
493    ///     println!("response {:?}", response);
494    ///     Ok(())
495    /// }
496    /// ```
497    pub fn generate_ssh_script(&self) -> super::builder::data_migration_service::GenerateSshScript {
498        super::builder::data_migration_service::GenerateSshScript::new(self.inner.clone())
499    }
500
501    /// Generate a TCP Proxy configuration script to configure a cloud-hosted VM
502    /// running a TCP Proxy.
503    ///
504    /// # Example
505    /// ```
506    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
507    /// use google_cloud_clouddms_v1::Result;
508    /// async fn sample(
509    ///    client: &DataMigrationService
510    /// ) -> Result<()> {
511    ///     let response = client.generate_tcp_proxy_script()
512    ///         /* set fields */
513    ///         .send().await?;
514    ///     println!("response {:?}", response);
515    ///     Ok(())
516    /// }
517    /// ```
518    pub fn generate_tcp_proxy_script(
519        &self,
520    ) -> super::builder::data_migration_service::GenerateTcpProxyScript {
521        super::builder::data_migration_service::GenerateTcpProxyScript::new(self.inner.clone())
522    }
523
524    /// Retrieves a list of all connection profiles in a given project and
525    /// location.
526    ///
527    /// # Example
528    /// ```
529    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
530    /// use google_cloud_gax::paginator::ItemPaginator as _;
531    /// use google_cloud_clouddms_v1::Result;
532    /// async fn sample(
533    ///    client: &DataMigrationService, project_id: &str, location_id: &str
534    /// ) -> Result<()> {
535    ///     let mut list = client.list_connection_profiles()
536    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
537    ///         .by_item();
538    ///     while let Some(item) = list.next().await.transpose()? {
539    ///         println!("{:?}", item);
540    ///     }
541    ///     Ok(())
542    /// }
543    /// ```
544    pub fn list_connection_profiles(
545        &self,
546    ) -> super::builder::data_migration_service::ListConnectionProfiles {
547        super::builder::data_migration_service::ListConnectionProfiles::new(self.inner.clone())
548    }
549
550    /// Gets details of a single connection profile.
551    ///
552    /// # Example
553    /// ```
554    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
555    /// use google_cloud_clouddms_v1::Result;
556    /// async fn sample(
557    ///    client: &DataMigrationService, project_id: &str, location_id: &str, connection_profile_id: &str
558    /// ) -> Result<()> {
559    ///     let response = client.get_connection_profile()
560    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"))
561    ///         .send().await?;
562    ///     println!("response {:?}", response);
563    ///     Ok(())
564    /// }
565    /// ```
566    pub fn get_connection_profile(
567        &self,
568    ) -> super::builder::data_migration_service::GetConnectionProfile {
569        super::builder::data_migration_service::GetConnectionProfile::new(self.inner.clone())
570    }
571
572    /// Creates a new connection profile in a given project and location.
573    ///
574    /// # Long running operations
575    ///
576    /// This method is used to start, and/or poll a [long-running Operation].
577    /// The [Working with long-running operations] chapter in the [user guide]
578    /// covers these operations in detail.
579    ///
580    /// [long-running operation]: https://google.aip.dev/151
581    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
582    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
583    ///
584    /// # Example
585    /// ```
586    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
587    /// use google_cloud_lro::Poller;
588    /// use google_cloud_clouddms_v1::model::ConnectionProfile;
589    /// use google_cloud_clouddms_v1::Result;
590    /// async fn sample(
591    ///    client: &DataMigrationService, project_id: &str, location_id: &str
592    /// ) -> Result<()> {
593    ///     let response = client.create_connection_profile()
594    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
595    ///         .set_connection_profile(
596    ///             ConnectionProfile::new()/* set fields */
597    ///         )
598    ///         .poller().until_done().await?;
599    ///     println!("response {:?}", response);
600    ///     Ok(())
601    /// }
602    /// ```
603    pub fn create_connection_profile(
604        &self,
605    ) -> super::builder::data_migration_service::CreateConnectionProfile {
606        super::builder::data_migration_service::CreateConnectionProfile::new(self.inner.clone())
607    }
608
609    /// Update the configuration of a single connection profile.
610    ///
611    /// # Long running operations
612    ///
613    /// This method is used to start, and/or poll a [long-running Operation].
614    /// The [Working with long-running operations] chapter in the [user guide]
615    /// covers these operations in detail.
616    ///
617    /// [long-running operation]: https://google.aip.dev/151
618    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
619    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
620    ///
621    /// # Example
622    /// ```
623    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
624    /// use google_cloud_lro::Poller;
625    /// # extern crate wkt as google_cloud_wkt;
626    /// use google_cloud_wkt::FieldMask;
627    /// use google_cloud_clouddms_v1::model::ConnectionProfile;
628    /// use google_cloud_clouddms_v1::Result;
629    /// async fn sample(
630    ///    client: &DataMigrationService, project_id: &str, location_id: &str, connection_profile_id: &str
631    /// ) -> Result<()> {
632    ///     let response = client.update_connection_profile()
633    ///         .set_connection_profile(
634    ///             ConnectionProfile::new().set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"))/* set fields */
635    ///         )
636    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
637    ///         .poller().until_done().await?;
638    ///     println!("response {:?}", response);
639    ///     Ok(())
640    /// }
641    /// ```
642    pub fn update_connection_profile(
643        &self,
644    ) -> super::builder::data_migration_service::UpdateConnectionProfile {
645        super::builder::data_migration_service::UpdateConnectionProfile::new(self.inner.clone())
646    }
647
648    /// Deletes a single Database Migration Service connection profile.
649    /// A connection profile can only be deleted if it is not in use by any
650    /// active migration jobs.
651    ///
652    /// # Long running operations
653    ///
654    /// This method is used to start, and/or poll a [long-running Operation].
655    /// The [Working with long-running operations] chapter in the [user guide]
656    /// covers these operations in detail.
657    ///
658    /// [long-running operation]: https://google.aip.dev/151
659    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
660    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
661    ///
662    /// # Example
663    /// ```
664    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
665    /// use google_cloud_lro::Poller;
666    /// use google_cloud_clouddms_v1::Result;
667    /// async fn sample(
668    ///    client: &DataMigrationService, project_id: &str, location_id: &str, connection_profile_id: &str
669    /// ) -> Result<()> {
670    ///     client.delete_connection_profile()
671    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"))
672    ///         .poller().until_done().await?;
673    ///     Ok(())
674    /// }
675    /// ```
676    pub fn delete_connection_profile(
677        &self,
678    ) -> super::builder::data_migration_service::DeleteConnectionProfile {
679        super::builder::data_migration_service::DeleteConnectionProfile::new(self.inner.clone())
680    }
681
682    /// Creates a new private connection in a given project and location.
683    ///
684    /// # Long running operations
685    ///
686    /// This method is used to start, and/or poll a [long-running Operation].
687    /// The [Working with long-running operations] chapter in the [user guide]
688    /// covers these operations in detail.
689    ///
690    /// [long-running operation]: https://google.aip.dev/151
691    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
692    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
693    ///
694    /// # Example
695    /// ```
696    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
697    /// use google_cloud_lro::Poller;
698    /// use google_cloud_clouddms_v1::model::PrivateConnection;
699    /// use google_cloud_clouddms_v1::Result;
700    /// async fn sample(
701    ///    client: &DataMigrationService, project_id: &str, location_id: &str
702    /// ) -> Result<()> {
703    ///     let response = client.create_private_connection()
704    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
705    ///         .set_private_connection(
706    ///             PrivateConnection::new()/* set fields */
707    ///         )
708    ///         .poller().until_done().await?;
709    ///     println!("response {:?}", response);
710    ///     Ok(())
711    /// }
712    /// ```
713    pub fn create_private_connection(
714        &self,
715    ) -> super::builder::data_migration_service::CreatePrivateConnection {
716        super::builder::data_migration_service::CreatePrivateConnection::new(self.inner.clone())
717    }
718
719    /// Gets details of a single private connection.
720    ///
721    /// # Example
722    /// ```
723    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
724    /// use google_cloud_clouddms_v1::Result;
725    /// async fn sample(
726    ///    client: &DataMigrationService, project_id: &str, location_id: &str, private_connection_id: &str
727    /// ) -> Result<()> {
728    ///     let response = client.get_private_connection()
729    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"))
730    ///         .send().await?;
731    ///     println!("response {:?}", response);
732    ///     Ok(())
733    /// }
734    /// ```
735    pub fn get_private_connection(
736        &self,
737    ) -> super::builder::data_migration_service::GetPrivateConnection {
738        super::builder::data_migration_service::GetPrivateConnection::new(self.inner.clone())
739    }
740
741    /// Retrieves a list of private connections in a given project and location.
742    ///
743    /// # Example
744    /// ```
745    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
746    /// use google_cloud_gax::paginator::ItemPaginator as _;
747    /// use google_cloud_clouddms_v1::Result;
748    /// async fn sample(
749    ///    client: &DataMigrationService, project_id: &str, location_id: &str
750    /// ) -> Result<()> {
751    ///     let mut list = client.list_private_connections()
752    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
753    ///         .by_item();
754    ///     while let Some(item) = list.next().await.transpose()? {
755    ///         println!("{:?}", item);
756    ///     }
757    ///     Ok(())
758    /// }
759    /// ```
760    pub fn list_private_connections(
761        &self,
762    ) -> super::builder::data_migration_service::ListPrivateConnections {
763        super::builder::data_migration_service::ListPrivateConnections::new(self.inner.clone())
764    }
765
766    /// Deletes a single Database Migration Service private connection.
767    ///
768    /// # Long running operations
769    ///
770    /// This method is used to start, and/or poll a [long-running Operation].
771    /// The [Working with long-running operations] chapter in the [user guide]
772    /// covers these operations in detail.
773    ///
774    /// [long-running operation]: https://google.aip.dev/151
775    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
776    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
777    ///
778    /// # Example
779    /// ```
780    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
781    /// use google_cloud_lro::Poller;
782    /// use google_cloud_clouddms_v1::Result;
783    /// async fn sample(
784    ///    client: &DataMigrationService, project_id: &str, location_id: &str, private_connection_id: &str
785    /// ) -> Result<()> {
786    ///     client.delete_private_connection()
787    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"))
788    ///         .poller().until_done().await?;
789    ///     Ok(())
790    /// }
791    /// ```
792    pub fn delete_private_connection(
793        &self,
794    ) -> super::builder::data_migration_service::DeletePrivateConnection {
795        super::builder::data_migration_service::DeletePrivateConnection::new(self.inner.clone())
796    }
797
798    /// Gets details of a single conversion workspace.
799    ///
800    /// # Example
801    /// ```
802    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
803    /// use google_cloud_clouddms_v1::Result;
804    /// async fn sample(
805    ///    client: &DataMigrationService, project_id: &str, location_id: &str, conversion_workspace_id: &str
806    /// ) -> Result<()> {
807    ///     let response = client.get_conversion_workspace()
808    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/conversionWorkspaces/{conversion_workspace_id}"))
809    ///         .send().await?;
810    ///     println!("response {:?}", response);
811    ///     Ok(())
812    /// }
813    /// ```
814    pub fn get_conversion_workspace(
815        &self,
816    ) -> super::builder::data_migration_service::GetConversionWorkspace {
817        super::builder::data_migration_service::GetConversionWorkspace::new(self.inner.clone())
818    }
819
820    /// Lists conversion workspaces in a given project and location.
821    ///
822    /// # Example
823    /// ```
824    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
825    /// use google_cloud_gax::paginator::ItemPaginator as _;
826    /// use google_cloud_clouddms_v1::Result;
827    /// async fn sample(
828    ///    client: &DataMigrationService, project_id: &str, location_id: &str
829    /// ) -> Result<()> {
830    ///     let mut list = client.list_conversion_workspaces()
831    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
832    ///         .by_item();
833    ///     while let Some(item) = list.next().await.transpose()? {
834    ///         println!("{:?}", item);
835    ///     }
836    ///     Ok(())
837    /// }
838    /// ```
839    pub fn list_conversion_workspaces(
840        &self,
841    ) -> super::builder::data_migration_service::ListConversionWorkspaces {
842        super::builder::data_migration_service::ListConversionWorkspaces::new(self.inner.clone())
843    }
844
845    /// Creates a new conversion workspace in a given project and location.
846    ///
847    /// # Long running operations
848    ///
849    /// This method is used to start, and/or poll a [long-running Operation].
850    /// The [Working with long-running operations] chapter in the [user guide]
851    /// covers these operations in detail.
852    ///
853    /// [long-running operation]: https://google.aip.dev/151
854    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
855    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
856    ///
857    /// # Example
858    /// ```
859    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
860    /// use google_cloud_lro::Poller;
861    /// use google_cloud_clouddms_v1::model::ConversionWorkspace;
862    /// use google_cloud_clouddms_v1::Result;
863    /// async fn sample(
864    ///    client: &DataMigrationService, project_id: &str, location_id: &str
865    /// ) -> Result<()> {
866    ///     let response = client.create_conversion_workspace()
867    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
868    ///         .set_conversion_workspace(
869    ///             ConversionWorkspace::new()/* set fields */
870    ///         )
871    ///         .poller().until_done().await?;
872    ///     println!("response {:?}", response);
873    ///     Ok(())
874    /// }
875    /// ```
876    pub fn create_conversion_workspace(
877        &self,
878    ) -> super::builder::data_migration_service::CreateConversionWorkspace {
879        super::builder::data_migration_service::CreateConversionWorkspace::new(self.inner.clone())
880    }
881
882    /// Updates the parameters of a single conversion workspace.
883    ///
884    /// # Long running operations
885    ///
886    /// This method is used to start, and/or poll a [long-running Operation].
887    /// The [Working with long-running operations] chapter in the [user guide]
888    /// covers these operations in detail.
889    ///
890    /// [long-running operation]: https://google.aip.dev/151
891    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
892    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
893    ///
894    /// # Example
895    /// ```
896    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
897    /// use google_cloud_lro::Poller;
898    /// # extern crate wkt as google_cloud_wkt;
899    /// use google_cloud_wkt::FieldMask;
900    /// use google_cloud_clouddms_v1::model::ConversionWorkspace;
901    /// use google_cloud_clouddms_v1::Result;
902    /// async fn sample(
903    ///    client: &DataMigrationService, project_id: &str, location_id: &str, conversion_workspace_id: &str
904    /// ) -> Result<()> {
905    ///     let response = client.update_conversion_workspace()
906    ///         .set_conversion_workspace(
907    ///             ConversionWorkspace::new().set_name(format!("projects/{project_id}/locations/{location_id}/conversionWorkspaces/{conversion_workspace_id}"))/* set fields */
908    ///         )
909    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
910    ///         .poller().until_done().await?;
911    ///     println!("response {:?}", response);
912    ///     Ok(())
913    /// }
914    /// ```
915    pub fn update_conversion_workspace(
916        &self,
917    ) -> super::builder::data_migration_service::UpdateConversionWorkspace {
918        super::builder::data_migration_service::UpdateConversionWorkspace::new(self.inner.clone())
919    }
920
921    /// Deletes a single conversion workspace.
922    ///
923    /// # Long running operations
924    ///
925    /// This method is used to start, and/or poll a [long-running Operation].
926    /// The [Working with long-running operations] chapter in the [user guide]
927    /// covers these operations in detail.
928    ///
929    /// [long-running operation]: https://google.aip.dev/151
930    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
931    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
932    ///
933    /// # Example
934    /// ```
935    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
936    /// use google_cloud_lro::Poller;
937    /// use google_cloud_clouddms_v1::Result;
938    /// async fn sample(
939    ///    client: &DataMigrationService, project_id: &str, location_id: &str, conversion_workspace_id: &str
940    /// ) -> Result<()> {
941    ///     client.delete_conversion_workspace()
942    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/conversionWorkspaces/{conversion_workspace_id}"))
943    ///         .poller().until_done().await?;
944    ///     Ok(())
945    /// }
946    /// ```
947    pub fn delete_conversion_workspace(
948        &self,
949    ) -> super::builder::data_migration_service::DeleteConversionWorkspace {
950        super::builder::data_migration_service::DeleteConversionWorkspace::new(self.inner.clone())
951    }
952
953    /// Creates a new mapping rule for a given conversion workspace.
954    ///
955    /// # Example
956    /// ```
957    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
958    /// use google_cloud_clouddms_v1::model::MappingRule;
959    /// use google_cloud_clouddms_v1::Result;
960    /// async fn sample(
961    ///    client: &DataMigrationService, project_id: &str, location_id: &str, conversion_workspace_id: &str
962    /// ) -> Result<()> {
963    ///     let response = client.create_mapping_rule()
964    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/conversionWorkspaces/{conversion_workspace_id}"))
965    ///         .set_mapping_rule(
966    ///             MappingRule::new()/* set fields */
967    ///         )
968    ///         .send().await?;
969    ///     println!("response {:?}", response);
970    ///     Ok(())
971    /// }
972    /// ```
973    pub fn create_mapping_rule(&self) -> super::builder::data_migration_service::CreateMappingRule {
974        super::builder::data_migration_service::CreateMappingRule::new(self.inner.clone())
975    }
976
977    /// Deletes a single mapping rule.
978    ///
979    /// # Example
980    /// ```
981    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
982    /// use google_cloud_clouddms_v1::Result;
983    /// async fn sample(
984    ///    client: &DataMigrationService
985    /// ) -> Result<()> {
986    ///     client.delete_mapping_rule()
987    ///         /* set fields */
988    ///         .send().await?;
989    ///     Ok(())
990    /// }
991    /// ```
992    pub fn delete_mapping_rule(&self) -> super::builder::data_migration_service::DeleteMappingRule {
993        super::builder::data_migration_service::DeleteMappingRule::new(self.inner.clone())
994    }
995
996    /// Lists the mapping rules for a specific conversion workspace.
997    ///
998    /// # Example
999    /// ```
1000    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1001    /// use google_cloud_gax::paginator::ItemPaginator as _;
1002    /// use google_cloud_clouddms_v1::Result;
1003    /// async fn sample(
1004    ///    client: &DataMigrationService, project_id: &str, location_id: &str, conversion_workspace_id: &str
1005    /// ) -> Result<()> {
1006    ///     let mut list = client.list_mapping_rules()
1007    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/conversionWorkspaces/{conversion_workspace_id}"))
1008    ///         .by_item();
1009    ///     while let Some(item) = list.next().await.transpose()? {
1010    ///         println!("{:?}", item);
1011    ///     }
1012    ///     Ok(())
1013    /// }
1014    /// ```
1015    pub fn list_mapping_rules(&self) -> super::builder::data_migration_service::ListMappingRules {
1016        super::builder::data_migration_service::ListMappingRules::new(self.inner.clone())
1017    }
1018
1019    /// Gets the details of a mapping rule.
1020    ///
1021    /// # Example
1022    /// ```
1023    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1024    /// use google_cloud_clouddms_v1::Result;
1025    /// async fn sample(
1026    ///    client: &DataMigrationService, project_id: &str, location_id: &str, conversion_workspace_id: &str, mapping_rule_id: &str
1027    /// ) -> Result<()> {
1028    ///     let response = client.get_mapping_rule()
1029    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/conversionWorkspaces/{conversion_workspace_id}/mappingRules/{mapping_rule_id}"))
1030    ///         .send().await?;
1031    ///     println!("response {:?}", response);
1032    ///     Ok(())
1033    /// }
1034    /// ```
1035    pub fn get_mapping_rule(&self) -> super::builder::data_migration_service::GetMappingRule {
1036        super::builder::data_migration_service::GetMappingRule::new(self.inner.clone())
1037    }
1038
1039    /// Imports a snapshot of the source database into the
1040    /// conversion workspace.
1041    ///
1042    /// # Long running operations
1043    ///
1044    /// This method is used to start, and/or poll a [long-running Operation].
1045    /// The [Working with long-running operations] chapter in the [user guide]
1046    /// covers these operations in detail.
1047    ///
1048    /// [long-running operation]: https://google.aip.dev/151
1049    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1050    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1051    ///
1052    /// # Example
1053    /// ```
1054    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1055    /// use google_cloud_lro::Poller;
1056    /// use google_cloud_clouddms_v1::Result;
1057    /// async fn sample(
1058    ///    client: &DataMigrationService
1059    /// ) -> Result<()> {
1060    ///     let response = client.seed_conversion_workspace()
1061    ///         /* set fields */
1062    ///         .poller().until_done().await?;
1063    ///     println!("response {:?}", response);
1064    ///     Ok(())
1065    /// }
1066    /// ```
1067    pub fn seed_conversion_workspace(
1068        &self,
1069    ) -> super::builder::data_migration_service::SeedConversionWorkspace {
1070        super::builder::data_migration_service::SeedConversionWorkspace::new(self.inner.clone())
1071    }
1072
1073    /// Imports the mapping rules for a given conversion workspace.
1074    /// Supports various formats of external rules files.
1075    ///
1076    /// # Long running operations
1077    ///
1078    /// This method is used to start, and/or poll a [long-running Operation].
1079    /// The [Working with long-running operations] chapter in the [user guide]
1080    /// covers these operations in detail.
1081    ///
1082    /// [long-running operation]: https://google.aip.dev/151
1083    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1084    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1085    ///
1086    /// # Example
1087    /// ```
1088    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1089    /// use google_cloud_lro::Poller;
1090    /// use google_cloud_clouddms_v1::Result;
1091    /// async fn sample(
1092    ///    client: &DataMigrationService
1093    /// ) -> Result<()> {
1094    ///     let response = client.import_mapping_rules()
1095    ///         /* set fields */
1096    ///         .poller().until_done().await?;
1097    ///     println!("response {:?}", response);
1098    ///     Ok(())
1099    /// }
1100    /// ```
1101    pub fn import_mapping_rules(
1102        &self,
1103    ) -> super::builder::data_migration_service::ImportMappingRules {
1104        super::builder::data_migration_service::ImportMappingRules::new(self.inner.clone())
1105    }
1106
1107    /// Creates a draft tree schema for the destination database.
1108    ///
1109    /// # Long running operations
1110    ///
1111    /// This method is used to start, and/or poll a [long-running Operation].
1112    /// The [Working with long-running operations] chapter in the [user guide]
1113    /// covers these operations in detail.
1114    ///
1115    /// [long-running operation]: https://google.aip.dev/151
1116    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1117    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1118    ///
1119    /// # Example
1120    /// ```
1121    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1122    /// use google_cloud_lro::Poller;
1123    /// use google_cloud_clouddms_v1::Result;
1124    /// async fn sample(
1125    ///    client: &DataMigrationService
1126    /// ) -> Result<()> {
1127    ///     let response = client.convert_conversion_workspace()
1128    ///         /* set fields */
1129    ///         .poller().until_done().await?;
1130    ///     println!("response {:?}", response);
1131    ///     Ok(())
1132    /// }
1133    /// ```
1134    pub fn convert_conversion_workspace(
1135        &self,
1136    ) -> super::builder::data_migration_service::ConvertConversionWorkspace {
1137        super::builder::data_migration_service::ConvertConversionWorkspace::new(self.inner.clone())
1138    }
1139
1140    /// Marks all the data in the conversion workspace as committed.
1141    ///
1142    /// # Long running operations
1143    ///
1144    /// This method is used to start, and/or poll a [long-running Operation].
1145    /// The [Working with long-running operations] chapter in the [user guide]
1146    /// covers these operations in detail.
1147    ///
1148    /// [long-running operation]: https://google.aip.dev/151
1149    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1150    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1151    ///
1152    /// # Example
1153    /// ```
1154    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1155    /// use google_cloud_lro::Poller;
1156    /// use google_cloud_clouddms_v1::Result;
1157    /// async fn sample(
1158    ///    client: &DataMigrationService
1159    /// ) -> Result<()> {
1160    ///     let response = client.commit_conversion_workspace()
1161    ///         /* set fields */
1162    ///         .poller().until_done().await?;
1163    ///     println!("response {:?}", response);
1164    ///     Ok(())
1165    /// }
1166    /// ```
1167    pub fn commit_conversion_workspace(
1168        &self,
1169    ) -> super::builder::data_migration_service::CommitConversionWorkspace {
1170        super::builder::data_migration_service::CommitConversionWorkspace::new(self.inner.clone())
1171    }
1172
1173    /// Rolls back a conversion workspace to the last committed snapshot.
1174    ///
1175    /// # Long running operations
1176    ///
1177    /// This method is used to start, and/or poll a [long-running Operation].
1178    /// The [Working with long-running operations] chapter in the [user guide]
1179    /// covers these operations in detail.
1180    ///
1181    /// [long-running operation]: https://google.aip.dev/151
1182    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1183    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1184    ///
1185    /// # Example
1186    /// ```
1187    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1188    /// use google_cloud_lro::Poller;
1189    /// use google_cloud_clouddms_v1::Result;
1190    /// async fn sample(
1191    ///    client: &DataMigrationService
1192    /// ) -> Result<()> {
1193    ///     let response = client.rollback_conversion_workspace()
1194    ///         /* set fields */
1195    ///         .poller().until_done().await?;
1196    ///     println!("response {:?}", response);
1197    ///     Ok(())
1198    /// }
1199    /// ```
1200    pub fn rollback_conversion_workspace(
1201        &self,
1202    ) -> super::builder::data_migration_service::RollbackConversionWorkspace {
1203        super::builder::data_migration_service::RollbackConversionWorkspace::new(self.inner.clone())
1204    }
1205
1206    /// Applies draft tree onto a specific destination database.
1207    ///
1208    /// # Long running operations
1209    ///
1210    /// This method is used to start, and/or poll a [long-running Operation].
1211    /// The [Working with long-running operations] chapter in the [user guide]
1212    /// covers these operations in detail.
1213    ///
1214    /// [long-running operation]: https://google.aip.dev/151
1215    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1216    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1217    ///
1218    /// # Example
1219    /// ```
1220    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1221    /// use google_cloud_lro::Poller;
1222    /// use google_cloud_clouddms_v1::Result;
1223    /// async fn sample(
1224    ///    client: &DataMigrationService
1225    /// ) -> Result<()> {
1226    ///     let response = client.apply_conversion_workspace()
1227    ///         /* set fields */
1228    ///         .poller().until_done().await?;
1229    ///     println!("response {:?}", response);
1230    ///     Ok(())
1231    /// }
1232    /// ```
1233    pub fn apply_conversion_workspace(
1234        &self,
1235    ) -> super::builder::data_migration_service::ApplyConversionWorkspace {
1236        super::builder::data_migration_service::ApplyConversionWorkspace::new(self.inner.clone())
1237    }
1238
1239    /// Describes the database entities tree for a specific conversion workspace
1240    /// and a specific tree type.
1241    ///
1242    /// Database entities are not resources like conversion workspaces or mapping
1243    /// rules, and they can't be created, updated or deleted. Instead, they are
1244    /// simple data objects describing the structure of the client database.
1245    ///
1246    /// # Example
1247    /// ```
1248    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1249    /// use google_cloud_gax::paginator::ItemPaginator as _;
1250    /// use google_cloud_clouddms_v1::Result;
1251    /// async fn sample(
1252    ///    client: &DataMigrationService
1253    /// ) -> Result<()> {
1254    ///     let mut list = client.describe_database_entities()
1255    ///         /* set fields */
1256    ///         .by_item();
1257    ///     while let Some(item) = list.next().await.transpose()? {
1258    ///         println!("{:?}", item);
1259    ///     }
1260    ///     Ok(())
1261    /// }
1262    /// ```
1263    pub fn describe_database_entities(
1264        &self,
1265    ) -> super::builder::data_migration_service::DescribeDatabaseEntities {
1266        super::builder::data_migration_service::DescribeDatabaseEntities::new(self.inner.clone())
1267    }
1268
1269    /// Searches/lists the background jobs for a specific
1270    /// conversion workspace.
1271    ///
1272    /// The background jobs are not resources like conversion workspaces or
1273    /// mapping rules, and they can't be created, updated or deleted.
1274    /// Instead, they are a way to expose the data plane jobs log.
1275    ///
1276    /// # Example
1277    /// ```
1278    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1279    /// use google_cloud_clouddms_v1::Result;
1280    /// async fn sample(
1281    ///    client: &DataMigrationService
1282    /// ) -> Result<()> {
1283    ///     let response = client.search_background_jobs()
1284    ///         /* set fields */
1285    ///         .send().await?;
1286    ///     println!("response {:?}", response);
1287    ///     Ok(())
1288    /// }
1289    /// ```
1290    pub fn search_background_jobs(
1291        &self,
1292    ) -> super::builder::data_migration_service::SearchBackgroundJobs {
1293        super::builder::data_migration_service::SearchBackgroundJobs::new(self.inner.clone())
1294    }
1295
1296    /// Retrieves a list of committed revisions of a specific conversion
1297    /// workspace.
1298    ///
1299    /// # Example
1300    /// ```
1301    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1302    /// use google_cloud_clouddms_v1::Result;
1303    /// async fn sample(
1304    ///    client: &DataMigrationService
1305    /// ) -> Result<()> {
1306    ///     let response = client.describe_conversion_workspace_revisions()
1307    ///         /* set fields */
1308    ///         .send().await?;
1309    ///     println!("response {:?}", response);
1310    ///     Ok(())
1311    /// }
1312    /// ```
1313    pub fn describe_conversion_workspace_revisions(
1314        &self,
1315    ) -> super::builder::data_migration_service::DescribeConversionWorkspaceRevisions {
1316        super::builder::data_migration_service::DescribeConversionWorkspaceRevisions::new(
1317            self.inner.clone(),
1318        )
1319    }
1320
1321    /// Fetches a set of static IP addresses that need to be allowlisted by the
1322    /// customer when using the static-IP connectivity method.
1323    ///
1324    /// # Example
1325    /// ```
1326    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1327    /// use google_cloud_clouddms_v1::Result;
1328    /// async fn sample(
1329    ///    client: &DataMigrationService
1330    /// ) -> Result<()> {
1331    ///     let response = client.fetch_static_ips()
1332    ///         /* set fields */
1333    ///         .send().await?;
1334    ///     println!("response {:?}", response);
1335    ///     Ok(())
1336    /// }
1337    /// ```
1338    pub fn fetch_static_ips(&self) -> super::builder::data_migration_service::FetchStaticIps {
1339        super::builder::data_migration_service::FetchStaticIps::new(self.inner.clone())
1340    }
1341
1342    /// Lists information about the supported locations for this service.
1343    ///
1344    /// # Example
1345    /// ```
1346    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1347    /// use google_cloud_gax::paginator::ItemPaginator as _;
1348    /// use google_cloud_clouddms_v1::Result;
1349    /// async fn sample(
1350    ///    client: &DataMigrationService
1351    /// ) -> Result<()> {
1352    ///     let mut list = client.list_locations()
1353    ///         /* set fields */
1354    ///         .by_item();
1355    ///     while let Some(item) = list.next().await.transpose()? {
1356    ///         println!("{:?}", item);
1357    ///     }
1358    ///     Ok(())
1359    /// }
1360    /// ```
1361    pub fn list_locations(&self) -> super::builder::data_migration_service::ListLocations {
1362        super::builder::data_migration_service::ListLocations::new(self.inner.clone())
1363    }
1364
1365    /// Gets information about a location.
1366    ///
1367    /// # Example
1368    /// ```
1369    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1370    /// use google_cloud_clouddms_v1::Result;
1371    /// async fn sample(
1372    ///    client: &DataMigrationService
1373    /// ) -> Result<()> {
1374    ///     let response = client.get_location()
1375    ///         /* set fields */
1376    ///         .send().await?;
1377    ///     println!("response {:?}", response);
1378    ///     Ok(())
1379    /// }
1380    /// ```
1381    pub fn get_location(&self) -> super::builder::data_migration_service::GetLocation {
1382        super::builder::data_migration_service::GetLocation::new(self.inner.clone())
1383    }
1384
1385    /// Sets the access control policy on the specified resource. Replaces
1386    /// any existing policy.
1387    ///
1388    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1389    /// errors.
1390    ///
1391    /// # Example
1392    /// ```
1393    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1394    /// use google_cloud_clouddms_v1::Result;
1395    /// async fn sample(
1396    ///    client: &DataMigrationService
1397    /// ) -> Result<()> {
1398    ///     let response = client.set_iam_policy()
1399    ///         /* set fields */
1400    ///         .send().await?;
1401    ///     println!("response {:?}", response);
1402    ///     Ok(())
1403    /// }
1404    /// ```
1405    pub fn set_iam_policy(&self) -> super::builder::data_migration_service::SetIamPolicy {
1406        super::builder::data_migration_service::SetIamPolicy::new(self.inner.clone())
1407    }
1408
1409    /// Gets the access control policy for a resource. Returns an empty policy
1410    /// if the resource exists and does not have a policy set.
1411    ///
1412    /// # Example
1413    /// ```
1414    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1415    /// use google_cloud_clouddms_v1::Result;
1416    /// async fn sample(
1417    ///    client: &DataMigrationService
1418    /// ) -> Result<()> {
1419    ///     let response = client.get_iam_policy()
1420    ///         /* set fields */
1421    ///         .send().await?;
1422    ///     println!("response {:?}", response);
1423    ///     Ok(())
1424    /// }
1425    /// ```
1426    pub fn get_iam_policy(&self) -> super::builder::data_migration_service::GetIamPolicy {
1427        super::builder::data_migration_service::GetIamPolicy::new(self.inner.clone())
1428    }
1429
1430    /// Returns permissions that a caller has on the specified resource. If the
1431    /// resource does not exist, this will return an empty set of
1432    /// permissions, not a `NOT_FOUND` error.
1433    ///
1434    /// Note: This operation is designed to be used for building
1435    /// permission-aware UIs and command-line tools, not for authorization
1436    /// checking. This operation may "fail open" without warning.
1437    ///
1438    /// # Example
1439    /// ```
1440    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1441    /// use google_cloud_clouddms_v1::Result;
1442    /// async fn sample(
1443    ///    client: &DataMigrationService
1444    /// ) -> Result<()> {
1445    ///     let response = client.test_iam_permissions()
1446    ///         /* set fields */
1447    ///         .send().await?;
1448    ///     println!("response {:?}", response);
1449    ///     Ok(())
1450    /// }
1451    /// ```
1452    pub fn test_iam_permissions(
1453        &self,
1454    ) -> super::builder::data_migration_service::TestIamPermissions {
1455        super::builder::data_migration_service::TestIamPermissions::new(self.inner.clone())
1456    }
1457
1458    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1459    ///
1460    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1461    ///
1462    /// # Example
1463    /// ```
1464    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1465    /// use google_cloud_gax::paginator::ItemPaginator as _;
1466    /// use google_cloud_clouddms_v1::Result;
1467    /// async fn sample(
1468    ///    client: &DataMigrationService
1469    /// ) -> Result<()> {
1470    ///     let mut list = client.list_operations()
1471    ///         /* set fields */
1472    ///         .by_item();
1473    ///     while let Some(item) = list.next().await.transpose()? {
1474    ///         println!("{:?}", item);
1475    ///     }
1476    ///     Ok(())
1477    /// }
1478    /// ```
1479    pub fn list_operations(&self) -> super::builder::data_migration_service::ListOperations {
1480        super::builder::data_migration_service::ListOperations::new(self.inner.clone())
1481    }
1482
1483    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1484    ///
1485    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1486    ///
1487    /// # Example
1488    /// ```
1489    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1490    /// use google_cloud_clouddms_v1::Result;
1491    /// async fn sample(
1492    ///    client: &DataMigrationService
1493    /// ) -> Result<()> {
1494    ///     let response = client.get_operation()
1495    ///         /* set fields */
1496    ///         .send().await?;
1497    ///     println!("response {:?}", response);
1498    ///     Ok(())
1499    /// }
1500    /// ```
1501    pub fn get_operation(&self) -> super::builder::data_migration_service::GetOperation {
1502        super::builder::data_migration_service::GetOperation::new(self.inner.clone())
1503    }
1504
1505    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1506    ///
1507    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1508    ///
1509    /// # Example
1510    /// ```
1511    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1512    /// use google_cloud_clouddms_v1::Result;
1513    /// async fn sample(
1514    ///    client: &DataMigrationService
1515    /// ) -> Result<()> {
1516    ///     client.delete_operation()
1517    ///         /* set fields */
1518    ///         .send().await?;
1519    ///     Ok(())
1520    /// }
1521    /// ```
1522    pub fn delete_operation(&self) -> super::builder::data_migration_service::DeleteOperation {
1523        super::builder::data_migration_service::DeleteOperation::new(self.inner.clone())
1524    }
1525
1526    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1527    ///
1528    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1529    ///
1530    /// # Example
1531    /// ```
1532    /// # use google_cloud_clouddms_v1::client::DataMigrationService;
1533    /// use google_cloud_clouddms_v1::Result;
1534    /// async fn sample(
1535    ///    client: &DataMigrationService
1536    /// ) -> Result<()> {
1537    ///     client.cancel_operation()
1538    ///         /* set fields */
1539    ///         .send().await?;
1540    ///     Ok(())
1541    /// }
1542    /// ```
1543    pub fn cancel_operation(&self) -> super::builder::data_migration_service::CancelOperation {
1544        super::builder::data_migration_service::CancelOperation::new(self.inner.clone())
1545    }
1546}