google_cloud_dataplex_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 Cloud Dataplex API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// async fn sample(
26/// parent: &str,
27/// ) -> anyhow::Result<()> {
28/// let client = BusinessGlossaryService::builder().build().await?;
29/// let mut list = client.list_glossaries()
30/// .set_parent(parent)
31/// .by_item();
32/// while let Some(item) = list.next().await.transpose()? {
33/// println!("{:?}", item);
34/// }
35/// Ok(())
36/// }
37/// ```
38///
39/// # Service Description
40///
41/// BusinessGlossaryService provides APIs for managing business glossary
42/// resources for enterprise customers.
43/// The resources currently supported in Business Glossary are:
44///
45/// 1. Glossary
46/// 1. GlossaryCategory
47/// 1. GlossaryTerm
48///
49/// # Configuration
50///
51/// To configure `BusinessGlossaryService` use the `with_*` methods in the type returned
52/// by [builder()][BusinessGlossaryService::builder]. The default configuration should
53/// work for most applications. Common configuration changes include
54///
55/// * [with_endpoint()]: by default this client uses the global default endpoint
56/// (`https://dataplex.googleapis.com`). Applications using regional
57/// endpoints or running in restricted networks (e.g. a network configured
58// with [Private Google Access with VPC Service Controls]) may want to
59/// override this default.
60/// * [with_credentials()]: by default this client uses
61/// [Application Default Credentials]. Applications using custom
62/// authentication may need to override this default.
63///
64/// [with_endpoint()]: super::builder::business_glossary_service::ClientBuilder::with_endpoint
65/// [with_credentials()]: super::builder::business_glossary_service::ClientBuilder::with_credentials
66/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
67/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
68///
69/// # Pooling and Cloning
70///
71/// `BusinessGlossaryService` holds a connection pool internally, it is advised to
72/// create one and reuse it. You do not need to wrap `BusinessGlossaryService` in
73/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
74/// already uses an `Arc` internally.
75#[derive(Clone, Debug)]
76pub struct BusinessGlossaryService {
77 inner: std::sync::Arc<dyn super::stub::dynamic::BusinessGlossaryService>,
78}
79
80impl BusinessGlossaryService {
81 /// Returns a builder for [BusinessGlossaryService].
82 ///
83 /// ```
84 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
85 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
86 /// let client = BusinessGlossaryService::builder().build().await?;
87 /// # Ok(()) }
88 /// ```
89 pub fn builder() -> super::builder::business_glossary_service::ClientBuilder {
90 crate::new_client_builder(super::builder::business_glossary_service::client::Factory)
91 }
92
93 /// Creates a new client from the provided stub.
94 ///
95 /// The most common case for calling this function is in tests mocking the
96 /// client's behavior.
97 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
98 where
99 T: super::stub::BusinessGlossaryService + 'static,
100 {
101 Self { inner: stub.into() }
102 }
103
104 pub(crate) async fn new(
105 config: gaxi::options::ClientConfig,
106 ) -> crate::ClientBuilderResult<Self> {
107 let inner = Self::build_inner(config).await?;
108 Ok(Self { inner })
109 }
110
111 async fn build_inner(
112 conf: gaxi::options::ClientConfig,
113 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BusinessGlossaryService>>
114 {
115 if gaxi::options::tracing_enabled(&conf) {
116 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
117 }
118 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
119 }
120
121 async fn build_transport(
122 conf: gaxi::options::ClientConfig,
123 ) -> crate::ClientBuilderResult<impl super::stub::BusinessGlossaryService> {
124 super::transport::BusinessGlossaryService::new(conf).await
125 }
126
127 async fn build_with_tracing(
128 conf: gaxi::options::ClientConfig,
129 ) -> crate::ClientBuilderResult<impl super::stub::BusinessGlossaryService> {
130 Self::build_transport(conf)
131 .await
132 .map(super::tracing::BusinessGlossaryService::new)
133 }
134
135 /// Creates a new Glossary resource.
136 ///
137 /// # Long running operations
138 ///
139 /// This method is used to start, and/or poll a [long-running Operation].
140 /// The [Working with long-running operations] chapter in the [user guide]
141 /// covers these operations in detail.
142 ///
143 /// [long-running operation]: https://google.aip.dev/151
144 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
145 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
146 ///
147 /// # Example
148 /// ```
149 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
150 /// use google_cloud_lro::Poller;
151 /// use google_cloud_dataplex_v1::model::Glossary;
152 /// use google_cloud_dataplex_v1::Result;
153 /// async fn sample(
154 /// client: &BusinessGlossaryService, parent: &str
155 /// ) -> Result<()> {
156 /// let response = client.create_glossary()
157 /// .set_parent(parent)
158 /// .set_glossary_id("glossary_id_value")
159 /// .set_glossary(
160 /// Glossary::new()/* set fields */
161 /// )
162 /// .poller().until_done().await?;
163 /// println!("response {:?}", response);
164 /// Ok(())
165 /// }
166 /// ```
167 pub fn create_glossary(&self) -> super::builder::business_glossary_service::CreateGlossary {
168 super::builder::business_glossary_service::CreateGlossary::new(self.inner.clone())
169 }
170
171 /// Updates a Glossary resource.
172 ///
173 /// # Long running operations
174 ///
175 /// This method is used to start, and/or poll a [long-running Operation].
176 /// The [Working with long-running operations] chapter in the [user guide]
177 /// covers these operations in detail.
178 ///
179 /// [long-running operation]: https://google.aip.dev/151
180 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
181 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
182 ///
183 /// # Example
184 /// ```
185 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
186 /// use google_cloud_lro::Poller;
187 /// # extern crate wkt as google_cloud_wkt;
188 /// use google_cloud_wkt::FieldMask;
189 /// use google_cloud_dataplex_v1::model::Glossary;
190 /// use google_cloud_dataplex_v1::Result;
191 /// async fn sample(
192 /// client: &BusinessGlossaryService, project_id: &str, location_id: &str, glossary_id: &str
193 /// ) -> Result<()> {
194 /// let response = client.update_glossary()
195 /// .set_glossary(
196 /// Glossary::new().set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"))/* set fields */
197 /// )
198 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
199 /// .poller().until_done().await?;
200 /// println!("response {:?}", response);
201 /// Ok(())
202 /// }
203 /// ```
204 pub fn update_glossary(&self) -> super::builder::business_glossary_service::UpdateGlossary {
205 super::builder::business_glossary_service::UpdateGlossary::new(self.inner.clone())
206 }
207
208 /// Deletes a Glossary resource. All the categories and terms within the
209 /// Glossary must be deleted before the Glossary can be deleted.
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_dataplex_v1::client::BusinessGlossaryService;
224 /// use google_cloud_lro::Poller;
225 /// use google_cloud_dataplex_v1::Result;
226 /// async fn sample(
227 /// client: &BusinessGlossaryService, project_id: &str, location_id: &str, glossary_id: &str
228 /// ) -> Result<()> {
229 /// client.delete_glossary()
230 /// .set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"))
231 /// .poller().until_done().await?;
232 /// Ok(())
233 /// }
234 /// ```
235 pub fn delete_glossary(&self) -> super::builder::business_glossary_service::DeleteGlossary {
236 super::builder::business_glossary_service::DeleteGlossary::new(self.inner.clone())
237 }
238
239 /// Gets a Glossary resource.
240 ///
241 /// # Example
242 /// ```
243 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
244 /// use google_cloud_dataplex_v1::Result;
245 /// async fn sample(
246 /// client: &BusinessGlossaryService, project_id: &str, location_id: &str, glossary_id: &str
247 /// ) -> Result<()> {
248 /// let response = client.get_glossary()
249 /// .set_name(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"))
250 /// .send().await?;
251 /// println!("response {:?}", response);
252 /// Ok(())
253 /// }
254 /// ```
255 pub fn get_glossary(&self) -> super::builder::business_glossary_service::GetGlossary {
256 super::builder::business_glossary_service::GetGlossary::new(self.inner.clone())
257 }
258
259 /// Lists Glossary resources in a project and location.
260 ///
261 /// # Example
262 /// ```
263 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
264 /// use google_cloud_gax::paginator::ItemPaginator as _;
265 /// use google_cloud_dataplex_v1::Result;
266 /// async fn sample(
267 /// client: &BusinessGlossaryService, parent: &str
268 /// ) -> Result<()> {
269 /// let mut list = client.list_glossaries()
270 /// .set_parent(parent)
271 /// .by_item();
272 /// while let Some(item) = list.next().await.transpose()? {
273 /// println!("{:?}", item);
274 /// }
275 /// Ok(())
276 /// }
277 /// ```
278 pub fn list_glossaries(&self) -> super::builder::business_glossary_service::ListGlossaries {
279 super::builder::business_glossary_service::ListGlossaries::new(self.inner.clone())
280 }
281
282 /// Creates a new GlossaryCategory resource.
283 ///
284 /// # Example
285 /// ```
286 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
287 /// use google_cloud_dataplex_v1::Result;
288 /// async fn sample(
289 /// client: &BusinessGlossaryService
290 /// ) -> Result<()> {
291 /// let response = client.create_glossary_category()
292 /// /* set fields */
293 /// .send().await?;
294 /// println!("response {:?}", response);
295 /// Ok(())
296 /// }
297 /// ```
298 pub fn create_glossary_category(
299 &self,
300 ) -> super::builder::business_glossary_service::CreateGlossaryCategory {
301 super::builder::business_glossary_service::CreateGlossaryCategory::new(self.inner.clone())
302 }
303
304 /// Updates a GlossaryCategory resource.
305 ///
306 /// # Example
307 /// ```
308 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
309 /// use google_cloud_dataplex_v1::Result;
310 /// async fn sample(
311 /// client: &BusinessGlossaryService
312 /// ) -> Result<()> {
313 /// let response = client.update_glossary_category()
314 /// /* set fields */
315 /// .send().await?;
316 /// println!("response {:?}", response);
317 /// Ok(())
318 /// }
319 /// ```
320 pub fn update_glossary_category(
321 &self,
322 ) -> super::builder::business_glossary_service::UpdateGlossaryCategory {
323 super::builder::business_glossary_service::UpdateGlossaryCategory::new(self.inner.clone())
324 }
325
326 /// Deletes a GlossaryCategory resource. All the GlossaryCategories and
327 /// GlossaryTerms nested directly under the specified GlossaryCategory will be
328 /// moved one level up to the parent in the hierarchy.
329 ///
330 /// # Example
331 /// ```
332 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
333 /// use google_cloud_dataplex_v1::Result;
334 /// async fn sample(
335 /// client: &BusinessGlossaryService
336 /// ) -> Result<()> {
337 /// client.delete_glossary_category()
338 /// /* set fields */
339 /// .send().await?;
340 /// Ok(())
341 /// }
342 /// ```
343 pub fn delete_glossary_category(
344 &self,
345 ) -> super::builder::business_glossary_service::DeleteGlossaryCategory {
346 super::builder::business_glossary_service::DeleteGlossaryCategory::new(self.inner.clone())
347 }
348
349 /// Gets a GlossaryCategory resource.
350 ///
351 /// # Example
352 /// ```
353 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
354 /// use google_cloud_dataplex_v1::Result;
355 /// async fn sample(
356 /// client: &BusinessGlossaryService
357 /// ) -> Result<()> {
358 /// let response = client.get_glossary_category()
359 /// /* set fields */
360 /// .send().await?;
361 /// println!("response {:?}", response);
362 /// Ok(())
363 /// }
364 /// ```
365 pub fn get_glossary_category(
366 &self,
367 ) -> super::builder::business_glossary_service::GetGlossaryCategory {
368 super::builder::business_glossary_service::GetGlossaryCategory::new(self.inner.clone())
369 }
370
371 /// Lists GlossaryCategory resources in a Glossary.
372 ///
373 /// # Example
374 /// ```
375 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
376 /// use google_cloud_gax::paginator::ItemPaginator as _;
377 /// use google_cloud_dataplex_v1::Result;
378 /// async fn sample(
379 /// client: &BusinessGlossaryService, project_id: &str, location_id: &str, glossary_id: &str
380 /// ) -> Result<()> {
381 /// let mut list = client.list_glossary_categories()
382 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"))
383 /// .by_item();
384 /// while let Some(item) = list.next().await.transpose()? {
385 /// println!("{:?}", item);
386 /// }
387 /// Ok(())
388 /// }
389 /// ```
390 pub fn list_glossary_categories(
391 &self,
392 ) -> super::builder::business_glossary_service::ListGlossaryCategories {
393 super::builder::business_glossary_service::ListGlossaryCategories::new(self.inner.clone())
394 }
395
396 /// Creates a new GlossaryTerm resource.
397 ///
398 /// # Example
399 /// ```
400 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
401 /// use google_cloud_dataplex_v1::Result;
402 /// async fn sample(
403 /// client: &BusinessGlossaryService
404 /// ) -> Result<()> {
405 /// let response = client.create_glossary_term()
406 /// /* set fields */
407 /// .send().await?;
408 /// println!("response {:?}", response);
409 /// Ok(())
410 /// }
411 /// ```
412 pub fn create_glossary_term(
413 &self,
414 ) -> super::builder::business_glossary_service::CreateGlossaryTerm {
415 super::builder::business_glossary_service::CreateGlossaryTerm::new(self.inner.clone())
416 }
417
418 /// Updates a GlossaryTerm resource.
419 ///
420 /// # Example
421 /// ```
422 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
423 /// use google_cloud_dataplex_v1::Result;
424 /// async fn sample(
425 /// client: &BusinessGlossaryService
426 /// ) -> Result<()> {
427 /// let response = client.update_glossary_term()
428 /// /* set fields */
429 /// .send().await?;
430 /// println!("response {:?}", response);
431 /// Ok(())
432 /// }
433 /// ```
434 pub fn update_glossary_term(
435 &self,
436 ) -> super::builder::business_glossary_service::UpdateGlossaryTerm {
437 super::builder::business_glossary_service::UpdateGlossaryTerm::new(self.inner.clone())
438 }
439
440 /// Deletes a GlossaryTerm resource.
441 ///
442 /// # Example
443 /// ```
444 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
445 /// use google_cloud_dataplex_v1::Result;
446 /// async fn sample(
447 /// client: &BusinessGlossaryService
448 /// ) -> Result<()> {
449 /// client.delete_glossary_term()
450 /// /* set fields */
451 /// .send().await?;
452 /// Ok(())
453 /// }
454 /// ```
455 pub fn delete_glossary_term(
456 &self,
457 ) -> super::builder::business_glossary_service::DeleteGlossaryTerm {
458 super::builder::business_glossary_service::DeleteGlossaryTerm::new(self.inner.clone())
459 }
460
461 /// Gets a GlossaryTerm resource.
462 ///
463 /// # Example
464 /// ```
465 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
466 /// use google_cloud_dataplex_v1::Result;
467 /// async fn sample(
468 /// client: &BusinessGlossaryService
469 /// ) -> Result<()> {
470 /// let response = client.get_glossary_term()
471 /// /* set fields */
472 /// .send().await?;
473 /// println!("response {:?}", response);
474 /// Ok(())
475 /// }
476 /// ```
477 pub fn get_glossary_term(&self) -> super::builder::business_glossary_service::GetGlossaryTerm {
478 super::builder::business_glossary_service::GetGlossaryTerm::new(self.inner.clone())
479 }
480
481 /// Lists GlossaryTerm resources in a Glossary.
482 ///
483 /// # Example
484 /// ```
485 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
486 /// use google_cloud_gax::paginator::ItemPaginator as _;
487 /// use google_cloud_dataplex_v1::Result;
488 /// async fn sample(
489 /// client: &BusinessGlossaryService, project_id: &str, location_id: &str, glossary_id: &str
490 /// ) -> Result<()> {
491 /// let mut list = client.list_glossary_terms()
492 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/glossaries/{glossary_id}"))
493 /// .by_item();
494 /// while let Some(item) = list.next().await.transpose()? {
495 /// println!("{:?}", item);
496 /// }
497 /// Ok(())
498 /// }
499 /// ```
500 pub fn list_glossary_terms(
501 &self,
502 ) -> super::builder::business_glossary_service::ListGlossaryTerms {
503 super::builder::business_glossary_service::ListGlossaryTerms::new(self.inner.clone())
504 }
505
506 /// Lists information about the supported locations for this service.
507 /// This method can be called in two ways:
508 ///
509 /// * **List all public locations:** Use the path `GET /v1/locations`.
510 /// * **List project-visible locations:** Use the path
511 /// `GET /v1/projects/{project_id}/locations`. This may include public
512 /// locations as well as private or other locations specifically visible
513 /// to the project.
514 ///
515 /// # Example
516 /// ```
517 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
518 /// use google_cloud_gax::paginator::ItemPaginator as _;
519 /// use google_cloud_dataplex_v1::Result;
520 /// async fn sample(
521 /// client: &BusinessGlossaryService
522 /// ) -> Result<()> {
523 /// let mut list = client.list_locations()
524 /// /* set fields */
525 /// .by_item();
526 /// while let Some(item) = list.next().await.transpose()? {
527 /// println!("{:?}", item);
528 /// }
529 /// Ok(())
530 /// }
531 /// ```
532 pub fn list_locations(&self) -> super::builder::business_glossary_service::ListLocations {
533 super::builder::business_glossary_service::ListLocations::new(self.inner.clone())
534 }
535
536 /// Gets information about a location.
537 ///
538 /// # Example
539 /// ```
540 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
541 /// use google_cloud_dataplex_v1::Result;
542 /// async fn sample(
543 /// client: &BusinessGlossaryService
544 /// ) -> Result<()> {
545 /// let response = client.get_location()
546 /// /* set fields */
547 /// .send().await?;
548 /// println!("response {:?}", response);
549 /// Ok(())
550 /// }
551 /// ```
552 pub fn get_location(&self) -> super::builder::business_glossary_service::GetLocation {
553 super::builder::business_glossary_service::GetLocation::new(self.inner.clone())
554 }
555
556 /// Sets the access control policy on the specified resource. Replaces
557 /// any existing policy.
558 ///
559 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
560 /// errors.
561 ///
562 /// # Example
563 /// ```
564 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
565 /// use google_cloud_dataplex_v1::Result;
566 /// async fn sample(
567 /// client: &BusinessGlossaryService
568 /// ) -> Result<()> {
569 /// let response = client.set_iam_policy()
570 /// /* set fields */
571 /// .send().await?;
572 /// println!("response {:?}", response);
573 /// Ok(())
574 /// }
575 /// ```
576 pub fn set_iam_policy(&self) -> super::builder::business_glossary_service::SetIamPolicy {
577 super::builder::business_glossary_service::SetIamPolicy::new(self.inner.clone())
578 }
579
580 /// Gets the access control policy for a resource. Returns an empty policy
581 /// if the resource exists and does not have a policy set.
582 ///
583 /// # Example
584 /// ```
585 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
586 /// use google_cloud_dataplex_v1::Result;
587 /// async fn sample(
588 /// client: &BusinessGlossaryService
589 /// ) -> Result<()> {
590 /// let response = client.get_iam_policy()
591 /// /* set fields */
592 /// .send().await?;
593 /// println!("response {:?}", response);
594 /// Ok(())
595 /// }
596 /// ```
597 pub fn get_iam_policy(&self) -> super::builder::business_glossary_service::GetIamPolicy {
598 super::builder::business_glossary_service::GetIamPolicy::new(self.inner.clone())
599 }
600
601 /// Returns permissions that a caller has on the specified resource. If the
602 /// resource does not exist, this will return an empty set of
603 /// permissions, not a `NOT_FOUND` error.
604 ///
605 /// Note: This operation is designed to be used for building
606 /// permission-aware UIs and command-line tools, not for authorization
607 /// checking. This operation may "fail open" without warning.
608 ///
609 /// # Example
610 /// ```
611 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
612 /// use google_cloud_dataplex_v1::Result;
613 /// async fn sample(
614 /// client: &BusinessGlossaryService
615 /// ) -> Result<()> {
616 /// let response = client.test_iam_permissions()
617 /// /* set fields */
618 /// .send().await?;
619 /// println!("response {:?}", response);
620 /// Ok(())
621 /// }
622 /// ```
623 pub fn test_iam_permissions(
624 &self,
625 ) -> super::builder::business_glossary_service::TestIamPermissions {
626 super::builder::business_glossary_service::TestIamPermissions::new(self.inner.clone())
627 }
628
629 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
630 ///
631 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
632 ///
633 /// # Example
634 /// ```
635 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
636 /// use google_cloud_gax::paginator::ItemPaginator as _;
637 /// use google_cloud_dataplex_v1::Result;
638 /// async fn sample(
639 /// client: &BusinessGlossaryService
640 /// ) -> Result<()> {
641 /// let mut list = client.list_operations()
642 /// /* set fields */
643 /// .by_item();
644 /// while let Some(item) = list.next().await.transpose()? {
645 /// println!("{:?}", item);
646 /// }
647 /// Ok(())
648 /// }
649 /// ```
650 pub fn list_operations(&self) -> super::builder::business_glossary_service::ListOperations {
651 super::builder::business_glossary_service::ListOperations::new(self.inner.clone())
652 }
653
654 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
655 ///
656 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
657 ///
658 /// # Example
659 /// ```
660 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
661 /// use google_cloud_dataplex_v1::Result;
662 /// async fn sample(
663 /// client: &BusinessGlossaryService
664 /// ) -> Result<()> {
665 /// let response = client.get_operation()
666 /// /* set fields */
667 /// .send().await?;
668 /// println!("response {:?}", response);
669 /// Ok(())
670 /// }
671 /// ```
672 pub fn get_operation(&self) -> super::builder::business_glossary_service::GetOperation {
673 super::builder::business_glossary_service::GetOperation::new(self.inner.clone())
674 }
675
676 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
677 ///
678 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
679 ///
680 /// # Example
681 /// ```
682 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
683 /// use google_cloud_dataplex_v1::Result;
684 /// async fn sample(
685 /// client: &BusinessGlossaryService
686 /// ) -> Result<()> {
687 /// client.delete_operation()
688 /// /* set fields */
689 /// .send().await?;
690 /// Ok(())
691 /// }
692 /// ```
693 pub fn delete_operation(&self) -> super::builder::business_glossary_service::DeleteOperation {
694 super::builder::business_glossary_service::DeleteOperation::new(self.inner.clone())
695 }
696
697 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
698 ///
699 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
700 ///
701 /// # Example
702 /// ```
703 /// # use google_cloud_dataplex_v1::client::BusinessGlossaryService;
704 /// use google_cloud_dataplex_v1::Result;
705 /// async fn sample(
706 /// client: &BusinessGlossaryService
707 /// ) -> Result<()> {
708 /// client.cancel_operation()
709 /// /* set fields */
710 /// .send().await?;
711 /// Ok(())
712 /// }
713 /// ```
714 pub fn cancel_operation(&self) -> super::builder::business_glossary_service::CancelOperation {
715 super::builder::business_glossary_service::CancelOperation::new(self.inner.clone())
716 }
717}
718
719/// Implements a client for the Cloud Dataplex API.
720///
721/// # Example
722/// ```
723/// # use google_cloud_dataplex_v1::client::CatalogService;
724/// use google_cloud_gax::paginator::ItemPaginator as _;
725/// async fn sample(
726/// parent: &str,
727/// ) -> anyhow::Result<()> {
728/// let client = CatalogService::builder().build().await?;
729/// let mut list = client.list_entry_types()
730/// .set_parent(parent)
731/// .by_item();
732/// while let Some(item) = list.next().await.transpose()? {
733/// println!("{:?}", item);
734/// }
735/// Ok(())
736/// }
737/// ```
738///
739/// # Service Description
740///
741/// The primary resources offered by this service are EntryGroups, EntryTypes,
742/// AspectTypes, Entries and EntryLinks. They collectively let data
743/// administrators organize, manage, secure, and catalog data located across
744/// cloud projects in their organization in a variety of storage systems,
745/// including Cloud Storage and BigQuery.
746///
747/// # Configuration
748///
749/// To configure `CatalogService` use the `with_*` methods in the type returned
750/// by [builder()][CatalogService::builder]. The default configuration should
751/// work for most applications. Common configuration changes include
752///
753/// * [with_endpoint()]: by default this client uses the global default endpoint
754/// (`https://dataplex.googleapis.com`). Applications using regional
755/// endpoints or running in restricted networks (e.g. a network configured
756// with [Private Google Access with VPC Service Controls]) may want to
757/// override this default.
758/// * [with_credentials()]: by default this client uses
759/// [Application Default Credentials]. Applications using custom
760/// authentication may need to override this default.
761///
762/// [with_endpoint()]: super::builder::catalog_service::ClientBuilder::with_endpoint
763/// [with_credentials()]: super::builder::catalog_service::ClientBuilder::with_credentials
764/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
765/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
766///
767/// # Pooling and Cloning
768///
769/// `CatalogService` holds a connection pool internally, it is advised to
770/// create one and reuse it. You do not need to wrap `CatalogService` in
771/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
772/// already uses an `Arc` internally.
773#[derive(Clone, Debug)]
774pub struct CatalogService {
775 inner: std::sync::Arc<dyn super::stub::dynamic::CatalogService>,
776}
777
778impl CatalogService {
779 /// Returns a builder for [CatalogService].
780 ///
781 /// ```
782 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
783 /// # use google_cloud_dataplex_v1::client::CatalogService;
784 /// let client = CatalogService::builder().build().await?;
785 /// # Ok(()) }
786 /// ```
787 pub fn builder() -> super::builder::catalog_service::ClientBuilder {
788 crate::new_client_builder(super::builder::catalog_service::client::Factory)
789 }
790
791 /// Creates a new client from the provided stub.
792 ///
793 /// The most common case for calling this function is in tests mocking the
794 /// client's behavior.
795 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
796 where
797 T: super::stub::CatalogService + 'static,
798 {
799 Self { inner: stub.into() }
800 }
801
802 pub(crate) async fn new(
803 config: gaxi::options::ClientConfig,
804 ) -> crate::ClientBuilderResult<Self> {
805 let inner = Self::build_inner(config).await?;
806 Ok(Self { inner })
807 }
808
809 async fn build_inner(
810 conf: gaxi::options::ClientConfig,
811 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CatalogService>> {
812 if gaxi::options::tracing_enabled(&conf) {
813 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
814 }
815 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
816 }
817
818 async fn build_transport(
819 conf: gaxi::options::ClientConfig,
820 ) -> crate::ClientBuilderResult<impl super::stub::CatalogService> {
821 super::transport::CatalogService::new(conf).await
822 }
823
824 async fn build_with_tracing(
825 conf: gaxi::options::ClientConfig,
826 ) -> crate::ClientBuilderResult<impl super::stub::CatalogService> {
827 Self::build_transport(conf)
828 .await
829 .map(super::tracing::CatalogService::new)
830 }
831
832 /// Creates an EntryType.
833 ///
834 /// # Long running operations
835 ///
836 /// This method is used to start, and/or poll a [long-running Operation].
837 /// The [Working with long-running operations] chapter in the [user guide]
838 /// covers these operations in detail.
839 ///
840 /// [long-running operation]: https://google.aip.dev/151
841 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
842 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
843 ///
844 /// # Example
845 /// ```
846 /// # use google_cloud_dataplex_v1::client::CatalogService;
847 /// use google_cloud_lro::Poller;
848 /// use google_cloud_dataplex_v1::model::EntryType;
849 /// use google_cloud_dataplex_v1::Result;
850 /// async fn sample(
851 /// client: &CatalogService, parent: &str
852 /// ) -> Result<()> {
853 /// let response = client.create_entry_type()
854 /// .set_parent(parent)
855 /// .set_entry_type(
856 /// EntryType::new()/* set fields */
857 /// )
858 /// .poller().until_done().await?;
859 /// println!("response {:?}", response);
860 /// Ok(())
861 /// }
862 /// ```
863 pub fn create_entry_type(&self) -> super::builder::catalog_service::CreateEntryType {
864 super::builder::catalog_service::CreateEntryType::new(self.inner.clone())
865 }
866
867 /// Updates an EntryType.
868 ///
869 /// # Long running operations
870 ///
871 /// This method is used to start, and/or poll a [long-running Operation].
872 /// The [Working with long-running operations] chapter in the [user guide]
873 /// covers these operations in detail.
874 ///
875 /// [long-running operation]: https://google.aip.dev/151
876 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
877 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
878 ///
879 /// # Example
880 /// ```
881 /// # use google_cloud_dataplex_v1::client::CatalogService;
882 /// use google_cloud_lro::Poller;
883 /// # extern crate wkt as google_cloud_wkt;
884 /// use google_cloud_wkt::FieldMask;
885 /// use google_cloud_dataplex_v1::model::EntryType;
886 /// use google_cloud_dataplex_v1::Result;
887 /// async fn sample(
888 /// client: &CatalogService, project_id: &str, location_id: &str, entry_type_id: &str
889 /// ) -> Result<()> {
890 /// let response = client.update_entry_type()
891 /// .set_entry_type(
892 /// EntryType::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryTypes/{entry_type_id}"))/* set fields */
893 /// )
894 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
895 /// .poller().until_done().await?;
896 /// println!("response {:?}", response);
897 /// Ok(())
898 /// }
899 /// ```
900 pub fn update_entry_type(&self) -> super::builder::catalog_service::UpdateEntryType {
901 super::builder::catalog_service::UpdateEntryType::new(self.inner.clone())
902 }
903
904 /// Deletes an EntryType.
905 ///
906 /// # Long running operations
907 ///
908 /// This method is used to start, and/or poll a [long-running Operation].
909 /// The [Working with long-running operations] chapter in the [user guide]
910 /// covers these operations in detail.
911 ///
912 /// [long-running operation]: https://google.aip.dev/151
913 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
914 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
915 ///
916 /// # Example
917 /// ```
918 /// # use google_cloud_dataplex_v1::client::CatalogService;
919 /// use google_cloud_lro::Poller;
920 /// use google_cloud_dataplex_v1::Result;
921 /// async fn sample(
922 /// client: &CatalogService, project_id: &str, location_id: &str, entry_type_id: &str
923 /// ) -> Result<()> {
924 /// client.delete_entry_type()
925 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entryTypes/{entry_type_id}"))
926 /// .poller().until_done().await?;
927 /// Ok(())
928 /// }
929 /// ```
930 pub fn delete_entry_type(&self) -> super::builder::catalog_service::DeleteEntryType {
931 super::builder::catalog_service::DeleteEntryType::new(self.inner.clone())
932 }
933
934 /// Lists EntryType resources in a project and location.
935 ///
936 /// # Example
937 /// ```
938 /// # use google_cloud_dataplex_v1::client::CatalogService;
939 /// use google_cloud_gax::paginator::ItemPaginator as _;
940 /// use google_cloud_dataplex_v1::Result;
941 /// async fn sample(
942 /// client: &CatalogService, parent: &str
943 /// ) -> Result<()> {
944 /// let mut list = client.list_entry_types()
945 /// .set_parent(parent)
946 /// .by_item();
947 /// while let Some(item) = list.next().await.transpose()? {
948 /// println!("{:?}", item);
949 /// }
950 /// Ok(())
951 /// }
952 /// ```
953 pub fn list_entry_types(&self) -> super::builder::catalog_service::ListEntryTypes {
954 super::builder::catalog_service::ListEntryTypes::new(self.inner.clone())
955 }
956
957 /// Gets an EntryType.
958 ///
959 /// # Example
960 /// ```
961 /// # use google_cloud_dataplex_v1::client::CatalogService;
962 /// use google_cloud_dataplex_v1::Result;
963 /// async fn sample(
964 /// client: &CatalogService, project_id: &str, location_id: &str, entry_type_id: &str
965 /// ) -> Result<()> {
966 /// let response = client.get_entry_type()
967 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entryTypes/{entry_type_id}"))
968 /// .send().await?;
969 /// println!("response {:?}", response);
970 /// Ok(())
971 /// }
972 /// ```
973 pub fn get_entry_type(&self) -> super::builder::catalog_service::GetEntryType {
974 super::builder::catalog_service::GetEntryType::new(self.inner.clone())
975 }
976
977 /// Creates an AspectType.
978 ///
979 /// # Long running operations
980 ///
981 /// This method is used to start, and/or poll a [long-running Operation].
982 /// The [Working with long-running operations] chapter in the [user guide]
983 /// covers these operations in detail.
984 ///
985 /// [long-running operation]: https://google.aip.dev/151
986 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
987 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
988 ///
989 /// # Example
990 /// ```
991 /// # use google_cloud_dataplex_v1::client::CatalogService;
992 /// use google_cloud_lro::Poller;
993 /// use google_cloud_dataplex_v1::model::AspectType;
994 /// use google_cloud_dataplex_v1::Result;
995 /// async fn sample(
996 /// client: &CatalogService, parent: &str
997 /// ) -> Result<()> {
998 /// let response = client.create_aspect_type()
999 /// .set_parent(parent)
1000 /// .set_aspect_type(
1001 /// AspectType::new()/* set fields */
1002 /// )
1003 /// .poller().until_done().await?;
1004 /// println!("response {:?}", response);
1005 /// Ok(())
1006 /// }
1007 /// ```
1008 pub fn create_aspect_type(&self) -> super::builder::catalog_service::CreateAspectType {
1009 super::builder::catalog_service::CreateAspectType::new(self.inner.clone())
1010 }
1011
1012 /// Updates an AspectType.
1013 ///
1014 /// # Long running operations
1015 ///
1016 /// This method is used to start, and/or poll a [long-running Operation].
1017 /// The [Working with long-running operations] chapter in the [user guide]
1018 /// covers these operations in detail.
1019 ///
1020 /// [long-running operation]: https://google.aip.dev/151
1021 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1022 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1023 ///
1024 /// # Example
1025 /// ```
1026 /// # use google_cloud_dataplex_v1::client::CatalogService;
1027 /// use google_cloud_lro::Poller;
1028 /// # extern crate wkt as google_cloud_wkt;
1029 /// use google_cloud_wkt::FieldMask;
1030 /// use google_cloud_dataplex_v1::model::AspectType;
1031 /// use google_cloud_dataplex_v1::Result;
1032 /// async fn sample(
1033 /// client: &CatalogService, project_id: &str, location_id: &str, aspect_type_id: &str
1034 /// ) -> Result<()> {
1035 /// let response = client.update_aspect_type()
1036 /// .set_aspect_type(
1037 /// AspectType::new().set_name(format!("projects/{project_id}/locations/{location_id}/aspectTypes/{aspect_type_id}"))/* set fields */
1038 /// )
1039 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1040 /// .poller().until_done().await?;
1041 /// println!("response {:?}", response);
1042 /// Ok(())
1043 /// }
1044 /// ```
1045 pub fn update_aspect_type(&self) -> super::builder::catalog_service::UpdateAspectType {
1046 super::builder::catalog_service::UpdateAspectType::new(self.inner.clone())
1047 }
1048
1049 /// Deletes an AspectType.
1050 ///
1051 /// # Long running operations
1052 ///
1053 /// This method is used to start, and/or poll a [long-running Operation].
1054 /// The [Working with long-running operations] chapter in the [user guide]
1055 /// covers these operations in detail.
1056 ///
1057 /// [long-running operation]: https://google.aip.dev/151
1058 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1059 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1060 ///
1061 /// # Example
1062 /// ```
1063 /// # use google_cloud_dataplex_v1::client::CatalogService;
1064 /// use google_cloud_lro::Poller;
1065 /// use google_cloud_dataplex_v1::Result;
1066 /// async fn sample(
1067 /// client: &CatalogService, project_id: &str, location_id: &str, aspect_type_id: &str
1068 /// ) -> Result<()> {
1069 /// client.delete_aspect_type()
1070 /// .set_name(format!("projects/{project_id}/locations/{location_id}/aspectTypes/{aspect_type_id}"))
1071 /// .poller().until_done().await?;
1072 /// Ok(())
1073 /// }
1074 /// ```
1075 pub fn delete_aspect_type(&self) -> super::builder::catalog_service::DeleteAspectType {
1076 super::builder::catalog_service::DeleteAspectType::new(self.inner.clone())
1077 }
1078
1079 /// Lists AspectType resources in a project and location.
1080 ///
1081 /// # Example
1082 /// ```
1083 /// # use google_cloud_dataplex_v1::client::CatalogService;
1084 /// use google_cloud_gax::paginator::ItemPaginator as _;
1085 /// use google_cloud_dataplex_v1::Result;
1086 /// async fn sample(
1087 /// client: &CatalogService, parent: &str
1088 /// ) -> Result<()> {
1089 /// let mut list = client.list_aspect_types()
1090 /// .set_parent(parent)
1091 /// .by_item();
1092 /// while let Some(item) = list.next().await.transpose()? {
1093 /// println!("{:?}", item);
1094 /// }
1095 /// Ok(())
1096 /// }
1097 /// ```
1098 pub fn list_aspect_types(&self) -> super::builder::catalog_service::ListAspectTypes {
1099 super::builder::catalog_service::ListAspectTypes::new(self.inner.clone())
1100 }
1101
1102 /// Gets an AspectType.
1103 ///
1104 /// # Example
1105 /// ```
1106 /// # use google_cloud_dataplex_v1::client::CatalogService;
1107 /// use google_cloud_dataplex_v1::Result;
1108 /// async fn sample(
1109 /// client: &CatalogService, project_id: &str, location_id: &str, aspect_type_id: &str
1110 /// ) -> Result<()> {
1111 /// let response = client.get_aspect_type()
1112 /// .set_name(format!("projects/{project_id}/locations/{location_id}/aspectTypes/{aspect_type_id}"))
1113 /// .send().await?;
1114 /// println!("response {:?}", response);
1115 /// Ok(())
1116 /// }
1117 /// ```
1118 pub fn get_aspect_type(&self) -> super::builder::catalog_service::GetAspectType {
1119 super::builder::catalog_service::GetAspectType::new(self.inner.clone())
1120 }
1121
1122 /// Creates an EntryGroup.
1123 ///
1124 /// # Long running operations
1125 ///
1126 /// This method is used to start, and/or poll a [long-running Operation].
1127 /// The [Working with long-running operations] chapter in the [user guide]
1128 /// covers these operations in detail.
1129 ///
1130 /// [long-running operation]: https://google.aip.dev/151
1131 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1132 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1133 ///
1134 /// # Example
1135 /// ```
1136 /// # use google_cloud_dataplex_v1::client::CatalogService;
1137 /// use google_cloud_lro::Poller;
1138 /// use google_cloud_dataplex_v1::model::EntryGroup;
1139 /// use google_cloud_dataplex_v1::Result;
1140 /// async fn sample(
1141 /// client: &CatalogService, parent: &str
1142 /// ) -> Result<()> {
1143 /// let response = client.create_entry_group()
1144 /// .set_parent(parent)
1145 /// .set_entry_group(
1146 /// EntryGroup::new()/* set fields */
1147 /// )
1148 /// .poller().until_done().await?;
1149 /// println!("response {:?}", response);
1150 /// Ok(())
1151 /// }
1152 /// ```
1153 pub fn create_entry_group(&self) -> super::builder::catalog_service::CreateEntryGroup {
1154 super::builder::catalog_service::CreateEntryGroup::new(self.inner.clone())
1155 }
1156
1157 /// Updates an EntryGroup.
1158 ///
1159 /// # Long running operations
1160 ///
1161 /// This method is used to start, and/or poll a [long-running Operation].
1162 /// The [Working with long-running operations] chapter in the [user guide]
1163 /// covers these operations in detail.
1164 ///
1165 /// [long-running operation]: https://google.aip.dev/151
1166 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1167 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1168 ///
1169 /// # Example
1170 /// ```
1171 /// # use google_cloud_dataplex_v1::client::CatalogService;
1172 /// use google_cloud_lro::Poller;
1173 /// # extern crate wkt as google_cloud_wkt;
1174 /// use google_cloud_wkt::FieldMask;
1175 /// use google_cloud_dataplex_v1::model::EntryGroup;
1176 /// use google_cloud_dataplex_v1::Result;
1177 /// async fn sample(
1178 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str
1179 /// ) -> Result<()> {
1180 /// let response = client.update_entry_group()
1181 /// .set_entry_group(
1182 /// EntryGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"))/* set fields */
1183 /// )
1184 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1185 /// .poller().until_done().await?;
1186 /// println!("response {:?}", response);
1187 /// Ok(())
1188 /// }
1189 /// ```
1190 pub fn update_entry_group(&self) -> super::builder::catalog_service::UpdateEntryGroup {
1191 super::builder::catalog_service::UpdateEntryGroup::new(self.inner.clone())
1192 }
1193
1194 /// Deletes an EntryGroup.
1195 ///
1196 /// # Long running operations
1197 ///
1198 /// This method is used to start, and/or poll a [long-running Operation].
1199 /// The [Working with long-running operations] chapter in the [user guide]
1200 /// covers these operations in detail.
1201 ///
1202 /// [long-running operation]: https://google.aip.dev/151
1203 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1204 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1205 ///
1206 /// # Example
1207 /// ```
1208 /// # use google_cloud_dataplex_v1::client::CatalogService;
1209 /// use google_cloud_lro::Poller;
1210 /// use google_cloud_dataplex_v1::Result;
1211 /// async fn sample(
1212 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str
1213 /// ) -> Result<()> {
1214 /// client.delete_entry_group()
1215 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"))
1216 /// .poller().until_done().await?;
1217 /// Ok(())
1218 /// }
1219 /// ```
1220 pub fn delete_entry_group(&self) -> super::builder::catalog_service::DeleteEntryGroup {
1221 super::builder::catalog_service::DeleteEntryGroup::new(self.inner.clone())
1222 }
1223
1224 /// Lists EntryGroup resources in a project and location.
1225 ///
1226 /// # Example
1227 /// ```
1228 /// # use google_cloud_dataplex_v1::client::CatalogService;
1229 /// use google_cloud_gax::paginator::ItemPaginator as _;
1230 /// use google_cloud_dataplex_v1::Result;
1231 /// async fn sample(
1232 /// client: &CatalogService, parent: &str
1233 /// ) -> Result<()> {
1234 /// let mut list = client.list_entry_groups()
1235 /// .set_parent(parent)
1236 /// .by_item();
1237 /// while let Some(item) = list.next().await.transpose()? {
1238 /// println!("{:?}", item);
1239 /// }
1240 /// Ok(())
1241 /// }
1242 /// ```
1243 pub fn list_entry_groups(&self) -> super::builder::catalog_service::ListEntryGroups {
1244 super::builder::catalog_service::ListEntryGroups::new(self.inner.clone())
1245 }
1246
1247 /// Gets an EntryGroup.
1248 ///
1249 /// # Example
1250 /// ```
1251 /// # use google_cloud_dataplex_v1::client::CatalogService;
1252 /// use google_cloud_dataplex_v1::Result;
1253 /// async fn sample(
1254 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str
1255 /// ) -> Result<()> {
1256 /// let response = client.get_entry_group()
1257 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"))
1258 /// .send().await?;
1259 /// println!("response {:?}", response);
1260 /// Ok(())
1261 /// }
1262 /// ```
1263 pub fn get_entry_group(&self) -> super::builder::catalog_service::GetEntryGroup {
1264 super::builder::catalog_service::GetEntryGroup::new(self.inner.clone())
1265 }
1266
1267 /// Creates an Entry.
1268 ///
1269 /// # Example
1270 /// ```
1271 /// # use google_cloud_dataplex_v1::client::CatalogService;
1272 /// use google_cloud_dataplex_v1::model::Entry;
1273 /// use google_cloud_dataplex_v1::Result;
1274 /// async fn sample(
1275 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str
1276 /// ) -> Result<()> {
1277 /// let response = client.create_entry()
1278 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"))
1279 /// .set_entry_id("entry_id_value")
1280 /// .set_entry(
1281 /// Entry::new()/* set fields */
1282 /// )
1283 /// .send().await?;
1284 /// println!("response {:?}", response);
1285 /// Ok(())
1286 /// }
1287 /// ```
1288 pub fn create_entry(&self) -> super::builder::catalog_service::CreateEntry {
1289 super::builder::catalog_service::CreateEntry::new(self.inner.clone())
1290 }
1291
1292 /// Updates an Entry.
1293 ///
1294 /// # Example
1295 /// ```
1296 /// # use google_cloud_dataplex_v1::client::CatalogService;
1297 /// # extern crate wkt as google_cloud_wkt;
1298 /// use google_cloud_wkt::FieldMask;
1299 /// use google_cloud_dataplex_v1::model::Entry;
1300 /// use google_cloud_dataplex_v1::Result;
1301 /// async fn sample(
1302 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str, entry_id: &str
1303 /// ) -> Result<()> {
1304 /// let response = client.update_entry()
1305 /// .set_entry(
1306 /// Entry::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"))/* set fields */
1307 /// )
1308 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1309 /// .send().await?;
1310 /// println!("response {:?}", response);
1311 /// Ok(())
1312 /// }
1313 /// ```
1314 pub fn update_entry(&self) -> super::builder::catalog_service::UpdateEntry {
1315 super::builder::catalog_service::UpdateEntry::new(self.inner.clone())
1316 }
1317
1318 /// Deletes an Entry.
1319 ///
1320 /// # Example
1321 /// ```
1322 /// # use google_cloud_dataplex_v1::client::CatalogService;
1323 /// use google_cloud_dataplex_v1::Result;
1324 /// async fn sample(
1325 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str, entry_id: &str
1326 /// ) -> Result<()> {
1327 /// let response = client.delete_entry()
1328 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"))
1329 /// .send().await?;
1330 /// println!("response {:?}", response);
1331 /// Ok(())
1332 /// }
1333 /// ```
1334 pub fn delete_entry(&self) -> super::builder::catalog_service::DeleteEntry {
1335 super::builder::catalog_service::DeleteEntry::new(self.inner.clone())
1336 }
1337
1338 /// Lists Entries within an EntryGroup.
1339 ///
1340 /// # Example
1341 /// ```
1342 /// # use google_cloud_dataplex_v1::client::CatalogService;
1343 /// use google_cloud_gax::paginator::ItemPaginator as _;
1344 /// use google_cloud_dataplex_v1::Result;
1345 /// async fn sample(
1346 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str
1347 /// ) -> Result<()> {
1348 /// let mut list = client.list_entries()
1349 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"))
1350 /// .by_item();
1351 /// while let Some(item) = list.next().await.transpose()? {
1352 /// println!("{:?}", item);
1353 /// }
1354 /// Ok(())
1355 /// }
1356 /// ```
1357 pub fn list_entries(&self) -> super::builder::catalog_service::ListEntries {
1358 super::builder::catalog_service::ListEntries::new(self.inner.clone())
1359 }
1360
1361 /// Gets an Entry.
1362 ///
1363 /// # Example
1364 /// ```
1365 /// # use google_cloud_dataplex_v1::client::CatalogService;
1366 /// use google_cloud_dataplex_v1::Result;
1367 /// async fn sample(
1368 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str, entry_id: &str
1369 /// ) -> Result<()> {
1370 /// let response = client.get_entry()
1371 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}"))
1372 /// .send().await?;
1373 /// println!("response {:?}", response);
1374 /// Ok(())
1375 /// }
1376 /// ```
1377 pub fn get_entry(&self) -> super::builder::catalog_service::GetEntry {
1378 super::builder::catalog_service::GetEntry::new(self.inner.clone())
1379 }
1380
1381 /// Looks up an entry by name using the permission on the source system.
1382 ///
1383 /// # Example
1384 /// ```
1385 /// # use google_cloud_dataplex_v1::client::CatalogService;
1386 /// use google_cloud_dataplex_v1::Result;
1387 /// async fn sample(
1388 /// client: &CatalogService
1389 /// ) -> Result<()> {
1390 /// let response = client.lookup_entry()
1391 /// /* set fields */
1392 /// .send().await?;
1393 /// println!("response {:?}", response);
1394 /// Ok(())
1395 /// }
1396 /// ```
1397 pub fn lookup_entry(&self) -> super::builder::catalog_service::LookupEntry {
1398 super::builder::catalog_service::LookupEntry::new(self.inner.clone())
1399 }
1400
1401 /// Searches for Entries matching the given query and scope.
1402 ///
1403 /// # Example
1404 /// ```
1405 /// # use google_cloud_dataplex_v1::client::CatalogService;
1406 /// use google_cloud_gax::paginator::ItemPaginator as _;
1407 /// use google_cloud_dataplex_v1::Result;
1408 /// async fn sample(
1409 /// client: &CatalogService
1410 /// ) -> Result<()> {
1411 /// let mut list = client.search_entries()
1412 /// /* set fields */
1413 /// .by_item();
1414 /// while let Some(item) = list.next().await.transpose()? {
1415 /// println!("{:?}", item);
1416 /// }
1417 /// Ok(())
1418 /// }
1419 /// ```
1420 pub fn search_entries(&self) -> super::builder::catalog_service::SearchEntries {
1421 super::builder::catalog_service::SearchEntries::new(self.inner.clone())
1422 }
1423
1424 /// Creates a metadata job. For example, use a metadata job to import metadata
1425 /// from a third-party system into Dataplex Universal Catalog.
1426 ///
1427 /// # Long running operations
1428 ///
1429 /// This method is used to start, and/or poll a [long-running Operation].
1430 /// The [Working with long-running operations] chapter in the [user guide]
1431 /// covers these operations in detail.
1432 ///
1433 /// [long-running operation]: https://google.aip.dev/151
1434 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1435 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1436 ///
1437 /// # Example
1438 /// ```
1439 /// # use google_cloud_dataplex_v1::client::CatalogService;
1440 /// use google_cloud_lro::Poller;
1441 /// use google_cloud_dataplex_v1::model::MetadataJob;
1442 /// use google_cloud_dataplex_v1::Result;
1443 /// async fn sample(
1444 /// client: &CatalogService, parent: &str
1445 /// ) -> Result<()> {
1446 /// let response = client.create_metadata_job()
1447 /// .set_parent(parent)
1448 /// .set_metadata_job(
1449 /// MetadataJob::new()/* set fields */
1450 /// )
1451 /// .poller().until_done().await?;
1452 /// println!("response {:?}", response);
1453 /// Ok(())
1454 /// }
1455 /// ```
1456 pub fn create_metadata_job(&self) -> super::builder::catalog_service::CreateMetadataJob {
1457 super::builder::catalog_service::CreateMetadataJob::new(self.inner.clone())
1458 }
1459
1460 /// Gets a metadata job.
1461 ///
1462 /// # Example
1463 /// ```
1464 /// # use google_cloud_dataplex_v1::client::CatalogService;
1465 /// use google_cloud_dataplex_v1::Result;
1466 /// async fn sample(
1467 /// client: &CatalogService, project_id: &str, location_id: &str, metadata_job_id: &str
1468 /// ) -> Result<()> {
1469 /// let response = client.get_metadata_job()
1470 /// .set_name(format!("projects/{project_id}/locations/{location_id}/metadataJobs/{metadata_job_id}"))
1471 /// .send().await?;
1472 /// println!("response {:?}", response);
1473 /// Ok(())
1474 /// }
1475 /// ```
1476 pub fn get_metadata_job(&self) -> super::builder::catalog_service::GetMetadataJob {
1477 super::builder::catalog_service::GetMetadataJob::new(self.inner.clone())
1478 }
1479
1480 /// Lists metadata jobs.
1481 ///
1482 /// # Example
1483 /// ```
1484 /// # use google_cloud_dataplex_v1::client::CatalogService;
1485 /// use google_cloud_gax::paginator::ItemPaginator as _;
1486 /// use google_cloud_dataplex_v1::Result;
1487 /// async fn sample(
1488 /// client: &CatalogService, parent: &str
1489 /// ) -> Result<()> {
1490 /// let mut list = client.list_metadata_jobs()
1491 /// .set_parent(parent)
1492 /// .by_item();
1493 /// while let Some(item) = list.next().await.transpose()? {
1494 /// println!("{:?}", item);
1495 /// }
1496 /// Ok(())
1497 /// }
1498 /// ```
1499 pub fn list_metadata_jobs(&self) -> super::builder::catalog_service::ListMetadataJobs {
1500 super::builder::catalog_service::ListMetadataJobs::new(self.inner.clone())
1501 }
1502
1503 /// Cancels a metadata job.
1504 ///
1505 /// If you cancel a metadata import job that is in progress, the changes in the
1506 /// job might be partially applied. We recommend that you reset the state of
1507 /// the entry groups in your project by running another metadata job that
1508 /// reverts the changes from the canceled job.
1509 ///
1510 /// # Example
1511 /// ```
1512 /// # use google_cloud_dataplex_v1::client::CatalogService;
1513 /// use google_cloud_dataplex_v1::Result;
1514 /// async fn sample(
1515 /// client: &CatalogService
1516 /// ) -> Result<()> {
1517 /// client.cancel_metadata_job()
1518 /// /* set fields */
1519 /// .send().await?;
1520 /// Ok(())
1521 /// }
1522 /// ```
1523 pub fn cancel_metadata_job(&self) -> super::builder::catalog_service::CancelMetadataJob {
1524 super::builder::catalog_service::CancelMetadataJob::new(self.inner.clone())
1525 }
1526
1527 /// Creates an Entry Link.
1528 ///
1529 /// # Example
1530 /// ```
1531 /// # use google_cloud_dataplex_v1::client::CatalogService;
1532 /// use google_cloud_dataplex_v1::model::EntryLink;
1533 /// use google_cloud_dataplex_v1::Result;
1534 /// async fn sample(
1535 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str
1536 /// ) -> Result<()> {
1537 /// let response = client.create_entry_link()
1538 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}"))
1539 /// .set_entry_link(
1540 /// EntryLink::new()/* set fields */
1541 /// )
1542 /// .send().await?;
1543 /// println!("response {:?}", response);
1544 /// Ok(())
1545 /// }
1546 /// ```
1547 pub fn create_entry_link(&self) -> super::builder::catalog_service::CreateEntryLink {
1548 super::builder::catalog_service::CreateEntryLink::new(self.inner.clone())
1549 }
1550
1551 /// Updates an Entry Link.
1552 ///
1553 /// # Example
1554 /// ```
1555 /// # use google_cloud_dataplex_v1::client::CatalogService;
1556 /// use google_cloud_dataplex_v1::model::EntryLink;
1557 /// use google_cloud_dataplex_v1::Result;
1558 /// async fn sample(
1559 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str, entry_link_id: &str
1560 /// ) -> Result<()> {
1561 /// let response = client.update_entry_link()
1562 /// .set_entry_link(
1563 /// EntryLink::new().set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}"))/* set fields */
1564 /// )
1565 /// .send().await?;
1566 /// println!("response {:?}", response);
1567 /// Ok(())
1568 /// }
1569 /// ```
1570 pub fn update_entry_link(&self) -> super::builder::catalog_service::UpdateEntryLink {
1571 super::builder::catalog_service::UpdateEntryLink::new(self.inner.clone())
1572 }
1573
1574 /// Deletes an Entry Link.
1575 ///
1576 /// # Example
1577 /// ```
1578 /// # use google_cloud_dataplex_v1::client::CatalogService;
1579 /// use google_cloud_dataplex_v1::Result;
1580 /// async fn sample(
1581 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str, entry_link_id: &str
1582 /// ) -> Result<()> {
1583 /// let response = client.delete_entry_link()
1584 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}"))
1585 /// .send().await?;
1586 /// println!("response {:?}", response);
1587 /// Ok(())
1588 /// }
1589 /// ```
1590 pub fn delete_entry_link(&self) -> super::builder::catalog_service::DeleteEntryLink {
1591 super::builder::catalog_service::DeleteEntryLink::new(self.inner.clone())
1592 }
1593
1594 /// Looks up Entry Links referencing the specified Entry.
1595 ///
1596 /// # Example
1597 /// ```
1598 /// # use google_cloud_dataplex_v1::client::CatalogService;
1599 /// use google_cloud_gax::paginator::ItemPaginator as _;
1600 /// use google_cloud_dataplex_v1::Result;
1601 /// async fn sample(
1602 /// client: &CatalogService
1603 /// ) -> Result<()> {
1604 /// let mut list = client.lookup_entry_links()
1605 /// /* set fields */
1606 /// .by_item();
1607 /// while let Some(item) = list.next().await.transpose()? {
1608 /// println!("{:?}", item);
1609 /// }
1610 /// Ok(())
1611 /// }
1612 /// ```
1613 pub fn lookup_entry_links(&self) -> super::builder::catalog_service::LookupEntryLinks {
1614 super::builder::catalog_service::LookupEntryLinks::new(self.inner.clone())
1615 }
1616
1617 /// Looks up LLM Context for the specified resources.
1618 ///
1619 /// # Example
1620 /// ```
1621 /// # use google_cloud_dataplex_v1::client::CatalogService;
1622 /// use google_cloud_dataplex_v1::Result;
1623 /// async fn sample(
1624 /// client: &CatalogService
1625 /// ) -> Result<()> {
1626 /// let response = client.lookup_context()
1627 /// /* set fields */
1628 /// .send().await?;
1629 /// println!("response {:?}", response);
1630 /// Ok(())
1631 /// }
1632 /// ```
1633 pub fn lookup_context(&self) -> super::builder::catalog_service::LookupContext {
1634 super::builder::catalog_service::LookupContext::new(self.inner.clone())
1635 }
1636
1637 /// Gets an Entry Link.
1638 ///
1639 /// # Example
1640 /// ```
1641 /// # use google_cloud_dataplex_v1::client::CatalogService;
1642 /// use google_cloud_dataplex_v1::Result;
1643 /// async fn sample(
1644 /// client: &CatalogService, project_id: &str, location_id: &str, entry_group_id: &str, entry_link_id: &str
1645 /// ) -> Result<()> {
1646 /// let response = client.get_entry_link()
1647 /// .set_name(format!("projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entryLinks/{entry_link_id}"))
1648 /// .send().await?;
1649 /// println!("response {:?}", response);
1650 /// Ok(())
1651 /// }
1652 /// ```
1653 pub fn get_entry_link(&self) -> super::builder::catalog_service::GetEntryLink {
1654 super::builder::catalog_service::GetEntryLink::new(self.inner.clone())
1655 }
1656
1657 /// Creates a MetadataFeed.
1658 ///
1659 /// # Long running operations
1660 ///
1661 /// This method is used to start, and/or poll a [long-running Operation].
1662 /// The [Working with long-running operations] chapter in the [user guide]
1663 /// covers these operations in detail.
1664 ///
1665 /// [long-running operation]: https://google.aip.dev/151
1666 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1667 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1668 ///
1669 /// # Example
1670 /// ```
1671 /// # use google_cloud_dataplex_v1::client::CatalogService;
1672 /// use google_cloud_lro::Poller;
1673 /// use google_cloud_dataplex_v1::model::MetadataFeed;
1674 /// use google_cloud_dataplex_v1::Result;
1675 /// async fn sample(
1676 /// client: &CatalogService, parent: &str
1677 /// ) -> Result<()> {
1678 /// let response = client.create_metadata_feed()
1679 /// .set_parent(parent)
1680 /// .set_metadata_feed(
1681 /// MetadataFeed::new()/* set fields */
1682 /// )
1683 /// .poller().until_done().await?;
1684 /// println!("response {:?}", response);
1685 /// Ok(())
1686 /// }
1687 /// ```
1688 pub fn create_metadata_feed(&self) -> super::builder::catalog_service::CreateMetadataFeed {
1689 super::builder::catalog_service::CreateMetadataFeed::new(self.inner.clone())
1690 }
1691
1692 /// Gets a MetadataFeed.
1693 ///
1694 /// # Example
1695 /// ```
1696 /// # use google_cloud_dataplex_v1::client::CatalogService;
1697 /// use google_cloud_dataplex_v1::Result;
1698 /// async fn sample(
1699 /// client: &CatalogService, project_id: &str, location_id: &str, metadata_feed_id: &str
1700 /// ) -> Result<()> {
1701 /// let response = client.get_metadata_feed()
1702 /// .set_name(format!("projects/{project_id}/locations/{location_id}/metadataFeeds/{metadata_feed_id}"))
1703 /// .send().await?;
1704 /// println!("response {:?}", response);
1705 /// Ok(())
1706 /// }
1707 /// ```
1708 pub fn get_metadata_feed(&self) -> super::builder::catalog_service::GetMetadataFeed {
1709 super::builder::catalog_service::GetMetadataFeed::new(self.inner.clone())
1710 }
1711
1712 /// Retrieve a list of MetadataFeeds.
1713 ///
1714 /// # Example
1715 /// ```
1716 /// # use google_cloud_dataplex_v1::client::CatalogService;
1717 /// use google_cloud_gax::paginator::ItemPaginator as _;
1718 /// use google_cloud_dataplex_v1::Result;
1719 /// async fn sample(
1720 /// client: &CatalogService, parent: &str
1721 /// ) -> Result<()> {
1722 /// let mut list = client.list_metadata_feeds()
1723 /// .set_parent(parent)
1724 /// .by_item();
1725 /// while let Some(item) = list.next().await.transpose()? {
1726 /// println!("{:?}", item);
1727 /// }
1728 /// Ok(())
1729 /// }
1730 /// ```
1731 pub fn list_metadata_feeds(&self) -> super::builder::catalog_service::ListMetadataFeeds {
1732 super::builder::catalog_service::ListMetadataFeeds::new(self.inner.clone())
1733 }
1734
1735 /// Deletes a MetadataFeed.
1736 ///
1737 /// # Long running operations
1738 ///
1739 /// This method is used to start, and/or poll a [long-running Operation].
1740 /// The [Working with long-running operations] chapter in the [user guide]
1741 /// covers these operations in detail.
1742 ///
1743 /// [long-running operation]: https://google.aip.dev/151
1744 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1745 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1746 ///
1747 /// # Example
1748 /// ```
1749 /// # use google_cloud_dataplex_v1::client::CatalogService;
1750 /// use google_cloud_lro::Poller;
1751 /// use google_cloud_dataplex_v1::Result;
1752 /// async fn sample(
1753 /// client: &CatalogService, project_id: &str, location_id: &str, metadata_feed_id: &str
1754 /// ) -> Result<()> {
1755 /// client.delete_metadata_feed()
1756 /// .set_name(format!("projects/{project_id}/locations/{location_id}/metadataFeeds/{metadata_feed_id}"))
1757 /// .poller().until_done().await?;
1758 /// Ok(())
1759 /// }
1760 /// ```
1761 pub fn delete_metadata_feed(&self) -> super::builder::catalog_service::DeleteMetadataFeed {
1762 super::builder::catalog_service::DeleteMetadataFeed::new(self.inner.clone())
1763 }
1764
1765 /// Updates a MetadataFeed.
1766 ///
1767 /// # Long running operations
1768 ///
1769 /// This method is used to start, and/or poll a [long-running Operation].
1770 /// The [Working with long-running operations] chapter in the [user guide]
1771 /// covers these operations in detail.
1772 ///
1773 /// [long-running operation]: https://google.aip.dev/151
1774 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1775 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1776 ///
1777 /// # Example
1778 /// ```
1779 /// # use google_cloud_dataplex_v1::client::CatalogService;
1780 /// use google_cloud_lro::Poller;
1781 /// # extern crate wkt as google_cloud_wkt;
1782 /// use google_cloud_wkt::FieldMask;
1783 /// use google_cloud_dataplex_v1::model::MetadataFeed;
1784 /// use google_cloud_dataplex_v1::Result;
1785 /// async fn sample(
1786 /// client: &CatalogService, project_id: &str, location_id: &str, metadata_feed_id: &str
1787 /// ) -> Result<()> {
1788 /// let response = client.update_metadata_feed()
1789 /// .set_metadata_feed(
1790 /// MetadataFeed::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataFeeds/{metadata_feed_id}"))/* set fields */
1791 /// )
1792 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1793 /// .poller().until_done().await?;
1794 /// println!("response {:?}", response);
1795 /// Ok(())
1796 /// }
1797 /// ```
1798 pub fn update_metadata_feed(&self) -> super::builder::catalog_service::UpdateMetadataFeed {
1799 super::builder::catalog_service::UpdateMetadataFeed::new(self.inner.clone())
1800 }
1801
1802 /// Lists information about the supported locations for this service.
1803 /// This method can be called in two ways:
1804 ///
1805 /// * **List all public locations:** Use the path `GET /v1/locations`.
1806 /// * **List project-visible locations:** Use the path
1807 /// `GET /v1/projects/{project_id}/locations`. This may include public
1808 /// locations as well as private or other locations specifically visible
1809 /// to the project.
1810 ///
1811 /// # Example
1812 /// ```
1813 /// # use google_cloud_dataplex_v1::client::CatalogService;
1814 /// use google_cloud_gax::paginator::ItemPaginator as _;
1815 /// use google_cloud_dataplex_v1::Result;
1816 /// async fn sample(
1817 /// client: &CatalogService
1818 /// ) -> Result<()> {
1819 /// let mut list = client.list_locations()
1820 /// /* set fields */
1821 /// .by_item();
1822 /// while let Some(item) = list.next().await.transpose()? {
1823 /// println!("{:?}", item);
1824 /// }
1825 /// Ok(())
1826 /// }
1827 /// ```
1828 pub fn list_locations(&self) -> super::builder::catalog_service::ListLocations {
1829 super::builder::catalog_service::ListLocations::new(self.inner.clone())
1830 }
1831
1832 /// Gets information about a location.
1833 ///
1834 /// # Example
1835 /// ```
1836 /// # use google_cloud_dataplex_v1::client::CatalogService;
1837 /// use google_cloud_dataplex_v1::Result;
1838 /// async fn sample(
1839 /// client: &CatalogService
1840 /// ) -> Result<()> {
1841 /// let response = client.get_location()
1842 /// /* set fields */
1843 /// .send().await?;
1844 /// println!("response {:?}", response);
1845 /// Ok(())
1846 /// }
1847 /// ```
1848 pub fn get_location(&self) -> super::builder::catalog_service::GetLocation {
1849 super::builder::catalog_service::GetLocation::new(self.inner.clone())
1850 }
1851
1852 /// Sets the access control policy on the specified resource. Replaces
1853 /// any existing policy.
1854 ///
1855 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1856 /// errors.
1857 ///
1858 /// # Example
1859 /// ```
1860 /// # use google_cloud_dataplex_v1::client::CatalogService;
1861 /// use google_cloud_dataplex_v1::Result;
1862 /// async fn sample(
1863 /// client: &CatalogService
1864 /// ) -> Result<()> {
1865 /// let response = client.set_iam_policy()
1866 /// /* set fields */
1867 /// .send().await?;
1868 /// println!("response {:?}", response);
1869 /// Ok(())
1870 /// }
1871 /// ```
1872 pub fn set_iam_policy(&self) -> super::builder::catalog_service::SetIamPolicy {
1873 super::builder::catalog_service::SetIamPolicy::new(self.inner.clone())
1874 }
1875
1876 /// Gets the access control policy for a resource. Returns an empty policy
1877 /// if the resource exists and does not have a policy set.
1878 ///
1879 /// # Example
1880 /// ```
1881 /// # use google_cloud_dataplex_v1::client::CatalogService;
1882 /// use google_cloud_dataplex_v1::Result;
1883 /// async fn sample(
1884 /// client: &CatalogService
1885 /// ) -> Result<()> {
1886 /// let response = client.get_iam_policy()
1887 /// /* set fields */
1888 /// .send().await?;
1889 /// println!("response {:?}", response);
1890 /// Ok(())
1891 /// }
1892 /// ```
1893 pub fn get_iam_policy(&self) -> super::builder::catalog_service::GetIamPolicy {
1894 super::builder::catalog_service::GetIamPolicy::new(self.inner.clone())
1895 }
1896
1897 /// Returns permissions that a caller has on the specified resource. If the
1898 /// resource does not exist, this will return an empty set of
1899 /// permissions, not a `NOT_FOUND` error.
1900 ///
1901 /// Note: This operation is designed to be used for building
1902 /// permission-aware UIs and command-line tools, not for authorization
1903 /// checking. This operation may "fail open" without warning.
1904 ///
1905 /// # Example
1906 /// ```
1907 /// # use google_cloud_dataplex_v1::client::CatalogService;
1908 /// use google_cloud_dataplex_v1::Result;
1909 /// async fn sample(
1910 /// client: &CatalogService
1911 /// ) -> Result<()> {
1912 /// let response = client.test_iam_permissions()
1913 /// /* set fields */
1914 /// .send().await?;
1915 /// println!("response {:?}", response);
1916 /// Ok(())
1917 /// }
1918 /// ```
1919 pub fn test_iam_permissions(&self) -> super::builder::catalog_service::TestIamPermissions {
1920 super::builder::catalog_service::TestIamPermissions::new(self.inner.clone())
1921 }
1922
1923 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1924 ///
1925 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1926 ///
1927 /// # Example
1928 /// ```
1929 /// # use google_cloud_dataplex_v1::client::CatalogService;
1930 /// use google_cloud_gax::paginator::ItemPaginator as _;
1931 /// use google_cloud_dataplex_v1::Result;
1932 /// async fn sample(
1933 /// client: &CatalogService
1934 /// ) -> Result<()> {
1935 /// let mut list = client.list_operations()
1936 /// /* set fields */
1937 /// .by_item();
1938 /// while let Some(item) = list.next().await.transpose()? {
1939 /// println!("{:?}", item);
1940 /// }
1941 /// Ok(())
1942 /// }
1943 /// ```
1944 pub fn list_operations(&self) -> super::builder::catalog_service::ListOperations {
1945 super::builder::catalog_service::ListOperations::new(self.inner.clone())
1946 }
1947
1948 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1949 ///
1950 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1951 ///
1952 /// # Example
1953 /// ```
1954 /// # use google_cloud_dataplex_v1::client::CatalogService;
1955 /// use google_cloud_dataplex_v1::Result;
1956 /// async fn sample(
1957 /// client: &CatalogService
1958 /// ) -> Result<()> {
1959 /// let response = client.get_operation()
1960 /// /* set fields */
1961 /// .send().await?;
1962 /// println!("response {:?}", response);
1963 /// Ok(())
1964 /// }
1965 /// ```
1966 pub fn get_operation(&self) -> super::builder::catalog_service::GetOperation {
1967 super::builder::catalog_service::GetOperation::new(self.inner.clone())
1968 }
1969
1970 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1971 ///
1972 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1973 ///
1974 /// # Example
1975 /// ```
1976 /// # use google_cloud_dataplex_v1::client::CatalogService;
1977 /// use google_cloud_dataplex_v1::Result;
1978 /// async fn sample(
1979 /// client: &CatalogService
1980 /// ) -> Result<()> {
1981 /// client.delete_operation()
1982 /// /* set fields */
1983 /// .send().await?;
1984 /// Ok(())
1985 /// }
1986 /// ```
1987 pub fn delete_operation(&self) -> super::builder::catalog_service::DeleteOperation {
1988 super::builder::catalog_service::DeleteOperation::new(self.inner.clone())
1989 }
1990
1991 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1992 ///
1993 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1994 ///
1995 /// # Example
1996 /// ```
1997 /// # use google_cloud_dataplex_v1::client::CatalogService;
1998 /// use google_cloud_dataplex_v1::Result;
1999 /// async fn sample(
2000 /// client: &CatalogService
2001 /// ) -> Result<()> {
2002 /// client.cancel_operation()
2003 /// /* set fields */
2004 /// .send().await?;
2005 /// Ok(())
2006 /// }
2007 /// ```
2008 pub fn cancel_operation(&self) -> super::builder::catalog_service::CancelOperation {
2009 super::builder::catalog_service::CancelOperation::new(self.inner.clone())
2010 }
2011}
2012
2013/// Implements a client for the Cloud Dataplex API.
2014///
2015/// # Example
2016/// ```
2017/// # use google_cloud_dataplex_v1::client::CmekService;
2018/// use google_cloud_gax::paginator::ItemPaginator as _;
2019/// async fn sample(
2020/// organization_id: &str,
2021/// location_id: &str,
2022/// ) -> anyhow::Result<()> {
2023/// let client = CmekService::builder().build().await?;
2024/// let mut list = client.list_encryption_configs()
2025/// .set_parent(format!("organizations/{organization_id}/locations/{location_id}"))
2026/// .by_item();
2027/// while let Some(item) = list.next().await.transpose()? {
2028/// println!("{:?}", item);
2029/// }
2030/// Ok(())
2031/// }
2032/// ```
2033///
2034/// # Service Description
2035///
2036/// Dataplex Universal Catalog Customer Managed Encryption Keys (CMEK) Service
2037///
2038/// # Configuration
2039///
2040/// To configure `CmekService` use the `with_*` methods in the type returned
2041/// by [builder()][CmekService::builder]. The default configuration should
2042/// work for most applications. Common configuration changes include
2043///
2044/// * [with_endpoint()]: by default this client uses the global default endpoint
2045/// (`https://dataplex.googleapis.com`). Applications using regional
2046/// endpoints or running in restricted networks (e.g. a network configured
2047// with [Private Google Access with VPC Service Controls]) may want to
2048/// override this default.
2049/// * [with_credentials()]: by default this client uses
2050/// [Application Default Credentials]. Applications using custom
2051/// authentication may need to override this default.
2052///
2053/// [with_endpoint()]: super::builder::cmek_service::ClientBuilder::with_endpoint
2054/// [with_credentials()]: super::builder::cmek_service::ClientBuilder::with_credentials
2055/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2056/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2057///
2058/// # Pooling and Cloning
2059///
2060/// `CmekService` holds a connection pool internally, it is advised to
2061/// create one and reuse it. You do not need to wrap `CmekService` in
2062/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2063/// already uses an `Arc` internally.
2064#[derive(Clone, Debug)]
2065pub struct CmekService {
2066 inner: std::sync::Arc<dyn super::stub::dynamic::CmekService>,
2067}
2068
2069impl CmekService {
2070 /// Returns a builder for [CmekService].
2071 ///
2072 /// ```
2073 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2074 /// # use google_cloud_dataplex_v1::client::CmekService;
2075 /// let client = CmekService::builder().build().await?;
2076 /// # Ok(()) }
2077 /// ```
2078 pub fn builder() -> super::builder::cmek_service::ClientBuilder {
2079 crate::new_client_builder(super::builder::cmek_service::client::Factory)
2080 }
2081
2082 /// Creates a new client from the provided stub.
2083 ///
2084 /// The most common case for calling this function is in tests mocking the
2085 /// client's behavior.
2086 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2087 where
2088 T: super::stub::CmekService + 'static,
2089 {
2090 Self { inner: stub.into() }
2091 }
2092
2093 pub(crate) async fn new(
2094 config: gaxi::options::ClientConfig,
2095 ) -> crate::ClientBuilderResult<Self> {
2096 let inner = Self::build_inner(config).await?;
2097 Ok(Self { inner })
2098 }
2099
2100 async fn build_inner(
2101 conf: gaxi::options::ClientConfig,
2102 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CmekService>> {
2103 if gaxi::options::tracing_enabled(&conf) {
2104 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2105 }
2106 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2107 }
2108
2109 async fn build_transport(
2110 conf: gaxi::options::ClientConfig,
2111 ) -> crate::ClientBuilderResult<impl super::stub::CmekService> {
2112 super::transport::CmekService::new(conf).await
2113 }
2114
2115 async fn build_with_tracing(
2116 conf: gaxi::options::ClientConfig,
2117 ) -> crate::ClientBuilderResult<impl super::stub::CmekService> {
2118 Self::build_transport(conf)
2119 .await
2120 .map(super::tracing::CmekService::new)
2121 }
2122
2123 /// Create an EncryptionConfig.
2124 ///
2125 /// # Long running operations
2126 ///
2127 /// This method is used to start, and/or poll a [long-running Operation].
2128 /// The [Working with long-running operations] chapter in the [user guide]
2129 /// covers these operations in detail.
2130 ///
2131 /// [long-running operation]: https://google.aip.dev/151
2132 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2133 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2134 ///
2135 /// # Example
2136 /// ```
2137 /// # use google_cloud_dataplex_v1::client::CmekService;
2138 /// use google_cloud_lro::Poller;
2139 /// use google_cloud_dataplex_v1::model::EncryptionConfig;
2140 /// use google_cloud_dataplex_v1::Result;
2141 /// async fn sample(
2142 /// client: &CmekService, parent: &str
2143 /// ) -> Result<()> {
2144 /// let response = client.create_encryption_config()
2145 /// .set_parent(parent)
2146 /// .set_encryption_config(
2147 /// EncryptionConfig::new()/* set fields */
2148 /// )
2149 /// .poller().until_done().await?;
2150 /// println!("response {:?}", response);
2151 /// Ok(())
2152 /// }
2153 /// ```
2154 pub fn create_encryption_config(&self) -> super::builder::cmek_service::CreateEncryptionConfig {
2155 super::builder::cmek_service::CreateEncryptionConfig::new(self.inner.clone())
2156 }
2157
2158 /// Update an EncryptionConfig.
2159 ///
2160 /// # Long running operations
2161 ///
2162 /// This method is used to start, and/or poll a [long-running Operation].
2163 /// The [Working with long-running operations] chapter in the [user guide]
2164 /// covers these operations in detail.
2165 ///
2166 /// [long-running operation]: https://google.aip.dev/151
2167 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2168 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2169 ///
2170 /// # Example
2171 /// ```
2172 /// # use google_cloud_dataplex_v1::client::CmekService;
2173 /// use google_cloud_lro::Poller;
2174 /// # extern crate wkt as google_cloud_wkt;
2175 /// use google_cloud_wkt::FieldMask;
2176 /// use google_cloud_dataplex_v1::model::EncryptionConfig;
2177 /// use google_cloud_dataplex_v1::Result;
2178 /// async fn sample(
2179 /// client: &CmekService, organization_id: &str, location_id: &str, encryption_config_id: &str
2180 /// ) -> Result<()> {
2181 /// let response = client.update_encryption_config()
2182 /// .set_encryption_config(
2183 /// EncryptionConfig::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/encryptionConfigs/{encryption_config_id}"))/* set fields */
2184 /// )
2185 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
2186 /// .poller().until_done().await?;
2187 /// println!("response {:?}", response);
2188 /// Ok(())
2189 /// }
2190 /// ```
2191 pub fn update_encryption_config(&self) -> super::builder::cmek_service::UpdateEncryptionConfig {
2192 super::builder::cmek_service::UpdateEncryptionConfig::new(self.inner.clone())
2193 }
2194
2195 /// Delete an EncryptionConfig.
2196 ///
2197 /// # Long running operations
2198 ///
2199 /// This method is used to start, and/or poll a [long-running Operation].
2200 /// The [Working with long-running operations] chapter in the [user guide]
2201 /// covers these operations in detail.
2202 ///
2203 /// [long-running operation]: https://google.aip.dev/151
2204 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2205 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2206 ///
2207 /// # Example
2208 /// ```
2209 /// # use google_cloud_dataplex_v1::client::CmekService;
2210 /// use google_cloud_lro::Poller;
2211 /// use google_cloud_dataplex_v1::Result;
2212 /// async fn sample(
2213 /// client: &CmekService, organization_id: &str, location_id: &str, encryption_config_id: &str
2214 /// ) -> Result<()> {
2215 /// client.delete_encryption_config()
2216 /// .set_name(format!("organizations/{organization_id}/locations/{location_id}/encryptionConfigs/{encryption_config_id}"))
2217 /// .poller().until_done().await?;
2218 /// Ok(())
2219 /// }
2220 /// ```
2221 pub fn delete_encryption_config(&self) -> super::builder::cmek_service::DeleteEncryptionConfig {
2222 super::builder::cmek_service::DeleteEncryptionConfig::new(self.inner.clone())
2223 }
2224
2225 /// List EncryptionConfigs.
2226 ///
2227 /// # Example
2228 /// ```
2229 /// # use google_cloud_dataplex_v1::client::CmekService;
2230 /// use google_cloud_gax::paginator::ItemPaginator as _;
2231 /// use google_cloud_dataplex_v1::Result;
2232 /// async fn sample(
2233 /// client: &CmekService, organization_id: &str, location_id: &str
2234 /// ) -> Result<()> {
2235 /// let mut list = client.list_encryption_configs()
2236 /// .set_parent(format!("organizations/{organization_id}/locations/{location_id}"))
2237 /// .by_item();
2238 /// while let Some(item) = list.next().await.transpose()? {
2239 /// println!("{:?}", item);
2240 /// }
2241 /// Ok(())
2242 /// }
2243 /// ```
2244 pub fn list_encryption_configs(&self) -> super::builder::cmek_service::ListEncryptionConfigs {
2245 super::builder::cmek_service::ListEncryptionConfigs::new(self.inner.clone())
2246 }
2247
2248 /// Get an EncryptionConfig.
2249 ///
2250 /// # Example
2251 /// ```
2252 /// # use google_cloud_dataplex_v1::client::CmekService;
2253 /// use google_cloud_dataplex_v1::Result;
2254 /// async fn sample(
2255 /// client: &CmekService, organization_id: &str, location_id: &str, encryption_config_id: &str
2256 /// ) -> Result<()> {
2257 /// let response = client.get_encryption_config()
2258 /// .set_name(format!("organizations/{organization_id}/locations/{location_id}/encryptionConfigs/{encryption_config_id}"))
2259 /// .send().await?;
2260 /// println!("response {:?}", response);
2261 /// Ok(())
2262 /// }
2263 /// ```
2264 pub fn get_encryption_config(&self) -> super::builder::cmek_service::GetEncryptionConfig {
2265 super::builder::cmek_service::GetEncryptionConfig::new(self.inner.clone())
2266 }
2267
2268 /// Lists information about the supported locations for this service.
2269 /// This method can be called in two ways:
2270 ///
2271 /// * **List all public locations:** Use the path `GET /v1/locations`.
2272 /// * **List project-visible locations:** Use the path
2273 /// `GET /v1/projects/{project_id}/locations`. This may include public
2274 /// locations as well as private or other locations specifically visible
2275 /// to the project.
2276 ///
2277 /// # Example
2278 /// ```
2279 /// # use google_cloud_dataplex_v1::client::CmekService;
2280 /// use google_cloud_gax::paginator::ItemPaginator as _;
2281 /// use google_cloud_dataplex_v1::Result;
2282 /// async fn sample(
2283 /// client: &CmekService
2284 /// ) -> Result<()> {
2285 /// let mut list = client.list_locations()
2286 /// /* set fields */
2287 /// .by_item();
2288 /// while let Some(item) = list.next().await.transpose()? {
2289 /// println!("{:?}", item);
2290 /// }
2291 /// Ok(())
2292 /// }
2293 /// ```
2294 pub fn list_locations(&self) -> super::builder::cmek_service::ListLocations {
2295 super::builder::cmek_service::ListLocations::new(self.inner.clone())
2296 }
2297
2298 /// Gets information about a location.
2299 ///
2300 /// # Example
2301 /// ```
2302 /// # use google_cloud_dataplex_v1::client::CmekService;
2303 /// use google_cloud_dataplex_v1::Result;
2304 /// async fn sample(
2305 /// client: &CmekService
2306 /// ) -> Result<()> {
2307 /// let response = client.get_location()
2308 /// /* set fields */
2309 /// .send().await?;
2310 /// println!("response {:?}", response);
2311 /// Ok(())
2312 /// }
2313 /// ```
2314 pub fn get_location(&self) -> super::builder::cmek_service::GetLocation {
2315 super::builder::cmek_service::GetLocation::new(self.inner.clone())
2316 }
2317
2318 /// Sets the access control policy on the specified resource. Replaces
2319 /// any existing policy.
2320 ///
2321 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2322 /// errors.
2323 ///
2324 /// # Example
2325 /// ```
2326 /// # use google_cloud_dataplex_v1::client::CmekService;
2327 /// use google_cloud_dataplex_v1::Result;
2328 /// async fn sample(
2329 /// client: &CmekService
2330 /// ) -> Result<()> {
2331 /// let response = client.set_iam_policy()
2332 /// /* set fields */
2333 /// .send().await?;
2334 /// println!("response {:?}", response);
2335 /// Ok(())
2336 /// }
2337 /// ```
2338 pub fn set_iam_policy(&self) -> super::builder::cmek_service::SetIamPolicy {
2339 super::builder::cmek_service::SetIamPolicy::new(self.inner.clone())
2340 }
2341
2342 /// Gets the access control policy for a resource. Returns an empty policy
2343 /// if the resource exists and does not have a policy set.
2344 ///
2345 /// # Example
2346 /// ```
2347 /// # use google_cloud_dataplex_v1::client::CmekService;
2348 /// use google_cloud_dataplex_v1::Result;
2349 /// async fn sample(
2350 /// client: &CmekService
2351 /// ) -> Result<()> {
2352 /// let response = client.get_iam_policy()
2353 /// /* set fields */
2354 /// .send().await?;
2355 /// println!("response {:?}", response);
2356 /// Ok(())
2357 /// }
2358 /// ```
2359 pub fn get_iam_policy(&self) -> super::builder::cmek_service::GetIamPolicy {
2360 super::builder::cmek_service::GetIamPolicy::new(self.inner.clone())
2361 }
2362
2363 /// Returns permissions that a caller has on the specified resource. If the
2364 /// resource does not exist, this will return an empty set of
2365 /// permissions, not a `NOT_FOUND` error.
2366 ///
2367 /// Note: This operation is designed to be used for building
2368 /// permission-aware UIs and command-line tools, not for authorization
2369 /// checking. This operation may "fail open" without warning.
2370 ///
2371 /// # Example
2372 /// ```
2373 /// # use google_cloud_dataplex_v1::client::CmekService;
2374 /// use google_cloud_dataplex_v1::Result;
2375 /// async fn sample(
2376 /// client: &CmekService
2377 /// ) -> Result<()> {
2378 /// let response = client.test_iam_permissions()
2379 /// /* set fields */
2380 /// .send().await?;
2381 /// println!("response {:?}", response);
2382 /// Ok(())
2383 /// }
2384 /// ```
2385 pub fn test_iam_permissions(&self) -> super::builder::cmek_service::TestIamPermissions {
2386 super::builder::cmek_service::TestIamPermissions::new(self.inner.clone())
2387 }
2388
2389 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2390 ///
2391 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2392 ///
2393 /// # Example
2394 /// ```
2395 /// # use google_cloud_dataplex_v1::client::CmekService;
2396 /// use google_cloud_gax::paginator::ItemPaginator as _;
2397 /// use google_cloud_dataplex_v1::Result;
2398 /// async fn sample(
2399 /// client: &CmekService
2400 /// ) -> Result<()> {
2401 /// let mut list = client.list_operations()
2402 /// /* set fields */
2403 /// .by_item();
2404 /// while let Some(item) = list.next().await.transpose()? {
2405 /// println!("{:?}", item);
2406 /// }
2407 /// Ok(())
2408 /// }
2409 /// ```
2410 pub fn list_operations(&self) -> super::builder::cmek_service::ListOperations {
2411 super::builder::cmek_service::ListOperations::new(self.inner.clone())
2412 }
2413
2414 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2415 ///
2416 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2417 ///
2418 /// # Example
2419 /// ```
2420 /// # use google_cloud_dataplex_v1::client::CmekService;
2421 /// use google_cloud_dataplex_v1::Result;
2422 /// async fn sample(
2423 /// client: &CmekService
2424 /// ) -> Result<()> {
2425 /// let response = client.get_operation()
2426 /// /* set fields */
2427 /// .send().await?;
2428 /// println!("response {:?}", response);
2429 /// Ok(())
2430 /// }
2431 /// ```
2432 pub fn get_operation(&self) -> super::builder::cmek_service::GetOperation {
2433 super::builder::cmek_service::GetOperation::new(self.inner.clone())
2434 }
2435
2436 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2437 ///
2438 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2439 ///
2440 /// # Example
2441 /// ```
2442 /// # use google_cloud_dataplex_v1::client::CmekService;
2443 /// use google_cloud_dataplex_v1::Result;
2444 /// async fn sample(
2445 /// client: &CmekService
2446 /// ) -> Result<()> {
2447 /// client.delete_operation()
2448 /// /* set fields */
2449 /// .send().await?;
2450 /// Ok(())
2451 /// }
2452 /// ```
2453 pub fn delete_operation(&self) -> super::builder::cmek_service::DeleteOperation {
2454 super::builder::cmek_service::DeleteOperation::new(self.inner.clone())
2455 }
2456
2457 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2458 ///
2459 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2460 ///
2461 /// # Example
2462 /// ```
2463 /// # use google_cloud_dataplex_v1::client::CmekService;
2464 /// use google_cloud_dataplex_v1::Result;
2465 /// async fn sample(
2466 /// client: &CmekService
2467 /// ) -> Result<()> {
2468 /// client.cancel_operation()
2469 /// /* set fields */
2470 /// .send().await?;
2471 /// Ok(())
2472 /// }
2473 /// ```
2474 pub fn cancel_operation(&self) -> super::builder::cmek_service::CancelOperation {
2475 super::builder::cmek_service::CancelOperation::new(self.inner.clone())
2476 }
2477}
2478
2479/// Implements a client for the Cloud Dataplex API.
2480///
2481/// # Example
2482/// ```
2483/// # use google_cloud_dataplex_v1::client::ContentService;
2484/// use google_cloud_gax::paginator::ItemPaginator as _;
2485/// async fn sample(
2486/// ) -> anyhow::Result<()> {
2487/// let client = ContentService::builder().build().await?;
2488/// let mut list = client.list_locations()
2489/// /* set fields */
2490/// .by_item();
2491/// while let Some(item) = list.next().await.transpose()? {
2492/// println!("{:?}", item);
2493/// }
2494/// Ok(())
2495/// }
2496/// ```
2497///
2498/// # Service Description
2499///
2500/// ContentService manages Notebook and SQL Scripts for Dataplex Universal
2501/// Catalog.
2502///
2503/// # Configuration
2504///
2505/// To configure `ContentService` use the `with_*` methods in the type returned
2506/// by [builder()][ContentService::builder]. The default configuration should
2507/// work for most applications. Common configuration changes include
2508///
2509/// * [with_endpoint()]: by default this client uses the global default endpoint
2510/// (`https://dataplex.googleapis.com`). Applications using regional
2511/// endpoints or running in restricted networks (e.g. a network configured
2512// with [Private Google Access with VPC Service Controls]) may want to
2513/// override this default.
2514/// * [with_credentials()]: by default this client uses
2515/// [Application Default Credentials]. Applications using custom
2516/// authentication may need to override this default.
2517///
2518/// [with_endpoint()]: super::builder::content_service::ClientBuilder::with_endpoint
2519/// [with_credentials()]: super::builder::content_service::ClientBuilder::with_credentials
2520/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2521/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2522///
2523/// # Pooling and Cloning
2524///
2525/// `ContentService` holds a connection pool internally, it is advised to
2526/// create one and reuse it. You do not need to wrap `ContentService` in
2527/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2528/// already uses an `Arc` internally.
2529#[derive(Clone, Debug)]
2530pub struct ContentService {
2531 inner: std::sync::Arc<dyn super::stub::dynamic::ContentService>,
2532}
2533
2534impl ContentService {
2535 /// Returns a builder for [ContentService].
2536 ///
2537 /// ```
2538 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2539 /// # use google_cloud_dataplex_v1::client::ContentService;
2540 /// let client = ContentService::builder().build().await?;
2541 /// # Ok(()) }
2542 /// ```
2543 pub fn builder() -> super::builder::content_service::ClientBuilder {
2544 crate::new_client_builder(super::builder::content_service::client::Factory)
2545 }
2546
2547 /// Creates a new client from the provided stub.
2548 ///
2549 /// The most common case for calling this function is in tests mocking the
2550 /// client's behavior.
2551 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2552 where
2553 T: super::stub::ContentService + 'static,
2554 {
2555 Self { inner: stub.into() }
2556 }
2557
2558 pub(crate) async fn new(
2559 config: gaxi::options::ClientConfig,
2560 ) -> crate::ClientBuilderResult<Self> {
2561 let inner = Self::build_inner(config).await?;
2562 Ok(Self { inner })
2563 }
2564
2565 async fn build_inner(
2566 conf: gaxi::options::ClientConfig,
2567 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ContentService>> {
2568 if gaxi::options::tracing_enabled(&conf) {
2569 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2570 }
2571 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2572 }
2573
2574 async fn build_transport(
2575 conf: gaxi::options::ClientConfig,
2576 ) -> crate::ClientBuilderResult<impl super::stub::ContentService> {
2577 super::transport::ContentService::new(conf).await
2578 }
2579
2580 async fn build_with_tracing(
2581 conf: gaxi::options::ClientConfig,
2582 ) -> crate::ClientBuilderResult<impl super::stub::ContentService> {
2583 Self::build_transport(conf)
2584 .await
2585 .map(super::tracing::ContentService::new)
2586 }
2587
2588 /// Lists information about the supported locations for this service.
2589 /// This method can be called in two ways:
2590 ///
2591 /// * **List all public locations:** Use the path `GET /v1/locations`.
2592 /// * **List project-visible locations:** Use the path
2593 /// `GET /v1/projects/{project_id}/locations`. This may include public
2594 /// locations as well as private or other locations specifically visible
2595 /// to the project.
2596 ///
2597 /// # Example
2598 /// ```
2599 /// # use google_cloud_dataplex_v1::client::ContentService;
2600 /// use google_cloud_gax::paginator::ItemPaginator as _;
2601 /// use google_cloud_dataplex_v1::Result;
2602 /// async fn sample(
2603 /// client: &ContentService
2604 /// ) -> Result<()> {
2605 /// let mut list = client.list_locations()
2606 /// /* set fields */
2607 /// .by_item();
2608 /// while let Some(item) = list.next().await.transpose()? {
2609 /// println!("{:?}", item);
2610 /// }
2611 /// Ok(())
2612 /// }
2613 /// ```
2614 pub fn list_locations(&self) -> super::builder::content_service::ListLocations {
2615 super::builder::content_service::ListLocations::new(self.inner.clone())
2616 }
2617
2618 /// Gets information about a location.
2619 ///
2620 /// # Example
2621 /// ```
2622 /// # use google_cloud_dataplex_v1::client::ContentService;
2623 /// use google_cloud_dataplex_v1::Result;
2624 /// async fn sample(
2625 /// client: &ContentService
2626 /// ) -> Result<()> {
2627 /// let response = client.get_location()
2628 /// /* set fields */
2629 /// .send().await?;
2630 /// println!("response {:?}", response);
2631 /// Ok(())
2632 /// }
2633 /// ```
2634 pub fn get_location(&self) -> super::builder::content_service::GetLocation {
2635 super::builder::content_service::GetLocation::new(self.inner.clone())
2636 }
2637
2638 /// Sets the access control policy on the specified resource. Replaces
2639 /// any existing policy.
2640 ///
2641 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2642 /// errors.
2643 ///
2644 /// # Example
2645 /// ```
2646 /// # use google_cloud_dataplex_v1::client::ContentService;
2647 /// use google_cloud_dataplex_v1::Result;
2648 /// async fn sample(
2649 /// client: &ContentService
2650 /// ) -> Result<()> {
2651 /// let response = client.set_iam_policy()
2652 /// /* set fields */
2653 /// .send().await?;
2654 /// println!("response {:?}", response);
2655 /// Ok(())
2656 /// }
2657 /// ```
2658 pub fn set_iam_policy(&self) -> super::builder::content_service::SetIamPolicy {
2659 super::builder::content_service::SetIamPolicy::new(self.inner.clone())
2660 }
2661
2662 /// Gets the access control policy for a resource. Returns an empty policy
2663 /// if the resource exists and does not have a policy set.
2664 ///
2665 /// # Example
2666 /// ```
2667 /// # use google_cloud_dataplex_v1::client::ContentService;
2668 /// use google_cloud_dataplex_v1::Result;
2669 /// async fn sample(
2670 /// client: &ContentService
2671 /// ) -> Result<()> {
2672 /// let response = client.get_iam_policy()
2673 /// /* set fields */
2674 /// .send().await?;
2675 /// println!("response {:?}", response);
2676 /// Ok(())
2677 /// }
2678 /// ```
2679 pub fn get_iam_policy(&self) -> super::builder::content_service::GetIamPolicy {
2680 super::builder::content_service::GetIamPolicy::new(self.inner.clone())
2681 }
2682
2683 /// Returns permissions that a caller has on the specified resource. If the
2684 /// resource does not exist, this will return an empty set of
2685 /// permissions, not a `NOT_FOUND` error.
2686 ///
2687 /// Note: This operation is designed to be used for building
2688 /// permission-aware UIs and command-line tools, not for authorization
2689 /// checking. This operation may "fail open" without warning.
2690 ///
2691 /// # Example
2692 /// ```
2693 /// # use google_cloud_dataplex_v1::client::ContentService;
2694 /// use google_cloud_dataplex_v1::Result;
2695 /// async fn sample(
2696 /// client: &ContentService
2697 /// ) -> Result<()> {
2698 /// let response = client.test_iam_permissions()
2699 /// /* set fields */
2700 /// .send().await?;
2701 /// println!("response {:?}", response);
2702 /// Ok(())
2703 /// }
2704 /// ```
2705 pub fn test_iam_permissions(&self) -> super::builder::content_service::TestIamPermissions {
2706 super::builder::content_service::TestIamPermissions::new(self.inner.clone())
2707 }
2708
2709 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2710 ///
2711 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2712 ///
2713 /// # Example
2714 /// ```
2715 /// # use google_cloud_dataplex_v1::client::ContentService;
2716 /// use google_cloud_gax::paginator::ItemPaginator as _;
2717 /// use google_cloud_dataplex_v1::Result;
2718 /// async fn sample(
2719 /// client: &ContentService
2720 /// ) -> Result<()> {
2721 /// let mut list = client.list_operations()
2722 /// /* set fields */
2723 /// .by_item();
2724 /// while let Some(item) = list.next().await.transpose()? {
2725 /// println!("{:?}", item);
2726 /// }
2727 /// Ok(())
2728 /// }
2729 /// ```
2730 pub fn list_operations(&self) -> super::builder::content_service::ListOperations {
2731 super::builder::content_service::ListOperations::new(self.inner.clone())
2732 }
2733
2734 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2735 ///
2736 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2737 ///
2738 /// # Example
2739 /// ```
2740 /// # use google_cloud_dataplex_v1::client::ContentService;
2741 /// use google_cloud_dataplex_v1::Result;
2742 /// async fn sample(
2743 /// client: &ContentService
2744 /// ) -> Result<()> {
2745 /// let response = client.get_operation()
2746 /// /* set fields */
2747 /// .send().await?;
2748 /// println!("response {:?}", response);
2749 /// Ok(())
2750 /// }
2751 /// ```
2752 pub fn get_operation(&self) -> super::builder::content_service::GetOperation {
2753 super::builder::content_service::GetOperation::new(self.inner.clone())
2754 }
2755
2756 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2757 ///
2758 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2759 ///
2760 /// # Example
2761 /// ```
2762 /// # use google_cloud_dataplex_v1::client::ContentService;
2763 /// use google_cloud_dataplex_v1::Result;
2764 /// async fn sample(
2765 /// client: &ContentService
2766 /// ) -> Result<()> {
2767 /// client.delete_operation()
2768 /// /* set fields */
2769 /// .send().await?;
2770 /// Ok(())
2771 /// }
2772 /// ```
2773 pub fn delete_operation(&self) -> super::builder::content_service::DeleteOperation {
2774 super::builder::content_service::DeleteOperation::new(self.inner.clone())
2775 }
2776
2777 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2778 ///
2779 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2780 ///
2781 /// # Example
2782 /// ```
2783 /// # use google_cloud_dataplex_v1::client::ContentService;
2784 /// use google_cloud_dataplex_v1::Result;
2785 /// async fn sample(
2786 /// client: &ContentService
2787 /// ) -> Result<()> {
2788 /// client.cancel_operation()
2789 /// /* set fields */
2790 /// .send().await?;
2791 /// Ok(())
2792 /// }
2793 /// ```
2794 pub fn cancel_operation(&self) -> super::builder::content_service::CancelOperation {
2795 super::builder::content_service::CancelOperation::new(self.inner.clone())
2796 }
2797}
2798
2799/// Implements a client for the Cloud Dataplex API.
2800///
2801/// # Example
2802/// ```
2803/// # use google_cloud_dataplex_v1::client::DataProductService;
2804/// use google_cloud_gax::paginator::ItemPaginator as _;
2805/// async fn sample(
2806/// parent: &str,
2807/// ) -> anyhow::Result<()> {
2808/// let client = DataProductService::builder().build().await?;
2809/// let mut list = client.list_data_products()
2810/// .set_parent(parent)
2811/// .by_item();
2812/// while let Some(item) = list.next().await.transpose()? {
2813/// println!("{:?}", item);
2814/// }
2815/// Ok(())
2816/// }
2817/// ```
2818///
2819/// # Service Description
2820///
2821/// `DataProductService` provides APIs for managing data products and
2822/// the underlying data assets.
2823///
2824/// # Configuration
2825///
2826/// To configure `DataProductService` use the `with_*` methods in the type returned
2827/// by [builder()][DataProductService::builder]. The default configuration should
2828/// work for most applications. Common configuration changes include
2829///
2830/// * [with_endpoint()]: by default this client uses the global default endpoint
2831/// (`https://dataplex.googleapis.com`). Applications using regional
2832/// endpoints or running in restricted networks (e.g. a network configured
2833// with [Private Google Access with VPC Service Controls]) may want to
2834/// override this default.
2835/// * [with_credentials()]: by default this client uses
2836/// [Application Default Credentials]. Applications using custom
2837/// authentication may need to override this default.
2838///
2839/// [with_endpoint()]: super::builder::data_product_service::ClientBuilder::with_endpoint
2840/// [with_credentials()]: super::builder::data_product_service::ClientBuilder::with_credentials
2841/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2842/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2843///
2844/// # Pooling and Cloning
2845///
2846/// `DataProductService` holds a connection pool internally, it is advised to
2847/// create one and reuse it. You do not need to wrap `DataProductService` in
2848/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2849/// already uses an `Arc` internally.
2850#[derive(Clone, Debug)]
2851pub struct DataProductService {
2852 inner: std::sync::Arc<dyn super::stub::dynamic::DataProductService>,
2853}
2854
2855impl DataProductService {
2856 /// Returns a builder for [DataProductService].
2857 ///
2858 /// ```
2859 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2860 /// # use google_cloud_dataplex_v1::client::DataProductService;
2861 /// let client = DataProductService::builder().build().await?;
2862 /// # Ok(()) }
2863 /// ```
2864 pub fn builder() -> super::builder::data_product_service::ClientBuilder {
2865 crate::new_client_builder(super::builder::data_product_service::client::Factory)
2866 }
2867
2868 /// Creates a new client from the provided stub.
2869 ///
2870 /// The most common case for calling this function is in tests mocking the
2871 /// client's behavior.
2872 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2873 where
2874 T: super::stub::DataProductService + 'static,
2875 {
2876 Self { inner: stub.into() }
2877 }
2878
2879 pub(crate) async fn new(
2880 config: gaxi::options::ClientConfig,
2881 ) -> crate::ClientBuilderResult<Self> {
2882 let inner = Self::build_inner(config).await?;
2883 Ok(Self { inner })
2884 }
2885
2886 async fn build_inner(
2887 conf: gaxi::options::ClientConfig,
2888 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataProductService>>
2889 {
2890 if gaxi::options::tracing_enabled(&conf) {
2891 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2892 }
2893 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2894 }
2895
2896 async fn build_transport(
2897 conf: gaxi::options::ClientConfig,
2898 ) -> crate::ClientBuilderResult<impl super::stub::DataProductService> {
2899 super::transport::DataProductService::new(conf).await
2900 }
2901
2902 async fn build_with_tracing(
2903 conf: gaxi::options::ClientConfig,
2904 ) -> crate::ClientBuilderResult<impl super::stub::DataProductService> {
2905 Self::build_transport(conf)
2906 .await
2907 .map(super::tracing::DataProductService::new)
2908 }
2909
2910 /// Creates a data product.
2911 ///
2912 /// # Long running operations
2913 ///
2914 /// This method is used to start, and/or poll a [long-running Operation].
2915 /// The [Working with long-running operations] chapter in the [user guide]
2916 /// covers these operations in detail.
2917 ///
2918 /// [long-running operation]: https://google.aip.dev/151
2919 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2920 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2921 ///
2922 /// # Example
2923 /// ```
2924 /// # use google_cloud_dataplex_v1::client::DataProductService;
2925 /// use google_cloud_lro::Poller;
2926 /// use google_cloud_dataplex_v1::model::DataProduct;
2927 /// use google_cloud_dataplex_v1::Result;
2928 /// async fn sample(
2929 /// client: &DataProductService, parent: &str
2930 /// ) -> Result<()> {
2931 /// let response = client.create_data_product()
2932 /// .set_parent(parent)
2933 /// .set_data_product(
2934 /// DataProduct::new()/* set fields */
2935 /// )
2936 /// .poller().until_done().await?;
2937 /// println!("response {:?}", response);
2938 /// Ok(())
2939 /// }
2940 /// ```
2941 pub fn create_data_product(&self) -> super::builder::data_product_service::CreateDataProduct {
2942 super::builder::data_product_service::CreateDataProduct::new(self.inner.clone())
2943 }
2944
2945 /// Deletes a data product. The deletion will fail if the data product is not
2946 /// empty (i.e. contains at least one data asset).
2947 ///
2948 /// # Long running operations
2949 ///
2950 /// This method is used to start, and/or poll a [long-running Operation].
2951 /// The [Working with long-running operations] chapter in the [user guide]
2952 /// covers these operations in detail.
2953 ///
2954 /// [long-running operation]: https://google.aip.dev/151
2955 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2956 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2957 ///
2958 /// # Example
2959 /// ```
2960 /// # use google_cloud_dataplex_v1::client::DataProductService;
2961 /// use google_cloud_lro::Poller;
2962 /// use google_cloud_dataplex_v1::Result;
2963 /// async fn sample(
2964 /// client: &DataProductService, project_id: &str, location_id: &str, data_product_id: &str
2965 /// ) -> Result<()> {
2966 /// client.delete_data_product()
2967 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"))
2968 /// .poller().until_done().await?;
2969 /// Ok(())
2970 /// }
2971 /// ```
2972 pub fn delete_data_product(&self) -> super::builder::data_product_service::DeleteDataProduct {
2973 super::builder::data_product_service::DeleteDataProduct::new(self.inner.clone())
2974 }
2975
2976 /// Gets a data product.
2977 ///
2978 /// # Example
2979 /// ```
2980 /// # use google_cloud_dataplex_v1::client::DataProductService;
2981 /// use google_cloud_dataplex_v1::Result;
2982 /// async fn sample(
2983 /// client: &DataProductService, project_id: &str, location_id: &str, data_product_id: &str
2984 /// ) -> Result<()> {
2985 /// let response = client.get_data_product()
2986 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"))
2987 /// .send().await?;
2988 /// println!("response {:?}", response);
2989 /// Ok(())
2990 /// }
2991 /// ```
2992 pub fn get_data_product(&self) -> super::builder::data_product_service::GetDataProduct {
2993 super::builder::data_product_service::GetDataProduct::new(self.inner.clone())
2994 }
2995
2996 /// Lists data products for a given project.
2997 ///
2998 /// # Example
2999 /// ```
3000 /// # use google_cloud_dataplex_v1::client::DataProductService;
3001 /// use google_cloud_gax::paginator::ItemPaginator as _;
3002 /// use google_cloud_dataplex_v1::Result;
3003 /// async fn sample(
3004 /// client: &DataProductService, parent: &str
3005 /// ) -> Result<()> {
3006 /// let mut list = client.list_data_products()
3007 /// .set_parent(parent)
3008 /// .by_item();
3009 /// while let Some(item) = list.next().await.transpose()? {
3010 /// println!("{:?}", item);
3011 /// }
3012 /// Ok(())
3013 /// }
3014 /// ```
3015 pub fn list_data_products(&self) -> super::builder::data_product_service::ListDataProducts {
3016 super::builder::data_product_service::ListDataProducts::new(self.inner.clone())
3017 }
3018
3019 /// Updates a data product.
3020 ///
3021 /// # Long running operations
3022 ///
3023 /// This method is used to start, and/or poll a [long-running Operation].
3024 /// The [Working with long-running operations] chapter in the [user guide]
3025 /// covers these operations in detail.
3026 ///
3027 /// [long-running operation]: https://google.aip.dev/151
3028 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3029 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3030 ///
3031 /// # Example
3032 /// ```
3033 /// # use google_cloud_dataplex_v1::client::DataProductService;
3034 /// use google_cloud_lro::Poller;
3035 /// # extern crate wkt as google_cloud_wkt;
3036 /// use google_cloud_wkt::FieldMask;
3037 /// use google_cloud_dataplex_v1::model::DataProduct;
3038 /// use google_cloud_dataplex_v1::Result;
3039 /// async fn sample(
3040 /// client: &DataProductService, project_id: &str, location_id: &str, data_product_id: &str
3041 /// ) -> Result<()> {
3042 /// let response = client.update_data_product()
3043 /// .set_data_product(
3044 /// DataProduct::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"))/* set fields */
3045 /// )
3046 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
3047 /// .poller().until_done().await?;
3048 /// println!("response {:?}", response);
3049 /// Ok(())
3050 /// }
3051 /// ```
3052 pub fn update_data_product(&self) -> super::builder::data_product_service::UpdateDataProduct {
3053 super::builder::data_product_service::UpdateDataProduct::new(self.inner.clone())
3054 }
3055
3056 /// Creates a data asset.
3057 ///
3058 /// # Long running operations
3059 ///
3060 /// This method is used to start, and/or poll a [long-running Operation].
3061 /// The [Working with long-running operations] chapter in the [user guide]
3062 /// covers these operations in detail.
3063 ///
3064 /// [long-running operation]: https://google.aip.dev/151
3065 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3066 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3067 ///
3068 /// # Example
3069 /// ```
3070 /// # use google_cloud_dataplex_v1::client::DataProductService;
3071 /// use google_cloud_lro::Poller;
3072 /// use google_cloud_dataplex_v1::model::DataAsset;
3073 /// use google_cloud_dataplex_v1::Result;
3074 /// async fn sample(
3075 /// client: &DataProductService, project_id: &str, location_id: &str, data_product_id: &str
3076 /// ) -> Result<()> {
3077 /// let response = client.create_data_asset()
3078 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"))
3079 /// .set_data_asset(
3080 /// DataAsset::new()/* set fields */
3081 /// )
3082 /// .poller().until_done().await?;
3083 /// println!("response {:?}", response);
3084 /// Ok(())
3085 /// }
3086 /// ```
3087 pub fn create_data_asset(&self) -> super::builder::data_product_service::CreateDataAsset {
3088 super::builder::data_product_service::CreateDataAsset::new(self.inner.clone())
3089 }
3090
3091 /// Updates a data asset.
3092 ///
3093 /// # Long running operations
3094 ///
3095 /// This method is used to start, and/or poll a [long-running Operation].
3096 /// The [Working with long-running operations] chapter in the [user guide]
3097 /// covers these operations in detail.
3098 ///
3099 /// [long-running operation]: https://google.aip.dev/151
3100 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3101 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3102 ///
3103 /// # Example
3104 /// ```
3105 /// # use google_cloud_dataplex_v1::client::DataProductService;
3106 /// use google_cloud_lro::Poller;
3107 /// # extern crate wkt as google_cloud_wkt;
3108 /// use google_cloud_wkt::FieldMask;
3109 /// use google_cloud_dataplex_v1::model::DataAsset;
3110 /// use google_cloud_dataplex_v1::Result;
3111 /// async fn sample(
3112 /// client: &DataProductService, project_id: &str, location_id: &str, data_product_id: &str, data_asset_id: &str
3113 /// ) -> Result<()> {
3114 /// let response = client.update_data_asset()
3115 /// .set_data_asset(
3116 /// DataAsset::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}"))/* set fields */
3117 /// )
3118 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
3119 /// .poller().until_done().await?;
3120 /// println!("response {:?}", response);
3121 /// Ok(())
3122 /// }
3123 /// ```
3124 pub fn update_data_asset(&self) -> super::builder::data_product_service::UpdateDataAsset {
3125 super::builder::data_product_service::UpdateDataAsset::new(self.inner.clone())
3126 }
3127
3128 /// Deletes a data asset.
3129 ///
3130 /// # Long running operations
3131 ///
3132 /// This method is used to start, and/or poll a [long-running Operation].
3133 /// The [Working with long-running operations] chapter in the [user guide]
3134 /// covers these operations in detail.
3135 ///
3136 /// [long-running operation]: https://google.aip.dev/151
3137 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3138 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3139 ///
3140 /// # Example
3141 /// ```
3142 /// # use google_cloud_dataplex_v1::client::DataProductService;
3143 /// use google_cloud_lro::Poller;
3144 /// use google_cloud_dataplex_v1::Result;
3145 /// async fn sample(
3146 /// client: &DataProductService, project_id: &str, location_id: &str, data_product_id: &str, data_asset_id: &str
3147 /// ) -> Result<()> {
3148 /// client.delete_data_asset()
3149 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}"))
3150 /// .poller().until_done().await?;
3151 /// Ok(())
3152 /// }
3153 /// ```
3154 pub fn delete_data_asset(&self) -> super::builder::data_product_service::DeleteDataAsset {
3155 super::builder::data_product_service::DeleteDataAsset::new(self.inner.clone())
3156 }
3157
3158 /// Gets a data asset.
3159 ///
3160 /// # Example
3161 /// ```
3162 /// # use google_cloud_dataplex_v1::client::DataProductService;
3163 /// use google_cloud_dataplex_v1::Result;
3164 /// async fn sample(
3165 /// client: &DataProductService, project_id: &str, location_id: &str, data_product_id: &str, data_asset_id: &str
3166 /// ) -> Result<()> {
3167 /// let response = client.get_data_asset()
3168 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}"))
3169 /// .send().await?;
3170 /// println!("response {:?}", response);
3171 /// Ok(())
3172 /// }
3173 /// ```
3174 pub fn get_data_asset(&self) -> super::builder::data_product_service::GetDataAsset {
3175 super::builder::data_product_service::GetDataAsset::new(self.inner.clone())
3176 }
3177
3178 /// Lists data assets for a given data product.
3179 ///
3180 /// # Example
3181 /// ```
3182 /// # use google_cloud_dataplex_v1::client::DataProductService;
3183 /// use google_cloud_gax::paginator::ItemPaginator as _;
3184 /// use google_cloud_dataplex_v1::Result;
3185 /// async fn sample(
3186 /// client: &DataProductService, project_id: &str, location_id: &str, data_product_id: &str
3187 /// ) -> Result<()> {
3188 /// let mut list = client.list_data_assets()
3189 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/dataProducts/{data_product_id}"))
3190 /// .by_item();
3191 /// while let Some(item) = list.next().await.transpose()? {
3192 /// println!("{:?}", item);
3193 /// }
3194 /// Ok(())
3195 /// }
3196 /// ```
3197 pub fn list_data_assets(&self) -> super::builder::data_product_service::ListDataAssets {
3198 super::builder::data_product_service::ListDataAssets::new(self.inner.clone())
3199 }
3200
3201 /// Lists information about the supported locations for this service.
3202 /// This method can be called in two ways:
3203 ///
3204 /// * **List all public locations:** Use the path `GET /v1/locations`.
3205 /// * **List project-visible locations:** Use the path
3206 /// `GET /v1/projects/{project_id}/locations`. This may include public
3207 /// locations as well as private or other locations specifically visible
3208 /// to the project.
3209 ///
3210 /// # Example
3211 /// ```
3212 /// # use google_cloud_dataplex_v1::client::DataProductService;
3213 /// use google_cloud_gax::paginator::ItemPaginator as _;
3214 /// use google_cloud_dataplex_v1::Result;
3215 /// async fn sample(
3216 /// client: &DataProductService
3217 /// ) -> Result<()> {
3218 /// let mut list = client.list_locations()
3219 /// /* set fields */
3220 /// .by_item();
3221 /// while let Some(item) = list.next().await.transpose()? {
3222 /// println!("{:?}", item);
3223 /// }
3224 /// Ok(())
3225 /// }
3226 /// ```
3227 pub fn list_locations(&self) -> super::builder::data_product_service::ListLocations {
3228 super::builder::data_product_service::ListLocations::new(self.inner.clone())
3229 }
3230
3231 /// Gets information about a location.
3232 ///
3233 /// # Example
3234 /// ```
3235 /// # use google_cloud_dataplex_v1::client::DataProductService;
3236 /// use google_cloud_dataplex_v1::Result;
3237 /// async fn sample(
3238 /// client: &DataProductService
3239 /// ) -> Result<()> {
3240 /// let response = client.get_location()
3241 /// /* set fields */
3242 /// .send().await?;
3243 /// println!("response {:?}", response);
3244 /// Ok(())
3245 /// }
3246 /// ```
3247 pub fn get_location(&self) -> super::builder::data_product_service::GetLocation {
3248 super::builder::data_product_service::GetLocation::new(self.inner.clone())
3249 }
3250
3251 /// Sets the access control policy on the specified resource. Replaces
3252 /// any existing policy.
3253 ///
3254 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3255 /// errors.
3256 ///
3257 /// # Example
3258 /// ```
3259 /// # use google_cloud_dataplex_v1::client::DataProductService;
3260 /// use google_cloud_dataplex_v1::Result;
3261 /// async fn sample(
3262 /// client: &DataProductService
3263 /// ) -> Result<()> {
3264 /// let response = client.set_iam_policy()
3265 /// /* set fields */
3266 /// .send().await?;
3267 /// println!("response {:?}", response);
3268 /// Ok(())
3269 /// }
3270 /// ```
3271 pub fn set_iam_policy(&self) -> super::builder::data_product_service::SetIamPolicy {
3272 super::builder::data_product_service::SetIamPolicy::new(self.inner.clone())
3273 }
3274
3275 /// Gets the access control policy for a resource. Returns an empty policy
3276 /// if the resource exists and does not have a policy set.
3277 ///
3278 /// # Example
3279 /// ```
3280 /// # use google_cloud_dataplex_v1::client::DataProductService;
3281 /// use google_cloud_dataplex_v1::Result;
3282 /// async fn sample(
3283 /// client: &DataProductService
3284 /// ) -> Result<()> {
3285 /// let response = client.get_iam_policy()
3286 /// /* set fields */
3287 /// .send().await?;
3288 /// println!("response {:?}", response);
3289 /// Ok(())
3290 /// }
3291 /// ```
3292 pub fn get_iam_policy(&self) -> super::builder::data_product_service::GetIamPolicy {
3293 super::builder::data_product_service::GetIamPolicy::new(self.inner.clone())
3294 }
3295
3296 /// Returns permissions that a caller has on the specified resource. If the
3297 /// resource does not exist, this will return an empty set of
3298 /// permissions, not a `NOT_FOUND` error.
3299 ///
3300 /// Note: This operation is designed to be used for building
3301 /// permission-aware UIs and command-line tools, not for authorization
3302 /// checking. This operation may "fail open" without warning.
3303 ///
3304 /// # Example
3305 /// ```
3306 /// # use google_cloud_dataplex_v1::client::DataProductService;
3307 /// use google_cloud_dataplex_v1::Result;
3308 /// async fn sample(
3309 /// client: &DataProductService
3310 /// ) -> Result<()> {
3311 /// let response = client.test_iam_permissions()
3312 /// /* set fields */
3313 /// .send().await?;
3314 /// println!("response {:?}", response);
3315 /// Ok(())
3316 /// }
3317 /// ```
3318 pub fn test_iam_permissions(&self) -> super::builder::data_product_service::TestIamPermissions {
3319 super::builder::data_product_service::TestIamPermissions::new(self.inner.clone())
3320 }
3321
3322 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3323 ///
3324 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3325 ///
3326 /// # Example
3327 /// ```
3328 /// # use google_cloud_dataplex_v1::client::DataProductService;
3329 /// use google_cloud_gax::paginator::ItemPaginator as _;
3330 /// use google_cloud_dataplex_v1::Result;
3331 /// async fn sample(
3332 /// client: &DataProductService
3333 /// ) -> Result<()> {
3334 /// let mut list = client.list_operations()
3335 /// /* set fields */
3336 /// .by_item();
3337 /// while let Some(item) = list.next().await.transpose()? {
3338 /// println!("{:?}", item);
3339 /// }
3340 /// Ok(())
3341 /// }
3342 /// ```
3343 pub fn list_operations(&self) -> super::builder::data_product_service::ListOperations {
3344 super::builder::data_product_service::ListOperations::new(self.inner.clone())
3345 }
3346
3347 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3348 ///
3349 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3350 ///
3351 /// # Example
3352 /// ```
3353 /// # use google_cloud_dataplex_v1::client::DataProductService;
3354 /// use google_cloud_dataplex_v1::Result;
3355 /// async fn sample(
3356 /// client: &DataProductService
3357 /// ) -> Result<()> {
3358 /// let response = client.get_operation()
3359 /// /* set fields */
3360 /// .send().await?;
3361 /// println!("response {:?}", response);
3362 /// Ok(())
3363 /// }
3364 /// ```
3365 pub fn get_operation(&self) -> super::builder::data_product_service::GetOperation {
3366 super::builder::data_product_service::GetOperation::new(self.inner.clone())
3367 }
3368
3369 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3370 ///
3371 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3372 ///
3373 /// # Example
3374 /// ```
3375 /// # use google_cloud_dataplex_v1::client::DataProductService;
3376 /// use google_cloud_dataplex_v1::Result;
3377 /// async fn sample(
3378 /// client: &DataProductService
3379 /// ) -> Result<()> {
3380 /// client.delete_operation()
3381 /// /* set fields */
3382 /// .send().await?;
3383 /// Ok(())
3384 /// }
3385 /// ```
3386 pub fn delete_operation(&self) -> super::builder::data_product_service::DeleteOperation {
3387 super::builder::data_product_service::DeleteOperation::new(self.inner.clone())
3388 }
3389
3390 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3391 ///
3392 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3393 ///
3394 /// # Example
3395 /// ```
3396 /// # use google_cloud_dataplex_v1::client::DataProductService;
3397 /// use google_cloud_dataplex_v1::Result;
3398 /// async fn sample(
3399 /// client: &DataProductService
3400 /// ) -> Result<()> {
3401 /// client.cancel_operation()
3402 /// /* set fields */
3403 /// .send().await?;
3404 /// Ok(())
3405 /// }
3406 /// ```
3407 pub fn cancel_operation(&self) -> super::builder::data_product_service::CancelOperation {
3408 super::builder::data_product_service::CancelOperation::new(self.inner.clone())
3409 }
3410}
3411
3412/// Implements a client for the Cloud Dataplex API.
3413///
3414/// # Example
3415/// ```
3416/// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3417/// use google_cloud_gax::paginator::ItemPaginator as _;
3418/// async fn sample(
3419/// parent: &str,
3420/// ) -> anyhow::Result<()> {
3421/// let client = DataTaxonomyService::builder().build().await?;
3422/// let mut list = client.list_data_taxonomies()
3423/// .set_parent(parent)
3424/// .by_item();
3425/// while let Some(item) = list.next().await.transpose()? {
3426/// println!("{:?}", item);
3427/// }
3428/// Ok(())
3429/// }
3430/// ```
3431///
3432/// # Service Description
3433///
3434/// DataTaxonomyService enables attribute-based governance. The resources
3435/// currently offered include DataTaxonomy and DataAttribute.
3436///
3437/// # Configuration
3438///
3439/// To configure `DataTaxonomyService` use the `with_*` methods in the type returned
3440/// by [builder()][DataTaxonomyService::builder]. The default configuration should
3441/// work for most applications. Common configuration changes include
3442///
3443/// * [with_endpoint()]: by default this client uses the global default endpoint
3444/// (`https://dataplex.googleapis.com`). Applications using regional
3445/// endpoints or running in restricted networks (e.g. a network configured
3446// with [Private Google Access with VPC Service Controls]) may want to
3447/// override this default.
3448/// * [with_credentials()]: by default this client uses
3449/// [Application Default Credentials]. Applications using custom
3450/// authentication may need to override this default.
3451///
3452/// [with_endpoint()]: super::builder::data_taxonomy_service::ClientBuilder::with_endpoint
3453/// [with_credentials()]: super::builder::data_taxonomy_service::ClientBuilder::with_credentials
3454/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3455/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3456///
3457/// # Pooling and Cloning
3458///
3459/// `DataTaxonomyService` holds a connection pool internally, it is advised to
3460/// create one and reuse it. You do not need to wrap `DataTaxonomyService` in
3461/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3462/// already uses an `Arc` internally.
3463#[derive(Clone, Debug)]
3464#[deprecated]
3465pub struct DataTaxonomyService {
3466 inner: std::sync::Arc<dyn super::stub::dynamic::DataTaxonomyService>,
3467}
3468
3469impl DataTaxonomyService {
3470 /// Returns a builder for [DataTaxonomyService].
3471 ///
3472 /// ```
3473 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3474 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3475 /// let client = DataTaxonomyService::builder().build().await?;
3476 /// # Ok(()) }
3477 /// ```
3478 pub fn builder() -> super::builder::data_taxonomy_service::ClientBuilder {
3479 crate::new_client_builder(super::builder::data_taxonomy_service::client::Factory)
3480 }
3481
3482 /// Creates a new client from the provided stub.
3483 ///
3484 /// The most common case for calling this function is in tests mocking the
3485 /// client's behavior.
3486 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3487 where
3488 T: super::stub::DataTaxonomyService + 'static,
3489 {
3490 Self { inner: stub.into() }
3491 }
3492
3493 pub(crate) async fn new(
3494 config: gaxi::options::ClientConfig,
3495 ) -> crate::ClientBuilderResult<Self> {
3496 let inner = Self::build_inner(config).await?;
3497 Ok(Self { inner })
3498 }
3499
3500 async fn build_inner(
3501 conf: gaxi::options::ClientConfig,
3502 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataTaxonomyService>>
3503 {
3504 if gaxi::options::tracing_enabled(&conf) {
3505 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3506 }
3507 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3508 }
3509
3510 async fn build_transport(
3511 conf: gaxi::options::ClientConfig,
3512 ) -> crate::ClientBuilderResult<impl super::stub::DataTaxonomyService> {
3513 super::transport::DataTaxonomyService::new(conf).await
3514 }
3515
3516 async fn build_with_tracing(
3517 conf: gaxi::options::ClientConfig,
3518 ) -> crate::ClientBuilderResult<impl super::stub::DataTaxonomyService> {
3519 Self::build_transport(conf)
3520 .await
3521 .map(super::tracing::DataTaxonomyService::new)
3522 }
3523
3524 /// Create a DataTaxonomy resource.
3525 ///
3526 /// # Long running operations
3527 ///
3528 /// This method is used to start, and/or poll a [long-running Operation].
3529 /// The [Working with long-running operations] chapter in the [user guide]
3530 /// covers these operations in detail.
3531 ///
3532 /// [long-running operation]: https://google.aip.dev/151
3533 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3534 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3535 ///
3536 /// # Example
3537 /// ```
3538 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3539 /// use google_cloud_lro::Poller;
3540 /// use google_cloud_dataplex_v1::model::DataTaxonomy;
3541 /// use google_cloud_dataplex_v1::Result;
3542 /// async fn sample(
3543 /// client: &DataTaxonomyService, parent: &str
3544 /// ) -> Result<()> {
3545 /// let response = client.create_data_taxonomy()
3546 /// .set_parent(parent)
3547 /// .set_data_taxonomy(
3548 /// DataTaxonomy::new()/* set fields */
3549 /// )
3550 /// .poller().until_done().await?;
3551 /// println!("response {:?}", response);
3552 /// Ok(())
3553 /// }
3554 /// ```
3555 #[deprecated]
3556 pub fn create_data_taxonomy(
3557 &self,
3558 ) -> super::builder::data_taxonomy_service::CreateDataTaxonomy {
3559 super::builder::data_taxonomy_service::CreateDataTaxonomy::new(self.inner.clone())
3560 }
3561
3562 /// Updates a DataTaxonomy resource.
3563 ///
3564 /// # Long running operations
3565 ///
3566 /// This method is used to start, and/or poll a [long-running Operation].
3567 /// The [Working with long-running operations] chapter in the [user guide]
3568 /// covers these operations in detail.
3569 ///
3570 /// [long-running operation]: https://google.aip.dev/151
3571 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3572 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3573 ///
3574 /// # Example
3575 /// ```
3576 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3577 /// use google_cloud_lro::Poller;
3578 /// # extern crate wkt as google_cloud_wkt;
3579 /// use google_cloud_wkt::FieldMask;
3580 /// use google_cloud_dataplex_v1::model::DataTaxonomy;
3581 /// use google_cloud_dataplex_v1::Result;
3582 /// async fn sample(
3583 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_taxonomy_id: &str
3584 /// ) -> Result<()> {
3585 /// let response = client.update_data_taxonomy()
3586 /// .set_data_taxonomy(
3587 /// DataTaxonomy::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"))/* set fields */
3588 /// )
3589 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
3590 /// .poller().until_done().await?;
3591 /// println!("response {:?}", response);
3592 /// Ok(())
3593 /// }
3594 /// ```
3595 #[deprecated]
3596 pub fn update_data_taxonomy(
3597 &self,
3598 ) -> super::builder::data_taxonomy_service::UpdateDataTaxonomy {
3599 super::builder::data_taxonomy_service::UpdateDataTaxonomy::new(self.inner.clone())
3600 }
3601
3602 /// Deletes a DataTaxonomy resource. All attributes within the DataTaxonomy
3603 /// must be deleted before the DataTaxonomy can be deleted.
3604 ///
3605 /// # Long running operations
3606 ///
3607 /// This method is used to start, and/or poll a [long-running Operation].
3608 /// The [Working with long-running operations] chapter in the [user guide]
3609 /// covers these operations in detail.
3610 ///
3611 /// [long-running operation]: https://google.aip.dev/151
3612 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3613 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3614 ///
3615 /// # Example
3616 /// ```
3617 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3618 /// use google_cloud_lro::Poller;
3619 /// use google_cloud_dataplex_v1::Result;
3620 /// async fn sample(
3621 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_taxonomy_id: &str
3622 /// ) -> Result<()> {
3623 /// client.delete_data_taxonomy()
3624 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"))
3625 /// .poller().until_done().await?;
3626 /// Ok(())
3627 /// }
3628 /// ```
3629 #[deprecated]
3630 pub fn delete_data_taxonomy(
3631 &self,
3632 ) -> super::builder::data_taxonomy_service::DeleteDataTaxonomy {
3633 super::builder::data_taxonomy_service::DeleteDataTaxonomy::new(self.inner.clone())
3634 }
3635
3636 /// Lists DataTaxonomy resources in a project and location.
3637 ///
3638 /// # Example
3639 /// ```
3640 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3641 /// use google_cloud_gax::paginator::ItemPaginator as _;
3642 /// use google_cloud_dataplex_v1::Result;
3643 /// async fn sample(
3644 /// client: &DataTaxonomyService, parent: &str
3645 /// ) -> Result<()> {
3646 /// let mut list = client.list_data_taxonomies()
3647 /// .set_parent(parent)
3648 /// .by_item();
3649 /// while let Some(item) = list.next().await.transpose()? {
3650 /// println!("{:?}", item);
3651 /// }
3652 /// Ok(())
3653 /// }
3654 /// ```
3655 #[deprecated]
3656 pub fn list_data_taxonomies(
3657 &self,
3658 ) -> super::builder::data_taxonomy_service::ListDataTaxonomies {
3659 super::builder::data_taxonomy_service::ListDataTaxonomies::new(self.inner.clone())
3660 }
3661
3662 /// Retrieves a DataTaxonomy resource.
3663 ///
3664 /// # Example
3665 /// ```
3666 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3667 /// use google_cloud_dataplex_v1::Result;
3668 /// async fn sample(
3669 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_taxonomy_id: &str
3670 /// ) -> Result<()> {
3671 /// let response = client.get_data_taxonomy()
3672 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"))
3673 /// .send().await?;
3674 /// println!("response {:?}", response);
3675 /// Ok(())
3676 /// }
3677 /// ```
3678 #[deprecated]
3679 pub fn get_data_taxonomy(&self) -> super::builder::data_taxonomy_service::GetDataTaxonomy {
3680 super::builder::data_taxonomy_service::GetDataTaxonomy::new(self.inner.clone())
3681 }
3682
3683 /// Create a DataAttributeBinding resource.
3684 ///
3685 /// # Long running operations
3686 ///
3687 /// This method is used to start, and/or poll a [long-running Operation].
3688 /// The [Working with long-running operations] chapter in the [user guide]
3689 /// covers these operations in detail.
3690 ///
3691 /// [long-running operation]: https://google.aip.dev/151
3692 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3693 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3694 ///
3695 /// # Example
3696 /// ```
3697 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3698 /// use google_cloud_lro::Poller;
3699 /// use google_cloud_dataplex_v1::model::DataAttributeBinding;
3700 /// use google_cloud_dataplex_v1::Result;
3701 /// async fn sample(
3702 /// client: &DataTaxonomyService, parent: &str
3703 /// ) -> Result<()> {
3704 /// let response = client.create_data_attribute_binding()
3705 /// .set_parent(parent)
3706 /// .set_data_attribute_binding(
3707 /// DataAttributeBinding::new()/* set fields */
3708 /// )
3709 /// .poller().until_done().await?;
3710 /// println!("response {:?}", response);
3711 /// Ok(())
3712 /// }
3713 /// ```
3714 #[deprecated]
3715 pub fn create_data_attribute_binding(
3716 &self,
3717 ) -> super::builder::data_taxonomy_service::CreateDataAttributeBinding {
3718 super::builder::data_taxonomy_service::CreateDataAttributeBinding::new(self.inner.clone())
3719 }
3720
3721 /// Updates a DataAttributeBinding resource.
3722 ///
3723 /// # Long running operations
3724 ///
3725 /// This method is used to start, and/or poll a [long-running Operation].
3726 /// The [Working with long-running operations] chapter in the [user guide]
3727 /// covers these operations in detail.
3728 ///
3729 /// [long-running operation]: https://google.aip.dev/151
3730 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3731 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3732 ///
3733 /// # Example
3734 /// ```
3735 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3736 /// use google_cloud_lro::Poller;
3737 /// # extern crate wkt as google_cloud_wkt;
3738 /// use google_cloud_wkt::FieldMask;
3739 /// use google_cloud_dataplex_v1::model::DataAttributeBinding;
3740 /// use google_cloud_dataplex_v1::Result;
3741 /// async fn sample(
3742 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_attribute_binding_id: &str
3743 /// ) -> Result<()> {
3744 /// let response = client.update_data_attribute_binding()
3745 /// .set_data_attribute_binding(
3746 /// DataAttributeBinding::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id}"))/* set fields */
3747 /// )
3748 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
3749 /// .poller().until_done().await?;
3750 /// println!("response {:?}", response);
3751 /// Ok(())
3752 /// }
3753 /// ```
3754 #[deprecated]
3755 pub fn update_data_attribute_binding(
3756 &self,
3757 ) -> super::builder::data_taxonomy_service::UpdateDataAttributeBinding {
3758 super::builder::data_taxonomy_service::UpdateDataAttributeBinding::new(self.inner.clone())
3759 }
3760
3761 /// Deletes a DataAttributeBinding resource. All attributes within the
3762 /// DataAttributeBinding must be deleted before the DataAttributeBinding can be
3763 /// deleted.
3764 ///
3765 /// # Long running operations
3766 ///
3767 /// This method is used to start, and/or poll a [long-running Operation].
3768 /// The [Working with long-running operations] chapter in the [user guide]
3769 /// covers these operations in detail.
3770 ///
3771 /// [long-running operation]: https://google.aip.dev/151
3772 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3773 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3774 ///
3775 /// # Example
3776 /// ```
3777 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3778 /// use google_cloud_lro::Poller;
3779 /// use google_cloud_dataplex_v1::Result;
3780 /// async fn sample(
3781 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_attribute_binding_id: &str
3782 /// ) -> Result<()> {
3783 /// client.delete_data_attribute_binding()
3784 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id}"))
3785 /// .poller().until_done().await?;
3786 /// Ok(())
3787 /// }
3788 /// ```
3789 #[deprecated]
3790 pub fn delete_data_attribute_binding(
3791 &self,
3792 ) -> super::builder::data_taxonomy_service::DeleteDataAttributeBinding {
3793 super::builder::data_taxonomy_service::DeleteDataAttributeBinding::new(self.inner.clone())
3794 }
3795
3796 /// Lists DataAttributeBinding resources in a project and location.
3797 ///
3798 /// # Example
3799 /// ```
3800 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3801 /// use google_cloud_gax::paginator::ItemPaginator as _;
3802 /// use google_cloud_dataplex_v1::Result;
3803 /// async fn sample(
3804 /// client: &DataTaxonomyService, parent: &str
3805 /// ) -> Result<()> {
3806 /// let mut list = client.list_data_attribute_bindings()
3807 /// .set_parent(parent)
3808 /// .by_item();
3809 /// while let Some(item) = list.next().await.transpose()? {
3810 /// println!("{:?}", item);
3811 /// }
3812 /// Ok(())
3813 /// }
3814 /// ```
3815 #[deprecated]
3816 pub fn list_data_attribute_bindings(
3817 &self,
3818 ) -> super::builder::data_taxonomy_service::ListDataAttributeBindings {
3819 super::builder::data_taxonomy_service::ListDataAttributeBindings::new(self.inner.clone())
3820 }
3821
3822 /// Retrieves a DataAttributeBinding resource.
3823 ///
3824 /// # Example
3825 /// ```
3826 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3827 /// use google_cloud_dataplex_v1::Result;
3828 /// async fn sample(
3829 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_attribute_binding_id: &str
3830 /// ) -> Result<()> {
3831 /// let response = client.get_data_attribute_binding()
3832 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataAttributeBindings/{data_attribute_binding_id}"))
3833 /// .send().await?;
3834 /// println!("response {:?}", response);
3835 /// Ok(())
3836 /// }
3837 /// ```
3838 #[deprecated]
3839 pub fn get_data_attribute_binding(
3840 &self,
3841 ) -> super::builder::data_taxonomy_service::GetDataAttributeBinding {
3842 super::builder::data_taxonomy_service::GetDataAttributeBinding::new(self.inner.clone())
3843 }
3844
3845 /// Create a DataAttribute resource.
3846 ///
3847 /// # Long running operations
3848 ///
3849 /// This method is used to start, and/or poll a [long-running Operation].
3850 /// The [Working with long-running operations] chapter in the [user guide]
3851 /// covers these operations in detail.
3852 ///
3853 /// [long-running operation]: https://google.aip.dev/151
3854 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3855 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3856 ///
3857 /// # Example
3858 /// ```
3859 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3860 /// use google_cloud_lro::Poller;
3861 /// use google_cloud_dataplex_v1::model::DataAttribute;
3862 /// use google_cloud_dataplex_v1::Result;
3863 /// async fn sample(
3864 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_taxonomy_id: &str
3865 /// ) -> Result<()> {
3866 /// let response = client.create_data_attribute()
3867 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"))
3868 /// .set_data_attribute(
3869 /// DataAttribute::new()/* set fields */
3870 /// )
3871 /// .poller().until_done().await?;
3872 /// println!("response {:?}", response);
3873 /// Ok(())
3874 /// }
3875 /// ```
3876 #[deprecated]
3877 pub fn create_data_attribute(
3878 &self,
3879 ) -> super::builder::data_taxonomy_service::CreateDataAttribute {
3880 super::builder::data_taxonomy_service::CreateDataAttribute::new(self.inner.clone())
3881 }
3882
3883 /// Updates a DataAttribute resource.
3884 ///
3885 /// # Long running operations
3886 ///
3887 /// This method is used to start, and/or poll a [long-running Operation].
3888 /// The [Working with long-running operations] chapter in the [user guide]
3889 /// covers these operations in detail.
3890 ///
3891 /// [long-running operation]: https://google.aip.dev/151
3892 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3893 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3894 ///
3895 /// # Example
3896 /// ```
3897 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3898 /// use google_cloud_lro::Poller;
3899 /// # extern crate wkt as google_cloud_wkt;
3900 /// use google_cloud_wkt::FieldMask;
3901 /// use google_cloud_dataplex_v1::model::DataAttribute;
3902 /// use google_cloud_dataplex_v1::Result;
3903 /// async fn sample(
3904 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_taxonomy_id: &str, data_attribute_id: &str
3905 /// ) -> Result<()> {
3906 /// let response = client.update_data_attribute()
3907 /// .set_data_attribute(
3908 /// DataAttribute::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}/attributes/{data_attribute_id}"))/* set fields */
3909 /// )
3910 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
3911 /// .poller().until_done().await?;
3912 /// println!("response {:?}", response);
3913 /// Ok(())
3914 /// }
3915 /// ```
3916 #[deprecated]
3917 pub fn update_data_attribute(
3918 &self,
3919 ) -> super::builder::data_taxonomy_service::UpdateDataAttribute {
3920 super::builder::data_taxonomy_service::UpdateDataAttribute::new(self.inner.clone())
3921 }
3922
3923 /// Deletes a Data Attribute resource.
3924 ///
3925 /// # Long running operations
3926 ///
3927 /// This method is used to start, and/or poll a [long-running Operation].
3928 /// The [Working with long-running operations] chapter in the [user guide]
3929 /// covers these operations in detail.
3930 ///
3931 /// [long-running operation]: https://google.aip.dev/151
3932 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3933 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3934 ///
3935 /// # Example
3936 /// ```
3937 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3938 /// use google_cloud_lro::Poller;
3939 /// use google_cloud_dataplex_v1::Result;
3940 /// async fn sample(
3941 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_taxonomy_id: &str, data_attribute_id: &str
3942 /// ) -> Result<()> {
3943 /// client.delete_data_attribute()
3944 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}/attributes/{data_attribute_id}"))
3945 /// .poller().until_done().await?;
3946 /// Ok(())
3947 /// }
3948 /// ```
3949 #[deprecated]
3950 pub fn delete_data_attribute(
3951 &self,
3952 ) -> super::builder::data_taxonomy_service::DeleteDataAttribute {
3953 super::builder::data_taxonomy_service::DeleteDataAttribute::new(self.inner.clone())
3954 }
3955
3956 /// Lists Data Attribute resources in a DataTaxonomy.
3957 ///
3958 /// # Example
3959 /// ```
3960 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3961 /// use google_cloud_gax::paginator::ItemPaginator as _;
3962 /// use google_cloud_dataplex_v1::Result;
3963 /// async fn sample(
3964 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_taxonomy_id: &str
3965 /// ) -> Result<()> {
3966 /// let mut list = client.list_data_attributes()
3967 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}"))
3968 /// .by_item();
3969 /// while let Some(item) = list.next().await.transpose()? {
3970 /// println!("{:?}", item);
3971 /// }
3972 /// Ok(())
3973 /// }
3974 /// ```
3975 #[deprecated]
3976 pub fn list_data_attributes(
3977 &self,
3978 ) -> super::builder::data_taxonomy_service::ListDataAttributes {
3979 super::builder::data_taxonomy_service::ListDataAttributes::new(self.inner.clone())
3980 }
3981
3982 /// Retrieves a Data Attribute resource.
3983 ///
3984 /// # Example
3985 /// ```
3986 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
3987 /// use google_cloud_dataplex_v1::Result;
3988 /// async fn sample(
3989 /// client: &DataTaxonomyService, project_id: &str, location_id: &str, data_taxonomy_id: &str, data_attribute_id: &str
3990 /// ) -> Result<()> {
3991 /// let response = client.get_data_attribute()
3992 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataTaxonomies/{data_taxonomy_id}/attributes/{data_attribute_id}"))
3993 /// .send().await?;
3994 /// println!("response {:?}", response);
3995 /// Ok(())
3996 /// }
3997 /// ```
3998 #[deprecated]
3999 pub fn get_data_attribute(&self) -> super::builder::data_taxonomy_service::GetDataAttribute {
4000 super::builder::data_taxonomy_service::GetDataAttribute::new(self.inner.clone())
4001 }
4002
4003 /// Lists information about the supported locations for this service.
4004 /// This method can be called in two ways:
4005 ///
4006 /// * **List all public locations:** Use the path `GET /v1/locations`.
4007 /// * **List project-visible locations:** Use the path
4008 /// `GET /v1/projects/{project_id}/locations`. This may include public
4009 /// locations as well as private or other locations specifically visible
4010 /// to the project.
4011 ///
4012 /// # Example
4013 /// ```
4014 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4015 /// use google_cloud_gax::paginator::ItemPaginator as _;
4016 /// use google_cloud_dataplex_v1::Result;
4017 /// async fn sample(
4018 /// client: &DataTaxonomyService
4019 /// ) -> Result<()> {
4020 /// let mut list = client.list_locations()
4021 /// /* set fields */
4022 /// .by_item();
4023 /// while let Some(item) = list.next().await.transpose()? {
4024 /// println!("{:?}", item);
4025 /// }
4026 /// Ok(())
4027 /// }
4028 /// ```
4029 pub fn list_locations(&self) -> super::builder::data_taxonomy_service::ListLocations {
4030 super::builder::data_taxonomy_service::ListLocations::new(self.inner.clone())
4031 }
4032
4033 /// Gets information about a location.
4034 ///
4035 /// # Example
4036 /// ```
4037 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4038 /// use google_cloud_dataplex_v1::Result;
4039 /// async fn sample(
4040 /// client: &DataTaxonomyService
4041 /// ) -> Result<()> {
4042 /// let response = client.get_location()
4043 /// /* set fields */
4044 /// .send().await?;
4045 /// println!("response {:?}", response);
4046 /// Ok(())
4047 /// }
4048 /// ```
4049 pub fn get_location(&self) -> super::builder::data_taxonomy_service::GetLocation {
4050 super::builder::data_taxonomy_service::GetLocation::new(self.inner.clone())
4051 }
4052
4053 /// Sets the access control policy on the specified resource. Replaces
4054 /// any existing policy.
4055 ///
4056 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4057 /// errors.
4058 ///
4059 /// # Example
4060 /// ```
4061 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4062 /// use google_cloud_dataplex_v1::Result;
4063 /// async fn sample(
4064 /// client: &DataTaxonomyService
4065 /// ) -> Result<()> {
4066 /// let response = client.set_iam_policy()
4067 /// /* set fields */
4068 /// .send().await?;
4069 /// println!("response {:?}", response);
4070 /// Ok(())
4071 /// }
4072 /// ```
4073 pub fn set_iam_policy(&self) -> super::builder::data_taxonomy_service::SetIamPolicy {
4074 super::builder::data_taxonomy_service::SetIamPolicy::new(self.inner.clone())
4075 }
4076
4077 /// Gets the access control policy for a resource. Returns an empty policy
4078 /// if the resource exists and does not have a policy set.
4079 ///
4080 /// # Example
4081 /// ```
4082 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4083 /// use google_cloud_dataplex_v1::Result;
4084 /// async fn sample(
4085 /// client: &DataTaxonomyService
4086 /// ) -> Result<()> {
4087 /// let response = client.get_iam_policy()
4088 /// /* set fields */
4089 /// .send().await?;
4090 /// println!("response {:?}", response);
4091 /// Ok(())
4092 /// }
4093 /// ```
4094 pub fn get_iam_policy(&self) -> super::builder::data_taxonomy_service::GetIamPolicy {
4095 super::builder::data_taxonomy_service::GetIamPolicy::new(self.inner.clone())
4096 }
4097
4098 /// Returns permissions that a caller has on the specified resource. If the
4099 /// resource does not exist, this will return an empty set of
4100 /// permissions, not a `NOT_FOUND` error.
4101 ///
4102 /// Note: This operation is designed to be used for building
4103 /// permission-aware UIs and command-line tools, not for authorization
4104 /// checking. This operation may "fail open" without warning.
4105 ///
4106 /// # Example
4107 /// ```
4108 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4109 /// use google_cloud_dataplex_v1::Result;
4110 /// async fn sample(
4111 /// client: &DataTaxonomyService
4112 /// ) -> Result<()> {
4113 /// let response = client.test_iam_permissions()
4114 /// /* set fields */
4115 /// .send().await?;
4116 /// println!("response {:?}", response);
4117 /// Ok(())
4118 /// }
4119 /// ```
4120 pub fn test_iam_permissions(
4121 &self,
4122 ) -> super::builder::data_taxonomy_service::TestIamPermissions {
4123 super::builder::data_taxonomy_service::TestIamPermissions::new(self.inner.clone())
4124 }
4125
4126 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4127 ///
4128 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4129 ///
4130 /// # Example
4131 /// ```
4132 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4133 /// use google_cloud_gax::paginator::ItemPaginator as _;
4134 /// use google_cloud_dataplex_v1::Result;
4135 /// async fn sample(
4136 /// client: &DataTaxonomyService
4137 /// ) -> Result<()> {
4138 /// let mut list = client.list_operations()
4139 /// /* set fields */
4140 /// .by_item();
4141 /// while let Some(item) = list.next().await.transpose()? {
4142 /// println!("{:?}", item);
4143 /// }
4144 /// Ok(())
4145 /// }
4146 /// ```
4147 pub fn list_operations(&self) -> super::builder::data_taxonomy_service::ListOperations {
4148 super::builder::data_taxonomy_service::ListOperations::new(self.inner.clone())
4149 }
4150
4151 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4152 ///
4153 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4154 ///
4155 /// # Example
4156 /// ```
4157 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4158 /// use google_cloud_dataplex_v1::Result;
4159 /// async fn sample(
4160 /// client: &DataTaxonomyService
4161 /// ) -> Result<()> {
4162 /// let response = client.get_operation()
4163 /// /* set fields */
4164 /// .send().await?;
4165 /// println!("response {:?}", response);
4166 /// Ok(())
4167 /// }
4168 /// ```
4169 pub fn get_operation(&self) -> super::builder::data_taxonomy_service::GetOperation {
4170 super::builder::data_taxonomy_service::GetOperation::new(self.inner.clone())
4171 }
4172
4173 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4174 ///
4175 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4176 ///
4177 /// # Example
4178 /// ```
4179 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4180 /// use google_cloud_dataplex_v1::Result;
4181 /// async fn sample(
4182 /// client: &DataTaxonomyService
4183 /// ) -> Result<()> {
4184 /// client.delete_operation()
4185 /// /* set fields */
4186 /// .send().await?;
4187 /// Ok(())
4188 /// }
4189 /// ```
4190 pub fn delete_operation(&self) -> super::builder::data_taxonomy_service::DeleteOperation {
4191 super::builder::data_taxonomy_service::DeleteOperation::new(self.inner.clone())
4192 }
4193
4194 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4195 ///
4196 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4197 ///
4198 /// # Example
4199 /// ```
4200 /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
4201 /// use google_cloud_dataplex_v1::Result;
4202 /// async fn sample(
4203 /// client: &DataTaxonomyService
4204 /// ) -> Result<()> {
4205 /// client.cancel_operation()
4206 /// /* set fields */
4207 /// .send().await?;
4208 /// Ok(())
4209 /// }
4210 /// ```
4211 pub fn cancel_operation(&self) -> super::builder::data_taxonomy_service::CancelOperation {
4212 super::builder::data_taxonomy_service::CancelOperation::new(self.inner.clone())
4213 }
4214}
4215
4216/// Implements a client for the Cloud Dataplex API.
4217///
4218/// # Example
4219/// ```
4220/// # use google_cloud_dataplex_v1::client::DataScanService;
4221/// use google_cloud_gax::paginator::ItemPaginator as _;
4222/// async fn sample(
4223/// parent: &str,
4224/// ) -> anyhow::Result<()> {
4225/// let client = DataScanService::builder().build().await?;
4226/// let mut list = client.list_data_scans()
4227/// .set_parent(parent)
4228/// .by_item();
4229/// while let Some(item) = list.next().await.transpose()? {
4230/// println!("{:?}", item);
4231/// }
4232/// Ok(())
4233/// }
4234/// ```
4235///
4236/// # Service Description
4237///
4238/// DataScanService manages DataScan resources which can be configured to run
4239/// various types of data scanning workload and generate enriched metadata (e.g.
4240/// Data Profile, Data Quality) for the data source.
4241///
4242/// # Configuration
4243///
4244/// To configure `DataScanService` use the `with_*` methods in the type returned
4245/// by [builder()][DataScanService::builder]. The default configuration should
4246/// work for most applications. Common configuration changes include
4247///
4248/// * [with_endpoint()]: by default this client uses the global default endpoint
4249/// (`https://dataplex.googleapis.com`). Applications using regional
4250/// endpoints or running in restricted networks (e.g. a network configured
4251// with [Private Google Access with VPC Service Controls]) may want to
4252/// override this default.
4253/// * [with_credentials()]: by default this client uses
4254/// [Application Default Credentials]. Applications using custom
4255/// authentication may need to override this default.
4256///
4257/// [with_endpoint()]: super::builder::data_scan_service::ClientBuilder::with_endpoint
4258/// [with_credentials()]: super::builder::data_scan_service::ClientBuilder::with_credentials
4259/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4260/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4261///
4262/// # Pooling and Cloning
4263///
4264/// `DataScanService` holds a connection pool internally, it is advised to
4265/// create one and reuse it. You do not need to wrap `DataScanService` in
4266/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4267/// already uses an `Arc` internally.
4268#[derive(Clone, Debug)]
4269pub struct DataScanService {
4270 inner: std::sync::Arc<dyn super::stub::dynamic::DataScanService>,
4271}
4272
4273impl DataScanService {
4274 /// Returns a builder for [DataScanService].
4275 ///
4276 /// ```
4277 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4278 /// # use google_cloud_dataplex_v1::client::DataScanService;
4279 /// let client = DataScanService::builder().build().await?;
4280 /// # Ok(()) }
4281 /// ```
4282 pub fn builder() -> super::builder::data_scan_service::ClientBuilder {
4283 crate::new_client_builder(super::builder::data_scan_service::client::Factory)
4284 }
4285
4286 /// Creates a new client from the provided stub.
4287 ///
4288 /// The most common case for calling this function is in tests mocking the
4289 /// client's behavior.
4290 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4291 where
4292 T: super::stub::DataScanService + 'static,
4293 {
4294 Self { inner: stub.into() }
4295 }
4296
4297 pub(crate) async fn new(
4298 config: gaxi::options::ClientConfig,
4299 ) -> crate::ClientBuilderResult<Self> {
4300 let inner = Self::build_inner(config).await?;
4301 Ok(Self { inner })
4302 }
4303
4304 async fn build_inner(
4305 conf: gaxi::options::ClientConfig,
4306 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataScanService>> {
4307 if gaxi::options::tracing_enabled(&conf) {
4308 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4309 }
4310 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4311 }
4312
4313 async fn build_transport(
4314 conf: gaxi::options::ClientConfig,
4315 ) -> crate::ClientBuilderResult<impl super::stub::DataScanService> {
4316 super::transport::DataScanService::new(conf).await
4317 }
4318
4319 async fn build_with_tracing(
4320 conf: gaxi::options::ClientConfig,
4321 ) -> crate::ClientBuilderResult<impl super::stub::DataScanService> {
4322 Self::build_transport(conf)
4323 .await
4324 .map(super::tracing::DataScanService::new)
4325 }
4326
4327 /// Creates a DataScan resource.
4328 ///
4329 /// # Long running operations
4330 ///
4331 /// This method is used to start, and/or poll a [long-running Operation].
4332 /// The [Working with long-running operations] chapter in the [user guide]
4333 /// covers these operations in detail.
4334 ///
4335 /// [long-running operation]: https://google.aip.dev/151
4336 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4337 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4338 ///
4339 /// # Example
4340 /// ```
4341 /// # use google_cloud_dataplex_v1::client::DataScanService;
4342 /// use google_cloud_lro::Poller;
4343 /// use google_cloud_dataplex_v1::model::DataScan;
4344 /// use google_cloud_dataplex_v1::Result;
4345 /// async fn sample(
4346 /// client: &DataScanService, parent: &str
4347 /// ) -> Result<()> {
4348 /// let response = client.create_data_scan()
4349 /// .set_parent(parent)
4350 /// .set_data_scan(
4351 /// DataScan::new()/* set fields */
4352 /// )
4353 /// .poller().until_done().await?;
4354 /// println!("response {:?}", response);
4355 /// Ok(())
4356 /// }
4357 /// ```
4358 pub fn create_data_scan(&self) -> super::builder::data_scan_service::CreateDataScan {
4359 super::builder::data_scan_service::CreateDataScan::new(self.inner.clone())
4360 }
4361
4362 /// Updates a DataScan resource.
4363 ///
4364 /// # Long running operations
4365 ///
4366 /// This method is used to start, and/or poll a [long-running Operation].
4367 /// The [Working with long-running operations] chapter in the [user guide]
4368 /// covers these operations in detail.
4369 ///
4370 /// [long-running operation]: https://google.aip.dev/151
4371 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4372 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4373 ///
4374 /// # Example
4375 /// ```
4376 /// # use google_cloud_dataplex_v1::client::DataScanService;
4377 /// use google_cloud_lro::Poller;
4378 /// # extern crate wkt as google_cloud_wkt;
4379 /// use google_cloud_wkt::FieldMask;
4380 /// use google_cloud_dataplex_v1::model::DataScan;
4381 /// use google_cloud_dataplex_v1::Result;
4382 /// async fn sample(
4383 /// client: &DataScanService, project_id: &str, location_id: &str, data_scan_id: &str
4384 /// ) -> Result<()> {
4385 /// let response = client.update_data_scan()
4386 /// .set_data_scan(
4387 /// DataScan::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"))/* set fields */
4388 /// )
4389 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
4390 /// .poller().until_done().await?;
4391 /// println!("response {:?}", response);
4392 /// Ok(())
4393 /// }
4394 /// ```
4395 pub fn update_data_scan(&self) -> super::builder::data_scan_service::UpdateDataScan {
4396 super::builder::data_scan_service::UpdateDataScan::new(self.inner.clone())
4397 }
4398
4399 /// Deletes a DataScan resource.
4400 ///
4401 /// # Long running operations
4402 ///
4403 /// This method is used to start, and/or poll a [long-running Operation].
4404 /// The [Working with long-running operations] chapter in the [user guide]
4405 /// covers these operations in detail.
4406 ///
4407 /// [long-running operation]: https://google.aip.dev/151
4408 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4409 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4410 ///
4411 /// # Example
4412 /// ```
4413 /// # use google_cloud_dataplex_v1::client::DataScanService;
4414 /// use google_cloud_lro::Poller;
4415 /// use google_cloud_dataplex_v1::Result;
4416 /// async fn sample(
4417 /// client: &DataScanService, project_id: &str, location_id: &str, data_scan_id: &str
4418 /// ) -> Result<()> {
4419 /// client.delete_data_scan()
4420 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"))
4421 /// .poller().until_done().await?;
4422 /// Ok(())
4423 /// }
4424 /// ```
4425 pub fn delete_data_scan(&self) -> super::builder::data_scan_service::DeleteDataScan {
4426 super::builder::data_scan_service::DeleteDataScan::new(self.inner.clone())
4427 }
4428
4429 /// Gets a DataScan resource.
4430 ///
4431 /// # Example
4432 /// ```
4433 /// # use google_cloud_dataplex_v1::client::DataScanService;
4434 /// use google_cloud_dataplex_v1::Result;
4435 /// async fn sample(
4436 /// client: &DataScanService, project_id: &str, location_id: &str, data_scan_id: &str
4437 /// ) -> Result<()> {
4438 /// let response = client.get_data_scan()
4439 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"))
4440 /// .send().await?;
4441 /// println!("response {:?}", response);
4442 /// Ok(())
4443 /// }
4444 /// ```
4445 pub fn get_data_scan(&self) -> super::builder::data_scan_service::GetDataScan {
4446 super::builder::data_scan_service::GetDataScan::new(self.inner.clone())
4447 }
4448
4449 /// Lists DataScans.
4450 ///
4451 /// # Example
4452 /// ```
4453 /// # use google_cloud_dataplex_v1::client::DataScanService;
4454 /// use google_cloud_gax::paginator::ItemPaginator as _;
4455 /// use google_cloud_dataplex_v1::Result;
4456 /// async fn sample(
4457 /// client: &DataScanService, parent: &str
4458 /// ) -> Result<()> {
4459 /// let mut list = client.list_data_scans()
4460 /// .set_parent(parent)
4461 /// .by_item();
4462 /// while let Some(item) = list.next().await.transpose()? {
4463 /// println!("{:?}", item);
4464 /// }
4465 /// Ok(())
4466 /// }
4467 /// ```
4468 pub fn list_data_scans(&self) -> super::builder::data_scan_service::ListDataScans {
4469 super::builder::data_scan_service::ListDataScans::new(self.inner.clone())
4470 }
4471
4472 /// Runs an on-demand execution of a DataScan
4473 ///
4474 /// # Example
4475 /// ```
4476 /// # use google_cloud_dataplex_v1::client::DataScanService;
4477 /// use google_cloud_dataplex_v1::Result;
4478 /// async fn sample(
4479 /// client: &DataScanService
4480 /// ) -> Result<()> {
4481 /// let response = client.run_data_scan()
4482 /// /* set fields */
4483 /// .send().await?;
4484 /// println!("response {:?}", response);
4485 /// Ok(())
4486 /// }
4487 /// ```
4488 pub fn run_data_scan(&self) -> super::builder::data_scan_service::RunDataScan {
4489 super::builder::data_scan_service::RunDataScan::new(self.inner.clone())
4490 }
4491
4492 /// Gets a DataScanJob resource.
4493 ///
4494 /// # Example
4495 /// ```
4496 /// # use google_cloud_dataplex_v1::client::DataScanService;
4497 /// use google_cloud_dataplex_v1::Result;
4498 /// async fn sample(
4499 /// client: &DataScanService, project_id: &str, location_id: &str, data_scan_id: &str, job_id: &str
4500 /// ) -> Result<()> {
4501 /// let response = client.get_data_scan_job()
4502 /// .set_name(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}/jobs/{job_id}"))
4503 /// .send().await?;
4504 /// println!("response {:?}", response);
4505 /// Ok(())
4506 /// }
4507 /// ```
4508 pub fn get_data_scan_job(&self) -> super::builder::data_scan_service::GetDataScanJob {
4509 super::builder::data_scan_service::GetDataScanJob::new(self.inner.clone())
4510 }
4511
4512 /// Lists DataScanJobs under the given DataScan.
4513 ///
4514 /// # Example
4515 /// ```
4516 /// # use google_cloud_dataplex_v1::client::DataScanService;
4517 /// use google_cloud_gax::paginator::ItemPaginator as _;
4518 /// use google_cloud_dataplex_v1::Result;
4519 /// async fn sample(
4520 /// client: &DataScanService, project_id: &str, location_id: &str, data_scan_id: &str
4521 /// ) -> Result<()> {
4522 /// let mut list = client.list_data_scan_jobs()
4523 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/dataScans/{data_scan_id}"))
4524 /// .by_item();
4525 /// while let Some(item) = list.next().await.transpose()? {
4526 /// println!("{:?}", item);
4527 /// }
4528 /// Ok(())
4529 /// }
4530 /// ```
4531 pub fn list_data_scan_jobs(&self) -> super::builder::data_scan_service::ListDataScanJobs {
4532 super::builder::data_scan_service::ListDataScanJobs::new(self.inner.clone())
4533 }
4534
4535 /// Generates recommended data quality rules based on the results of a data
4536 /// profiling scan.
4537 ///
4538 /// Use the recommendations to build rules for a data quality scan.
4539 ///
4540 /// # Example
4541 /// ```
4542 /// # use google_cloud_dataplex_v1::client::DataScanService;
4543 /// use google_cloud_dataplex_v1::Result;
4544 /// async fn sample(
4545 /// client: &DataScanService
4546 /// ) -> Result<()> {
4547 /// let response = client.generate_data_quality_rules()
4548 /// /* set fields */
4549 /// .send().await?;
4550 /// println!("response {:?}", response);
4551 /// Ok(())
4552 /// }
4553 /// ```
4554 pub fn generate_data_quality_rules(
4555 &self,
4556 ) -> super::builder::data_scan_service::GenerateDataQualityRules {
4557 super::builder::data_scan_service::GenerateDataQualityRules::new(self.inner.clone())
4558 }
4559
4560 /// Lists information about the supported locations for this service.
4561 /// This method can be called in two ways:
4562 ///
4563 /// * **List all public locations:** Use the path `GET /v1/locations`.
4564 /// * **List project-visible locations:** Use the path
4565 /// `GET /v1/projects/{project_id}/locations`. This may include public
4566 /// locations as well as private or other locations specifically visible
4567 /// to the project.
4568 ///
4569 /// # Example
4570 /// ```
4571 /// # use google_cloud_dataplex_v1::client::DataScanService;
4572 /// use google_cloud_gax::paginator::ItemPaginator as _;
4573 /// use google_cloud_dataplex_v1::Result;
4574 /// async fn sample(
4575 /// client: &DataScanService
4576 /// ) -> Result<()> {
4577 /// let mut list = client.list_locations()
4578 /// /* set fields */
4579 /// .by_item();
4580 /// while let Some(item) = list.next().await.transpose()? {
4581 /// println!("{:?}", item);
4582 /// }
4583 /// Ok(())
4584 /// }
4585 /// ```
4586 pub fn list_locations(&self) -> super::builder::data_scan_service::ListLocations {
4587 super::builder::data_scan_service::ListLocations::new(self.inner.clone())
4588 }
4589
4590 /// Gets information about a location.
4591 ///
4592 /// # Example
4593 /// ```
4594 /// # use google_cloud_dataplex_v1::client::DataScanService;
4595 /// use google_cloud_dataplex_v1::Result;
4596 /// async fn sample(
4597 /// client: &DataScanService
4598 /// ) -> Result<()> {
4599 /// let response = client.get_location()
4600 /// /* set fields */
4601 /// .send().await?;
4602 /// println!("response {:?}", response);
4603 /// Ok(())
4604 /// }
4605 /// ```
4606 pub fn get_location(&self) -> super::builder::data_scan_service::GetLocation {
4607 super::builder::data_scan_service::GetLocation::new(self.inner.clone())
4608 }
4609
4610 /// Sets the access control policy on the specified resource. Replaces
4611 /// any existing policy.
4612 ///
4613 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4614 /// errors.
4615 ///
4616 /// # Example
4617 /// ```
4618 /// # use google_cloud_dataplex_v1::client::DataScanService;
4619 /// use google_cloud_dataplex_v1::Result;
4620 /// async fn sample(
4621 /// client: &DataScanService
4622 /// ) -> Result<()> {
4623 /// let response = client.set_iam_policy()
4624 /// /* set fields */
4625 /// .send().await?;
4626 /// println!("response {:?}", response);
4627 /// Ok(())
4628 /// }
4629 /// ```
4630 pub fn set_iam_policy(&self) -> super::builder::data_scan_service::SetIamPolicy {
4631 super::builder::data_scan_service::SetIamPolicy::new(self.inner.clone())
4632 }
4633
4634 /// Gets the access control policy for a resource. Returns an empty policy
4635 /// if the resource exists and does not have a policy set.
4636 ///
4637 /// # Example
4638 /// ```
4639 /// # use google_cloud_dataplex_v1::client::DataScanService;
4640 /// use google_cloud_dataplex_v1::Result;
4641 /// async fn sample(
4642 /// client: &DataScanService
4643 /// ) -> Result<()> {
4644 /// let response = client.get_iam_policy()
4645 /// /* set fields */
4646 /// .send().await?;
4647 /// println!("response {:?}", response);
4648 /// Ok(())
4649 /// }
4650 /// ```
4651 pub fn get_iam_policy(&self) -> super::builder::data_scan_service::GetIamPolicy {
4652 super::builder::data_scan_service::GetIamPolicy::new(self.inner.clone())
4653 }
4654
4655 /// Returns permissions that a caller has on the specified resource. If the
4656 /// resource does not exist, this will return an empty set of
4657 /// permissions, not a `NOT_FOUND` error.
4658 ///
4659 /// Note: This operation is designed to be used for building
4660 /// permission-aware UIs and command-line tools, not for authorization
4661 /// checking. This operation may "fail open" without warning.
4662 ///
4663 /// # Example
4664 /// ```
4665 /// # use google_cloud_dataplex_v1::client::DataScanService;
4666 /// use google_cloud_dataplex_v1::Result;
4667 /// async fn sample(
4668 /// client: &DataScanService
4669 /// ) -> Result<()> {
4670 /// let response = client.test_iam_permissions()
4671 /// /* set fields */
4672 /// .send().await?;
4673 /// println!("response {:?}", response);
4674 /// Ok(())
4675 /// }
4676 /// ```
4677 pub fn test_iam_permissions(&self) -> super::builder::data_scan_service::TestIamPermissions {
4678 super::builder::data_scan_service::TestIamPermissions::new(self.inner.clone())
4679 }
4680
4681 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4682 ///
4683 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4684 ///
4685 /// # Example
4686 /// ```
4687 /// # use google_cloud_dataplex_v1::client::DataScanService;
4688 /// use google_cloud_gax::paginator::ItemPaginator as _;
4689 /// use google_cloud_dataplex_v1::Result;
4690 /// async fn sample(
4691 /// client: &DataScanService
4692 /// ) -> Result<()> {
4693 /// let mut list = client.list_operations()
4694 /// /* set fields */
4695 /// .by_item();
4696 /// while let Some(item) = list.next().await.transpose()? {
4697 /// println!("{:?}", item);
4698 /// }
4699 /// Ok(())
4700 /// }
4701 /// ```
4702 pub fn list_operations(&self) -> super::builder::data_scan_service::ListOperations {
4703 super::builder::data_scan_service::ListOperations::new(self.inner.clone())
4704 }
4705
4706 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4707 ///
4708 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4709 ///
4710 /// # Example
4711 /// ```
4712 /// # use google_cloud_dataplex_v1::client::DataScanService;
4713 /// use google_cloud_dataplex_v1::Result;
4714 /// async fn sample(
4715 /// client: &DataScanService
4716 /// ) -> Result<()> {
4717 /// let response = client.get_operation()
4718 /// /* set fields */
4719 /// .send().await?;
4720 /// println!("response {:?}", response);
4721 /// Ok(())
4722 /// }
4723 /// ```
4724 pub fn get_operation(&self) -> super::builder::data_scan_service::GetOperation {
4725 super::builder::data_scan_service::GetOperation::new(self.inner.clone())
4726 }
4727
4728 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4729 ///
4730 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4731 ///
4732 /// # Example
4733 /// ```
4734 /// # use google_cloud_dataplex_v1::client::DataScanService;
4735 /// use google_cloud_dataplex_v1::Result;
4736 /// async fn sample(
4737 /// client: &DataScanService
4738 /// ) -> Result<()> {
4739 /// client.delete_operation()
4740 /// /* set fields */
4741 /// .send().await?;
4742 /// Ok(())
4743 /// }
4744 /// ```
4745 pub fn delete_operation(&self) -> super::builder::data_scan_service::DeleteOperation {
4746 super::builder::data_scan_service::DeleteOperation::new(self.inner.clone())
4747 }
4748
4749 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4750 ///
4751 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4752 ///
4753 /// # Example
4754 /// ```
4755 /// # use google_cloud_dataplex_v1::client::DataScanService;
4756 /// use google_cloud_dataplex_v1::Result;
4757 /// async fn sample(
4758 /// client: &DataScanService
4759 /// ) -> Result<()> {
4760 /// client.cancel_operation()
4761 /// /* set fields */
4762 /// .send().await?;
4763 /// Ok(())
4764 /// }
4765 /// ```
4766 pub fn cancel_operation(&self) -> super::builder::data_scan_service::CancelOperation {
4767 super::builder::data_scan_service::CancelOperation::new(self.inner.clone())
4768 }
4769}
4770
4771/// Implements a client for the Cloud Dataplex API.
4772///
4773/// # Example
4774/// ```
4775/// # use google_cloud_dataplex_v1::client::MetadataService;
4776/// use google_cloud_gax::paginator::ItemPaginator as _;
4777/// async fn sample(
4778/// project_id: &str,
4779/// location_id: &str,
4780/// lake_id: &str,
4781/// zone_id: &str,
4782/// ) -> anyhow::Result<()> {
4783/// let client = MetadataService::builder().build().await?;
4784/// let mut list = client.list_entities()
4785/// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"))
4786/// .by_item();
4787/// while let Some(item) = list.next().await.transpose()? {
4788/// println!("{:?}", item);
4789/// }
4790/// Ok(())
4791/// }
4792/// ```
4793///
4794/// # Service Description
4795///
4796/// Metadata service manages metadata resources such as tables, filesets and
4797/// partitions.
4798///
4799/// # Configuration
4800///
4801/// To configure `MetadataService` use the `with_*` methods in the type returned
4802/// by [builder()][MetadataService::builder]. The default configuration should
4803/// work for most applications. Common configuration changes include
4804///
4805/// * [with_endpoint()]: by default this client uses the global default endpoint
4806/// (`https://dataplex.googleapis.com`). Applications using regional
4807/// endpoints or running in restricted networks (e.g. a network configured
4808// with [Private Google Access with VPC Service Controls]) may want to
4809/// override this default.
4810/// * [with_credentials()]: by default this client uses
4811/// [Application Default Credentials]. Applications using custom
4812/// authentication may need to override this default.
4813///
4814/// [with_endpoint()]: super::builder::metadata_service::ClientBuilder::with_endpoint
4815/// [with_credentials()]: super::builder::metadata_service::ClientBuilder::with_credentials
4816/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4817/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4818///
4819/// # Pooling and Cloning
4820///
4821/// `MetadataService` holds a connection pool internally, it is advised to
4822/// create one and reuse it. You do not need to wrap `MetadataService` in
4823/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4824/// already uses an `Arc` internally.
4825#[derive(Clone, Debug)]
4826pub struct MetadataService {
4827 inner: std::sync::Arc<dyn super::stub::dynamic::MetadataService>,
4828}
4829
4830impl MetadataService {
4831 /// Returns a builder for [MetadataService].
4832 ///
4833 /// ```
4834 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4835 /// # use google_cloud_dataplex_v1::client::MetadataService;
4836 /// let client = MetadataService::builder().build().await?;
4837 /// # Ok(()) }
4838 /// ```
4839 pub fn builder() -> super::builder::metadata_service::ClientBuilder {
4840 crate::new_client_builder(super::builder::metadata_service::client::Factory)
4841 }
4842
4843 /// Creates a new client from the provided stub.
4844 ///
4845 /// The most common case for calling this function is in tests mocking the
4846 /// client's behavior.
4847 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4848 where
4849 T: super::stub::MetadataService + 'static,
4850 {
4851 Self { inner: stub.into() }
4852 }
4853
4854 pub(crate) async fn new(
4855 config: gaxi::options::ClientConfig,
4856 ) -> crate::ClientBuilderResult<Self> {
4857 let inner = Self::build_inner(config).await?;
4858 Ok(Self { inner })
4859 }
4860
4861 async fn build_inner(
4862 conf: gaxi::options::ClientConfig,
4863 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MetadataService>> {
4864 if gaxi::options::tracing_enabled(&conf) {
4865 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4866 }
4867 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4868 }
4869
4870 async fn build_transport(
4871 conf: gaxi::options::ClientConfig,
4872 ) -> crate::ClientBuilderResult<impl super::stub::MetadataService> {
4873 super::transport::MetadataService::new(conf).await
4874 }
4875
4876 async fn build_with_tracing(
4877 conf: gaxi::options::ClientConfig,
4878 ) -> crate::ClientBuilderResult<impl super::stub::MetadataService> {
4879 Self::build_transport(conf)
4880 .await
4881 .map(super::tracing::MetadataService::new)
4882 }
4883
4884 /// Create a metadata entity.
4885 ///
4886 /// # Example
4887 /// ```
4888 /// # use google_cloud_dataplex_v1::client::MetadataService;
4889 /// use google_cloud_dataplex_v1::model::Entity;
4890 /// use google_cloud_dataplex_v1::Result;
4891 /// async fn sample(
4892 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str
4893 /// ) -> Result<()> {
4894 /// let response = client.create_entity()
4895 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"))
4896 /// .set_entity(
4897 /// Entity::new()/* set fields */
4898 /// )
4899 /// .send().await?;
4900 /// println!("response {:?}", response);
4901 /// Ok(())
4902 /// }
4903 /// ```
4904 pub fn create_entity(&self) -> super::builder::metadata_service::CreateEntity {
4905 super::builder::metadata_service::CreateEntity::new(self.inner.clone())
4906 }
4907
4908 /// Update a metadata entity. Only supports full resource update.
4909 ///
4910 /// # Example
4911 /// ```
4912 /// # use google_cloud_dataplex_v1::client::MetadataService;
4913 /// use google_cloud_dataplex_v1::model::Entity;
4914 /// use google_cloud_dataplex_v1::Result;
4915 /// async fn sample(
4916 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, entity_id: &str
4917 /// ) -> Result<()> {
4918 /// let response = client.update_entity()
4919 /// .set_entity(
4920 /// Entity::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"))/* set fields */
4921 /// )
4922 /// .send().await?;
4923 /// println!("response {:?}", response);
4924 /// Ok(())
4925 /// }
4926 /// ```
4927 pub fn update_entity(&self) -> super::builder::metadata_service::UpdateEntity {
4928 super::builder::metadata_service::UpdateEntity::new(self.inner.clone())
4929 }
4930
4931 /// Delete a metadata entity.
4932 ///
4933 /// # Example
4934 /// ```
4935 /// # use google_cloud_dataplex_v1::client::MetadataService;
4936 /// use google_cloud_dataplex_v1::Result;
4937 /// async fn sample(
4938 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, entity_id: &str
4939 /// ) -> Result<()> {
4940 /// client.delete_entity()
4941 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"))
4942 /// .send().await?;
4943 /// Ok(())
4944 /// }
4945 /// ```
4946 pub fn delete_entity(&self) -> super::builder::metadata_service::DeleteEntity {
4947 super::builder::metadata_service::DeleteEntity::new(self.inner.clone())
4948 }
4949
4950 /// Get a metadata entity.
4951 ///
4952 /// # Example
4953 /// ```
4954 /// # use google_cloud_dataplex_v1::client::MetadataService;
4955 /// use google_cloud_dataplex_v1::Result;
4956 /// async fn sample(
4957 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, entity_id: &str
4958 /// ) -> Result<()> {
4959 /// let response = client.get_entity()
4960 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"))
4961 /// .send().await?;
4962 /// println!("response {:?}", response);
4963 /// Ok(())
4964 /// }
4965 /// ```
4966 pub fn get_entity(&self) -> super::builder::metadata_service::GetEntity {
4967 super::builder::metadata_service::GetEntity::new(self.inner.clone())
4968 }
4969
4970 /// List metadata entities in a zone.
4971 ///
4972 /// # Example
4973 /// ```
4974 /// # use google_cloud_dataplex_v1::client::MetadataService;
4975 /// use google_cloud_gax::paginator::ItemPaginator as _;
4976 /// use google_cloud_dataplex_v1::Result;
4977 /// async fn sample(
4978 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str
4979 /// ) -> Result<()> {
4980 /// let mut list = client.list_entities()
4981 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"))
4982 /// .by_item();
4983 /// while let Some(item) = list.next().await.transpose()? {
4984 /// println!("{:?}", item);
4985 /// }
4986 /// Ok(())
4987 /// }
4988 /// ```
4989 pub fn list_entities(&self) -> super::builder::metadata_service::ListEntities {
4990 super::builder::metadata_service::ListEntities::new(self.inner.clone())
4991 }
4992
4993 /// Create a metadata partition.
4994 ///
4995 /// # Example
4996 /// ```
4997 /// # use google_cloud_dataplex_v1::client::MetadataService;
4998 /// use google_cloud_dataplex_v1::model::Partition;
4999 /// use google_cloud_dataplex_v1::Result;
5000 /// async fn sample(
5001 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, entity_id: &str
5002 /// ) -> Result<()> {
5003 /// let response = client.create_partition()
5004 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"))
5005 /// .set_partition(
5006 /// Partition::new()/* set fields */
5007 /// )
5008 /// .send().await?;
5009 /// println!("response {:?}", response);
5010 /// Ok(())
5011 /// }
5012 /// ```
5013 pub fn create_partition(&self) -> super::builder::metadata_service::CreatePartition {
5014 super::builder::metadata_service::CreatePartition::new(self.inner.clone())
5015 }
5016
5017 /// Delete a metadata partition.
5018 ///
5019 /// # Example
5020 /// ```
5021 /// # use google_cloud_dataplex_v1::client::MetadataService;
5022 /// use google_cloud_dataplex_v1::Result;
5023 /// async fn sample(
5024 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, entity_id: &str, partition_id: &str
5025 /// ) -> Result<()> {
5026 /// client.delete_partition()
5027 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_id}"))
5028 /// .send().await?;
5029 /// Ok(())
5030 /// }
5031 /// ```
5032 pub fn delete_partition(&self) -> super::builder::metadata_service::DeletePartition {
5033 super::builder::metadata_service::DeletePartition::new(self.inner.clone())
5034 }
5035
5036 /// Get a metadata partition of an entity.
5037 ///
5038 /// # Example
5039 /// ```
5040 /// # use google_cloud_dataplex_v1::client::MetadataService;
5041 /// use google_cloud_dataplex_v1::Result;
5042 /// async fn sample(
5043 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, entity_id: &str, partition_id: &str
5044 /// ) -> Result<()> {
5045 /// let response = client.get_partition()
5046 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_id}"))
5047 /// .send().await?;
5048 /// println!("response {:?}", response);
5049 /// Ok(())
5050 /// }
5051 /// ```
5052 pub fn get_partition(&self) -> super::builder::metadata_service::GetPartition {
5053 super::builder::metadata_service::GetPartition::new(self.inner.clone())
5054 }
5055
5056 /// List metadata partitions of an entity.
5057 ///
5058 /// # Example
5059 /// ```
5060 /// # use google_cloud_dataplex_v1::client::MetadataService;
5061 /// use google_cloud_gax::paginator::ItemPaginator as _;
5062 /// use google_cloud_dataplex_v1::Result;
5063 /// async fn sample(
5064 /// client: &MetadataService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, entity_id: &str
5065 /// ) -> Result<()> {
5066 /// let mut list = client.list_partitions()
5067 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}"))
5068 /// .by_item();
5069 /// while let Some(item) = list.next().await.transpose()? {
5070 /// println!("{:?}", item);
5071 /// }
5072 /// Ok(())
5073 /// }
5074 /// ```
5075 pub fn list_partitions(&self) -> super::builder::metadata_service::ListPartitions {
5076 super::builder::metadata_service::ListPartitions::new(self.inner.clone())
5077 }
5078
5079 /// Lists information about the supported locations for this service.
5080 /// This method can be called in two ways:
5081 ///
5082 /// * **List all public locations:** Use the path `GET /v1/locations`.
5083 /// * **List project-visible locations:** Use the path
5084 /// `GET /v1/projects/{project_id}/locations`. This may include public
5085 /// locations as well as private or other locations specifically visible
5086 /// to the project.
5087 ///
5088 /// # Example
5089 /// ```
5090 /// # use google_cloud_dataplex_v1::client::MetadataService;
5091 /// use google_cloud_gax::paginator::ItemPaginator as _;
5092 /// use google_cloud_dataplex_v1::Result;
5093 /// async fn sample(
5094 /// client: &MetadataService
5095 /// ) -> Result<()> {
5096 /// let mut list = client.list_locations()
5097 /// /* set fields */
5098 /// .by_item();
5099 /// while let Some(item) = list.next().await.transpose()? {
5100 /// println!("{:?}", item);
5101 /// }
5102 /// Ok(())
5103 /// }
5104 /// ```
5105 pub fn list_locations(&self) -> super::builder::metadata_service::ListLocations {
5106 super::builder::metadata_service::ListLocations::new(self.inner.clone())
5107 }
5108
5109 /// Gets information about a location.
5110 ///
5111 /// # Example
5112 /// ```
5113 /// # use google_cloud_dataplex_v1::client::MetadataService;
5114 /// use google_cloud_dataplex_v1::Result;
5115 /// async fn sample(
5116 /// client: &MetadataService
5117 /// ) -> Result<()> {
5118 /// let response = client.get_location()
5119 /// /* set fields */
5120 /// .send().await?;
5121 /// println!("response {:?}", response);
5122 /// Ok(())
5123 /// }
5124 /// ```
5125 pub fn get_location(&self) -> super::builder::metadata_service::GetLocation {
5126 super::builder::metadata_service::GetLocation::new(self.inner.clone())
5127 }
5128
5129 /// Sets the access control policy on the specified resource. Replaces
5130 /// any existing policy.
5131 ///
5132 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5133 /// errors.
5134 ///
5135 /// # Example
5136 /// ```
5137 /// # use google_cloud_dataplex_v1::client::MetadataService;
5138 /// use google_cloud_dataplex_v1::Result;
5139 /// async fn sample(
5140 /// client: &MetadataService
5141 /// ) -> Result<()> {
5142 /// let response = client.set_iam_policy()
5143 /// /* set fields */
5144 /// .send().await?;
5145 /// println!("response {:?}", response);
5146 /// Ok(())
5147 /// }
5148 /// ```
5149 pub fn set_iam_policy(&self) -> super::builder::metadata_service::SetIamPolicy {
5150 super::builder::metadata_service::SetIamPolicy::new(self.inner.clone())
5151 }
5152
5153 /// Gets the access control policy for a resource. Returns an empty policy
5154 /// if the resource exists and does not have a policy set.
5155 ///
5156 /// # Example
5157 /// ```
5158 /// # use google_cloud_dataplex_v1::client::MetadataService;
5159 /// use google_cloud_dataplex_v1::Result;
5160 /// async fn sample(
5161 /// client: &MetadataService
5162 /// ) -> Result<()> {
5163 /// let response = client.get_iam_policy()
5164 /// /* set fields */
5165 /// .send().await?;
5166 /// println!("response {:?}", response);
5167 /// Ok(())
5168 /// }
5169 /// ```
5170 pub fn get_iam_policy(&self) -> super::builder::metadata_service::GetIamPolicy {
5171 super::builder::metadata_service::GetIamPolicy::new(self.inner.clone())
5172 }
5173
5174 /// Returns permissions that a caller has on the specified resource. If the
5175 /// resource does not exist, this will return an empty set of
5176 /// permissions, not a `NOT_FOUND` error.
5177 ///
5178 /// Note: This operation is designed to be used for building
5179 /// permission-aware UIs and command-line tools, not for authorization
5180 /// checking. This operation may "fail open" without warning.
5181 ///
5182 /// # Example
5183 /// ```
5184 /// # use google_cloud_dataplex_v1::client::MetadataService;
5185 /// use google_cloud_dataplex_v1::Result;
5186 /// async fn sample(
5187 /// client: &MetadataService
5188 /// ) -> Result<()> {
5189 /// let response = client.test_iam_permissions()
5190 /// /* set fields */
5191 /// .send().await?;
5192 /// println!("response {:?}", response);
5193 /// Ok(())
5194 /// }
5195 /// ```
5196 pub fn test_iam_permissions(&self) -> super::builder::metadata_service::TestIamPermissions {
5197 super::builder::metadata_service::TestIamPermissions::new(self.inner.clone())
5198 }
5199
5200 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5201 ///
5202 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5203 ///
5204 /// # Example
5205 /// ```
5206 /// # use google_cloud_dataplex_v1::client::MetadataService;
5207 /// use google_cloud_gax::paginator::ItemPaginator as _;
5208 /// use google_cloud_dataplex_v1::Result;
5209 /// async fn sample(
5210 /// client: &MetadataService
5211 /// ) -> Result<()> {
5212 /// let mut list = client.list_operations()
5213 /// /* set fields */
5214 /// .by_item();
5215 /// while let Some(item) = list.next().await.transpose()? {
5216 /// println!("{:?}", item);
5217 /// }
5218 /// Ok(())
5219 /// }
5220 /// ```
5221 pub fn list_operations(&self) -> super::builder::metadata_service::ListOperations {
5222 super::builder::metadata_service::ListOperations::new(self.inner.clone())
5223 }
5224
5225 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5226 ///
5227 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5228 ///
5229 /// # Example
5230 /// ```
5231 /// # use google_cloud_dataplex_v1::client::MetadataService;
5232 /// use google_cloud_dataplex_v1::Result;
5233 /// async fn sample(
5234 /// client: &MetadataService
5235 /// ) -> Result<()> {
5236 /// let response = client.get_operation()
5237 /// /* set fields */
5238 /// .send().await?;
5239 /// println!("response {:?}", response);
5240 /// Ok(())
5241 /// }
5242 /// ```
5243 pub fn get_operation(&self) -> super::builder::metadata_service::GetOperation {
5244 super::builder::metadata_service::GetOperation::new(self.inner.clone())
5245 }
5246
5247 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5248 ///
5249 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5250 ///
5251 /// # Example
5252 /// ```
5253 /// # use google_cloud_dataplex_v1::client::MetadataService;
5254 /// use google_cloud_dataplex_v1::Result;
5255 /// async fn sample(
5256 /// client: &MetadataService
5257 /// ) -> Result<()> {
5258 /// client.delete_operation()
5259 /// /* set fields */
5260 /// .send().await?;
5261 /// Ok(())
5262 /// }
5263 /// ```
5264 pub fn delete_operation(&self) -> super::builder::metadata_service::DeleteOperation {
5265 super::builder::metadata_service::DeleteOperation::new(self.inner.clone())
5266 }
5267
5268 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5269 ///
5270 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5271 ///
5272 /// # Example
5273 /// ```
5274 /// # use google_cloud_dataplex_v1::client::MetadataService;
5275 /// use google_cloud_dataplex_v1::Result;
5276 /// async fn sample(
5277 /// client: &MetadataService
5278 /// ) -> Result<()> {
5279 /// client.cancel_operation()
5280 /// /* set fields */
5281 /// .send().await?;
5282 /// Ok(())
5283 /// }
5284 /// ```
5285 pub fn cancel_operation(&self) -> super::builder::metadata_service::CancelOperation {
5286 super::builder::metadata_service::CancelOperation::new(self.inner.clone())
5287 }
5288}
5289
5290/// Implements a client for the Cloud Dataplex API.
5291///
5292/// # Example
5293/// ```
5294/// # use google_cloud_dataplex_v1::client::DataplexService;
5295/// use google_cloud_gax::paginator::ItemPaginator as _;
5296/// async fn sample(
5297/// parent: &str,
5298/// ) -> anyhow::Result<()> {
5299/// let client = DataplexService::builder().build().await?;
5300/// let mut list = client.list_lakes()
5301/// .set_parent(parent)
5302/// .by_item();
5303/// while let Some(item) = list.next().await.transpose()? {
5304/// println!("{:?}", item);
5305/// }
5306/// Ok(())
5307/// }
5308/// ```
5309///
5310/// # Service Description
5311///
5312/// Dataplex service provides data lakes as a service. The primary resources
5313/// offered by this service are Lakes, Zones and Assets which collectively allow
5314/// a data administrator to organize, manage, secure and catalog data across
5315/// their organization located across cloud projects in a variety of storage
5316/// systems including Cloud Storage and BigQuery.
5317///
5318/// # Configuration
5319///
5320/// To configure `DataplexService` use the `with_*` methods in the type returned
5321/// by [builder()][DataplexService::builder]. The default configuration should
5322/// work for most applications. Common configuration changes include
5323///
5324/// * [with_endpoint()]: by default this client uses the global default endpoint
5325/// (`https://dataplex.googleapis.com`). Applications using regional
5326/// endpoints or running in restricted networks (e.g. a network configured
5327// with [Private Google Access with VPC Service Controls]) may want to
5328/// override this default.
5329/// * [with_credentials()]: by default this client uses
5330/// [Application Default Credentials]. Applications using custom
5331/// authentication may need to override this default.
5332///
5333/// [with_endpoint()]: super::builder::dataplex_service::ClientBuilder::with_endpoint
5334/// [with_credentials()]: super::builder::dataplex_service::ClientBuilder::with_credentials
5335/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5336/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5337///
5338/// # Pooling and Cloning
5339///
5340/// `DataplexService` holds a connection pool internally, it is advised to
5341/// create one and reuse it. You do not need to wrap `DataplexService` in
5342/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5343/// already uses an `Arc` internally.
5344#[derive(Clone, Debug)]
5345pub struct DataplexService {
5346 inner: std::sync::Arc<dyn super::stub::dynamic::DataplexService>,
5347}
5348
5349impl DataplexService {
5350 /// Returns a builder for [DataplexService].
5351 ///
5352 /// ```
5353 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5354 /// # use google_cloud_dataplex_v1::client::DataplexService;
5355 /// let client = DataplexService::builder().build().await?;
5356 /// # Ok(()) }
5357 /// ```
5358 pub fn builder() -> super::builder::dataplex_service::ClientBuilder {
5359 crate::new_client_builder(super::builder::dataplex_service::client::Factory)
5360 }
5361
5362 /// Creates a new client from the provided stub.
5363 ///
5364 /// The most common case for calling this function is in tests mocking the
5365 /// client's behavior.
5366 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5367 where
5368 T: super::stub::DataplexService + 'static,
5369 {
5370 Self { inner: stub.into() }
5371 }
5372
5373 pub(crate) async fn new(
5374 config: gaxi::options::ClientConfig,
5375 ) -> crate::ClientBuilderResult<Self> {
5376 let inner = Self::build_inner(config).await?;
5377 Ok(Self { inner })
5378 }
5379
5380 async fn build_inner(
5381 conf: gaxi::options::ClientConfig,
5382 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataplexService>> {
5383 if gaxi::options::tracing_enabled(&conf) {
5384 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5385 }
5386 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5387 }
5388
5389 async fn build_transport(
5390 conf: gaxi::options::ClientConfig,
5391 ) -> crate::ClientBuilderResult<impl super::stub::DataplexService> {
5392 super::transport::DataplexService::new(conf).await
5393 }
5394
5395 async fn build_with_tracing(
5396 conf: gaxi::options::ClientConfig,
5397 ) -> crate::ClientBuilderResult<impl super::stub::DataplexService> {
5398 Self::build_transport(conf)
5399 .await
5400 .map(super::tracing::DataplexService::new)
5401 }
5402
5403 /// Creates a lake resource.
5404 ///
5405 /// # Long running operations
5406 ///
5407 /// This method is used to start, and/or poll a [long-running Operation].
5408 /// The [Working with long-running operations] chapter in the [user guide]
5409 /// covers these operations in detail.
5410 ///
5411 /// [long-running operation]: https://google.aip.dev/151
5412 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5413 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5414 ///
5415 /// # Example
5416 /// ```
5417 /// # use google_cloud_dataplex_v1::client::DataplexService;
5418 /// use google_cloud_lro::Poller;
5419 /// use google_cloud_dataplex_v1::model::Lake;
5420 /// use google_cloud_dataplex_v1::Result;
5421 /// async fn sample(
5422 /// client: &DataplexService, parent: &str
5423 /// ) -> Result<()> {
5424 /// let response = client.create_lake()
5425 /// .set_parent(parent)
5426 /// .set_lake_id("lake_id_value")
5427 /// .set_lake(
5428 /// Lake::new()/* set fields */
5429 /// )
5430 /// .poller().until_done().await?;
5431 /// println!("response {:?}", response);
5432 /// Ok(())
5433 /// }
5434 /// ```
5435 pub fn create_lake(&self) -> super::builder::dataplex_service::CreateLake {
5436 super::builder::dataplex_service::CreateLake::new(self.inner.clone())
5437 }
5438
5439 /// Updates a lake resource.
5440 ///
5441 /// # Long running operations
5442 ///
5443 /// This method is used to start, and/or poll a [long-running Operation].
5444 /// The [Working with long-running operations] chapter in the [user guide]
5445 /// covers these operations in detail.
5446 ///
5447 /// [long-running operation]: https://google.aip.dev/151
5448 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5449 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5450 ///
5451 /// # Example
5452 /// ```
5453 /// # use google_cloud_dataplex_v1::client::DataplexService;
5454 /// use google_cloud_lro::Poller;
5455 /// # extern crate wkt as google_cloud_wkt;
5456 /// use google_cloud_wkt::FieldMask;
5457 /// use google_cloud_dataplex_v1::model::Lake;
5458 /// use google_cloud_dataplex_v1::Result;
5459 /// async fn sample(
5460 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str
5461 /// ) -> Result<()> {
5462 /// let response = client.update_lake()
5463 /// .set_lake(
5464 /// Lake::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"))/* set fields */
5465 /// )
5466 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
5467 /// .poller().until_done().await?;
5468 /// println!("response {:?}", response);
5469 /// Ok(())
5470 /// }
5471 /// ```
5472 pub fn update_lake(&self) -> super::builder::dataplex_service::UpdateLake {
5473 super::builder::dataplex_service::UpdateLake::new(self.inner.clone())
5474 }
5475
5476 /// Deletes a lake resource. All zones within the lake must be deleted before
5477 /// the lake can be deleted.
5478 ///
5479 /// # Long running operations
5480 ///
5481 /// This method is used to start, and/or poll a [long-running Operation].
5482 /// The [Working with long-running operations] chapter in the [user guide]
5483 /// covers these operations in detail.
5484 ///
5485 /// [long-running operation]: https://google.aip.dev/151
5486 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5487 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5488 ///
5489 /// # Example
5490 /// ```
5491 /// # use google_cloud_dataplex_v1::client::DataplexService;
5492 /// use google_cloud_lro::Poller;
5493 /// use google_cloud_dataplex_v1::Result;
5494 /// async fn sample(
5495 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str
5496 /// ) -> Result<()> {
5497 /// client.delete_lake()
5498 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"))
5499 /// .poller().until_done().await?;
5500 /// Ok(())
5501 /// }
5502 /// ```
5503 pub fn delete_lake(&self) -> super::builder::dataplex_service::DeleteLake {
5504 super::builder::dataplex_service::DeleteLake::new(self.inner.clone())
5505 }
5506
5507 /// Lists lake resources in a project and location.
5508 ///
5509 /// # Example
5510 /// ```
5511 /// # use google_cloud_dataplex_v1::client::DataplexService;
5512 /// use google_cloud_gax::paginator::ItemPaginator as _;
5513 /// use google_cloud_dataplex_v1::Result;
5514 /// async fn sample(
5515 /// client: &DataplexService, parent: &str
5516 /// ) -> Result<()> {
5517 /// let mut list = client.list_lakes()
5518 /// .set_parent(parent)
5519 /// .by_item();
5520 /// while let Some(item) = list.next().await.transpose()? {
5521 /// println!("{:?}", item);
5522 /// }
5523 /// Ok(())
5524 /// }
5525 /// ```
5526 pub fn list_lakes(&self) -> super::builder::dataplex_service::ListLakes {
5527 super::builder::dataplex_service::ListLakes::new(self.inner.clone())
5528 }
5529
5530 /// Retrieves a lake resource.
5531 ///
5532 /// # Example
5533 /// ```
5534 /// # use google_cloud_dataplex_v1::client::DataplexService;
5535 /// use google_cloud_dataplex_v1::Result;
5536 /// async fn sample(
5537 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str
5538 /// ) -> Result<()> {
5539 /// let response = client.get_lake()
5540 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"))
5541 /// .send().await?;
5542 /// println!("response {:?}", response);
5543 /// Ok(())
5544 /// }
5545 /// ```
5546 pub fn get_lake(&self) -> super::builder::dataplex_service::GetLake {
5547 super::builder::dataplex_service::GetLake::new(self.inner.clone())
5548 }
5549
5550 /// Lists action resources in a lake.
5551 ///
5552 /// # Example
5553 /// ```
5554 /// # use google_cloud_dataplex_v1::client::DataplexService;
5555 /// use google_cloud_gax::paginator::ItemPaginator as _;
5556 /// use google_cloud_dataplex_v1::Result;
5557 /// async fn sample(
5558 /// client: &DataplexService
5559 /// ) -> Result<()> {
5560 /// let mut list = client.list_lake_actions()
5561 /// /* set fields */
5562 /// .by_item();
5563 /// while let Some(item) = list.next().await.transpose()? {
5564 /// println!("{:?}", item);
5565 /// }
5566 /// Ok(())
5567 /// }
5568 /// ```
5569 pub fn list_lake_actions(&self) -> super::builder::dataplex_service::ListLakeActions {
5570 super::builder::dataplex_service::ListLakeActions::new(self.inner.clone())
5571 }
5572
5573 /// Creates a zone resource within a lake.
5574 ///
5575 /// # Long running operations
5576 ///
5577 /// This method is used to start, and/or poll a [long-running Operation].
5578 /// The [Working with long-running operations] chapter in the [user guide]
5579 /// covers these operations in detail.
5580 ///
5581 /// [long-running operation]: https://google.aip.dev/151
5582 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5583 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5584 ///
5585 /// # Example
5586 /// ```
5587 /// # use google_cloud_dataplex_v1::client::DataplexService;
5588 /// use google_cloud_lro::Poller;
5589 /// use google_cloud_dataplex_v1::model::Zone;
5590 /// use google_cloud_dataplex_v1::Result;
5591 /// async fn sample(
5592 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str
5593 /// ) -> Result<()> {
5594 /// let response = client.create_zone()
5595 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"))
5596 /// .set_zone_id("zone_id_value")
5597 /// .set_zone(
5598 /// Zone::new()/* set fields */
5599 /// )
5600 /// .poller().until_done().await?;
5601 /// println!("response {:?}", response);
5602 /// Ok(())
5603 /// }
5604 /// ```
5605 pub fn create_zone(&self) -> super::builder::dataplex_service::CreateZone {
5606 super::builder::dataplex_service::CreateZone::new(self.inner.clone())
5607 }
5608
5609 /// Updates a zone resource.
5610 ///
5611 /// # Long running operations
5612 ///
5613 /// This method is used to start, and/or poll a [long-running Operation].
5614 /// The [Working with long-running operations] chapter in the [user guide]
5615 /// covers these operations in detail.
5616 ///
5617 /// [long-running operation]: https://google.aip.dev/151
5618 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5619 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5620 ///
5621 /// # Example
5622 /// ```
5623 /// # use google_cloud_dataplex_v1::client::DataplexService;
5624 /// use google_cloud_lro::Poller;
5625 /// # extern crate wkt as google_cloud_wkt;
5626 /// use google_cloud_wkt::FieldMask;
5627 /// use google_cloud_dataplex_v1::model::Zone;
5628 /// use google_cloud_dataplex_v1::Result;
5629 /// async fn sample(
5630 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str
5631 /// ) -> Result<()> {
5632 /// let response = client.update_zone()
5633 /// .set_zone(
5634 /// Zone::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"))/* set fields */
5635 /// )
5636 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
5637 /// .poller().until_done().await?;
5638 /// println!("response {:?}", response);
5639 /// Ok(())
5640 /// }
5641 /// ```
5642 pub fn update_zone(&self) -> super::builder::dataplex_service::UpdateZone {
5643 super::builder::dataplex_service::UpdateZone::new(self.inner.clone())
5644 }
5645
5646 /// Deletes a zone resource. All assets within a zone must be deleted before
5647 /// the zone can be deleted.
5648 ///
5649 /// # Long running operations
5650 ///
5651 /// This method is used to start, and/or poll a [long-running Operation].
5652 /// The [Working with long-running operations] chapter in the [user guide]
5653 /// covers these operations in detail.
5654 ///
5655 /// [long-running operation]: https://google.aip.dev/151
5656 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5657 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5658 ///
5659 /// # Example
5660 /// ```
5661 /// # use google_cloud_dataplex_v1::client::DataplexService;
5662 /// use google_cloud_lro::Poller;
5663 /// use google_cloud_dataplex_v1::Result;
5664 /// async fn sample(
5665 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str
5666 /// ) -> Result<()> {
5667 /// client.delete_zone()
5668 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"))
5669 /// .poller().until_done().await?;
5670 /// Ok(())
5671 /// }
5672 /// ```
5673 pub fn delete_zone(&self) -> super::builder::dataplex_service::DeleteZone {
5674 super::builder::dataplex_service::DeleteZone::new(self.inner.clone())
5675 }
5676
5677 /// Lists zone resources in a lake.
5678 ///
5679 /// # Example
5680 /// ```
5681 /// # use google_cloud_dataplex_v1::client::DataplexService;
5682 /// use google_cloud_gax::paginator::ItemPaginator as _;
5683 /// use google_cloud_dataplex_v1::Result;
5684 /// async fn sample(
5685 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str
5686 /// ) -> Result<()> {
5687 /// let mut list = client.list_zones()
5688 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"))
5689 /// .by_item();
5690 /// while let Some(item) = list.next().await.transpose()? {
5691 /// println!("{:?}", item);
5692 /// }
5693 /// Ok(())
5694 /// }
5695 /// ```
5696 pub fn list_zones(&self) -> super::builder::dataplex_service::ListZones {
5697 super::builder::dataplex_service::ListZones::new(self.inner.clone())
5698 }
5699
5700 /// Retrieves a zone resource.
5701 ///
5702 /// # Example
5703 /// ```
5704 /// # use google_cloud_dataplex_v1::client::DataplexService;
5705 /// use google_cloud_dataplex_v1::Result;
5706 /// async fn sample(
5707 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str
5708 /// ) -> Result<()> {
5709 /// let response = client.get_zone()
5710 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"))
5711 /// .send().await?;
5712 /// println!("response {:?}", response);
5713 /// Ok(())
5714 /// }
5715 /// ```
5716 pub fn get_zone(&self) -> super::builder::dataplex_service::GetZone {
5717 super::builder::dataplex_service::GetZone::new(self.inner.clone())
5718 }
5719
5720 /// Lists action resources in a zone.
5721 ///
5722 /// # Example
5723 /// ```
5724 /// # use google_cloud_dataplex_v1::client::DataplexService;
5725 /// use google_cloud_gax::paginator::ItemPaginator as _;
5726 /// use google_cloud_dataplex_v1::Result;
5727 /// async fn sample(
5728 /// client: &DataplexService
5729 /// ) -> Result<()> {
5730 /// let mut list = client.list_zone_actions()
5731 /// /* set fields */
5732 /// .by_item();
5733 /// while let Some(item) = list.next().await.transpose()? {
5734 /// println!("{:?}", item);
5735 /// }
5736 /// Ok(())
5737 /// }
5738 /// ```
5739 pub fn list_zone_actions(&self) -> super::builder::dataplex_service::ListZoneActions {
5740 super::builder::dataplex_service::ListZoneActions::new(self.inner.clone())
5741 }
5742
5743 /// Creates an asset resource.
5744 ///
5745 /// # Long running operations
5746 ///
5747 /// This method is used to start, and/or poll a [long-running Operation].
5748 /// The [Working with long-running operations] chapter in the [user guide]
5749 /// covers these operations in detail.
5750 ///
5751 /// [long-running operation]: https://google.aip.dev/151
5752 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5753 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5754 ///
5755 /// # Example
5756 /// ```
5757 /// # use google_cloud_dataplex_v1::client::DataplexService;
5758 /// use google_cloud_lro::Poller;
5759 /// use google_cloud_dataplex_v1::model::Asset;
5760 /// use google_cloud_dataplex_v1::Result;
5761 /// async fn sample(
5762 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str
5763 /// ) -> Result<()> {
5764 /// let response = client.create_asset()
5765 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"))
5766 /// .set_asset_id("asset_id_value")
5767 /// .set_asset(
5768 /// Asset::new()/* set fields */
5769 /// )
5770 /// .poller().until_done().await?;
5771 /// println!("response {:?}", response);
5772 /// Ok(())
5773 /// }
5774 /// ```
5775 pub fn create_asset(&self) -> super::builder::dataplex_service::CreateAsset {
5776 super::builder::dataplex_service::CreateAsset::new(self.inner.clone())
5777 }
5778
5779 /// Updates an asset resource.
5780 ///
5781 /// # Long running operations
5782 ///
5783 /// This method is used to start, and/or poll a [long-running Operation].
5784 /// The [Working with long-running operations] chapter in the [user guide]
5785 /// covers these operations in detail.
5786 ///
5787 /// [long-running operation]: https://google.aip.dev/151
5788 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5789 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5790 ///
5791 /// # Example
5792 /// ```
5793 /// # use google_cloud_dataplex_v1::client::DataplexService;
5794 /// use google_cloud_lro::Poller;
5795 /// # extern crate wkt as google_cloud_wkt;
5796 /// use google_cloud_wkt::FieldMask;
5797 /// use google_cloud_dataplex_v1::model::Asset;
5798 /// use google_cloud_dataplex_v1::Result;
5799 /// async fn sample(
5800 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, asset_id: &str
5801 /// ) -> Result<()> {
5802 /// let response = client.update_asset()
5803 /// .set_asset(
5804 /// Asset::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}"))/* set fields */
5805 /// )
5806 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
5807 /// .poller().until_done().await?;
5808 /// println!("response {:?}", response);
5809 /// Ok(())
5810 /// }
5811 /// ```
5812 pub fn update_asset(&self) -> super::builder::dataplex_service::UpdateAsset {
5813 super::builder::dataplex_service::UpdateAsset::new(self.inner.clone())
5814 }
5815
5816 /// Deletes an asset resource. The referenced storage resource is detached
5817 /// (default) or deleted based on the associated Lifecycle policy.
5818 ///
5819 /// # Long running operations
5820 ///
5821 /// This method is used to start, and/or poll a [long-running Operation].
5822 /// The [Working with long-running operations] chapter in the [user guide]
5823 /// covers these operations in detail.
5824 ///
5825 /// [long-running operation]: https://google.aip.dev/151
5826 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5827 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5828 ///
5829 /// # Example
5830 /// ```
5831 /// # use google_cloud_dataplex_v1::client::DataplexService;
5832 /// use google_cloud_lro::Poller;
5833 /// use google_cloud_dataplex_v1::Result;
5834 /// async fn sample(
5835 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, asset_id: &str
5836 /// ) -> Result<()> {
5837 /// client.delete_asset()
5838 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}"))
5839 /// .poller().until_done().await?;
5840 /// Ok(())
5841 /// }
5842 /// ```
5843 pub fn delete_asset(&self) -> super::builder::dataplex_service::DeleteAsset {
5844 super::builder::dataplex_service::DeleteAsset::new(self.inner.clone())
5845 }
5846
5847 /// Lists asset resources in a zone.
5848 ///
5849 /// # Example
5850 /// ```
5851 /// # use google_cloud_dataplex_v1::client::DataplexService;
5852 /// use google_cloud_gax::paginator::ItemPaginator as _;
5853 /// use google_cloud_dataplex_v1::Result;
5854 /// async fn sample(
5855 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str
5856 /// ) -> Result<()> {
5857 /// let mut list = client.list_assets()
5858 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}"))
5859 /// .by_item();
5860 /// while let Some(item) = list.next().await.transpose()? {
5861 /// println!("{:?}", item);
5862 /// }
5863 /// Ok(())
5864 /// }
5865 /// ```
5866 pub fn list_assets(&self) -> super::builder::dataplex_service::ListAssets {
5867 super::builder::dataplex_service::ListAssets::new(self.inner.clone())
5868 }
5869
5870 /// Retrieves an asset resource.
5871 ///
5872 /// # Example
5873 /// ```
5874 /// # use google_cloud_dataplex_v1::client::DataplexService;
5875 /// use google_cloud_dataplex_v1::Result;
5876 /// async fn sample(
5877 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, zone_id: &str, asset_id: &str
5878 /// ) -> Result<()> {
5879 /// let response = client.get_asset()
5880 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}"))
5881 /// .send().await?;
5882 /// println!("response {:?}", response);
5883 /// Ok(())
5884 /// }
5885 /// ```
5886 pub fn get_asset(&self) -> super::builder::dataplex_service::GetAsset {
5887 super::builder::dataplex_service::GetAsset::new(self.inner.clone())
5888 }
5889
5890 /// Lists action resources in an asset.
5891 ///
5892 /// # Example
5893 /// ```
5894 /// # use google_cloud_dataplex_v1::client::DataplexService;
5895 /// use google_cloud_gax::paginator::ItemPaginator as _;
5896 /// use google_cloud_dataplex_v1::Result;
5897 /// async fn sample(
5898 /// client: &DataplexService
5899 /// ) -> Result<()> {
5900 /// let mut list = client.list_asset_actions()
5901 /// /* set fields */
5902 /// .by_item();
5903 /// while let Some(item) = list.next().await.transpose()? {
5904 /// println!("{:?}", item);
5905 /// }
5906 /// Ok(())
5907 /// }
5908 /// ```
5909 pub fn list_asset_actions(&self) -> super::builder::dataplex_service::ListAssetActions {
5910 super::builder::dataplex_service::ListAssetActions::new(self.inner.clone())
5911 }
5912
5913 /// Creates a task resource within a lake.
5914 ///
5915 /// # Long running operations
5916 ///
5917 /// This method is used to start, and/or poll a [long-running Operation].
5918 /// The [Working with long-running operations] chapter in the [user guide]
5919 /// covers these operations in detail.
5920 ///
5921 /// [long-running operation]: https://google.aip.dev/151
5922 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5923 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5924 ///
5925 /// # Example
5926 /// ```
5927 /// # use google_cloud_dataplex_v1::client::DataplexService;
5928 /// use google_cloud_lro::Poller;
5929 /// use google_cloud_dataplex_v1::model::Task;
5930 /// use google_cloud_dataplex_v1::Result;
5931 /// async fn sample(
5932 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str
5933 /// ) -> Result<()> {
5934 /// let response = client.create_task()
5935 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"))
5936 /// .set_task_id("task_id_value")
5937 /// .set_task(
5938 /// Task::new()/* set fields */
5939 /// )
5940 /// .poller().until_done().await?;
5941 /// println!("response {:?}", response);
5942 /// Ok(())
5943 /// }
5944 /// ```
5945 pub fn create_task(&self) -> super::builder::dataplex_service::CreateTask {
5946 super::builder::dataplex_service::CreateTask::new(self.inner.clone())
5947 }
5948
5949 /// Update the task resource.
5950 ///
5951 /// # Long running operations
5952 ///
5953 /// This method is used to start, and/or poll a [long-running Operation].
5954 /// The [Working with long-running operations] chapter in the [user guide]
5955 /// covers these operations in detail.
5956 ///
5957 /// [long-running operation]: https://google.aip.dev/151
5958 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5959 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5960 ///
5961 /// # Example
5962 /// ```
5963 /// # use google_cloud_dataplex_v1::client::DataplexService;
5964 /// use google_cloud_lro::Poller;
5965 /// # extern crate wkt as google_cloud_wkt;
5966 /// use google_cloud_wkt::FieldMask;
5967 /// use google_cloud_dataplex_v1::model::Task;
5968 /// use google_cloud_dataplex_v1::Result;
5969 /// async fn sample(
5970 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, task_id: &str
5971 /// ) -> Result<()> {
5972 /// let response = client.update_task()
5973 /// .set_task(
5974 /// Task::new().set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"))/* set fields */
5975 /// )
5976 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
5977 /// .poller().until_done().await?;
5978 /// println!("response {:?}", response);
5979 /// Ok(())
5980 /// }
5981 /// ```
5982 pub fn update_task(&self) -> super::builder::dataplex_service::UpdateTask {
5983 super::builder::dataplex_service::UpdateTask::new(self.inner.clone())
5984 }
5985
5986 /// Delete the task resource.
5987 ///
5988 /// # Long running operations
5989 ///
5990 /// This method is used to start, and/or poll a [long-running Operation].
5991 /// The [Working with long-running operations] chapter in the [user guide]
5992 /// covers these operations in detail.
5993 ///
5994 /// [long-running operation]: https://google.aip.dev/151
5995 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5996 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5997 ///
5998 /// # Example
5999 /// ```
6000 /// # use google_cloud_dataplex_v1::client::DataplexService;
6001 /// use google_cloud_lro::Poller;
6002 /// use google_cloud_dataplex_v1::Result;
6003 /// async fn sample(
6004 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, task_id: &str
6005 /// ) -> Result<()> {
6006 /// client.delete_task()
6007 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"))
6008 /// .poller().until_done().await?;
6009 /// Ok(())
6010 /// }
6011 /// ```
6012 pub fn delete_task(&self) -> super::builder::dataplex_service::DeleteTask {
6013 super::builder::dataplex_service::DeleteTask::new(self.inner.clone())
6014 }
6015
6016 /// Lists tasks under the given lake.
6017 ///
6018 /// # Example
6019 /// ```
6020 /// # use google_cloud_dataplex_v1::client::DataplexService;
6021 /// use google_cloud_gax::paginator::ItemPaginator as _;
6022 /// use google_cloud_dataplex_v1::Result;
6023 /// async fn sample(
6024 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str
6025 /// ) -> Result<()> {
6026 /// let mut list = client.list_tasks()
6027 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}"))
6028 /// .by_item();
6029 /// while let Some(item) = list.next().await.transpose()? {
6030 /// println!("{:?}", item);
6031 /// }
6032 /// Ok(())
6033 /// }
6034 /// ```
6035 pub fn list_tasks(&self) -> super::builder::dataplex_service::ListTasks {
6036 super::builder::dataplex_service::ListTasks::new(self.inner.clone())
6037 }
6038
6039 /// Get task resource.
6040 ///
6041 /// # Example
6042 /// ```
6043 /// # use google_cloud_dataplex_v1::client::DataplexService;
6044 /// use google_cloud_dataplex_v1::Result;
6045 /// async fn sample(
6046 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, task_id: &str
6047 /// ) -> Result<()> {
6048 /// let response = client.get_task()
6049 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"))
6050 /// .send().await?;
6051 /// println!("response {:?}", response);
6052 /// Ok(())
6053 /// }
6054 /// ```
6055 pub fn get_task(&self) -> super::builder::dataplex_service::GetTask {
6056 super::builder::dataplex_service::GetTask::new(self.inner.clone())
6057 }
6058
6059 /// Lists Jobs under the given task.
6060 ///
6061 /// # Example
6062 /// ```
6063 /// # use google_cloud_dataplex_v1::client::DataplexService;
6064 /// use google_cloud_gax::paginator::ItemPaginator as _;
6065 /// use google_cloud_dataplex_v1::Result;
6066 /// async fn sample(
6067 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, task_id: &str
6068 /// ) -> Result<()> {
6069 /// let mut list = client.list_jobs()
6070 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}"))
6071 /// .by_item();
6072 /// while let Some(item) = list.next().await.transpose()? {
6073 /// println!("{:?}", item);
6074 /// }
6075 /// Ok(())
6076 /// }
6077 /// ```
6078 pub fn list_jobs(&self) -> super::builder::dataplex_service::ListJobs {
6079 super::builder::dataplex_service::ListJobs::new(self.inner.clone())
6080 }
6081
6082 /// Run an on demand execution of a Task.
6083 ///
6084 /// # Example
6085 /// ```
6086 /// # use google_cloud_dataplex_v1::client::DataplexService;
6087 /// use google_cloud_dataplex_v1::Result;
6088 /// async fn sample(
6089 /// client: &DataplexService
6090 /// ) -> Result<()> {
6091 /// let response = client.run_task()
6092 /// /* set fields */
6093 /// .send().await?;
6094 /// println!("response {:?}", response);
6095 /// Ok(())
6096 /// }
6097 /// ```
6098 pub fn run_task(&self) -> super::builder::dataplex_service::RunTask {
6099 super::builder::dataplex_service::RunTask::new(self.inner.clone())
6100 }
6101
6102 /// Get job resource.
6103 ///
6104 /// # Example
6105 /// ```
6106 /// # use google_cloud_dataplex_v1::client::DataplexService;
6107 /// use google_cloud_dataplex_v1::Result;
6108 /// async fn sample(
6109 /// client: &DataplexService, project_id: &str, location_id: &str, lake_id: &str, task_id: &str, job_id: &str
6110 /// ) -> Result<()> {
6111 /// let response = client.get_job()
6112 /// .set_name(format!("projects/{project_id}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}"))
6113 /// .send().await?;
6114 /// println!("response {:?}", response);
6115 /// Ok(())
6116 /// }
6117 /// ```
6118 pub fn get_job(&self) -> super::builder::dataplex_service::GetJob {
6119 super::builder::dataplex_service::GetJob::new(self.inner.clone())
6120 }
6121
6122 /// Cancel jobs running for the task resource.
6123 ///
6124 /// # Example
6125 /// ```
6126 /// # use google_cloud_dataplex_v1::client::DataplexService;
6127 /// use google_cloud_dataplex_v1::Result;
6128 /// async fn sample(
6129 /// client: &DataplexService
6130 /// ) -> Result<()> {
6131 /// client.cancel_job()
6132 /// /* set fields */
6133 /// .send().await?;
6134 /// Ok(())
6135 /// }
6136 /// ```
6137 pub fn cancel_job(&self) -> super::builder::dataplex_service::CancelJob {
6138 super::builder::dataplex_service::CancelJob::new(self.inner.clone())
6139 }
6140
6141 /// Lists information about the supported locations for this service.
6142 /// This method can be called in two ways:
6143 ///
6144 /// * **List all public locations:** Use the path `GET /v1/locations`.
6145 /// * **List project-visible locations:** Use the path
6146 /// `GET /v1/projects/{project_id}/locations`. This may include public
6147 /// locations as well as private or other locations specifically visible
6148 /// to the project.
6149 ///
6150 /// # Example
6151 /// ```
6152 /// # use google_cloud_dataplex_v1::client::DataplexService;
6153 /// use google_cloud_gax::paginator::ItemPaginator as _;
6154 /// use google_cloud_dataplex_v1::Result;
6155 /// async fn sample(
6156 /// client: &DataplexService
6157 /// ) -> Result<()> {
6158 /// let mut list = client.list_locations()
6159 /// /* set fields */
6160 /// .by_item();
6161 /// while let Some(item) = list.next().await.transpose()? {
6162 /// println!("{:?}", item);
6163 /// }
6164 /// Ok(())
6165 /// }
6166 /// ```
6167 pub fn list_locations(&self) -> super::builder::dataplex_service::ListLocations {
6168 super::builder::dataplex_service::ListLocations::new(self.inner.clone())
6169 }
6170
6171 /// Gets information about a location.
6172 ///
6173 /// # Example
6174 /// ```
6175 /// # use google_cloud_dataplex_v1::client::DataplexService;
6176 /// use google_cloud_dataplex_v1::Result;
6177 /// async fn sample(
6178 /// client: &DataplexService
6179 /// ) -> Result<()> {
6180 /// let response = client.get_location()
6181 /// /* set fields */
6182 /// .send().await?;
6183 /// println!("response {:?}", response);
6184 /// Ok(())
6185 /// }
6186 /// ```
6187 pub fn get_location(&self) -> super::builder::dataplex_service::GetLocation {
6188 super::builder::dataplex_service::GetLocation::new(self.inner.clone())
6189 }
6190
6191 /// Sets the access control policy on the specified resource. Replaces
6192 /// any existing policy.
6193 ///
6194 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6195 /// errors.
6196 ///
6197 /// # Example
6198 /// ```
6199 /// # use google_cloud_dataplex_v1::client::DataplexService;
6200 /// use google_cloud_dataplex_v1::Result;
6201 /// async fn sample(
6202 /// client: &DataplexService
6203 /// ) -> Result<()> {
6204 /// let response = client.set_iam_policy()
6205 /// /* set fields */
6206 /// .send().await?;
6207 /// println!("response {:?}", response);
6208 /// Ok(())
6209 /// }
6210 /// ```
6211 pub fn set_iam_policy(&self) -> super::builder::dataplex_service::SetIamPolicy {
6212 super::builder::dataplex_service::SetIamPolicy::new(self.inner.clone())
6213 }
6214
6215 /// Gets the access control policy for a resource. Returns an empty policy
6216 /// if the resource exists and does not have a policy set.
6217 ///
6218 /// # Example
6219 /// ```
6220 /// # use google_cloud_dataplex_v1::client::DataplexService;
6221 /// use google_cloud_dataplex_v1::Result;
6222 /// async fn sample(
6223 /// client: &DataplexService
6224 /// ) -> Result<()> {
6225 /// let response = client.get_iam_policy()
6226 /// /* set fields */
6227 /// .send().await?;
6228 /// println!("response {:?}", response);
6229 /// Ok(())
6230 /// }
6231 /// ```
6232 pub fn get_iam_policy(&self) -> super::builder::dataplex_service::GetIamPolicy {
6233 super::builder::dataplex_service::GetIamPolicy::new(self.inner.clone())
6234 }
6235
6236 /// Returns permissions that a caller has on the specified resource. If the
6237 /// resource does not exist, this will return an empty set of
6238 /// permissions, not a `NOT_FOUND` error.
6239 ///
6240 /// Note: This operation is designed to be used for building
6241 /// permission-aware UIs and command-line tools, not for authorization
6242 /// checking. This operation may "fail open" without warning.
6243 ///
6244 /// # Example
6245 /// ```
6246 /// # use google_cloud_dataplex_v1::client::DataplexService;
6247 /// use google_cloud_dataplex_v1::Result;
6248 /// async fn sample(
6249 /// client: &DataplexService
6250 /// ) -> Result<()> {
6251 /// let response = client.test_iam_permissions()
6252 /// /* set fields */
6253 /// .send().await?;
6254 /// println!("response {:?}", response);
6255 /// Ok(())
6256 /// }
6257 /// ```
6258 pub fn test_iam_permissions(&self) -> super::builder::dataplex_service::TestIamPermissions {
6259 super::builder::dataplex_service::TestIamPermissions::new(self.inner.clone())
6260 }
6261
6262 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6263 ///
6264 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6265 ///
6266 /// # Example
6267 /// ```
6268 /// # use google_cloud_dataplex_v1::client::DataplexService;
6269 /// use google_cloud_gax::paginator::ItemPaginator as _;
6270 /// use google_cloud_dataplex_v1::Result;
6271 /// async fn sample(
6272 /// client: &DataplexService
6273 /// ) -> Result<()> {
6274 /// let mut list = client.list_operations()
6275 /// /* set fields */
6276 /// .by_item();
6277 /// while let Some(item) = list.next().await.transpose()? {
6278 /// println!("{:?}", item);
6279 /// }
6280 /// Ok(())
6281 /// }
6282 /// ```
6283 pub fn list_operations(&self) -> super::builder::dataplex_service::ListOperations {
6284 super::builder::dataplex_service::ListOperations::new(self.inner.clone())
6285 }
6286
6287 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6288 ///
6289 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6290 ///
6291 /// # Example
6292 /// ```
6293 /// # use google_cloud_dataplex_v1::client::DataplexService;
6294 /// use google_cloud_dataplex_v1::Result;
6295 /// async fn sample(
6296 /// client: &DataplexService
6297 /// ) -> Result<()> {
6298 /// let response = client.get_operation()
6299 /// /* set fields */
6300 /// .send().await?;
6301 /// println!("response {:?}", response);
6302 /// Ok(())
6303 /// }
6304 /// ```
6305 pub fn get_operation(&self) -> super::builder::dataplex_service::GetOperation {
6306 super::builder::dataplex_service::GetOperation::new(self.inner.clone())
6307 }
6308
6309 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6310 ///
6311 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6312 ///
6313 /// # Example
6314 /// ```
6315 /// # use google_cloud_dataplex_v1::client::DataplexService;
6316 /// use google_cloud_dataplex_v1::Result;
6317 /// async fn sample(
6318 /// client: &DataplexService
6319 /// ) -> Result<()> {
6320 /// client.delete_operation()
6321 /// /* set fields */
6322 /// .send().await?;
6323 /// Ok(())
6324 /// }
6325 /// ```
6326 pub fn delete_operation(&self) -> super::builder::dataplex_service::DeleteOperation {
6327 super::builder::dataplex_service::DeleteOperation::new(self.inner.clone())
6328 }
6329
6330 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6331 ///
6332 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6333 ///
6334 /// # Example
6335 /// ```
6336 /// # use google_cloud_dataplex_v1::client::DataplexService;
6337 /// use google_cloud_dataplex_v1::Result;
6338 /// async fn sample(
6339 /// client: &DataplexService
6340 /// ) -> Result<()> {
6341 /// client.cancel_operation()
6342 /// /* set fields */
6343 /// .send().await?;
6344 /// Ok(())
6345 /// }
6346 /// ```
6347 pub fn cancel_operation(&self) -> super::builder::dataplex_service::CancelOperation {
6348 super::builder::dataplex_service::CancelOperation::new(self.inner.clone())
6349 }
6350}