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