google_cloud_dataplex_v1/
client.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18
19/// Implements a client for the Cloud Dataplex API.
20///
21/// # Example
22/// ```
23/// # tokio_test::block_on(async {
24/// # use google_cloud_dataplex_v1::client::CatalogService;
25/// let client = CatalogService::builder().build().await?;
26/// // use `client` to make requests to the Cloud Dataplex API.
27/// # gax::client_builder::Result::<()>::Ok(()) });
28/// ```
29///
30/// # Service Description
31///
32/// The primary resources offered by this service are EntryGroups, EntryTypes,
33/// AspectTypes, and Entries. They collectively let data administrators organize,
34/// manage, secure, and catalog data located across cloud projects in their
35/// organization in a variety of storage systems, including Cloud Storage and
36/// BigQuery.
37///
38/// # Configuration
39///
40/// To configure `CatalogService` use the `with_*` methods in the type returned
41/// by [builder()][CatalogService::builder]. The default configuration should
42/// work for most applications. Common configuration changes include
43///
44/// * [with_endpoint()]: by default this client uses the global default endpoint
45///   (`https://dataplex.googleapis.com`). Applications using regional
46///   endpoints or running in restricted networks (e.g. a network configured
47//    with [Private Google Access with VPC Service Controls]) may want to
48///   override this default.
49/// * [with_credentials()]: by default this client uses
50///   [Application Default Credentials]. Applications using custom
51///   authentication may need to override this default.
52///
53/// [with_endpoint()]: super::builder::catalog_service::ClientBuilder::with_endpoint
54/// [with_credentials()]: super::builder::catalog_service::ClientBuilder::credentials
55/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
56/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
57///
58/// # Pooling and Cloning
59///
60/// `CatalogService` holds a connection pool internally, it is advised to
61/// create one and the reuse it.  You do not need to wrap `CatalogService` in
62/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
63/// already uses an `Arc` internally.
64#[derive(Clone, Debug)]
65pub struct CatalogService {
66    inner: std::sync::Arc<dyn super::stub::dynamic::CatalogService>,
67}
68
69impl CatalogService {
70    /// Returns a builder for [CatalogService].
71    ///
72    /// ```
73    /// # tokio_test::block_on(async {
74    /// # use google_cloud_dataplex_v1::client::CatalogService;
75    /// let client = CatalogService::builder().build().await?;
76    /// # gax::client_builder::Result::<()>::Ok(()) });
77    /// ```
78    pub fn builder() -> super::builder::catalog_service::ClientBuilder {
79        gax::client_builder::internal::new_builder(super::builder::catalog_service::client::Factory)
80    }
81
82    /// Creates a new client from the provided stub.
83    ///
84    /// The most common case for calling this function is in tests mocking the
85    /// client's behavior.
86    pub fn from_stub<T>(stub: T) -> Self
87    where
88        T: super::stub::CatalogService + 'static,
89    {
90        Self {
91            inner: std::sync::Arc::new(stub),
92        }
93    }
94
95    pub(crate) async fn new(
96        config: gaxi::options::ClientConfig,
97    ) -> gax::client_builder::Result<Self> {
98        let inner = Self::build_inner(config).await?;
99        Ok(Self { inner })
100    }
101
102    async fn build_inner(
103        conf: gaxi::options::ClientConfig,
104    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::CatalogService>> {
105        if gaxi::options::tracing_enabled(&conf) {
106            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
107        }
108        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
109    }
110
111    async fn build_transport(
112        conf: gaxi::options::ClientConfig,
113    ) -> gax::client_builder::Result<impl super::stub::CatalogService> {
114        super::transport::CatalogService::new(conf).await
115    }
116
117    async fn build_with_tracing(
118        conf: gaxi::options::ClientConfig,
119    ) -> gax::client_builder::Result<impl super::stub::CatalogService> {
120        Self::build_transport(conf)
121            .await
122            .map(super::tracing::CatalogService::new)
123    }
124
125    /// Creates an EntryType.
126    ///
127    /// # Long running operations
128    ///
129    /// This method is used to start, and/or poll a [long-running Operation].
130    /// The [Working with long-running operations] chapter in the [user guide]
131    /// covers these operations in detail.
132    ///
133    /// [long-running operation]: https://google.aip.dev/151
134    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
135    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
136    pub fn create_entry_type(&self) -> super::builder::catalog_service::CreateEntryType {
137        super::builder::catalog_service::CreateEntryType::new(self.inner.clone())
138    }
139
140    /// Updates an EntryType.
141    ///
142    /// # Long running operations
143    ///
144    /// This method is used to start, and/or poll a [long-running Operation].
145    /// The [Working with long-running operations] chapter in the [user guide]
146    /// covers these operations in detail.
147    ///
148    /// [long-running operation]: https://google.aip.dev/151
149    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
150    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
151    pub fn update_entry_type(&self) -> super::builder::catalog_service::UpdateEntryType {
152        super::builder::catalog_service::UpdateEntryType::new(self.inner.clone())
153    }
154
155    /// Deletes an EntryType.
156    ///
157    /// # Long running operations
158    ///
159    /// This method is used to start, and/or poll a [long-running Operation].
160    /// The [Working with long-running operations] chapter in the [user guide]
161    /// covers these operations in detail.
162    ///
163    /// [long-running operation]: https://google.aip.dev/151
164    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
165    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
166    pub fn delete_entry_type(&self) -> super::builder::catalog_service::DeleteEntryType {
167        super::builder::catalog_service::DeleteEntryType::new(self.inner.clone())
168    }
169
170    /// Lists EntryType resources in a project and location.
171    pub fn list_entry_types(&self) -> super::builder::catalog_service::ListEntryTypes {
172        super::builder::catalog_service::ListEntryTypes::new(self.inner.clone())
173    }
174
175    /// Gets an EntryType.
176    pub fn get_entry_type(&self) -> super::builder::catalog_service::GetEntryType {
177        super::builder::catalog_service::GetEntryType::new(self.inner.clone())
178    }
179
180    /// Creates an AspectType.
181    ///
182    /// # Long running operations
183    ///
184    /// This method is used to start, and/or poll a [long-running Operation].
185    /// The [Working with long-running operations] chapter in the [user guide]
186    /// covers these operations in detail.
187    ///
188    /// [long-running operation]: https://google.aip.dev/151
189    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
190    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
191    pub fn create_aspect_type(&self) -> super::builder::catalog_service::CreateAspectType {
192        super::builder::catalog_service::CreateAspectType::new(self.inner.clone())
193    }
194
195    /// Updates an AspectType.
196    ///
197    /// # Long running operations
198    ///
199    /// This method is used to start, and/or poll a [long-running Operation].
200    /// The [Working with long-running operations] chapter in the [user guide]
201    /// covers these operations in detail.
202    ///
203    /// [long-running operation]: https://google.aip.dev/151
204    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
205    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
206    pub fn update_aspect_type(&self) -> super::builder::catalog_service::UpdateAspectType {
207        super::builder::catalog_service::UpdateAspectType::new(self.inner.clone())
208    }
209
210    /// Deletes an AspectType.
211    ///
212    /// # Long running operations
213    ///
214    /// This method is used to start, and/or poll a [long-running Operation].
215    /// The [Working with long-running operations] chapter in the [user guide]
216    /// covers these operations in detail.
217    ///
218    /// [long-running operation]: https://google.aip.dev/151
219    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
220    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
221    pub fn delete_aspect_type(&self) -> super::builder::catalog_service::DeleteAspectType {
222        super::builder::catalog_service::DeleteAspectType::new(self.inner.clone())
223    }
224
225    /// Lists AspectType resources in a project and location.
226    pub fn list_aspect_types(&self) -> super::builder::catalog_service::ListAspectTypes {
227        super::builder::catalog_service::ListAspectTypes::new(self.inner.clone())
228    }
229
230    /// Gets an AspectType.
231    pub fn get_aspect_type(&self) -> super::builder::catalog_service::GetAspectType {
232        super::builder::catalog_service::GetAspectType::new(self.inner.clone())
233    }
234
235    /// Creates an EntryGroup.
236    ///
237    /// # Long running operations
238    ///
239    /// This method is used to start, and/or poll a [long-running Operation].
240    /// The [Working with long-running operations] chapter in the [user guide]
241    /// covers these operations in detail.
242    ///
243    /// [long-running operation]: https://google.aip.dev/151
244    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
245    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
246    pub fn create_entry_group(&self) -> super::builder::catalog_service::CreateEntryGroup {
247        super::builder::catalog_service::CreateEntryGroup::new(self.inner.clone())
248    }
249
250    /// Updates an EntryGroup.
251    ///
252    /// # Long running operations
253    ///
254    /// This method is used to start, and/or poll a [long-running Operation].
255    /// The [Working with long-running operations] chapter in the [user guide]
256    /// covers these operations in detail.
257    ///
258    /// [long-running operation]: https://google.aip.dev/151
259    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
260    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
261    pub fn update_entry_group(&self) -> super::builder::catalog_service::UpdateEntryGroup {
262        super::builder::catalog_service::UpdateEntryGroup::new(self.inner.clone())
263    }
264
265    /// Deletes an EntryGroup.
266    ///
267    /// # Long running operations
268    ///
269    /// This method is used to start, and/or poll a [long-running Operation].
270    /// The [Working with long-running operations] chapter in the [user guide]
271    /// covers these operations in detail.
272    ///
273    /// [long-running operation]: https://google.aip.dev/151
274    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
275    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
276    pub fn delete_entry_group(&self) -> super::builder::catalog_service::DeleteEntryGroup {
277        super::builder::catalog_service::DeleteEntryGroup::new(self.inner.clone())
278    }
279
280    /// Lists EntryGroup resources in a project and location.
281    pub fn list_entry_groups(&self) -> super::builder::catalog_service::ListEntryGroups {
282        super::builder::catalog_service::ListEntryGroups::new(self.inner.clone())
283    }
284
285    /// Gets an EntryGroup.
286    pub fn get_entry_group(&self) -> super::builder::catalog_service::GetEntryGroup {
287        super::builder::catalog_service::GetEntryGroup::new(self.inner.clone())
288    }
289
290    /// Creates an Entry.
291    pub fn create_entry(&self) -> super::builder::catalog_service::CreateEntry {
292        super::builder::catalog_service::CreateEntry::new(self.inner.clone())
293    }
294
295    /// Updates an Entry.
296    pub fn update_entry(&self) -> super::builder::catalog_service::UpdateEntry {
297        super::builder::catalog_service::UpdateEntry::new(self.inner.clone())
298    }
299
300    /// Deletes an Entry.
301    pub fn delete_entry(&self) -> super::builder::catalog_service::DeleteEntry {
302        super::builder::catalog_service::DeleteEntry::new(self.inner.clone())
303    }
304
305    /// Lists Entries within an EntryGroup.
306    pub fn list_entries(&self) -> super::builder::catalog_service::ListEntries {
307        super::builder::catalog_service::ListEntries::new(self.inner.clone())
308    }
309
310    /// Gets an Entry.
311    pub fn get_entry(&self) -> super::builder::catalog_service::GetEntry {
312        super::builder::catalog_service::GetEntry::new(self.inner.clone())
313    }
314
315    /// Looks up an entry by name using the permission on the source system.
316    pub fn lookup_entry(&self) -> super::builder::catalog_service::LookupEntry {
317        super::builder::catalog_service::LookupEntry::new(self.inner.clone())
318    }
319
320    /// Searches for Entries matching the given query and scope.
321    pub fn search_entries(&self) -> super::builder::catalog_service::SearchEntries {
322        super::builder::catalog_service::SearchEntries::new(self.inner.clone())
323    }
324
325    /// Creates a metadata job. For example, use a metadata job to import Dataplex
326    /// Catalog entries and aspects from a third-party system into Dataplex.
327    ///
328    /// # Long running operations
329    ///
330    /// This method is used to start, and/or poll a [long-running Operation].
331    /// The [Working with long-running operations] chapter in the [user guide]
332    /// covers these operations in detail.
333    ///
334    /// [long-running operation]: https://google.aip.dev/151
335    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
336    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
337    pub fn create_metadata_job(&self) -> super::builder::catalog_service::CreateMetadataJob {
338        super::builder::catalog_service::CreateMetadataJob::new(self.inner.clone())
339    }
340
341    /// Gets a metadata job.
342    pub fn get_metadata_job(&self) -> super::builder::catalog_service::GetMetadataJob {
343        super::builder::catalog_service::GetMetadataJob::new(self.inner.clone())
344    }
345
346    /// Lists metadata jobs.
347    pub fn list_metadata_jobs(&self) -> super::builder::catalog_service::ListMetadataJobs {
348        super::builder::catalog_service::ListMetadataJobs::new(self.inner.clone())
349    }
350
351    /// Cancels a metadata job.
352    ///
353    /// If you cancel a metadata import job that is in progress, the changes in the
354    /// job might be partially applied. We recommend that you reset the state of
355    /// the entry groups in your project by running another metadata job that
356    /// reverts the changes from the canceled job.
357    pub fn cancel_metadata_job(&self) -> super::builder::catalog_service::CancelMetadataJob {
358        super::builder::catalog_service::CancelMetadataJob::new(self.inner.clone())
359    }
360
361    /// Lists information about the supported locations for this service.
362    pub fn list_locations(&self) -> super::builder::catalog_service::ListLocations {
363        super::builder::catalog_service::ListLocations::new(self.inner.clone())
364    }
365
366    /// Gets information about a location.
367    pub fn get_location(&self) -> super::builder::catalog_service::GetLocation {
368        super::builder::catalog_service::GetLocation::new(self.inner.clone())
369    }
370
371    /// Sets the access control policy on the specified resource. Replaces
372    /// any existing policy.
373    ///
374    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
375    /// errors.
376    pub fn set_iam_policy(&self) -> super::builder::catalog_service::SetIamPolicy {
377        super::builder::catalog_service::SetIamPolicy::new(self.inner.clone())
378    }
379
380    /// Gets the access control policy for a resource. Returns an empty policy
381    /// if the resource exists and does not have a policy set.
382    pub fn get_iam_policy(&self) -> super::builder::catalog_service::GetIamPolicy {
383        super::builder::catalog_service::GetIamPolicy::new(self.inner.clone())
384    }
385
386    /// Returns permissions that a caller has on the specified resource. If the
387    /// resource does not exist, this will return an empty set of
388    /// permissions, not a `NOT_FOUND` error.
389    ///
390    /// Note: This operation is designed to be used for building
391    /// permission-aware UIs and command-line tools, not for authorization
392    /// checking. This operation may "fail open" without warning.
393    pub fn test_iam_permissions(&self) -> super::builder::catalog_service::TestIamPermissions {
394        super::builder::catalog_service::TestIamPermissions::new(self.inner.clone())
395    }
396
397    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
398    ///
399    /// [google.longrunning.Operations]: longrunning::client::Operations
400    pub fn list_operations(&self) -> super::builder::catalog_service::ListOperations {
401        super::builder::catalog_service::ListOperations::new(self.inner.clone())
402    }
403
404    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
405    ///
406    /// [google.longrunning.Operations]: longrunning::client::Operations
407    pub fn get_operation(&self) -> super::builder::catalog_service::GetOperation {
408        super::builder::catalog_service::GetOperation::new(self.inner.clone())
409    }
410
411    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
412    ///
413    /// [google.longrunning.Operations]: longrunning::client::Operations
414    pub fn delete_operation(&self) -> super::builder::catalog_service::DeleteOperation {
415        super::builder::catalog_service::DeleteOperation::new(self.inner.clone())
416    }
417
418    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
419    ///
420    /// [google.longrunning.Operations]: longrunning::client::Operations
421    pub fn cancel_operation(&self) -> super::builder::catalog_service::CancelOperation {
422        super::builder::catalog_service::CancelOperation::new(self.inner.clone())
423    }
424}
425
426/// Implements a client for the Cloud Dataplex API.
427///
428/// # Example
429/// ```
430/// # tokio_test::block_on(async {
431/// # use google_cloud_dataplex_v1::client::CmekService;
432/// let client = CmekService::builder().build().await?;
433/// // use `client` to make requests to the Cloud Dataplex API.
434/// # gax::client_builder::Result::<()>::Ok(()) });
435/// ```
436///
437/// # Service Description
438///
439/// Dataplex Cmek Service
440///
441/// # Configuration
442///
443/// To configure `CmekService` use the `with_*` methods in the type returned
444/// by [builder()][CmekService::builder]. The default configuration should
445/// work for most applications. Common configuration changes include
446///
447/// * [with_endpoint()]: by default this client uses the global default endpoint
448///   (`https://dataplex.googleapis.com`). Applications using regional
449///   endpoints or running in restricted networks (e.g. a network configured
450//    with [Private Google Access with VPC Service Controls]) may want to
451///   override this default.
452/// * [with_credentials()]: by default this client uses
453///   [Application Default Credentials]. Applications using custom
454///   authentication may need to override this default.
455///
456/// [with_endpoint()]: super::builder::cmek_service::ClientBuilder::with_endpoint
457/// [with_credentials()]: super::builder::cmek_service::ClientBuilder::credentials
458/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
459/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
460///
461/// # Pooling and Cloning
462///
463/// `CmekService` holds a connection pool internally, it is advised to
464/// create one and the reuse it.  You do not need to wrap `CmekService` in
465/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
466/// already uses an `Arc` internally.
467#[derive(Clone, Debug)]
468pub struct CmekService {
469    inner: std::sync::Arc<dyn super::stub::dynamic::CmekService>,
470}
471
472impl CmekService {
473    /// Returns a builder for [CmekService].
474    ///
475    /// ```
476    /// # tokio_test::block_on(async {
477    /// # use google_cloud_dataplex_v1::client::CmekService;
478    /// let client = CmekService::builder().build().await?;
479    /// # gax::client_builder::Result::<()>::Ok(()) });
480    /// ```
481    pub fn builder() -> super::builder::cmek_service::ClientBuilder {
482        gax::client_builder::internal::new_builder(super::builder::cmek_service::client::Factory)
483    }
484
485    /// Creates a new client from the provided stub.
486    ///
487    /// The most common case for calling this function is in tests mocking the
488    /// client's behavior.
489    pub fn from_stub<T>(stub: T) -> Self
490    where
491        T: super::stub::CmekService + 'static,
492    {
493        Self {
494            inner: std::sync::Arc::new(stub),
495        }
496    }
497
498    pub(crate) async fn new(
499        config: gaxi::options::ClientConfig,
500    ) -> gax::client_builder::Result<Self> {
501        let inner = Self::build_inner(config).await?;
502        Ok(Self { inner })
503    }
504
505    async fn build_inner(
506        conf: gaxi::options::ClientConfig,
507    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::CmekService>> {
508        if gaxi::options::tracing_enabled(&conf) {
509            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
510        }
511        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
512    }
513
514    async fn build_transport(
515        conf: gaxi::options::ClientConfig,
516    ) -> gax::client_builder::Result<impl super::stub::CmekService> {
517        super::transport::CmekService::new(conf).await
518    }
519
520    async fn build_with_tracing(
521        conf: gaxi::options::ClientConfig,
522    ) -> gax::client_builder::Result<impl super::stub::CmekService> {
523        Self::build_transport(conf)
524            .await
525            .map(super::tracing::CmekService::new)
526    }
527
528    /// Create an EncryptionConfig.
529    ///
530    /// # Long running operations
531    ///
532    /// This method is used to start, and/or poll a [long-running Operation].
533    /// The [Working with long-running operations] chapter in the [user guide]
534    /// covers these operations in detail.
535    ///
536    /// [long-running operation]: https://google.aip.dev/151
537    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
538    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
539    pub fn create_encryption_config(&self) -> super::builder::cmek_service::CreateEncryptionConfig {
540        super::builder::cmek_service::CreateEncryptionConfig::new(self.inner.clone())
541    }
542
543    /// Update an EncryptionConfig.
544    ///
545    /// # Long running operations
546    ///
547    /// This method is used to start, and/or poll a [long-running Operation].
548    /// The [Working with long-running operations] chapter in the [user guide]
549    /// covers these operations in detail.
550    ///
551    /// [long-running operation]: https://google.aip.dev/151
552    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
553    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
554    pub fn update_encryption_config(&self) -> super::builder::cmek_service::UpdateEncryptionConfig {
555        super::builder::cmek_service::UpdateEncryptionConfig::new(self.inner.clone())
556    }
557
558    /// Delete an EncryptionConfig.
559    ///
560    /// # Long running operations
561    ///
562    /// This method is used to start, and/or poll a [long-running Operation].
563    /// The [Working with long-running operations] chapter in the [user guide]
564    /// covers these operations in detail.
565    ///
566    /// [long-running operation]: https://google.aip.dev/151
567    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
568    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
569    pub fn delete_encryption_config(&self) -> super::builder::cmek_service::DeleteEncryptionConfig {
570        super::builder::cmek_service::DeleteEncryptionConfig::new(self.inner.clone())
571    }
572
573    /// List EncryptionConfigs.
574    pub fn list_encryption_configs(&self) -> super::builder::cmek_service::ListEncryptionConfigs {
575        super::builder::cmek_service::ListEncryptionConfigs::new(self.inner.clone())
576    }
577
578    /// Get an EncryptionConfig.
579    pub fn get_encryption_config(&self) -> super::builder::cmek_service::GetEncryptionConfig {
580        super::builder::cmek_service::GetEncryptionConfig::new(self.inner.clone())
581    }
582
583    /// Lists information about the supported locations for this service.
584    pub fn list_locations(&self) -> super::builder::cmek_service::ListLocations {
585        super::builder::cmek_service::ListLocations::new(self.inner.clone())
586    }
587
588    /// Gets information about a location.
589    pub fn get_location(&self) -> super::builder::cmek_service::GetLocation {
590        super::builder::cmek_service::GetLocation::new(self.inner.clone())
591    }
592
593    /// Sets the access control policy on the specified resource. Replaces
594    /// any existing policy.
595    ///
596    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
597    /// errors.
598    pub fn set_iam_policy(&self) -> super::builder::cmek_service::SetIamPolicy {
599        super::builder::cmek_service::SetIamPolicy::new(self.inner.clone())
600    }
601
602    /// Gets the access control policy for a resource. Returns an empty policy
603    /// if the resource exists and does not have a policy set.
604    pub fn get_iam_policy(&self) -> super::builder::cmek_service::GetIamPolicy {
605        super::builder::cmek_service::GetIamPolicy::new(self.inner.clone())
606    }
607
608    /// Returns permissions that a caller has on the specified resource. If the
609    /// resource does not exist, this will return an empty set of
610    /// permissions, not a `NOT_FOUND` error.
611    ///
612    /// Note: This operation is designed to be used for building
613    /// permission-aware UIs and command-line tools, not for authorization
614    /// checking. This operation may "fail open" without warning.
615    pub fn test_iam_permissions(&self) -> super::builder::cmek_service::TestIamPermissions {
616        super::builder::cmek_service::TestIamPermissions::new(self.inner.clone())
617    }
618
619    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
620    ///
621    /// [google.longrunning.Operations]: longrunning::client::Operations
622    pub fn list_operations(&self) -> super::builder::cmek_service::ListOperations {
623        super::builder::cmek_service::ListOperations::new(self.inner.clone())
624    }
625
626    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
627    ///
628    /// [google.longrunning.Operations]: longrunning::client::Operations
629    pub fn get_operation(&self) -> super::builder::cmek_service::GetOperation {
630        super::builder::cmek_service::GetOperation::new(self.inner.clone())
631    }
632
633    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
634    ///
635    /// [google.longrunning.Operations]: longrunning::client::Operations
636    pub fn delete_operation(&self) -> super::builder::cmek_service::DeleteOperation {
637        super::builder::cmek_service::DeleteOperation::new(self.inner.clone())
638    }
639
640    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
641    ///
642    /// [google.longrunning.Operations]: longrunning::client::Operations
643    pub fn cancel_operation(&self) -> super::builder::cmek_service::CancelOperation {
644        super::builder::cmek_service::CancelOperation::new(self.inner.clone())
645    }
646}
647
648/// Implements a client for the Cloud Dataplex API.
649///
650/// # Example
651/// ```
652/// # tokio_test::block_on(async {
653/// # use google_cloud_dataplex_v1::client::ContentService;
654/// let client = ContentService::builder().build().await?;
655/// // use `client` to make requests to the Cloud Dataplex API.
656/// # gax::client_builder::Result::<()>::Ok(()) });
657/// ```
658///
659/// # Service Description
660///
661/// ContentService manages Notebook and SQL Scripts for Dataplex.
662///
663/// # Configuration
664///
665/// To configure `ContentService` use the `with_*` methods in the type returned
666/// by [builder()][ContentService::builder]. The default configuration should
667/// work for most applications. Common configuration changes include
668///
669/// * [with_endpoint()]: by default this client uses the global default endpoint
670///   (`https://dataplex.googleapis.com`). Applications using regional
671///   endpoints or running in restricted networks (e.g. a network configured
672//    with [Private Google Access with VPC Service Controls]) may want to
673///   override this default.
674/// * [with_credentials()]: by default this client uses
675///   [Application Default Credentials]. Applications using custom
676///   authentication may need to override this default.
677///
678/// [with_endpoint()]: super::builder::content_service::ClientBuilder::with_endpoint
679/// [with_credentials()]: super::builder::content_service::ClientBuilder::credentials
680/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
681/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
682///
683/// # Pooling and Cloning
684///
685/// `ContentService` holds a connection pool internally, it is advised to
686/// create one and the reuse it.  You do not need to wrap `ContentService` in
687/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
688/// already uses an `Arc` internally.
689#[derive(Clone, Debug)]
690pub struct ContentService {
691    inner: std::sync::Arc<dyn super::stub::dynamic::ContentService>,
692}
693
694impl ContentService {
695    /// Returns a builder for [ContentService].
696    ///
697    /// ```
698    /// # tokio_test::block_on(async {
699    /// # use google_cloud_dataplex_v1::client::ContentService;
700    /// let client = ContentService::builder().build().await?;
701    /// # gax::client_builder::Result::<()>::Ok(()) });
702    /// ```
703    pub fn builder() -> super::builder::content_service::ClientBuilder {
704        gax::client_builder::internal::new_builder(super::builder::content_service::client::Factory)
705    }
706
707    /// Creates a new client from the provided stub.
708    ///
709    /// The most common case for calling this function is in tests mocking the
710    /// client's behavior.
711    pub fn from_stub<T>(stub: T) -> Self
712    where
713        T: super::stub::ContentService + 'static,
714    {
715        Self {
716            inner: std::sync::Arc::new(stub),
717        }
718    }
719
720    pub(crate) async fn new(
721        config: gaxi::options::ClientConfig,
722    ) -> gax::client_builder::Result<Self> {
723        let inner = Self::build_inner(config).await?;
724        Ok(Self { inner })
725    }
726
727    async fn build_inner(
728        conf: gaxi::options::ClientConfig,
729    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ContentService>> {
730        if gaxi::options::tracing_enabled(&conf) {
731            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
732        }
733        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
734    }
735
736    async fn build_transport(
737        conf: gaxi::options::ClientConfig,
738    ) -> gax::client_builder::Result<impl super::stub::ContentService> {
739        super::transport::ContentService::new(conf).await
740    }
741
742    async fn build_with_tracing(
743        conf: gaxi::options::ClientConfig,
744    ) -> gax::client_builder::Result<impl super::stub::ContentService> {
745        Self::build_transport(conf)
746            .await
747            .map(super::tracing::ContentService::new)
748    }
749
750    /// Create a content.
751    pub fn create_content(&self) -> super::builder::content_service::CreateContent {
752        super::builder::content_service::CreateContent::new(self.inner.clone())
753    }
754
755    /// Update a content. Only supports full resource update.
756    pub fn update_content(&self) -> super::builder::content_service::UpdateContent {
757        super::builder::content_service::UpdateContent::new(self.inner.clone())
758    }
759
760    /// Delete a content.
761    pub fn delete_content(&self) -> super::builder::content_service::DeleteContent {
762        super::builder::content_service::DeleteContent::new(self.inner.clone())
763    }
764
765    /// Get a content resource.
766    pub fn get_content(&self) -> super::builder::content_service::GetContent {
767        super::builder::content_service::GetContent::new(self.inner.clone())
768    }
769
770    /// Gets the access control policy for a contentitem resource. A `NOT_FOUND`
771    /// error is returned if the resource does not exist. An empty policy is
772    /// returned if the resource exists but does not have a policy set on it.
773    ///
774    /// Caller must have Google IAM `dataplex.content.getIamPolicy` permission
775    /// on the resource.
776    pub fn get_iam_policy(&self) -> super::builder::content_service::GetIamPolicy {
777        super::builder::content_service::GetIamPolicy::new(self.inner.clone())
778    }
779
780    /// Sets the access control policy on the specified contentitem resource.
781    /// Replaces any existing policy.
782    ///
783    /// Caller must have Google IAM `dataplex.content.setIamPolicy` permission
784    /// on the resource.
785    pub fn set_iam_policy(&self) -> super::builder::content_service::SetIamPolicy {
786        super::builder::content_service::SetIamPolicy::new(self.inner.clone())
787    }
788
789    /// Returns the caller's permissions on a resource.
790    /// If the resource does not exist, an empty set of
791    /// permissions is returned (a `NOT_FOUND` error is not returned).
792    ///
793    /// A caller is not required to have Google IAM permission to make this
794    /// request.
795    ///
796    /// Note: This operation is designed to be used for building permission-aware
797    /// UIs and command-line tools, not for authorization checking. This operation
798    /// may "fail open" without warning.
799    pub fn test_iam_permissions(&self) -> super::builder::content_service::TestIamPermissions {
800        super::builder::content_service::TestIamPermissions::new(self.inner.clone())
801    }
802
803    /// List content.
804    pub fn list_content(&self) -> super::builder::content_service::ListContent {
805        super::builder::content_service::ListContent::new(self.inner.clone())
806    }
807
808    /// Lists information about the supported locations for this service.
809    pub fn list_locations(&self) -> super::builder::content_service::ListLocations {
810        super::builder::content_service::ListLocations::new(self.inner.clone())
811    }
812
813    /// Gets information about a location.
814    pub fn get_location(&self) -> super::builder::content_service::GetLocation {
815        super::builder::content_service::GetLocation::new(self.inner.clone())
816    }
817
818    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
819    ///
820    /// [google.longrunning.Operations]: longrunning::client::Operations
821    pub fn list_operations(&self) -> super::builder::content_service::ListOperations {
822        super::builder::content_service::ListOperations::new(self.inner.clone())
823    }
824
825    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
826    ///
827    /// [google.longrunning.Operations]: longrunning::client::Operations
828    pub fn get_operation(&self) -> super::builder::content_service::GetOperation {
829        super::builder::content_service::GetOperation::new(self.inner.clone())
830    }
831
832    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
833    ///
834    /// [google.longrunning.Operations]: longrunning::client::Operations
835    pub fn delete_operation(&self) -> super::builder::content_service::DeleteOperation {
836        super::builder::content_service::DeleteOperation::new(self.inner.clone())
837    }
838
839    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
840    ///
841    /// [google.longrunning.Operations]: longrunning::client::Operations
842    pub fn cancel_operation(&self) -> super::builder::content_service::CancelOperation {
843        super::builder::content_service::CancelOperation::new(self.inner.clone())
844    }
845}
846
847/// Implements a client for the Cloud Dataplex API.
848///
849/// # Example
850/// ```
851/// # tokio_test::block_on(async {
852/// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
853/// let client = DataTaxonomyService::builder().build().await?;
854/// // use `client` to make requests to the Cloud Dataplex API.
855/// # gax::client_builder::Result::<()>::Ok(()) });
856/// ```
857///
858/// # Service Description
859///
860/// DataTaxonomyService enables attribute-based governance. The resources
861/// currently offered include DataTaxonomy and DataAttribute.
862///
863/// # Configuration
864///
865/// To configure `DataTaxonomyService` use the `with_*` methods in the type returned
866/// by [builder()][DataTaxonomyService::builder]. The default configuration should
867/// work for most applications. Common configuration changes include
868///
869/// * [with_endpoint()]: by default this client uses the global default endpoint
870///   (`https://dataplex.googleapis.com`). Applications using regional
871///   endpoints or running in restricted networks (e.g. a network configured
872//    with [Private Google Access with VPC Service Controls]) may want to
873///   override this default.
874/// * [with_credentials()]: by default this client uses
875///   [Application Default Credentials]. Applications using custom
876///   authentication may need to override this default.
877///
878/// [with_endpoint()]: super::builder::data_taxonomy_service::ClientBuilder::with_endpoint
879/// [with_credentials()]: super::builder::data_taxonomy_service::ClientBuilder::credentials
880/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
881/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
882///
883/// # Pooling and Cloning
884///
885/// `DataTaxonomyService` holds a connection pool internally, it is advised to
886/// create one and the reuse it.  You do not need to wrap `DataTaxonomyService` in
887/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
888/// already uses an `Arc` internally.
889#[derive(Clone, Debug)]
890#[deprecated]
891pub struct DataTaxonomyService {
892    inner: std::sync::Arc<dyn super::stub::dynamic::DataTaxonomyService>,
893}
894
895impl DataTaxonomyService {
896    /// Returns a builder for [DataTaxonomyService].
897    ///
898    /// ```
899    /// # tokio_test::block_on(async {
900    /// # use google_cloud_dataplex_v1::client::DataTaxonomyService;
901    /// let client = DataTaxonomyService::builder().build().await?;
902    /// # gax::client_builder::Result::<()>::Ok(()) });
903    /// ```
904    pub fn builder() -> super::builder::data_taxonomy_service::ClientBuilder {
905        gax::client_builder::internal::new_builder(
906            super::builder::data_taxonomy_service::client::Factory,
907        )
908    }
909
910    /// Creates a new client from the provided stub.
911    ///
912    /// The most common case for calling this function is in tests mocking the
913    /// client's behavior.
914    pub fn from_stub<T>(stub: T) -> Self
915    where
916        T: super::stub::DataTaxonomyService + 'static,
917    {
918        Self {
919            inner: std::sync::Arc::new(stub),
920        }
921    }
922
923    pub(crate) async fn new(
924        config: gaxi::options::ClientConfig,
925    ) -> gax::client_builder::Result<Self> {
926        let inner = Self::build_inner(config).await?;
927        Ok(Self { inner })
928    }
929
930    async fn build_inner(
931        conf: gaxi::options::ClientConfig,
932    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::DataTaxonomyService>>
933    {
934        if gaxi::options::tracing_enabled(&conf) {
935            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
936        }
937        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
938    }
939
940    async fn build_transport(
941        conf: gaxi::options::ClientConfig,
942    ) -> gax::client_builder::Result<impl super::stub::DataTaxonomyService> {
943        super::transport::DataTaxonomyService::new(conf).await
944    }
945
946    async fn build_with_tracing(
947        conf: gaxi::options::ClientConfig,
948    ) -> gax::client_builder::Result<impl super::stub::DataTaxonomyService> {
949        Self::build_transport(conf)
950            .await
951            .map(super::tracing::DataTaxonomyService::new)
952    }
953
954    /// Create a DataTaxonomy resource.
955    ///
956    /// # Long running operations
957    ///
958    /// This method is used to start, and/or poll a [long-running Operation].
959    /// The [Working with long-running operations] chapter in the [user guide]
960    /// covers these operations in detail.
961    ///
962    /// [long-running operation]: https://google.aip.dev/151
963    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
964    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
965    #[deprecated]
966    pub fn create_data_taxonomy(
967        &self,
968    ) -> super::builder::data_taxonomy_service::CreateDataTaxonomy {
969        super::builder::data_taxonomy_service::CreateDataTaxonomy::new(self.inner.clone())
970    }
971
972    /// Updates a DataTaxonomy resource.
973    ///
974    /// # Long running operations
975    ///
976    /// This method is used to start, and/or poll a [long-running Operation].
977    /// The [Working with long-running operations] chapter in the [user guide]
978    /// covers these operations in detail.
979    ///
980    /// [long-running operation]: https://google.aip.dev/151
981    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
982    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
983    #[deprecated]
984    pub fn update_data_taxonomy(
985        &self,
986    ) -> super::builder::data_taxonomy_service::UpdateDataTaxonomy {
987        super::builder::data_taxonomy_service::UpdateDataTaxonomy::new(self.inner.clone())
988    }
989
990    /// Deletes a DataTaxonomy resource. All attributes within the DataTaxonomy
991    /// must be deleted before the DataTaxonomy can be deleted.
992    ///
993    /// # Long running operations
994    ///
995    /// This method is used to start, and/or poll a [long-running Operation].
996    /// The [Working with long-running operations] chapter in the [user guide]
997    /// covers these operations in detail.
998    ///
999    /// [long-running operation]: https://google.aip.dev/151
1000    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1001    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1002    #[deprecated]
1003    pub fn delete_data_taxonomy(
1004        &self,
1005    ) -> super::builder::data_taxonomy_service::DeleteDataTaxonomy {
1006        super::builder::data_taxonomy_service::DeleteDataTaxonomy::new(self.inner.clone())
1007    }
1008
1009    /// Lists DataTaxonomy resources in a project and location.
1010    #[deprecated]
1011    pub fn list_data_taxonomies(
1012        &self,
1013    ) -> super::builder::data_taxonomy_service::ListDataTaxonomies {
1014        super::builder::data_taxonomy_service::ListDataTaxonomies::new(self.inner.clone())
1015    }
1016
1017    /// Retrieves a DataTaxonomy resource.
1018    #[deprecated]
1019    pub fn get_data_taxonomy(&self) -> super::builder::data_taxonomy_service::GetDataTaxonomy {
1020        super::builder::data_taxonomy_service::GetDataTaxonomy::new(self.inner.clone())
1021    }
1022
1023    /// Create a DataAttributeBinding resource.
1024    ///
1025    /// # Long running operations
1026    ///
1027    /// This method is used to start, and/or poll a [long-running Operation].
1028    /// The [Working with long-running operations] chapter in the [user guide]
1029    /// covers these operations in detail.
1030    ///
1031    /// [long-running operation]: https://google.aip.dev/151
1032    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1033    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1034    #[deprecated]
1035    pub fn create_data_attribute_binding(
1036        &self,
1037    ) -> super::builder::data_taxonomy_service::CreateDataAttributeBinding {
1038        super::builder::data_taxonomy_service::CreateDataAttributeBinding::new(self.inner.clone())
1039    }
1040
1041    /// Updates a DataAttributeBinding resource.
1042    ///
1043    /// # Long running operations
1044    ///
1045    /// This method is used to start, and/or poll a [long-running Operation].
1046    /// The [Working with long-running operations] chapter in the [user guide]
1047    /// covers these operations in detail.
1048    ///
1049    /// [long-running operation]: https://google.aip.dev/151
1050    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1051    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1052    #[deprecated]
1053    pub fn update_data_attribute_binding(
1054        &self,
1055    ) -> super::builder::data_taxonomy_service::UpdateDataAttributeBinding {
1056        super::builder::data_taxonomy_service::UpdateDataAttributeBinding::new(self.inner.clone())
1057    }
1058
1059    /// Deletes a DataAttributeBinding resource. All attributes within the
1060    /// DataAttributeBinding must be deleted before the DataAttributeBinding can be
1061    /// deleted.
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    #[deprecated]
1073    pub fn delete_data_attribute_binding(
1074        &self,
1075    ) -> super::builder::data_taxonomy_service::DeleteDataAttributeBinding {
1076        super::builder::data_taxonomy_service::DeleteDataAttributeBinding::new(self.inner.clone())
1077    }
1078
1079    /// Lists DataAttributeBinding resources in a project and location.
1080    #[deprecated]
1081    pub fn list_data_attribute_bindings(
1082        &self,
1083    ) -> super::builder::data_taxonomy_service::ListDataAttributeBindings {
1084        super::builder::data_taxonomy_service::ListDataAttributeBindings::new(self.inner.clone())
1085    }
1086
1087    /// Retrieves a DataAttributeBinding resource.
1088    #[deprecated]
1089    pub fn get_data_attribute_binding(
1090        &self,
1091    ) -> super::builder::data_taxonomy_service::GetDataAttributeBinding {
1092        super::builder::data_taxonomy_service::GetDataAttributeBinding::new(self.inner.clone())
1093    }
1094
1095    /// Create a DataAttribute resource.
1096    ///
1097    /// # Long running operations
1098    ///
1099    /// This method is used to start, and/or poll a [long-running Operation].
1100    /// The [Working with long-running operations] chapter in the [user guide]
1101    /// covers these operations in detail.
1102    ///
1103    /// [long-running operation]: https://google.aip.dev/151
1104    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1105    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1106    #[deprecated]
1107    pub fn create_data_attribute(
1108        &self,
1109    ) -> super::builder::data_taxonomy_service::CreateDataAttribute {
1110        super::builder::data_taxonomy_service::CreateDataAttribute::new(self.inner.clone())
1111    }
1112
1113    /// Updates a DataAttribute resource.
1114    ///
1115    /// # Long running operations
1116    ///
1117    /// This method is used to start, and/or poll a [long-running Operation].
1118    /// The [Working with long-running operations] chapter in the [user guide]
1119    /// covers these operations in detail.
1120    ///
1121    /// [long-running operation]: https://google.aip.dev/151
1122    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1123    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1124    #[deprecated]
1125    pub fn update_data_attribute(
1126        &self,
1127    ) -> super::builder::data_taxonomy_service::UpdateDataAttribute {
1128        super::builder::data_taxonomy_service::UpdateDataAttribute::new(self.inner.clone())
1129    }
1130
1131    /// Deletes a Data Attribute resource.
1132    ///
1133    /// # Long running operations
1134    ///
1135    /// This method is used to start, and/or poll a [long-running Operation].
1136    /// The [Working with long-running operations] chapter in the [user guide]
1137    /// covers these operations in detail.
1138    ///
1139    /// [long-running operation]: https://google.aip.dev/151
1140    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1141    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1142    #[deprecated]
1143    pub fn delete_data_attribute(
1144        &self,
1145    ) -> super::builder::data_taxonomy_service::DeleteDataAttribute {
1146        super::builder::data_taxonomy_service::DeleteDataAttribute::new(self.inner.clone())
1147    }
1148
1149    /// Lists Data Attribute resources in a DataTaxonomy.
1150    #[deprecated]
1151    pub fn list_data_attributes(
1152        &self,
1153    ) -> super::builder::data_taxonomy_service::ListDataAttributes {
1154        super::builder::data_taxonomy_service::ListDataAttributes::new(self.inner.clone())
1155    }
1156
1157    /// Retrieves a Data Attribute resource.
1158    #[deprecated]
1159    pub fn get_data_attribute(&self) -> super::builder::data_taxonomy_service::GetDataAttribute {
1160        super::builder::data_taxonomy_service::GetDataAttribute::new(self.inner.clone())
1161    }
1162
1163    /// Lists information about the supported locations for this service.
1164    pub fn list_locations(&self) -> super::builder::data_taxonomy_service::ListLocations {
1165        super::builder::data_taxonomy_service::ListLocations::new(self.inner.clone())
1166    }
1167
1168    /// Gets information about a location.
1169    pub fn get_location(&self) -> super::builder::data_taxonomy_service::GetLocation {
1170        super::builder::data_taxonomy_service::GetLocation::new(self.inner.clone())
1171    }
1172
1173    /// Sets the access control policy on the specified resource. Replaces
1174    /// any existing policy.
1175    ///
1176    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1177    /// errors.
1178    pub fn set_iam_policy(&self) -> super::builder::data_taxonomy_service::SetIamPolicy {
1179        super::builder::data_taxonomy_service::SetIamPolicy::new(self.inner.clone())
1180    }
1181
1182    /// Gets the access control policy for a resource. Returns an empty policy
1183    /// if the resource exists and does not have a policy set.
1184    pub fn get_iam_policy(&self) -> super::builder::data_taxonomy_service::GetIamPolicy {
1185        super::builder::data_taxonomy_service::GetIamPolicy::new(self.inner.clone())
1186    }
1187
1188    /// Returns permissions that a caller has on the specified resource. If the
1189    /// resource does not exist, this will return an empty set of
1190    /// permissions, not a `NOT_FOUND` error.
1191    ///
1192    /// Note: This operation is designed to be used for building
1193    /// permission-aware UIs and command-line tools, not for authorization
1194    /// checking. This operation may "fail open" without warning.
1195    pub fn test_iam_permissions(
1196        &self,
1197    ) -> super::builder::data_taxonomy_service::TestIamPermissions {
1198        super::builder::data_taxonomy_service::TestIamPermissions::new(self.inner.clone())
1199    }
1200
1201    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1202    ///
1203    /// [google.longrunning.Operations]: longrunning::client::Operations
1204    pub fn list_operations(&self) -> super::builder::data_taxonomy_service::ListOperations {
1205        super::builder::data_taxonomy_service::ListOperations::new(self.inner.clone())
1206    }
1207
1208    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1209    ///
1210    /// [google.longrunning.Operations]: longrunning::client::Operations
1211    pub fn get_operation(&self) -> super::builder::data_taxonomy_service::GetOperation {
1212        super::builder::data_taxonomy_service::GetOperation::new(self.inner.clone())
1213    }
1214
1215    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1216    ///
1217    /// [google.longrunning.Operations]: longrunning::client::Operations
1218    pub fn delete_operation(&self) -> super::builder::data_taxonomy_service::DeleteOperation {
1219        super::builder::data_taxonomy_service::DeleteOperation::new(self.inner.clone())
1220    }
1221
1222    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1223    ///
1224    /// [google.longrunning.Operations]: longrunning::client::Operations
1225    pub fn cancel_operation(&self) -> super::builder::data_taxonomy_service::CancelOperation {
1226        super::builder::data_taxonomy_service::CancelOperation::new(self.inner.clone())
1227    }
1228}
1229
1230/// Implements a client for the Cloud Dataplex API.
1231///
1232/// # Example
1233/// ```
1234/// # tokio_test::block_on(async {
1235/// # use google_cloud_dataplex_v1::client::DataScanService;
1236/// let client = DataScanService::builder().build().await?;
1237/// // use `client` to make requests to the Cloud Dataplex API.
1238/// # gax::client_builder::Result::<()>::Ok(()) });
1239/// ```
1240///
1241/// # Service Description
1242///
1243/// DataScanService manages DataScan resources which can be configured to run
1244/// various types of data scanning workload and generate enriched metadata (e.g.
1245/// Data Profile, Data Quality) for the data source.
1246///
1247/// # Configuration
1248///
1249/// To configure `DataScanService` use the `with_*` methods in the type returned
1250/// by [builder()][DataScanService::builder]. The default configuration should
1251/// work for most applications. Common configuration changes include
1252///
1253/// * [with_endpoint()]: by default this client uses the global default endpoint
1254///   (`https://dataplex.googleapis.com`). Applications using regional
1255///   endpoints or running in restricted networks (e.g. a network configured
1256//    with [Private Google Access with VPC Service Controls]) may want to
1257///   override this default.
1258/// * [with_credentials()]: by default this client uses
1259///   [Application Default Credentials]. Applications using custom
1260///   authentication may need to override this default.
1261///
1262/// [with_endpoint()]: super::builder::data_scan_service::ClientBuilder::with_endpoint
1263/// [with_credentials()]: super::builder::data_scan_service::ClientBuilder::credentials
1264/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1265/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1266///
1267/// # Pooling and Cloning
1268///
1269/// `DataScanService` holds a connection pool internally, it is advised to
1270/// create one and the reuse it.  You do not need to wrap `DataScanService` in
1271/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1272/// already uses an `Arc` internally.
1273#[derive(Clone, Debug)]
1274pub struct DataScanService {
1275    inner: std::sync::Arc<dyn super::stub::dynamic::DataScanService>,
1276}
1277
1278impl DataScanService {
1279    /// Returns a builder for [DataScanService].
1280    ///
1281    /// ```
1282    /// # tokio_test::block_on(async {
1283    /// # use google_cloud_dataplex_v1::client::DataScanService;
1284    /// let client = DataScanService::builder().build().await?;
1285    /// # gax::client_builder::Result::<()>::Ok(()) });
1286    /// ```
1287    pub fn builder() -> super::builder::data_scan_service::ClientBuilder {
1288        gax::client_builder::internal::new_builder(
1289            super::builder::data_scan_service::client::Factory,
1290        )
1291    }
1292
1293    /// Creates a new client from the provided stub.
1294    ///
1295    /// The most common case for calling this function is in tests mocking the
1296    /// client's behavior.
1297    pub fn from_stub<T>(stub: T) -> Self
1298    where
1299        T: super::stub::DataScanService + 'static,
1300    {
1301        Self {
1302            inner: std::sync::Arc::new(stub),
1303        }
1304    }
1305
1306    pub(crate) async fn new(
1307        config: gaxi::options::ClientConfig,
1308    ) -> gax::client_builder::Result<Self> {
1309        let inner = Self::build_inner(config).await?;
1310        Ok(Self { inner })
1311    }
1312
1313    async fn build_inner(
1314        conf: gaxi::options::ClientConfig,
1315    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::DataScanService>>
1316    {
1317        if gaxi::options::tracing_enabled(&conf) {
1318            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1319        }
1320        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1321    }
1322
1323    async fn build_transport(
1324        conf: gaxi::options::ClientConfig,
1325    ) -> gax::client_builder::Result<impl super::stub::DataScanService> {
1326        super::transport::DataScanService::new(conf).await
1327    }
1328
1329    async fn build_with_tracing(
1330        conf: gaxi::options::ClientConfig,
1331    ) -> gax::client_builder::Result<impl super::stub::DataScanService> {
1332        Self::build_transport(conf)
1333            .await
1334            .map(super::tracing::DataScanService::new)
1335    }
1336
1337    /// Creates a DataScan resource.
1338    ///
1339    /// # Long running operations
1340    ///
1341    /// This method is used to start, and/or poll a [long-running Operation].
1342    /// The [Working with long-running operations] chapter in the [user guide]
1343    /// covers these operations in detail.
1344    ///
1345    /// [long-running operation]: https://google.aip.dev/151
1346    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1347    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1348    pub fn create_data_scan(&self) -> super::builder::data_scan_service::CreateDataScan {
1349        super::builder::data_scan_service::CreateDataScan::new(self.inner.clone())
1350    }
1351
1352    /// Updates a DataScan resource.
1353    ///
1354    /// # Long running operations
1355    ///
1356    /// This method is used to start, and/or poll a [long-running Operation].
1357    /// The [Working with long-running operations] chapter in the [user guide]
1358    /// covers these operations in detail.
1359    ///
1360    /// [long-running operation]: https://google.aip.dev/151
1361    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1362    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1363    pub fn update_data_scan(&self) -> super::builder::data_scan_service::UpdateDataScan {
1364        super::builder::data_scan_service::UpdateDataScan::new(self.inner.clone())
1365    }
1366
1367    /// Deletes a DataScan resource.
1368    ///
1369    /// # Long running operations
1370    ///
1371    /// This method is used to start, and/or poll a [long-running Operation].
1372    /// The [Working with long-running operations] chapter in the [user guide]
1373    /// covers these operations in detail.
1374    ///
1375    /// [long-running operation]: https://google.aip.dev/151
1376    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1377    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1378    pub fn delete_data_scan(&self) -> super::builder::data_scan_service::DeleteDataScan {
1379        super::builder::data_scan_service::DeleteDataScan::new(self.inner.clone())
1380    }
1381
1382    /// Gets a DataScan resource.
1383    pub fn get_data_scan(&self) -> super::builder::data_scan_service::GetDataScan {
1384        super::builder::data_scan_service::GetDataScan::new(self.inner.clone())
1385    }
1386
1387    /// Lists DataScans.
1388    pub fn list_data_scans(&self) -> super::builder::data_scan_service::ListDataScans {
1389        super::builder::data_scan_service::ListDataScans::new(self.inner.clone())
1390    }
1391
1392    /// Runs an on-demand execution of a DataScan
1393    pub fn run_data_scan(&self) -> super::builder::data_scan_service::RunDataScan {
1394        super::builder::data_scan_service::RunDataScan::new(self.inner.clone())
1395    }
1396
1397    /// Gets a DataScanJob resource.
1398    pub fn get_data_scan_job(&self) -> super::builder::data_scan_service::GetDataScanJob {
1399        super::builder::data_scan_service::GetDataScanJob::new(self.inner.clone())
1400    }
1401
1402    /// Lists DataScanJobs under the given DataScan.
1403    pub fn list_data_scan_jobs(&self) -> super::builder::data_scan_service::ListDataScanJobs {
1404        super::builder::data_scan_service::ListDataScanJobs::new(self.inner.clone())
1405    }
1406
1407    /// Generates recommended data quality rules based on the results of a data
1408    /// profiling scan.
1409    ///
1410    /// Use the recommendations to build rules for a data quality scan.
1411    pub fn generate_data_quality_rules(
1412        &self,
1413    ) -> super::builder::data_scan_service::GenerateDataQualityRules {
1414        super::builder::data_scan_service::GenerateDataQualityRules::new(self.inner.clone())
1415    }
1416
1417    /// Lists information about the supported locations for this service.
1418    pub fn list_locations(&self) -> super::builder::data_scan_service::ListLocations {
1419        super::builder::data_scan_service::ListLocations::new(self.inner.clone())
1420    }
1421
1422    /// Gets information about a location.
1423    pub fn get_location(&self) -> super::builder::data_scan_service::GetLocation {
1424        super::builder::data_scan_service::GetLocation::new(self.inner.clone())
1425    }
1426
1427    /// Sets the access control policy on the specified resource. Replaces
1428    /// any existing policy.
1429    ///
1430    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1431    /// errors.
1432    pub fn set_iam_policy(&self) -> super::builder::data_scan_service::SetIamPolicy {
1433        super::builder::data_scan_service::SetIamPolicy::new(self.inner.clone())
1434    }
1435
1436    /// Gets the access control policy for a resource. Returns an empty policy
1437    /// if the resource exists and does not have a policy set.
1438    pub fn get_iam_policy(&self) -> super::builder::data_scan_service::GetIamPolicy {
1439        super::builder::data_scan_service::GetIamPolicy::new(self.inner.clone())
1440    }
1441
1442    /// Returns permissions that a caller has on the specified resource. If the
1443    /// resource does not exist, this will return an empty set of
1444    /// permissions, not a `NOT_FOUND` error.
1445    ///
1446    /// Note: This operation is designed to be used for building
1447    /// permission-aware UIs and command-line tools, not for authorization
1448    /// checking. This operation may "fail open" without warning.
1449    pub fn test_iam_permissions(&self) -> super::builder::data_scan_service::TestIamPermissions {
1450        super::builder::data_scan_service::TestIamPermissions::new(self.inner.clone())
1451    }
1452
1453    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1454    ///
1455    /// [google.longrunning.Operations]: longrunning::client::Operations
1456    pub fn list_operations(&self) -> super::builder::data_scan_service::ListOperations {
1457        super::builder::data_scan_service::ListOperations::new(self.inner.clone())
1458    }
1459
1460    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1461    ///
1462    /// [google.longrunning.Operations]: longrunning::client::Operations
1463    pub fn get_operation(&self) -> super::builder::data_scan_service::GetOperation {
1464        super::builder::data_scan_service::GetOperation::new(self.inner.clone())
1465    }
1466
1467    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1468    ///
1469    /// [google.longrunning.Operations]: longrunning::client::Operations
1470    pub fn delete_operation(&self) -> super::builder::data_scan_service::DeleteOperation {
1471        super::builder::data_scan_service::DeleteOperation::new(self.inner.clone())
1472    }
1473
1474    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1475    ///
1476    /// [google.longrunning.Operations]: longrunning::client::Operations
1477    pub fn cancel_operation(&self) -> super::builder::data_scan_service::CancelOperation {
1478        super::builder::data_scan_service::CancelOperation::new(self.inner.clone())
1479    }
1480}
1481
1482/// Implements a client for the Cloud Dataplex API.
1483///
1484/// # Example
1485/// ```
1486/// # tokio_test::block_on(async {
1487/// # use google_cloud_dataplex_v1::client::MetadataService;
1488/// let client = MetadataService::builder().build().await?;
1489/// // use `client` to make requests to the Cloud Dataplex API.
1490/// # gax::client_builder::Result::<()>::Ok(()) });
1491/// ```
1492///
1493/// # Service Description
1494///
1495/// Metadata service manages metadata resources such as tables, filesets and
1496/// partitions.
1497///
1498/// # Configuration
1499///
1500/// To configure `MetadataService` use the `with_*` methods in the type returned
1501/// by [builder()][MetadataService::builder]. The default configuration should
1502/// work for most applications. Common configuration changes include
1503///
1504/// * [with_endpoint()]: by default this client uses the global default endpoint
1505///   (`https://dataplex.googleapis.com`). Applications using regional
1506///   endpoints or running in restricted networks (e.g. a network configured
1507//    with [Private Google Access with VPC Service Controls]) may want to
1508///   override this default.
1509/// * [with_credentials()]: by default this client uses
1510///   [Application Default Credentials]. Applications using custom
1511///   authentication may need to override this default.
1512///
1513/// [with_endpoint()]: super::builder::metadata_service::ClientBuilder::with_endpoint
1514/// [with_credentials()]: super::builder::metadata_service::ClientBuilder::credentials
1515/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1516/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1517///
1518/// # Pooling and Cloning
1519///
1520/// `MetadataService` holds a connection pool internally, it is advised to
1521/// create one and the reuse it.  You do not need to wrap `MetadataService` in
1522/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1523/// already uses an `Arc` internally.
1524#[derive(Clone, Debug)]
1525pub struct MetadataService {
1526    inner: std::sync::Arc<dyn super::stub::dynamic::MetadataService>,
1527}
1528
1529impl MetadataService {
1530    /// Returns a builder for [MetadataService].
1531    ///
1532    /// ```
1533    /// # tokio_test::block_on(async {
1534    /// # use google_cloud_dataplex_v1::client::MetadataService;
1535    /// let client = MetadataService::builder().build().await?;
1536    /// # gax::client_builder::Result::<()>::Ok(()) });
1537    /// ```
1538    pub fn builder() -> super::builder::metadata_service::ClientBuilder {
1539        gax::client_builder::internal::new_builder(
1540            super::builder::metadata_service::client::Factory,
1541        )
1542    }
1543
1544    /// Creates a new client from the provided stub.
1545    ///
1546    /// The most common case for calling this function is in tests mocking the
1547    /// client's behavior.
1548    pub fn from_stub<T>(stub: T) -> Self
1549    where
1550        T: super::stub::MetadataService + 'static,
1551    {
1552        Self {
1553            inner: std::sync::Arc::new(stub),
1554        }
1555    }
1556
1557    pub(crate) async fn new(
1558        config: gaxi::options::ClientConfig,
1559    ) -> gax::client_builder::Result<Self> {
1560        let inner = Self::build_inner(config).await?;
1561        Ok(Self { inner })
1562    }
1563
1564    async fn build_inner(
1565        conf: gaxi::options::ClientConfig,
1566    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::MetadataService>>
1567    {
1568        if gaxi::options::tracing_enabled(&conf) {
1569            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1570        }
1571        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1572    }
1573
1574    async fn build_transport(
1575        conf: gaxi::options::ClientConfig,
1576    ) -> gax::client_builder::Result<impl super::stub::MetadataService> {
1577        super::transport::MetadataService::new(conf).await
1578    }
1579
1580    async fn build_with_tracing(
1581        conf: gaxi::options::ClientConfig,
1582    ) -> gax::client_builder::Result<impl super::stub::MetadataService> {
1583        Self::build_transport(conf)
1584            .await
1585            .map(super::tracing::MetadataService::new)
1586    }
1587
1588    /// Create a metadata entity.
1589    pub fn create_entity(&self) -> super::builder::metadata_service::CreateEntity {
1590        super::builder::metadata_service::CreateEntity::new(self.inner.clone())
1591    }
1592
1593    /// Update a metadata entity. Only supports full resource update.
1594    pub fn update_entity(&self) -> super::builder::metadata_service::UpdateEntity {
1595        super::builder::metadata_service::UpdateEntity::new(self.inner.clone())
1596    }
1597
1598    /// Delete a metadata entity.
1599    pub fn delete_entity(&self) -> super::builder::metadata_service::DeleteEntity {
1600        super::builder::metadata_service::DeleteEntity::new(self.inner.clone())
1601    }
1602
1603    /// Get a metadata entity.
1604    pub fn get_entity(&self) -> super::builder::metadata_service::GetEntity {
1605        super::builder::metadata_service::GetEntity::new(self.inner.clone())
1606    }
1607
1608    /// List metadata entities in a zone.
1609    pub fn list_entities(&self) -> super::builder::metadata_service::ListEntities {
1610        super::builder::metadata_service::ListEntities::new(self.inner.clone())
1611    }
1612
1613    /// Create a metadata partition.
1614    pub fn create_partition(&self) -> super::builder::metadata_service::CreatePartition {
1615        super::builder::metadata_service::CreatePartition::new(self.inner.clone())
1616    }
1617
1618    /// Delete a metadata partition.
1619    pub fn delete_partition(&self) -> super::builder::metadata_service::DeletePartition {
1620        super::builder::metadata_service::DeletePartition::new(self.inner.clone())
1621    }
1622
1623    /// Get a metadata partition of an entity.
1624    pub fn get_partition(&self) -> super::builder::metadata_service::GetPartition {
1625        super::builder::metadata_service::GetPartition::new(self.inner.clone())
1626    }
1627
1628    /// List metadata partitions of an entity.
1629    pub fn list_partitions(&self) -> super::builder::metadata_service::ListPartitions {
1630        super::builder::metadata_service::ListPartitions::new(self.inner.clone())
1631    }
1632
1633    /// Lists information about the supported locations for this service.
1634    pub fn list_locations(&self) -> super::builder::metadata_service::ListLocations {
1635        super::builder::metadata_service::ListLocations::new(self.inner.clone())
1636    }
1637
1638    /// Gets information about a location.
1639    pub fn get_location(&self) -> super::builder::metadata_service::GetLocation {
1640        super::builder::metadata_service::GetLocation::new(self.inner.clone())
1641    }
1642
1643    /// Sets the access control policy on the specified resource. Replaces
1644    /// any existing policy.
1645    ///
1646    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1647    /// errors.
1648    pub fn set_iam_policy(&self) -> super::builder::metadata_service::SetIamPolicy {
1649        super::builder::metadata_service::SetIamPolicy::new(self.inner.clone())
1650    }
1651
1652    /// Gets the access control policy for a resource. Returns an empty policy
1653    /// if the resource exists and does not have a policy set.
1654    pub fn get_iam_policy(&self) -> super::builder::metadata_service::GetIamPolicy {
1655        super::builder::metadata_service::GetIamPolicy::new(self.inner.clone())
1656    }
1657
1658    /// Returns permissions that a caller has on the specified resource. If the
1659    /// resource does not exist, this will return an empty set of
1660    /// permissions, not a `NOT_FOUND` error.
1661    ///
1662    /// Note: This operation is designed to be used for building
1663    /// permission-aware UIs and command-line tools, not for authorization
1664    /// checking. This operation may "fail open" without warning.
1665    pub fn test_iam_permissions(&self) -> super::builder::metadata_service::TestIamPermissions {
1666        super::builder::metadata_service::TestIamPermissions::new(self.inner.clone())
1667    }
1668
1669    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1670    ///
1671    /// [google.longrunning.Operations]: longrunning::client::Operations
1672    pub fn list_operations(&self) -> super::builder::metadata_service::ListOperations {
1673        super::builder::metadata_service::ListOperations::new(self.inner.clone())
1674    }
1675
1676    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1677    ///
1678    /// [google.longrunning.Operations]: longrunning::client::Operations
1679    pub fn get_operation(&self) -> super::builder::metadata_service::GetOperation {
1680        super::builder::metadata_service::GetOperation::new(self.inner.clone())
1681    }
1682
1683    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1684    ///
1685    /// [google.longrunning.Operations]: longrunning::client::Operations
1686    pub fn delete_operation(&self) -> super::builder::metadata_service::DeleteOperation {
1687        super::builder::metadata_service::DeleteOperation::new(self.inner.clone())
1688    }
1689
1690    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1691    ///
1692    /// [google.longrunning.Operations]: longrunning::client::Operations
1693    pub fn cancel_operation(&self) -> super::builder::metadata_service::CancelOperation {
1694        super::builder::metadata_service::CancelOperation::new(self.inner.clone())
1695    }
1696}
1697
1698/// Implements a client for the Cloud Dataplex API.
1699///
1700/// # Example
1701/// ```
1702/// # tokio_test::block_on(async {
1703/// # use google_cloud_dataplex_v1::client::DataplexService;
1704/// let client = DataplexService::builder().build().await?;
1705/// // use `client` to make requests to the Cloud Dataplex API.
1706/// # gax::client_builder::Result::<()>::Ok(()) });
1707/// ```
1708///
1709/// # Service Description
1710///
1711/// Dataplex service provides data lakes as a service. The primary resources
1712/// offered by this service are Lakes, Zones and Assets which collectively allow
1713/// a data administrator to organize, manage, secure and catalog data across
1714/// their organization located across cloud projects in a variety of storage
1715/// systems including Cloud Storage and BigQuery.
1716///
1717/// # Configuration
1718///
1719/// To configure `DataplexService` use the `with_*` methods in the type returned
1720/// by [builder()][DataplexService::builder]. The default configuration should
1721/// work for most applications. Common configuration changes include
1722///
1723/// * [with_endpoint()]: by default this client uses the global default endpoint
1724///   (`https://dataplex.googleapis.com`). Applications using regional
1725///   endpoints or running in restricted networks (e.g. a network configured
1726//    with [Private Google Access with VPC Service Controls]) may want to
1727///   override this default.
1728/// * [with_credentials()]: by default this client uses
1729///   [Application Default Credentials]. Applications using custom
1730///   authentication may need to override this default.
1731///
1732/// [with_endpoint()]: super::builder::dataplex_service::ClientBuilder::with_endpoint
1733/// [with_credentials()]: super::builder::dataplex_service::ClientBuilder::credentials
1734/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1735/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1736///
1737/// # Pooling and Cloning
1738///
1739/// `DataplexService` holds a connection pool internally, it is advised to
1740/// create one and the reuse it.  You do not need to wrap `DataplexService` in
1741/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1742/// already uses an `Arc` internally.
1743#[derive(Clone, Debug)]
1744pub struct DataplexService {
1745    inner: std::sync::Arc<dyn super::stub::dynamic::DataplexService>,
1746}
1747
1748impl DataplexService {
1749    /// Returns a builder for [DataplexService].
1750    ///
1751    /// ```
1752    /// # tokio_test::block_on(async {
1753    /// # use google_cloud_dataplex_v1::client::DataplexService;
1754    /// let client = DataplexService::builder().build().await?;
1755    /// # gax::client_builder::Result::<()>::Ok(()) });
1756    /// ```
1757    pub fn builder() -> super::builder::dataplex_service::ClientBuilder {
1758        gax::client_builder::internal::new_builder(
1759            super::builder::dataplex_service::client::Factory,
1760        )
1761    }
1762
1763    /// Creates a new client from the provided stub.
1764    ///
1765    /// The most common case for calling this function is in tests mocking the
1766    /// client's behavior.
1767    pub fn from_stub<T>(stub: T) -> Self
1768    where
1769        T: super::stub::DataplexService + 'static,
1770    {
1771        Self {
1772            inner: std::sync::Arc::new(stub),
1773        }
1774    }
1775
1776    pub(crate) async fn new(
1777        config: gaxi::options::ClientConfig,
1778    ) -> gax::client_builder::Result<Self> {
1779        let inner = Self::build_inner(config).await?;
1780        Ok(Self { inner })
1781    }
1782
1783    async fn build_inner(
1784        conf: gaxi::options::ClientConfig,
1785    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::DataplexService>>
1786    {
1787        if gaxi::options::tracing_enabled(&conf) {
1788            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1789        }
1790        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1791    }
1792
1793    async fn build_transport(
1794        conf: gaxi::options::ClientConfig,
1795    ) -> gax::client_builder::Result<impl super::stub::DataplexService> {
1796        super::transport::DataplexService::new(conf).await
1797    }
1798
1799    async fn build_with_tracing(
1800        conf: gaxi::options::ClientConfig,
1801    ) -> gax::client_builder::Result<impl super::stub::DataplexService> {
1802        Self::build_transport(conf)
1803            .await
1804            .map(super::tracing::DataplexService::new)
1805    }
1806
1807    /// Creates a lake resource.
1808    ///
1809    /// # Long running operations
1810    ///
1811    /// This method is used to start, and/or poll a [long-running Operation].
1812    /// The [Working with long-running operations] chapter in the [user guide]
1813    /// covers these operations in detail.
1814    ///
1815    /// [long-running operation]: https://google.aip.dev/151
1816    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1817    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1818    pub fn create_lake(&self) -> super::builder::dataplex_service::CreateLake {
1819        super::builder::dataplex_service::CreateLake::new(self.inner.clone())
1820    }
1821
1822    /// Updates a lake resource.
1823    ///
1824    /// # Long running operations
1825    ///
1826    /// This method is used to start, and/or poll a [long-running Operation].
1827    /// The [Working with long-running operations] chapter in the [user guide]
1828    /// covers these operations in detail.
1829    ///
1830    /// [long-running operation]: https://google.aip.dev/151
1831    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1832    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1833    pub fn update_lake(&self) -> super::builder::dataplex_service::UpdateLake {
1834        super::builder::dataplex_service::UpdateLake::new(self.inner.clone())
1835    }
1836
1837    /// Deletes a lake resource. All zones within the lake must be deleted before
1838    /// the lake can be deleted.
1839    ///
1840    /// # Long running operations
1841    ///
1842    /// This method is used to start, and/or poll a [long-running Operation].
1843    /// The [Working with long-running operations] chapter in the [user guide]
1844    /// covers these operations in detail.
1845    ///
1846    /// [long-running operation]: https://google.aip.dev/151
1847    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1848    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1849    pub fn delete_lake(&self) -> super::builder::dataplex_service::DeleteLake {
1850        super::builder::dataplex_service::DeleteLake::new(self.inner.clone())
1851    }
1852
1853    /// Lists lake resources in a project and location.
1854    pub fn list_lakes(&self) -> super::builder::dataplex_service::ListLakes {
1855        super::builder::dataplex_service::ListLakes::new(self.inner.clone())
1856    }
1857
1858    /// Retrieves a lake resource.
1859    pub fn get_lake(&self) -> super::builder::dataplex_service::GetLake {
1860        super::builder::dataplex_service::GetLake::new(self.inner.clone())
1861    }
1862
1863    /// Lists action resources in a lake.
1864    pub fn list_lake_actions(&self) -> super::builder::dataplex_service::ListLakeActions {
1865        super::builder::dataplex_service::ListLakeActions::new(self.inner.clone())
1866    }
1867
1868    /// Creates a zone resource within a lake.
1869    ///
1870    /// # Long running operations
1871    ///
1872    /// This method is used to start, and/or poll a [long-running Operation].
1873    /// The [Working with long-running operations] chapter in the [user guide]
1874    /// covers these operations in detail.
1875    ///
1876    /// [long-running operation]: https://google.aip.dev/151
1877    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1878    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1879    pub fn create_zone(&self) -> super::builder::dataplex_service::CreateZone {
1880        super::builder::dataplex_service::CreateZone::new(self.inner.clone())
1881    }
1882
1883    /// Updates a zone resource.
1884    ///
1885    /// # Long running operations
1886    ///
1887    /// This method is used to start, and/or poll a [long-running Operation].
1888    /// The [Working with long-running operations] chapter in the [user guide]
1889    /// covers these operations in detail.
1890    ///
1891    /// [long-running operation]: https://google.aip.dev/151
1892    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1893    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1894    pub fn update_zone(&self) -> super::builder::dataplex_service::UpdateZone {
1895        super::builder::dataplex_service::UpdateZone::new(self.inner.clone())
1896    }
1897
1898    /// Deletes a zone resource. All assets within a zone must be deleted before
1899    /// the zone can be deleted.
1900    ///
1901    /// # Long running operations
1902    ///
1903    /// This method is used to start, and/or poll a [long-running Operation].
1904    /// The [Working with long-running operations] chapter in the [user guide]
1905    /// covers these operations in detail.
1906    ///
1907    /// [long-running operation]: https://google.aip.dev/151
1908    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1909    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1910    pub fn delete_zone(&self) -> super::builder::dataplex_service::DeleteZone {
1911        super::builder::dataplex_service::DeleteZone::new(self.inner.clone())
1912    }
1913
1914    /// Lists zone resources in a lake.
1915    pub fn list_zones(&self) -> super::builder::dataplex_service::ListZones {
1916        super::builder::dataplex_service::ListZones::new(self.inner.clone())
1917    }
1918
1919    /// Retrieves a zone resource.
1920    pub fn get_zone(&self) -> super::builder::dataplex_service::GetZone {
1921        super::builder::dataplex_service::GetZone::new(self.inner.clone())
1922    }
1923
1924    /// Lists action resources in a zone.
1925    pub fn list_zone_actions(&self) -> super::builder::dataplex_service::ListZoneActions {
1926        super::builder::dataplex_service::ListZoneActions::new(self.inner.clone())
1927    }
1928
1929    /// Creates an asset resource.
1930    ///
1931    /// # Long running operations
1932    ///
1933    /// This method is used to start, and/or poll a [long-running Operation].
1934    /// The [Working with long-running operations] chapter in the [user guide]
1935    /// covers these operations in detail.
1936    ///
1937    /// [long-running operation]: https://google.aip.dev/151
1938    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1939    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1940    pub fn create_asset(&self) -> super::builder::dataplex_service::CreateAsset {
1941        super::builder::dataplex_service::CreateAsset::new(self.inner.clone())
1942    }
1943
1944    /// Updates an asset resource.
1945    ///
1946    /// # Long running operations
1947    ///
1948    /// This method is used to start, and/or poll a [long-running Operation].
1949    /// The [Working with long-running operations] chapter in the [user guide]
1950    /// covers these operations in detail.
1951    ///
1952    /// [long-running operation]: https://google.aip.dev/151
1953    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1954    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1955    pub fn update_asset(&self) -> super::builder::dataplex_service::UpdateAsset {
1956        super::builder::dataplex_service::UpdateAsset::new(self.inner.clone())
1957    }
1958
1959    /// Deletes an asset resource. The referenced storage resource is detached
1960    /// (default) or deleted based on the associated Lifecycle policy.
1961    ///
1962    /// # Long running operations
1963    ///
1964    /// This method is used to start, and/or poll a [long-running Operation].
1965    /// The [Working with long-running operations] chapter in the [user guide]
1966    /// covers these operations in detail.
1967    ///
1968    /// [long-running operation]: https://google.aip.dev/151
1969    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1970    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1971    pub fn delete_asset(&self) -> super::builder::dataplex_service::DeleteAsset {
1972        super::builder::dataplex_service::DeleteAsset::new(self.inner.clone())
1973    }
1974
1975    /// Lists asset resources in a zone.
1976    pub fn list_assets(&self) -> super::builder::dataplex_service::ListAssets {
1977        super::builder::dataplex_service::ListAssets::new(self.inner.clone())
1978    }
1979
1980    /// Retrieves an asset resource.
1981    pub fn get_asset(&self) -> super::builder::dataplex_service::GetAsset {
1982        super::builder::dataplex_service::GetAsset::new(self.inner.clone())
1983    }
1984
1985    /// Lists action resources in an asset.
1986    pub fn list_asset_actions(&self) -> super::builder::dataplex_service::ListAssetActions {
1987        super::builder::dataplex_service::ListAssetActions::new(self.inner.clone())
1988    }
1989
1990    /// Creates a task resource within a lake.
1991    ///
1992    /// # Long running operations
1993    ///
1994    /// This method is used to start, and/or poll a [long-running Operation].
1995    /// The [Working with long-running operations] chapter in the [user guide]
1996    /// covers these operations in detail.
1997    ///
1998    /// [long-running operation]: https://google.aip.dev/151
1999    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2000    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2001    pub fn create_task(&self) -> super::builder::dataplex_service::CreateTask {
2002        super::builder::dataplex_service::CreateTask::new(self.inner.clone())
2003    }
2004
2005    /// Update the task resource.
2006    ///
2007    /// # Long running operations
2008    ///
2009    /// This method is used to start, and/or poll a [long-running Operation].
2010    /// The [Working with long-running operations] chapter in the [user guide]
2011    /// covers these operations in detail.
2012    ///
2013    /// [long-running operation]: https://google.aip.dev/151
2014    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2015    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2016    pub fn update_task(&self) -> super::builder::dataplex_service::UpdateTask {
2017        super::builder::dataplex_service::UpdateTask::new(self.inner.clone())
2018    }
2019
2020    /// Delete the task resource.
2021    ///
2022    /// # Long running operations
2023    ///
2024    /// This method is used to start, and/or poll a [long-running Operation].
2025    /// The [Working with long-running operations] chapter in the [user guide]
2026    /// covers these operations in detail.
2027    ///
2028    /// [long-running operation]: https://google.aip.dev/151
2029    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2030    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2031    pub fn delete_task(&self) -> super::builder::dataplex_service::DeleteTask {
2032        super::builder::dataplex_service::DeleteTask::new(self.inner.clone())
2033    }
2034
2035    /// Lists tasks under the given lake.
2036    pub fn list_tasks(&self) -> super::builder::dataplex_service::ListTasks {
2037        super::builder::dataplex_service::ListTasks::new(self.inner.clone())
2038    }
2039
2040    /// Get task resource.
2041    pub fn get_task(&self) -> super::builder::dataplex_service::GetTask {
2042        super::builder::dataplex_service::GetTask::new(self.inner.clone())
2043    }
2044
2045    /// Lists Jobs under the given task.
2046    pub fn list_jobs(&self) -> super::builder::dataplex_service::ListJobs {
2047        super::builder::dataplex_service::ListJobs::new(self.inner.clone())
2048    }
2049
2050    /// Run an on demand execution of a Task.
2051    pub fn run_task(&self) -> super::builder::dataplex_service::RunTask {
2052        super::builder::dataplex_service::RunTask::new(self.inner.clone())
2053    }
2054
2055    /// Get job resource.
2056    pub fn get_job(&self) -> super::builder::dataplex_service::GetJob {
2057        super::builder::dataplex_service::GetJob::new(self.inner.clone())
2058    }
2059
2060    /// Cancel jobs running for the task resource.
2061    pub fn cancel_job(&self) -> super::builder::dataplex_service::CancelJob {
2062        super::builder::dataplex_service::CancelJob::new(self.inner.clone())
2063    }
2064
2065    /// Create an environment resource.
2066    ///
2067    /// # Long running operations
2068    ///
2069    /// This method is used to start, and/or poll a [long-running Operation].
2070    /// The [Working with long-running operations] chapter in the [user guide]
2071    /// covers these operations in detail.
2072    ///
2073    /// [long-running operation]: https://google.aip.dev/151
2074    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2075    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2076    pub fn create_environment(&self) -> super::builder::dataplex_service::CreateEnvironment {
2077        super::builder::dataplex_service::CreateEnvironment::new(self.inner.clone())
2078    }
2079
2080    /// Update the environment resource.
2081    ///
2082    /// # Long running operations
2083    ///
2084    /// This method is used to start, and/or poll a [long-running Operation].
2085    /// The [Working with long-running operations] chapter in the [user guide]
2086    /// covers these operations in detail.
2087    ///
2088    /// [long-running operation]: https://google.aip.dev/151
2089    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2090    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2091    pub fn update_environment(&self) -> super::builder::dataplex_service::UpdateEnvironment {
2092        super::builder::dataplex_service::UpdateEnvironment::new(self.inner.clone())
2093    }
2094
2095    /// Delete the environment resource. All the child resources must have been
2096    /// deleted before environment deletion can be initiated.
2097    ///
2098    /// # Long running operations
2099    ///
2100    /// This method is used to start, and/or poll a [long-running Operation].
2101    /// The [Working with long-running operations] chapter in the [user guide]
2102    /// covers these operations in detail.
2103    ///
2104    /// [long-running operation]: https://google.aip.dev/151
2105    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2106    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2107    pub fn delete_environment(&self) -> super::builder::dataplex_service::DeleteEnvironment {
2108        super::builder::dataplex_service::DeleteEnvironment::new(self.inner.clone())
2109    }
2110
2111    /// Lists environments under the given lake.
2112    pub fn list_environments(&self) -> super::builder::dataplex_service::ListEnvironments {
2113        super::builder::dataplex_service::ListEnvironments::new(self.inner.clone())
2114    }
2115
2116    /// Get environment resource.
2117    pub fn get_environment(&self) -> super::builder::dataplex_service::GetEnvironment {
2118        super::builder::dataplex_service::GetEnvironment::new(self.inner.clone())
2119    }
2120
2121    /// Lists session resources in an environment.
2122    pub fn list_sessions(&self) -> super::builder::dataplex_service::ListSessions {
2123        super::builder::dataplex_service::ListSessions::new(self.inner.clone())
2124    }
2125
2126    /// Lists information about the supported locations for this service.
2127    pub fn list_locations(&self) -> super::builder::dataplex_service::ListLocations {
2128        super::builder::dataplex_service::ListLocations::new(self.inner.clone())
2129    }
2130
2131    /// Gets information about a location.
2132    pub fn get_location(&self) -> super::builder::dataplex_service::GetLocation {
2133        super::builder::dataplex_service::GetLocation::new(self.inner.clone())
2134    }
2135
2136    /// Sets the access control policy on the specified resource. Replaces
2137    /// any existing policy.
2138    ///
2139    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2140    /// errors.
2141    pub fn set_iam_policy(&self) -> super::builder::dataplex_service::SetIamPolicy {
2142        super::builder::dataplex_service::SetIamPolicy::new(self.inner.clone())
2143    }
2144
2145    /// Gets the access control policy for a resource. Returns an empty policy
2146    /// if the resource exists and does not have a policy set.
2147    pub fn get_iam_policy(&self) -> super::builder::dataplex_service::GetIamPolicy {
2148        super::builder::dataplex_service::GetIamPolicy::new(self.inner.clone())
2149    }
2150
2151    /// Returns permissions that a caller has on the specified resource. If the
2152    /// resource does not exist, this will return an empty set of
2153    /// permissions, not a `NOT_FOUND` error.
2154    ///
2155    /// Note: This operation is designed to be used for building
2156    /// permission-aware UIs and command-line tools, not for authorization
2157    /// checking. This operation may "fail open" without warning.
2158    pub fn test_iam_permissions(&self) -> super::builder::dataplex_service::TestIamPermissions {
2159        super::builder::dataplex_service::TestIamPermissions::new(self.inner.clone())
2160    }
2161
2162    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2163    ///
2164    /// [google.longrunning.Operations]: longrunning::client::Operations
2165    pub fn list_operations(&self) -> super::builder::dataplex_service::ListOperations {
2166        super::builder::dataplex_service::ListOperations::new(self.inner.clone())
2167    }
2168
2169    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2170    ///
2171    /// [google.longrunning.Operations]: longrunning::client::Operations
2172    pub fn get_operation(&self) -> super::builder::dataplex_service::GetOperation {
2173        super::builder::dataplex_service::GetOperation::new(self.inner.clone())
2174    }
2175
2176    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2177    ///
2178    /// [google.longrunning.Operations]: longrunning::client::Operations
2179    pub fn delete_operation(&self) -> super::builder::dataplex_service::DeleteOperation {
2180        super::builder::dataplex_service::DeleteOperation::new(self.inner.clone())
2181    }
2182
2183    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2184    ///
2185    /// [google.longrunning.Operations]: longrunning::client::Operations
2186    pub fn cancel_operation(&self) -> super::builder::dataplex_service::CancelOperation {
2187        super::builder::dataplex_service::CancelOperation::new(self.inner.clone())
2188    }
2189}