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