Skip to main content

google_cloud_bigtable_admin_v2/
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 Bigtable Admin API.
20///
21/// # Example
22/// ```
23/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24/// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
25/// let client = BigtableInstanceAdmin::builder().build().await?;
26/// // use `client` to make requests to the Cloud Bigtable Admin API.
27/// # Ok(()) }
28/// ```
29///
30/// # Service Description
31///
32/// Service for creating, configuring, and deleting Cloud Bigtable Instances and
33/// Clusters. Provides access to the Instance and Cluster schemas only, not the
34/// tables' metadata or data stored in those tables.
35///
36/// # Configuration
37///
38/// To configure `BigtableInstanceAdmin` use the `with_*` methods in the type returned
39/// by [builder()][BigtableInstanceAdmin::builder]. The default configuration should
40/// work for most applications. Common configuration changes include
41///
42/// * [with_endpoint()]: by default this client uses the global default endpoint
43///   (`https://bigtableadmin.googleapis.com`). Applications using regional
44///   endpoints or running in restricted networks (e.g. a network configured
45//    with [Private Google Access with VPC Service Controls]) may want to
46///   override this default.
47/// * [with_credentials()]: by default this client uses
48///   [Application Default Credentials]. Applications using custom
49///   authentication may need to override this default.
50///
51/// [with_endpoint()]: super::builder::bigtable_instance_admin::ClientBuilder::with_endpoint
52/// [with_credentials()]: super::builder::bigtable_instance_admin::ClientBuilder::credentials
53/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
54/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
55///
56/// # Pooling and Cloning
57///
58/// `BigtableInstanceAdmin` holds a connection pool internally, it is advised to
59/// create one and the reuse it.  You do not need to wrap `BigtableInstanceAdmin` in
60/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
61/// already uses an `Arc` internally.
62#[derive(Clone, Debug)]
63pub struct BigtableInstanceAdmin {
64    inner: std::sync::Arc<dyn super::stub::dynamic::BigtableInstanceAdmin>,
65}
66
67impl BigtableInstanceAdmin {
68    /// Returns a builder for [BigtableInstanceAdmin].
69    ///
70    /// ```
71    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
72    /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
73    /// let client = BigtableInstanceAdmin::builder().build().await?;
74    /// # Ok(()) }
75    /// ```
76    pub fn builder() -> super::builder::bigtable_instance_admin::ClientBuilder {
77        crate::new_client_builder(super::builder::bigtable_instance_admin::client::Factory)
78    }
79
80    /// Creates a new client from the provided stub.
81    ///
82    /// The most common case for calling this function is in tests mocking the
83    /// client's behavior.
84    pub fn from_stub<T>(stub: T) -> Self
85    where
86        T: super::stub::BigtableInstanceAdmin + 'static,
87    {
88        Self {
89            inner: std::sync::Arc::new(stub),
90        }
91    }
92
93    pub(crate) async fn new(
94        config: gaxi::options::ClientConfig,
95    ) -> crate::ClientBuilderResult<Self> {
96        let inner = Self::build_inner(config).await?;
97        Ok(Self { inner })
98    }
99
100    async fn build_inner(
101        conf: gaxi::options::ClientConfig,
102    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BigtableInstanceAdmin>>
103    {
104        if gaxi::options::tracing_enabled(&conf) {
105            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
106        }
107        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
108    }
109
110    async fn build_transport(
111        conf: gaxi::options::ClientConfig,
112    ) -> crate::ClientBuilderResult<impl super::stub::BigtableInstanceAdmin> {
113        super::transport::BigtableInstanceAdmin::new(conf).await
114    }
115
116    async fn build_with_tracing(
117        conf: gaxi::options::ClientConfig,
118    ) -> crate::ClientBuilderResult<impl super::stub::BigtableInstanceAdmin> {
119        Self::build_transport(conf)
120            .await
121            .map(super::tracing::BigtableInstanceAdmin::new)
122    }
123
124    /// Create an instance within a project.
125    ///
126    /// Note that exactly one of Cluster.serve_nodes and
127    /// Cluster.cluster_config.cluster_autoscaling_config can be set. If
128    /// serve_nodes is set to non-zero, then the cluster is manually scaled. If
129    /// cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
130    /// enabled.
131    ///
132    /// # Long running operations
133    ///
134    /// This method is used to start, and/or poll a [long-running Operation].
135    /// The [Working with long-running operations] chapter in the [user guide]
136    /// covers these operations in detail.
137    ///
138    /// [long-running operation]: https://google.aip.dev/151
139    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
140    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
141    pub fn create_instance(&self) -> super::builder::bigtable_instance_admin::CreateInstance {
142        super::builder::bigtable_instance_admin::CreateInstance::new(self.inner.clone())
143    }
144
145    /// Gets information about an instance.
146    pub fn get_instance(&self) -> super::builder::bigtable_instance_admin::GetInstance {
147        super::builder::bigtable_instance_admin::GetInstance::new(self.inner.clone())
148    }
149
150    /// Lists information about instances in a project.
151    pub fn list_instances(&self) -> super::builder::bigtable_instance_admin::ListInstances {
152        super::builder::bigtable_instance_admin::ListInstances::new(self.inner.clone())
153    }
154
155    /// Updates an instance within a project. This method updates only the display
156    /// name and type for an Instance. To update other Instance properties, such as
157    /// labels, use PartialUpdateInstance.
158    pub fn update_instance(&self) -> super::builder::bigtable_instance_admin::UpdateInstance {
159        super::builder::bigtable_instance_admin::UpdateInstance::new(self.inner.clone())
160    }
161
162    /// Partially updates an instance within a project. This method can modify all
163    /// fields of an Instance and is the preferred way to update an Instance.
164    ///
165    /// # Long running operations
166    ///
167    /// This method is used to start, and/or poll a [long-running Operation].
168    /// The [Working with long-running operations] chapter in the [user guide]
169    /// covers these operations in detail.
170    ///
171    /// [long-running operation]: https://google.aip.dev/151
172    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
173    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
174    pub fn partial_update_instance(
175        &self,
176    ) -> super::builder::bigtable_instance_admin::PartialUpdateInstance {
177        super::builder::bigtable_instance_admin::PartialUpdateInstance::new(self.inner.clone())
178    }
179
180    /// Delete an instance from a project.
181    pub fn delete_instance(&self) -> super::builder::bigtable_instance_admin::DeleteInstance {
182        super::builder::bigtable_instance_admin::DeleteInstance::new(self.inner.clone())
183    }
184
185    /// Creates a cluster within an instance.
186    ///
187    /// Note that exactly one of Cluster.serve_nodes and
188    /// Cluster.cluster_config.cluster_autoscaling_config can be set. If
189    /// serve_nodes is set to non-zero, then the cluster is manually scaled. If
190    /// cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
191    /// enabled.
192    ///
193    /// # Long running operations
194    ///
195    /// This method is used to start, and/or poll a [long-running Operation].
196    /// The [Working with long-running operations] chapter in the [user guide]
197    /// covers these operations in detail.
198    ///
199    /// [long-running operation]: https://google.aip.dev/151
200    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
201    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
202    pub fn create_cluster(&self) -> super::builder::bigtable_instance_admin::CreateCluster {
203        super::builder::bigtable_instance_admin::CreateCluster::new(self.inner.clone())
204    }
205
206    /// Gets information about a cluster.
207    pub fn get_cluster(&self) -> super::builder::bigtable_instance_admin::GetCluster {
208        super::builder::bigtable_instance_admin::GetCluster::new(self.inner.clone())
209    }
210
211    /// Lists information about clusters in an instance.
212    pub fn list_clusters(&self) -> super::builder::bigtable_instance_admin::ListClusters {
213        super::builder::bigtable_instance_admin::ListClusters::new(self.inner.clone())
214    }
215
216    /// Updates a cluster within an instance.
217    ///
218    /// Note that UpdateCluster does not support updating
219    /// cluster_config.cluster_autoscaling_config. In order to update it, you
220    /// must use PartialUpdateCluster.
221    ///
222    /// # Long running operations
223    ///
224    /// This method is used to start, and/or poll a [long-running Operation].
225    /// The [Working with long-running operations] chapter in the [user guide]
226    /// covers these operations in detail.
227    ///
228    /// [long-running operation]: https://google.aip.dev/151
229    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
230    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
231    pub fn update_cluster(&self) -> super::builder::bigtable_instance_admin::UpdateCluster {
232        super::builder::bigtable_instance_admin::UpdateCluster::new(self.inner.clone())
233    }
234
235    /// Partially updates a cluster within a project. This method is the preferred
236    /// way to update a Cluster.
237    ///
238    /// To enable and update autoscaling, set
239    /// cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
240    /// serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
241    /// are ignored. Note that an update cannot simultaneously set serve_nodes to
242    /// non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
243    /// also specify both in the update_mask.
244    ///
245    /// To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
246    /// and explicitly set a serve_node count via the update_mask.
247    ///
248    /// # Long running operations
249    ///
250    /// This method is used to start, and/or poll a [long-running Operation].
251    /// The [Working with long-running operations] chapter in the [user guide]
252    /// covers these operations in detail.
253    ///
254    /// [long-running operation]: https://google.aip.dev/151
255    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
256    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
257    pub fn partial_update_cluster(
258        &self,
259    ) -> super::builder::bigtable_instance_admin::PartialUpdateCluster {
260        super::builder::bigtable_instance_admin::PartialUpdateCluster::new(self.inner.clone())
261    }
262
263    /// Deletes a cluster from an instance.
264    pub fn delete_cluster(&self) -> super::builder::bigtable_instance_admin::DeleteCluster {
265        super::builder::bigtable_instance_admin::DeleteCluster::new(self.inner.clone())
266    }
267
268    /// Creates an app profile within an instance.
269    pub fn create_app_profile(&self) -> super::builder::bigtable_instance_admin::CreateAppProfile {
270        super::builder::bigtable_instance_admin::CreateAppProfile::new(self.inner.clone())
271    }
272
273    /// Gets information about an app profile.
274    pub fn get_app_profile(&self) -> super::builder::bigtable_instance_admin::GetAppProfile {
275        super::builder::bigtable_instance_admin::GetAppProfile::new(self.inner.clone())
276    }
277
278    /// Lists information about app profiles in an instance.
279    pub fn list_app_profiles(&self) -> super::builder::bigtable_instance_admin::ListAppProfiles {
280        super::builder::bigtable_instance_admin::ListAppProfiles::new(self.inner.clone())
281    }
282
283    /// Updates an app profile within an instance.
284    ///
285    /// # Long running operations
286    ///
287    /// This method is used to start, and/or poll a [long-running Operation].
288    /// The [Working with long-running operations] chapter in the [user guide]
289    /// covers these operations in detail.
290    ///
291    /// [long-running operation]: https://google.aip.dev/151
292    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
293    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
294    pub fn update_app_profile(&self) -> super::builder::bigtable_instance_admin::UpdateAppProfile {
295        super::builder::bigtable_instance_admin::UpdateAppProfile::new(self.inner.clone())
296    }
297
298    /// Deletes an app profile from an instance.
299    pub fn delete_app_profile(&self) -> super::builder::bigtable_instance_admin::DeleteAppProfile {
300        super::builder::bigtable_instance_admin::DeleteAppProfile::new(self.inner.clone())
301    }
302
303    /// Gets the access control policy for an instance resource. Returns an empty
304    /// policy if an instance exists but does not have a policy set.
305    pub fn get_iam_policy(&self) -> super::builder::bigtable_instance_admin::GetIamPolicy {
306        super::builder::bigtable_instance_admin::GetIamPolicy::new(self.inner.clone())
307    }
308
309    /// Sets the access control policy on an instance resource. Replaces any
310    /// existing policy.
311    pub fn set_iam_policy(&self) -> super::builder::bigtable_instance_admin::SetIamPolicy {
312        super::builder::bigtable_instance_admin::SetIamPolicy::new(self.inner.clone())
313    }
314
315    /// Returns permissions that the caller has on the specified instance resource.
316    pub fn test_iam_permissions(
317        &self,
318    ) -> super::builder::bigtable_instance_admin::TestIamPermissions {
319        super::builder::bigtable_instance_admin::TestIamPermissions::new(self.inner.clone())
320    }
321
322    /// Lists hot tablets in a cluster, within the time range provided. Hot
323    /// tablets are ordered based on CPU usage.
324    pub fn list_hot_tablets(&self) -> super::builder::bigtable_instance_admin::ListHotTablets {
325        super::builder::bigtable_instance_admin::ListHotTablets::new(self.inner.clone())
326    }
327
328    /// Creates a logical view within an instance.
329    ///
330    /// # Long running operations
331    ///
332    /// This method is used to start, and/or poll a [long-running Operation].
333    /// The [Working with long-running operations] chapter in the [user guide]
334    /// covers these operations in detail.
335    ///
336    /// [long-running operation]: https://google.aip.dev/151
337    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
338    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
339    pub fn create_logical_view(
340        &self,
341    ) -> super::builder::bigtable_instance_admin::CreateLogicalView {
342        super::builder::bigtable_instance_admin::CreateLogicalView::new(self.inner.clone())
343    }
344
345    /// Gets information about a logical view.
346    pub fn get_logical_view(&self) -> super::builder::bigtable_instance_admin::GetLogicalView {
347        super::builder::bigtable_instance_admin::GetLogicalView::new(self.inner.clone())
348    }
349
350    /// Lists information about logical views in an instance.
351    pub fn list_logical_views(&self) -> super::builder::bigtable_instance_admin::ListLogicalViews {
352        super::builder::bigtable_instance_admin::ListLogicalViews::new(self.inner.clone())
353    }
354
355    /// Updates a logical view within an instance.
356    ///
357    /// # Long running operations
358    ///
359    /// This method is used to start, and/or poll a [long-running Operation].
360    /// The [Working with long-running operations] chapter in the [user guide]
361    /// covers these operations in detail.
362    ///
363    /// [long-running operation]: https://google.aip.dev/151
364    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
365    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
366    pub fn update_logical_view(
367        &self,
368    ) -> super::builder::bigtable_instance_admin::UpdateLogicalView {
369        super::builder::bigtable_instance_admin::UpdateLogicalView::new(self.inner.clone())
370    }
371
372    /// Deletes a logical view from an instance.
373    pub fn delete_logical_view(
374        &self,
375    ) -> super::builder::bigtable_instance_admin::DeleteLogicalView {
376        super::builder::bigtable_instance_admin::DeleteLogicalView::new(self.inner.clone())
377    }
378
379    /// Creates a materialized view within an instance.
380    ///
381    /// # Long running operations
382    ///
383    /// This method is used to start, and/or poll a [long-running Operation].
384    /// The [Working with long-running operations] chapter in the [user guide]
385    /// covers these operations in detail.
386    ///
387    /// [long-running operation]: https://google.aip.dev/151
388    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
389    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
390    pub fn create_materialized_view(
391        &self,
392    ) -> super::builder::bigtable_instance_admin::CreateMaterializedView {
393        super::builder::bigtable_instance_admin::CreateMaterializedView::new(self.inner.clone())
394    }
395
396    /// Gets information about a materialized view.
397    pub fn get_materialized_view(
398        &self,
399    ) -> super::builder::bigtable_instance_admin::GetMaterializedView {
400        super::builder::bigtable_instance_admin::GetMaterializedView::new(self.inner.clone())
401    }
402
403    /// Lists information about materialized views in an instance.
404    pub fn list_materialized_views(
405        &self,
406    ) -> super::builder::bigtable_instance_admin::ListMaterializedViews {
407        super::builder::bigtable_instance_admin::ListMaterializedViews::new(self.inner.clone())
408    }
409
410    /// Updates a materialized view within an instance.
411    ///
412    /// # Long running operations
413    ///
414    /// This method is used to start, and/or poll a [long-running Operation].
415    /// The [Working with long-running operations] chapter in the [user guide]
416    /// covers these operations in detail.
417    ///
418    /// [long-running operation]: https://google.aip.dev/151
419    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
420    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
421    pub fn update_materialized_view(
422        &self,
423    ) -> super::builder::bigtable_instance_admin::UpdateMaterializedView {
424        super::builder::bigtable_instance_admin::UpdateMaterializedView::new(self.inner.clone())
425    }
426
427    /// Deletes a materialized view from an instance.
428    pub fn delete_materialized_view(
429        &self,
430    ) -> super::builder::bigtable_instance_admin::DeleteMaterializedView {
431        super::builder::bigtable_instance_admin::DeleteMaterializedView::new(self.inner.clone())
432    }
433
434    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
435    ///
436    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
437    pub fn list_operations(&self) -> super::builder::bigtable_instance_admin::ListOperations {
438        super::builder::bigtable_instance_admin::ListOperations::new(self.inner.clone())
439    }
440
441    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
442    ///
443    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
444    pub fn get_operation(&self) -> super::builder::bigtable_instance_admin::GetOperation {
445        super::builder::bigtable_instance_admin::GetOperation::new(self.inner.clone())
446    }
447
448    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
449    ///
450    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
451    pub fn delete_operation(&self) -> super::builder::bigtable_instance_admin::DeleteOperation {
452        super::builder::bigtable_instance_admin::DeleteOperation::new(self.inner.clone())
453    }
454
455    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
456    ///
457    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
458    pub fn cancel_operation(&self) -> super::builder::bigtable_instance_admin::CancelOperation {
459        super::builder::bigtable_instance_admin::CancelOperation::new(self.inner.clone())
460    }
461}
462
463/// Implements a client for the Cloud Bigtable Admin API.
464///
465/// # Example
466/// ```
467/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
468/// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
469/// let client = BigtableTableAdmin::builder().build().await?;
470/// // use `client` to make requests to the Cloud Bigtable Admin API.
471/// # Ok(()) }
472/// ```
473///
474/// # Service Description
475///
476/// Service for creating, configuring, and deleting Cloud Bigtable tables.
477///
478/// Provides access to the table schemas only, not the data stored within
479/// the tables.
480///
481/// # Configuration
482///
483/// To configure `BigtableTableAdmin` use the `with_*` methods in the type returned
484/// by [builder()][BigtableTableAdmin::builder]. The default configuration should
485/// work for most applications. Common configuration changes include
486///
487/// * [with_endpoint()]: by default this client uses the global default endpoint
488///   (`https://bigtableadmin.googleapis.com`). Applications using regional
489///   endpoints or running in restricted networks (e.g. a network configured
490//    with [Private Google Access with VPC Service Controls]) may want to
491///   override this default.
492/// * [with_credentials()]: by default this client uses
493///   [Application Default Credentials]. Applications using custom
494///   authentication may need to override this default.
495///
496/// [with_endpoint()]: super::builder::bigtable_table_admin::ClientBuilder::with_endpoint
497/// [with_credentials()]: super::builder::bigtable_table_admin::ClientBuilder::credentials
498/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
499/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
500///
501/// # Pooling and Cloning
502///
503/// `BigtableTableAdmin` holds a connection pool internally, it is advised to
504/// create one and the reuse it.  You do not need to wrap `BigtableTableAdmin` in
505/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
506/// already uses an `Arc` internally.
507#[derive(Clone, Debug)]
508pub struct BigtableTableAdmin {
509    inner: std::sync::Arc<dyn super::stub::dynamic::BigtableTableAdmin>,
510}
511
512impl BigtableTableAdmin {
513    /// Returns a builder for [BigtableTableAdmin].
514    ///
515    /// ```
516    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
517    /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
518    /// let client = BigtableTableAdmin::builder().build().await?;
519    /// # Ok(()) }
520    /// ```
521    pub fn builder() -> super::builder::bigtable_table_admin::ClientBuilder {
522        crate::new_client_builder(super::builder::bigtable_table_admin::client::Factory)
523    }
524
525    /// Creates a new client from the provided stub.
526    ///
527    /// The most common case for calling this function is in tests mocking the
528    /// client's behavior.
529    pub fn from_stub<T>(stub: T) -> Self
530    where
531        T: super::stub::BigtableTableAdmin + 'static,
532    {
533        Self {
534            inner: std::sync::Arc::new(stub),
535        }
536    }
537
538    pub(crate) async fn new(
539        config: gaxi::options::ClientConfig,
540    ) -> crate::ClientBuilderResult<Self> {
541        let inner = Self::build_inner(config).await?;
542        Ok(Self { inner })
543    }
544
545    async fn build_inner(
546        conf: gaxi::options::ClientConfig,
547    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BigtableTableAdmin>>
548    {
549        if gaxi::options::tracing_enabled(&conf) {
550            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
551        }
552        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
553    }
554
555    async fn build_transport(
556        conf: gaxi::options::ClientConfig,
557    ) -> crate::ClientBuilderResult<impl super::stub::BigtableTableAdmin> {
558        super::transport::BigtableTableAdmin::new(conf).await
559    }
560
561    async fn build_with_tracing(
562        conf: gaxi::options::ClientConfig,
563    ) -> crate::ClientBuilderResult<impl super::stub::BigtableTableAdmin> {
564        Self::build_transport(conf)
565            .await
566            .map(super::tracing::BigtableTableAdmin::new)
567    }
568
569    /// Creates a new table in the specified instance.
570    /// The table can be created with a full set of initial column families,
571    /// specified in the request.
572    pub fn create_table(&self) -> super::builder::bigtable_table_admin::CreateTable {
573        super::builder::bigtable_table_admin::CreateTable::new(self.inner.clone())
574    }
575
576    /// Creates a new table from the specified snapshot. The target table must
577    /// not exist. The snapshot and the table must be in the same instance.
578    ///
579    /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
580    /// feature is not currently available to most Cloud Bigtable customers. This
581    /// feature might be changed in backward-incompatible ways and is not
582    /// recommended for production use. It is not subject to any SLA or deprecation
583    /// policy.
584    ///
585    /// # Long running operations
586    ///
587    /// This method is used to start, and/or poll a [long-running Operation].
588    /// The [Working with long-running operations] chapter in the [user guide]
589    /// covers these operations in detail.
590    ///
591    /// [long-running operation]: https://google.aip.dev/151
592    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
593    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
594    pub fn create_table_from_snapshot(
595        &self,
596    ) -> super::builder::bigtable_table_admin::CreateTableFromSnapshot {
597        super::builder::bigtable_table_admin::CreateTableFromSnapshot::new(self.inner.clone())
598    }
599
600    /// Lists all tables served from a specified instance.
601    pub fn list_tables(&self) -> super::builder::bigtable_table_admin::ListTables {
602        super::builder::bigtable_table_admin::ListTables::new(self.inner.clone())
603    }
604
605    /// Gets metadata information about the specified table.
606    pub fn get_table(&self) -> super::builder::bigtable_table_admin::GetTable {
607        super::builder::bigtable_table_admin::GetTable::new(self.inner.clone())
608    }
609
610    /// Updates a specified table.
611    ///
612    /// # Long running operations
613    ///
614    /// This method is used to start, and/or poll a [long-running Operation].
615    /// The [Working with long-running operations] chapter in the [user guide]
616    /// covers these operations in detail.
617    ///
618    /// [long-running operation]: https://google.aip.dev/151
619    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
620    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
621    pub fn update_table(&self) -> super::builder::bigtable_table_admin::UpdateTable {
622        super::builder::bigtable_table_admin::UpdateTable::new(self.inner.clone())
623    }
624
625    /// Permanently deletes a specified table and all of its data.
626    pub fn delete_table(&self) -> super::builder::bigtable_table_admin::DeleteTable {
627        super::builder::bigtable_table_admin::DeleteTable::new(self.inner.clone())
628    }
629
630    /// Restores a specified table which was accidentally deleted.
631    ///
632    /// # Long running operations
633    ///
634    /// This method is used to start, and/or poll a [long-running Operation].
635    /// The [Working with long-running operations] chapter in the [user guide]
636    /// covers these operations in detail.
637    ///
638    /// [long-running operation]: https://google.aip.dev/151
639    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
640    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
641    pub fn undelete_table(&self) -> super::builder::bigtable_table_admin::UndeleteTable {
642        super::builder::bigtable_table_admin::UndeleteTable::new(self.inner.clone())
643    }
644
645    /// Creates a new AuthorizedView in a table.
646    ///
647    /// # Long running operations
648    ///
649    /// This method is used to start, and/or poll a [long-running Operation].
650    /// The [Working with long-running operations] chapter in the [user guide]
651    /// covers these operations in detail.
652    ///
653    /// [long-running operation]: https://google.aip.dev/151
654    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
655    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
656    pub fn create_authorized_view(
657        &self,
658    ) -> super::builder::bigtable_table_admin::CreateAuthorizedView {
659        super::builder::bigtable_table_admin::CreateAuthorizedView::new(self.inner.clone())
660    }
661
662    /// Lists all AuthorizedViews from a specific table.
663    pub fn list_authorized_views(
664        &self,
665    ) -> super::builder::bigtable_table_admin::ListAuthorizedViews {
666        super::builder::bigtable_table_admin::ListAuthorizedViews::new(self.inner.clone())
667    }
668
669    /// Gets information from a specified AuthorizedView.
670    pub fn get_authorized_view(&self) -> super::builder::bigtable_table_admin::GetAuthorizedView {
671        super::builder::bigtable_table_admin::GetAuthorizedView::new(self.inner.clone())
672    }
673
674    /// Updates an AuthorizedView in a table.
675    ///
676    /// # Long running operations
677    ///
678    /// This method is used to start, and/or poll a [long-running Operation].
679    /// The [Working with long-running operations] chapter in the [user guide]
680    /// covers these operations in detail.
681    ///
682    /// [long-running operation]: https://google.aip.dev/151
683    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
684    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
685    pub fn update_authorized_view(
686        &self,
687    ) -> super::builder::bigtable_table_admin::UpdateAuthorizedView {
688        super::builder::bigtable_table_admin::UpdateAuthorizedView::new(self.inner.clone())
689    }
690
691    /// Permanently deletes a specified AuthorizedView.
692    pub fn delete_authorized_view(
693        &self,
694    ) -> super::builder::bigtable_table_admin::DeleteAuthorizedView {
695        super::builder::bigtable_table_admin::DeleteAuthorizedView::new(self.inner.clone())
696    }
697
698    /// Performs a series of column family modifications on the specified table.
699    /// Either all or none of the modifications will occur before this method
700    /// returns, but data requests received prior to that point may see a table
701    /// where only some modifications have taken effect.
702    pub fn modify_column_families(
703        &self,
704    ) -> super::builder::bigtable_table_admin::ModifyColumnFamilies {
705        super::builder::bigtable_table_admin::ModifyColumnFamilies::new(self.inner.clone())
706    }
707
708    /// Permanently drop/delete a row range from a specified table. The request can
709    /// specify whether to delete all rows in a table, or only those that match a
710    /// particular prefix.
711    pub fn drop_row_range(&self) -> super::builder::bigtable_table_admin::DropRowRange {
712        super::builder::bigtable_table_admin::DropRowRange::new(self.inner.clone())
713    }
714
715    /// Generates a consistency token for a Table, which can be used in
716    /// CheckConsistency to check whether mutations to the table that finished
717    /// before this call started have been replicated. The tokens will be available
718    /// for 90 days.
719    pub fn generate_consistency_token(
720        &self,
721    ) -> super::builder::bigtable_table_admin::GenerateConsistencyToken {
722        super::builder::bigtable_table_admin::GenerateConsistencyToken::new(self.inner.clone())
723    }
724
725    /// Checks replication consistency based on a consistency token, that is, if
726    /// replication has caught up based on the conditions specified in the token
727    /// and the check request.
728    pub fn check_consistency(&self) -> super::builder::bigtable_table_admin::CheckConsistency {
729        super::builder::bigtable_table_admin::CheckConsistency::new(self.inner.clone())
730    }
731
732    /// Creates a new snapshot in the specified cluster from the specified
733    /// source table. The cluster and the table must be in the same instance.
734    ///
735    /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
736    /// feature is not currently available to most Cloud Bigtable customers. This
737    /// feature might be changed in backward-incompatible ways and is not
738    /// recommended for production use. It is not subject to any SLA or deprecation
739    /// policy.
740    ///
741    /// # Long running operations
742    ///
743    /// This method is used to start, and/or poll a [long-running Operation].
744    /// The [Working with long-running operations] chapter in the [user guide]
745    /// covers these operations in detail.
746    ///
747    /// [long-running operation]: https://google.aip.dev/151
748    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
749    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
750    pub fn snapshot_table(&self) -> super::builder::bigtable_table_admin::SnapshotTable {
751        super::builder::bigtable_table_admin::SnapshotTable::new(self.inner.clone())
752    }
753
754    /// Gets metadata information about the specified snapshot.
755    ///
756    /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
757    /// feature is not currently available to most Cloud Bigtable customers. This
758    /// feature might be changed in backward-incompatible ways and is not
759    /// recommended for production use. It is not subject to any SLA or deprecation
760    /// policy.
761    pub fn get_snapshot(&self) -> super::builder::bigtable_table_admin::GetSnapshot {
762        super::builder::bigtable_table_admin::GetSnapshot::new(self.inner.clone())
763    }
764
765    /// Lists all snapshots associated with the specified cluster.
766    ///
767    /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
768    /// feature is not currently available to most Cloud Bigtable customers. This
769    /// feature might be changed in backward-incompatible ways and is not
770    /// recommended for production use. It is not subject to any SLA or deprecation
771    /// policy.
772    pub fn list_snapshots(&self) -> super::builder::bigtable_table_admin::ListSnapshots {
773        super::builder::bigtable_table_admin::ListSnapshots::new(self.inner.clone())
774    }
775
776    /// Permanently deletes the specified snapshot.
777    ///
778    /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
779    /// feature is not currently available to most Cloud Bigtable customers. This
780    /// feature might be changed in backward-incompatible ways and is not
781    /// recommended for production use. It is not subject to any SLA or deprecation
782    /// policy.
783    pub fn delete_snapshot(&self) -> super::builder::bigtable_table_admin::DeleteSnapshot {
784        super::builder::bigtable_table_admin::DeleteSnapshot::new(self.inner.clone())
785    }
786
787    /// Starts creating a new Cloud Bigtable Backup.  The returned backup
788    /// [long-running operation][google.longrunning.Operation] can be used to
789    /// track creation of the backup. The
790    /// [metadata][google.longrunning.Operation.metadata] field type is
791    /// [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
792    /// [response][google.longrunning.Operation.response] field type is
793    /// [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
794    /// returned operation will stop the creation and delete the backup.
795    ///
796    /// [google.bigtable.admin.v2.Backup]: crate::model::Backup
797    /// [google.bigtable.admin.v2.CreateBackupMetadata]: crate::model::CreateBackupMetadata
798    /// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
799    /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
800    /// [google.longrunning.Operation.response]: google_cloud_longrunning::model::Operation::result
801    ///
802    /// # Long running operations
803    ///
804    /// This method is used to start, and/or poll a [long-running Operation].
805    /// The [Working with long-running operations] chapter in the [user guide]
806    /// covers these operations in detail.
807    ///
808    /// [long-running operation]: https://google.aip.dev/151
809    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
810    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
811    pub fn create_backup(&self) -> super::builder::bigtable_table_admin::CreateBackup {
812        super::builder::bigtable_table_admin::CreateBackup::new(self.inner.clone())
813    }
814
815    /// Gets metadata on a pending or completed Cloud Bigtable Backup.
816    pub fn get_backup(&self) -> super::builder::bigtable_table_admin::GetBackup {
817        super::builder::bigtable_table_admin::GetBackup::new(self.inner.clone())
818    }
819
820    /// Updates a pending or completed Cloud Bigtable Backup.
821    pub fn update_backup(&self) -> super::builder::bigtable_table_admin::UpdateBackup {
822        super::builder::bigtable_table_admin::UpdateBackup::new(self.inner.clone())
823    }
824
825    /// Deletes a pending or completed Cloud Bigtable backup.
826    pub fn delete_backup(&self) -> super::builder::bigtable_table_admin::DeleteBackup {
827        super::builder::bigtable_table_admin::DeleteBackup::new(self.inner.clone())
828    }
829
830    /// Lists Cloud Bigtable backups. Returns both completed and pending
831    /// backups.
832    pub fn list_backups(&self) -> super::builder::bigtable_table_admin::ListBackups {
833        super::builder::bigtable_table_admin::ListBackups::new(self.inner.clone())
834    }
835
836    /// Create a new table by restoring from a completed backup.  The
837    /// returned table [long-running operation][google.longrunning.Operation] can
838    /// be used to track the progress of the operation, and to cancel it.  The
839    /// [metadata][google.longrunning.Operation.metadata] field type is
840    /// [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].  The
841    /// [response][google.longrunning.Operation.response] type is
842    /// [Table][google.bigtable.admin.v2.Table], if successful.
843    ///
844    /// [google.bigtable.admin.v2.RestoreTableMetadata]: crate::model::RestoreTableMetadata
845    /// [google.bigtable.admin.v2.Table]: crate::model::Table
846    /// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
847    /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
848    /// [google.longrunning.Operation.response]: google_cloud_longrunning::model::Operation::result
849    ///
850    /// # Long running operations
851    ///
852    /// This method is used to start, and/or poll a [long-running Operation].
853    /// The [Working with long-running operations] chapter in the [user guide]
854    /// covers these operations in detail.
855    ///
856    /// [long-running operation]: https://google.aip.dev/151
857    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
858    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
859    pub fn restore_table(&self) -> super::builder::bigtable_table_admin::RestoreTable {
860        super::builder::bigtable_table_admin::RestoreTable::new(self.inner.clone())
861    }
862
863    /// Copy a Cloud Bigtable backup to a new backup in the destination cluster
864    /// located in the destination instance and project.
865    ///
866    /// # Long running operations
867    ///
868    /// This method is used to start, and/or poll a [long-running Operation].
869    /// The [Working with long-running operations] chapter in the [user guide]
870    /// covers these operations in detail.
871    ///
872    /// [long-running operation]: https://google.aip.dev/151
873    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
874    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
875    pub fn copy_backup(&self) -> super::builder::bigtable_table_admin::CopyBackup {
876        super::builder::bigtable_table_admin::CopyBackup::new(self.inner.clone())
877    }
878
879    /// Gets the access control policy for a Bigtable resource.
880    /// Returns an empty policy if the resource exists but does not have a policy
881    /// set.
882    pub fn get_iam_policy(&self) -> super::builder::bigtable_table_admin::GetIamPolicy {
883        super::builder::bigtable_table_admin::GetIamPolicy::new(self.inner.clone())
884    }
885
886    /// Sets the access control policy on a Bigtable resource.
887    /// Replaces any existing policy.
888    pub fn set_iam_policy(&self) -> super::builder::bigtable_table_admin::SetIamPolicy {
889        super::builder::bigtable_table_admin::SetIamPolicy::new(self.inner.clone())
890    }
891
892    /// Returns permissions that the caller has on the specified Bigtable
893    /// resource.
894    pub fn test_iam_permissions(&self) -> super::builder::bigtable_table_admin::TestIamPermissions {
895        super::builder::bigtable_table_admin::TestIamPermissions::new(self.inner.clone())
896    }
897
898    /// Creates a new schema bundle in the specified table.
899    ///
900    /// # Long running operations
901    ///
902    /// This method is used to start, and/or poll a [long-running Operation].
903    /// The [Working with long-running operations] chapter in the [user guide]
904    /// covers these operations in detail.
905    ///
906    /// [long-running operation]: https://google.aip.dev/151
907    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
908    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
909    pub fn create_schema_bundle(&self) -> super::builder::bigtable_table_admin::CreateSchemaBundle {
910        super::builder::bigtable_table_admin::CreateSchemaBundle::new(self.inner.clone())
911    }
912
913    /// Updates a schema bundle in the specified table.
914    ///
915    /// # Long running operations
916    ///
917    /// This method is used to start, and/or poll a [long-running Operation].
918    /// The [Working with long-running operations] chapter in the [user guide]
919    /// covers these operations in detail.
920    ///
921    /// [long-running operation]: https://google.aip.dev/151
922    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
923    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
924    pub fn update_schema_bundle(&self) -> super::builder::bigtable_table_admin::UpdateSchemaBundle {
925        super::builder::bigtable_table_admin::UpdateSchemaBundle::new(self.inner.clone())
926    }
927
928    /// Gets metadata information about the specified schema bundle.
929    pub fn get_schema_bundle(&self) -> super::builder::bigtable_table_admin::GetSchemaBundle {
930        super::builder::bigtable_table_admin::GetSchemaBundle::new(self.inner.clone())
931    }
932
933    /// Lists all schema bundles associated with the specified table.
934    pub fn list_schema_bundles(&self) -> super::builder::bigtable_table_admin::ListSchemaBundles {
935        super::builder::bigtable_table_admin::ListSchemaBundles::new(self.inner.clone())
936    }
937
938    /// Deletes a schema bundle in the specified table.
939    pub fn delete_schema_bundle(&self) -> super::builder::bigtable_table_admin::DeleteSchemaBundle {
940        super::builder::bigtable_table_admin::DeleteSchemaBundle::new(self.inner.clone())
941    }
942
943    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
944    ///
945    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
946    pub fn list_operations(&self) -> super::builder::bigtable_table_admin::ListOperations {
947        super::builder::bigtable_table_admin::ListOperations::new(self.inner.clone())
948    }
949
950    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
951    ///
952    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
953    pub fn get_operation(&self) -> super::builder::bigtable_table_admin::GetOperation {
954        super::builder::bigtable_table_admin::GetOperation::new(self.inner.clone())
955    }
956
957    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
958    ///
959    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
960    pub fn delete_operation(&self) -> super::builder::bigtable_table_admin::DeleteOperation {
961        super::builder::bigtable_table_admin::DeleteOperation::new(self.inner.clone())
962    }
963
964    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
965    ///
966    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
967    pub fn cancel_operation(&self) -> super::builder::bigtable_table_admin::CancelOperation {
968        super::builder::bigtable_table_admin::CancelOperation::new(self.inner.clone())
969    }
970}