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