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