Skip to main content

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