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