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::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![allow(rustdoc::redundant_explicit_links)]
20
21/// Implements a client for the Cloud Bigtable Admin API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
26/// use google_cloud_gax::paginator::ItemPaginator as _;
27/// async fn sample(
28/// project_id: &str,
29/// instance_id: &str,
30/// ) -> anyhow::Result<()> {
31/// let client = BigtableInstanceAdmin::builder().build().await?;
32/// let mut list = client.list_app_profiles()
33/// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
34/// .by_item();
35/// while let Some(item) = list.next().await.transpose()? {
36/// println!("{:?}", item);
37/// }
38/// Ok(())
39/// }
40/// ```
41///
42/// # Service Description
43///
44/// Service for creating, configuring, and deleting Cloud Bigtable Instances and
45/// Clusters. Provides access to the Instance and Cluster schemas only, not the
46/// tables' metadata or data stored in those tables.
47///
48/// # Configuration
49///
50/// To configure `BigtableInstanceAdmin` use the `with_*` methods in the type returned
51/// by [builder()][BigtableInstanceAdmin::builder]. The default configuration should
52/// work for most applications. Common configuration changes include
53///
54/// * [with_endpoint()]: by default this client uses the global default endpoint
55/// (`https://bigtableadmin.googleapis.com`). Applications using regional
56/// endpoints or running in restricted networks (e.g. a network configured
57/// with [Private Google Access with VPC Service Controls]) may want to
58/// override this default.
59/// * [with_credentials()]: by default this client uses
60/// [Application Default Credentials]. Applications using custom
61/// authentication may need to override this default.
62///
63/// [with_endpoint()]: super::builder::bigtable_instance_admin::ClientBuilder::with_endpoint
64/// [with_credentials()]: super::builder::bigtable_instance_admin::ClientBuilder::with_credentials
65/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
66/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
67///
68/// # Pooling and Cloning
69///
70/// `BigtableInstanceAdmin` holds a connection pool internally, it is advised to
71/// create one and reuse it. You do not need to wrap `BigtableInstanceAdmin` in
72/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
73/// already uses an `Arc` internally.
74#[derive(Clone, Debug)]
75pub struct BigtableInstanceAdmin {
76 inner: std::sync::Arc<dyn super::stub::dynamic::BigtableInstanceAdmin>,
77}
78
79impl BigtableInstanceAdmin {
80 /// Returns a builder for [BigtableInstanceAdmin].
81 ///
82 /// ```
83 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
84 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
85 /// let client = BigtableInstanceAdmin::builder().build().await?;
86 /// # Ok(()) }
87 /// ```
88 pub fn builder() -> super::builder::bigtable_instance_admin::ClientBuilder {
89 crate::new_client_builder(super::builder::bigtable_instance_admin::client::Factory)
90 }
91
92 /// Creates a new client from the provided stub.
93 ///
94 /// The most common case for calling this function is in tests mocking the
95 /// client's behavior.
96 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
97 where
98 T: super::stub::BigtableInstanceAdmin + 'static,
99 {
100 Self { inner: stub.into() }
101 }
102
103 pub(crate) async fn new(
104 config: gaxi::options::ClientConfig,
105 ) -> crate::ClientBuilderResult<Self> {
106 let inner = Self::build_inner(config).await?;
107 Ok(Self { inner })
108 }
109
110 async fn build_inner(
111 conf: gaxi::options::ClientConfig,
112 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BigtableInstanceAdmin>>
113 {
114 if gaxi::options::tracing_enabled(&conf) {
115 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
116 }
117 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
118 }
119
120 async fn build_transport(
121 conf: gaxi::options::ClientConfig,
122 ) -> crate::ClientBuilderResult<impl super::stub::BigtableInstanceAdmin> {
123 super::transport::BigtableInstanceAdmin::new(conf).await
124 }
125
126 async fn build_with_tracing(
127 conf: gaxi::options::ClientConfig,
128 ) -> crate::ClientBuilderResult<impl super::stub::BigtableInstanceAdmin> {
129 Self::build_transport(conf)
130 .await
131 .map(super::tracing::BigtableInstanceAdmin::new)
132 }
133
134 /// Create an instance within a project.
135 ///
136 /// Note that exactly one of Cluster.serve_nodes and
137 /// Cluster.cluster_config.cluster_autoscaling_config can be set. If
138 /// serve_nodes is set to non-zero, then the cluster is manually scaled. If
139 /// cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
140 /// enabled.
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 ///
152 /// # Example
153 /// ```
154 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
155 /// use google_cloud_lro::Poller;
156 /// use google_cloud_bigtable_admin_v2::model::Instance;
157 /// use google_cloud_bigtable_admin_v2::Result;
158 /// async fn sample(
159 /// client: &BigtableInstanceAdmin, parent: &str
160 /// ) -> Result<()> {
161 /// let response = client.create_instance()
162 /// .set_parent(parent)
163 /// .set_instance_id("instance_id_value")
164 /// .set_instance(
165 /// Instance::new()/* set fields */
166 /// )
167 /// .poller().until_done().await?;
168 /// println!("response {:?}", response);
169 /// Ok(())
170 /// }
171 /// ```
172 pub fn create_instance(&self) -> super::builder::bigtable_instance_admin::CreateInstance {
173 super::builder::bigtable_instance_admin::CreateInstance::new(self.inner.clone())
174 }
175
176 /// Gets information about an instance.
177 ///
178 /// # Example
179 /// ```
180 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
181 /// use google_cloud_bigtable_admin_v2::Result;
182 /// async fn sample(
183 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
184 /// ) -> Result<()> {
185 /// let response = client.get_instance()
186 /// .set_name(format!("projects/{project_id}/instances/{instance_id}"))
187 /// .send().await?;
188 /// println!("response {:?}", response);
189 /// Ok(())
190 /// }
191 /// ```
192 pub fn get_instance(&self) -> super::builder::bigtable_instance_admin::GetInstance {
193 super::builder::bigtable_instance_admin::GetInstance::new(self.inner.clone())
194 }
195
196 /// Lists information about instances in a project.
197 ///
198 /// # Example
199 /// ```
200 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
201 /// use google_cloud_bigtable_admin_v2::Result;
202 /// async fn sample(
203 /// client: &BigtableInstanceAdmin
204 /// ) -> Result<()> {
205 /// let response = client.list_instances()
206 /// /* set fields */
207 /// .send().await?;
208 /// println!("response {:?}", response);
209 /// Ok(())
210 /// }
211 /// ```
212 pub fn list_instances(&self) -> super::builder::bigtable_instance_admin::ListInstances {
213 super::builder::bigtable_instance_admin::ListInstances::new(self.inner.clone())
214 }
215
216 /// Updates an instance within a project. This method updates only the display
217 /// name and type for an Instance. To update other Instance properties, such as
218 /// labels, use PartialUpdateInstance.
219 ///
220 /// # Example
221 /// ```
222 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
223 /// use google_cloud_bigtable_admin_v2::Result;
224 /// async fn sample(
225 /// client: &BigtableInstanceAdmin
226 /// ) -> Result<()> {
227 /// let response = client.update_instance()
228 /// /* set fields */
229 /// .send().await?;
230 /// println!("response {:?}", response);
231 /// Ok(())
232 /// }
233 /// ```
234 pub fn update_instance(&self) -> super::builder::bigtable_instance_admin::UpdateInstance {
235 super::builder::bigtable_instance_admin::UpdateInstance::new(self.inner.clone())
236 }
237
238 /// Partially updates an instance within a project. This method can modify all
239 /// fields of an Instance and is the preferred way to update an Instance.
240 ///
241 /// # Long running operations
242 ///
243 /// This method is used to start, and/or poll a [long-running Operation].
244 /// The [Working with long-running operations] chapter in the [user guide]
245 /// covers these operations in detail.
246 ///
247 /// [long-running operation]: https://google.aip.dev/151
248 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
249 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
250 ///
251 /// # Example
252 /// ```
253 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
254 /// use google_cloud_lro::Poller;
255 /// use google_cloud_bigtable_admin_v2::Result;
256 /// async fn sample(
257 /// client: &BigtableInstanceAdmin
258 /// ) -> Result<()> {
259 /// let response = client.partial_update_instance()
260 /// /* set fields */
261 /// .poller().until_done().await?;
262 /// println!("response {:?}", response);
263 /// Ok(())
264 /// }
265 /// ```
266 pub fn partial_update_instance(
267 &self,
268 ) -> super::builder::bigtable_instance_admin::PartialUpdateInstance {
269 super::builder::bigtable_instance_admin::PartialUpdateInstance::new(self.inner.clone())
270 }
271
272 /// Delete an instance from a project.
273 ///
274 /// # Example
275 /// ```
276 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
277 /// use google_cloud_bigtable_admin_v2::Result;
278 /// async fn sample(
279 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
280 /// ) -> Result<()> {
281 /// client.delete_instance()
282 /// .set_name(format!("projects/{project_id}/instances/{instance_id}"))
283 /// .send().await?;
284 /// Ok(())
285 /// }
286 /// ```
287 pub fn delete_instance(&self) -> super::builder::bigtable_instance_admin::DeleteInstance {
288 super::builder::bigtable_instance_admin::DeleteInstance::new(self.inner.clone())
289 }
290
291 /// Creates a cluster within an instance.
292 ///
293 /// Note that exactly one of Cluster.serve_nodes and
294 /// Cluster.cluster_config.cluster_autoscaling_config can be set. If
295 /// serve_nodes is set to non-zero, then the cluster is manually scaled. If
296 /// cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
297 /// enabled.
298 ///
299 /// # Long running operations
300 ///
301 /// This method is used to start, and/or poll a [long-running Operation].
302 /// The [Working with long-running operations] chapter in the [user guide]
303 /// covers these operations in detail.
304 ///
305 /// [long-running operation]: https://google.aip.dev/151
306 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
307 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
308 ///
309 /// # Example
310 /// ```
311 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
312 /// use google_cloud_lro::Poller;
313 /// use google_cloud_bigtable_admin_v2::model::Cluster;
314 /// use google_cloud_bigtable_admin_v2::Result;
315 /// async fn sample(
316 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
317 /// ) -> Result<()> {
318 /// let response = client.create_cluster()
319 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
320 /// .set_cluster_id("cluster_id_value")
321 /// .set_cluster(
322 /// Cluster::new()/* set fields */
323 /// )
324 /// .poller().until_done().await?;
325 /// println!("response {:?}", response);
326 /// Ok(())
327 /// }
328 /// ```
329 pub fn create_cluster(&self) -> super::builder::bigtable_instance_admin::CreateCluster {
330 super::builder::bigtable_instance_admin::CreateCluster::new(self.inner.clone())
331 }
332
333 /// Gets information about a cluster.
334 ///
335 /// # Example
336 /// ```
337 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
338 /// use google_cloud_bigtable_admin_v2::Result;
339 /// async fn sample(
340 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, cluster_id: &str
341 /// ) -> Result<()> {
342 /// let response = client.get_cluster()
343 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"))
344 /// .send().await?;
345 /// println!("response {:?}", response);
346 /// Ok(())
347 /// }
348 /// ```
349 pub fn get_cluster(&self) -> super::builder::bigtable_instance_admin::GetCluster {
350 super::builder::bigtable_instance_admin::GetCluster::new(self.inner.clone())
351 }
352
353 /// Lists information about clusters in an instance.
354 ///
355 /// # Example
356 /// ```
357 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
358 /// use google_cloud_bigtable_admin_v2::Result;
359 /// async fn sample(
360 /// client: &BigtableInstanceAdmin
361 /// ) -> Result<()> {
362 /// let response = client.list_clusters()
363 /// /* set fields */
364 /// .send().await?;
365 /// println!("response {:?}", response);
366 /// Ok(())
367 /// }
368 /// ```
369 pub fn list_clusters(&self) -> super::builder::bigtable_instance_admin::ListClusters {
370 super::builder::bigtable_instance_admin::ListClusters::new(self.inner.clone())
371 }
372
373 /// Updates a cluster within an instance.
374 ///
375 /// Note that UpdateCluster does not support updating
376 /// cluster_config.cluster_autoscaling_config. In order to update it, you
377 /// must use PartialUpdateCluster.
378 ///
379 /// # Long running operations
380 ///
381 /// This method is used to start, and/or poll a [long-running Operation].
382 /// The [Working with long-running operations] chapter in the [user guide]
383 /// covers these operations in detail.
384 ///
385 /// [long-running operation]: https://google.aip.dev/151
386 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
387 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
388 ///
389 /// # Example
390 /// ```
391 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
392 /// use google_cloud_lro::Poller;
393 /// use google_cloud_bigtable_admin_v2::Result;
394 /// async fn sample(
395 /// client: &BigtableInstanceAdmin
396 /// ) -> Result<()> {
397 /// let response = client.update_cluster()
398 /// /* set fields */
399 /// .poller().until_done().await?;
400 /// println!("response {:?}", response);
401 /// Ok(())
402 /// }
403 /// ```
404 pub fn update_cluster(&self) -> super::builder::bigtable_instance_admin::UpdateCluster {
405 super::builder::bigtable_instance_admin::UpdateCluster::new(self.inner.clone())
406 }
407
408 /// Partially updates a cluster within a project. This method is the preferred
409 /// way to update a Cluster.
410 ///
411 /// To enable and update autoscaling, set
412 /// cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
413 /// serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
414 /// are ignored. Note that an update cannot simultaneously set serve_nodes to
415 /// non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
416 /// also specify both in the update_mask.
417 ///
418 /// To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
419 /// and explicitly set a serve_node count via the update_mask.
420 ///
421 /// # Long running operations
422 ///
423 /// This method is used to start, and/or poll a [long-running Operation].
424 /// The [Working with long-running operations] chapter in the [user guide]
425 /// covers these operations in detail.
426 ///
427 /// [long-running operation]: https://google.aip.dev/151
428 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
429 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
430 ///
431 /// # Example
432 /// ```
433 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
434 /// use google_cloud_lro::Poller;
435 /// use google_cloud_bigtable_admin_v2::Result;
436 /// async fn sample(
437 /// client: &BigtableInstanceAdmin
438 /// ) -> Result<()> {
439 /// let response = client.partial_update_cluster()
440 /// /* set fields */
441 /// .poller().until_done().await?;
442 /// println!("response {:?}", response);
443 /// Ok(())
444 /// }
445 /// ```
446 pub fn partial_update_cluster(
447 &self,
448 ) -> super::builder::bigtable_instance_admin::PartialUpdateCluster {
449 super::builder::bigtable_instance_admin::PartialUpdateCluster::new(self.inner.clone())
450 }
451
452 /// Deletes a cluster from an instance.
453 ///
454 /// # Example
455 /// ```
456 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
457 /// use google_cloud_bigtable_admin_v2::Result;
458 /// async fn sample(
459 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, cluster_id: &str
460 /// ) -> Result<()> {
461 /// client.delete_cluster()
462 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"))
463 /// .send().await?;
464 /// Ok(())
465 /// }
466 /// ```
467 pub fn delete_cluster(&self) -> super::builder::bigtable_instance_admin::DeleteCluster {
468 super::builder::bigtable_instance_admin::DeleteCluster::new(self.inner.clone())
469 }
470
471 /// Creates an app profile within an instance.
472 ///
473 /// # Example
474 /// ```
475 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
476 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
477 /// use google_cloud_bigtable_admin_v2::Result;
478 /// async fn sample(
479 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
480 /// ) -> Result<()> {
481 /// let response = client.create_app_profile()
482 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
483 /// .set_app_profile(
484 /// AppProfile::new()/* set fields */
485 /// )
486 /// .send().await?;
487 /// println!("response {:?}", response);
488 /// Ok(())
489 /// }
490 /// ```
491 pub fn create_app_profile(&self) -> super::builder::bigtable_instance_admin::CreateAppProfile {
492 super::builder::bigtable_instance_admin::CreateAppProfile::new(self.inner.clone())
493 }
494
495 /// Gets information about an app profile.
496 ///
497 /// # Example
498 /// ```
499 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
500 /// use google_cloud_bigtable_admin_v2::Result;
501 /// async fn sample(
502 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, app_profile_id: &str
503 /// ) -> Result<()> {
504 /// let response = client.get_app_profile()
505 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/appProfiles/{app_profile_id}"))
506 /// .send().await?;
507 /// println!("response {:?}", response);
508 /// Ok(())
509 /// }
510 /// ```
511 pub fn get_app_profile(&self) -> super::builder::bigtable_instance_admin::GetAppProfile {
512 super::builder::bigtable_instance_admin::GetAppProfile::new(self.inner.clone())
513 }
514
515 /// Lists information about app profiles in an instance.
516 ///
517 /// # Example
518 /// ```
519 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
520 /// use google_cloud_gax::paginator::ItemPaginator as _;
521 /// use google_cloud_bigtable_admin_v2::Result;
522 /// async fn sample(
523 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
524 /// ) -> Result<()> {
525 /// let mut list = client.list_app_profiles()
526 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
527 /// .by_item();
528 /// while let Some(item) = list.next().await.transpose()? {
529 /// println!("{:?}", item);
530 /// }
531 /// Ok(())
532 /// }
533 /// ```
534 pub fn list_app_profiles(&self) -> super::builder::bigtable_instance_admin::ListAppProfiles {
535 super::builder::bigtable_instance_admin::ListAppProfiles::new(self.inner.clone())
536 }
537
538 /// Updates an app profile within an instance.
539 ///
540 /// # Long running operations
541 ///
542 /// This method is used to start, and/or poll a [long-running Operation].
543 /// The [Working with long-running operations] chapter in the [user guide]
544 /// covers these operations in detail.
545 ///
546 /// [long-running operation]: https://google.aip.dev/151
547 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
548 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
549 ///
550 /// # Example
551 /// ```
552 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
553 /// use google_cloud_lro::Poller;
554 /// # extern crate wkt as google_cloud_wkt;
555 /// use google_cloud_wkt::FieldMask;
556 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
557 /// use google_cloud_bigtable_admin_v2::Result;
558 /// async fn sample(
559 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, app_profile_id: &str
560 /// ) -> Result<()> {
561 /// let response = client.update_app_profile()
562 /// .set_app_profile(
563 /// AppProfile::new().set_name(format!("projects/{project_id}/instances/{instance_id}/appProfiles/{app_profile_id}"))/* set fields */
564 /// )
565 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
566 /// .poller().until_done().await?;
567 /// println!("response {:?}", response);
568 /// Ok(())
569 /// }
570 /// ```
571 pub fn update_app_profile(&self) -> super::builder::bigtable_instance_admin::UpdateAppProfile {
572 super::builder::bigtable_instance_admin::UpdateAppProfile::new(self.inner.clone())
573 }
574
575 /// Deletes an app profile from an instance.
576 ///
577 /// # Example
578 /// ```
579 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
580 /// use google_cloud_bigtable_admin_v2::Result;
581 /// async fn sample(
582 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, app_profile_id: &str
583 /// ) -> Result<()> {
584 /// client.delete_app_profile()
585 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/appProfiles/{app_profile_id}"))
586 /// .send().await?;
587 /// Ok(())
588 /// }
589 /// ```
590 pub fn delete_app_profile(&self) -> super::builder::bigtable_instance_admin::DeleteAppProfile {
591 super::builder::bigtable_instance_admin::DeleteAppProfile::new(self.inner.clone())
592 }
593
594 /// Gets the access control policy for an instance resource. Returns an empty
595 /// policy if an instance exists but does not have a policy set.
596 ///
597 /// # Example
598 /// ```
599 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
600 /// use google_cloud_bigtable_admin_v2::Result;
601 /// async fn sample(
602 /// client: &BigtableInstanceAdmin
603 /// ) -> Result<()> {
604 /// let response = client.get_iam_policy()
605 /// /* set fields */
606 /// .send().await?;
607 /// println!("response {:?}", response);
608 /// Ok(())
609 /// }
610 /// ```
611 pub fn get_iam_policy(&self) -> super::builder::bigtable_instance_admin::GetIamPolicy {
612 super::builder::bigtable_instance_admin::GetIamPolicy::new(self.inner.clone())
613 }
614
615 /// Sets the access control policy on an instance resource. Replaces any
616 /// existing policy.
617 ///
618 /// # Example
619 /// ```
620 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
621 /// use google_cloud_bigtable_admin_v2::Result;
622 /// async fn sample(
623 /// client: &BigtableInstanceAdmin
624 /// ) -> Result<()> {
625 /// let response = client.set_iam_policy()
626 /// /* set fields */
627 /// .send().await?;
628 /// println!("response {:?}", response);
629 /// Ok(())
630 /// }
631 /// ```
632 pub fn set_iam_policy(&self) -> super::builder::bigtable_instance_admin::SetIamPolicy {
633 super::builder::bigtable_instance_admin::SetIamPolicy::new(self.inner.clone())
634 }
635
636 /// Returns permissions that the caller has on the specified instance resource.
637 ///
638 /// # Example
639 /// ```
640 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
641 /// use google_cloud_bigtable_admin_v2::Result;
642 /// async fn sample(
643 /// client: &BigtableInstanceAdmin
644 /// ) -> Result<()> {
645 /// let response = client.test_iam_permissions()
646 /// /* set fields */
647 /// .send().await?;
648 /// println!("response {:?}", response);
649 /// Ok(())
650 /// }
651 /// ```
652 pub fn test_iam_permissions(
653 &self,
654 ) -> super::builder::bigtable_instance_admin::TestIamPermissions {
655 super::builder::bigtable_instance_admin::TestIamPermissions::new(self.inner.clone())
656 }
657
658 /// Lists hot tablets in a cluster, within the time range provided. Hot
659 /// tablets are ordered based on CPU usage.
660 ///
661 /// # Example
662 /// ```
663 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
664 /// use google_cloud_gax::paginator::ItemPaginator as _;
665 /// use google_cloud_bigtable_admin_v2::Result;
666 /// async fn sample(
667 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, cluster_id: &str
668 /// ) -> Result<()> {
669 /// let mut list = client.list_hot_tablets()
670 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"))
671 /// .by_item();
672 /// while let Some(item) = list.next().await.transpose()? {
673 /// println!("{:?}", item);
674 /// }
675 /// Ok(())
676 /// }
677 /// ```
678 pub fn list_hot_tablets(&self) -> super::builder::bigtable_instance_admin::ListHotTablets {
679 super::builder::bigtable_instance_admin::ListHotTablets::new(self.inner.clone())
680 }
681
682 /// Creates a logical view within an instance.
683 ///
684 /// # Long running operations
685 ///
686 /// This method is used to start, and/or poll a [long-running Operation].
687 /// The [Working with long-running operations] chapter in the [user guide]
688 /// covers these operations in detail.
689 ///
690 /// [long-running operation]: https://google.aip.dev/151
691 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
692 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
693 ///
694 /// # Example
695 /// ```
696 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
697 /// use google_cloud_lro::Poller;
698 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
699 /// use google_cloud_bigtable_admin_v2::Result;
700 /// async fn sample(
701 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
702 /// ) -> Result<()> {
703 /// let response = client.create_logical_view()
704 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
705 /// .set_logical_view(
706 /// LogicalView::new()/* set fields */
707 /// )
708 /// .poller().until_done().await?;
709 /// println!("response {:?}", response);
710 /// Ok(())
711 /// }
712 /// ```
713 pub fn create_logical_view(
714 &self,
715 ) -> super::builder::bigtable_instance_admin::CreateLogicalView {
716 super::builder::bigtable_instance_admin::CreateLogicalView::new(self.inner.clone())
717 }
718
719 /// Gets information about a logical view.
720 ///
721 /// # Example
722 /// ```
723 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
724 /// use google_cloud_bigtable_admin_v2::Result;
725 /// async fn sample(
726 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, logical_view_id: &str
727 /// ) -> Result<()> {
728 /// let response = client.get_logical_view()
729 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/logicalViews/{logical_view_id}"))
730 /// .send().await?;
731 /// println!("response {:?}", response);
732 /// Ok(())
733 /// }
734 /// ```
735 pub fn get_logical_view(&self) -> super::builder::bigtable_instance_admin::GetLogicalView {
736 super::builder::bigtable_instance_admin::GetLogicalView::new(self.inner.clone())
737 }
738
739 /// Lists information about logical views in an instance.
740 ///
741 /// # Example
742 /// ```
743 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
744 /// use google_cloud_gax::paginator::ItemPaginator as _;
745 /// use google_cloud_bigtable_admin_v2::Result;
746 /// async fn sample(
747 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
748 /// ) -> Result<()> {
749 /// let mut list = client.list_logical_views()
750 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
751 /// .by_item();
752 /// while let Some(item) = list.next().await.transpose()? {
753 /// println!("{:?}", item);
754 /// }
755 /// Ok(())
756 /// }
757 /// ```
758 pub fn list_logical_views(&self) -> super::builder::bigtable_instance_admin::ListLogicalViews {
759 super::builder::bigtable_instance_admin::ListLogicalViews::new(self.inner.clone())
760 }
761
762 /// Updates a logical view within an instance.
763 ///
764 /// # Long running operations
765 ///
766 /// This method is used to start, and/or poll a [long-running Operation].
767 /// The [Working with long-running operations] chapter in the [user guide]
768 /// covers these operations in detail.
769 ///
770 /// [long-running operation]: https://google.aip.dev/151
771 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
772 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
773 ///
774 /// # Example
775 /// ```
776 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
777 /// use google_cloud_lro::Poller;
778 /// # extern crate wkt as google_cloud_wkt;
779 /// use google_cloud_wkt::FieldMask;
780 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
781 /// use google_cloud_bigtable_admin_v2::Result;
782 /// async fn sample(
783 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, logical_view_id: &str
784 /// ) -> Result<()> {
785 /// let response = client.update_logical_view()
786 /// .set_logical_view(
787 /// LogicalView::new().set_name(format!("projects/{project_id}/instances/{instance_id}/logicalViews/{logical_view_id}"))/* set fields */
788 /// )
789 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
790 /// .poller().until_done().await?;
791 /// println!("response {:?}", response);
792 /// Ok(())
793 /// }
794 /// ```
795 pub fn update_logical_view(
796 &self,
797 ) -> super::builder::bigtable_instance_admin::UpdateLogicalView {
798 super::builder::bigtable_instance_admin::UpdateLogicalView::new(self.inner.clone())
799 }
800
801 /// Deletes a logical view from an instance.
802 ///
803 /// # Example
804 /// ```
805 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
806 /// use google_cloud_bigtable_admin_v2::Result;
807 /// async fn sample(
808 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, logical_view_id: &str
809 /// ) -> Result<()> {
810 /// client.delete_logical_view()
811 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/logicalViews/{logical_view_id}"))
812 /// .send().await?;
813 /// Ok(())
814 /// }
815 /// ```
816 pub fn delete_logical_view(
817 &self,
818 ) -> super::builder::bigtable_instance_admin::DeleteLogicalView {
819 super::builder::bigtable_instance_admin::DeleteLogicalView::new(self.inner.clone())
820 }
821
822 /// Creates a materialized view within an instance.
823 ///
824 /// # Long running operations
825 ///
826 /// This method is used to start, and/or poll a [long-running Operation].
827 /// The [Working with long-running operations] chapter in the [user guide]
828 /// covers these operations in detail.
829 ///
830 /// [long-running operation]: https://google.aip.dev/151
831 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
832 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
833 ///
834 /// # Example
835 /// ```
836 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
837 /// use google_cloud_lro::Poller;
838 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
839 /// use google_cloud_bigtable_admin_v2::Result;
840 /// async fn sample(
841 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
842 /// ) -> Result<()> {
843 /// let response = client.create_materialized_view()
844 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
845 /// .set_materialized_view(
846 /// MaterializedView::new()/* set fields */
847 /// )
848 /// .poller().until_done().await?;
849 /// println!("response {:?}", response);
850 /// Ok(())
851 /// }
852 /// ```
853 pub fn create_materialized_view(
854 &self,
855 ) -> super::builder::bigtable_instance_admin::CreateMaterializedView {
856 super::builder::bigtable_instance_admin::CreateMaterializedView::new(self.inner.clone())
857 }
858
859 /// Gets information about a materialized view.
860 ///
861 /// # Example
862 /// ```
863 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
864 /// use google_cloud_bigtable_admin_v2::Result;
865 /// async fn sample(
866 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, materialized_view_id: &str
867 /// ) -> Result<()> {
868 /// let response = client.get_materialized_view()
869 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/materializedViews/{materialized_view_id}"))
870 /// .send().await?;
871 /// println!("response {:?}", response);
872 /// Ok(())
873 /// }
874 /// ```
875 pub fn get_materialized_view(
876 &self,
877 ) -> super::builder::bigtable_instance_admin::GetMaterializedView {
878 super::builder::bigtable_instance_admin::GetMaterializedView::new(self.inner.clone())
879 }
880
881 /// Lists information about materialized views in an instance.
882 ///
883 /// # Example
884 /// ```
885 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
886 /// use google_cloud_gax::paginator::ItemPaginator as _;
887 /// use google_cloud_bigtable_admin_v2::Result;
888 /// async fn sample(
889 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str
890 /// ) -> Result<()> {
891 /// let mut list = client.list_materialized_views()
892 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
893 /// .by_item();
894 /// while let Some(item) = list.next().await.transpose()? {
895 /// println!("{:?}", item);
896 /// }
897 /// Ok(())
898 /// }
899 /// ```
900 pub fn list_materialized_views(
901 &self,
902 ) -> super::builder::bigtable_instance_admin::ListMaterializedViews {
903 super::builder::bigtable_instance_admin::ListMaterializedViews::new(self.inner.clone())
904 }
905
906 /// Updates a materialized view within an instance.
907 ///
908 /// # Long running operations
909 ///
910 /// This method is used to start, and/or poll a [long-running Operation].
911 /// The [Working with long-running operations] chapter in the [user guide]
912 /// covers these operations in detail.
913 ///
914 /// [long-running operation]: https://google.aip.dev/151
915 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
916 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
917 ///
918 /// # Example
919 /// ```
920 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
921 /// use google_cloud_lro::Poller;
922 /// # extern crate wkt as google_cloud_wkt;
923 /// use google_cloud_wkt::FieldMask;
924 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
925 /// use google_cloud_bigtable_admin_v2::Result;
926 /// async fn sample(
927 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, materialized_view_id: &str
928 /// ) -> Result<()> {
929 /// let response = client.update_materialized_view()
930 /// .set_materialized_view(
931 /// MaterializedView::new().set_name(format!("projects/{project_id}/instances/{instance_id}/materializedViews/{materialized_view_id}"))/* set fields */
932 /// )
933 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
934 /// .poller().until_done().await?;
935 /// println!("response {:?}", response);
936 /// Ok(())
937 /// }
938 /// ```
939 pub fn update_materialized_view(
940 &self,
941 ) -> super::builder::bigtable_instance_admin::UpdateMaterializedView {
942 super::builder::bigtable_instance_admin::UpdateMaterializedView::new(self.inner.clone())
943 }
944
945 /// Deletes a materialized view from an instance.
946 ///
947 /// # Example
948 /// ```
949 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
950 /// use google_cloud_bigtable_admin_v2::Result;
951 /// async fn sample(
952 /// client: &BigtableInstanceAdmin, project_id: &str, instance_id: &str, materialized_view_id: &str
953 /// ) -> Result<()> {
954 /// client.delete_materialized_view()
955 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/materializedViews/{materialized_view_id}"))
956 /// .send().await?;
957 /// Ok(())
958 /// }
959 /// ```
960 pub fn delete_materialized_view(
961 &self,
962 ) -> super::builder::bigtable_instance_admin::DeleteMaterializedView {
963 super::builder::bigtable_instance_admin::DeleteMaterializedView::new(self.inner.clone())
964 }
965
966 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
967 ///
968 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
969 ///
970 /// # Example
971 /// ```
972 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
973 /// use google_cloud_gax::paginator::ItemPaginator as _;
974 /// use google_cloud_bigtable_admin_v2::Result;
975 /// async fn sample(
976 /// client: &BigtableInstanceAdmin
977 /// ) -> Result<()> {
978 /// let mut list = client.list_operations()
979 /// /* set fields */
980 /// .by_item();
981 /// while let Some(item) = list.next().await.transpose()? {
982 /// println!("{:?}", item);
983 /// }
984 /// Ok(())
985 /// }
986 /// ```
987 pub fn list_operations(&self) -> super::builder::bigtable_instance_admin::ListOperations {
988 super::builder::bigtable_instance_admin::ListOperations::new(self.inner.clone())
989 }
990
991 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
992 ///
993 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
994 ///
995 /// # Example
996 /// ```
997 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
998 /// use google_cloud_bigtable_admin_v2::Result;
999 /// async fn sample(
1000 /// client: &BigtableInstanceAdmin
1001 /// ) -> Result<()> {
1002 /// let response = client.get_operation()
1003 /// /* set fields */
1004 /// .send().await?;
1005 /// println!("response {:?}", response);
1006 /// Ok(())
1007 /// }
1008 /// ```
1009 pub fn get_operation(&self) -> super::builder::bigtable_instance_admin::GetOperation {
1010 super::builder::bigtable_instance_admin::GetOperation::new(self.inner.clone())
1011 }
1012
1013 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1014 ///
1015 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1016 ///
1017 /// # Example
1018 /// ```
1019 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
1020 /// use google_cloud_bigtable_admin_v2::Result;
1021 /// async fn sample(
1022 /// client: &BigtableInstanceAdmin
1023 /// ) -> Result<()> {
1024 /// client.delete_operation()
1025 /// /* set fields */
1026 /// .send().await?;
1027 /// Ok(())
1028 /// }
1029 /// ```
1030 pub fn delete_operation(&self) -> super::builder::bigtable_instance_admin::DeleteOperation {
1031 super::builder::bigtable_instance_admin::DeleteOperation::new(self.inner.clone())
1032 }
1033
1034 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1035 ///
1036 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1037 ///
1038 /// # Example
1039 /// ```
1040 /// # use google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin;
1041 /// use google_cloud_bigtable_admin_v2::Result;
1042 /// async fn sample(
1043 /// client: &BigtableInstanceAdmin
1044 /// ) -> Result<()> {
1045 /// client.cancel_operation()
1046 /// /* set fields */
1047 /// .send().await?;
1048 /// Ok(())
1049 /// }
1050 /// ```
1051 pub fn cancel_operation(&self) -> super::builder::bigtable_instance_admin::CancelOperation {
1052 super::builder::bigtable_instance_admin::CancelOperation::new(self.inner.clone())
1053 }
1054}
1055
1056/// Implements a client for the Cloud Bigtable Admin API.
1057///
1058/// # Example
1059/// ```
1060/// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1061/// use google_cloud_gax::paginator::ItemPaginator as _;
1062/// async fn sample(
1063/// project_id: &str,
1064/// instance_id: &str,
1065/// ) -> anyhow::Result<()> {
1066/// let client = BigtableTableAdmin::builder().build().await?;
1067/// let mut list = client.list_tables()
1068/// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
1069/// .by_item();
1070/// while let Some(item) = list.next().await.transpose()? {
1071/// println!("{:?}", item);
1072/// }
1073/// Ok(())
1074/// }
1075/// ```
1076///
1077/// # Service Description
1078///
1079/// Service for creating, configuring, and deleting Cloud Bigtable tables.
1080///
1081/// Provides access to the table schemas only, not the data stored within
1082/// the tables.
1083///
1084/// # Configuration
1085///
1086/// To configure `BigtableTableAdmin` use the `with_*` methods in the type returned
1087/// by [builder()][BigtableTableAdmin::builder]. The default configuration should
1088/// work for most applications. Common configuration changes include
1089///
1090/// * [with_endpoint()]: by default this client uses the global default endpoint
1091/// (`https://bigtableadmin.googleapis.com`). Applications using regional
1092/// endpoints or running in restricted networks (e.g. a network configured
1093/// with [Private Google Access with VPC Service Controls]) may want to
1094/// override this default.
1095/// * [with_credentials()]: by default this client uses
1096/// [Application Default Credentials]. Applications using custom
1097/// authentication may need to override this default.
1098///
1099/// [with_endpoint()]: super::builder::bigtable_table_admin::ClientBuilder::with_endpoint
1100/// [with_credentials()]: super::builder::bigtable_table_admin::ClientBuilder::with_credentials
1101/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1102/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1103///
1104/// # Pooling and Cloning
1105///
1106/// `BigtableTableAdmin` holds a connection pool internally, it is advised to
1107/// create one and reuse it. You do not need to wrap `BigtableTableAdmin` in
1108/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1109/// already uses an `Arc` internally.
1110#[derive(Clone, Debug)]
1111pub struct BigtableTableAdmin {
1112 inner: std::sync::Arc<dyn super::stub::dynamic::BigtableTableAdmin>,
1113}
1114
1115impl BigtableTableAdmin {
1116 /// Returns a builder for [BigtableTableAdmin].
1117 ///
1118 /// ```
1119 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1120 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1121 /// let client = BigtableTableAdmin::builder().build().await?;
1122 /// # Ok(()) }
1123 /// ```
1124 pub fn builder() -> super::builder::bigtable_table_admin::ClientBuilder {
1125 crate::new_client_builder(super::builder::bigtable_table_admin::client::Factory)
1126 }
1127
1128 /// Creates a new client from the provided stub.
1129 ///
1130 /// The most common case for calling this function is in tests mocking the
1131 /// client's behavior.
1132 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1133 where
1134 T: super::stub::BigtableTableAdmin + 'static,
1135 {
1136 Self { inner: stub.into() }
1137 }
1138
1139 pub(crate) async fn new(
1140 config: gaxi::options::ClientConfig,
1141 ) -> crate::ClientBuilderResult<Self> {
1142 let inner = Self::build_inner(config).await?;
1143 Ok(Self { inner })
1144 }
1145
1146 async fn build_inner(
1147 conf: gaxi::options::ClientConfig,
1148 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BigtableTableAdmin>>
1149 {
1150 if gaxi::options::tracing_enabled(&conf) {
1151 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1152 }
1153 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1154 }
1155
1156 async fn build_transport(
1157 conf: gaxi::options::ClientConfig,
1158 ) -> crate::ClientBuilderResult<impl super::stub::BigtableTableAdmin> {
1159 super::transport::BigtableTableAdmin::new(conf).await
1160 }
1161
1162 async fn build_with_tracing(
1163 conf: gaxi::options::ClientConfig,
1164 ) -> crate::ClientBuilderResult<impl super::stub::BigtableTableAdmin> {
1165 Self::build_transport(conf)
1166 .await
1167 .map(super::tracing::BigtableTableAdmin::new)
1168 }
1169
1170 /// Creates a new table in the specified instance.
1171 /// The table can be created with a full set of initial column families,
1172 /// specified in the request.
1173 ///
1174 /// # Example
1175 /// ```
1176 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1177 /// use google_cloud_bigtable_admin_v2::model::Table;
1178 /// use google_cloud_bigtable_admin_v2::Result;
1179 /// async fn sample(
1180 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str
1181 /// ) -> Result<()> {
1182 /// let response = client.create_table()
1183 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
1184 /// .set_table_id("table_id_value")
1185 /// .set_table(
1186 /// Table::new()/* set fields */
1187 /// )
1188 /// .send().await?;
1189 /// println!("response {:?}", response);
1190 /// Ok(())
1191 /// }
1192 /// ```
1193 pub fn create_table(&self) -> super::builder::bigtable_table_admin::CreateTable {
1194 super::builder::bigtable_table_admin::CreateTable::new(self.inner.clone())
1195 }
1196
1197 /// Creates a new table from the specified snapshot. The target table must
1198 /// not exist. The snapshot and the table must be in the same instance.
1199 ///
1200 /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
1201 /// feature is not currently available to most Cloud Bigtable customers. This
1202 /// feature might be changed in backward-incompatible ways and is not
1203 /// recommended for production use. It is not subject to any SLA or deprecation
1204 /// policy.
1205 ///
1206 /// # Long running operations
1207 ///
1208 /// This method is used to start, and/or poll a [long-running Operation].
1209 /// The [Working with long-running operations] chapter in the [user guide]
1210 /// covers these operations in detail.
1211 ///
1212 /// [long-running operation]: https://google.aip.dev/151
1213 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1214 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1215 ///
1216 /// # Example
1217 /// ```
1218 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1219 /// use google_cloud_lro::Poller;
1220 /// use google_cloud_bigtable_admin_v2::Result;
1221 /// async fn sample(
1222 /// client: &BigtableTableAdmin
1223 /// ) -> Result<()> {
1224 /// let response = client.create_table_from_snapshot()
1225 /// /* set fields */
1226 /// .poller().until_done().await?;
1227 /// println!("response {:?}", response);
1228 /// Ok(())
1229 /// }
1230 /// ```
1231 pub fn create_table_from_snapshot(
1232 &self,
1233 ) -> super::builder::bigtable_table_admin::CreateTableFromSnapshot {
1234 super::builder::bigtable_table_admin::CreateTableFromSnapshot::new(self.inner.clone())
1235 }
1236
1237 /// Lists all tables served from a specified instance.
1238 ///
1239 /// # Example
1240 /// ```
1241 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1242 /// use google_cloud_gax::paginator::ItemPaginator as _;
1243 /// use google_cloud_bigtable_admin_v2::Result;
1244 /// async fn sample(
1245 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str
1246 /// ) -> Result<()> {
1247 /// let mut list = client.list_tables()
1248 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}"))
1249 /// .by_item();
1250 /// while let Some(item) = list.next().await.transpose()? {
1251 /// println!("{:?}", item);
1252 /// }
1253 /// Ok(())
1254 /// }
1255 /// ```
1256 pub fn list_tables(&self) -> super::builder::bigtable_table_admin::ListTables {
1257 super::builder::bigtable_table_admin::ListTables::new(self.inner.clone())
1258 }
1259
1260 /// Gets metadata information about the specified table.
1261 ///
1262 /// # Example
1263 /// ```
1264 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1265 /// use google_cloud_bigtable_admin_v2::Result;
1266 /// async fn sample(
1267 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str
1268 /// ) -> Result<()> {
1269 /// let response = client.get_table()
1270 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"))
1271 /// .send().await?;
1272 /// println!("response {:?}", response);
1273 /// Ok(())
1274 /// }
1275 /// ```
1276 pub fn get_table(&self) -> super::builder::bigtable_table_admin::GetTable {
1277 super::builder::bigtable_table_admin::GetTable::new(self.inner.clone())
1278 }
1279
1280 /// Updates a specified table.
1281 ///
1282 /// # Long running operations
1283 ///
1284 /// This method is used to start, and/or poll a [long-running Operation].
1285 /// The [Working with long-running operations] chapter in the [user guide]
1286 /// covers these operations in detail.
1287 ///
1288 /// [long-running operation]: https://google.aip.dev/151
1289 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1290 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1291 ///
1292 /// # Example
1293 /// ```
1294 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1295 /// use google_cloud_lro::Poller;
1296 /// # extern crate wkt as google_cloud_wkt;
1297 /// use google_cloud_wkt::FieldMask;
1298 /// use google_cloud_bigtable_admin_v2::model::Table;
1299 /// use google_cloud_bigtable_admin_v2::Result;
1300 /// async fn sample(
1301 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str
1302 /// ) -> Result<()> {
1303 /// let response = client.update_table()
1304 /// .set_table(
1305 /// Table::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"))/* set fields */
1306 /// )
1307 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1308 /// .poller().until_done().await?;
1309 /// println!("response {:?}", response);
1310 /// Ok(())
1311 /// }
1312 /// ```
1313 pub fn update_table(&self) -> super::builder::bigtable_table_admin::UpdateTable {
1314 super::builder::bigtable_table_admin::UpdateTable::new(self.inner.clone())
1315 }
1316
1317 /// Permanently deletes a specified table and all of its data.
1318 ///
1319 /// # Example
1320 /// ```
1321 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1322 /// use google_cloud_bigtable_admin_v2::Result;
1323 /// async fn sample(
1324 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str
1325 /// ) -> Result<()> {
1326 /// client.delete_table()
1327 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"))
1328 /// .send().await?;
1329 /// Ok(())
1330 /// }
1331 /// ```
1332 pub fn delete_table(&self) -> super::builder::bigtable_table_admin::DeleteTable {
1333 super::builder::bigtable_table_admin::DeleteTable::new(self.inner.clone())
1334 }
1335
1336 /// Restores a specified table which was accidentally deleted.
1337 ///
1338 /// # Long running operations
1339 ///
1340 /// This method is used to start, and/or poll a [long-running Operation].
1341 /// The [Working with long-running operations] chapter in the [user guide]
1342 /// covers these operations in detail.
1343 ///
1344 /// [long-running operation]: https://google.aip.dev/151
1345 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1346 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1347 ///
1348 /// # Example
1349 /// ```
1350 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1351 /// use google_cloud_lro::Poller;
1352 /// use google_cloud_bigtable_admin_v2::Result;
1353 /// async fn sample(
1354 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str
1355 /// ) -> Result<()> {
1356 /// let response = client.undelete_table()
1357 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"))
1358 /// .poller().until_done().await?;
1359 /// println!("response {:?}", response);
1360 /// Ok(())
1361 /// }
1362 /// ```
1363 pub fn undelete_table(&self) -> super::builder::bigtable_table_admin::UndeleteTable {
1364 super::builder::bigtable_table_admin::UndeleteTable::new(self.inner.clone())
1365 }
1366
1367 /// Creates a new AuthorizedView in a table.
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 ///
1379 /// # Example
1380 /// ```
1381 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1382 /// use google_cloud_lro::Poller;
1383 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
1384 /// use google_cloud_bigtable_admin_v2::Result;
1385 /// async fn sample(
1386 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str
1387 /// ) -> Result<()> {
1388 /// let response = client.create_authorized_view()
1389 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"))
1390 /// .set_authorized_view(
1391 /// AuthorizedView::new()/* set fields */
1392 /// )
1393 /// .poller().until_done().await?;
1394 /// println!("response {:?}", response);
1395 /// Ok(())
1396 /// }
1397 /// ```
1398 pub fn create_authorized_view(
1399 &self,
1400 ) -> super::builder::bigtable_table_admin::CreateAuthorizedView {
1401 super::builder::bigtable_table_admin::CreateAuthorizedView::new(self.inner.clone())
1402 }
1403
1404 /// Lists all AuthorizedViews from a specific table.
1405 ///
1406 /// # Example
1407 /// ```
1408 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1409 /// use google_cloud_gax::paginator::ItemPaginator as _;
1410 /// use google_cloud_bigtable_admin_v2::Result;
1411 /// async fn sample(
1412 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str
1413 /// ) -> Result<()> {
1414 /// let mut list = client.list_authorized_views()
1415 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"))
1416 /// .by_item();
1417 /// while let Some(item) = list.next().await.transpose()? {
1418 /// println!("{:?}", item);
1419 /// }
1420 /// Ok(())
1421 /// }
1422 /// ```
1423 pub fn list_authorized_views(
1424 &self,
1425 ) -> super::builder::bigtable_table_admin::ListAuthorizedViews {
1426 super::builder::bigtable_table_admin::ListAuthorizedViews::new(self.inner.clone())
1427 }
1428
1429 /// Gets information from a specified AuthorizedView.
1430 ///
1431 /// # Example
1432 /// ```
1433 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1434 /// use google_cloud_bigtable_admin_v2::Result;
1435 /// async fn sample(
1436 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str, authorized_view_id: &str
1437 /// ) -> Result<()> {
1438 /// let response = client.get_authorized_view()
1439 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/authorizedViews/{authorized_view_id}"))
1440 /// .send().await?;
1441 /// println!("response {:?}", response);
1442 /// Ok(())
1443 /// }
1444 /// ```
1445 pub fn get_authorized_view(&self) -> super::builder::bigtable_table_admin::GetAuthorizedView {
1446 super::builder::bigtable_table_admin::GetAuthorizedView::new(self.inner.clone())
1447 }
1448
1449 /// Updates an AuthorizedView in a table.
1450 ///
1451 /// # Long running operations
1452 ///
1453 /// This method is used to start, and/or poll a [long-running Operation].
1454 /// The [Working with long-running operations] chapter in the [user guide]
1455 /// covers these operations in detail.
1456 ///
1457 /// [long-running operation]: https://google.aip.dev/151
1458 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1459 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1460 ///
1461 /// # Example
1462 /// ```
1463 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1464 /// use google_cloud_lro::Poller;
1465 /// # extern crate wkt as google_cloud_wkt;
1466 /// use google_cloud_wkt::FieldMask;
1467 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
1468 /// use google_cloud_bigtable_admin_v2::Result;
1469 /// async fn sample(
1470 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str, authorized_view_id: &str
1471 /// ) -> Result<()> {
1472 /// let response = client.update_authorized_view()
1473 /// .set_authorized_view(
1474 /// AuthorizedView::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/authorizedViews/{authorized_view_id}"))/* set fields */
1475 /// )
1476 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1477 /// .poller().until_done().await?;
1478 /// println!("response {:?}", response);
1479 /// Ok(())
1480 /// }
1481 /// ```
1482 pub fn update_authorized_view(
1483 &self,
1484 ) -> super::builder::bigtable_table_admin::UpdateAuthorizedView {
1485 super::builder::bigtable_table_admin::UpdateAuthorizedView::new(self.inner.clone())
1486 }
1487
1488 /// Permanently deletes a specified AuthorizedView.
1489 ///
1490 /// # Example
1491 /// ```
1492 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1493 /// use google_cloud_bigtable_admin_v2::Result;
1494 /// async fn sample(
1495 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str, authorized_view_id: &str
1496 /// ) -> Result<()> {
1497 /// client.delete_authorized_view()
1498 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/authorizedViews/{authorized_view_id}"))
1499 /// .send().await?;
1500 /// Ok(())
1501 /// }
1502 /// ```
1503 pub fn delete_authorized_view(
1504 &self,
1505 ) -> super::builder::bigtable_table_admin::DeleteAuthorizedView {
1506 super::builder::bigtable_table_admin::DeleteAuthorizedView::new(self.inner.clone())
1507 }
1508
1509 /// Performs a series of column family modifications on the specified table.
1510 /// Either all or none of the modifications will occur before this method
1511 /// returns, but data requests received prior to that point may see a table
1512 /// where only some modifications have taken effect.
1513 ///
1514 /// # Example
1515 /// ```
1516 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1517 /// use google_cloud_bigtable_admin_v2::Result;
1518 /// async fn sample(
1519 /// client: &BigtableTableAdmin
1520 /// ) -> Result<()> {
1521 /// let response = client.modify_column_families()
1522 /// /* set fields */
1523 /// .send().await?;
1524 /// println!("response {:?}", response);
1525 /// Ok(())
1526 /// }
1527 /// ```
1528 pub fn modify_column_families(
1529 &self,
1530 ) -> super::builder::bigtable_table_admin::ModifyColumnFamilies {
1531 super::builder::bigtable_table_admin::ModifyColumnFamilies::new(self.inner.clone())
1532 }
1533
1534 /// Permanently drop/delete a row range from a specified table. The request can
1535 /// specify whether to delete all rows in a table, or only those that match a
1536 /// particular prefix.
1537 ///
1538 /// # Example
1539 /// ```
1540 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1541 /// use google_cloud_bigtable_admin_v2::Result;
1542 /// async fn sample(
1543 /// client: &BigtableTableAdmin
1544 /// ) -> Result<()> {
1545 /// client.drop_row_range()
1546 /// /* set fields */
1547 /// .send().await?;
1548 /// Ok(())
1549 /// }
1550 /// ```
1551 pub fn drop_row_range(&self) -> super::builder::bigtable_table_admin::DropRowRange {
1552 super::builder::bigtable_table_admin::DropRowRange::new(self.inner.clone())
1553 }
1554
1555 /// Generates a consistency token for a Table, which can be used in
1556 /// CheckConsistency to check whether mutations to the table that finished
1557 /// before this call started have been replicated. The tokens will be available
1558 /// for 90 days.
1559 ///
1560 /// # Example
1561 /// ```
1562 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1563 /// use google_cloud_bigtable_admin_v2::Result;
1564 /// async fn sample(
1565 /// client: &BigtableTableAdmin
1566 /// ) -> Result<()> {
1567 /// let response = client.generate_consistency_token()
1568 /// /* set fields */
1569 /// .send().await?;
1570 /// println!("response {:?}", response);
1571 /// Ok(())
1572 /// }
1573 /// ```
1574 pub fn generate_consistency_token(
1575 &self,
1576 ) -> super::builder::bigtable_table_admin::GenerateConsistencyToken {
1577 super::builder::bigtable_table_admin::GenerateConsistencyToken::new(self.inner.clone())
1578 }
1579
1580 /// Checks replication consistency based on a consistency token, that is, if
1581 /// replication has caught up based on the conditions specified in the token
1582 /// and the check request.
1583 ///
1584 /// # Example
1585 /// ```
1586 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1587 /// use google_cloud_bigtable_admin_v2::Result;
1588 /// async fn sample(
1589 /// client: &BigtableTableAdmin
1590 /// ) -> Result<()> {
1591 /// let response = client.check_consistency()
1592 /// /* set fields */
1593 /// .send().await?;
1594 /// println!("response {:?}", response);
1595 /// Ok(())
1596 /// }
1597 /// ```
1598 pub fn check_consistency(&self) -> super::builder::bigtable_table_admin::CheckConsistency {
1599 super::builder::bigtable_table_admin::CheckConsistency::new(self.inner.clone())
1600 }
1601
1602 /// Creates a new snapshot in the specified cluster from the specified
1603 /// source table. The cluster and the table must be in the same instance.
1604 ///
1605 /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
1606 /// feature is not currently available to most Cloud Bigtable customers. This
1607 /// feature might be changed in backward-incompatible ways and is not
1608 /// recommended for production use. It is not subject to any SLA or deprecation
1609 /// policy.
1610 ///
1611 /// # Long running operations
1612 ///
1613 /// This method is used to start, and/or poll a [long-running Operation].
1614 /// The [Working with long-running operations] chapter in the [user guide]
1615 /// covers these operations in detail.
1616 ///
1617 /// [long-running operation]: https://google.aip.dev/151
1618 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1619 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1620 ///
1621 /// # Example
1622 /// ```
1623 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1624 /// use google_cloud_lro::Poller;
1625 /// use google_cloud_bigtable_admin_v2::Result;
1626 /// async fn sample(
1627 /// client: &BigtableTableAdmin
1628 /// ) -> Result<()> {
1629 /// let response = client.snapshot_table()
1630 /// /* set fields */
1631 /// .poller().until_done().await?;
1632 /// println!("response {:?}", response);
1633 /// Ok(())
1634 /// }
1635 /// ```
1636 pub fn snapshot_table(&self) -> super::builder::bigtable_table_admin::SnapshotTable {
1637 super::builder::bigtable_table_admin::SnapshotTable::new(self.inner.clone())
1638 }
1639
1640 /// Gets metadata information about the specified snapshot.
1641 ///
1642 /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
1643 /// feature is not currently available to most Cloud Bigtable customers. This
1644 /// feature might be changed in backward-incompatible ways and is not
1645 /// recommended for production use. It is not subject to any SLA or deprecation
1646 /// policy.
1647 ///
1648 /// # Example
1649 /// ```
1650 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1651 /// use google_cloud_bigtable_admin_v2::Result;
1652 /// async fn sample(
1653 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, cluster_id: &str, snapshot_id: &str
1654 /// ) -> Result<()> {
1655 /// let response = client.get_snapshot()
1656 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/snapshots/{snapshot_id}"))
1657 /// .send().await?;
1658 /// println!("response {:?}", response);
1659 /// Ok(())
1660 /// }
1661 /// ```
1662 pub fn get_snapshot(&self) -> super::builder::bigtable_table_admin::GetSnapshot {
1663 super::builder::bigtable_table_admin::GetSnapshot::new(self.inner.clone())
1664 }
1665
1666 /// Lists all snapshots associated with the specified cluster.
1667 ///
1668 /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
1669 /// feature is not currently available to most Cloud Bigtable customers. This
1670 /// feature might be changed in backward-incompatible ways and is not
1671 /// recommended for production use. It is not subject to any SLA or deprecation
1672 /// policy.
1673 ///
1674 /// # Example
1675 /// ```
1676 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1677 /// use google_cloud_gax::paginator::ItemPaginator as _;
1678 /// use google_cloud_bigtable_admin_v2::Result;
1679 /// async fn sample(
1680 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, cluster_id: &str
1681 /// ) -> Result<()> {
1682 /// let mut list = client.list_snapshots()
1683 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"))
1684 /// .by_item();
1685 /// while let Some(item) = list.next().await.transpose()? {
1686 /// println!("{:?}", item);
1687 /// }
1688 /// Ok(())
1689 /// }
1690 /// ```
1691 pub fn list_snapshots(&self) -> super::builder::bigtable_table_admin::ListSnapshots {
1692 super::builder::bigtable_table_admin::ListSnapshots::new(self.inner.clone())
1693 }
1694
1695 /// Permanently deletes the specified snapshot.
1696 ///
1697 /// Note: This is a private alpha release of Cloud Bigtable snapshots. This
1698 /// feature is not currently available to most Cloud Bigtable customers. This
1699 /// feature might be changed in backward-incompatible ways and is not
1700 /// recommended for production use. It is not subject to any SLA or deprecation
1701 /// policy.
1702 ///
1703 /// # Example
1704 /// ```
1705 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1706 /// use google_cloud_bigtable_admin_v2::Result;
1707 /// async fn sample(
1708 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, cluster_id: &str, snapshot_id: &str
1709 /// ) -> Result<()> {
1710 /// client.delete_snapshot()
1711 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/snapshots/{snapshot_id}"))
1712 /// .send().await?;
1713 /// Ok(())
1714 /// }
1715 /// ```
1716 pub fn delete_snapshot(&self) -> super::builder::bigtable_table_admin::DeleteSnapshot {
1717 super::builder::bigtable_table_admin::DeleteSnapshot::new(self.inner.clone())
1718 }
1719
1720 /// Starts creating a new Cloud Bigtable Backup. The returned backup
1721 /// [long-running operation][google.longrunning.Operation] can be used to
1722 /// track creation of the backup. The
1723 /// [metadata][google.longrunning.Operation.metadata] field type is
1724 /// [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
1725 /// [response][google.longrunning.Operation.response] field type is
1726 /// [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
1727 /// returned operation will stop the creation and delete the backup.
1728 ///
1729 /// [google.bigtable.admin.v2.Backup]: crate::model::Backup
1730 /// [google.bigtable.admin.v2.CreateBackupMetadata]: crate::model::CreateBackupMetadata
1731 /// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
1732 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
1733 /// [google.longrunning.Operation.response]: google_cloud_longrunning::model::Operation::result
1734 ///
1735 /// # Long running operations
1736 ///
1737 /// This method is used to start, and/or poll a [long-running Operation].
1738 /// The [Working with long-running operations] chapter in the [user guide]
1739 /// covers these operations in detail.
1740 ///
1741 /// [long-running operation]: https://google.aip.dev/151
1742 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1743 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1744 ///
1745 /// # Example
1746 /// ```
1747 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1748 /// use google_cloud_lro::Poller;
1749 /// use google_cloud_bigtable_admin_v2::model::Backup;
1750 /// use google_cloud_bigtable_admin_v2::Result;
1751 /// async fn sample(
1752 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, cluster_id: &str
1753 /// ) -> Result<()> {
1754 /// let response = client.create_backup()
1755 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"))
1756 /// .set_backup_id("backup_id_value")
1757 /// .set_backup(
1758 /// Backup::new()/* set fields */
1759 /// )
1760 /// .poller().until_done().await?;
1761 /// println!("response {:?}", response);
1762 /// Ok(())
1763 /// }
1764 /// ```
1765 pub fn create_backup(&self) -> super::builder::bigtable_table_admin::CreateBackup {
1766 super::builder::bigtable_table_admin::CreateBackup::new(self.inner.clone())
1767 }
1768
1769 /// Gets metadata on a pending or completed Cloud Bigtable Backup.
1770 ///
1771 /// # Example
1772 /// ```
1773 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1774 /// use google_cloud_bigtable_admin_v2::Result;
1775 /// async fn sample(
1776 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, cluster_id: &str, backup_id: &str
1777 /// ) -> Result<()> {
1778 /// let response = client.get_backup()
1779 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"))
1780 /// .send().await?;
1781 /// println!("response {:?}", response);
1782 /// Ok(())
1783 /// }
1784 /// ```
1785 pub fn get_backup(&self) -> super::builder::bigtable_table_admin::GetBackup {
1786 super::builder::bigtable_table_admin::GetBackup::new(self.inner.clone())
1787 }
1788
1789 /// Updates a pending or completed Cloud Bigtable Backup.
1790 ///
1791 /// # Example
1792 /// ```
1793 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1794 /// # extern crate wkt as google_cloud_wkt;
1795 /// use google_cloud_wkt::FieldMask;
1796 /// use google_cloud_bigtable_admin_v2::model::Backup;
1797 /// use google_cloud_bigtable_admin_v2::Result;
1798 /// async fn sample(
1799 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, cluster_id: &str, backup_id: &str
1800 /// ) -> Result<()> {
1801 /// let response = client.update_backup()
1802 /// .set_backup(
1803 /// Backup::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"))/* set fields */
1804 /// )
1805 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1806 /// .send().await?;
1807 /// println!("response {:?}", response);
1808 /// Ok(())
1809 /// }
1810 /// ```
1811 pub fn update_backup(&self) -> super::builder::bigtable_table_admin::UpdateBackup {
1812 super::builder::bigtable_table_admin::UpdateBackup::new(self.inner.clone())
1813 }
1814
1815 /// Deletes a pending or completed Cloud Bigtable backup.
1816 ///
1817 /// # Example
1818 /// ```
1819 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1820 /// use google_cloud_bigtable_admin_v2::Result;
1821 /// async fn sample(
1822 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, cluster_id: &str, backup_id: &str
1823 /// ) -> Result<()> {
1824 /// client.delete_backup()
1825 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"))
1826 /// .send().await?;
1827 /// Ok(())
1828 /// }
1829 /// ```
1830 pub fn delete_backup(&self) -> super::builder::bigtable_table_admin::DeleteBackup {
1831 super::builder::bigtable_table_admin::DeleteBackup::new(self.inner.clone())
1832 }
1833
1834 /// Lists Cloud Bigtable backups. Returns both completed and pending
1835 /// backups.
1836 ///
1837 /// # Example
1838 /// ```
1839 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1840 /// use google_cloud_gax::paginator::ItemPaginator as _;
1841 /// use google_cloud_bigtable_admin_v2::Result;
1842 /// async fn sample(
1843 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, cluster_id: &str
1844 /// ) -> Result<()> {
1845 /// let mut list = client.list_backups()
1846 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"))
1847 /// .by_item();
1848 /// while let Some(item) = list.next().await.transpose()? {
1849 /// println!("{:?}", item);
1850 /// }
1851 /// Ok(())
1852 /// }
1853 /// ```
1854 pub fn list_backups(&self) -> super::builder::bigtable_table_admin::ListBackups {
1855 super::builder::bigtable_table_admin::ListBackups::new(self.inner.clone())
1856 }
1857
1858 /// Create a new table by restoring from a completed backup. The
1859 /// returned table [long-running operation][google.longrunning.Operation] can
1860 /// be used to track the progress of the operation, and to cancel it. The
1861 /// [metadata][google.longrunning.Operation.metadata] field type is
1862 /// [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The
1863 /// [response][google.longrunning.Operation.response] type is
1864 /// [Table][google.bigtable.admin.v2.Table], if successful.
1865 ///
1866 /// [google.bigtable.admin.v2.RestoreTableMetadata]: crate::model::RestoreTableMetadata
1867 /// [google.bigtable.admin.v2.Table]: crate::model::Table
1868 /// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
1869 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
1870 /// [google.longrunning.Operation.response]: google_cloud_longrunning::model::Operation::result
1871 ///
1872 /// # Long running operations
1873 ///
1874 /// This method is used to start, and/or poll a [long-running Operation].
1875 /// The [Working with long-running operations] chapter in the [user guide]
1876 /// covers these operations in detail.
1877 ///
1878 /// [long-running operation]: https://google.aip.dev/151
1879 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1880 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1881 ///
1882 /// # Example
1883 /// ```
1884 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1885 /// use google_cloud_lro::Poller;
1886 /// use google_cloud_bigtable_admin_v2::Result;
1887 /// async fn sample(
1888 /// client: &BigtableTableAdmin
1889 /// ) -> Result<()> {
1890 /// let response = client.restore_table()
1891 /// /* set fields */
1892 /// .poller().until_done().await?;
1893 /// println!("response {:?}", response);
1894 /// Ok(())
1895 /// }
1896 /// ```
1897 pub fn restore_table(&self) -> super::builder::bigtable_table_admin::RestoreTable {
1898 super::builder::bigtable_table_admin::RestoreTable::new(self.inner.clone())
1899 }
1900
1901 /// Copy a Cloud Bigtable backup to a new backup in the destination cluster
1902 /// located in the destination instance and project.
1903 ///
1904 /// # Long running operations
1905 ///
1906 /// This method is used to start, and/or poll a [long-running Operation].
1907 /// The [Working with long-running operations] chapter in the [user guide]
1908 /// covers these operations in detail.
1909 ///
1910 /// [long-running operation]: https://google.aip.dev/151
1911 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1912 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1913 ///
1914 /// # Example
1915 /// ```
1916 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1917 /// use google_cloud_lro::Poller;
1918 /// use google_cloud_bigtable_admin_v2::Result;
1919 /// async fn sample(
1920 /// client: &BigtableTableAdmin
1921 /// ) -> Result<()> {
1922 /// let response = client.copy_backup()
1923 /// /* set fields */
1924 /// .poller().until_done().await?;
1925 /// println!("response {:?}", response);
1926 /// Ok(())
1927 /// }
1928 /// ```
1929 pub fn copy_backup(&self) -> super::builder::bigtable_table_admin::CopyBackup {
1930 super::builder::bigtable_table_admin::CopyBackup::new(self.inner.clone())
1931 }
1932
1933 /// Gets the access control policy for a Bigtable resource.
1934 /// Returns an empty policy if the resource exists but does not have a policy
1935 /// set.
1936 ///
1937 /// # Example
1938 /// ```
1939 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1940 /// use google_cloud_bigtable_admin_v2::Result;
1941 /// async fn sample(
1942 /// client: &BigtableTableAdmin
1943 /// ) -> Result<()> {
1944 /// let response = client.get_iam_policy()
1945 /// /* set fields */
1946 /// .send().await?;
1947 /// println!("response {:?}", response);
1948 /// Ok(())
1949 /// }
1950 /// ```
1951 pub fn get_iam_policy(&self) -> super::builder::bigtable_table_admin::GetIamPolicy {
1952 super::builder::bigtable_table_admin::GetIamPolicy::new(self.inner.clone())
1953 }
1954
1955 /// Sets the access control policy on a Bigtable resource.
1956 /// Replaces any existing policy.
1957 ///
1958 /// # Example
1959 /// ```
1960 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1961 /// use google_cloud_bigtable_admin_v2::Result;
1962 /// async fn sample(
1963 /// client: &BigtableTableAdmin
1964 /// ) -> Result<()> {
1965 /// let response = client.set_iam_policy()
1966 /// /* set fields */
1967 /// .send().await?;
1968 /// println!("response {:?}", response);
1969 /// Ok(())
1970 /// }
1971 /// ```
1972 pub fn set_iam_policy(&self) -> super::builder::bigtable_table_admin::SetIamPolicy {
1973 super::builder::bigtable_table_admin::SetIamPolicy::new(self.inner.clone())
1974 }
1975
1976 /// Returns permissions that the caller has on the specified Bigtable
1977 /// resource.
1978 ///
1979 /// # Example
1980 /// ```
1981 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
1982 /// use google_cloud_bigtable_admin_v2::Result;
1983 /// async fn sample(
1984 /// client: &BigtableTableAdmin
1985 /// ) -> Result<()> {
1986 /// let response = client.test_iam_permissions()
1987 /// /* set fields */
1988 /// .send().await?;
1989 /// println!("response {:?}", response);
1990 /// Ok(())
1991 /// }
1992 /// ```
1993 pub fn test_iam_permissions(&self) -> super::builder::bigtable_table_admin::TestIamPermissions {
1994 super::builder::bigtable_table_admin::TestIamPermissions::new(self.inner.clone())
1995 }
1996
1997 /// Creates a new schema bundle in the specified table.
1998 ///
1999 /// # Long running operations
2000 ///
2001 /// This method is used to start, and/or poll a [long-running Operation].
2002 /// The [Working with long-running operations] chapter in the [user guide]
2003 /// covers these operations in detail.
2004 ///
2005 /// [long-running operation]: https://google.aip.dev/151
2006 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2007 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2008 ///
2009 /// # Example
2010 /// ```
2011 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2012 /// use google_cloud_lro::Poller;
2013 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
2014 /// use google_cloud_bigtable_admin_v2::Result;
2015 /// async fn sample(
2016 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str
2017 /// ) -> Result<()> {
2018 /// let response = client.create_schema_bundle()
2019 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"))
2020 /// .set_schema_bundle(
2021 /// SchemaBundle::new()/* set fields */
2022 /// )
2023 /// .poller().until_done().await?;
2024 /// println!("response {:?}", response);
2025 /// Ok(())
2026 /// }
2027 /// ```
2028 pub fn create_schema_bundle(&self) -> super::builder::bigtable_table_admin::CreateSchemaBundle {
2029 super::builder::bigtable_table_admin::CreateSchemaBundle::new(self.inner.clone())
2030 }
2031
2032 /// Updates a schema bundle in the specified table.
2033 ///
2034 /// # Long running operations
2035 ///
2036 /// This method is used to start, and/or poll a [long-running Operation].
2037 /// The [Working with long-running operations] chapter in the [user guide]
2038 /// covers these operations in detail.
2039 ///
2040 /// [long-running operation]: https://google.aip.dev/151
2041 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2042 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2043 ///
2044 /// # Example
2045 /// ```
2046 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2047 /// use google_cloud_lro::Poller;
2048 /// # extern crate wkt as google_cloud_wkt;
2049 /// use google_cloud_wkt::FieldMask;
2050 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
2051 /// use google_cloud_bigtable_admin_v2::Result;
2052 /// async fn sample(
2053 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str, schema_bundle_id: &str
2054 /// ) -> Result<()> {
2055 /// let response = client.update_schema_bundle()
2056 /// .set_schema_bundle(
2057 /// SchemaBundle::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/schemaBundles/{schema_bundle_id}"))/* set fields */
2058 /// )
2059 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
2060 /// .poller().until_done().await?;
2061 /// println!("response {:?}", response);
2062 /// Ok(())
2063 /// }
2064 /// ```
2065 pub fn update_schema_bundle(&self) -> super::builder::bigtable_table_admin::UpdateSchemaBundle {
2066 super::builder::bigtable_table_admin::UpdateSchemaBundle::new(self.inner.clone())
2067 }
2068
2069 /// Gets metadata information about the specified schema bundle.
2070 ///
2071 /// # Example
2072 /// ```
2073 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2074 /// use google_cloud_bigtable_admin_v2::Result;
2075 /// async fn sample(
2076 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str, schema_bundle_id: &str
2077 /// ) -> Result<()> {
2078 /// let response = client.get_schema_bundle()
2079 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/schemaBundles/{schema_bundle_id}"))
2080 /// .send().await?;
2081 /// println!("response {:?}", response);
2082 /// Ok(())
2083 /// }
2084 /// ```
2085 pub fn get_schema_bundle(&self) -> super::builder::bigtable_table_admin::GetSchemaBundle {
2086 super::builder::bigtable_table_admin::GetSchemaBundle::new(self.inner.clone())
2087 }
2088
2089 /// Lists all schema bundles associated with the specified table.
2090 ///
2091 /// # Example
2092 /// ```
2093 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2094 /// use google_cloud_gax::paginator::ItemPaginator as _;
2095 /// use google_cloud_bigtable_admin_v2::Result;
2096 /// async fn sample(
2097 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str
2098 /// ) -> Result<()> {
2099 /// let mut list = client.list_schema_bundles()
2100 /// .set_parent(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"))
2101 /// .by_item();
2102 /// while let Some(item) = list.next().await.transpose()? {
2103 /// println!("{:?}", item);
2104 /// }
2105 /// Ok(())
2106 /// }
2107 /// ```
2108 pub fn list_schema_bundles(&self) -> super::builder::bigtable_table_admin::ListSchemaBundles {
2109 super::builder::bigtable_table_admin::ListSchemaBundles::new(self.inner.clone())
2110 }
2111
2112 /// Deletes a schema bundle in the specified table.
2113 ///
2114 /// # Example
2115 /// ```
2116 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2117 /// use google_cloud_bigtable_admin_v2::Result;
2118 /// async fn sample(
2119 /// client: &BigtableTableAdmin, project_id: &str, instance_id: &str, table_id: &str, schema_bundle_id: &str
2120 /// ) -> Result<()> {
2121 /// client.delete_schema_bundle()
2122 /// .set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/schemaBundles/{schema_bundle_id}"))
2123 /// .send().await?;
2124 /// Ok(())
2125 /// }
2126 /// ```
2127 pub fn delete_schema_bundle(&self) -> super::builder::bigtable_table_admin::DeleteSchemaBundle {
2128 super::builder::bigtable_table_admin::DeleteSchemaBundle::new(self.inner.clone())
2129 }
2130
2131 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2132 ///
2133 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2134 ///
2135 /// # Example
2136 /// ```
2137 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2138 /// use google_cloud_gax::paginator::ItemPaginator as _;
2139 /// use google_cloud_bigtable_admin_v2::Result;
2140 /// async fn sample(
2141 /// client: &BigtableTableAdmin
2142 /// ) -> Result<()> {
2143 /// let mut list = client.list_operations()
2144 /// /* set fields */
2145 /// .by_item();
2146 /// while let Some(item) = list.next().await.transpose()? {
2147 /// println!("{:?}", item);
2148 /// }
2149 /// Ok(())
2150 /// }
2151 /// ```
2152 pub fn list_operations(&self) -> super::builder::bigtable_table_admin::ListOperations {
2153 super::builder::bigtable_table_admin::ListOperations::new(self.inner.clone())
2154 }
2155
2156 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2157 ///
2158 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2159 ///
2160 /// # Example
2161 /// ```
2162 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2163 /// use google_cloud_bigtable_admin_v2::Result;
2164 /// async fn sample(
2165 /// client: &BigtableTableAdmin
2166 /// ) -> Result<()> {
2167 /// let response = client.get_operation()
2168 /// /* set fields */
2169 /// .send().await?;
2170 /// println!("response {:?}", response);
2171 /// Ok(())
2172 /// }
2173 /// ```
2174 pub fn get_operation(&self) -> super::builder::bigtable_table_admin::GetOperation {
2175 super::builder::bigtable_table_admin::GetOperation::new(self.inner.clone())
2176 }
2177
2178 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2179 ///
2180 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2181 ///
2182 /// # Example
2183 /// ```
2184 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2185 /// use google_cloud_bigtable_admin_v2::Result;
2186 /// async fn sample(
2187 /// client: &BigtableTableAdmin
2188 /// ) -> Result<()> {
2189 /// client.delete_operation()
2190 /// /* set fields */
2191 /// .send().await?;
2192 /// Ok(())
2193 /// }
2194 /// ```
2195 pub fn delete_operation(&self) -> super::builder::bigtable_table_admin::DeleteOperation {
2196 super::builder::bigtable_table_admin::DeleteOperation::new(self.inner.clone())
2197 }
2198
2199 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2200 ///
2201 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2202 ///
2203 /// # Example
2204 /// ```
2205 /// # use google_cloud_bigtable_admin_v2::client::BigtableTableAdmin;
2206 /// use google_cloud_bigtable_admin_v2::Result;
2207 /// async fn sample(
2208 /// client: &BigtableTableAdmin
2209 /// ) -> Result<()> {
2210 /// client.cancel_operation()
2211 /// /* set fields */
2212 /// .send().await?;
2213 /// Ok(())
2214 /// }
2215 /// ```
2216 pub fn cancel_operation(&self) -> super::builder::bigtable_table_admin::CancelOperation {
2217 super::builder::bigtable_table_admin::CancelOperation::new(self.inner.clone())
2218 }
2219}