google_cloud_bigtable_admin_v2/model.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
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate lazy_static;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Request message for BigtableInstanceAdmin.CreateInstance.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct CreateInstanceRequest {
44 /// Required. The unique name of the project in which to create the new
45 /// instance. Values are of the form `projects/{project}`.
46 pub parent: std::string::String,
47
48 /// Required. The ID to be used when referring to the new instance within its
49 /// project, e.g., just `myinstance` rather than
50 /// `projects/myproject/instances/myinstance`.
51 pub instance_id: std::string::String,
52
53 /// Required. The instance to create.
54 /// Fields marked `OutputOnly` must be left blank.
55 pub instance: std::option::Option<crate::model::Instance>,
56
57 /// Required. The clusters to be created within the instance, mapped by desired
58 /// cluster ID, e.g., just `mycluster` rather than
59 /// `projects/myproject/instances/myinstance/clusters/mycluster`.
60 /// Fields marked `OutputOnly` must be left blank.
61 pub clusters: std::collections::HashMap<std::string::String, crate::model::Cluster>,
62
63 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
64}
65
66impl CreateInstanceRequest {
67 pub fn new() -> Self {
68 std::default::Default::default()
69 }
70
71 /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
72 ///
73 /// # Example
74 /// ```ignore,no_run
75 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
76 /// let x = CreateInstanceRequest::new().set_parent("example");
77 /// ```
78 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
79 self.parent = v.into();
80 self
81 }
82
83 /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
84 ///
85 /// # Example
86 /// ```ignore,no_run
87 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
88 /// let x = CreateInstanceRequest::new().set_instance_id("example");
89 /// ```
90 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
91 self.instance_id = v.into();
92 self
93 }
94
95 /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
96 ///
97 /// # Example
98 /// ```ignore,no_run
99 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
100 /// use google_cloud_bigtable_admin_v2::model::Instance;
101 /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
102 /// ```
103 pub fn set_instance<T>(mut self, v: T) -> Self
104 where
105 T: std::convert::Into<crate::model::Instance>,
106 {
107 self.instance = std::option::Option::Some(v.into());
108 self
109 }
110
111 /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
112 ///
113 /// # Example
114 /// ```ignore,no_run
115 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
116 /// use google_cloud_bigtable_admin_v2::model::Instance;
117 /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
118 /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
119 /// ```
120 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
121 where
122 T: std::convert::Into<crate::model::Instance>,
123 {
124 self.instance = v.map(|x| x.into());
125 self
126 }
127
128 /// Sets the value of [clusters][crate::model::CreateInstanceRequest::clusters].
129 ///
130 /// # Example
131 /// ```ignore,no_run
132 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
133 /// use google_cloud_bigtable_admin_v2::model::Cluster;
134 /// let x = CreateInstanceRequest::new().set_clusters([
135 /// ("key0", Cluster::default()/* use setters */),
136 /// ("key1", Cluster::default()/* use (different) setters */),
137 /// ]);
138 /// ```
139 pub fn set_clusters<T, K, V>(mut self, v: T) -> Self
140 where
141 T: std::iter::IntoIterator<Item = (K, V)>,
142 K: std::convert::Into<std::string::String>,
143 V: std::convert::Into<crate::model::Cluster>,
144 {
145 use std::iter::Iterator;
146 self.clusters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
147 self
148 }
149}
150
151impl wkt::message::Message for CreateInstanceRequest {
152 fn typename() -> &'static str {
153 "type.googleapis.com/google.bigtable.admin.v2.CreateInstanceRequest"
154 }
155}
156
157/// Request message for BigtableInstanceAdmin.GetInstance.
158#[derive(Clone, Default, PartialEq)]
159#[non_exhaustive]
160pub struct GetInstanceRequest {
161 /// Required. The unique name of the requested instance. Values are of the form
162 /// `projects/{project}/instances/{instance}`.
163 pub name: std::string::String,
164
165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
166}
167
168impl GetInstanceRequest {
169 pub fn new() -> Self {
170 std::default::Default::default()
171 }
172
173 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
174 ///
175 /// # Example
176 /// ```ignore,no_run
177 /// # use google_cloud_bigtable_admin_v2::model::GetInstanceRequest;
178 /// let x = GetInstanceRequest::new().set_name("example");
179 /// ```
180 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
181 self.name = v.into();
182 self
183 }
184}
185
186impl wkt::message::Message for GetInstanceRequest {
187 fn typename() -> &'static str {
188 "type.googleapis.com/google.bigtable.admin.v2.GetInstanceRequest"
189 }
190}
191
192/// Request message for BigtableInstanceAdmin.ListInstances.
193#[derive(Clone, Default, PartialEq)]
194#[non_exhaustive]
195pub struct ListInstancesRequest {
196 /// Required. The unique name of the project for which a list of instances is
197 /// requested. Values are of the form `projects/{project}`.
198 pub parent: std::string::String,
199
200 /// DEPRECATED: This field is unused and ignored.
201 pub page_token: std::string::String,
202
203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
204}
205
206impl ListInstancesRequest {
207 pub fn new() -> Self {
208 std::default::Default::default()
209 }
210
211 /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
212 ///
213 /// # Example
214 /// ```ignore,no_run
215 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesRequest;
216 /// let x = ListInstancesRequest::new().set_parent("example");
217 /// ```
218 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
219 self.parent = v.into();
220 self
221 }
222
223 /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
224 ///
225 /// # Example
226 /// ```ignore,no_run
227 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesRequest;
228 /// let x = ListInstancesRequest::new().set_page_token("example");
229 /// ```
230 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
231 self.page_token = v.into();
232 self
233 }
234}
235
236impl wkt::message::Message for ListInstancesRequest {
237 fn typename() -> &'static str {
238 "type.googleapis.com/google.bigtable.admin.v2.ListInstancesRequest"
239 }
240}
241
242/// Response message for BigtableInstanceAdmin.ListInstances.
243#[derive(Clone, Default, PartialEq)]
244#[non_exhaustive]
245pub struct ListInstancesResponse {
246 /// The list of requested instances.
247 pub instances: std::vec::Vec<crate::model::Instance>,
248
249 /// Locations from which Instance information could not be retrieved,
250 /// due to an outage or some other transient condition.
251 /// Instances whose Clusters are all in one of the failed locations
252 /// may be missing from `instances`, and Instances with at least one
253 /// Cluster in a failed location may only have partial information returned.
254 /// Values are of the form `projects/<project>/locations/<zone_id>`
255 pub failed_locations: std::vec::Vec<std::string::String>,
256
257 /// DEPRECATED: This field is unused and ignored.
258 pub next_page_token: std::string::String,
259
260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
261}
262
263impl ListInstancesResponse {
264 pub fn new() -> Self {
265 std::default::Default::default()
266 }
267
268 /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
269 ///
270 /// # Example
271 /// ```ignore,no_run
272 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesResponse;
273 /// use google_cloud_bigtable_admin_v2::model::Instance;
274 /// let x = ListInstancesResponse::new()
275 /// .set_instances([
276 /// Instance::default()/* use setters */,
277 /// Instance::default()/* use (different) setters */,
278 /// ]);
279 /// ```
280 pub fn set_instances<T, V>(mut self, v: T) -> Self
281 where
282 T: std::iter::IntoIterator<Item = V>,
283 V: std::convert::Into<crate::model::Instance>,
284 {
285 use std::iter::Iterator;
286 self.instances = v.into_iter().map(|i| i.into()).collect();
287 self
288 }
289
290 /// Sets the value of [failed_locations][crate::model::ListInstancesResponse::failed_locations].
291 ///
292 /// # Example
293 /// ```ignore,no_run
294 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesResponse;
295 /// let x = ListInstancesResponse::new().set_failed_locations(["a", "b", "c"]);
296 /// ```
297 pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
298 where
299 T: std::iter::IntoIterator<Item = V>,
300 V: std::convert::Into<std::string::String>,
301 {
302 use std::iter::Iterator;
303 self.failed_locations = v.into_iter().map(|i| i.into()).collect();
304 self
305 }
306
307 /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
308 ///
309 /// # Example
310 /// ```ignore,no_run
311 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesResponse;
312 /// let x = ListInstancesResponse::new().set_next_page_token("example");
313 /// ```
314 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
315 self.next_page_token = v.into();
316 self
317 }
318}
319
320impl wkt::message::Message for ListInstancesResponse {
321 fn typename() -> &'static str {
322 "type.googleapis.com/google.bigtable.admin.v2.ListInstancesResponse"
323 }
324}
325
326/// Request message for BigtableInstanceAdmin.PartialUpdateInstance.
327#[derive(Clone, Default, PartialEq)]
328#[non_exhaustive]
329pub struct PartialUpdateInstanceRequest {
330 /// Required. The Instance which will (partially) replace the current value.
331 pub instance: std::option::Option<crate::model::Instance>,
332
333 /// Required. The subset of Instance fields which should be replaced.
334 /// Must be explicitly set.
335 pub update_mask: std::option::Option<wkt::FieldMask>,
336
337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
338}
339
340impl PartialUpdateInstanceRequest {
341 pub fn new() -> Self {
342 std::default::Default::default()
343 }
344
345 /// Sets the value of [instance][crate::model::PartialUpdateInstanceRequest::instance].
346 ///
347 /// # Example
348 /// ```ignore,no_run
349 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
350 /// use google_cloud_bigtable_admin_v2::model::Instance;
351 /// let x = PartialUpdateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
352 /// ```
353 pub fn set_instance<T>(mut self, v: T) -> Self
354 where
355 T: std::convert::Into<crate::model::Instance>,
356 {
357 self.instance = std::option::Option::Some(v.into());
358 self
359 }
360
361 /// Sets or clears the value of [instance][crate::model::PartialUpdateInstanceRequest::instance].
362 ///
363 /// # Example
364 /// ```ignore,no_run
365 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
366 /// use google_cloud_bigtable_admin_v2::model::Instance;
367 /// let x = PartialUpdateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
368 /// let x = PartialUpdateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
369 /// ```
370 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
371 where
372 T: std::convert::Into<crate::model::Instance>,
373 {
374 self.instance = v.map(|x| x.into());
375 self
376 }
377
378 /// Sets the value of [update_mask][crate::model::PartialUpdateInstanceRequest::update_mask].
379 ///
380 /// # Example
381 /// ```ignore,no_run
382 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
383 /// use wkt::FieldMask;
384 /// let x = PartialUpdateInstanceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
385 /// ```
386 pub fn set_update_mask<T>(mut self, v: T) -> Self
387 where
388 T: std::convert::Into<wkt::FieldMask>,
389 {
390 self.update_mask = std::option::Option::Some(v.into());
391 self
392 }
393
394 /// Sets or clears the value of [update_mask][crate::model::PartialUpdateInstanceRequest::update_mask].
395 ///
396 /// # Example
397 /// ```ignore,no_run
398 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
399 /// use wkt::FieldMask;
400 /// let x = PartialUpdateInstanceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
401 /// let x = PartialUpdateInstanceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
402 /// ```
403 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
404 where
405 T: std::convert::Into<wkt::FieldMask>,
406 {
407 self.update_mask = v.map(|x| x.into());
408 self
409 }
410}
411
412impl wkt::message::Message for PartialUpdateInstanceRequest {
413 fn typename() -> &'static str {
414 "type.googleapis.com/google.bigtable.admin.v2.PartialUpdateInstanceRequest"
415 }
416}
417
418/// Request message for BigtableInstanceAdmin.DeleteInstance.
419#[derive(Clone, Default, PartialEq)]
420#[non_exhaustive]
421pub struct DeleteInstanceRequest {
422 /// Required. The unique name of the instance to be deleted.
423 /// Values are of the form `projects/{project}/instances/{instance}`.
424 pub name: std::string::String,
425
426 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
427}
428
429impl DeleteInstanceRequest {
430 pub fn new() -> Self {
431 std::default::Default::default()
432 }
433
434 /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
435 ///
436 /// # Example
437 /// ```ignore,no_run
438 /// # use google_cloud_bigtable_admin_v2::model::DeleteInstanceRequest;
439 /// let x = DeleteInstanceRequest::new().set_name("example");
440 /// ```
441 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
442 self.name = v.into();
443 self
444 }
445}
446
447impl wkt::message::Message for DeleteInstanceRequest {
448 fn typename() -> &'static str {
449 "type.googleapis.com/google.bigtable.admin.v2.DeleteInstanceRequest"
450 }
451}
452
453/// Request message for BigtableInstanceAdmin.CreateCluster.
454#[derive(Clone, Default, PartialEq)]
455#[non_exhaustive]
456pub struct CreateClusterRequest {
457 /// Required. The unique name of the instance in which to create the new
458 /// cluster. Values are of the form `projects/{project}/instances/{instance}`.
459 pub parent: std::string::String,
460
461 /// Required. The ID to be used when referring to the new cluster within its
462 /// instance, e.g., just `mycluster` rather than
463 /// `projects/myproject/instances/myinstance/clusters/mycluster`.
464 pub cluster_id: std::string::String,
465
466 /// Required. The cluster to be created.
467 /// Fields marked `OutputOnly` must be left blank.
468 pub cluster: std::option::Option<crate::model::Cluster>,
469
470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
471}
472
473impl CreateClusterRequest {
474 pub fn new() -> Self {
475 std::default::Default::default()
476 }
477
478 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
479 ///
480 /// # Example
481 /// ```ignore,no_run
482 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
483 /// let x = CreateClusterRequest::new().set_parent("example");
484 /// ```
485 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
486 self.parent = v.into();
487 self
488 }
489
490 /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
491 ///
492 /// # Example
493 /// ```ignore,no_run
494 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
495 /// let x = CreateClusterRequest::new().set_cluster_id("example");
496 /// ```
497 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
498 self.cluster_id = v.into();
499 self
500 }
501
502 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
503 ///
504 /// # Example
505 /// ```ignore,no_run
506 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
507 /// use google_cloud_bigtable_admin_v2::model::Cluster;
508 /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
509 /// ```
510 pub fn set_cluster<T>(mut self, v: T) -> Self
511 where
512 T: std::convert::Into<crate::model::Cluster>,
513 {
514 self.cluster = std::option::Option::Some(v.into());
515 self
516 }
517
518 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
519 ///
520 /// # Example
521 /// ```ignore,no_run
522 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
523 /// use google_cloud_bigtable_admin_v2::model::Cluster;
524 /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
525 /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
526 /// ```
527 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
528 where
529 T: std::convert::Into<crate::model::Cluster>,
530 {
531 self.cluster = v.map(|x| x.into());
532 self
533 }
534}
535
536impl wkt::message::Message for CreateClusterRequest {
537 fn typename() -> &'static str {
538 "type.googleapis.com/google.bigtable.admin.v2.CreateClusterRequest"
539 }
540}
541
542/// Request message for BigtableInstanceAdmin.GetCluster.
543#[derive(Clone, Default, PartialEq)]
544#[non_exhaustive]
545pub struct GetClusterRequest {
546 /// Required. The unique name of the requested cluster. Values are of the form
547 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
548 pub name: std::string::String,
549
550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
551}
552
553impl GetClusterRequest {
554 pub fn new() -> Self {
555 std::default::Default::default()
556 }
557
558 /// Sets the value of [name][crate::model::GetClusterRequest::name].
559 ///
560 /// # Example
561 /// ```ignore,no_run
562 /// # use google_cloud_bigtable_admin_v2::model::GetClusterRequest;
563 /// let x = GetClusterRequest::new().set_name("example");
564 /// ```
565 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
566 self.name = v.into();
567 self
568 }
569}
570
571impl wkt::message::Message for GetClusterRequest {
572 fn typename() -> &'static str {
573 "type.googleapis.com/google.bigtable.admin.v2.GetClusterRequest"
574 }
575}
576
577/// Request message for BigtableInstanceAdmin.ListClusters.
578#[derive(Clone, Default, PartialEq)]
579#[non_exhaustive]
580pub struct ListClustersRequest {
581 /// Required. The unique name of the instance for which a list of clusters is
582 /// requested. Values are of the form
583 /// `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
584 /// Clusters for all Instances in a project, e.g.,
585 /// `projects/myproject/instances/-`.
586 pub parent: std::string::String,
587
588 /// DEPRECATED: This field is unused and ignored.
589 pub page_token: std::string::String,
590
591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
592}
593
594impl ListClustersRequest {
595 pub fn new() -> Self {
596 std::default::Default::default()
597 }
598
599 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
600 ///
601 /// # Example
602 /// ```ignore,no_run
603 /// # use google_cloud_bigtable_admin_v2::model::ListClustersRequest;
604 /// let x = ListClustersRequest::new().set_parent("example");
605 /// ```
606 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
607 self.parent = v.into();
608 self
609 }
610
611 /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
612 ///
613 /// # Example
614 /// ```ignore,no_run
615 /// # use google_cloud_bigtable_admin_v2::model::ListClustersRequest;
616 /// let x = ListClustersRequest::new().set_page_token("example");
617 /// ```
618 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
619 self.page_token = v.into();
620 self
621 }
622}
623
624impl wkt::message::Message for ListClustersRequest {
625 fn typename() -> &'static str {
626 "type.googleapis.com/google.bigtable.admin.v2.ListClustersRequest"
627 }
628}
629
630/// Response message for BigtableInstanceAdmin.ListClusters.
631#[derive(Clone, Default, PartialEq)]
632#[non_exhaustive]
633pub struct ListClustersResponse {
634 /// The list of requested clusters.
635 pub clusters: std::vec::Vec<crate::model::Cluster>,
636
637 /// Locations from which Cluster information could not be retrieved,
638 /// due to an outage or some other transient condition.
639 /// Clusters from these locations may be missing from `clusters`,
640 /// or may only have partial information returned.
641 /// Values are of the form `projects/<project>/locations/<zone_id>`
642 pub failed_locations: std::vec::Vec<std::string::String>,
643
644 /// DEPRECATED: This field is unused and ignored.
645 pub next_page_token: std::string::String,
646
647 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
648}
649
650impl ListClustersResponse {
651 pub fn new() -> Self {
652 std::default::Default::default()
653 }
654
655 /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
656 ///
657 /// # Example
658 /// ```ignore,no_run
659 /// # use google_cloud_bigtable_admin_v2::model::ListClustersResponse;
660 /// use google_cloud_bigtable_admin_v2::model::Cluster;
661 /// let x = ListClustersResponse::new()
662 /// .set_clusters([
663 /// Cluster::default()/* use setters */,
664 /// Cluster::default()/* use (different) setters */,
665 /// ]);
666 /// ```
667 pub fn set_clusters<T, V>(mut self, v: T) -> Self
668 where
669 T: std::iter::IntoIterator<Item = V>,
670 V: std::convert::Into<crate::model::Cluster>,
671 {
672 use std::iter::Iterator;
673 self.clusters = v.into_iter().map(|i| i.into()).collect();
674 self
675 }
676
677 /// Sets the value of [failed_locations][crate::model::ListClustersResponse::failed_locations].
678 ///
679 /// # Example
680 /// ```ignore,no_run
681 /// # use google_cloud_bigtable_admin_v2::model::ListClustersResponse;
682 /// let x = ListClustersResponse::new().set_failed_locations(["a", "b", "c"]);
683 /// ```
684 pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
685 where
686 T: std::iter::IntoIterator<Item = V>,
687 V: std::convert::Into<std::string::String>,
688 {
689 use std::iter::Iterator;
690 self.failed_locations = v.into_iter().map(|i| i.into()).collect();
691 self
692 }
693
694 /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
695 ///
696 /// # Example
697 /// ```ignore,no_run
698 /// # use google_cloud_bigtable_admin_v2::model::ListClustersResponse;
699 /// let x = ListClustersResponse::new().set_next_page_token("example");
700 /// ```
701 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
702 self.next_page_token = v.into();
703 self
704 }
705}
706
707impl wkt::message::Message for ListClustersResponse {
708 fn typename() -> &'static str {
709 "type.googleapis.com/google.bigtable.admin.v2.ListClustersResponse"
710 }
711}
712
713/// Request message for BigtableInstanceAdmin.DeleteCluster.
714#[derive(Clone, Default, PartialEq)]
715#[non_exhaustive]
716pub struct DeleteClusterRequest {
717 /// Required. The unique name of the cluster to be deleted. Values are of the
718 /// form `projects/{project}/instances/{instance}/clusters/{cluster}`.
719 pub name: std::string::String,
720
721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
722}
723
724impl DeleteClusterRequest {
725 pub fn new() -> Self {
726 std::default::Default::default()
727 }
728
729 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
730 ///
731 /// # Example
732 /// ```ignore,no_run
733 /// # use google_cloud_bigtable_admin_v2::model::DeleteClusterRequest;
734 /// let x = DeleteClusterRequest::new().set_name("example");
735 /// ```
736 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
737 self.name = v.into();
738 self
739 }
740}
741
742impl wkt::message::Message for DeleteClusterRequest {
743 fn typename() -> &'static str {
744 "type.googleapis.com/google.bigtable.admin.v2.DeleteClusterRequest"
745 }
746}
747
748/// The metadata for the Operation returned by CreateInstance.
749#[derive(Clone, Default, PartialEq)]
750#[non_exhaustive]
751pub struct CreateInstanceMetadata {
752 /// The request that prompted the initiation of this CreateInstance operation.
753 pub original_request: std::option::Option<crate::model::CreateInstanceRequest>,
754
755 /// The time at which the original request was received.
756 pub request_time: std::option::Option<wkt::Timestamp>,
757
758 /// The time at which the operation failed or was completed successfully.
759 pub finish_time: std::option::Option<wkt::Timestamp>,
760
761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
762}
763
764impl CreateInstanceMetadata {
765 pub fn new() -> Self {
766 std::default::Default::default()
767 }
768
769 /// Sets the value of [original_request][crate::model::CreateInstanceMetadata::original_request].
770 ///
771 /// # Example
772 /// ```ignore,no_run
773 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
774 /// use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
775 /// let x = CreateInstanceMetadata::new().set_original_request(CreateInstanceRequest::default()/* use setters */);
776 /// ```
777 pub fn set_original_request<T>(mut self, v: T) -> Self
778 where
779 T: std::convert::Into<crate::model::CreateInstanceRequest>,
780 {
781 self.original_request = std::option::Option::Some(v.into());
782 self
783 }
784
785 /// Sets or clears the value of [original_request][crate::model::CreateInstanceMetadata::original_request].
786 ///
787 /// # Example
788 /// ```ignore,no_run
789 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
790 /// use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
791 /// let x = CreateInstanceMetadata::new().set_or_clear_original_request(Some(CreateInstanceRequest::default()/* use setters */));
792 /// let x = CreateInstanceMetadata::new().set_or_clear_original_request(None::<CreateInstanceRequest>);
793 /// ```
794 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
795 where
796 T: std::convert::Into<crate::model::CreateInstanceRequest>,
797 {
798 self.original_request = v.map(|x| x.into());
799 self
800 }
801
802 /// Sets the value of [request_time][crate::model::CreateInstanceMetadata::request_time].
803 ///
804 /// # Example
805 /// ```ignore,no_run
806 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
807 /// use wkt::Timestamp;
808 /// let x = CreateInstanceMetadata::new().set_request_time(Timestamp::default()/* use setters */);
809 /// ```
810 pub fn set_request_time<T>(mut self, v: T) -> Self
811 where
812 T: std::convert::Into<wkt::Timestamp>,
813 {
814 self.request_time = std::option::Option::Some(v.into());
815 self
816 }
817
818 /// Sets or clears the value of [request_time][crate::model::CreateInstanceMetadata::request_time].
819 ///
820 /// # Example
821 /// ```ignore,no_run
822 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
823 /// use wkt::Timestamp;
824 /// let x = CreateInstanceMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
825 /// let x = CreateInstanceMetadata::new().set_or_clear_request_time(None::<Timestamp>);
826 /// ```
827 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
828 where
829 T: std::convert::Into<wkt::Timestamp>,
830 {
831 self.request_time = v.map(|x| x.into());
832 self
833 }
834
835 /// Sets the value of [finish_time][crate::model::CreateInstanceMetadata::finish_time].
836 ///
837 /// # Example
838 /// ```ignore,no_run
839 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
840 /// use wkt::Timestamp;
841 /// let x = CreateInstanceMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
842 /// ```
843 pub fn set_finish_time<T>(mut self, v: T) -> Self
844 where
845 T: std::convert::Into<wkt::Timestamp>,
846 {
847 self.finish_time = std::option::Option::Some(v.into());
848 self
849 }
850
851 /// Sets or clears the value of [finish_time][crate::model::CreateInstanceMetadata::finish_time].
852 ///
853 /// # Example
854 /// ```ignore,no_run
855 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
856 /// use wkt::Timestamp;
857 /// let x = CreateInstanceMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
858 /// let x = CreateInstanceMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
859 /// ```
860 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
861 where
862 T: std::convert::Into<wkt::Timestamp>,
863 {
864 self.finish_time = v.map(|x| x.into());
865 self
866 }
867}
868
869impl wkt::message::Message for CreateInstanceMetadata {
870 fn typename() -> &'static str {
871 "type.googleapis.com/google.bigtable.admin.v2.CreateInstanceMetadata"
872 }
873}
874
875/// The metadata for the Operation returned by UpdateInstance.
876#[derive(Clone, Default, PartialEq)]
877#[non_exhaustive]
878pub struct UpdateInstanceMetadata {
879 /// The request that prompted the initiation of this UpdateInstance operation.
880 pub original_request: std::option::Option<crate::model::PartialUpdateInstanceRequest>,
881
882 /// The time at which the original request was received.
883 pub request_time: std::option::Option<wkt::Timestamp>,
884
885 /// The time at which the operation failed or was completed successfully.
886 pub finish_time: std::option::Option<wkt::Timestamp>,
887
888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
889}
890
891impl UpdateInstanceMetadata {
892 pub fn new() -> Self {
893 std::default::Default::default()
894 }
895
896 /// Sets the value of [original_request][crate::model::UpdateInstanceMetadata::original_request].
897 ///
898 /// # Example
899 /// ```ignore,no_run
900 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
901 /// use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
902 /// let x = UpdateInstanceMetadata::new().set_original_request(PartialUpdateInstanceRequest::default()/* use setters */);
903 /// ```
904 pub fn set_original_request<T>(mut self, v: T) -> Self
905 where
906 T: std::convert::Into<crate::model::PartialUpdateInstanceRequest>,
907 {
908 self.original_request = std::option::Option::Some(v.into());
909 self
910 }
911
912 /// Sets or clears the value of [original_request][crate::model::UpdateInstanceMetadata::original_request].
913 ///
914 /// # Example
915 /// ```ignore,no_run
916 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
917 /// use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
918 /// let x = UpdateInstanceMetadata::new().set_or_clear_original_request(Some(PartialUpdateInstanceRequest::default()/* use setters */));
919 /// let x = UpdateInstanceMetadata::new().set_or_clear_original_request(None::<PartialUpdateInstanceRequest>);
920 /// ```
921 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
922 where
923 T: std::convert::Into<crate::model::PartialUpdateInstanceRequest>,
924 {
925 self.original_request = v.map(|x| x.into());
926 self
927 }
928
929 /// Sets the value of [request_time][crate::model::UpdateInstanceMetadata::request_time].
930 ///
931 /// # Example
932 /// ```ignore,no_run
933 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
934 /// use wkt::Timestamp;
935 /// let x = UpdateInstanceMetadata::new().set_request_time(Timestamp::default()/* use setters */);
936 /// ```
937 pub fn set_request_time<T>(mut self, v: T) -> Self
938 where
939 T: std::convert::Into<wkt::Timestamp>,
940 {
941 self.request_time = std::option::Option::Some(v.into());
942 self
943 }
944
945 /// Sets or clears the value of [request_time][crate::model::UpdateInstanceMetadata::request_time].
946 ///
947 /// # Example
948 /// ```ignore,no_run
949 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
950 /// use wkt::Timestamp;
951 /// let x = UpdateInstanceMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
952 /// let x = UpdateInstanceMetadata::new().set_or_clear_request_time(None::<Timestamp>);
953 /// ```
954 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
955 where
956 T: std::convert::Into<wkt::Timestamp>,
957 {
958 self.request_time = v.map(|x| x.into());
959 self
960 }
961
962 /// Sets the value of [finish_time][crate::model::UpdateInstanceMetadata::finish_time].
963 ///
964 /// # Example
965 /// ```ignore,no_run
966 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
967 /// use wkt::Timestamp;
968 /// let x = UpdateInstanceMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
969 /// ```
970 pub fn set_finish_time<T>(mut self, v: T) -> Self
971 where
972 T: std::convert::Into<wkt::Timestamp>,
973 {
974 self.finish_time = std::option::Option::Some(v.into());
975 self
976 }
977
978 /// Sets or clears the value of [finish_time][crate::model::UpdateInstanceMetadata::finish_time].
979 ///
980 /// # Example
981 /// ```ignore,no_run
982 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
983 /// use wkt::Timestamp;
984 /// let x = UpdateInstanceMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
985 /// let x = UpdateInstanceMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
986 /// ```
987 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
988 where
989 T: std::convert::Into<wkt::Timestamp>,
990 {
991 self.finish_time = v.map(|x| x.into());
992 self
993 }
994}
995
996impl wkt::message::Message for UpdateInstanceMetadata {
997 fn typename() -> &'static str {
998 "type.googleapis.com/google.bigtable.admin.v2.UpdateInstanceMetadata"
999 }
1000}
1001
1002/// The metadata for the Operation returned by CreateCluster.
1003#[derive(Clone, Default, PartialEq)]
1004#[non_exhaustive]
1005pub struct CreateClusterMetadata {
1006 /// The request that prompted the initiation of this CreateCluster operation.
1007 pub original_request: std::option::Option<crate::model::CreateClusterRequest>,
1008
1009 /// The time at which the original request was received.
1010 pub request_time: std::option::Option<wkt::Timestamp>,
1011
1012 /// The time at which the operation failed or was completed successfully.
1013 pub finish_time: std::option::Option<wkt::Timestamp>,
1014
1015 /// Keys: the full `name` of each table that existed in the instance when
1016 /// CreateCluster was first called, i.e.
1017 /// `projects/<project>/instances/<instance>/tables/<table>`. Any table added
1018 /// to the instance by a later API call will be created in the new cluster by
1019 /// that API call, not this one.
1020 ///
1021 /// Values: information on how much of a table's data has been copied to the
1022 /// newly-created cluster so far.
1023 pub tables: std::collections::HashMap<
1024 std::string::String,
1025 crate::model::create_cluster_metadata::TableProgress,
1026 >,
1027
1028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1029}
1030
1031impl CreateClusterMetadata {
1032 pub fn new() -> Self {
1033 std::default::Default::default()
1034 }
1035
1036 /// Sets the value of [original_request][crate::model::CreateClusterMetadata::original_request].
1037 ///
1038 /// # Example
1039 /// ```ignore,no_run
1040 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1041 /// use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
1042 /// let x = CreateClusterMetadata::new().set_original_request(CreateClusterRequest::default()/* use setters */);
1043 /// ```
1044 pub fn set_original_request<T>(mut self, v: T) -> Self
1045 where
1046 T: std::convert::Into<crate::model::CreateClusterRequest>,
1047 {
1048 self.original_request = std::option::Option::Some(v.into());
1049 self
1050 }
1051
1052 /// Sets or clears the value of [original_request][crate::model::CreateClusterMetadata::original_request].
1053 ///
1054 /// # Example
1055 /// ```ignore,no_run
1056 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1057 /// use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
1058 /// let x = CreateClusterMetadata::new().set_or_clear_original_request(Some(CreateClusterRequest::default()/* use setters */));
1059 /// let x = CreateClusterMetadata::new().set_or_clear_original_request(None::<CreateClusterRequest>);
1060 /// ```
1061 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
1062 where
1063 T: std::convert::Into<crate::model::CreateClusterRequest>,
1064 {
1065 self.original_request = v.map(|x| x.into());
1066 self
1067 }
1068
1069 /// Sets the value of [request_time][crate::model::CreateClusterMetadata::request_time].
1070 ///
1071 /// # Example
1072 /// ```ignore,no_run
1073 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1074 /// use wkt::Timestamp;
1075 /// let x = CreateClusterMetadata::new().set_request_time(Timestamp::default()/* use setters */);
1076 /// ```
1077 pub fn set_request_time<T>(mut self, v: T) -> Self
1078 where
1079 T: std::convert::Into<wkt::Timestamp>,
1080 {
1081 self.request_time = std::option::Option::Some(v.into());
1082 self
1083 }
1084
1085 /// Sets or clears the value of [request_time][crate::model::CreateClusterMetadata::request_time].
1086 ///
1087 /// # Example
1088 /// ```ignore,no_run
1089 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1090 /// use wkt::Timestamp;
1091 /// let x = CreateClusterMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
1092 /// let x = CreateClusterMetadata::new().set_or_clear_request_time(None::<Timestamp>);
1093 /// ```
1094 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
1095 where
1096 T: std::convert::Into<wkt::Timestamp>,
1097 {
1098 self.request_time = v.map(|x| x.into());
1099 self
1100 }
1101
1102 /// Sets the value of [finish_time][crate::model::CreateClusterMetadata::finish_time].
1103 ///
1104 /// # Example
1105 /// ```ignore,no_run
1106 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1107 /// use wkt::Timestamp;
1108 /// let x = CreateClusterMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
1109 /// ```
1110 pub fn set_finish_time<T>(mut self, v: T) -> Self
1111 where
1112 T: std::convert::Into<wkt::Timestamp>,
1113 {
1114 self.finish_time = std::option::Option::Some(v.into());
1115 self
1116 }
1117
1118 /// Sets or clears the value of [finish_time][crate::model::CreateClusterMetadata::finish_time].
1119 ///
1120 /// # Example
1121 /// ```ignore,no_run
1122 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1123 /// use wkt::Timestamp;
1124 /// let x = CreateClusterMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1125 /// let x = CreateClusterMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
1126 /// ```
1127 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1128 where
1129 T: std::convert::Into<wkt::Timestamp>,
1130 {
1131 self.finish_time = v.map(|x| x.into());
1132 self
1133 }
1134
1135 /// Sets the value of [tables][crate::model::CreateClusterMetadata::tables].
1136 ///
1137 /// # Example
1138 /// ```ignore,no_run
1139 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1140 /// use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::TableProgress;
1141 /// let x = CreateClusterMetadata::new().set_tables([
1142 /// ("key0", TableProgress::default()/* use setters */),
1143 /// ("key1", TableProgress::default()/* use (different) setters */),
1144 /// ]);
1145 /// ```
1146 pub fn set_tables<T, K, V>(mut self, v: T) -> Self
1147 where
1148 T: std::iter::IntoIterator<Item = (K, V)>,
1149 K: std::convert::Into<std::string::String>,
1150 V: std::convert::Into<crate::model::create_cluster_metadata::TableProgress>,
1151 {
1152 use std::iter::Iterator;
1153 self.tables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1154 self
1155 }
1156}
1157
1158impl wkt::message::Message for CreateClusterMetadata {
1159 fn typename() -> &'static str {
1160 "type.googleapis.com/google.bigtable.admin.v2.CreateClusterMetadata"
1161 }
1162}
1163
1164/// Defines additional types related to [CreateClusterMetadata].
1165pub mod create_cluster_metadata {
1166 #[allow(unused_imports)]
1167 use super::*;
1168
1169 /// Progress info for copying a table's data to the new cluster.
1170 #[derive(Clone, Default, PartialEq)]
1171 #[non_exhaustive]
1172 pub struct TableProgress {
1173 /// Estimate of the size of the table to be copied.
1174 pub estimated_size_bytes: i64,
1175
1176 /// Estimate of the number of bytes copied so far for this table.
1177 /// This will eventually reach 'estimated_size_bytes' unless the table copy
1178 /// is CANCELLED.
1179 pub estimated_copied_bytes: i64,
1180
1181 pub state: crate::model::create_cluster_metadata::table_progress::State,
1182
1183 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1184 }
1185
1186 impl TableProgress {
1187 pub fn new() -> Self {
1188 std::default::Default::default()
1189 }
1190
1191 /// Sets the value of [estimated_size_bytes][crate::model::create_cluster_metadata::TableProgress::estimated_size_bytes].
1192 ///
1193 /// # Example
1194 /// ```ignore,no_run
1195 /// # use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::TableProgress;
1196 /// let x = TableProgress::new().set_estimated_size_bytes(42);
1197 /// ```
1198 pub fn set_estimated_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1199 self.estimated_size_bytes = v.into();
1200 self
1201 }
1202
1203 /// Sets the value of [estimated_copied_bytes][crate::model::create_cluster_metadata::TableProgress::estimated_copied_bytes].
1204 ///
1205 /// # Example
1206 /// ```ignore,no_run
1207 /// # use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::TableProgress;
1208 /// let x = TableProgress::new().set_estimated_copied_bytes(42);
1209 /// ```
1210 pub fn set_estimated_copied_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1211 self.estimated_copied_bytes = v.into();
1212 self
1213 }
1214
1215 /// Sets the value of [state][crate::model::create_cluster_metadata::TableProgress::state].
1216 ///
1217 /// # Example
1218 /// ```ignore,no_run
1219 /// # use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::TableProgress;
1220 /// use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::table_progress::State;
1221 /// let x0 = TableProgress::new().set_state(State::Pending);
1222 /// let x1 = TableProgress::new().set_state(State::Copying);
1223 /// let x2 = TableProgress::new().set_state(State::Completed);
1224 /// ```
1225 pub fn set_state<
1226 T: std::convert::Into<crate::model::create_cluster_metadata::table_progress::State>,
1227 >(
1228 mut self,
1229 v: T,
1230 ) -> Self {
1231 self.state = v.into();
1232 self
1233 }
1234 }
1235
1236 impl wkt::message::Message for TableProgress {
1237 fn typename() -> &'static str {
1238 "type.googleapis.com/google.bigtable.admin.v2.CreateClusterMetadata.TableProgress"
1239 }
1240 }
1241
1242 /// Defines additional types related to [TableProgress].
1243 pub mod table_progress {
1244 #[allow(unused_imports)]
1245 use super::*;
1246
1247 ///
1248 /// # Working with unknown values
1249 ///
1250 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1251 /// additional enum variants at any time. Adding new variants is not considered
1252 /// a breaking change. Applications should write their code in anticipation of:
1253 ///
1254 /// - New values appearing in future releases of the client library, **and**
1255 /// - New values received dynamically, without application changes.
1256 ///
1257 /// Please consult the [Working with enums] section in the user guide for some
1258 /// guidelines.
1259 ///
1260 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1261 #[derive(Clone, Debug, PartialEq)]
1262 #[non_exhaustive]
1263 pub enum State {
1264 Unspecified,
1265 /// The table has not yet begun copying to the new cluster.
1266 Pending,
1267 /// The table is actively being copied to the new cluster.
1268 Copying,
1269 /// The table has been fully copied to the new cluster.
1270 Completed,
1271 /// The table was deleted before it finished copying to the new cluster.
1272 /// Note that tables deleted after completion will stay marked as
1273 /// COMPLETED, not CANCELLED.
1274 Cancelled,
1275 /// If set, the enum was initialized with an unknown value.
1276 ///
1277 /// Applications can examine the value using [State::value] or
1278 /// [State::name].
1279 UnknownValue(state::UnknownValue),
1280 }
1281
1282 #[doc(hidden)]
1283 pub mod state {
1284 #[allow(unused_imports)]
1285 use super::*;
1286 #[derive(Clone, Debug, PartialEq)]
1287 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1288 }
1289
1290 impl State {
1291 /// Gets the enum value.
1292 ///
1293 /// Returns `None` if the enum contains an unknown value deserialized from
1294 /// the string representation of enums.
1295 pub fn value(&self) -> std::option::Option<i32> {
1296 match self {
1297 Self::Unspecified => std::option::Option::Some(0),
1298 Self::Pending => std::option::Option::Some(1),
1299 Self::Copying => std::option::Option::Some(2),
1300 Self::Completed => std::option::Option::Some(3),
1301 Self::Cancelled => std::option::Option::Some(4),
1302 Self::UnknownValue(u) => u.0.value(),
1303 }
1304 }
1305
1306 /// Gets the enum value as a string.
1307 ///
1308 /// Returns `None` if the enum contains an unknown value deserialized from
1309 /// the integer representation of enums.
1310 pub fn name(&self) -> std::option::Option<&str> {
1311 match self {
1312 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1313 Self::Pending => std::option::Option::Some("PENDING"),
1314 Self::Copying => std::option::Option::Some("COPYING"),
1315 Self::Completed => std::option::Option::Some("COMPLETED"),
1316 Self::Cancelled => std::option::Option::Some("CANCELLED"),
1317 Self::UnknownValue(u) => u.0.name(),
1318 }
1319 }
1320 }
1321
1322 impl std::default::Default for State {
1323 fn default() -> Self {
1324 use std::convert::From;
1325 Self::from(0)
1326 }
1327 }
1328
1329 impl std::fmt::Display for State {
1330 fn fmt(
1331 &self,
1332 f: &mut std::fmt::Formatter<'_>,
1333 ) -> std::result::Result<(), std::fmt::Error> {
1334 wkt::internal::display_enum(f, self.name(), self.value())
1335 }
1336 }
1337
1338 impl std::convert::From<i32> for State {
1339 fn from(value: i32) -> Self {
1340 match value {
1341 0 => Self::Unspecified,
1342 1 => Self::Pending,
1343 2 => Self::Copying,
1344 3 => Self::Completed,
1345 4 => Self::Cancelled,
1346 _ => Self::UnknownValue(state::UnknownValue(
1347 wkt::internal::UnknownEnumValue::Integer(value),
1348 )),
1349 }
1350 }
1351 }
1352
1353 impl std::convert::From<&str> for State {
1354 fn from(value: &str) -> Self {
1355 use std::string::ToString;
1356 match value {
1357 "STATE_UNSPECIFIED" => Self::Unspecified,
1358 "PENDING" => Self::Pending,
1359 "COPYING" => Self::Copying,
1360 "COMPLETED" => Self::Completed,
1361 "CANCELLED" => Self::Cancelled,
1362 _ => Self::UnknownValue(state::UnknownValue(
1363 wkt::internal::UnknownEnumValue::String(value.to_string()),
1364 )),
1365 }
1366 }
1367 }
1368
1369 impl serde::ser::Serialize for State {
1370 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1371 where
1372 S: serde::Serializer,
1373 {
1374 match self {
1375 Self::Unspecified => serializer.serialize_i32(0),
1376 Self::Pending => serializer.serialize_i32(1),
1377 Self::Copying => serializer.serialize_i32(2),
1378 Self::Completed => serializer.serialize_i32(3),
1379 Self::Cancelled => serializer.serialize_i32(4),
1380 Self::UnknownValue(u) => u.0.serialize(serializer),
1381 }
1382 }
1383 }
1384
1385 impl<'de> serde::de::Deserialize<'de> for State {
1386 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1387 where
1388 D: serde::Deserializer<'de>,
1389 {
1390 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1391 ".google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State",
1392 ))
1393 }
1394 }
1395 }
1396}
1397
1398/// The metadata for the Operation returned by UpdateCluster.
1399#[derive(Clone, Default, PartialEq)]
1400#[non_exhaustive]
1401pub struct UpdateClusterMetadata {
1402 /// The request that prompted the initiation of this UpdateCluster operation.
1403 pub original_request: std::option::Option<crate::model::Cluster>,
1404
1405 /// The time at which the original request was received.
1406 pub request_time: std::option::Option<wkt::Timestamp>,
1407
1408 /// The time at which the operation failed or was completed successfully.
1409 pub finish_time: std::option::Option<wkt::Timestamp>,
1410
1411 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1412}
1413
1414impl UpdateClusterMetadata {
1415 pub fn new() -> Self {
1416 std::default::Default::default()
1417 }
1418
1419 /// Sets the value of [original_request][crate::model::UpdateClusterMetadata::original_request].
1420 ///
1421 /// # Example
1422 /// ```ignore,no_run
1423 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1424 /// use google_cloud_bigtable_admin_v2::model::Cluster;
1425 /// let x = UpdateClusterMetadata::new().set_original_request(Cluster::default()/* use setters */);
1426 /// ```
1427 pub fn set_original_request<T>(mut self, v: T) -> Self
1428 where
1429 T: std::convert::Into<crate::model::Cluster>,
1430 {
1431 self.original_request = std::option::Option::Some(v.into());
1432 self
1433 }
1434
1435 /// Sets or clears the value of [original_request][crate::model::UpdateClusterMetadata::original_request].
1436 ///
1437 /// # Example
1438 /// ```ignore,no_run
1439 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1440 /// use google_cloud_bigtable_admin_v2::model::Cluster;
1441 /// let x = UpdateClusterMetadata::new().set_or_clear_original_request(Some(Cluster::default()/* use setters */));
1442 /// let x = UpdateClusterMetadata::new().set_or_clear_original_request(None::<Cluster>);
1443 /// ```
1444 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
1445 where
1446 T: std::convert::Into<crate::model::Cluster>,
1447 {
1448 self.original_request = v.map(|x| x.into());
1449 self
1450 }
1451
1452 /// Sets the value of [request_time][crate::model::UpdateClusterMetadata::request_time].
1453 ///
1454 /// # Example
1455 /// ```ignore,no_run
1456 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1457 /// use wkt::Timestamp;
1458 /// let x = UpdateClusterMetadata::new().set_request_time(Timestamp::default()/* use setters */);
1459 /// ```
1460 pub fn set_request_time<T>(mut self, v: T) -> Self
1461 where
1462 T: std::convert::Into<wkt::Timestamp>,
1463 {
1464 self.request_time = std::option::Option::Some(v.into());
1465 self
1466 }
1467
1468 /// Sets or clears the value of [request_time][crate::model::UpdateClusterMetadata::request_time].
1469 ///
1470 /// # Example
1471 /// ```ignore,no_run
1472 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1473 /// use wkt::Timestamp;
1474 /// let x = UpdateClusterMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
1475 /// let x = UpdateClusterMetadata::new().set_or_clear_request_time(None::<Timestamp>);
1476 /// ```
1477 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
1478 where
1479 T: std::convert::Into<wkt::Timestamp>,
1480 {
1481 self.request_time = v.map(|x| x.into());
1482 self
1483 }
1484
1485 /// Sets the value of [finish_time][crate::model::UpdateClusterMetadata::finish_time].
1486 ///
1487 /// # Example
1488 /// ```ignore,no_run
1489 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1490 /// use wkt::Timestamp;
1491 /// let x = UpdateClusterMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
1492 /// ```
1493 pub fn set_finish_time<T>(mut self, v: T) -> Self
1494 where
1495 T: std::convert::Into<wkt::Timestamp>,
1496 {
1497 self.finish_time = std::option::Option::Some(v.into());
1498 self
1499 }
1500
1501 /// Sets or clears the value of [finish_time][crate::model::UpdateClusterMetadata::finish_time].
1502 ///
1503 /// # Example
1504 /// ```ignore,no_run
1505 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1506 /// use wkt::Timestamp;
1507 /// let x = UpdateClusterMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1508 /// let x = UpdateClusterMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
1509 /// ```
1510 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1511 where
1512 T: std::convert::Into<wkt::Timestamp>,
1513 {
1514 self.finish_time = v.map(|x| x.into());
1515 self
1516 }
1517}
1518
1519impl wkt::message::Message for UpdateClusterMetadata {
1520 fn typename() -> &'static str {
1521 "type.googleapis.com/google.bigtable.admin.v2.UpdateClusterMetadata"
1522 }
1523}
1524
1525/// The metadata for the Operation returned by PartialUpdateCluster.
1526#[derive(Clone, Default, PartialEq)]
1527#[non_exhaustive]
1528pub struct PartialUpdateClusterMetadata {
1529 /// The time at which the original request was received.
1530 pub request_time: std::option::Option<wkt::Timestamp>,
1531
1532 /// The time at which the operation failed or was completed successfully.
1533 pub finish_time: std::option::Option<wkt::Timestamp>,
1534
1535 /// The original request for PartialUpdateCluster.
1536 pub original_request: std::option::Option<crate::model::PartialUpdateClusterRequest>,
1537
1538 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1539}
1540
1541impl PartialUpdateClusterMetadata {
1542 pub fn new() -> Self {
1543 std::default::Default::default()
1544 }
1545
1546 /// Sets the value of [request_time][crate::model::PartialUpdateClusterMetadata::request_time].
1547 ///
1548 /// # Example
1549 /// ```ignore,no_run
1550 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1551 /// use wkt::Timestamp;
1552 /// let x = PartialUpdateClusterMetadata::new().set_request_time(Timestamp::default()/* use setters */);
1553 /// ```
1554 pub fn set_request_time<T>(mut self, v: T) -> Self
1555 where
1556 T: std::convert::Into<wkt::Timestamp>,
1557 {
1558 self.request_time = std::option::Option::Some(v.into());
1559 self
1560 }
1561
1562 /// Sets or clears the value of [request_time][crate::model::PartialUpdateClusterMetadata::request_time].
1563 ///
1564 /// # Example
1565 /// ```ignore,no_run
1566 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1567 /// use wkt::Timestamp;
1568 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
1569 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_request_time(None::<Timestamp>);
1570 /// ```
1571 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
1572 where
1573 T: std::convert::Into<wkt::Timestamp>,
1574 {
1575 self.request_time = v.map(|x| x.into());
1576 self
1577 }
1578
1579 /// Sets the value of [finish_time][crate::model::PartialUpdateClusterMetadata::finish_time].
1580 ///
1581 /// # Example
1582 /// ```ignore,no_run
1583 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1584 /// use wkt::Timestamp;
1585 /// let x = PartialUpdateClusterMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
1586 /// ```
1587 pub fn set_finish_time<T>(mut self, v: T) -> Self
1588 where
1589 T: std::convert::Into<wkt::Timestamp>,
1590 {
1591 self.finish_time = std::option::Option::Some(v.into());
1592 self
1593 }
1594
1595 /// Sets or clears the value of [finish_time][crate::model::PartialUpdateClusterMetadata::finish_time].
1596 ///
1597 /// # Example
1598 /// ```ignore,no_run
1599 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1600 /// use wkt::Timestamp;
1601 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1602 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
1603 /// ```
1604 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1605 where
1606 T: std::convert::Into<wkt::Timestamp>,
1607 {
1608 self.finish_time = v.map(|x| x.into());
1609 self
1610 }
1611
1612 /// Sets the value of [original_request][crate::model::PartialUpdateClusterMetadata::original_request].
1613 ///
1614 /// # Example
1615 /// ```ignore,no_run
1616 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1617 /// use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1618 /// let x = PartialUpdateClusterMetadata::new().set_original_request(PartialUpdateClusterRequest::default()/* use setters */);
1619 /// ```
1620 pub fn set_original_request<T>(mut self, v: T) -> Self
1621 where
1622 T: std::convert::Into<crate::model::PartialUpdateClusterRequest>,
1623 {
1624 self.original_request = std::option::Option::Some(v.into());
1625 self
1626 }
1627
1628 /// Sets or clears the value of [original_request][crate::model::PartialUpdateClusterMetadata::original_request].
1629 ///
1630 /// # Example
1631 /// ```ignore,no_run
1632 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1633 /// use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1634 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_original_request(Some(PartialUpdateClusterRequest::default()/* use setters */));
1635 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_original_request(None::<PartialUpdateClusterRequest>);
1636 /// ```
1637 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
1638 where
1639 T: std::convert::Into<crate::model::PartialUpdateClusterRequest>,
1640 {
1641 self.original_request = v.map(|x| x.into());
1642 self
1643 }
1644}
1645
1646impl wkt::message::Message for PartialUpdateClusterMetadata {
1647 fn typename() -> &'static str {
1648 "type.googleapis.com/google.bigtable.admin.v2.PartialUpdateClusterMetadata"
1649 }
1650}
1651
1652/// Request message for BigtableInstanceAdmin.PartialUpdateCluster.
1653#[derive(Clone, Default, PartialEq)]
1654#[non_exhaustive]
1655pub struct PartialUpdateClusterRequest {
1656 /// Required. The Cluster which contains the partial updates to be applied,
1657 /// subject to the update_mask.
1658 pub cluster: std::option::Option<crate::model::Cluster>,
1659
1660 /// Required. The subset of Cluster fields which should be replaced.
1661 pub update_mask: std::option::Option<wkt::FieldMask>,
1662
1663 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1664}
1665
1666impl PartialUpdateClusterRequest {
1667 pub fn new() -> Self {
1668 std::default::Default::default()
1669 }
1670
1671 /// Sets the value of [cluster][crate::model::PartialUpdateClusterRequest::cluster].
1672 ///
1673 /// # Example
1674 /// ```ignore,no_run
1675 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1676 /// use google_cloud_bigtable_admin_v2::model::Cluster;
1677 /// let x = PartialUpdateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1678 /// ```
1679 pub fn set_cluster<T>(mut self, v: T) -> Self
1680 where
1681 T: std::convert::Into<crate::model::Cluster>,
1682 {
1683 self.cluster = std::option::Option::Some(v.into());
1684 self
1685 }
1686
1687 /// Sets or clears the value of [cluster][crate::model::PartialUpdateClusterRequest::cluster].
1688 ///
1689 /// # Example
1690 /// ```ignore,no_run
1691 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1692 /// use google_cloud_bigtable_admin_v2::model::Cluster;
1693 /// let x = PartialUpdateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1694 /// let x = PartialUpdateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1695 /// ```
1696 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1697 where
1698 T: std::convert::Into<crate::model::Cluster>,
1699 {
1700 self.cluster = v.map(|x| x.into());
1701 self
1702 }
1703
1704 /// Sets the value of [update_mask][crate::model::PartialUpdateClusterRequest::update_mask].
1705 ///
1706 /// # Example
1707 /// ```ignore,no_run
1708 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1709 /// use wkt::FieldMask;
1710 /// let x = PartialUpdateClusterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1711 /// ```
1712 pub fn set_update_mask<T>(mut self, v: T) -> Self
1713 where
1714 T: std::convert::Into<wkt::FieldMask>,
1715 {
1716 self.update_mask = std::option::Option::Some(v.into());
1717 self
1718 }
1719
1720 /// Sets or clears the value of [update_mask][crate::model::PartialUpdateClusterRequest::update_mask].
1721 ///
1722 /// # Example
1723 /// ```ignore,no_run
1724 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1725 /// use wkt::FieldMask;
1726 /// let x = PartialUpdateClusterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1727 /// let x = PartialUpdateClusterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1728 /// ```
1729 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1730 where
1731 T: std::convert::Into<wkt::FieldMask>,
1732 {
1733 self.update_mask = v.map(|x| x.into());
1734 self
1735 }
1736}
1737
1738impl wkt::message::Message for PartialUpdateClusterRequest {
1739 fn typename() -> &'static str {
1740 "type.googleapis.com/google.bigtable.admin.v2.PartialUpdateClusterRequest"
1741 }
1742}
1743
1744/// Request message for BigtableInstanceAdmin.CreateAppProfile.
1745#[derive(Clone, Default, PartialEq)]
1746#[non_exhaustive]
1747pub struct CreateAppProfileRequest {
1748 /// Required. The unique name of the instance in which to create the new app
1749 /// profile. Values are of the form `projects/{project}/instances/{instance}`.
1750 pub parent: std::string::String,
1751
1752 /// Required. The ID to be used when referring to the new app profile within
1753 /// its instance, e.g., just `myprofile` rather than
1754 /// `projects/myproject/instances/myinstance/appProfiles/myprofile`.
1755 pub app_profile_id: std::string::String,
1756
1757 /// Required. The app profile to be created.
1758 /// Fields marked `OutputOnly` will be ignored.
1759 pub app_profile: std::option::Option<crate::model::AppProfile>,
1760
1761 /// If true, ignore safety checks when creating the app profile.
1762 pub ignore_warnings: bool,
1763
1764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1765}
1766
1767impl CreateAppProfileRequest {
1768 pub fn new() -> Self {
1769 std::default::Default::default()
1770 }
1771
1772 /// Sets the value of [parent][crate::model::CreateAppProfileRequest::parent].
1773 ///
1774 /// # Example
1775 /// ```ignore,no_run
1776 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
1777 /// let x = CreateAppProfileRequest::new().set_parent("example");
1778 /// ```
1779 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1780 self.parent = v.into();
1781 self
1782 }
1783
1784 /// Sets the value of [app_profile_id][crate::model::CreateAppProfileRequest::app_profile_id].
1785 ///
1786 /// # Example
1787 /// ```ignore,no_run
1788 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
1789 /// let x = CreateAppProfileRequest::new().set_app_profile_id("example");
1790 /// ```
1791 pub fn set_app_profile_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1792 self.app_profile_id = v.into();
1793 self
1794 }
1795
1796 /// Sets the value of [app_profile][crate::model::CreateAppProfileRequest::app_profile].
1797 ///
1798 /// # Example
1799 /// ```ignore,no_run
1800 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
1801 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
1802 /// let x = CreateAppProfileRequest::new().set_app_profile(AppProfile::default()/* use setters */);
1803 /// ```
1804 pub fn set_app_profile<T>(mut self, v: T) -> Self
1805 where
1806 T: std::convert::Into<crate::model::AppProfile>,
1807 {
1808 self.app_profile = std::option::Option::Some(v.into());
1809 self
1810 }
1811
1812 /// Sets or clears the value of [app_profile][crate::model::CreateAppProfileRequest::app_profile].
1813 ///
1814 /// # Example
1815 /// ```ignore,no_run
1816 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
1817 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
1818 /// let x = CreateAppProfileRequest::new().set_or_clear_app_profile(Some(AppProfile::default()/* use setters */));
1819 /// let x = CreateAppProfileRequest::new().set_or_clear_app_profile(None::<AppProfile>);
1820 /// ```
1821 pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
1822 where
1823 T: std::convert::Into<crate::model::AppProfile>,
1824 {
1825 self.app_profile = v.map(|x| x.into());
1826 self
1827 }
1828
1829 /// Sets the value of [ignore_warnings][crate::model::CreateAppProfileRequest::ignore_warnings].
1830 ///
1831 /// # Example
1832 /// ```ignore,no_run
1833 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
1834 /// let x = CreateAppProfileRequest::new().set_ignore_warnings(true);
1835 /// ```
1836 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1837 self.ignore_warnings = v.into();
1838 self
1839 }
1840}
1841
1842impl wkt::message::Message for CreateAppProfileRequest {
1843 fn typename() -> &'static str {
1844 "type.googleapis.com/google.bigtable.admin.v2.CreateAppProfileRequest"
1845 }
1846}
1847
1848/// Request message for BigtableInstanceAdmin.GetAppProfile.
1849#[derive(Clone, Default, PartialEq)]
1850#[non_exhaustive]
1851pub struct GetAppProfileRequest {
1852 /// Required. The unique name of the requested app profile. Values are of the
1853 /// form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
1854 pub name: std::string::String,
1855
1856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1857}
1858
1859impl GetAppProfileRequest {
1860 pub fn new() -> Self {
1861 std::default::Default::default()
1862 }
1863
1864 /// Sets the value of [name][crate::model::GetAppProfileRequest::name].
1865 ///
1866 /// # Example
1867 /// ```ignore,no_run
1868 /// # use google_cloud_bigtable_admin_v2::model::GetAppProfileRequest;
1869 /// let x = GetAppProfileRequest::new().set_name("example");
1870 /// ```
1871 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1872 self.name = v.into();
1873 self
1874 }
1875}
1876
1877impl wkt::message::Message for GetAppProfileRequest {
1878 fn typename() -> &'static str {
1879 "type.googleapis.com/google.bigtable.admin.v2.GetAppProfileRequest"
1880 }
1881}
1882
1883/// Request message for BigtableInstanceAdmin.ListAppProfiles.
1884#[derive(Clone, Default, PartialEq)]
1885#[non_exhaustive]
1886pub struct ListAppProfilesRequest {
1887 /// Required. The unique name of the instance for which a list of app profiles
1888 /// is requested. Values are of the form
1889 /// `projects/{project}/instances/{instance}`.
1890 /// Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
1891 /// e.g., `projects/myproject/instances/-`.
1892 pub parent: std::string::String,
1893
1894 /// Maximum number of results per page.
1895 ///
1896 /// A page_size of zero lets the server choose the number of items to return.
1897 /// A page_size which is strictly positive will return at most that many items.
1898 /// A negative page_size will cause an error.
1899 ///
1900 /// Following the first request, subsequent paginated calls are not required
1901 /// to pass a page_size. If a page_size is set in subsequent calls, it must
1902 /// match the page_size given in the first request.
1903 pub page_size: i32,
1904
1905 /// The value of `next_page_token` returned by a previous call.
1906 pub page_token: std::string::String,
1907
1908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1909}
1910
1911impl ListAppProfilesRequest {
1912 pub fn new() -> Self {
1913 std::default::Default::default()
1914 }
1915
1916 /// Sets the value of [parent][crate::model::ListAppProfilesRequest::parent].
1917 ///
1918 /// # Example
1919 /// ```ignore,no_run
1920 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesRequest;
1921 /// let x = ListAppProfilesRequest::new().set_parent("example");
1922 /// ```
1923 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1924 self.parent = v.into();
1925 self
1926 }
1927
1928 /// Sets the value of [page_size][crate::model::ListAppProfilesRequest::page_size].
1929 ///
1930 /// # Example
1931 /// ```ignore,no_run
1932 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesRequest;
1933 /// let x = ListAppProfilesRequest::new().set_page_size(42);
1934 /// ```
1935 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1936 self.page_size = v.into();
1937 self
1938 }
1939
1940 /// Sets the value of [page_token][crate::model::ListAppProfilesRequest::page_token].
1941 ///
1942 /// # Example
1943 /// ```ignore,no_run
1944 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesRequest;
1945 /// let x = ListAppProfilesRequest::new().set_page_token("example");
1946 /// ```
1947 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1948 self.page_token = v.into();
1949 self
1950 }
1951}
1952
1953impl wkt::message::Message for ListAppProfilesRequest {
1954 fn typename() -> &'static str {
1955 "type.googleapis.com/google.bigtable.admin.v2.ListAppProfilesRequest"
1956 }
1957}
1958
1959/// Response message for BigtableInstanceAdmin.ListAppProfiles.
1960#[derive(Clone, Default, PartialEq)]
1961#[non_exhaustive]
1962pub struct ListAppProfilesResponse {
1963 /// The list of requested app profiles.
1964 pub app_profiles: std::vec::Vec<crate::model::AppProfile>,
1965
1966 /// Set if not all app profiles could be returned in a single response.
1967 /// Pass this value to `page_token` in another request to get the next
1968 /// page of results.
1969 pub next_page_token: std::string::String,
1970
1971 /// Locations from which AppProfile information could not be retrieved,
1972 /// due to an outage or some other transient condition.
1973 /// AppProfiles from these locations may be missing from `app_profiles`.
1974 /// Values are of the form `projects/<project>/locations/<zone_id>`
1975 pub failed_locations: std::vec::Vec<std::string::String>,
1976
1977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1978}
1979
1980impl ListAppProfilesResponse {
1981 pub fn new() -> Self {
1982 std::default::Default::default()
1983 }
1984
1985 /// Sets the value of [app_profiles][crate::model::ListAppProfilesResponse::app_profiles].
1986 ///
1987 /// # Example
1988 /// ```ignore,no_run
1989 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesResponse;
1990 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
1991 /// let x = ListAppProfilesResponse::new()
1992 /// .set_app_profiles([
1993 /// AppProfile::default()/* use setters */,
1994 /// AppProfile::default()/* use (different) setters */,
1995 /// ]);
1996 /// ```
1997 pub fn set_app_profiles<T, V>(mut self, v: T) -> Self
1998 where
1999 T: std::iter::IntoIterator<Item = V>,
2000 V: std::convert::Into<crate::model::AppProfile>,
2001 {
2002 use std::iter::Iterator;
2003 self.app_profiles = v.into_iter().map(|i| i.into()).collect();
2004 self
2005 }
2006
2007 /// Sets the value of [next_page_token][crate::model::ListAppProfilesResponse::next_page_token].
2008 ///
2009 /// # Example
2010 /// ```ignore,no_run
2011 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesResponse;
2012 /// let x = ListAppProfilesResponse::new().set_next_page_token("example");
2013 /// ```
2014 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2015 self.next_page_token = v.into();
2016 self
2017 }
2018
2019 /// Sets the value of [failed_locations][crate::model::ListAppProfilesResponse::failed_locations].
2020 ///
2021 /// # Example
2022 /// ```ignore,no_run
2023 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesResponse;
2024 /// let x = ListAppProfilesResponse::new().set_failed_locations(["a", "b", "c"]);
2025 /// ```
2026 pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
2027 where
2028 T: std::iter::IntoIterator<Item = V>,
2029 V: std::convert::Into<std::string::String>,
2030 {
2031 use std::iter::Iterator;
2032 self.failed_locations = v.into_iter().map(|i| i.into()).collect();
2033 self
2034 }
2035}
2036
2037impl wkt::message::Message for ListAppProfilesResponse {
2038 fn typename() -> &'static str {
2039 "type.googleapis.com/google.bigtable.admin.v2.ListAppProfilesResponse"
2040 }
2041}
2042
2043#[doc(hidden)]
2044impl google_cloud_gax::paginator::internal::PageableResponse for ListAppProfilesResponse {
2045 type PageItem = crate::model::AppProfile;
2046
2047 fn items(self) -> std::vec::Vec<Self::PageItem> {
2048 self.app_profiles
2049 }
2050
2051 fn next_page_token(&self) -> std::string::String {
2052 use std::clone::Clone;
2053 self.next_page_token.clone()
2054 }
2055}
2056
2057/// Request message for BigtableInstanceAdmin.UpdateAppProfile.
2058#[derive(Clone, Default, PartialEq)]
2059#[non_exhaustive]
2060pub struct UpdateAppProfileRequest {
2061 /// Required. The app profile which will (partially) replace the current value.
2062 pub app_profile: std::option::Option<crate::model::AppProfile>,
2063
2064 /// Required. The subset of app profile fields which should be replaced.
2065 /// If unset, all fields will be replaced.
2066 pub update_mask: std::option::Option<wkt::FieldMask>,
2067
2068 /// If true, ignore safety checks when updating the app profile.
2069 pub ignore_warnings: bool,
2070
2071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2072}
2073
2074impl UpdateAppProfileRequest {
2075 pub fn new() -> Self {
2076 std::default::Default::default()
2077 }
2078
2079 /// Sets the value of [app_profile][crate::model::UpdateAppProfileRequest::app_profile].
2080 ///
2081 /// # Example
2082 /// ```ignore,no_run
2083 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2084 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
2085 /// let x = UpdateAppProfileRequest::new().set_app_profile(AppProfile::default()/* use setters */);
2086 /// ```
2087 pub fn set_app_profile<T>(mut self, v: T) -> Self
2088 where
2089 T: std::convert::Into<crate::model::AppProfile>,
2090 {
2091 self.app_profile = std::option::Option::Some(v.into());
2092 self
2093 }
2094
2095 /// Sets or clears the value of [app_profile][crate::model::UpdateAppProfileRequest::app_profile].
2096 ///
2097 /// # Example
2098 /// ```ignore,no_run
2099 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2100 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
2101 /// let x = UpdateAppProfileRequest::new().set_or_clear_app_profile(Some(AppProfile::default()/* use setters */));
2102 /// let x = UpdateAppProfileRequest::new().set_or_clear_app_profile(None::<AppProfile>);
2103 /// ```
2104 pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
2105 where
2106 T: std::convert::Into<crate::model::AppProfile>,
2107 {
2108 self.app_profile = v.map(|x| x.into());
2109 self
2110 }
2111
2112 /// Sets the value of [update_mask][crate::model::UpdateAppProfileRequest::update_mask].
2113 ///
2114 /// # Example
2115 /// ```ignore,no_run
2116 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2117 /// use wkt::FieldMask;
2118 /// let x = UpdateAppProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2119 /// ```
2120 pub fn set_update_mask<T>(mut self, v: T) -> Self
2121 where
2122 T: std::convert::Into<wkt::FieldMask>,
2123 {
2124 self.update_mask = std::option::Option::Some(v.into());
2125 self
2126 }
2127
2128 /// Sets or clears the value of [update_mask][crate::model::UpdateAppProfileRequest::update_mask].
2129 ///
2130 /// # Example
2131 /// ```ignore,no_run
2132 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2133 /// use wkt::FieldMask;
2134 /// let x = UpdateAppProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2135 /// let x = UpdateAppProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2136 /// ```
2137 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2138 where
2139 T: std::convert::Into<wkt::FieldMask>,
2140 {
2141 self.update_mask = v.map(|x| x.into());
2142 self
2143 }
2144
2145 /// Sets the value of [ignore_warnings][crate::model::UpdateAppProfileRequest::ignore_warnings].
2146 ///
2147 /// # Example
2148 /// ```ignore,no_run
2149 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2150 /// let x = UpdateAppProfileRequest::new().set_ignore_warnings(true);
2151 /// ```
2152 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2153 self.ignore_warnings = v.into();
2154 self
2155 }
2156}
2157
2158impl wkt::message::Message for UpdateAppProfileRequest {
2159 fn typename() -> &'static str {
2160 "type.googleapis.com/google.bigtable.admin.v2.UpdateAppProfileRequest"
2161 }
2162}
2163
2164/// Request message for BigtableInstanceAdmin.DeleteAppProfile.
2165#[derive(Clone, Default, PartialEq)]
2166#[non_exhaustive]
2167pub struct DeleteAppProfileRequest {
2168 /// Required. The unique name of the app profile to be deleted. Values are of
2169 /// the form
2170 /// `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
2171 pub name: std::string::String,
2172
2173 /// Required. If true, ignore safety checks when deleting the app profile.
2174 pub ignore_warnings: bool,
2175
2176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2177}
2178
2179impl DeleteAppProfileRequest {
2180 pub fn new() -> Self {
2181 std::default::Default::default()
2182 }
2183
2184 /// Sets the value of [name][crate::model::DeleteAppProfileRequest::name].
2185 ///
2186 /// # Example
2187 /// ```ignore,no_run
2188 /// # use google_cloud_bigtable_admin_v2::model::DeleteAppProfileRequest;
2189 /// let x = DeleteAppProfileRequest::new().set_name("example");
2190 /// ```
2191 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2192 self.name = v.into();
2193 self
2194 }
2195
2196 /// Sets the value of [ignore_warnings][crate::model::DeleteAppProfileRequest::ignore_warnings].
2197 ///
2198 /// # Example
2199 /// ```ignore,no_run
2200 /// # use google_cloud_bigtable_admin_v2::model::DeleteAppProfileRequest;
2201 /// let x = DeleteAppProfileRequest::new().set_ignore_warnings(true);
2202 /// ```
2203 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2204 self.ignore_warnings = v.into();
2205 self
2206 }
2207}
2208
2209impl wkt::message::Message for DeleteAppProfileRequest {
2210 fn typename() -> &'static str {
2211 "type.googleapis.com/google.bigtable.admin.v2.DeleteAppProfileRequest"
2212 }
2213}
2214
2215/// The metadata for the Operation returned by UpdateAppProfile.
2216#[derive(Clone, Default, PartialEq)]
2217#[non_exhaustive]
2218pub struct UpdateAppProfileMetadata {
2219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2220}
2221
2222impl UpdateAppProfileMetadata {
2223 pub fn new() -> Self {
2224 std::default::Default::default()
2225 }
2226}
2227
2228impl wkt::message::Message for UpdateAppProfileMetadata {
2229 fn typename() -> &'static str {
2230 "type.googleapis.com/google.bigtable.admin.v2.UpdateAppProfileMetadata"
2231 }
2232}
2233
2234/// Request message for BigtableInstanceAdmin.ListHotTablets.
2235#[derive(Clone, Default, PartialEq)]
2236#[non_exhaustive]
2237pub struct ListHotTabletsRequest {
2238 /// Required. The cluster name to list hot tablets.
2239 /// Value is in the following form:
2240 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
2241 pub parent: std::string::String,
2242
2243 /// The start time to list hot tablets. The hot tablets in the response will
2244 /// have start times between the requested start time and end time. Start time
2245 /// defaults to Now if it is unset, and end time defaults to Now - 24 hours if
2246 /// it is unset. The start time should be less than the end time, and the
2247 /// maximum allowed time range between start time and end time is 48 hours.
2248 /// Start time and end time should have values between Now and Now - 14 days.
2249 pub start_time: std::option::Option<wkt::Timestamp>,
2250
2251 /// The end time to list hot tablets.
2252 pub end_time: std::option::Option<wkt::Timestamp>,
2253
2254 /// Maximum number of results per page.
2255 ///
2256 /// A page_size that is empty or zero lets the server choose the number of
2257 /// items to return. A page_size which is strictly positive will return at most
2258 /// that many items. A negative page_size will cause an error.
2259 ///
2260 /// Following the first request, subsequent paginated calls do not need a
2261 /// page_size field. If a page_size is set in subsequent calls, it must match
2262 /// the page_size given in the first request.
2263 pub page_size: i32,
2264
2265 /// The value of `next_page_token` returned by a previous call.
2266 pub page_token: std::string::String,
2267
2268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2269}
2270
2271impl ListHotTabletsRequest {
2272 pub fn new() -> Self {
2273 std::default::Default::default()
2274 }
2275
2276 /// Sets the value of [parent][crate::model::ListHotTabletsRequest::parent].
2277 ///
2278 /// # Example
2279 /// ```ignore,no_run
2280 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2281 /// let x = ListHotTabletsRequest::new().set_parent("example");
2282 /// ```
2283 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2284 self.parent = v.into();
2285 self
2286 }
2287
2288 /// Sets the value of [start_time][crate::model::ListHotTabletsRequest::start_time].
2289 ///
2290 /// # Example
2291 /// ```ignore,no_run
2292 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2293 /// use wkt::Timestamp;
2294 /// let x = ListHotTabletsRequest::new().set_start_time(Timestamp::default()/* use setters */);
2295 /// ```
2296 pub fn set_start_time<T>(mut self, v: T) -> Self
2297 where
2298 T: std::convert::Into<wkt::Timestamp>,
2299 {
2300 self.start_time = std::option::Option::Some(v.into());
2301 self
2302 }
2303
2304 /// Sets or clears the value of [start_time][crate::model::ListHotTabletsRequest::start_time].
2305 ///
2306 /// # Example
2307 /// ```ignore,no_run
2308 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2309 /// use wkt::Timestamp;
2310 /// let x = ListHotTabletsRequest::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
2311 /// let x = ListHotTabletsRequest::new().set_or_clear_start_time(None::<Timestamp>);
2312 /// ```
2313 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2314 where
2315 T: std::convert::Into<wkt::Timestamp>,
2316 {
2317 self.start_time = v.map(|x| x.into());
2318 self
2319 }
2320
2321 /// Sets the value of [end_time][crate::model::ListHotTabletsRequest::end_time].
2322 ///
2323 /// # Example
2324 /// ```ignore,no_run
2325 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2326 /// use wkt::Timestamp;
2327 /// let x = ListHotTabletsRequest::new().set_end_time(Timestamp::default()/* use setters */);
2328 /// ```
2329 pub fn set_end_time<T>(mut self, v: T) -> Self
2330 where
2331 T: std::convert::Into<wkt::Timestamp>,
2332 {
2333 self.end_time = std::option::Option::Some(v.into());
2334 self
2335 }
2336
2337 /// Sets or clears the value of [end_time][crate::model::ListHotTabletsRequest::end_time].
2338 ///
2339 /// # Example
2340 /// ```ignore,no_run
2341 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2342 /// use wkt::Timestamp;
2343 /// let x = ListHotTabletsRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2344 /// let x = ListHotTabletsRequest::new().set_or_clear_end_time(None::<Timestamp>);
2345 /// ```
2346 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2347 where
2348 T: std::convert::Into<wkt::Timestamp>,
2349 {
2350 self.end_time = v.map(|x| x.into());
2351 self
2352 }
2353
2354 /// Sets the value of [page_size][crate::model::ListHotTabletsRequest::page_size].
2355 ///
2356 /// # Example
2357 /// ```ignore,no_run
2358 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2359 /// let x = ListHotTabletsRequest::new().set_page_size(42);
2360 /// ```
2361 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2362 self.page_size = v.into();
2363 self
2364 }
2365
2366 /// Sets the value of [page_token][crate::model::ListHotTabletsRequest::page_token].
2367 ///
2368 /// # Example
2369 /// ```ignore,no_run
2370 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2371 /// let x = ListHotTabletsRequest::new().set_page_token("example");
2372 /// ```
2373 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2374 self.page_token = v.into();
2375 self
2376 }
2377}
2378
2379impl wkt::message::Message for ListHotTabletsRequest {
2380 fn typename() -> &'static str {
2381 "type.googleapis.com/google.bigtable.admin.v2.ListHotTabletsRequest"
2382 }
2383}
2384
2385/// Response message for BigtableInstanceAdmin.ListHotTablets.
2386#[derive(Clone, Default, PartialEq)]
2387#[non_exhaustive]
2388pub struct ListHotTabletsResponse {
2389 /// List of hot tablets in the tables of the requested cluster that fall
2390 /// within the requested time range. Hot tablets are ordered by node cpu usage
2391 /// percent. If there are multiple hot tablets that correspond to the same
2392 /// tablet within a 15-minute interval, only the hot tablet with the highest
2393 /// node cpu usage will be included in the response.
2394 pub hot_tablets: std::vec::Vec<crate::model::HotTablet>,
2395
2396 /// Set if not all hot tablets could be returned in a single response.
2397 /// Pass this value to `page_token` in another request to get the next
2398 /// page of results.
2399 pub next_page_token: std::string::String,
2400
2401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2402}
2403
2404impl ListHotTabletsResponse {
2405 pub fn new() -> Self {
2406 std::default::Default::default()
2407 }
2408
2409 /// Sets the value of [hot_tablets][crate::model::ListHotTabletsResponse::hot_tablets].
2410 ///
2411 /// # Example
2412 /// ```ignore,no_run
2413 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsResponse;
2414 /// use google_cloud_bigtable_admin_v2::model::HotTablet;
2415 /// let x = ListHotTabletsResponse::new()
2416 /// .set_hot_tablets([
2417 /// HotTablet::default()/* use setters */,
2418 /// HotTablet::default()/* use (different) setters */,
2419 /// ]);
2420 /// ```
2421 pub fn set_hot_tablets<T, V>(mut self, v: T) -> Self
2422 where
2423 T: std::iter::IntoIterator<Item = V>,
2424 V: std::convert::Into<crate::model::HotTablet>,
2425 {
2426 use std::iter::Iterator;
2427 self.hot_tablets = v.into_iter().map(|i| i.into()).collect();
2428 self
2429 }
2430
2431 /// Sets the value of [next_page_token][crate::model::ListHotTabletsResponse::next_page_token].
2432 ///
2433 /// # Example
2434 /// ```ignore,no_run
2435 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsResponse;
2436 /// let x = ListHotTabletsResponse::new().set_next_page_token("example");
2437 /// ```
2438 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2439 self.next_page_token = v.into();
2440 self
2441 }
2442}
2443
2444impl wkt::message::Message for ListHotTabletsResponse {
2445 fn typename() -> &'static str {
2446 "type.googleapis.com/google.bigtable.admin.v2.ListHotTabletsResponse"
2447 }
2448}
2449
2450#[doc(hidden)]
2451impl google_cloud_gax::paginator::internal::PageableResponse for ListHotTabletsResponse {
2452 type PageItem = crate::model::HotTablet;
2453
2454 fn items(self) -> std::vec::Vec<Self::PageItem> {
2455 self.hot_tablets
2456 }
2457
2458 fn next_page_token(&self) -> std::string::String {
2459 use std::clone::Clone;
2460 self.next_page_token.clone()
2461 }
2462}
2463
2464/// Request message for BigtableInstanceAdmin.CreateLogicalView.
2465#[derive(Clone, Default, PartialEq)]
2466#[non_exhaustive]
2467pub struct CreateLogicalViewRequest {
2468 /// Required. The parent instance where this logical view will be created.
2469 /// Format: `projects/{project}/instances/{instance}`.
2470 pub parent: std::string::String,
2471
2472 /// Required. The ID to use for the logical view, which will become the final
2473 /// component of the logical view's resource name.
2474 pub logical_view_id: std::string::String,
2475
2476 /// Required. The logical view to create.
2477 pub logical_view: std::option::Option<crate::model::LogicalView>,
2478
2479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2480}
2481
2482impl CreateLogicalViewRequest {
2483 pub fn new() -> Self {
2484 std::default::Default::default()
2485 }
2486
2487 /// Sets the value of [parent][crate::model::CreateLogicalViewRequest::parent].
2488 ///
2489 /// # Example
2490 /// ```ignore,no_run
2491 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
2492 /// let x = CreateLogicalViewRequest::new().set_parent("example");
2493 /// ```
2494 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2495 self.parent = v.into();
2496 self
2497 }
2498
2499 /// Sets the value of [logical_view_id][crate::model::CreateLogicalViewRequest::logical_view_id].
2500 ///
2501 /// # Example
2502 /// ```ignore,no_run
2503 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
2504 /// let x = CreateLogicalViewRequest::new().set_logical_view_id("example");
2505 /// ```
2506 pub fn set_logical_view_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2507 self.logical_view_id = v.into();
2508 self
2509 }
2510
2511 /// Sets the value of [logical_view][crate::model::CreateLogicalViewRequest::logical_view].
2512 ///
2513 /// # Example
2514 /// ```ignore,no_run
2515 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
2516 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
2517 /// let x = CreateLogicalViewRequest::new().set_logical_view(LogicalView::default()/* use setters */);
2518 /// ```
2519 pub fn set_logical_view<T>(mut self, v: T) -> Self
2520 where
2521 T: std::convert::Into<crate::model::LogicalView>,
2522 {
2523 self.logical_view = std::option::Option::Some(v.into());
2524 self
2525 }
2526
2527 /// Sets or clears the value of [logical_view][crate::model::CreateLogicalViewRequest::logical_view].
2528 ///
2529 /// # Example
2530 /// ```ignore,no_run
2531 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
2532 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
2533 /// let x = CreateLogicalViewRequest::new().set_or_clear_logical_view(Some(LogicalView::default()/* use setters */));
2534 /// let x = CreateLogicalViewRequest::new().set_or_clear_logical_view(None::<LogicalView>);
2535 /// ```
2536 pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
2537 where
2538 T: std::convert::Into<crate::model::LogicalView>,
2539 {
2540 self.logical_view = v.map(|x| x.into());
2541 self
2542 }
2543}
2544
2545impl wkt::message::Message for CreateLogicalViewRequest {
2546 fn typename() -> &'static str {
2547 "type.googleapis.com/google.bigtable.admin.v2.CreateLogicalViewRequest"
2548 }
2549}
2550
2551/// The metadata for the Operation returned by CreateLogicalView.
2552#[derive(Clone, Default, PartialEq)]
2553#[non_exhaustive]
2554pub struct CreateLogicalViewMetadata {
2555 /// The request that prompted the initiation of this CreateLogicalView
2556 /// operation.
2557 pub original_request: std::option::Option<crate::model::CreateLogicalViewRequest>,
2558
2559 /// The time at which this operation started.
2560 pub start_time: std::option::Option<wkt::Timestamp>,
2561
2562 /// If set, the time at which this operation finished or was canceled.
2563 pub end_time: std::option::Option<wkt::Timestamp>,
2564
2565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2566}
2567
2568impl CreateLogicalViewMetadata {
2569 pub fn new() -> Self {
2570 std::default::Default::default()
2571 }
2572
2573 /// Sets the value of [original_request][crate::model::CreateLogicalViewMetadata::original_request].
2574 ///
2575 /// # Example
2576 /// ```ignore,no_run
2577 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
2578 /// use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
2579 /// let x = CreateLogicalViewMetadata::new().set_original_request(CreateLogicalViewRequest::default()/* use setters */);
2580 /// ```
2581 pub fn set_original_request<T>(mut self, v: T) -> Self
2582 where
2583 T: std::convert::Into<crate::model::CreateLogicalViewRequest>,
2584 {
2585 self.original_request = std::option::Option::Some(v.into());
2586 self
2587 }
2588
2589 /// Sets or clears the value of [original_request][crate::model::CreateLogicalViewMetadata::original_request].
2590 ///
2591 /// # Example
2592 /// ```ignore,no_run
2593 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
2594 /// use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
2595 /// let x = CreateLogicalViewMetadata::new().set_or_clear_original_request(Some(CreateLogicalViewRequest::default()/* use setters */));
2596 /// let x = CreateLogicalViewMetadata::new().set_or_clear_original_request(None::<CreateLogicalViewRequest>);
2597 /// ```
2598 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
2599 where
2600 T: std::convert::Into<crate::model::CreateLogicalViewRequest>,
2601 {
2602 self.original_request = v.map(|x| x.into());
2603 self
2604 }
2605
2606 /// Sets the value of [start_time][crate::model::CreateLogicalViewMetadata::start_time].
2607 ///
2608 /// # Example
2609 /// ```ignore,no_run
2610 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
2611 /// use wkt::Timestamp;
2612 /// let x = CreateLogicalViewMetadata::new().set_start_time(Timestamp::default()/* use setters */);
2613 /// ```
2614 pub fn set_start_time<T>(mut self, v: T) -> Self
2615 where
2616 T: std::convert::Into<wkt::Timestamp>,
2617 {
2618 self.start_time = std::option::Option::Some(v.into());
2619 self
2620 }
2621
2622 /// Sets or clears the value of [start_time][crate::model::CreateLogicalViewMetadata::start_time].
2623 ///
2624 /// # Example
2625 /// ```ignore,no_run
2626 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
2627 /// use wkt::Timestamp;
2628 /// let x = CreateLogicalViewMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
2629 /// let x = CreateLogicalViewMetadata::new().set_or_clear_start_time(None::<Timestamp>);
2630 /// ```
2631 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2632 where
2633 T: std::convert::Into<wkt::Timestamp>,
2634 {
2635 self.start_time = v.map(|x| x.into());
2636 self
2637 }
2638
2639 /// Sets the value of [end_time][crate::model::CreateLogicalViewMetadata::end_time].
2640 ///
2641 /// # Example
2642 /// ```ignore,no_run
2643 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
2644 /// use wkt::Timestamp;
2645 /// let x = CreateLogicalViewMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2646 /// ```
2647 pub fn set_end_time<T>(mut self, v: T) -> Self
2648 where
2649 T: std::convert::Into<wkt::Timestamp>,
2650 {
2651 self.end_time = std::option::Option::Some(v.into());
2652 self
2653 }
2654
2655 /// Sets or clears the value of [end_time][crate::model::CreateLogicalViewMetadata::end_time].
2656 ///
2657 /// # Example
2658 /// ```ignore,no_run
2659 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
2660 /// use wkt::Timestamp;
2661 /// let x = CreateLogicalViewMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2662 /// let x = CreateLogicalViewMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2663 /// ```
2664 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2665 where
2666 T: std::convert::Into<wkt::Timestamp>,
2667 {
2668 self.end_time = v.map(|x| x.into());
2669 self
2670 }
2671}
2672
2673impl wkt::message::Message for CreateLogicalViewMetadata {
2674 fn typename() -> &'static str {
2675 "type.googleapis.com/google.bigtable.admin.v2.CreateLogicalViewMetadata"
2676 }
2677}
2678
2679/// Request message for BigtableInstanceAdmin.GetLogicalView.
2680#[derive(Clone, Default, PartialEq)]
2681#[non_exhaustive]
2682pub struct GetLogicalViewRequest {
2683 /// Required. The unique name of the requested logical view. Values are of the
2684 /// form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
2685 pub name: std::string::String,
2686
2687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2688}
2689
2690impl GetLogicalViewRequest {
2691 pub fn new() -> Self {
2692 std::default::Default::default()
2693 }
2694
2695 /// Sets the value of [name][crate::model::GetLogicalViewRequest::name].
2696 ///
2697 /// # Example
2698 /// ```ignore,no_run
2699 /// # use google_cloud_bigtable_admin_v2::model::GetLogicalViewRequest;
2700 /// let x = GetLogicalViewRequest::new().set_name("example");
2701 /// ```
2702 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2703 self.name = v.into();
2704 self
2705 }
2706}
2707
2708impl wkt::message::Message for GetLogicalViewRequest {
2709 fn typename() -> &'static str {
2710 "type.googleapis.com/google.bigtable.admin.v2.GetLogicalViewRequest"
2711 }
2712}
2713
2714/// Request message for BigtableInstanceAdmin.ListLogicalViews.
2715#[derive(Clone, Default, PartialEq)]
2716#[non_exhaustive]
2717pub struct ListLogicalViewsRequest {
2718 /// Required. The unique name of the instance for which the list of logical
2719 /// views is requested. Values are of the form
2720 /// `projects/{project}/instances/{instance}`.
2721 pub parent: std::string::String,
2722
2723 /// Optional. The maximum number of logical views to return. The service may
2724 /// return fewer than this value
2725 pub page_size: i32,
2726
2727 /// Optional. A page token, received from a previous `ListLogicalViews` call.
2728 /// Provide this to retrieve the subsequent page.
2729 ///
2730 /// When paginating, all other parameters provided to `ListLogicalViews` must
2731 /// match the call that provided the page token.
2732 pub page_token: std::string::String,
2733
2734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2735}
2736
2737impl ListLogicalViewsRequest {
2738 pub fn new() -> Self {
2739 std::default::Default::default()
2740 }
2741
2742 /// Sets the value of [parent][crate::model::ListLogicalViewsRequest::parent].
2743 ///
2744 /// # Example
2745 /// ```ignore,no_run
2746 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsRequest;
2747 /// let x = ListLogicalViewsRequest::new().set_parent("example");
2748 /// ```
2749 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2750 self.parent = v.into();
2751 self
2752 }
2753
2754 /// Sets the value of [page_size][crate::model::ListLogicalViewsRequest::page_size].
2755 ///
2756 /// # Example
2757 /// ```ignore,no_run
2758 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsRequest;
2759 /// let x = ListLogicalViewsRequest::new().set_page_size(42);
2760 /// ```
2761 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2762 self.page_size = v.into();
2763 self
2764 }
2765
2766 /// Sets the value of [page_token][crate::model::ListLogicalViewsRequest::page_token].
2767 ///
2768 /// # Example
2769 /// ```ignore,no_run
2770 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsRequest;
2771 /// let x = ListLogicalViewsRequest::new().set_page_token("example");
2772 /// ```
2773 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2774 self.page_token = v.into();
2775 self
2776 }
2777}
2778
2779impl wkt::message::Message for ListLogicalViewsRequest {
2780 fn typename() -> &'static str {
2781 "type.googleapis.com/google.bigtable.admin.v2.ListLogicalViewsRequest"
2782 }
2783}
2784
2785/// Response message for BigtableInstanceAdmin.ListLogicalViews.
2786#[derive(Clone, Default, PartialEq)]
2787#[non_exhaustive]
2788pub struct ListLogicalViewsResponse {
2789 /// The list of requested logical views.
2790 pub logical_views: std::vec::Vec<crate::model::LogicalView>,
2791
2792 /// A token, which can be sent as `page_token` to retrieve the next page.
2793 /// If this field is omitted, there are no subsequent pages.
2794 pub next_page_token: std::string::String,
2795
2796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2797}
2798
2799impl ListLogicalViewsResponse {
2800 pub fn new() -> Self {
2801 std::default::Default::default()
2802 }
2803
2804 /// Sets the value of [logical_views][crate::model::ListLogicalViewsResponse::logical_views].
2805 ///
2806 /// # Example
2807 /// ```ignore,no_run
2808 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsResponse;
2809 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
2810 /// let x = ListLogicalViewsResponse::new()
2811 /// .set_logical_views([
2812 /// LogicalView::default()/* use setters */,
2813 /// LogicalView::default()/* use (different) setters */,
2814 /// ]);
2815 /// ```
2816 pub fn set_logical_views<T, V>(mut self, v: T) -> Self
2817 where
2818 T: std::iter::IntoIterator<Item = V>,
2819 V: std::convert::Into<crate::model::LogicalView>,
2820 {
2821 use std::iter::Iterator;
2822 self.logical_views = v.into_iter().map(|i| i.into()).collect();
2823 self
2824 }
2825
2826 /// Sets the value of [next_page_token][crate::model::ListLogicalViewsResponse::next_page_token].
2827 ///
2828 /// # Example
2829 /// ```ignore,no_run
2830 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsResponse;
2831 /// let x = ListLogicalViewsResponse::new().set_next_page_token("example");
2832 /// ```
2833 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2834 self.next_page_token = v.into();
2835 self
2836 }
2837}
2838
2839impl wkt::message::Message for ListLogicalViewsResponse {
2840 fn typename() -> &'static str {
2841 "type.googleapis.com/google.bigtable.admin.v2.ListLogicalViewsResponse"
2842 }
2843}
2844
2845#[doc(hidden)]
2846impl google_cloud_gax::paginator::internal::PageableResponse for ListLogicalViewsResponse {
2847 type PageItem = crate::model::LogicalView;
2848
2849 fn items(self) -> std::vec::Vec<Self::PageItem> {
2850 self.logical_views
2851 }
2852
2853 fn next_page_token(&self) -> std::string::String {
2854 use std::clone::Clone;
2855 self.next_page_token.clone()
2856 }
2857}
2858
2859/// Request message for BigtableInstanceAdmin.UpdateLogicalView.
2860#[derive(Clone, Default, PartialEq)]
2861#[non_exhaustive]
2862pub struct UpdateLogicalViewRequest {
2863 /// Required. The logical view to update.
2864 ///
2865 /// The logical view's `name` field is used to identify the view to update.
2866 /// Format:
2867 /// `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
2868 pub logical_view: std::option::Option<crate::model::LogicalView>,
2869
2870 /// Optional. The list of fields to update.
2871 pub update_mask: std::option::Option<wkt::FieldMask>,
2872
2873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2874}
2875
2876impl UpdateLogicalViewRequest {
2877 pub fn new() -> Self {
2878 std::default::Default::default()
2879 }
2880
2881 /// Sets the value of [logical_view][crate::model::UpdateLogicalViewRequest::logical_view].
2882 ///
2883 /// # Example
2884 /// ```ignore,no_run
2885 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
2886 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
2887 /// let x = UpdateLogicalViewRequest::new().set_logical_view(LogicalView::default()/* use setters */);
2888 /// ```
2889 pub fn set_logical_view<T>(mut self, v: T) -> Self
2890 where
2891 T: std::convert::Into<crate::model::LogicalView>,
2892 {
2893 self.logical_view = std::option::Option::Some(v.into());
2894 self
2895 }
2896
2897 /// Sets or clears the value of [logical_view][crate::model::UpdateLogicalViewRequest::logical_view].
2898 ///
2899 /// # Example
2900 /// ```ignore,no_run
2901 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
2902 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
2903 /// let x = UpdateLogicalViewRequest::new().set_or_clear_logical_view(Some(LogicalView::default()/* use setters */));
2904 /// let x = UpdateLogicalViewRequest::new().set_or_clear_logical_view(None::<LogicalView>);
2905 /// ```
2906 pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
2907 where
2908 T: std::convert::Into<crate::model::LogicalView>,
2909 {
2910 self.logical_view = v.map(|x| x.into());
2911 self
2912 }
2913
2914 /// Sets the value of [update_mask][crate::model::UpdateLogicalViewRequest::update_mask].
2915 ///
2916 /// # Example
2917 /// ```ignore,no_run
2918 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
2919 /// use wkt::FieldMask;
2920 /// let x = UpdateLogicalViewRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2921 /// ```
2922 pub fn set_update_mask<T>(mut self, v: T) -> Self
2923 where
2924 T: std::convert::Into<wkt::FieldMask>,
2925 {
2926 self.update_mask = std::option::Option::Some(v.into());
2927 self
2928 }
2929
2930 /// Sets or clears the value of [update_mask][crate::model::UpdateLogicalViewRequest::update_mask].
2931 ///
2932 /// # Example
2933 /// ```ignore,no_run
2934 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
2935 /// use wkt::FieldMask;
2936 /// let x = UpdateLogicalViewRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2937 /// let x = UpdateLogicalViewRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2938 /// ```
2939 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2940 where
2941 T: std::convert::Into<wkt::FieldMask>,
2942 {
2943 self.update_mask = v.map(|x| x.into());
2944 self
2945 }
2946}
2947
2948impl wkt::message::Message for UpdateLogicalViewRequest {
2949 fn typename() -> &'static str {
2950 "type.googleapis.com/google.bigtable.admin.v2.UpdateLogicalViewRequest"
2951 }
2952}
2953
2954/// The metadata for the Operation returned by UpdateLogicalView.
2955#[derive(Clone, Default, PartialEq)]
2956#[non_exhaustive]
2957pub struct UpdateLogicalViewMetadata {
2958 /// The request that prompted the initiation of this UpdateLogicalView
2959 /// operation.
2960 pub original_request: std::option::Option<crate::model::UpdateLogicalViewRequest>,
2961
2962 /// The time at which this operation was started.
2963 pub start_time: std::option::Option<wkt::Timestamp>,
2964
2965 /// If set, the time at which this operation finished or was canceled.
2966 pub end_time: std::option::Option<wkt::Timestamp>,
2967
2968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2969}
2970
2971impl UpdateLogicalViewMetadata {
2972 pub fn new() -> Self {
2973 std::default::Default::default()
2974 }
2975
2976 /// Sets the value of [original_request][crate::model::UpdateLogicalViewMetadata::original_request].
2977 ///
2978 /// # Example
2979 /// ```ignore,no_run
2980 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
2981 /// use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
2982 /// let x = UpdateLogicalViewMetadata::new().set_original_request(UpdateLogicalViewRequest::default()/* use setters */);
2983 /// ```
2984 pub fn set_original_request<T>(mut self, v: T) -> Self
2985 where
2986 T: std::convert::Into<crate::model::UpdateLogicalViewRequest>,
2987 {
2988 self.original_request = std::option::Option::Some(v.into());
2989 self
2990 }
2991
2992 /// Sets or clears the value of [original_request][crate::model::UpdateLogicalViewMetadata::original_request].
2993 ///
2994 /// # Example
2995 /// ```ignore,no_run
2996 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
2997 /// use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
2998 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_original_request(Some(UpdateLogicalViewRequest::default()/* use setters */));
2999 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_original_request(None::<UpdateLogicalViewRequest>);
3000 /// ```
3001 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
3002 where
3003 T: std::convert::Into<crate::model::UpdateLogicalViewRequest>,
3004 {
3005 self.original_request = v.map(|x| x.into());
3006 self
3007 }
3008
3009 /// Sets the value of [start_time][crate::model::UpdateLogicalViewMetadata::start_time].
3010 ///
3011 /// # Example
3012 /// ```ignore,no_run
3013 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3014 /// use wkt::Timestamp;
3015 /// let x = UpdateLogicalViewMetadata::new().set_start_time(Timestamp::default()/* use setters */);
3016 /// ```
3017 pub fn set_start_time<T>(mut self, v: T) -> Self
3018 where
3019 T: std::convert::Into<wkt::Timestamp>,
3020 {
3021 self.start_time = std::option::Option::Some(v.into());
3022 self
3023 }
3024
3025 /// Sets or clears the value of [start_time][crate::model::UpdateLogicalViewMetadata::start_time].
3026 ///
3027 /// # Example
3028 /// ```ignore,no_run
3029 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3030 /// use wkt::Timestamp;
3031 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3032 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_start_time(None::<Timestamp>);
3033 /// ```
3034 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3035 where
3036 T: std::convert::Into<wkt::Timestamp>,
3037 {
3038 self.start_time = v.map(|x| x.into());
3039 self
3040 }
3041
3042 /// Sets the value of [end_time][crate::model::UpdateLogicalViewMetadata::end_time].
3043 ///
3044 /// # Example
3045 /// ```ignore,no_run
3046 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3047 /// use wkt::Timestamp;
3048 /// let x = UpdateLogicalViewMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3049 /// ```
3050 pub fn set_end_time<T>(mut self, v: T) -> Self
3051 where
3052 T: std::convert::Into<wkt::Timestamp>,
3053 {
3054 self.end_time = std::option::Option::Some(v.into());
3055 self
3056 }
3057
3058 /// Sets or clears the value of [end_time][crate::model::UpdateLogicalViewMetadata::end_time].
3059 ///
3060 /// # Example
3061 /// ```ignore,no_run
3062 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3063 /// use wkt::Timestamp;
3064 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3065 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3066 /// ```
3067 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3068 where
3069 T: std::convert::Into<wkt::Timestamp>,
3070 {
3071 self.end_time = v.map(|x| x.into());
3072 self
3073 }
3074}
3075
3076impl wkt::message::Message for UpdateLogicalViewMetadata {
3077 fn typename() -> &'static str {
3078 "type.googleapis.com/google.bigtable.admin.v2.UpdateLogicalViewMetadata"
3079 }
3080}
3081
3082/// Request message for BigtableInstanceAdmin.DeleteLogicalView.
3083#[derive(Clone, Default, PartialEq)]
3084#[non_exhaustive]
3085pub struct DeleteLogicalViewRequest {
3086 /// Required. The unique name of the logical view to be deleted.
3087 /// Format:
3088 /// `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
3089 pub name: std::string::String,
3090
3091 /// Optional. The current etag of the logical view.
3092 /// If an etag is provided and does not match the current etag of the
3093 /// logical view, deletion will be blocked and an ABORTED error will be
3094 /// returned.
3095 pub etag: std::string::String,
3096
3097 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3098}
3099
3100impl DeleteLogicalViewRequest {
3101 pub fn new() -> Self {
3102 std::default::Default::default()
3103 }
3104
3105 /// Sets the value of [name][crate::model::DeleteLogicalViewRequest::name].
3106 ///
3107 /// # Example
3108 /// ```ignore,no_run
3109 /// # use google_cloud_bigtable_admin_v2::model::DeleteLogicalViewRequest;
3110 /// let x = DeleteLogicalViewRequest::new().set_name("example");
3111 /// ```
3112 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3113 self.name = v.into();
3114 self
3115 }
3116
3117 /// Sets the value of [etag][crate::model::DeleteLogicalViewRequest::etag].
3118 ///
3119 /// # Example
3120 /// ```ignore,no_run
3121 /// # use google_cloud_bigtable_admin_v2::model::DeleteLogicalViewRequest;
3122 /// let x = DeleteLogicalViewRequest::new().set_etag("example");
3123 /// ```
3124 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3125 self.etag = v.into();
3126 self
3127 }
3128}
3129
3130impl wkt::message::Message for DeleteLogicalViewRequest {
3131 fn typename() -> &'static str {
3132 "type.googleapis.com/google.bigtable.admin.v2.DeleteLogicalViewRequest"
3133 }
3134}
3135
3136/// Request message for BigtableInstanceAdmin.CreateMaterializedView.
3137#[derive(Clone, Default, PartialEq)]
3138#[non_exhaustive]
3139pub struct CreateMaterializedViewRequest {
3140 /// Required. The parent instance where this materialized view will be created.
3141 /// Format: `projects/{project}/instances/{instance}`.
3142 pub parent: std::string::String,
3143
3144 /// Required. The ID to use for the materialized view, which will become the
3145 /// final component of the materialized view's resource name.
3146 pub materialized_view_id: std::string::String,
3147
3148 /// Required. The materialized view to create.
3149 pub materialized_view: std::option::Option<crate::model::MaterializedView>,
3150
3151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3152}
3153
3154impl CreateMaterializedViewRequest {
3155 pub fn new() -> Self {
3156 std::default::Default::default()
3157 }
3158
3159 /// Sets the value of [parent][crate::model::CreateMaterializedViewRequest::parent].
3160 ///
3161 /// # Example
3162 /// ```ignore,no_run
3163 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3164 /// let x = CreateMaterializedViewRequest::new().set_parent("example");
3165 /// ```
3166 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3167 self.parent = v.into();
3168 self
3169 }
3170
3171 /// Sets the value of [materialized_view_id][crate::model::CreateMaterializedViewRequest::materialized_view_id].
3172 ///
3173 /// # Example
3174 /// ```ignore,no_run
3175 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3176 /// let x = CreateMaterializedViewRequest::new().set_materialized_view_id("example");
3177 /// ```
3178 pub fn set_materialized_view_id<T: std::convert::Into<std::string::String>>(
3179 mut self,
3180 v: T,
3181 ) -> Self {
3182 self.materialized_view_id = v.into();
3183 self
3184 }
3185
3186 /// Sets the value of [materialized_view][crate::model::CreateMaterializedViewRequest::materialized_view].
3187 ///
3188 /// # Example
3189 /// ```ignore,no_run
3190 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3191 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
3192 /// let x = CreateMaterializedViewRequest::new().set_materialized_view(MaterializedView::default()/* use setters */);
3193 /// ```
3194 pub fn set_materialized_view<T>(mut self, v: T) -> Self
3195 where
3196 T: std::convert::Into<crate::model::MaterializedView>,
3197 {
3198 self.materialized_view = std::option::Option::Some(v.into());
3199 self
3200 }
3201
3202 /// Sets or clears the value of [materialized_view][crate::model::CreateMaterializedViewRequest::materialized_view].
3203 ///
3204 /// # Example
3205 /// ```ignore,no_run
3206 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3207 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
3208 /// let x = CreateMaterializedViewRequest::new().set_or_clear_materialized_view(Some(MaterializedView::default()/* use setters */));
3209 /// let x = CreateMaterializedViewRequest::new().set_or_clear_materialized_view(None::<MaterializedView>);
3210 /// ```
3211 pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
3212 where
3213 T: std::convert::Into<crate::model::MaterializedView>,
3214 {
3215 self.materialized_view = v.map(|x| x.into());
3216 self
3217 }
3218}
3219
3220impl wkt::message::Message for CreateMaterializedViewRequest {
3221 fn typename() -> &'static str {
3222 "type.googleapis.com/google.bigtable.admin.v2.CreateMaterializedViewRequest"
3223 }
3224}
3225
3226/// The metadata for the Operation returned by CreateMaterializedView.
3227#[derive(Clone, Default, PartialEq)]
3228#[non_exhaustive]
3229pub struct CreateMaterializedViewMetadata {
3230 /// The request that prompted the initiation of this CreateMaterializedView
3231 /// operation.
3232 pub original_request: std::option::Option<crate::model::CreateMaterializedViewRequest>,
3233
3234 /// The time at which this operation started.
3235 pub start_time: std::option::Option<wkt::Timestamp>,
3236
3237 /// If set, the time at which this operation finished or was canceled.
3238 pub end_time: std::option::Option<wkt::Timestamp>,
3239
3240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3241}
3242
3243impl CreateMaterializedViewMetadata {
3244 pub fn new() -> Self {
3245 std::default::Default::default()
3246 }
3247
3248 /// Sets the value of [original_request][crate::model::CreateMaterializedViewMetadata::original_request].
3249 ///
3250 /// # Example
3251 /// ```ignore,no_run
3252 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3253 /// use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3254 /// let x = CreateMaterializedViewMetadata::new().set_original_request(CreateMaterializedViewRequest::default()/* use setters */);
3255 /// ```
3256 pub fn set_original_request<T>(mut self, v: T) -> Self
3257 where
3258 T: std::convert::Into<crate::model::CreateMaterializedViewRequest>,
3259 {
3260 self.original_request = std::option::Option::Some(v.into());
3261 self
3262 }
3263
3264 /// Sets or clears the value of [original_request][crate::model::CreateMaterializedViewMetadata::original_request].
3265 ///
3266 /// # Example
3267 /// ```ignore,no_run
3268 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3269 /// use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3270 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_original_request(Some(CreateMaterializedViewRequest::default()/* use setters */));
3271 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_original_request(None::<CreateMaterializedViewRequest>);
3272 /// ```
3273 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
3274 where
3275 T: std::convert::Into<crate::model::CreateMaterializedViewRequest>,
3276 {
3277 self.original_request = v.map(|x| x.into());
3278 self
3279 }
3280
3281 /// Sets the value of [start_time][crate::model::CreateMaterializedViewMetadata::start_time].
3282 ///
3283 /// # Example
3284 /// ```ignore,no_run
3285 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3286 /// use wkt::Timestamp;
3287 /// let x = CreateMaterializedViewMetadata::new().set_start_time(Timestamp::default()/* use setters */);
3288 /// ```
3289 pub fn set_start_time<T>(mut self, v: T) -> Self
3290 where
3291 T: std::convert::Into<wkt::Timestamp>,
3292 {
3293 self.start_time = std::option::Option::Some(v.into());
3294 self
3295 }
3296
3297 /// Sets or clears the value of [start_time][crate::model::CreateMaterializedViewMetadata::start_time].
3298 ///
3299 /// # Example
3300 /// ```ignore,no_run
3301 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3302 /// use wkt::Timestamp;
3303 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3304 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_start_time(None::<Timestamp>);
3305 /// ```
3306 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3307 where
3308 T: std::convert::Into<wkt::Timestamp>,
3309 {
3310 self.start_time = v.map(|x| x.into());
3311 self
3312 }
3313
3314 /// Sets the value of [end_time][crate::model::CreateMaterializedViewMetadata::end_time].
3315 ///
3316 /// # Example
3317 /// ```ignore,no_run
3318 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3319 /// use wkt::Timestamp;
3320 /// let x = CreateMaterializedViewMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3321 /// ```
3322 pub fn set_end_time<T>(mut self, v: T) -> Self
3323 where
3324 T: std::convert::Into<wkt::Timestamp>,
3325 {
3326 self.end_time = std::option::Option::Some(v.into());
3327 self
3328 }
3329
3330 /// Sets or clears the value of [end_time][crate::model::CreateMaterializedViewMetadata::end_time].
3331 ///
3332 /// # Example
3333 /// ```ignore,no_run
3334 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3335 /// use wkt::Timestamp;
3336 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3337 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3338 /// ```
3339 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3340 where
3341 T: std::convert::Into<wkt::Timestamp>,
3342 {
3343 self.end_time = v.map(|x| x.into());
3344 self
3345 }
3346}
3347
3348impl wkt::message::Message for CreateMaterializedViewMetadata {
3349 fn typename() -> &'static str {
3350 "type.googleapis.com/google.bigtable.admin.v2.CreateMaterializedViewMetadata"
3351 }
3352}
3353
3354/// Request message for BigtableInstanceAdmin.GetMaterializedView.
3355#[derive(Clone, Default, PartialEq)]
3356#[non_exhaustive]
3357pub struct GetMaterializedViewRequest {
3358 /// Required. The unique name of the requested materialized view. Values are of
3359 /// the form
3360 /// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
3361 pub name: std::string::String,
3362
3363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3364}
3365
3366impl GetMaterializedViewRequest {
3367 pub fn new() -> Self {
3368 std::default::Default::default()
3369 }
3370
3371 /// Sets the value of [name][crate::model::GetMaterializedViewRequest::name].
3372 ///
3373 /// # Example
3374 /// ```ignore,no_run
3375 /// # use google_cloud_bigtable_admin_v2::model::GetMaterializedViewRequest;
3376 /// let x = GetMaterializedViewRequest::new().set_name("example");
3377 /// ```
3378 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3379 self.name = v.into();
3380 self
3381 }
3382}
3383
3384impl wkt::message::Message for GetMaterializedViewRequest {
3385 fn typename() -> &'static str {
3386 "type.googleapis.com/google.bigtable.admin.v2.GetMaterializedViewRequest"
3387 }
3388}
3389
3390/// Request message for BigtableInstanceAdmin.ListMaterializedViews.
3391#[derive(Clone, Default, PartialEq)]
3392#[non_exhaustive]
3393pub struct ListMaterializedViewsRequest {
3394 /// Required. The unique name of the instance for which the list of
3395 /// materialized views is requested. Values are of the form
3396 /// `projects/{project}/instances/{instance}`.
3397 pub parent: std::string::String,
3398
3399 /// Optional. The maximum number of materialized views to return. The service
3400 /// may return fewer than this value
3401 pub page_size: i32,
3402
3403 /// Optional. A page token, received from a previous `ListMaterializedViews`
3404 /// call. Provide this to retrieve the subsequent page.
3405 ///
3406 /// When paginating, all other parameters provided to `ListMaterializedViews`
3407 /// must match the call that provided the page token.
3408 pub page_token: std::string::String,
3409
3410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3411}
3412
3413impl ListMaterializedViewsRequest {
3414 pub fn new() -> Self {
3415 std::default::Default::default()
3416 }
3417
3418 /// Sets the value of [parent][crate::model::ListMaterializedViewsRequest::parent].
3419 ///
3420 /// # Example
3421 /// ```ignore,no_run
3422 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsRequest;
3423 /// let x = ListMaterializedViewsRequest::new().set_parent("example");
3424 /// ```
3425 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3426 self.parent = v.into();
3427 self
3428 }
3429
3430 /// Sets the value of [page_size][crate::model::ListMaterializedViewsRequest::page_size].
3431 ///
3432 /// # Example
3433 /// ```ignore,no_run
3434 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsRequest;
3435 /// let x = ListMaterializedViewsRequest::new().set_page_size(42);
3436 /// ```
3437 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3438 self.page_size = v.into();
3439 self
3440 }
3441
3442 /// Sets the value of [page_token][crate::model::ListMaterializedViewsRequest::page_token].
3443 ///
3444 /// # Example
3445 /// ```ignore,no_run
3446 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsRequest;
3447 /// let x = ListMaterializedViewsRequest::new().set_page_token("example");
3448 /// ```
3449 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3450 self.page_token = v.into();
3451 self
3452 }
3453}
3454
3455impl wkt::message::Message for ListMaterializedViewsRequest {
3456 fn typename() -> &'static str {
3457 "type.googleapis.com/google.bigtable.admin.v2.ListMaterializedViewsRequest"
3458 }
3459}
3460
3461/// Response message for BigtableInstanceAdmin.ListMaterializedViews.
3462#[derive(Clone, Default, PartialEq)]
3463#[non_exhaustive]
3464pub struct ListMaterializedViewsResponse {
3465 /// The list of requested materialized views.
3466 pub materialized_views: std::vec::Vec<crate::model::MaterializedView>,
3467
3468 /// A token, which can be sent as `page_token` to retrieve the next page.
3469 /// If this field is omitted, there are no subsequent pages.
3470 pub next_page_token: std::string::String,
3471
3472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3473}
3474
3475impl ListMaterializedViewsResponse {
3476 pub fn new() -> Self {
3477 std::default::Default::default()
3478 }
3479
3480 /// Sets the value of [materialized_views][crate::model::ListMaterializedViewsResponse::materialized_views].
3481 ///
3482 /// # Example
3483 /// ```ignore,no_run
3484 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsResponse;
3485 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
3486 /// let x = ListMaterializedViewsResponse::new()
3487 /// .set_materialized_views([
3488 /// MaterializedView::default()/* use setters */,
3489 /// MaterializedView::default()/* use (different) setters */,
3490 /// ]);
3491 /// ```
3492 pub fn set_materialized_views<T, V>(mut self, v: T) -> Self
3493 where
3494 T: std::iter::IntoIterator<Item = V>,
3495 V: std::convert::Into<crate::model::MaterializedView>,
3496 {
3497 use std::iter::Iterator;
3498 self.materialized_views = v.into_iter().map(|i| i.into()).collect();
3499 self
3500 }
3501
3502 /// Sets the value of [next_page_token][crate::model::ListMaterializedViewsResponse::next_page_token].
3503 ///
3504 /// # Example
3505 /// ```ignore,no_run
3506 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsResponse;
3507 /// let x = ListMaterializedViewsResponse::new().set_next_page_token("example");
3508 /// ```
3509 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3510 self.next_page_token = v.into();
3511 self
3512 }
3513}
3514
3515impl wkt::message::Message for ListMaterializedViewsResponse {
3516 fn typename() -> &'static str {
3517 "type.googleapis.com/google.bigtable.admin.v2.ListMaterializedViewsResponse"
3518 }
3519}
3520
3521#[doc(hidden)]
3522impl google_cloud_gax::paginator::internal::PageableResponse for ListMaterializedViewsResponse {
3523 type PageItem = crate::model::MaterializedView;
3524
3525 fn items(self) -> std::vec::Vec<Self::PageItem> {
3526 self.materialized_views
3527 }
3528
3529 fn next_page_token(&self) -> std::string::String {
3530 use std::clone::Clone;
3531 self.next_page_token.clone()
3532 }
3533}
3534
3535/// Request message for BigtableInstanceAdmin.UpdateMaterializedView.
3536#[derive(Clone, Default, PartialEq)]
3537#[non_exhaustive]
3538pub struct UpdateMaterializedViewRequest {
3539 /// Required. The materialized view to update.
3540 ///
3541 /// The materialized view's `name` field is used to identify the view to
3542 /// update. Format:
3543 /// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
3544 pub materialized_view: std::option::Option<crate::model::MaterializedView>,
3545
3546 /// Optional. The list of fields to update.
3547 pub update_mask: std::option::Option<wkt::FieldMask>,
3548
3549 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3550}
3551
3552impl UpdateMaterializedViewRequest {
3553 pub fn new() -> Self {
3554 std::default::Default::default()
3555 }
3556
3557 /// Sets the value of [materialized_view][crate::model::UpdateMaterializedViewRequest::materialized_view].
3558 ///
3559 /// # Example
3560 /// ```ignore,no_run
3561 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
3562 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
3563 /// let x = UpdateMaterializedViewRequest::new().set_materialized_view(MaterializedView::default()/* use setters */);
3564 /// ```
3565 pub fn set_materialized_view<T>(mut self, v: T) -> Self
3566 where
3567 T: std::convert::Into<crate::model::MaterializedView>,
3568 {
3569 self.materialized_view = std::option::Option::Some(v.into());
3570 self
3571 }
3572
3573 /// Sets or clears the value of [materialized_view][crate::model::UpdateMaterializedViewRequest::materialized_view].
3574 ///
3575 /// # Example
3576 /// ```ignore,no_run
3577 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
3578 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
3579 /// let x = UpdateMaterializedViewRequest::new().set_or_clear_materialized_view(Some(MaterializedView::default()/* use setters */));
3580 /// let x = UpdateMaterializedViewRequest::new().set_or_clear_materialized_view(None::<MaterializedView>);
3581 /// ```
3582 pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
3583 where
3584 T: std::convert::Into<crate::model::MaterializedView>,
3585 {
3586 self.materialized_view = v.map(|x| x.into());
3587 self
3588 }
3589
3590 /// Sets the value of [update_mask][crate::model::UpdateMaterializedViewRequest::update_mask].
3591 ///
3592 /// # Example
3593 /// ```ignore,no_run
3594 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
3595 /// use wkt::FieldMask;
3596 /// let x = UpdateMaterializedViewRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3597 /// ```
3598 pub fn set_update_mask<T>(mut self, v: T) -> Self
3599 where
3600 T: std::convert::Into<wkt::FieldMask>,
3601 {
3602 self.update_mask = std::option::Option::Some(v.into());
3603 self
3604 }
3605
3606 /// Sets or clears the value of [update_mask][crate::model::UpdateMaterializedViewRequest::update_mask].
3607 ///
3608 /// # Example
3609 /// ```ignore,no_run
3610 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
3611 /// use wkt::FieldMask;
3612 /// let x = UpdateMaterializedViewRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3613 /// let x = UpdateMaterializedViewRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3614 /// ```
3615 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3616 where
3617 T: std::convert::Into<wkt::FieldMask>,
3618 {
3619 self.update_mask = v.map(|x| x.into());
3620 self
3621 }
3622}
3623
3624impl wkt::message::Message for UpdateMaterializedViewRequest {
3625 fn typename() -> &'static str {
3626 "type.googleapis.com/google.bigtable.admin.v2.UpdateMaterializedViewRequest"
3627 }
3628}
3629
3630/// The metadata for the Operation returned by UpdateMaterializedView.
3631#[derive(Clone, Default, PartialEq)]
3632#[non_exhaustive]
3633pub struct UpdateMaterializedViewMetadata {
3634 /// The request that prompted the initiation of this UpdateMaterializedView
3635 /// operation.
3636 pub original_request: std::option::Option<crate::model::UpdateMaterializedViewRequest>,
3637
3638 /// The time at which this operation was started.
3639 pub start_time: std::option::Option<wkt::Timestamp>,
3640
3641 /// If set, the time at which this operation finished or was canceled.
3642 pub end_time: std::option::Option<wkt::Timestamp>,
3643
3644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3645}
3646
3647impl UpdateMaterializedViewMetadata {
3648 pub fn new() -> Self {
3649 std::default::Default::default()
3650 }
3651
3652 /// Sets the value of [original_request][crate::model::UpdateMaterializedViewMetadata::original_request].
3653 ///
3654 /// # Example
3655 /// ```ignore,no_run
3656 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
3657 /// use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
3658 /// let x = UpdateMaterializedViewMetadata::new().set_original_request(UpdateMaterializedViewRequest::default()/* use setters */);
3659 /// ```
3660 pub fn set_original_request<T>(mut self, v: T) -> Self
3661 where
3662 T: std::convert::Into<crate::model::UpdateMaterializedViewRequest>,
3663 {
3664 self.original_request = std::option::Option::Some(v.into());
3665 self
3666 }
3667
3668 /// Sets or clears the value of [original_request][crate::model::UpdateMaterializedViewMetadata::original_request].
3669 ///
3670 /// # Example
3671 /// ```ignore,no_run
3672 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
3673 /// use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
3674 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_original_request(Some(UpdateMaterializedViewRequest::default()/* use setters */));
3675 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_original_request(None::<UpdateMaterializedViewRequest>);
3676 /// ```
3677 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
3678 where
3679 T: std::convert::Into<crate::model::UpdateMaterializedViewRequest>,
3680 {
3681 self.original_request = v.map(|x| x.into());
3682 self
3683 }
3684
3685 /// Sets the value of [start_time][crate::model::UpdateMaterializedViewMetadata::start_time].
3686 ///
3687 /// # Example
3688 /// ```ignore,no_run
3689 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
3690 /// use wkt::Timestamp;
3691 /// let x = UpdateMaterializedViewMetadata::new().set_start_time(Timestamp::default()/* use setters */);
3692 /// ```
3693 pub fn set_start_time<T>(mut self, v: T) -> Self
3694 where
3695 T: std::convert::Into<wkt::Timestamp>,
3696 {
3697 self.start_time = std::option::Option::Some(v.into());
3698 self
3699 }
3700
3701 /// Sets or clears the value of [start_time][crate::model::UpdateMaterializedViewMetadata::start_time].
3702 ///
3703 /// # Example
3704 /// ```ignore,no_run
3705 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
3706 /// use wkt::Timestamp;
3707 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3708 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_start_time(None::<Timestamp>);
3709 /// ```
3710 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3711 where
3712 T: std::convert::Into<wkt::Timestamp>,
3713 {
3714 self.start_time = v.map(|x| x.into());
3715 self
3716 }
3717
3718 /// Sets the value of [end_time][crate::model::UpdateMaterializedViewMetadata::end_time].
3719 ///
3720 /// # Example
3721 /// ```ignore,no_run
3722 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
3723 /// use wkt::Timestamp;
3724 /// let x = UpdateMaterializedViewMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3725 /// ```
3726 pub fn set_end_time<T>(mut self, v: T) -> Self
3727 where
3728 T: std::convert::Into<wkt::Timestamp>,
3729 {
3730 self.end_time = std::option::Option::Some(v.into());
3731 self
3732 }
3733
3734 /// Sets or clears the value of [end_time][crate::model::UpdateMaterializedViewMetadata::end_time].
3735 ///
3736 /// # Example
3737 /// ```ignore,no_run
3738 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
3739 /// use wkt::Timestamp;
3740 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3741 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3742 /// ```
3743 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3744 where
3745 T: std::convert::Into<wkt::Timestamp>,
3746 {
3747 self.end_time = v.map(|x| x.into());
3748 self
3749 }
3750}
3751
3752impl wkt::message::Message for UpdateMaterializedViewMetadata {
3753 fn typename() -> &'static str {
3754 "type.googleapis.com/google.bigtable.admin.v2.UpdateMaterializedViewMetadata"
3755 }
3756}
3757
3758/// Request message for BigtableInstanceAdmin.DeleteMaterializedView.
3759#[derive(Clone, Default, PartialEq)]
3760#[non_exhaustive]
3761pub struct DeleteMaterializedViewRequest {
3762 /// Required. The unique name of the materialized view to be deleted.
3763 /// Format:
3764 /// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
3765 pub name: std::string::String,
3766
3767 /// Optional. The current etag of the materialized view.
3768 /// If an etag is provided and does not match the current etag of the
3769 /// materialized view, deletion will be blocked and an ABORTED error will be
3770 /// returned.
3771 pub etag: std::string::String,
3772
3773 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3774}
3775
3776impl DeleteMaterializedViewRequest {
3777 pub fn new() -> Self {
3778 std::default::Default::default()
3779 }
3780
3781 /// Sets the value of [name][crate::model::DeleteMaterializedViewRequest::name].
3782 ///
3783 /// # Example
3784 /// ```ignore,no_run
3785 /// # use google_cloud_bigtable_admin_v2::model::DeleteMaterializedViewRequest;
3786 /// let x = DeleteMaterializedViewRequest::new().set_name("example");
3787 /// ```
3788 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3789 self.name = v.into();
3790 self
3791 }
3792
3793 /// Sets the value of [etag][crate::model::DeleteMaterializedViewRequest::etag].
3794 ///
3795 /// # Example
3796 /// ```ignore,no_run
3797 /// # use google_cloud_bigtable_admin_v2::model::DeleteMaterializedViewRequest;
3798 /// let x = DeleteMaterializedViewRequest::new().set_etag("example");
3799 /// ```
3800 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3801 self.etag = v.into();
3802 self
3803 }
3804}
3805
3806impl wkt::message::Message for DeleteMaterializedViewRequest {
3807 fn typename() -> &'static str {
3808 "type.googleapis.com/google.bigtable.admin.v2.DeleteMaterializedViewRequest"
3809 }
3810}
3811
3812/// The request for
3813/// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
3814///
3815/// [google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]: crate::client::BigtableTableAdmin::restore_table
3816#[derive(Clone, Default, PartialEq)]
3817#[non_exhaustive]
3818pub struct RestoreTableRequest {
3819 /// Required. The name of the instance in which to create the restored
3820 /// table. Values are of the form `projects/<project>/instances/<instance>`.
3821 pub parent: std::string::String,
3822
3823 /// Required. The id of the table to create and restore to. This
3824 /// table must not already exist. The `table_id` appended to
3825 /// `parent` forms the full table name of the form
3826 /// `projects/<project>/instances/<instance>/tables/<table_id>`.
3827 pub table_id: std::string::String,
3828
3829 /// Required. The source from which to restore.
3830 pub source: std::option::Option<crate::model::restore_table_request::Source>,
3831
3832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3833}
3834
3835impl RestoreTableRequest {
3836 pub fn new() -> Self {
3837 std::default::Default::default()
3838 }
3839
3840 /// Sets the value of [parent][crate::model::RestoreTableRequest::parent].
3841 ///
3842 /// # Example
3843 /// ```ignore,no_run
3844 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableRequest;
3845 /// let x = RestoreTableRequest::new().set_parent("example");
3846 /// ```
3847 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3848 self.parent = v.into();
3849 self
3850 }
3851
3852 /// Sets the value of [table_id][crate::model::RestoreTableRequest::table_id].
3853 ///
3854 /// # Example
3855 /// ```ignore,no_run
3856 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableRequest;
3857 /// let x = RestoreTableRequest::new().set_table_id("example");
3858 /// ```
3859 pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3860 self.table_id = v.into();
3861 self
3862 }
3863
3864 /// Sets the value of [source][crate::model::RestoreTableRequest::source].
3865 ///
3866 /// Note that all the setters affecting `source` are mutually
3867 /// exclusive.
3868 ///
3869 /// # Example
3870 /// ```ignore,no_run
3871 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableRequest;
3872 /// use google_cloud_bigtable_admin_v2::model::restore_table_request::Source;
3873 /// let x = RestoreTableRequest::new().set_source(Some(Source::Backup("example".to_string())));
3874 /// ```
3875 pub fn set_source<
3876 T: std::convert::Into<std::option::Option<crate::model::restore_table_request::Source>>,
3877 >(
3878 mut self,
3879 v: T,
3880 ) -> Self {
3881 self.source = v.into();
3882 self
3883 }
3884
3885 /// The value of [source][crate::model::RestoreTableRequest::source]
3886 /// if it holds a `Backup`, `None` if the field is not set or
3887 /// holds a different branch.
3888 pub fn backup(&self) -> std::option::Option<&std::string::String> {
3889 #[allow(unreachable_patterns)]
3890 self.source.as_ref().and_then(|v| match v {
3891 crate::model::restore_table_request::Source::Backup(v) => std::option::Option::Some(v),
3892 _ => std::option::Option::None,
3893 })
3894 }
3895
3896 /// Sets the value of [source][crate::model::RestoreTableRequest::source]
3897 /// to hold a `Backup`.
3898 ///
3899 /// Note that all the setters affecting `source` are
3900 /// mutually exclusive.
3901 ///
3902 /// # Example
3903 /// ```ignore,no_run
3904 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableRequest;
3905 /// let x = RestoreTableRequest::new().set_backup("example");
3906 /// assert!(x.backup().is_some());
3907 /// ```
3908 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3909 self.source = std::option::Option::Some(
3910 crate::model::restore_table_request::Source::Backup(v.into()),
3911 );
3912 self
3913 }
3914}
3915
3916impl wkt::message::Message for RestoreTableRequest {
3917 fn typename() -> &'static str {
3918 "type.googleapis.com/google.bigtable.admin.v2.RestoreTableRequest"
3919 }
3920}
3921
3922/// Defines additional types related to [RestoreTableRequest].
3923pub mod restore_table_request {
3924 #[allow(unused_imports)]
3925 use super::*;
3926
3927 /// Required. The source from which to restore.
3928 #[derive(Clone, Debug, PartialEq)]
3929 #[non_exhaustive]
3930 pub enum Source {
3931 /// Name of the backup from which to restore. Values are of the form
3932 /// `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
3933 Backup(std::string::String),
3934 }
3935}
3936
3937/// Metadata type for the long-running operation returned by
3938/// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
3939///
3940/// [google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]: crate::client::BigtableTableAdmin::restore_table
3941#[derive(Clone, Default, PartialEq)]
3942#[non_exhaustive]
3943pub struct RestoreTableMetadata {
3944 /// Name of the table being created and restored to.
3945 pub name: std::string::String,
3946
3947 /// The type of the restore source.
3948 pub source_type: crate::model::RestoreSourceType,
3949
3950 /// If exists, the name of the long-running operation that will be used to
3951 /// track the post-restore optimization process to optimize the performance of
3952 /// the restored table. The metadata type of the long-running operation is
3953 /// [OptimizeRestoreTableMetadata][]. The response type is
3954 /// [Empty][google.protobuf.Empty]. This long-running operation may be
3955 /// automatically created by the system if applicable after the
3956 /// RestoreTable long-running operation completes successfully. This operation
3957 /// may not be created if the table is already optimized or the restore was
3958 /// not successful.
3959 ///
3960 /// [google.protobuf.Empty]: wkt::Empty
3961 pub optimize_table_operation_name: std::string::String,
3962
3963 /// The progress of the
3964 /// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
3965 /// operation.
3966 ///
3967 /// [google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]: crate::client::BigtableTableAdmin::restore_table
3968 pub progress: std::option::Option<crate::model::OperationProgress>,
3969
3970 /// Information about the source used to restore the table, as specified by
3971 /// `source` in
3972 /// [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest].
3973 ///
3974 /// [google.bigtable.admin.v2.RestoreTableRequest]: crate::model::RestoreTableRequest
3975 pub source_info: std::option::Option<crate::model::restore_table_metadata::SourceInfo>,
3976
3977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3978}
3979
3980impl RestoreTableMetadata {
3981 pub fn new() -> Self {
3982 std::default::Default::default()
3983 }
3984
3985 /// Sets the value of [name][crate::model::RestoreTableMetadata::name].
3986 ///
3987 /// # Example
3988 /// ```ignore,no_run
3989 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
3990 /// let x = RestoreTableMetadata::new().set_name("example");
3991 /// ```
3992 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3993 self.name = v.into();
3994 self
3995 }
3996
3997 /// Sets the value of [source_type][crate::model::RestoreTableMetadata::source_type].
3998 ///
3999 /// # Example
4000 /// ```ignore,no_run
4001 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4002 /// use google_cloud_bigtable_admin_v2::model::RestoreSourceType;
4003 /// let x0 = RestoreTableMetadata::new().set_source_type(RestoreSourceType::Backup);
4004 /// ```
4005 pub fn set_source_type<T: std::convert::Into<crate::model::RestoreSourceType>>(
4006 mut self,
4007 v: T,
4008 ) -> Self {
4009 self.source_type = v.into();
4010 self
4011 }
4012
4013 /// Sets the value of [optimize_table_operation_name][crate::model::RestoreTableMetadata::optimize_table_operation_name].
4014 ///
4015 /// # Example
4016 /// ```ignore,no_run
4017 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4018 /// let x = RestoreTableMetadata::new().set_optimize_table_operation_name("example");
4019 /// ```
4020 pub fn set_optimize_table_operation_name<T: std::convert::Into<std::string::String>>(
4021 mut self,
4022 v: T,
4023 ) -> Self {
4024 self.optimize_table_operation_name = v.into();
4025 self
4026 }
4027
4028 /// Sets the value of [progress][crate::model::RestoreTableMetadata::progress].
4029 ///
4030 /// # Example
4031 /// ```ignore,no_run
4032 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4033 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
4034 /// let x = RestoreTableMetadata::new().set_progress(OperationProgress::default()/* use setters */);
4035 /// ```
4036 pub fn set_progress<T>(mut self, v: T) -> Self
4037 where
4038 T: std::convert::Into<crate::model::OperationProgress>,
4039 {
4040 self.progress = std::option::Option::Some(v.into());
4041 self
4042 }
4043
4044 /// Sets or clears the value of [progress][crate::model::RestoreTableMetadata::progress].
4045 ///
4046 /// # Example
4047 /// ```ignore,no_run
4048 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4049 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
4050 /// let x = RestoreTableMetadata::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
4051 /// let x = RestoreTableMetadata::new().set_or_clear_progress(None::<OperationProgress>);
4052 /// ```
4053 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
4054 where
4055 T: std::convert::Into<crate::model::OperationProgress>,
4056 {
4057 self.progress = v.map(|x| x.into());
4058 self
4059 }
4060
4061 /// Sets the value of [source_info][crate::model::RestoreTableMetadata::source_info].
4062 ///
4063 /// Note that all the setters affecting `source_info` are mutually
4064 /// exclusive.
4065 ///
4066 /// # Example
4067 /// ```ignore,no_run
4068 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4069 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
4070 /// let x = RestoreTableMetadata::new().set_source_info(Some(
4071 /// google_cloud_bigtable_admin_v2::model::restore_table_metadata::SourceInfo::BackupInfo(BackupInfo::default().into())));
4072 /// ```
4073 pub fn set_source_info<
4074 T: std::convert::Into<std::option::Option<crate::model::restore_table_metadata::SourceInfo>>,
4075 >(
4076 mut self,
4077 v: T,
4078 ) -> Self {
4079 self.source_info = v.into();
4080 self
4081 }
4082
4083 /// The value of [source_info][crate::model::RestoreTableMetadata::source_info]
4084 /// if it holds a `BackupInfo`, `None` if the field is not set or
4085 /// holds a different branch.
4086 pub fn backup_info(&self) -> std::option::Option<&std::boxed::Box<crate::model::BackupInfo>> {
4087 #[allow(unreachable_patterns)]
4088 self.source_info.as_ref().and_then(|v| match v {
4089 crate::model::restore_table_metadata::SourceInfo::BackupInfo(v) => {
4090 std::option::Option::Some(v)
4091 }
4092 _ => std::option::Option::None,
4093 })
4094 }
4095
4096 /// Sets the value of [source_info][crate::model::RestoreTableMetadata::source_info]
4097 /// to hold a `BackupInfo`.
4098 ///
4099 /// Note that all the setters affecting `source_info` are
4100 /// mutually exclusive.
4101 ///
4102 /// # Example
4103 /// ```ignore,no_run
4104 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4105 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
4106 /// let x = RestoreTableMetadata::new().set_backup_info(BackupInfo::default()/* use setters */);
4107 /// assert!(x.backup_info().is_some());
4108 /// ```
4109 pub fn set_backup_info<T: std::convert::Into<std::boxed::Box<crate::model::BackupInfo>>>(
4110 mut self,
4111 v: T,
4112 ) -> Self {
4113 self.source_info = std::option::Option::Some(
4114 crate::model::restore_table_metadata::SourceInfo::BackupInfo(v.into()),
4115 );
4116 self
4117 }
4118}
4119
4120impl wkt::message::Message for RestoreTableMetadata {
4121 fn typename() -> &'static str {
4122 "type.googleapis.com/google.bigtable.admin.v2.RestoreTableMetadata"
4123 }
4124}
4125
4126/// Defines additional types related to [RestoreTableMetadata].
4127pub mod restore_table_metadata {
4128 #[allow(unused_imports)]
4129 use super::*;
4130
4131 /// Information about the source used to restore the table, as specified by
4132 /// `source` in
4133 /// [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest].
4134 ///
4135 /// [google.bigtable.admin.v2.RestoreTableRequest]: crate::model::RestoreTableRequest
4136 #[derive(Clone, Debug, PartialEq)]
4137 #[non_exhaustive]
4138 pub enum SourceInfo {
4139 BackupInfo(std::boxed::Box<crate::model::BackupInfo>),
4140 }
4141}
4142
4143/// Metadata type for the long-running operation used to track the progress
4144/// of optimizations performed on a newly restored table. This long-running
4145/// operation is automatically created by the system after the successful
4146/// completion of a table restore, and cannot be cancelled.
4147#[derive(Clone, Default, PartialEq)]
4148#[non_exhaustive]
4149pub struct OptimizeRestoredTableMetadata {
4150 /// Name of the restored table being optimized.
4151 pub name: std::string::String,
4152
4153 /// The progress of the post-restore optimizations.
4154 pub progress: std::option::Option<crate::model::OperationProgress>,
4155
4156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4157}
4158
4159impl OptimizeRestoredTableMetadata {
4160 pub fn new() -> Self {
4161 std::default::Default::default()
4162 }
4163
4164 /// Sets the value of [name][crate::model::OptimizeRestoredTableMetadata::name].
4165 ///
4166 /// # Example
4167 /// ```ignore,no_run
4168 /// # use google_cloud_bigtable_admin_v2::model::OptimizeRestoredTableMetadata;
4169 /// let x = OptimizeRestoredTableMetadata::new().set_name("example");
4170 /// ```
4171 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4172 self.name = v.into();
4173 self
4174 }
4175
4176 /// Sets the value of [progress][crate::model::OptimizeRestoredTableMetadata::progress].
4177 ///
4178 /// # Example
4179 /// ```ignore,no_run
4180 /// # use google_cloud_bigtable_admin_v2::model::OptimizeRestoredTableMetadata;
4181 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
4182 /// let x = OptimizeRestoredTableMetadata::new().set_progress(OperationProgress::default()/* use setters */);
4183 /// ```
4184 pub fn set_progress<T>(mut self, v: T) -> Self
4185 where
4186 T: std::convert::Into<crate::model::OperationProgress>,
4187 {
4188 self.progress = std::option::Option::Some(v.into());
4189 self
4190 }
4191
4192 /// Sets or clears the value of [progress][crate::model::OptimizeRestoredTableMetadata::progress].
4193 ///
4194 /// # Example
4195 /// ```ignore,no_run
4196 /// # use google_cloud_bigtable_admin_v2::model::OptimizeRestoredTableMetadata;
4197 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
4198 /// let x = OptimizeRestoredTableMetadata::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
4199 /// let x = OptimizeRestoredTableMetadata::new().set_or_clear_progress(None::<OperationProgress>);
4200 /// ```
4201 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
4202 where
4203 T: std::convert::Into<crate::model::OperationProgress>,
4204 {
4205 self.progress = v.map(|x| x.into());
4206 self
4207 }
4208}
4209
4210impl wkt::message::Message for OptimizeRestoredTableMetadata {
4211 fn typename() -> &'static str {
4212 "type.googleapis.com/google.bigtable.admin.v2.OptimizeRestoredTableMetadata"
4213 }
4214}
4215
4216/// Request message for
4217/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]
4218///
4219/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]: crate::client::BigtableTableAdmin::create_table
4220#[derive(Clone, Default, PartialEq)]
4221#[non_exhaustive]
4222pub struct CreateTableRequest {
4223 /// Required. The unique name of the instance in which to create the table.
4224 /// Values are of the form `projects/{project}/instances/{instance}`.
4225 pub parent: std::string::String,
4226
4227 /// Required. The name by which the new table should be referred to within the
4228 /// parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
4229 /// Maximum 50 characters.
4230 pub table_id: std::string::String,
4231
4232 /// Required. The Table to create.
4233 pub table: std::option::Option<crate::model::Table>,
4234
4235 /// The optional list of row keys that will be used to initially split the
4236 /// table into several tablets (tablets are similar to HBase regions).
4237 /// Given two split keys, `s1` and `s2`, three tablets will be created,
4238 /// spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
4239 ///
4240 /// Example:
4241 ///
4242 /// * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
4243 /// `"other", "zz"]`
4244 /// * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
4245 /// * Key assignment:
4246 /// - Tablet 1 `[, apple) => {"a"}.`
4247 /// - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.`
4248 /// - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
4249 /// - Tablet 4 `[customer_2, other) => {"customer_2"}.`
4250 /// - Tablet 5 `[other, ) => {"other", "zz"}.`
4251 pub initial_splits: std::vec::Vec<crate::model::create_table_request::Split>,
4252
4253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4254}
4255
4256impl CreateTableRequest {
4257 pub fn new() -> Self {
4258 std::default::Default::default()
4259 }
4260
4261 /// Sets the value of [parent][crate::model::CreateTableRequest::parent].
4262 ///
4263 /// # Example
4264 /// ```ignore,no_run
4265 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4266 /// let x = CreateTableRequest::new().set_parent("example");
4267 /// ```
4268 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4269 self.parent = v.into();
4270 self
4271 }
4272
4273 /// Sets the value of [table_id][crate::model::CreateTableRequest::table_id].
4274 ///
4275 /// # Example
4276 /// ```ignore,no_run
4277 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4278 /// let x = CreateTableRequest::new().set_table_id("example");
4279 /// ```
4280 pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4281 self.table_id = v.into();
4282 self
4283 }
4284
4285 /// Sets the value of [table][crate::model::CreateTableRequest::table].
4286 ///
4287 /// # Example
4288 /// ```ignore,no_run
4289 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4290 /// use google_cloud_bigtable_admin_v2::model::Table;
4291 /// let x = CreateTableRequest::new().set_table(Table::default()/* use setters */);
4292 /// ```
4293 pub fn set_table<T>(mut self, v: T) -> Self
4294 where
4295 T: std::convert::Into<crate::model::Table>,
4296 {
4297 self.table = std::option::Option::Some(v.into());
4298 self
4299 }
4300
4301 /// Sets or clears the value of [table][crate::model::CreateTableRequest::table].
4302 ///
4303 /// # Example
4304 /// ```ignore,no_run
4305 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4306 /// use google_cloud_bigtable_admin_v2::model::Table;
4307 /// let x = CreateTableRequest::new().set_or_clear_table(Some(Table::default()/* use setters */));
4308 /// let x = CreateTableRequest::new().set_or_clear_table(None::<Table>);
4309 /// ```
4310 pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
4311 where
4312 T: std::convert::Into<crate::model::Table>,
4313 {
4314 self.table = v.map(|x| x.into());
4315 self
4316 }
4317
4318 /// Sets the value of [initial_splits][crate::model::CreateTableRequest::initial_splits].
4319 ///
4320 /// # Example
4321 /// ```ignore,no_run
4322 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4323 /// use google_cloud_bigtable_admin_v2::model::create_table_request::Split;
4324 /// let x = CreateTableRequest::new()
4325 /// .set_initial_splits([
4326 /// Split::default()/* use setters */,
4327 /// Split::default()/* use (different) setters */,
4328 /// ]);
4329 /// ```
4330 pub fn set_initial_splits<T, V>(mut self, v: T) -> Self
4331 where
4332 T: std::iter::IntoIterator<Item = V>,
4333 V: std::convert::Into<crate::model::create_table_request::Split>,
4334 {
4335 use std::iter::Iterator;
4336 self.initial_splits = v.into_iter().map(|i| i.into()).collect();
4337 self
4338 }
4339}
4340
4341impl wkt::message::Message for CreateTableRequest {
4342 fn typename() -> &'static str {
4343 "type.googleapis.com/google.bigtable.admin.v2.CreateTableRequest"
4344 }
4345}
4346
4347/// Defines additional types related to [CreateTableRequest].
4348pub mod create_table_request {
4349 #[allow(unused_imports)]
4350 use super::*;
4351
4352 /// An initial split point for a newly created table.
4353 #[derive(Clone, Default, PartialEq)]
4354 #[non_exhaustive]
4355 pub struct Split {
4356 /// Row key to use as an initial tablet boundary.
4357 pub key: ::bytes::Bytes,
4358
4359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4360 }
4361
4362 impl Split {
4363 pub fn new() -> Self {
4364 std::default::Default::default()
4365 }
4366
4367 /// Sets the value of [key][crate::model::create_table_request::Split::key].
4368 ///
4369 /// # Example
4370 /// ```ignore,no_run
4371 /// # use google_cloud_bigtable_admin_v2::model::create_table_request::Split;
4372 /// let x = Split::new().set_key(bytes::Bytes::from_static(b"example"));
4373 /// ```
4374 pub fn set_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4375 self.key = v.into();
4376 self
4377 }
4378 }
4379
4380 impl wkt::message::Message for Split {
4381 fn typename() -> &'static str {
4382 "type.googleapis.com/google.bigtable.admin.v2.CreateTableRequest.Split"
4383 }
4384 }
4385}
4386
4387/// Request message for
4388/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]
4389///
4390/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
4391/// feature is not currently available to most Cloud Bigtable customers. This
4392/// feature might be changed in backward-incompatible ways and is not recommended
4393/// for production use. It is not subject to any SLA or deprecation policy.
4394///
4395/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]: crate::client::BigtableTableAdmin::create_table_from_snapshot
4396#[derive(Clone, Default, PartialEq)]
4397#[non_exhaustive]
4398pub struct CreateTableFromSnapshotRequest {
4399 /// Required. The unique name of the instance in which to create the table.
4400 /// Values are of the form `projects/{project}/instances/{instance}`.
4401 pub parent: std::string::String,
4402
4403 /// Required. The name by which the new table should be referred to within the
4404 /// parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
4405 pub table_id: std::string::String,
4406
4407 /// Required. The unique name of the snapshot from which to restore the table.
4408 /// The snapshot and the table must be in the same instance. Values are of the
4409 /// form
4410 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
4411 pub source_snapshot: std::string::String,
4412
4413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4414}
4415
4416impl CreateTableFromSnapshotRequest {
4417 pub fn new() -> Self {
4418 std::default::Default::default()
4419 }
4420
4421 /// Sets the value of [parent][crate::model::CreateTableFromSnapshotRequest::parent].
4422 ///
4423 /// # Example
4424 /// ```ignore,no_run
4425 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
4426 /// let x = CreateTableFromSnapshotRequest::new().set_parent("example");
4427 /// ```
4428 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4429 self.parent = v.into();
4430 self
4431 }
4432
4433 /// Sets the value of [table_id][crate::model::CreateTableFromSnapshotRequest::table_id].
4434 ///
4435 /// # Example
4436 /// ```ignore,no_run
4437 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
4438 /// let x = CreateTableFromSnapshotRequest::new().set_table_id("example");
4439 /// ```
4440 pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4441 self.table_id = v.into();
4442 self
4443 }
4444
4445 /// Sets the value of [source_snapshot][crate::model::CreateTableFromSnapshotRequest::source_snapshot].
4446 ///
4447 /// # Example
4448 /// ```ignore,no_run
4449 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
4450 /// let x = CreateTableFromSnapshotRequest::new().set_source_snapshot("example");
4451 /// ```
4452 pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4453 self.source_snapshot = v.into();
4454 self
4455 }
4456}
4457
4458impl wkt::message::Message for CreateTableFromSnapshotRequest {
4459 fn typename() -> &'static str {
4460 "type.googleapis.com/google.bigtable.admin.v2.CreateTableFromSnapshotRequest"
4461 }
4462}
4463
4464/// Request message for
4465/// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]
4466///
4467/// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]: crate::client::BigtableTableAdmin::drop_row_range
4468#[derive(Clone, Default, PartialEq)]
4469#[non_exhaustive]
4470pub struct DropRowRangeRequest {
4471 /// Required. The unique name of the table on which to drop a range of rows.
4472 /// Values are of the form
4473 /// `projects/{project}/instances/{instance}/tables/{table}`.
4474 pub name: std::string::String,
4475
4476 /// Delete all rows or by prefix.
4477 pub target: std::option::Option<crate::model::drop_row_range_request::Target>,
4478
4479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4480}
4481
4482impl DropRowRangeRequest {
4483 pub fn new() -> Self {
4484 std::default::Default::default()
4485 }
4486
4487 /// Sets the value of [name][crate::model::DropRowRangeRequest::name].
4488 ///
4489 /// # Example
4490 /// ```ignore,no_run
4491 /// # use google_cloud_bigtable_admin_v2::model::DropRowRangeRequest;
4492 /// let x = DropRowRangeRequest::new().set_name("example");
4493 /// ```
4494 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4495 self.name = v.into();
4496 self
4497 }
4498
4499 /// Sets the value of [target][crate::model::DropRowRangeRequest::target].
4500 ///
4501 /// Note that all the setters affecting `target` are mutually
4502 /// exclusive.
4503 ///
4504 /// # Example
4505 /// ```ignore,no_run
4506 /// # use google_cloud_bigtable_admin_v2::model::DropRowRangeRequest;
4507 /// use google_cloud_bigtable_admin_v2::model::drop_row_range_request::Target;
4508 /// let x = DropRowRangeRequest::new().set_target(Some(Target::RowKeyPrefix(bytes::Bytes::from_static(b"example"))));
4509 /// ```
4510 pub fn set_target<
4511 T: std::convert::Into<std::option::Option<crate::model::drop_row_range_request::Target>>,
4512 >(
4513 mut self,
4514 v: T,
4515 ) -> Self {
4516 self.target = v.into();
4517 self
4518 }
4519
4520 /// The value of [target][crate::model::DropRowRangeRequest::target]
4521 /// if it holds a `RowKeyPrefix`, `None` if the field is not set or
4522 /// holds a different branch.
4523 pub fn row_key_prefix(&self) -> std::option::Option<&::bytes::Bytes> {
4524 #[allow(unreachable_patterns)]
4525 self.target.as_ref().and_then(|v| match v {
4526 crate::model::drop_row_range_request::Target::RowKeyPrefix(v) => {
4527 std::option::Option::Some(v)
4528 }
4529 _ => std::option::Option::None,
4530 })
4531 }
4532
4533 /// Sets the value of [target][crate::model::DropRowRangeRequest::target]
4534 /// to hold a `RowKeyPrefix`.
4535 ///
4536 /// Note that all the setters affecting `target` are
4537 /// mutually exclusive.
4538 ///
4539 /// # Example
4540 /// ```ignore,no_run
4541 /// # use google_cloud_bigtable_admin_v2::model::DropRowRangeRequest;
4542 /// let x = DropRowRangeRequest::new().set_row_key_prefix(bytes::Bytes::from_static(b"example"));
4543 /// assert!(x.row_key_prefix().is_some());
4544 /// assert!(x.delete_all_data_from_table().is_none());
4545 /// ```
4546 pub fn set_row_key_prefix<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4547 self.target = std::option::Option::Some(
4548 crate::model::drop_row_range_request::Target::RowKeyPrefix(v.into()),
4549 );
4550 self
4551 }
4552
4553 /// The value of [target][crate::model::DropRowRangeRequest::target]
4554 /// if it holds a `DeleteAllDataFromTable`, `None` if the field is not set or
4555 /// holds a different branch.
4556 pub fn delete_all_data_from_table(&self) -> std::option::Option<&bool> {
4557 #[allow(unreachable_patterns)]
4558 self.target.as_ref().and_then(|v| match v {
4559 crate::model::drop_row_range_request::Target::DeleteAllDataFromTable(v) => {
4560 std::option::Option::Some(v)
4561 }
4562 _ => std::option::Option::None,
4563 })
4564 }
4565
4566 /// Sets the value of [target][crate::model::DropRowRangeRequest::target]
4567 /// to hold a `DeleteAllDataFromTable`.
4568 ///
4569 /// Note that all the setters affecting `target` are
4570 /// mutually exclusive.
4571 ///
4572 /// # Example
4573 /// ```ignore,no_run
4574 /// # use google_cloud_bigtable_admin_v2::model::DropRowRangeRequest;
4575 /// let x = DropRowRangeRequest::new().set_delete_all_data_from_table(true);
4576 /// assert!(x.delete_all_data_from_table().is_some());
4577 /// assert!(x.row_key_prefix().is_none());
4578 /// ```
4579 pub fn set_delete_all_data_from_table<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4580 self.target = std::option::Option::Some(
4581 crate::model::drop_row_range_request::Target::DeleteAllDataFromTable(v.into()),
4582 );
4583 self
4584 }
4585}
4586
4587impl wkt::message::Message for DropRowRangeRequest {
4588 fn typename() -> &'static str {
4589 "type.googleapis.com/google.bigtable.admin.v2.DropRowRangeRequest"
4590 }
4591}
4592
4593/// Defines additional types related to [DropRowRangeRequest].
4594pub mod drop_row_range_request {
4595 #[allow(unused_imports)]
4596 use super::*;
4597
4598 /// Delete all rows or by prefix.
4599 #[derive(Clone, Debug, PartialEq)]
4600 #[non_exhaustive]
4601 pub enum Target {
4602 /// Delete all rows that start with this row key prefix. Prefix cannot be
4603 /// zero length.
4604 RowKeyPrefix(::bytes::Bytes),
4605 /// Delete all rows in the table. Setting this to false is a no-op.
4606 DeleteAllDataFromTable(bool),
4607 }
4608}
4609
4610/// Request message for
4611/// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
4612///
4613/// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables]: crate::client::BigtableTableAdmin::list_tables
4614#[derive(Clone, Default, PartialEq)]
4615#[non_exhaustive]
4616pub struct ListTablesRequest {
4617 /// Required. The unique name of the instance for which tables should be
4618 /// listed. Values are of the form `projects/{project}/instances/{instance}`.
4619 pub parent: std::string::String,
4620
4621 /// The view to be applied to the returned tables' fields.
4622 /// NAME_ONLY view (default) and REPLICATION_VIEW are supported.
4623 pub view: crate::model::table::View,
4624
4625 /// Maximum number of results per page.
4626 ///
4627 /// A page_size of zero lets the server choose the number of items to return.
4628 /// A page_size which is strictly positive will return at most that many items.
4629 /// A negative page_size will cause an error.
4630 ///
4631 /// Following the first request, subsequent paginated calls are not required
4632 /// to pass a page_size. If a page_size is set in subsequent calls, it must
4633 /// match the page_size given in the first request.
4634 pub page_size: i32,
4635
4636 /// The value of `next_page_token` returned by a previous call.
4637 pub page_token: std::string::String,
4638
4639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4640}
4641
4642impl ListTablesRequest {
4643 pub fn new() -> Self {
4644 std::default::Default::default()
4645 }
4646
4647 /// Sets the value of [parent][crate::model::ListTablesRequest::parent].
4648 ///
4649 /// # Example
4650 /// ```ignore,no_run
4651 /// # use google_cloud_bigtable_admin_v2::model::ListTablesRequest;
4652 /// let x = ListTablesRequest::new().set_parent("example");
4653 /// ```
4654 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4655 self.parent = v.into();
4656 self
4657 }
4658
4659 /// Sets the value of [view][crate::model::ListTablesRequest::view].
4660 ///
4661 /// # Example
4662 /// ```ignore,no_run
4663 /// # use google_cloud_bigtable_admin_v2::model::ListTablesRequest;
4664 /// use google_cloud_bigtable_admin_v2::model::table::View;
4665 /// let x0 = ListTablesRequest::new().set_view(View::NameOnly);
4666 /// let x1 = ListTablesRequest::new().set_view(View::SchemaView);
4667 /// let x2 = ListTablesRequest::new().set_view(View::ReplicationView);
4668 /// ```
4669 pub fn set_view<T: std::convert::Into<crate::model::table::View>>(mut self, v: T) -> Self {
4670 self.view = v.into();
4671 self
4672 }
4673
4674 /// Sets the value of [page_size][crate::model::ListTablesRequest::page_size].
4675 ///
4676 /// # Example
4677 /// ```ignore,no_run
4678 /// # use google_cloud_bigtable_admin_v2::model::ListTablesRequest;
4679 /// let x = ListTablesRequest::new().set_page_size(42);
4680 /// ```
4681 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4682 self.page_size = v.into();
4683 self
4684 }
4685
4686 /// Sets the value of [page_token][crate::model::ListTablesRequest::page_token].
4687 ///
4688 /// # Example
4689 /// ```ignore,no_run
4690 /// # use google_cloud_bigtable_admin_v2::model::ListTablesRequest;
4691 /// let x = ListTablesRequest::new().set_page_token("example");
4692 /// ```
4693 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4694 self.page_token = v.into();
4695 self
4696 }
4697}
4698
4699impl wkt::message::Message for ListTablesRequest {
4700 fn typename() -> &'static str {
4701 "type.googleapis.com/google.bigtable.admin.v2.ListTablesRequest"
4702 }
4703}
4704
4705/// Response message for
4706/// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
4707///
4708/// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables]: crate::client::BigtableTableAdmin::list_tables
4709#[derive(Clone, Default, PartialEq)]
4710#[non_exhaustive]
4711pub struct ListTablesResponse {
4712 /// The tables present in the requested instance.
4713 pub tables: std::vec::Vec<crate::model::Table>,
4714
4715 /// Set if not all tables could be returned in a single response.
4716 /// Pass this value to `page_token` in another request to get the next
4717 /// page of results.
4718 pub next_page_token: std::string::String,
4719
4720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4721}
4722
4723impl ListTablesResponse {
4724 pub fn new() -> Self {
4725 std::default::Default::default()
4726 }
4727
4728 /// Sets the value of [tables][crate::model::ListTablesResponse::tables].
4729 ///
4730 /// # Example
4731 /// ```ignore,no_run
4732 /// # use google_cloud_bigtable_admin_v2::model::ListTablesResponse;
4733 /// use google_cloud_bigtable_admin_v2::model::Table;
4734 /// let x = ListTablesResponse::new()
4735 /// .set_tables([
4736 /// Table::default()/* use setters */,
4737 /// Table::default()/* use (different) setters */,
4738 /// ]);
4739 /// ```
4740 pub fn set_tables<T, V>(mut self, v: T) -> Self
4741 where
4742 T: std::iter::IntoIterator<Item = V>,
4743 V: std::convert::Into<crate::model::Table>,
4744 {
4745 use std::iter::Iterator;
4746 self.tables = v.into_iter().map(|i| i.into()).collect();
4747 self
4748 }
4749
4750 /// Sets the value of [next_page_token][crate::model::ListTablesResponse::next_page_token].
4751 ///
4752 /// # Example
4753 /// ```ignore,no_run
4754 /// # use google_cloud_bigtable_admin_v2::model::ListTablesResponse;
4755 /// let x = ListTablesResponse::new().set_next_page_token("example");
4756 /// ```
4757 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4758 self.next_page_token = v.into();
4759 self
4760 }
4761}
4762
4763impl wkt::message::Message for ListTablesResponse {
4764 fn typename() -> &'static str {
4765 "type.googleapis.com/google.bigtable.admin.v2.ListTablesResponse"
4766 }
4767}
4768
4769#[doc(hidden)]
4770impl google_cloud_gax::paginator::internal::PageableResponse for ListTablesResponse {
4771 type PageItem = crate::model::Table;
4772
4773 fn items(self) -> std::vec::Vec<Self::PageItem> {
4774 self.tables
4775 }
4776
4777 fn next_page_token(&self) -> std::string::String {
4778 use std::clone::Clone;
4779 self.next_page_token.clone()
4780 }
4781}
4782
4783/// Request message for
4784/// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable]
4785///
4786/// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable]: crate::client::BigtableTableAdmin::get_table
4787#[derive(Clone, Default, PartialEq)]
4788#[non_exhaustive]
4789pub struct GetTableRequest {
4790 /// Required. The unique name of the requested table.
4791 /// Values are of the form
4792 /// `projects/{project}/instances/{instance}/tables/{table}`.
4793 pub name: std::string::String,
4794
4795 /// The view to be applied to the returned table's fields.
4796 /// Defaults to `SCHEMA_VIEW` if unspecified.
4797 pub view: crate::model::table::View,
4798
4799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4800}
4801
4802impl GetTableRequest {
4803 pub fn new() -> Self {
4804 std::default::Default::default()
4805 }
4806
4807 /// Sets the value of [name][crate::model::GetTableRequest::name].
4808 ///
4809 /// # Example
4810 /// ```ignore,no_run
4811 /// # use google_cloud_bigtable_admin_v2::model::GetTableRequest;
4812 /// let x = GetTableRequest::new().set_name("example");
4813 /// ```
4814 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4815 self.name = v.into();
4816 self
4817 }
4818
4819 /// Sets the value of [view][crate::model::GetTableRequest::view].
4820 ///
4821 /// # Example
4822 /// ```ignore,no_run
4823 /// # use google_cloud_bigtable_admin_v2::model::GetTableRequest;
4824 /// use google_cloud_bigtable_admin_v2::model::table::View;
4825 /// let x0 = GetTableRequest::new().set_view(View::NameOnly);
4826 /// let x1 = GetTableRequest::new().set_view(View::SchemaView);
4827 /// let x2 = GetTableRequest::new().set_view(View::ReplicationView);
4828 /// ```
4829 pub fn set_view<T: std::convert::Into<crate::model::table::View>>(mut self, v: T) -> Self {
4830 self.view = v.into();
4831 self
4832 }
4833}
4834
4835impl wkt::message::Message for GetTableRequest {
4836 fn typename() -> &'static str {
4837 "type.googleapis.com/google.bigtable.admin.v2.GetTableRequest"
4838 }
4839}
4840
4841/// The request for
4842/// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
4843///
4844/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]: crate::client::BigtableTableAdmin::update_table
4845#[derive(Clone, Default, PartialEq)]
4846#[non_exhaustive]
4847pub struct UpdateTableRequest {
4848 /// Required. The table to update.
4849 /// The table's `name` field is used to identify the table to update.
4850 pub table: std::option::Option<crate::model::Table>,
4851
4852 /// Required. The list of fields to update.
4853 /// A mask specifying which fields (e.g. `change_stream_config`) in the `table`
4854 /// field should be updated. This mask is relative to the `table` field, not to
4855 /// the request message. The wildcard (*) path is currently not supported.
4856 /// Currently UpdateTable is only supported for the following fields:
4857 ///
4858 /// * `change_stream_config`
4859 /// * `change_stream_config.retention_period`
4860 /// * `deletion_protection`
4861 /// * `row_key_schema`
4862 ///
4863 /// If `column_families` is set in `update_mask`, it will return an
4864 /// UNIMPLEMENTED error.
4865 pub update_mask: std::option::Option<wkt::FieldMask>,
4866
4867 /// Optional. If true, ignore safety checks when updating the table.
4868 pub ignore_warnings: bool,
4869
4870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4871}
4872
4873impl UpdateTableRequest {
4874 pub fn new() -> Self {
4875 std::default::Default::default()
4876 }
4877
4878 /// Sets the value of [table][crate::model::UpdateTableRequest::table].
4879 ///
4880 /// # Example
4881 /// ```ignore,no_run
4882 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
4883 /// use google_cloud_bigtable_admin_v2::model::Table;
4884 /// let x = UpdateTableRequest::new().set_table(Table::default()/* use setters */);
4885 /// ```
4886 pub fn set_table<T>(mut self, v: T) -> Self
4887 where
4888 T: std::convert::Into<crate::model::Table>,
4889 {
4890 self.table = std::option::Option::Some(v.into());
4891 self
4892 }
4893
4894 /// Sets or clears the value of [table][crate::model::UpdateTableRequest::table].
4895 ///
4896 /// # Example
4897 /// ```ignore,no_run
4898 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
4899 /// use google_cloud_bigtable_admin_v2::model::Table;
4900 /// let x = UpdateTableRequest::new().set_or_clear_table(Some(Table::default()/* use setters */));
4901 /// let x = UpdateTableRequest::new().set_or_clear_table(None::<Table>);
4902 /// ```
4903 pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
4904 where
4905 T: std::convert::Into<crate::model::Table>,
4906 {
4907 self.table = v.map(|x| x.into());
4908 self
4909 }
4910
4911 /// Sets the value of [update_mask][crate::model::UpdateTableRequest::update_mask].
4912 ///
4913 /// # Example
4914 /// ```ignore,no_run
4915 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
4916 /// use wkt::FieldMask;
4917 /// let x = UpdateTableRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4918 /// ```
4919 pub fn set_update_mask<T>(mut self, v: T) -> Self
4920 where
4921 T: std::convert::Into<wkt::FieldMask>,
4922 {
4923 self.update_mask = std::option::Option::Some(v.into());
4924 self
4925 }
4926
4927 /// Sets or clears the value of [update_mask][crate::model::UpdateTableRequest::update_mask].
4928 ///
4929 /// # Example
4930 /// ```ignore,no_run
4931 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
4932 /// use wkt::FieldMask;
4933 /// let x = UpdateTableRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4934 /// let x = UpdateTableRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4935 /// ```
4936 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4937 where
4938 T: std::convert::Into<wkt::FieldMask>,
4939 {
4940 self.update_mask = v.map(|x| x.into());
4941 self
4942 }
4943
4944 /// Sets the value of [ignore_warnings][crate::model::UpdateTableRequest::ignore_warnings].
4945 ///
4946 /// # Example
4947 /// ```ignore,no_run
4948 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
4949 /// let x = UpdateTableRequest::new().set_ignore_warnings(true);
4950 /// ```
4951 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4952 self.ignore_warnings = v.into();
4953 self
4954 }
4955}
4956
4957impl wkt::message::Message for UpdateTableRequest {
4958 fn typename() -> &'static str {
4959 "type.googleapis.com/google.bigtable.admin.v2.UpdateTableRequest"
4960 }
4961}
4962
4963/// Metadata type for the operation returned by
4964/// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
4965///
4966/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]: crate::client::BigtableTableAdmin::update_table
4967#[derive(Clone, Default, PartialEq)]
4968#[non_exhaustive]
4969pub struct UpdateTableMetadata {
4970 /// The name of the table being updated.
4971 pub name: std::string::String,
4972
4973 /// The time at which this operation started.
4974 pub start_time: std::option::Option<wkt::Timestamp>,
4975
4976 /// If set, the time at which this operation finished or was canceled.
4977 pub end_time: std::option::Option<wkt::Timestamp>,
4978
4979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4980}
4981
4982impl UpdateTableMetadata {
4983 pub fn new() -> Self {
4984 std::default::Default::default()
4985 }
4986
4987 /// Sets the value of [name][crate::model::UpdateTableMetadata::name].
4988 ///
4989 /// # Example
4990 /// ```ignore,no_run
4991 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
4992 /// let x = UpdateTableMetadata::new().set_name("example");
4993 /// ```
4994 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4995 self.name = v.into();
4996 self
4997 }
4998
4999 /// Sets the value of [start_time][crate::model::UpdateTableMetadata::start_time].
5000 ///
5001 /// # Example
5002 /// ```ignore,no_run
5003 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5004 /// use wkt::Timestamp;
5005 /// let x = UpdateTableMetadata::new().set_start_time(Timestamp::default()/* use setters */);
5006 /// ```
5007 pub fn set_start_time<T>(mut self, v: T) -> Self
5008 where
5009 T: std::convert::Into<wkt::Timestamp>,
5010 {
5011 self.start_time = std::option::Option::Some(v.into());
5012 self
5013 }
5014
5015 /// Sets or clears the value of [start_time][crate::model::UpdateTableMetadata::start_time].
5016 ///
5017 /// # Example
5018 /// ```ignore,no_run
5019 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5020 /// use wkt::Timestamp;
5021 /// let x = UpdateTableMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
5022 /// let x = UpdateTableMetadata::new().set_or_clear_start_time(None::<Timestamp>);
5023 /// ```
5024 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5025 where
5026 T: std::convert::Into<wkt::Timestamp>,
5027 {
5028 self.start_time = v.map(|x| x.into());
5029 self
5030 }
5031
5032 /// Sets the value of [end_time][crate::model::UpdateTableMetadata::end_time].
5033 ///
5034 /// # Example
5035 /// ```ignore,no_run
5036 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5037 /// use wkt::Timestamp;
5038 /// let x = UpdateTableMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5039 /// ```
5040 pub fn set_end_time<T>(mut self, v: T) -> Self
5041 where
5042 T: std::convert::Into<wkt::Timestamp>,
5043 {
5044 self.end_time = std::option::Option::Some(v.into());
5045 self
5046 }
5047
5048 /// Sets or clears the value of [end_time][crate::model::UpdateTableMetadata::end_time].
5049 ///
5050 /// # Example
5051 /// ```ignore,no_run
5052 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5053 /// use wkt::Timestamp;
5054 /// let x = UpdateTableMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5055 /// let x = UpdateTableMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5056 /// ```
5057 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5058 where
5059 T: std::convert::Into<wkt::Timestamp>,
5060 {
5061 self.end_time = v.map(|x| x.into());
5062 self
5063 }
5064}
5065
5066impl wkt::message::Message for UpdateTableMetadata {
5067 fn typename() -> &'static str {
5068 "type.googleapis.com/google.bigtable.admin.v2.UpdateTableMetadata"
5069 }
5070}
5071
5072/// Request message for
5073/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]
5074///
5075/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]: crate::client::BigtableTableAdmin::delete_table
5076#[derive(Clone, Default, PartialEq)]
5077#[non_exhaustive]
5078pub struct DeleteTableRequest {
5079 /// Required. The unique name of the table to be deleted.
5080 /// Values are of the form
5081 /// `projects/{project}/instances/{instance}/tables/{table}`.
5082 pub name: std::string::String,
5083
5084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5085}
5086
5087impl DeleteTableRequest {
5088 pub fn new() -> Self {
5089 std::default::Default::default()
5090 }
5091
5092 /// Sets the value of [name][crate::model::DeleteTableRequest::name].
5093 ///
5094 /// # Example
5095 /// ```ignore,no_run
5096 /// # use google_cloud_bigtable_admin_v2::model::DeleteTableRequest;
5097 /// let x = DeleteTableRequest::new().set_name("example");
5098 /// ```
5099 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5100 self.name = v.into();
5101 self
5102 }
5103}
5104
5105impl wkt::message::Message for DeleteTableRequest {
5106 fn typename() -> &'static str {
5107 "type.googleapis.com/google.bigtable.admin.v2.DeleteTableRequest"
5108 }
5109}
5110
5111/// Request message for
5112/// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]
5113///
5114/// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]: crate::client::BigtableTableAdmin::undelete_table
5115#[derive(Clone, Default, PartialEq)]
5116#[non_exhaustive]
5117pub struct UndeleteTableRequest {
5118 /// Required. The unique name of the table to be restored.
5119 /// Values are of the form
5120 /// `projects/{project}/instances/{instance}/tables/{table}`.
5121 pub name: std::string::String,
5122
5123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5124}
5125
5126impl UndeleteTableRequest {
5127 pub fn new() -> Self {
5128 std::default::Default::default()
5129 }
5130
5131 /// Sets the value of [name][crate::model::UndeleteTableRequest::name].
5132 ///
5133 /// # Example
5134 /// ```ignore,no_run
5135 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableRequest;
5136 /// let x = UndeleteTableRequest::new().set_name("example");
5137 /// ```
5138 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5139 self.name = v.into();
5140 self
5141 }
5142}
5143
5144impl wkt::message::Message for UndeleteTableRequest {
5145 fn typename() -> &'static str {
5146 "type.googleapis.com/google.bigtable.admin.v2.UndeleteTableRequest"
5147 }
5148}
5149
5150/// Metadata type for the operation returned by
5151/// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable].
5152///
5153/// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]: crate::client::BigtableTableAdmin::undelete_table
5154#[derive(Clone, Default, PartialEq)]
5155#[non_exhaustive]
5156pub struct UndeleteTableMetadata {
5157 /// The name of the table being restored.
5158 pub name: std::string::String,
5159
5160 /// The time at which this operation started.
5161 pub start_time: std::option::Option<wkt::Timestamp>,
5162
5163 /// If set, the time at which this operation finished or was cancelled.
5164 pub end_time: std::option::Option<wkt::Timestamp>,
5165
5166 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5167}
5168
5169impl UndeleteTableMetadata {
5170 pub fn new() -> Self {
5171 std::default::Default::default()
5172 }
5173
5174 /// Sets the value of [name][crate::model::UndeleteTableMetadata::name].
5175 ///
5176 /// # Example
5177 /// ```ignore,no_run
5178 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5179 /// let x = UndeleteTableMetadata::new().set_name("example");
5180 /// ```
5181 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5182 self.name = v.into();
5183 self
5184 }
5185
5186 /// Sets the value of [start_time][crate::model::UndeleteTableMetadata::start_time].
5187 ///
5188 /// # Example
5189 /// ```ignore,no_run
5190 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5191 /// use wkt::Timestamp;
5192 /// let x = UndeleteTableMetadata::new().set_start_time(Timestamp::default()/* use setters */);
5193 /// ```
5194 pub fn set_start_time<T>(mut self, v: T) -> Self
5195 where
5196 T: std::convert::Into<wkt::Timestamp>,
5197 {
5198 self.start_time = std::option::Option::Some(v.into());
5199 self
5200 }
5201
5202 /// Sets or clears the value of [start_time][crate::model::UndeleteTableMetadata::start_time].
5203 ///
5204 /// # Example
5205 /// ```ignore,no_run
5206 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5207 /// use wkt::Timestamp;
5208 /// let x = UndeleteTableMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
5209 /// let x = UndeleteTableMetadata::new().set_or_clear_start_time(None::<Timestamp>);
5210 /// ```
5211 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5212 where
5213 T: std::convert::Into<wkt::Timestamp>,
5214 {
5215 self.start_time = v.map(|x| x.into());
5216 self
5217 }
5218
5219 /// Sets the value of [end_time][crate::model::UndeleteTableMetadata::end_time].
5220 ///
5221 /// # Example
5222 /// ```ignore,no_run
5223 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5224 /// use wkt::Timestamp;
5225 /// let x = UndeleteTableMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5226 /// ```
5227 pub fn set_end_time<T>(mut self, v: T) -> Self
5228 where
5229 T: std::convert::Into<wkt::Timestamp>,
5230 {
5231 self.end_time = std::option::Option::Some(v.into());
5232 self
5233 }
5234
5235 /// Sets or clears the value of [end_time][crate::model::UndeleteTableMetadata::end_time].
5236 ///
5237 /// # Example
5238 /// ```ignore,no_run
5239 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5240 /// use wkt::Timestamp;
5241 /// let x = UndeleteTableMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5242 /// let x = UndeleteTableMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5243 /// ```
5244 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5245 where
5246 T: std::convert::Into<wkt::Timestamp>,
5247 {
5248 self.end_time = v.map(|x| x.into());
5249 self
5250 }
5251}
5252
5253impl wkt::message::Message for UndeleteTableMetadata {
5254 fn typename() -> &'static str {
5255 "type.googleapis.com/google.bigtable.admin.v2.UndeleteTableMetadata"
5256 }
5257}
5258
5259/// Request message for
5260/// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]
5261///
5262/// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]: crate::client::BigtableTableAdmin::modify_column_families
5263#[derive(Clone, Default, PartialEq)]
5264#[non_exhaustive]
5265pub struct ModifyColumnFamiliesRequest {
5266 /// Required. The unique name of the table whose families should be modified.
5267 /// Values are of the form
5268 /// `projects/{project}/instances/{instance}/tables/{table}`.
5269 pub name: std::string::String,
5270
5271 /// Required. Modifications to be atomically applied to the specified table's
5272 /// families. Entries are applied in order, meaning that earlier modifications
5273 /// can be masked by later ones (in the case of repeated updates to the same
5274 /// family, for example).
5275 pub modifications: std::vec::Vec<crate::model::modify_column_families_request::Modification>,
5276
5277 /// Optional. If true, ignore safety checks when modifying the column families.
5278 pub ignore_warnings: bool,
5279
5280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5281}
5282
5283impl ModifyColumnFamiliesRequest {
5284 pub fn new() -> Self {
5285 std::default::Default::default()
5286 }
5287
5288 /// Sets the value of [name][crate::model::ModifyColumnFamiliesRequest::name].
5289 ///
5290 /// # Example
5291 /// ```ignore,no_run
5292 /// # use google_cloud_bigtable_admin_v2::model::ModifyColumnFamiliesRequest;
5293 /// let x = ModifyColumnFamiliesRequest::new().set_name("example");
5294 /// ```
5295 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5296 self.name = v.into();
5297 self
5298 }
5299
5300 /// Sets the value of [modifications][crate::model::ModifyColumnFamiliesRequest::modifications].
5301 ///
5302 /// # Example
5303 /// ```ignore,no_run
5304 /// # use google_cloud_bigtable_admin_v2::model::ModifyColumnFamiliesRequest;
5305 /// use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5306 /// let x = ModifyColumnFamiliesRequest::new()
5307 /// .set_modifications([
5308 /// Modification::default()/* use setters */,
5309 /// Modification::default()/* use (different) setters */,
5310 /// ]);
5311 /// ```
5312 pub fn set_modifications<T, V>(mut self, v: T) -> Self
5313 where
5314 T: std::iter::IntoIterator<Item = V>,
5315 V: std::convert::Into<crate::model::modify_column_families_request::Modification>,
5316 {
5317 use std::iter::Iterator;
5318 self.modifications = v.into_iter().map(|i| i.into()).collect();
5319 self
5320 }
5321
5322 /// Sets the value of [ignore_warnings][crate::model::ModifyColumnFamiliesRequest::ignore_warnings].
5323 ///
5324 /// # Example
5325 /// ```ignore,no_run
5326 /// # use google_cloud_bigtable_admin_v2::model::ModifyColumnFamiliesRequest;
5327 /// let x = ModifyColumnFamiliesRequest::new().set_ignore_warnings(true);
5328 /// ```
5329 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5330 self.ignore_warnings = v.into();
5331 self
5332 }
5333}
5334
5335impl wkt::message::Message for ModifyColumnFamiliesRequest {
5336 fn typename() -> &'static str {
5337 "type.googleapis.com/google.bigtable.admin.v2.ModifyColumnFamiliesRequest"
5338 }
5339}
5340
5341/// Defines additional types related to [ModifyColumnFamiliesRequest].
5342pub mod modify_column_families_request {
5343 #[allow(unused_imports)]
5344 use super::*;
5345
5346 /// A create, update, or delete of a particular column family.
5347 #[derive(Clone, Default, PartialEq)]
5348 #[non_exhaustive]
5349 pub struct Modification {
5350 /// The ID of the column family to be modified.
5351 pub id: std::string::String,
5352
5353 /// Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
5354 /// mod should be updated, ignored for other modification types. If unset or
5355 /// empty, we treat it as updating `gc_rule` to be backward compatible.
5356 pub update_mask: std::option::Option<wkt::FieldMask>,
5357
5358 /// Column family modifications.
5359 pub r#mod:
5360 std::option::Option<crate::model::modify_column_families_request::modification::Mod>,
5361
5362 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5363 }
5364
5365 impl Modification {
5366 pub fn new() -> Self {
5367 std::default::Default::default()
5368 }
5369
5370 /// Sets the value of [id][crate::model::modify_column_families_request::Modification::id].
5371 ///
5372 /// # Example
5373 /// ```ignore,no_run
5374 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5375 /// let x = Modification::new().set_id("example");
5376 /// ```
5377 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5378 self.id = v.into();
5379 self
5380 }
5381
5382 /// Sets the value of [update_mask][crate::model::modify_column_families_request::Modification::update_mask].
5383 ///
5384 /// # Example
5385 /// ```ignore,no_run
5386 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5387 /// use wkt::FieldMask;
5388 /// let x = Modification::new().set_update_mask(FieldMask::default()/* use setters */);
5389 /// ```
5390 pub fn set_update_mask<T>(mut self, v: T) -> Self
5391 where
5392 T: std::convert::Into<wkt::FieldMask>,
5393 {
5394 self.update_mask = std::option::Option::Some(v.into());
5395 self
5396 }
5397
5398 /// Sets or clears the value of [update_mask][crate::model::modify_column_families_request::Modification::update_mask].
5399 ///
5400 /// # Example
5401 /// ```ignore,no_run
5402 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5403 /// use wkt::FieldMask;
5404 /// let x = Modification::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5405 /// let x = Modification::new().set_or_clear_update_mask(None::<FieldMask>);
5406 /// ```
5407 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5408 where
5409 T: std::convert::Into<wkt::FieldMask>,
5410 {
5411 self.update_mask = v.map(|x| x.into());
5412 self
5413 }
5414
5415 /// Sets the value of [r#mod][crate::model::modify_column_families_request::Modification::mod].
5416 ///
5417 /// Note that all the setters affecting `r#mod` are mutually
5418 /// exclusive.
5419 ///
5420 /// # Example
5421 /// ```ignore,no_run
5422 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5423 /// use google_cloud_bigtable_admin_v2::model::modify_column_families_request::modification::Mod;
5424 /// let x = Modification::new().set_mod(Some(Mod::Drop(true)));
5425 /// ```
5426 pub fn set_mod<
5427 T: std::convert::Into<
5428 std::option::Option<
5429 crate::model::modify_column_families_request::modification::Mod,
5430 >,
5431 >,
5432 >(
5433 mut self,
5434 v: T,
5435 ) -> Self {
5436 self.r#mod = v.into();
5437 self
5438 }
5439
5440 /// The value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
5441 /// if it holds a `Create`, `None` if the field is not set or
5442 /// holds a different branch.
5443 pub fn create(&self) -> std::option::Option<&std::boxed::Box<crate::model::ColumnFamily>> {
5444 #[allow(unreachable_patterns)]
5445 self.r#mod.as_ref().and_then(|v| match v {
5446 crate::model::modify_column_families_request::modification::Mod::Create(v) => {
5447 std::option::Option::Some(v)
5448 }
5449 _ => std::option::Option::None,
5450 })
5451 }
5452
5453 /// Sets the value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
5454 /// to hold a `Create`.
5455 ///
5456 /// Note that all the setters affecting `r#mod` are
5457 /// mutually exclusive.
5458 ///
5459 /// # Example
5460 /// ```ignore,no_run
5461 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5462 /// use google_cloud_bigtable_admin_v2::model::ColumnFamily;
5463 /// let x = Modification::new().set_create(ColumnFamily::default()/* use setters */);
5464 /// assert!(x.create().is_some());
5465 /// assert!(x.update().is_none());
5466 /// assert!(x.drop().is_none());
5467 /// ```
5468 pub fn set_create<T: std::convert::Into<std::boxed::Box<crate::model::ColumnFamily>>>(
5469 mut self,
5470 v: T,
5471 ) -> Self {
5472 self.r#mod = std::option::Option::Some(
5473 crate::model::modify_column_families_request::modification::Mod::Create(v.into()),
5474 );
5475 self
5476 }
5477
5478 /// The value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
5479 /// if it holds a `Update`, `None` if the field is not set or
5480 /// holds a different branch.
5481 pub fn update(&self) -> std::option::Option<&std::boxed::Box<crate::model::ColumnFamily>> {
5482 #[allow(unreachable_patterns)]
5483 self.r#mod.as_ref().and_then(|v| match v {
5484 crate::model::modify_column_families_request::modification::Mod::Update(v) => {
5485 std::option::Option::Some(v)
5486 }
5487 _ => std::option::Option::None,
5488 })
5489 }
5490
5491 /// Sets the value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
5492 /// to hold a `Update`.
5493 ///
5494 /// Note that all the setters affecting `r#mod` are
5495 /// mutually exclusive.
5496 ///
5497 /// # Example
5498 /// ```ignore,no_run
5499 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5500 /// use google_cloud_bigtable_admin_v2::model::ColumnFamily;
5501 /// let x = Modification::new().set_update(ColumnFamily::default()/* use setters */);
5502 /// assert!(x.update().is_some());
5503 /// assert!(x.create().is_none());
5504 /// assert!(x.drop().is_none());
5505 /// ```
5506 pub fn set_update<T: std::convert::Into<std::boxed::Box<crate::model::ColumnFamily>>>(
5507 mut self,
5508 v: T,
5509 ) -> Self {
5510 self.r#mod = std::option::Option::Some(
5511 crate::model::modify_column_families_request::modification::Mod::Update(v.into()),
5512 );
5513 self
5514 }
5515
5516 /// The value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
5517 /// if it holds a `Drop`, `None` if the field is not set or
5518 /// holds a different branch.
5519 pub fn drop(&self) -> std::option::Option<&bool> {
5520 #[allow(unreachable_patterns)]
5521 self.r#mod.as_ref().and_then(|v| match v {
5522 crate::model::modify_column_families_request::modification::Mod::Drop(v) => {
5523 std::option::Option::Some(v)
5524 }
5525 _ => std::option::Option::None,
5526 })
5527 }
5528
5529 /// Sets the value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
5530 /// to hold a `Drop`.
5531 ///
5532 /// Note that all the setters affecting `r#mod` are
5533 /// mutually exclusive.
5534 ///
5535 /// # Example
5536 /// ```ignore,no_run
5537 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5538 /// let x = Modification::new().set_drop(true);
5539 /// assert!(x.drop().is_some());
5540 /// assert!(x.create().is_none());
5541 /// assert!(x.update().is_none());
5542 /// ```
5543 pub fn set_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5544 self.r#mod = std::option::Option::Some(
5545 crate::model::modify_column_families_request::modification::Mod::Drop(v.into()),
5546 );
5547 self
5548 }
5549 }
5550
5551 impl wkt::message::Message for Modification {
5552 fn typename() -> &'static str {
5553 "type.googleapis.com/google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification"
5554 }
5555 }
5556
5557 /// Defines additional types related to [Modification].
5558 pub mod modification {
5559 #[allow(unused_imports)]
5560 use super::*;
5561
5562 /// Column family modifications.
5563 #[derive(Clone, Debug, PartialEq)]
5564 #[non_exhaustive]
5565 pub enum Mod {
5566 /// Create a new column family with the specified schema, or fail if
5567 /// one already exists with the given ID.
5568 Create(std::boxed::Box<crate::model::ColumnFamily>),
5569 /// Update an existing column family to the specified schema, or fail
5570 /// if no column family exists with the given ID.
5571 Update(std::boxed::Box<crate::model::ColumnFamily>),
5572 /// Drop (delete) the column family with the given ID, or fail if no such
5573 /// family exists.
5574 Drop(bool),
5575 }
5576 }
5577}
5578
5579/// Request message for
5580/// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
5581///
5582/// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]: crate::client::BigtableTableAdmin::generate_consistency_token
5583#[derive(Clone, Default, PartialEq)]
5584#[non_exhaustive]
5585pub struct GenerateConsistencyTokenRequest {
5586 /// Required. The unique name of the Table for which to create a consistency
5587 /// token. Values are of the form
5588 /// `projects/{project}/instances/{instance}/tables/{table}`.
5589 pub name: std::string::String,
5590
5591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5592}
5593
5594impl GenerateConsistencyTokenRequest {
5595 pub fn new() -> Self {
5596 std::default::Default::default()
5597 }
5598
5599 /// Sets the value of [name][crate::model::GenerateConsistencyTokenRequest::name].
5600 ///
5601 /// # Example
5602 /// ```ignore,no_run
5603 /// # use google_cloud_bigtable_admin_v2::model::GenerateConsistencyTokenRequest;
5604 /// let x = GenerateConsistencyTokenRequest::new().set_name("example");
5605 /// ```
5606 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5607 self.name = v.into();
5608 self
5609 }
5610}
5611
5612impl wkt::message::Message for GenerateConsistencyTokenRequest {
5613 fn typename() -> &'static str {
5614 "type.googleapis.com/google.bigtable.admin.v2.GenerateConsistencyTokenRequest"
5615 }
5616}
5617
5618/// Response message for
5619/// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
5620///
5621/// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]: crate::client::BigtableTableAdmin::generate_consistency_token
5622#[derive(Clone, Default, PartialEq)]
5623#[non_exhaustive]
5624pub struct GenerateConsistencyTokenResponse {
5625 /// The generated consistency token.
5626 pub consistency_token: std::string::String,
5627
5628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5629}
5630
5631impl GenerateConsistencyTokenResponse {
5632 pub fn new() -> Self {
5633 std::default::Default::default()
5634 }
5635
5636 /// Sets the value of [consistency_token][crate::model::GenerateConsistencyTokenResponse::consistency_token].
5637 ///
5638 /// # Example
5639 /// ```ignore,no_run
5640 /// # use google_cloud_bigtable_admin_v2::model::GenerateConsistencyTokenResponse;
5641 /// let x = GenerateConsistencyTokenResponse::new().set_consistency_token("example");
5642 /// ```
5643 pub fn set_consistency_token<T: std::convert::Into<std::string::String>>(
5644 mut self,
5645 v: T,
5646 ) -> Self {
5647 self.consistency_token = v.into();
5648 self
5649 }
5650}
5651
5652impl wkt::message::Message for GenerateConsistencyTokenResponse {
5653 fn typename() -> &'static str {
5654 "type.googleapis.com/google.bigtable.admin.v2.GenerateConsistencyTokenResponse"
5655 }
5656}
5657
5658/// Request message for
5659/// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
5660///
5661/// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]: crate::client::BigtableTableAdmin::check_consistency
5662#[derive(Clone, Default, PartialEq)]
5663#[non_exhaustive]
5664pub struct CheckConsistencyRequest {
5665 /// Required. The unique name of the Table for which to check replication
5666 /// consistency. Values are of the form
5667 /// `projects/{project}/instances/{instance}/tables/{table}`.
5668 pub name: std::string::String,
5669
5670 /// Required. The token created using GenerateConsistencyToken for the Table.
5671 pub consistency_token: std::string::String,
5672
5673 /// Which type of read needs to consistently observe which type of write?
5674 /// Default: `standard_read_remote_writes`
5675 pub mode: std::option::Option<crate::model::check_consistency_request::Mode>,
5676
5677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5678}
5679
5680impl CheckConsistencyRequest {
5681 pub fn new() -> Self {
5682 std::default::Default::default()
5683 }
5684
5685 /// Sets the value of [name][crate::model::CheckConsistencyRequest::name].
5686 ///
5687 /// # Example
5688 /// ```ignore,no_run
5689 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
5690 /// let x = CheckConsistencyRequest::new().set_name("example");
5691 /// ```
5692 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5693 self.name = v.into();
5694 self
5695 }
5696
5697 /// Sets the value of [consistency_token][crate::model::CheckConsistencyRequest::consistency_token].
5698 ///
5699 /// # Example
5700 /// ```ignore,no_run
5701 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
5702 /// let x = CheckConsistencyRequest::new().set_consistency_token("example");
5703 /// ```
5704 pub fn set_consistency_token<T: std::convert::Into<std::string::String>>(
5705 mut self,
5706 v: T,
5707 ) -> Self {
5708 self.consistency_token = v.into();
5709 self
5710 }
5711
5712 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode].
5713 ///
5714 /// Note that all the setters affecting `mode` are mutually
5715 /// exclusive.
5716 ///
5717 /// # Example
5718 /// ```ignore,no_run
5719 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
5720 /// use google_cloud_bigtable_admin_v2::model::StandardReadRemoteWrites;
5721 /// let x = CheckConsistencyRequest::new().set_mode(Some(
5722 /// google_cloud_bigtable_admin_v2::model::check_consistency_request::Mode::StandardReadRemoteWrites(StandardReadRemoteWrites::default().into())));
5723 /// ```
5724 pub fn set_mode<
5725 T: std::convert::Into<std::option::Option<crate::model::check_consistency_request::Mode>>,
5726 >(
5727 mut self,
5728 v: T,
5729 ) -> Self {
5730 self.mode = v.into();
5731 self
5732 }
5733
5734 /// The value of [mode][crate::model::CheckConsistencyRequest::mode]
5735 /// if it holds a `StandardReadRemoteWrites`, `None` if the field is not set or
5736 /// holds a different branch.
5737 pub fn standard_read_remote_writes(
5738 &self,
5739 ) -> std::option::Option<&std::boxed::Box<crate::model::StandardReadRemoteWrites>> {
5740 #[allow(unreachable_patterns)]
5741 self.mode.as_ref().and_then(|v| match v {
5742 crate::model::check_consistency_request::Mode::StandardReadRemoteWrites(v) => {
5743 std::option::Option::Some(v)
5744 }
5745 _ => std::option::Option::None,
5746 })
5747 }
5748
5749 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode]
5750 /// to hold a `StandardReadRemoteWrites`.
5751 ///
5752 /// Note that all the setters affecting `mode` are
5753 /// mutually exclusive.
5754 ///
5755 /// # Example
5756 /// ```ignore,no_run
5757 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
5758 /// use google_cloud_bigtable_admin_v2::model::StandardReadRemoteWrites;
5759 /// let x = CheckConsistencyRequest::new().set_standard_read_remote_writes(StandardReadRemoteWrites::default()/* use setters */);
5760 /// assert!(x.standard_read_remote_writes().is_some());
5761 /// assert!(x.data_boost_read_local_writes().is_none());
5762 /// ```
5763 pub fn set_standard_read_remote_writes<
5764 T: std::convert::Into<std::boxed::Box<crate::model::StandardReadRemoteWrites>>,
5765 >(
5766 mut self,
5767 v: T,
5768 ) -> Self {
5769 self.mode = std::option::Option::Some(
5770 crate::model::check_consistency_request::Mode::StandardReadRemoteWrites(v.into()),
5771 );
5772 self
5773 }
5774
5775 /// The value of [mode][crate::model::CheckConsistencyRequest::mode]
5776 /// if it holds a `DataBoostReadLocalWrites`, `None` if the field is not set or
5777 /// holds a different branch.
5778 pub fn data_boost_read_local_writes(
5779 &self,
5780 ) -> std::option::Option<&std::boxed::Box<crate::model::DataBoostReadLocalWrites>> {
5781 #[allow(unreachable_patterns)]
5782 self.mode.as_ref().and_then(|v| match v {
5783 crate::model::check_consistency_request::Mode::DataBoostReadLocalWrites(v) => {
5784 std::option::Option::Some(v)
5785 }
5786 _ => std::option::Option::None,
5787 })
5788 }
5789
5790 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode]
5791 /// to hold a `DataBoostReadLocalWrites`.
5792 ///
5793 /// Note that all the setters affecting `mode` are
5794 /// mutually exclusive.
5795 ///
5796 /// # Example
5797 /// ```ignore,no_run
5798 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
5799 /// use google_cloud_bigtable_admin_v2::model::DataBoostReadLocalWrites;
5800 /// let x = CheckConsistencyRequest::new().set_data_boost_read_local_writes(DataBoostReadLocalWrites::default()/* use setters */);
5801 /// assert!(x.data_boost_read_local_writes().is_some());
5802 /// assert!(x.standard_read_remote_writes().is_none());
5803 /// ```
5804 pub fn set_data_boost_read_local_writes<
5805 T: std::convert::Into<std::boxed::Box<crate::model::DataBoostReadLocalWrites>>,
5806 >(
5807 mut self,
5808 v: T,
5809 ) -> Self {
5810 self.mode = std::option::Option::Some(
5811 crate::model::check_consistency_request::Mode::DataBoostReadLocalWrites(v.into()),
5812 );
5813 self
5814 }
5815}
5816
5817impl wkt::message::Message for CheckConsistencyRequest {
5818 fn typename() -> &'static str {
5819 "type.googleapis.com/google.bigtable.admin.v2.CheckConsistencyRequest"
5820 }
5821}
5822
5823/// Defines additional types related to [CheckConsistencyRequest].
5824pub mod check_consistency_request {
5825 #[allow(unused_imports)]
5826 use super::*;
5827
5828 /// Which type of read needs to consistently observe which type of write?
5829 /// Default: `standard_read_remote_writes`
5830 #[derive(Clone, Debug, PartialEq)]
5831 #[non_exhaustive]
5832 pub enum Mode {
5833 /// Checks that reads using an app profile with `StandardIsolation` can
5834 /// see all writes committed before the token was created, even if the
5835 /// read and write target different clusters.
5836 StandardReadRemoteWrites(std::boxed::Box<crate::model::StandardReadRemoteWrites>),
5837 /// Checks that reads using an app profile with `DataBoostIsolationReadOnly`
5838 /// can see all writes committed before the token was created, but only if
5839 /// the read and write target the same cluster.
5840 DataBoostReadLocalWrites(std::boxed::Box<crate::model::DataBoostReadLocalWrites>),
5841 }
5842}
5843
5844/// Checks that all writes before the consistency token was generated are
5845/// replicated in every cluster and readable.
5846#[derive(Clone, Default, PartialEq)]
5847#[non_exhaustive]
5848pub struct StandardReadRemoteWrites {
5849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5850}
5851
5852impl StandardReadRemoteWrites {
5853 pub fn new() -> Self {
5854 std::default::Default::default()
5855 }
5856}
5857
5858impl wkt::message::Message for StandardReadRemoteWrites {
5859 fn typename() -> &'static str {
5860 "type.googleapis.com/google.bigtable.admin.v2.StandardReadRemoteWrites"
5861 }
5862}
5863
5864/// Checks that all writes before the consistency token was generated in the same
5865/// cluster are readable by Databoost.
5866#[derive(Clone, Default, PartialEq)]
5867#[non_exhaustive]
5868pub struct DataBoostReadLocalWrites {
5869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5870}
5871
5872impl DataBoostReadLocalWrites {
5873 pub fn new() -> Self {
5874 std::default::Default::default()
5875 }
5876}
5877
5878impl wkt::message::Message for DataBoostReadLocalWrites {
5879 fn typename() -> &'static str {
5880 "type.googleapis.com/google.bigtable.admin.v2.DataBoostReadLocalWrites"
5881 }
5882}
5883
5884/// Response message for
5885/// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
5886///
5887/// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]: crate::client::BigtableTableAdmin::check_consistency
5888#[derive(Clone, Default, PartialEq)]
5889#[non_exhaustive]
5890pub struct CheckConsistencyResponse {
5891 /// True only if the token is consistent. A token is consistent if replication
5892 /// has caught up with the restrictions specified in the request.
5893 pub consistent: bool,
5894
5895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5896}
5897
5898impl CheckConsistencyResponse {
5899 pub fn new() -> Self {
5900 std::default::Default::default()
5901 }
5902
5903 /// Sets the value of [consistent][crate::model::CheckConsistencyResponse::consistent].
5904 ///
5905 /// # Example
5906 /// ```ignore,no_run
5907 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyResponse;
5908 /// let x = CheckConsistencyResponse::new().set_consistent(true);
5909 /// ```
5910 pub fn set_consistent<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5911 self.consistent = v.into();
5912 self
5913 }
5914}
5915
5916impl wkt::message::Message for CheckConsistencyResponse {
5917 fn typename() -> &'static str {
5918 "type.googleapis.com/google.bigtable.admin.v2.CheckConsistencyResponse"
5919 }
5920}
5921
5922/// Request message for
5923/// [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]
5924///
5925/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
5926/// feature is not currently available to most Cloud Bigtable customers. This
5927/// feature might be changed in backward-incompatible ways and is not recommended
5928/// for production use. It is not subject to any SLA or deprecation policy.
5929///
5930/// [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]: crate::client::BigtableTableAdmin::snapshot_table
5931#[derive(Clone, Default, PartialEq)]
5932#[non_exhaustive]
5933pub struct SnapshotTableRequest {
5934 /// Required. The unique name of the table to have the snapshot taken.
5935 /// Values are of the form
5936 /// `projects/{project}/instances/{instance}/tables/{table}`.
5937 pub name: std::string::String,
5938
5939 /// Required. The name of the cluster where the snapshot will be created in.
5940 /// Values are of the form
5941 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
5942 pub cluster: std::string::String,
5943
5944 /// Required. The ID by which the new snapshot should be referred to within the
5945 /// parent cluster, e.g., `mysnapshot` of the form:
5946 /// `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
5947 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
5948 pub snapshot_id: std::string::String,
5949
5950 /// The amount of time that the new snapshot can stay active after it is
5951 /// created. Once 'ttl' expires, the snapshot will get deleted. The maximum
5952 /// amount of time a snapshot can stay active is 7 days. If 'ttl' is not
5953 /// specified, the default value of 24 hours will be used.
5954 pub ttl: std::option::Option<wkt::Duration>,
5955
5956 /// Description of the snapshot.
5957 pub description: std::string::String,
5958
5959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5960}
5961
5962impl SnapshotTableRequest {
5963 pub fn new() -> Self {
5964 std::default::Default::default()
5965 }
5966
5967 /// Sets the value of [name][crate::model::SnapshotTableRequest::name].
5968 ///
5969 /// # Example
5970 /// ```ignore,no_run
5971 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
5972 /// let x = SnapshotTableRequest::new().set_name("example");
5973 /// ```
5974 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5975 self.name = v.into();
5976 self
5977 }
5978
5979 /// Sets the value of [cluster][crate::model::SnapshotTableRequest::cluster].
5980 ///
5981 /// # Example
5982 /// ```ignore,no_run
5983 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
5984 /// let x = SnapshotTableRequest::new().set_cluster("example");
5985 /// ```
5986 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5987 self.cluster = v.into();
5988 self
5989 }
5990
5991 /// Sets the value of [snapshot_id][crate::model::SnapshotTableRequest::snapshot_id].
5992 ///
5993 /// # Example
5994 /// ```ignore,no_run
5995 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
5996 /// let x = SnapshotTableRequest::new().set_snapshot_id("example");
5997 /// ```
5998 pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5999 self.snapshot_id = v.into();
6000 self
6001 }
6002
6003 /// Sets the value of [ttl][crate::model::SnapshotTableRequest::ttl].
6004 ///
6005 /// # Example
6006 /// ```ignore,no_run
6007 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6008 /// use wkt::Duration;
6009 /// let x = SnapshotTableRequest::new().set_ttl(Duration::default()/* use setters */);
6010 /// ```
6011 pub fn set_ttl<T>(mut self, v: T) -> Self
6012 where
6013 T: std::convert::Into<wkt::Duration>,
6014 {
6015 self.ttl = std::option::Option::Some(v.into());
6016 self
6017 }
6018
6019 /// Sets or clears the value of [ttl][crate::model::SnapshotTableRequest::ttl].
6020 ///
6021 /// # Example
6022 /// ```ignore,no_run
6023 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6024 /// use wkt::Duration;
6025 /// let x = SnapshotTableRequest::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
6026 /// let x = SnapshotTableRequest::new().set_or_clear_ttl(None::<Duration>);
6027 /// ```
6028 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
6029 where
6030 T: std::convert::Into<wkt::Duration>,
6031 {
6032 self.ttl = v.map(|x| x.into());
6033 self
6034 }
6035
6036 /// Sets the value of [description][crate::model::SnapshotTableRequest::description].
6037 ///
6038 /// # Example
6039 /// ```ignore,no_run
6040 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6041 /// let x = SnapshotTableRequest::new().set_description("example");
6042 /// ```
6043 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6044 self.description = v.into();
6045 self
6046 }
6047}
6048
6049impl wkt::message::Message for SnapshotTableRequest {
6050 fn typename() -> &'static str {
6051 "type.googleapis.com/google.bigtable.admin.v2.SnapshotTableRequest"
6052 }
6053}
6054
6055/// Request message for
6056/// [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]
6057///
6058/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6059/// feature is not currently available to most Cloud Bigtable customers. This
6060/// feature might be changed in backward-incompatible ways and is not recommended
6061/// for production use. It is not subject to any SLA or deprecation policy.
6062///
6063/// [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]: crate::client::BigtableTableAdmin::get_snapshot
6064#[derive(Clone, Default, PartialEq)]
6065#[non_exhaustive]
6066pub struct GetSnapshotRequest {
6067 /// Required. The unique name of the requested snapshot.
6068 /// Values are of the form
6069 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
6070 pub name: std::string::String,
6071
6072 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6073}
6074
6075impl GetSnapshotRequest {
6076 pub fn new() -> Self {
6077 std::default::Default::default()
6078 }
6079
6080 /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
6081 ///
6082 /// # Example
6083 /// ```ignore,no_run
6084 /// # use google_cloud_bigtable_admin_v2::model::GetSnapshotRequest;
6085 /// let x = GetSnapshotRequest::new().set_name("example");
6086 /// ```
6087 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6088 self.name = v.into();
6089 self
6090 }
6091}
6092
6093impl wkt::message::Message for GetSnapshotRequest {
6094 fn typename() -> &'static str {
6095 "type.googleapis.com/google.bigtable.admin.v2.GetSnapshotRequest"
6096 }
6097}
6098
6099/// Request message for
6100/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
6101///
6102/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6103/// feature is not currently available to most Cloud Bigtable customers. This
6104/// feature might be changed in backward-incompatible ways and is not recommended
6105/// for production use. It is not subject to any SLA or deprecation policy.
6106///
6107/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]: crate::client::BigtableTableAdmin::list_snapshots
6108#[derive(Clone, Default, PartialEq)]
6109#[non_exhaustive]
6110pub struct ListSnapshotsRequest {
6111 /// Required. The unique name of the cluster for which snapshots should be
6112 /// listed. Values are of the form
6113 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
6114 /// Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
6115 /// e.g., `projects/{project}/instances/{instance}/clusters/-`.
6116 pub parent: std::string::String,
6117
6118 /// The maximum number of snapshots to return per page.
6119 /// CURRENTLY UNIMPLEMENTED AND IGNORED.
6120 pub page_size: i32,
6121
6122 /// The value of `next_page_token` returned by a previous call.
6123 pub page_token: std::string::String,
6124
6125 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6126}
6127
6128impl ListSnapshotsRequest {
6129 pub fn new() -> Self {
6130 std::default::Default::default()
6131 }
6132
6133 /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
6134 ///
6135 /// # Example
6136 /// ```ignore,no_run
6137 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsRequest;
6138 /// let x = ListSnapshotsRequest::new().set_parent("example");
6139 /// ```
6140 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6141 self.parent = v.into();
6142 self
6143 }
6144
6145 /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
6146 ///
6147 /// # Example
6148 /// ```ignore,no_run
6149 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsRequest;
6150 /// let x = ListSnapshotsRequest::new().set_page_size(42);
6151 /// ```
6152 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6153 self.page_size = v.into();
6154 self
6155 }
6156
6157 /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
6158 ///
6159 /// # Example
6160 /// ```ignore,no_run
6161 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsRequest;
6162 /// let x = ListSnapshotsRequest::new().set_page_token("example");
6163 /// ```
6164 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6165 self.page_token = v.into();
6166 self
6167 }
6168}
6169
6170impl wkt::message::Message for ListSnapshotsRequest {
6171 fn typename() -> &'static str {
6172 "type.googleapis.com/google.bigtable.admin.v2.ListSnapshotsRequest"
6173 }
6174}
6175
6176/// Response message for
6177/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
6178///
6179/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6180/// feature is not currently available to most Cloud Bigtable customers. This
6181/// feature might be changed in backward-incompatible ways and is not recommended
6182/// for production use. It is not subject to any SLA or deprecation policy.
6183///
6184/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]: crate::client::BigtableTableAdmin::list_snapshots
6185#[derive(Clone, Default, PartialEq)]
6186#[non_exhaustive]
6187pub struct ListSnapshotsResponse {
6188 /// The snapshots present in the requested cluster.
6189 pub snapshots: std::vec::Vec<crate::model::Snapshot>,
6190
6191 /// Set if not all snapshots could be returned in a single response.
6192 /// Pass this value to `page_token` in another request to get the next
6193 /// page of results.
6194 pub next_page_token: std::string::String,
6195
6196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6197}
6198
6199impl ListSnapshotsResponse {
6200 pub fn new() -> Self {
6201 std::default::Default::default()
6202 }
6203
6204 /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
6205 ///
6206 /// # Example
6207 /// ```ignore,no_run
6208 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsResponse;
6209 /// use google_cloud_bigtable_admin_v2::model::Snapshot;
6210 /// let x = ListSnapshotsResponse::new()
6211 /// .set_snapshots([
6212 /// Snapshot::default()/* use setters */,
6213 /// Snapshot::default()/* use (different) setters */,
6214 /// ]);
6215 /// ```
6216 pub fn set_snapshots<T, V>(mut self, v: T) -> Self
6217 where
6218 T: std::iter::IntoIterator<Item = V>,
6219 V: std::convert::Into<crate::model::Snapshot>,
6220 {
6221 use std::iter::Iterator;
6222 self.snapshots = v.into_iter().map(|i| i.into()).collect();
6223 self
6224 }
6225
6226 /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
6227 ///
6228 /// # Example
6229 /// ```ignore,no_run
6230 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsResponse;
6231 /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
6232 /// ```
6233 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6234 self.next_page_token = v.into();
6235 self
6236 }
6237}
6238
6239impl wkt::message::Message for ListSnapshotsResponse {
6240 fn typename() -> &'static str {
6241 "type.googleapis.com/google.bigtable.admin.v2.ListSnapshotsResponse"
6242 }
6243}
6244
6245#[doc(hidden)]
6246impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
6247 type PageItem = crate::model::Snapshot;
6248
6249 fn items(self) -> std::vec::Vec<Self::PageItem> {
6250 self.snapshots
6251 }
6252
6253 fn next_page_token(&self) -> std::string::String {
6254 use std::clone::Clone;
6255 self.next_page_token.clone()
6256 }
6257}
6258
6259/// Request message for
6260/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]
6261///
6262/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6263/// feature is not currently available to most Cloud Bigtable customers. This
6264/// feature might be changed in backward-incompatible ways and is not recommended
6265/// for production use. It is not subject to any SLA or deprecation policy.
6266///
6267/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]: crate::client::BigtableTableAdmin::delete_snapshot
6268#[derive(Clone, Default, PartialEq)]
6269#[non_exhaustive]
6270pub struct DeleteSnapshotRequest {
6271 /// Required. The unique name of the snapshot to be deleted.
6272 /// Values are of the form
6273 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
6274 pub name: std::string::String,
6275
6276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6277}
6278
6279impl DeleteSnapshotRequest {
6280 pub fn new() -> Self {
6281 std::default::Default::default()
6282 }
6283
6284 /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
6285 ///
6286 /// # Example
6287 /// ```ignore,no_run
6288 /// # use google_cloud_bigtable_admin_v2::model::DeleteSnapshotRequest;
6289 /// let x = DeleteSnapshotRequest::new().set_name("example");
6290 /// ```
6291 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6292 self.name = v.into();
6293 self
6294 }
6295}
6296
6297impl wkt::message::Message for DeleteSnapshotRequest {
6298 fn typename() -> &'static str {
6299 "type.googleapis.com/google.bigtable.admin.v2.DeleteSnapshotRequest"
6300 }
6301}
6302
6303/// The metadata for the Operation returned by SnapshotTable.
6304///
6305/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6306/// feature is not currently available to most Cloud Bigtable customers. This
6307/// feature might be changed in backward-incompatible ways and is not recommended
6308/// for production use. It is not subject to any SLA or deprecation policy.
6309#[derive(Clone, Default, PartialEq)]
6310#[non_exhaustive]
6311pub struct SnapshotTableMetadata {
6312 /// The request that prompted the initiation of this SnapshotTable operation.
6313 pub original_request: std::option::Option<crate::model::SnapshotTableRequest>,
6314
6315 /// The time at which the original request was received.
6316 pub request_time: std::option::Option<wkt::Timestamp>,
6317
6318 /// The time at which the operation failed or was completed successfully.
6319 pub finish_time: std::option::Option<wkt::Timestamp>,
6320
6321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6322}
6323
6324impl SnapshotTableMetadata {
6325 pub fn new() -> Self {
6326 std::default::Default::default()
6327 }
6328
6329 /// Sets the value of [original_request][crate::model::SnapshotTableMetadata::original_request].
6330 ///
6331 /// # Example
6332 /// ```ignore,no_run
6333 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6334 /// use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6335 /// let x = SnapshotTableMetadata::new().set_original_request(SnapshotTableRequest::default()/* use setters */);
6336 /// ```
6337 pub fn set_original_request<T>(mut self, v: T) -> Self
6338 where
6339 T: std::convert::Into<crate::model::SnapshotTableRequest>,
6340 {
6341 self.original_request = std::option::Option::Some(v.into());
6342 self
6343 }
6344
6345 /// Sets or clears the value of [original_request][crate::model::SnapshotTableMetadata::original_request].
6346 ///
6347 /// # Example
6348 /// ```ignore,no_run
6349 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6350 /// use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6351 /// let x = SnapshotTableMetadata::new().set_or_clear_original_request(Some(SnapshotTableRequest::default()/* use setters */));
6352 /// let x = SnapshotTableMetadata::new().set_or_clear_original_request(None::<SnapshotTableRequest>);
6353 /// ```
6354 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
6355 where
6356 T: std::convert::Into<crate::model::SnapshotTableRequest>,
6357 {
6358 self.original_request = v.map(|x| x.into());
6359 self
6360 }
6361
6362 /// Sets the value of [request_time][crate::model::SnapshotTableMetadata::request_time].
6363 ///
6364 /// # Example
6365 /// ```ignore,no_run
6366 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6367 /// use wkt::Timestamp;
6368 /// let x = SnapshotTableMetadata::new().set_request_time(Timestamp::default()/* use setters */);
6369 /// ```
6370 pub fn set_request_time<T>(mut self, v: T) -> Self
6371 where
6372 T: std::convert::Into<wkt::Timestamp>,
6373 {
6374 self.request_time = std::option::Option::Some(v.into());
6375 self
6376 }
6377
6378 /// Sets or clears the value of [request_time][crate::model::SnapshotTableMetadata::request_time].
6379 ///
6380 /// # Example
6381 /// ```ignore,no_run
6382 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6383 /// use wkt::Timestamp;
6384 /// let x = SnapshotTableMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
6385 /// let x = SnapshotTableMetadata::new().set_or_clear_request_time(None::<Timestamp>);
6386 /// ```
6387 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
6388 where
6389 T: std::convert::Into<wkt::Timestamp>,
6390 {
6391 self.request_time = v.map(|x| x.into());
6392 self
6393 }
6394
6395 /// Sets the value of [finish_time][crate::model::SnapshotTableMetadata::finish_time].
6396 ///
6397 /// # Example
6398 /// ```ignore,no_run
6399 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6400 /// use wkt::Timestamp;
6401 /// let x = SnapshotTableMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
6402 /// ```
6403 pub fn set_finish_time<T>(mut self, v: T) -> Self
6404 where
6405 T: std::convert::Into<wkt::Timestamp>,
6406 {
6407 self.finish_time = std::option::Option::Some(v.into());
6408 self
6409 }
6410
6411 /// Sets or clears the value of [finish_time][crate::model::SnapshotTableMetadata::finish_time].
6412 ///
6413 /// # Example
6414 /// ```ignore,no_run
6415 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6416 /// use wkt::Timestamp;
6417 /// let x = SnapshotTableMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
6418 /// let x = SnapshotTableMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
6419 /// ```
6420 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
6421 where
6422 T: std::convert::Into<wkt::Timestamp>,
6423 {
6424 self.finish_time = v.map(|x| x.into());
6425 self
6426 }
6427}
6428
6429impl wkt::message::Message for SnapshotTableMetadata {
6430 fn typename() -> &'static str {
6431 "type.googleapis.com/google.bigtable.admin.v2.SnapshotTableMetadata"
6432 }
6433}
6434
6435/// The metadata for the Operation returned by CreateTableFromSnapshot.
6436///
6437/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6438/// feature is not currently available to most Cloud Bigtable customers. This
6439/// feature might be changed in backward-incompatible ways and is not recommended
6440/// for production use. It is not subject to any SLA or deprecation policy.
6441#[derive(Clone, Default, PartialEq)]
6442#[non_exhaustive]
6443pub struct CreateTableFromSnapshotMetadata {
6444 /// The request that prompted the initiation of this CreateTableFromSnapshot
6445 /// operation.
6446 pub original_request: std::option::Option<crate::model::CreateTableFromSnapshotRequest>,
6447
6448 /// The time at which the original request was received.
6449 pub request_time: std::option::Option<wkt::Timestamp>,
6450
6451 /// The time at which the operation failed or was completed successfully.
6452 pub finish_time: std::option::Option<wkt::Timestamp>,
6453
6454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6455}
6456
6457impl CreateTableFromSnapshotMetadata {
6458 pub fn new() -> Self {
6459 std::default::Default::default()
6460 }
6461
6462 /// Sets the value of [original_request][crate::model::CreateTableFromSnapshotMetadata::original_request].
6463 ///
6464 /// # Example
6465 /// ```ignore,no_run
6466 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
6467 /// use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
6468 /// let x = CreateTableFromSnapshotMetadata::new().set_original_request(CreateTableFromSnapshotRequest::default()/* use setters */);
6469 /// ```
6470 pub fn set_original_request<T>(mut self, v: T) -> Self
6471 where
6472 T: std::convert::Into<crate::model::CreateTableFromSnapshotRequest>,
6473 {
6474 self.original_request = std::option::Option::Some(v.into());
6475 self
6476 }
6477
6478 /// Sets or clears the value of [original_request][crate::model::CreateTableFromSnapshotMetadata::original_request].
6479 ///
6480 /// # Example
6481 /// ```ignore,no_run
6482 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
6483 /// use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
6484 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_original_request(Some(CreateTableFromSnapshotRequest::default()/* use setters */));
6485 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_original_request(None::<CreateTableFromSnapshotRequest>);
6486 /// ```
6487 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
6488 where
6489 T: std::convert::Into<crate::model::CreateTableFromSnapshotRequest>,
6490 {
6491 self.original_request = v.map(|x| x.into());
6492 self
6493 }
6494
6495 /// Sets the value of [request_time][crate::model::CreateTableFromSnapshotMetadata::request_time].
6496 ///
6497 /// # Example
6498 /// ```ignore,no_run
6499 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
6500 /// use wkt::Timestamp;
6501 /// let x = CreateTableFromSnapshotMetadata::new().set_request_time(Timestamp::default()/* use setters */);
6502 /// ```
6503 pub fn set_request_time<T>(mut self, v: T) -> Self
6504 where
6505 T: std::convert::Into<wkt::Timestamp>,
6506 {
6507 self.request_time = std::option::Option::Some(v.into());
6508 self
6509 }
6510
6511 /// Sets or clears the value of [request_time][crate::model::CreateTableFromSnapshotMetadata::request_time].
6512 ///
6513 /// # Example
6514 /// ```ignore,no_run
6515 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
6516 /// use wkt::Timestamp;
6517 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
6518 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_request_time(None::<Timestamp>);
6519 /// ```
6520 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
6521 where
6522 T: std::convert::Into<wkt::Timestamp>,
6523 {
6524 self.request_time = v.map(|x| x.into());
6525 self
6526 }
6527
6528 /// Sets the value of [finish_time][crate::model::CreateTableFromSnapshotMetadata::finish_time].
6529 ///
6530 /// # Example
6531 /// ```ignore,no_run
6532 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
6533 /// use wkt::Timestamp;
6534 /// let x = CreateTableFromSnapshotMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
6535 /// ```
6536 pub fn set_finish_time<T>(mut self, v: T) -> Self
6537 where
6538 T: std::convert::Into<wkt::Timestamp>,
6539 {
6540 self.finish_time = std::option::Option::Some(v.into());
6541 self
6542 }
6543
6544 /// Sets or clears the value of [finish_time][crate::model::CreateTableFromSnapshotMetadata::finish_time].
6545 ///
6546 /// # Example
6547 /// ```ignore,no_run
6548 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
6549 /// use wkt::Timestamp;
6550 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
6551 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
6552 /// ```
6553 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
6554 where
6555 T: std::convert::Into<wkt::Timestamp>,
6556 {
6557 self.finish_time = v.map(|x| x.into());
6558 self
6559 }
6560}
6561
6562impl wkt::message::Message for CreateTableFromSnapshotMetadata {
6563 fn typename() -> &'static str {
6564 "type.googleapis.com/google.bigtable.admin.v2.CreateTableFromSnapshotMetadata"
6565 }
6566}
6567
6568/// The request for
6569/// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
6570///
6571/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]: crate::client::BigtableTableAdmin::create_backup
6572#[derive(Clone, Default, PartialEq)]
6573#[non_exhaustive]
6574pub struct CreateBackupRequest {
6575 /// Required. This must be one of the clusters in the instance in which this
6576 /// table is located. The backup will be stored in this cluster. Values are
6577 /// of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
6578 pub parent: std::string::String,
6579
6580 /// Required. The id of the backup to be created. The `backup_id` along with
6581 /// the parent `parent` are combined as {parent}/backups/{backup_id} to create
6582 /// the full backup name, of the form:
6583 /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
6584 /// This string must be between 1 and 50 characters in length and match the
6585 /// regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
6586 pub backup_id: std::string::String,
6587
6588 /// Required. The backup to create.
6589 pub backup: std::option::Option<crate::model::Backup>,
6590
6591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6592}
6593
6594impl CreateBackupRequest {
6595 pub fn new() -> Self {
6596 std::default::Default::default()
6597 }
6598
6599 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
6600 ///
6601 /// # Example
6602 /// ```ignore,no_run
6603 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupRequest;
6604 /// let x = CreateBackupRequest::new().set_parent("example");
6605 /// ```
6606 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6607 self.parent = v.into();
6608 self
6609 }
6610
6611 /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
6612 ///
6613 /// # Example
6614 /// ```ignore,no_run
6615 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupRequest;
6616 /// let x = CreateBackupRequest::new().set_backup_id("example");
6617 /// ```
6618 pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6619 self.backup_id = v.into();
6620 self
6621 }
6622
6623 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
6624 ///
6625 /// # Example
6626 /// ```ignore,no_run
6627 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupRequest;
6628 /// use google_cloud_bigtable_admin_v2::model::Backup;
6629 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
6630 /// ```
6631 pub fn set_backup<T>(mut self, v: T) -> Self
6632 where
6633 T: std::convert::Into<crate::model::Backup>,
6634 {
6635 self.backup = std::option::Option::Some(v.into());
6636 self
6637 }
6638
6639 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
6640 ///
6641 /// # Example
6642 /// ```ignore,no_run
6643 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupRequest;
6644 /// use google_cloud_bigtable_admin_v2::model::Backup;
6645 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
6646 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
6647 /// ```
6648 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
6649 where
6650 T: std::convert::Into<crate::model::Backup>,
6651 {
6652 self.backup = v.map(|x| x.into());
6653 self
6654 }
6655}
6656
6657impl wkt::message::Message for CreateBackupRequest {
6658 fn typename() -> &'static str {
6659 "type.googleapis.com/google.bigtable.admin.v2.CreateBackupRequest"
6660 }
6661}
6662
6663/// Metadata type for the operation returned by
6664/// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
6665///
6666/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]: crate::client::BigtableTableAdmin::create_backup
6667#[derive(Clone, Default, PartialEq)]
6668#[non_exhaustive]
6669pub struct CreateBackupMetadata {
6670 /// The name of the backup being created.
6671 pub name: std::string::String,
6672
6673 /// The name of the table the backup is created from.
6674 pub source_table: std::string::String,
6675
6676 /// The time at which this operation started.
6677 pub start_time: std::option::Option<wkt::Timestamp>,
6678
6679 /// If set, the time at which this operation finished or was cancelled.
6680 pub end_time: std::option::Option<wkt::Timestamp>,
6681
6682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6683}
6684
6685impl CreateBackupMetadata {
6686 pub fn new() -> Self {
6687 std::default::Default::default()
6688 }
6689
6690 /// Sets the value of [name][crate::model::CreateBackupMetadata::name].
6691 ///
6692 /// # Example
6693 /// ```ignore,no_run
6694 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
6695 /// let x = CreateBackupMetadata::new().set_name("example");
6696 /// ```
6697 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6698 self.name = v.into();
6699 self
6700 }
6701
6702 /// Sets the value of [source_table][crate::model::CreateBackupMetadata::source_table].
6703 ///
6704 /// # Example
6705 /// ```ignore,no_run
6706 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
6707 /// let x = CreateBackupMetadata::new().set_source_table("example");
6708 /// ```
6709 pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6710 self.source_table = v.into();
6711 self
6712 }
6713
6714 /// Sets the value of [start_time][crate::model::CreateBackupMetadata::start_time].
6715 ///
6716 /// # Example
6717 /// ```ignore,no_run
6718 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
6719 /// use wkt::Timestamp;
6720 /// let x = CreateBackupMetadata::new().set_start_time(Timestamp::default()/* use setters */);
6721 /// ```
6722 pub fn set_start_time<T>(mut self, v: T) -> Self
6723 where
6724 T: std::convert::Into<wkt::Timestamp>,
6725 {
6726 self.start_time = std::option::Option::Some(v.into());
6727 self
6728 }
6729
6730 /// Sets or clears the value of [start_time][crate::model::CreateBackupMetadata::start_time].
6731 ///
6732 /// # Example
6733 /// ```ignore,no_run
6734 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
6735 /// use wkt::Timestamp;
6736 /// let x = CreateBackupMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
6737 /// let x = CreateBackupMetadata::new().set_or_clear_start_time(None::<Timestamp>);
6738 /// ```
6739 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
6740 where
6741 T: std::convert::Into<wkt::Timestamp>,
6742 {
6743 self.start_time = v.map(|x| x.into());
6744 self
6745 }
6746
6747 /// Sets the value of [end_time][crate::model::CreateBackupMetadata::end_time].
6748 ///
6749 /// # Example
6750 /// ```ignore,no_run
6751 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
6752 /// use wkt::Timestamp;
6753 /// let x = CreateBackupMetadata::new().set_end_time(Timestamp::default()/* use setters */);
6754 /// ```
6755 pub fn set_end_time<T>(mut self, v: T) -> Self
6756 where
6757 T: std::convert::Into<wkt::Timestamp>,
6758 {
6759 self.end_time = std::option::Option::Some(v.into());
6760 self
6761 }
6762
6763 /// Sets or clears the value of [end_time][crate::model::CreateBackupMetadata::end_time].
6764 ///
6765 /// # Example
6766 /// ```ignore,no_run
6767 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
6768 /// use wkt::Timestamp;
6769 /// let x = CreateBackupMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
6770 /// let x = CreateBackupMetadata::new().set_or_clear_end_time(None::<Timestamp>);
6771 /// ```
6772 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6773 where
6774 T: std::convert::Into<wkt::Timestamp>,
6775 {
6776 self.end_time = v.map(|x| x.into());
6777 self
6778 }
6779}
6780
6781impl wkt::message::Message for CreateBackupMetadata {
6782 fn typename() -> &'static str {
6783 "type.googleapis.com/google.bigtable.admin.v2.CreateBackupMetadata"
6784 }
6785}
6786
6787/// The request for
6788/// [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup].
6789///
6790/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]: crate::client::BigtableTableAdmin::update_backup
6791#[derive(Clone, Default, PartialEq)]
6792#[non_exhaustive]
6793pub struct UpdateBackupRequest {
6794 /// Required. The backup to update. `backup.name`, and the fields to be updated
6795 /// as specified by `update_mask` are required. Other fields are ignored.
6796 /// Update is only supported for the following fields:
6797 ///
6798 /// * `backup.expire_time`.
6799 pub backup: std::option::Option<crate::model::Backup>,
6800
6801 /// Required. A mask specifying which fields (e.g. `expire_time`) in the
6802 /// Backup resource should be updated. This mask is relative to the Backup
6803 /// resource, not to the request message. The field mask must always be
6804 /// specified; this prevents any future fields from being erased accidentally
6805 /// by clients that do not know about them.
6806 pub update_mask: std::option::Option<wkt::FieldMask>,
6807
6808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6809}
6810
6811impl UpdateBackupRequest {
6812 pub fn new() -> Self {
6813 std::default::Default::default()
6814 }
6815
6816 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
6817 ///
6818 /// # Example
6819 /// ```ignore,no_run
6820 /// # use google_cloud_bigtable_admin_v2::model::UpdateBackupRequest;
6821 /// use google_cloud_bigtable_admin_v2::model::Backup;
6822 /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
6823 /// ```
6824 pub fn set_backup<T>(mut self, v: T) -> Self
6825 where
6826 T: std::convert::Into<crate::model::Backup>,
6827 {
6828 self.backup = std::option::Option::Some(v.into());
6829 self
6830 }
6831
6832 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
6833 ///
6834 /// # Example
6835 /// ```ignore,no_run
6836 /// # use google_cloud_bigtable_admin_v2::model::UpdateBackupRequest;
6837 /// use google_cloud_bigtable_admin_v2::model::Backup;
6838 /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
6839 /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
6840 /// ```
6841 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
6842 where
6843 T: std::convert::Into<crate::model::Backup>,
6844 {
6845 self.backup = v.map(|x| x.into());
6846 self
6847 }
6848
6849 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
6850 ///
6851 /// # Example
6852 /// ```ignore,no_run
6853 /// # use google_cloud_bigtable_admin_v2::model::UpdateBackupRequest;
6854 /// use wkt::FieldMask;
6855 /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6856 /// ```
6857 pub fn set_update_mask<T>(mut self, v: T) -> Self
6858 where
6859 T: std::convert::Into<wkt::FieldMask>,
6860 {
6861 self.update_mask = std::option::Option::Some(v.into());
6862 self
6863 }
6864
6865 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
6866 ///
6867 /// # Example
6868 /// ```ignore,no_run
6869 /// # use google_cloud_bigtable_admin_v2::model::UpdateBackupRequest;
6870 /// use wkt::FieldMask;
6871 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6872 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6873 /// ```
6874 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6875 where
6876 T: std::convert::Into<wkt::FieldMask>,
6877 {
6878 self.update_mask = v.map(|x| x.into());
6879 self
6880 }
6881}
6882
6883impl wkt::message::Message for UpdateBackupRequest {
6884 fn typename() -> &'static str {
6885 "type.googleapis.com/google.bigtable.admin.v2.UpdateBackupRequest"
6886 }
6887}
6888
6889/// The request for
6890/// [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup].
6891///
6892/// [google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]: crate::client::BigtableTableAdmin::get_backup
6893#[derive(Clone, Default, PartialEq)]
6894#[non_exhaustive]
6895pub struct GetBackupRequest {
6896 /// Required. Name of the backup.
6897 /// Values are of the form
6898 /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
6899 pub name: std::string::String,
6900
6901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6902}
6903
6904impl GetBackupRequest {
6905 pub fn new() -> Self {
6906 std::default::Default::default()
6907 }
6908
6909 /// Sets the value of [name][crate::model::GetBackupRequest::name].
6910 ///
6911 /// # Example
6912 /// ```ignore,no_run
6913 /// # use google_cloud_bigtable_admin_v2::model::GetBackupRequest;
6914 /// let x = GetBackupRequest::new().set_name("example");
6915 /// ```
6916 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6917 self.name = v.into();
6918 self
6919 }
6920}
6921
6922impl wkt::message::Message for GetBackupRequest {
6923 fn typename() -> &'static str {
6924 "type.googleapis.com/google.bigtable.admin.v2.GetBackupRequest"
6925 }
6926}
6927
6928/// The request for
6929/// [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup].
6930///
6931/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]: crate::client::BigtableTableAdmin::delete_backup
6932#[derive(Clone, Default, PartialEq)]
6933#[non_exhaustive]
6934pub struct DeleteBackupRequest {
6935 /// Required. Name of the backup to delete.
6936 /// Values are of the form
6937 /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
6938 pub name: std::string::String,
6939
6940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6941}
6942
6943impl DeleteBackupRequest {
6944 pub fn new() -> Self {
6945 std::default::Default::default()
6946 }
6947
6948 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
6949 ///
6950 /// # Example
6951 /// ```ignore,no_run
6952 /// # use google_cloud_bigtable_admin_v2::model::DeleteBackupRequest;
6953 /// let x = DeleteBackupRequest::new().set_name("example");
6954 /// ```
6955 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6956 self.name = v.into();
6957 self
6958 }
6959}
6960
6961impl wkt::message::Message for DeleteBackupRequest {
6962 fn typename() -> &'static str {
6963 "type.googleapis.com/google.bigtable.admin.v2.DeleteBackupRequest"
6964 }
6965}
6966
6967/// The request for
6968/// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
6969///
6970/// [google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]: crate::client::BigtableTableAdmin::list_backups
6971#[derive(Clone, Default, PartialEq)]
6972#[non_exhaustive]
6973pub struct ListBackupsRequest {
6974 /// Required. The cluster to list backups from. Values are of the
6975 /// form `projects/{project}/instances/{instance}/clusters/{cluster}`.
6976 /// Use `{cluster} = '-'` to list backups for all clusters in an instance,
6977 /// e.g., `projects/{project}/instances/{instance}/clusters/-`.
6978 pub parent: std::string::String,
6979
6980 /// A filter expression that filters backups listed in the response.
6981 /// The expression must specify the field name, a comparison operator,
6982 /// and the value that you want to use for filtering. The value must be a
6983 /// string, a number, or a boolean. The comparison operator must be
6984 /// <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
6985 /// roughly synonymous with equality. Filter rules are case insensitive.
6986 ///
6987 /// The fields eligible for filtering are:
6988 ///
6989 /// * `name`
6990 /// * `source_table`
6991 /// * `state`
6992 /// * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
6993 /// * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
6994 /// * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
6995 /// * `size_bytes`
6996 ///
6997 /// To filter on multiple expressions, provide each separate expression within
6998 /// parentheses. By default, each expression is an AND expression. However,
6999 /// you can include AND, OR, and NOT expressions explicitly.
7000 ///
7001 /// Some examples of using filters are:
7002 ///
7003 /// * `name:"exact"` --> The backup's name is the string "exact".
7004 /// * `name:howl` --> The backup's name contains the string "howl".
7005 /// * `source_table:prod`
7006 /// --> The source_table's name contains the string "prod".
7007 /// * `state:CREATING` --> The backup is pending creation.
7008 /// * `state:READY` --> The backup is fully created and ready for use.
7009 /// * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
7010 /// --> The backup name contains the string "howl" and start_time
7011 /// of the backup is before 2018-03-28T14:50:00Z.
7012 /// * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
7013 pub filter: std::string::String,
7014
7015 /// An expression for specifying the sort order of the results of the request.
7016 /// The string value should specify one or more fields in
7017 /// [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
7018 /// <https://aip.dev/132#ordering>.
7019 ///
7020 /// Fields supported are:
7021 ///
7022 /// * name
7023 /// * source_table
7024 /// * expire_time
7025 /// * start_time
7026 /// * end_time
7027 /// * size_bytes
7028 /// * state
7029 ///
7030 /// For example, "start_time". The default sorting order is ascending.
7031 /// To specify descending order for the field, a suffix " desc" should
7032 /// be appended to the field name. For example, "start_time desc".
7033 /// Redundant space characters in the syntax are insigificant.
7034 ///
7035 /// If order_by is empty, results will be sorted by `start_time` in descending
7036 /// order starting from the most recently created backup.
7037 ///
7038 /// [google.bigtable.admin.v2.Backup]: crate::model::Backup
7039 pub order_by: std::string::String,
7040
7041 /// Number of backups to be returned in the response. If 0 or
7042 /// less, defaults to the server's maximum allowed page size.
7043 pub page_size: i32,
7044
7045 /// If non-empty, `page_token` should contain a
7046 /// [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
7047 /// from a previous
7048 /// [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
7049 /// same `parent` and with the same `filter`.
7050 ///
7051 /// [google.bigtable.admin.v2.ListBackupsResponse]: crate::model::ListBackupsResponse
7052 /// [google.bigtable.admin.v2.ListBackupsResponse.next_page_token]: crate::model::ListBackupsResponse::next_page_token
7053 pub page_token: std::string::String,
7054
7055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7056}
7057
7058impl ListBackupsRequest {
7059 pub fn new() -> Self {
7060 std::default::Default::default()
7061 }
7062
7063 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
7064 ///
7065 /// # Example
7066 /// ```ignore,no_run
7067 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7068 /// let x = ListBackupsRequest::new().set_parent("example");
7069 /// ```
7070 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7071 self.parent = v.into();
7072 self
7073 }
7074
7075 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
7076 ///
7077 /// # Example
7078 /// ```ignore,no_run
7079 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7080 /// let x = ListBackupsRequest::new().set_filter("example");
7081 /// ```
7082 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7083 self.filter = v.into();
7084 self
7085 }
7086
7087 /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
7088 ///
7089 /// # Example
7090 /// ```ignore,no_run
7091 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7092 /// let x = ListBackupsRequest::new().set_order_by("example");
7093 /// ```
7094 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7095 self.order_by = v.into();
7096 self
7097 }
7098
7099 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
7100 ///
7101 /// # Example
7102 /// ```ignore,no_run
7103 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7104 /// let x = ListBackupsRequest::new().set_page_size(42);
7105 /// ```
7106 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7107 self.page_size = v.into();
7108 self
7109 }
7110
7111 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
7112 ///
7113 /// # Example
7114 /// ```ignore,no_run
7115 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7116 /// let x = ListBackupsRequest::new().set_page_token("example");
7117 /// ```
7118 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7119 self.page_token = v.into();
7120 self
7121 }
7122}
7123
7124impl wkt::message::Message for ListBackupsRequest {
7125 fn typename() -> &'static str {
7126 "type.googleapis.com/google.bigtable.admin.v2.ListBackupsRequest"
7127 }
7128}
7129
7130/// The response for
7131/// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
7132///
7133/// [google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]: crate::client::BigtableTableAdmin::list_backups
7134#[derive(Clone, Default, PartialEq)]
7135#[non_exhaustive]
7136pub struct ListBackupsResponse {
7137 /// The list of matching backups.
7138 pub backups: std::vec::Vec<crate::model::Backup>,
7139
7140 /// `next_page_token` can be sent in a subsequent
7141 /// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
7142 /// to fetch more of the matching backups.
7143 ///
7144 /// [google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]: crate::client::BigtableTableAdmin::list_backups
7145 pub next_page_token: std::string::String,
7146
7147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7148}
7149
7150impl ListBackupsResponse {
7151 pub fn new() -> Self {
7152 std::default::Default::default()
7153 }
7154
7155 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
7156 ///
7157 /// # Example
7158 /// ```ignore,no_run
7159 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsResponse;
7160 /// use google_cloud_bigtable_admin_v2::model::Backup;
7161 /// let x = ListBackupsResponse::new()
7162 /// .set_backups([
7163 /// Backup::default()/* use setters */,
7164 /// Backup::default()/* use (different) setters */,
7165 /// ]);
7166 /// ```
7167 pub fn set_backups<T, V>(mut self, v: T) -> Self
7168 where
7169 T: std::iter::IntoIterator<Item = V>,
7170 V: std::convert::Into<crate::model::Backup>,
7171 {
7172 use std::iter::Iterator;
7173 self.backups = v.into_iter().map(|i| i.into()).collect();
7174 self
7175 }
7176
7177 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
7178 ///
7179 /// # Example
7180 /// ```ignore,no_run
7181 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsResponse;
7182 /// let x = ListBackupsResponse::new().set_next_page_token("example");
7183 /// ```
7184 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7185 self.next_page_token = v.into();
7186 self
7187 }
7188}
7189
7190impl wkt::message::Message for ListBackupsResponse {
7191 fn typename() -> &'static str {
7192 "type.googleapis.com/google.bigtable.admin.v2.ListBackupsResponse"
7193 }
7194}
7195
7196#[doc(hidden)]
7197impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
7198 type PageItem = crate::model::Backup;
7199
7200 fn items(self) -> std::vec::Vec<Self::PageItem> {
7201 self.backups
7202 }
7203
7204 fn next_page_token(&self) -> std::string::String {
7205 use std::clone::Clone;
7206 self.next_page_token.clone()
7207 }
7208}
7209
7210/// The request for
7211/// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
7212///
7213/// [google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]: crate::client::BigtableTableAdmin::copy_backup
7214#[derive(Clone, Default, PartialEq)]
7215#[non_exhaustive]
7216pub struct CopyBackupRequest {
7217 /// Required. The name of the destination cluster that will contain the backup
7218 /// copy. The cluster must already exist. Values are of the form:
7219 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
7220 pub parent: std::string::String,
7221
7222 /// Required. The id of the new backup. The `backup_id` along with `parent`
7223 /// are combined as {parent}/backups/{backup_id} to create the full backup
7224 /// name, of the form:
7225 /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
7226 /// This string must be between 1 and 50 characters in length and match the
7227 /// regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
7228 pub backup_id: std::string::String,
7229
7230 /// Required. The source backup to be copied from.
7231 /// The source backup needs to be in READY state for it to be copied.
7232 /// Copying a copied backup is not allowed.
7233 /// Once CopyBackup is in progress, the source backup cannot be deleted or
7234 /// cleaned up on expiration until CopyBackup is finished.
7235 /// Values are of the form:
7236 /// `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
7237 pub source_backup: std::string::String,
7238
7239 /// Required. Required. The expiration time of the copied backup with
7240 /// microsecond granularity that must be at least 6 hours and at most 30 days
7241 /// from the time the request is received. Once the `expire_time` has
7242 /// passed, Cloud Bigtable will delete the backup and free the resources used
7243 /// by the backup.
7244 pub expire_time: std::option::Option<wkt::Timestamp>,
7245
7246 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7247}
7248
7249impl CopyBackupRequest {
7250 pub fn new() -> Self {
7251 std::default::Default::default()
7252 }
7253
7254 /// Sets the value of [parent][crate::model::CopyBackupRequest::parent].
7255 ///
7256 /// # Example
7257 /// ```ignore,no_run
7258 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7259 /// let x = CopyBackupRequest::new().set_parent("example");
7260 /// ```
7261 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7262 self.parent = v.into();
7263 self
7264 }
7265
7266 /// Sets the value of [backup_id][crate::model::CopyBackupRequest::backup_id].
7267 ///
7268 /// # Example
7269 /// ```ignore,no_run
7270 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7271 /// let x = CopyBackupRequest::new().set_backup_id("example");
7272 /// ```
7273 pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7274 self.backup_id = v.into();
7275 self
7276 }
7277
7278 /// Sets the value of [source_backup][crate::model::CopyBackupRequest::source_backup].
7279 ///
7280 /// # Example
7281 /// ```ignore,no_run
7282 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7283 /// let x = CopyBackupRequest::new().set_source_backup("example");
7284 /// ```
7285 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7286 self.source_backup = v.into();
7287 self
7288 }
7289
7290 /// Sets the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
7291 ///
7292 /// # Example
7293 /// ```ignore,no_run
7294 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7295 /// use wkt::Timestamp;
7296 /// let x = CopyBackupRequest::new().set_expire_time(Timestamp::default()/* use setters */);
7297 /// ```
7298 pub fn set_expire_time<T>(mut self, v: T) -> Self
7299 where
7300 T: std::convert::Into<wkt::Timestamp>,
7301 {
7302 self.expire_time = std::option::Option::Some(v.into());
7303 self
7304 }
7305
7306 /// Sets or clears the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
7307 ///
7308 /// # Example
7309 /// ```ignore,no_run
7310 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7311 /// use wkt::Timestamp;
7312 /// let x = CopyBackupRequest::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
7313 /// let x = CopyBackupRequest::new().set_or_clear_expire_time(None::<Timestamp>);
7314 /// ```
7315 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
7316 where
7317 T: std::convert::Into<wkt::Timestamp>,
7318 {
7319 self.expire_time = v.map(|x| x.into());
7320 self
7321 }
7322}
7323
7324impl wkt::message::Message for CopyBackupRequest {
7325 fn typename() -> &'static str {
7326 "type.googleapis.com/google.bigtable.admin.v2.CopyBackupRequest"
7327 }
7328}
7329
7330/// Metadata type for the google.longrunning.Operation returned by
7331/// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
7332///
7333/// [google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]: crate::client::BigtableTableAdmin::copy_backup
7334#[derive(Clone, Default, PartialEq)]
7335#[non_exhaustive]
7336pub struct CopyBackupMetadata {
7337 /// The name of the backup being created through the copy operation.
7338 /// Values are of the form
7339 /// `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
7340 pub name: std::string::String,
7341
7342 /// Information about the source backup that is being copied from.
7343 pub source_backup_info: std::option::Option<crate::model::BackupInfo>,
7344
7345 /// The progress of the
7346 /// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
7347 /// operation.
7348 ///
7349 /// [google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]: crate::client::BigtableTableAdmin::copy_backup
7350 pub progress: std::option::Option<crate::model::OperationProgress>,
7351
7352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7353}
7354
7355impl CopyBackupMetadata {
7356 pub fn new() -> Self {
7357 std::default::Default::default()
7358 }
7359
7360 /// Sets the value of [name][crate::model::CopyBackupMetadata::name].
7361 ///
7362 /// # Example
7363 /// ```ignore,no_run
7364 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
7365 /// let x = CopyBackupMetadata::new().set_name("example");
7366 /// ```
7367 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7368 self.name = v.into();
7369 self
7370 }
7371
7372 /// Sets the value of [source_backup_info][crate::model::CopyBackupMetadata::source_backup_info].
7373 ///
7374 /// # Example
7375 /// ```ignore,no_run
7376 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
7377 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
7378 /// let x = CopyBackupMetadata::new().set_source_backup_info(BackupInfo::default()/* use setters */);
7379 /// ```
7380 pub fn set_source_backup_info<T>(mut self, v: T) -> Self
7381 where
7382 T: std::convert::Into<crate::model::BackupInfo>,
7383 {
7384 self.source_backup_info = std::option::Option::Some(v.into());
7385 self
7386 }
7387
7388 /// Sets or clears the value of [source_backup_info][crate::model::CopyBackupMetadata::source_backup_info].
7389 ///
7390 /// # Example
7391 /// ```ignore,no_run
7392 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
7393 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
7394 /// let x = CopyBackupMetadata::new().set_or_clear_source_backup_info(Some(BackupInfo::default()/* use setters */));
7395 /// let x = CopyBackupMetadata::new().set_or_clear_source_backup_info(None::<BackupInfo>);
7396 /// ```
7397 pub fn set_or_clear_source_backup_info<T>(mut self, v: std::option::Option<T>) -> Self
7398 where
7399 T: std::convert::Into<crate::model::BackupInfo>,
7400 {
7401 self.source_backup_info = v.map(|x| x.into());
7402 self
7403 }
7404
7405 /// Sets the value of [progress][crate::model::CopyBackupMetadata::progress].
7406 ///
7407 /// # Example
7408 /// ```ignore,no_run
7409 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
7410 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
7411 /// let x = CopyBackupMetadata::new().set_progress(OperationProgress::default()/* use setters */);
7412 /// ```
7413 pub fn set_progress<T>(mut self, v: T) -> Self
7414 where
7415 T: std::convert::Into<crate::model::OperationProgress>,
7416 {
7417 self.progress = std::option::Option::Some(v.into());
7418 self
7419 }
7420
7421 /// Sets or clears the value of [progress][crate::model::CopyBackupMetadata::progress].
7422 ///
7423 /// # Example
7424 /// ```ignore,no_run
7425 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
7426 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
7427 /// let x = CopyBackupMetadata::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
7428 /// let x = CopyBackupMetadata::new().set_or_clear_progress(None::<OperationProgress>);
7429 /// ```
7430 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
7431 where
7432 T: std::convert::Into<crate::model::OperationProgress>,
7433 {
7434 self.progress = v.map(|x| x.into());
7435 self
7436 }
7437}
7438
7439impl wkt::message::Message for CopyBackupMetadata {
7440 fn typename() -> &'static str {
7441 "type.googleapis.com/google.bigtable.admin.v2.CopyBackupMetadata"
7442 }
7443}
7444
7445/// The request for
7446/// [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]
7447///
7448/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]: crate::client::BigtableTableAdmin::create_authorized_view
7449#[derive(Clone, Default, PartialEq)]
7450#[non_exhaustive]
7451pub struct CreateAuthorizedViewRequest {
7452 /// Required. This is the name of the table the AuthorizedView belongs to.
7453 /// Values are of the form
7454 /// `projects/{project}/instances/{instance}/tables/{table}`.
7455 pub parent: std::string::String,
7456
7457 /// Required. The id of the AuthorizedView to create. This AuthorizedView must
7458 /// not already exist. The `authorized_view_id` appended to `parent` forms the
7459 /// full AuthorizedView name of the form
7460 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
7461 pub authorized_view_id: std::string::String,
7462
7463 /// Required. The AuthorizedView to create.
7464 pub authorized_view: std::option::Option<crate::model::AuthorizedView>,
7465
7466 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7467}
7468
7469impl CreateAuthorizedViewRequest {
7470 pub fn new() -> Self {
7471 std::default::Default::default()
7472 }
7473
7474 /// Sets the value of [parent][crate::model::CreateAuthorizedViewRequest::parent].
7475 ///
7476 /// # Example
7477 /// ```ignore,no_run
7478 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
7479 /// let x = CreateAuthorizedViewRequest::new().set_parent("example");
7480 /// ```
7481 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7482 self.parent = v.into();
7483 self
7484 }
7485
7486 /// Sets the value of [authorized_view_id][crate::model::CreateAuthorizedViewRequest::authorized_view_id].
7487 ///
7488 /// # Example
7489 /// ```ignore,no_run
7490 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
7491 /// let x = CreateAuthorizedViewRequest::new().set_authorized_view_id("example");
7492 /// ```
7493 pub fn set_authorized_view_id<T: std::convert::Into<std::string::String>>(
7494 mut self,
7495 v: T,
7496 ) -> Self {
7497 self.authorized_view_id = v.into();
7498 self
7499 }
7500
7501 /// Sets the value of [authorized_view][crate::model::CreateAuthorizedViewRequest::authorized_view].
7502 ///
7503 /// # Example
7504 /// ```ignore,no_run
7505 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
7506 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
7507 /// let x = CreateAuthorizedViewRequest::new().set_authorized_view(AuthorizedView::default()/* use setters */);
7508 /// ```
7509 pub fn set_authorized_view<T>(mut self, v: T) -> Self
7510 where
7511 T: std::convert::Into<crate::model::AuthorizedView>,
7512 {
7513 self.authorized_view = std::option::Option::Some(v.into());
7514 self
7515 }
7516
7517 /// Sets or clears the value of [authorized_view][crate::model::CreateAuthorizedViewRequest::authorized_view].
7518 ///
7519 /// # Example
7520 /// ```ignore,no_run
7521 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
7522 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
7523 /// let x = CreateAuthorizedViewRequest::new().set_or_clear_authorized_view(Some(AuthorizedView::default()/* use setters */));
7524 /// let x = CreateAuthorizedViewRequest::new().set_or_clear_authorized_view(None::<AuthorizedView>);
7525 /// ```
7526 pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
7527 where
7528 T: std::convert::Into<crate::model::AuthorizedView>,
7529 {
7530 self.authorized_view = v.map(|x| x.into());
7531 self
7532 }
7533}
7534
7535impl wkt::message::Message for CreateAuthorizedViewRequest {
7536 fn typename() -> &'static str {
7537 "type.googleapis.com/google.bigtable.admin.v2.CreateAuthorizedViewRequest"
7538 }
7539}
7540
7541/// The metadata for the Operation returned by CreateAuthorizedView.
7542#[derive(Clone, Default, PartialEq)]
7543#[non_exhaustive]
7544pub struct CreateAuthorizedViewMetadata {
7545 /// The request that prompted the initiation of this CreateAuthorizedView
7546 /// operation.
7547 pub original_request: std::option::Option<crate::model::CreateAuthorizedViewRequest>,
7548
7549 /// The time at which the original request was received.
7550 pub request_time: std::option::Option<wkt::Timestamp>,
7551
7552 /// The time at which the operation failed or was completed successfully.
7553 pub finish_time: std::option::Option<wkt::Timestamp>,
7554
7555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7556}
7557
7558impl CreateAuthorizedViewMetadata {
7559 pub fn new() -> Self {
7560 std::default::Default::default()
7561 }
7562
7563 /// Sets the value of [original_request][crate::model::CreateAuthorizedViewMetadata::original_request].
7564 ///
7565 /// # Example
7566 /// ```ignore,no_run
7567 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
7568 /// use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
7569 /// let x = CreateAuthorizedViewMetadata::new().set_original_request(CreateAuthorizedViewRequest::default()/* use setters */);
7570 /// ```
7571 pub fn set_original_request<T>(mut self, v: T) -> Self
7572 where
7573 T: std::convert::Into<crate::model::CreateAuthorizedViewRequest>,
7574 {
7575 self.original_request = std::option::Option::Some(v.into());
7576 self
7577 }
7578
7579 /// Sets or clears the value of [original_request][crate::model::CreateAuthorizedViewMetadata::original_request].
7580 ///
7581 /// # Example
7582 /// ```ignore,no_run
7583 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
7584 /// use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
7585 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_original_request(Some(CreateAuthorizedViewRequest::default()/* use setters */));
7586 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_original_request(None::<CreateAuthorizedViewRequest>);
7587 /// ```
7588 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
7589 where
7590 T: std::convert::Into<crate::model::CreateAuthorizedViewRequest>,
7591 {
7592 self.original_request = v.map(|x| x.into());
7593 self
7594 }
7595
7596 /// Sets the value of [request_time][crate::model::CreateAuthorizedViewMetadata::request_time].
7597 ///
7598 /// # Example
7599 /// ```ignore,no_run
7600 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
7601 /// use wkt::Timestamp;
7602 /// let x = CreateAuthorizedViewMetadata::new().set_request_time(Timestamp::default()/* use setters */);
7603 /// ```
7604 pub fn set_request_time<T>(mut self, v: T) -> Self
7605 where
7606 T: std::convert::Into<wkt::Timestamp>,
7607 {
7608 self.request_time = std::option::Option::Some(v.into());
7609 self
7610 }
7611
7612 /// Sets or clears the value of [request_time][crate::model::CreateAuthorizedViewMetadata::request_time].
7613 ///
7614 /// # Example
7615 /// ```ignore,no_run
7616 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
7617 /// use wkt::Timestamp;
7618 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
7619 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_request_time(None::<Timestamp>);
7620 /// ```
7621 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
7622 where
7623 T: std::convert::Into<wkt::Timestamp>,
7624 {
7625 self.request_time = v.map(|x| x.into());
7626 self
7627 }
7628
7629 /// Sets the value of [finish_time][crate::model::CreateAuthorizedViewMetadata::finish_time].
7630 ///
7631 /// # Example
7632 /// ```ignore,no_run
7633 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
7634 /// use wkt::Timestamp;
7635 /// let x = CreateAuthorizedViewMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
7636 /// ```
7637 pub fn set_finish_time<T>(mut self, v: T) -> Self
7638 where
7639 T: std::convert::Into<wkt::Timestamp>,
7640 {
7641 self.finish_time = std::option::Option::Some(v.into());
7642 self
7643 }
7644
7645 /// Sets or clears the value of [finish_time][crate::model::CreateAuthorizedViewMetadata::finish_time].
7646 ///
7647 /// # Example
7648 /// ```ignore,no_run
7649 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
7650 /// use wkt::Timestamp;
7651 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
7652 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
7653 /// ```
7654 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
7655 where
7656 T: std::convert::Into<wkt::Timestamp>,
7657 {
7658 self.finish_time = v.map(|x| x.into());
7659 self
7660 }
7661}
7662
7663impl wkt::message::Message for CreateAuthorizedViewMetadata {
7664 fn typename() -> &'static str {
7665 "type.googleapis.com/google.bigtable.admin.v2.CreateAuthorizedViewMetadata"
7666 }
7667}
7668
7669/// Request message for
7670/// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
7671///
7672/// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]: crate::client::BigtableTableAdmin::list_authorized_views
7673#[derive(Clone, Default, PartialEq)]
7674#[non_exhaustive]
7675pub struct ListAuthorizedViewsRequest {
7676 /// Required. The unique name of the table for which AuthorizedViews should be
7677 /// listed. Values are of the form
7678 /// `projects/{project}/instances/{instance}/tables/{table}`.
7679 pub parent: std::string::String,
7680
7681 /// Optional. Maximum number of results per page.
7682 ///
7683 /// A page_size of zero lets the server choose the number of items to return.
7684 /// A page_size which is strictly positive will return at most that many items.
7685 /// A negative page_size will cause an error.
7686 ///
7687 /// Following the first request, subsequent paginated calls are not required
7688 /// to pass a page_size. If a page_size is set in subsequent calls, it must
7689 /// match the page_size given in the first request.
7690 pub page_size: i32,
7691
7692 /// Optional. The value of `next_page_token` returned by a previous call.
7693 pub page_token: std::string::String,
7694
7695 /// Optional. The resource_view to be applied to the returned AuthorizedViews'
7696 /// fields. Default to NAME_ONLY.
7697 pub view: crate::model::authorized_view::ResponseView,
7698
7699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7700}
7701
7702impl ListAuthorizedViewsRequest {
7703 pub fn new() -> Self {
7704 std::default::Default::default()
7705 }
7706
7707 /// Sets the value of [parent][crate::model::ListAuthorizedViewsRequest::parent].
7708 ///
7709 /// # Example
7710 /// ```ignore,no_run
7711 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsRequest;
7712 /// let x = ListAuthorizedViewsRequest::new().set_parent("example");
7713 /// ```
7714 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7715 self.parent = v.into();
7716 self
7717 }
7718
7719 /// Sets the value of [page_size][crate::model::ListAuthorizedViewsRequest::page_size].
7720 ///
7721 /// # Example
7722 /// ```ignore,no_run
7723 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsRequest;
7724 /// let x = ListAuthorizedViewsRequest::new().set_page_size(42);
7725 /// ```
7726 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7727 self.page_size = v.into();
7728 self
7729 }
7730
7731 /// Sets the value of [page_token][crate::model::ListAuthorizedViewsRequest::page_token].
7732 ///
7733 /// # Example
7734 /// ```ignore,no_run
7735 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsRequest;
7736 /// let x = ListAuthorizedViewsRequest::new().set_page_token("example");
7737 /// ```
7738 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7739 self.page_token = v.into();
7740 self
7741 }
7742
7743 /// Sets the value of [view][crate::model::ListAuthorizedViewsRequest::view].
7744 ///
7745 /// # Example
7746 /// ```ignore,no_run
7747 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsRequest;
7748 /// use google_cloud_bigtable_admin_v2::model::authorized_view::ResponseView;
7749 /// let x0 = ListAuthorizedViewsRequest::new().set_view(ResponseView::NameOnly);
7750 /// let x1 = ListAuthorizedViewsRequest::new().set_view(ResponseView::Basic);
7751 /// let x2 = ListAuthorizedViewsRequest::new().set_view(ResponseView::Full);
7752 /// ```
7753 pub fn set_view<T: std::convert::Into<crate::model::authorized_view::ResponseView>>(
7754 mut self,
7755 v: T,
7756 ) -> Self {
7757 self.view = v.into();
7758 self
7759 }
7760}
7761
7762impl wkt::message::Message for ListAuthorizedViewsRequest {
7763 fn typename() -> &'static str {
7764 "type.googleapis.com/google.bigtable.admin.v2.ListAuthorizedViewsRequest"
7765 }
7766}
7767
7768/// Response message for
7769/// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
7770///
7771/// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]: crate::client::BigtableTableAdmin::list_authorized_views
7772#[derive(Clone, Default, PartialEq)]
7773#[non_exhaustive]
7774pub struct ListAuthorizedViewsResponse {
7775 /// The AuthorizedViews present in the requested table.
7776 pub authorized_views: std::vec::Vec<crate::model::AuthorizedView>,
7777
7778 /// Set if not all tables could be returned in a single response.
7779 /// Pass this value to `page_token` in another request to get the next
7780 /// page of results.
7781 pub next_page_token: std::string::String,
7782
7783 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7784}
7785
7786impl ListAuthorizedViewsResponse {
7787 pub fn new() -> Self {
7788 std::default::Default::default()
7789 }
7790
7791 /// Sets the value of [authorized_views][crate::model::ListAuthorizedViewsResponse::authorized_views].
7792 ///
7793 /// # Example
7794 /// ```ignore,no_run
7795 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsResponse;
7796 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
7797 /// let x = ListAuthorizedViewsResponse::new()
7798 /// .set_authorized_views([
7799 /// AuthorizedView::default()/* use setters */,
7800 /// AuthorizedView::default()/* use (different) setters */,
7801 /// ]);
7802 /// ```
7803 pub fn set_authorized_views<T, V>(mut self, v: T) -> Self
7804 where
7805 T: std::iter::IntoIterator<Item = V>,
7806 V: std::convert::Into<crate::model::AuthorizedView>,
7807 {
7808 use std::iter::Iterator;
7809 self.authorized_views = v.into_iter().map(|i| i.into()).collect();
7810 self
7811 }
7812
7813 /// Sets the value of [next_page_token][crate::model::ListAuthorizedViewsResponse::next_page_token].
7814 ///
7815 /// # Example
7816 /// ```ignore,no_run
7817 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsResponse;
7818 /// let x = ListAuthorizedViewsResponse::new().set_next_page_token("example");
7819 /// ```
7820 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7821 self.next_page_token = v.into();
7822 self
7823 }
7824}
7825
7826impl wkt::message::Message for ListAuthorizedViewsResponse {
7827 fn typename() -> &'static str {
7828 "type.googleapis.com/google.bigtable.admin.v2.ListAuthorizedViewsResponse"
7829 }
7830}
7831
7832#[doc(hidden)]
7833impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizedViewsResponse {
7834 type PageItem = crate::model::AuthorizedView;
7835
7836 fn items(self) -> std::vec::Vec<Self::PageItem> {
7837 self.authorized_views
7838 }
7839
7840 fn next_page_token(&self) -> std::string::String {
7841 use std::clone::Clone;
7842 self.next_page_token.clone()
7843 }
7844}
7845
7846/// Request message for
7847/// [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView]
7848///
7849/// [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView]: crate::client::BigtableTableAdmin::get_authorized_view
7850#[derive(Clone, Default, PartialEq)]
7851#[non_exhaustive]
7852pub struct GetAuthorizedViewRequest {
7853 /// Required. The unique name of the requested AuthorizedView.
7854 /// Values are of the form
7855 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
7856 pub name: std::string::String,
7857
7858 /// Optional. The resource_view to be applied to the returned AuthorizedView's
7859 /// fields. Default to BASIC.
7860 pub view: crate::model::authorized_view::ResponseView,
7861
7862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7863}
7864
7865impl GetAuthorizedViewRequest {
7866 pub fn new() -> Self {
7867 std::default::Default::default()
7868 }
7869
7870 /// Sets the value of [name][crate::model::GetAuthorizedViewRequest::name].
7871 ///
7872 /// # Example
7873 /// ```ignore,no_run
7874 /// # use google_cloud_bigtable_admin_v2::model::GetAuthorizedViewRequest;
7875 /// let x = GetAuthorizedViewRequest::new().set_name("example");
7876 /// ```
7877 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7878 self.name = v.into();
7879 self
7880 }
7881
7882 /// Sets the value of [view][crate::model::GetAuthorizedViewRequest::view].
7883 ///
7884 /// # Example
7885 /// ```ignore,no_run
7886 /// # use google_cloud_bigtable_admin_v2::model::GetAuthorizedViewRequest;
7887 /// use google_cloud_bigtable_admin_v2::model::authorized_view::ResponseView;
7888 /// let x0 = GetAuthorizedViewRequest::new().set_view(ResponseView::NameOnly);
7889 /// let x1 = GetAuthorizedViewRequest::new().set_view(ResponseView::Basic);
7890 /// let x2 = GetAuthorizedViewRequest::new().set_view(ResponseView::Full);
7891 /// ```
7892 pub fn set_view<T: std::convert::Into<crate::model::authorized_view::ResponseView>>(
7893 mut self,
7894 v: T,
7895 ) -> Self {
7896 self.view = v.into();
7897 self
7898 }
7899}
7900
7901impl wkt::message::Message for GetAuthorizedViewRequest {
7902 fn typename() -> &'static str {
7903 "type.googleapis.com/google.bigtable.admin.v2.GetAuthorizedViewRequest"
7904 }
7905}
7906
7907/// The request for
7908/// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
7909///
7910/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]: crate::client::BigtableTableAdmin::update_authorized_view
7911#[derive(Clone, Default, PartialEq)]
7912#[non_exhaustive]
7913pub struct UpdateAuthorizedViewRequest {
7914 /// Required. The AuthorizedView to update. The `name` in `authorized_view` is
7915 /// used to identify the AuthorizedView. AuthorizedView name must in this
7916 /// format:
7917 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
7918 pub authorized_view: std::option::Option<crate::model::AuthorizedView>,
7919
7920 /// Optional. The list of fields to update.
7921 /// A mask specifying which fields in the AuthorizedView resource should be
7922 /// updated. This mask is relative to the AuthorizedView resource, not to the
7923 /// request message. A field will be overwritten if it is in the mask. If
7924 /// empty, all fields set in the request will be overwritten. A special value
7925 /// `*` means to overwrite all fields (including fields not set in the
7926 /// request).
7927 pub update_mask: std::option::Option<wkt::FieldMask>,
7928
7929 /// Optional. If true, ignore the safety checks when updating the
7930 /// AuthorizedView.
7931 pub ignore_warnings: bool,
7932
7933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7934}
7935
7936impl UpdateAuthorizedViewRequest {
7937 pub fn new() -> Self {
7938 std::default::Default::default()
7939 }
7940
7941 /// Sets the value of [authorized_view][crate::model::UpdateAuthorizedViewRequest::authorized_view].
7942 ///
7943 /// # Example
7944 /// ```ignore,no_run
7945 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
7946 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
7947 /// let x = UpdateAuthorizedViewRequest::new().set_authorized_view(AuthorizedView::default()/* use setters */);
7948 /// ```
7949 pub fn set_authorized_view<T>(mut self, v: T) -> Self
7950 where
7951 T: std::convert::Into<crate::model::AuthorizedView>,
7952 {
7953 self.authorized_view = std::option::Option::Some(v.into());
7954 self
7955 }
7956
7957 /// Sets or clears the value of [authorized_view][crate::model::UpdateAuthorizedViewRequest::authorized_view].
7958 ///
7959 /// # Example
7960 /// ```ignore,no_run
7961 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
7962 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
7963 /// let x = UpdateAuthorizedViewRequest::new().set_or_clear_authorized_view(Some(AuthorizedView::default()/* use setters */));
7964 /// let x = UpdateAuthorizedViewRequest::new().set_or_clear_authorized_view(None::<AuthorizedView>);
7965 /// ```
7966 pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
7967 where
7968 T: std::convert::Into<crate::model::AuthorizedView>,
7969 {
7970 self.authorized_view = v.map(|x| x.into());
7971 self
7972 }
7973
7974 /// Sets the value of [update_mask][crate::model::UpdateAuthorizedViewRequest::update_mask].
7975 ///
7976 /// # Example
7977 /// ```ignore,no_run
7978 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
7979 /// use wkt::FieldMask;
7980 /// let x = UpdateAuthorizedViewRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7981 /// ```
7982 pub fn set_update_mask<T>(mut self, v: T) -> Self
7983 where
7984 T: std::convert::Into<wkt::FieldMask>,
7985 {
7986 self.update_mask = std::option::Option::Some(v.into());
7987 self
7988 }
7989
7990 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizedViewRequest::update_mask].
7991 ///
7992 /// # Example
7993 /// ```ignore,no_run
7994 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
7995 /// use wkt::FieldMask;
7996 /// let x = UpdateAuthorizedViewRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7997 /// let x = UpdateAuthorizedViewRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7998 /// ```
7999 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8000 where
8001 T: std::convert::Into<wkt::FieldMask>,
8002 {
8003 self.update_mask = v.map(|x| x.into());
8004 self
8005 }
8006
8007 /// Sets the value of [ignore_warnings][crate::model::UpdateAuthorizedViewRequest::ignore_warnings].
8008 ///
8009 /// # Example
8010 /// ```ignore,no_run
8011 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8012 /// let x = UpdateAuthorizedViewRequest::new().set_ignore_warnings(true);
8013 /// ```
8014 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8015 self.ignore_warnings = v.into();
8016 self
8017 }
8018}
8019
8020impl wkt::message::Message for UpdateAuthorizedViewRequest {
8021 fn typename() -> &'static str {
8022 "type.googleapis.com/google.bigtable.admin.v2.UpdateAuthorizedViewRequest"
8023 }
8024}
8025
8026/// Metadata for the google.longrunning.Operation returned by
8027/// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
8028///
8029/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]: crate::client::BigtableTableAdmin::update_authorized_view
8030#[derive(Clone, Default, PartialEq)]
8031#[non_exhaustive]
8032pub struct UpdateAuthorizedViewMetadata {
8033 /// The request that prompted the initiation of this UpdateAuthorizedView
8034 /// operation.
8035 pub original_request: std::option::Option<crate::model::UpdateAuthorizedViewRequest>,
8036
8037 /// The time at which the original request was received.
8038 pub request_time: std::option::Option<wkt::Timestamp>,
8039
8040 /// The time at which the operation failed or was completed successfully.
8041 pub finish_time: std::option::Option<wkt::Timestamp>,
8042
8043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8044}
8045
8046impl UpdateAuthorizedViewMetadata {
8047 pub fn new() -> Self {
8048 std::default::Default::default()
8049 }
8050
8051 /// Sets the value of [original_request][crate::model::UpdateAuthorizedViewMetadata::original_request].
8052 ///
8053 /// # Example
8054 /// ```ignore,no_run
8055 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8056 /// use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8057 /// let x = UpdateAuthorizedViewMetadata::new().set_original_request(UpdateAuthorizedViewRequest::default()/* use setters */);
8058 /// ```
8059 pub fn set_original_request<T>(mut self, v: T) -> Self
8060 where
8061 T: std::convert::Into<crate::model::UpdateAuthorizedViewRequest>,
8062 {
8063 self.original_request = std::option::Option::Some(v.into());
8064 self
8065 }
8066
8067 /// Sets or clears the value of [original_request][crate::model::UpdateAuthorizedViewMetadata::original_request].
8068 ///
8069 /// # Example
8070 /// ```ignore,no_run
8071 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8072 /// use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8073 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_original_request(Some(UpdateAuthorizedViewRequest::default()/* use setters */));
8074 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_original_request(None::<UpdateAuthorizedViewRequest>);
8075 /// ```
8076 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
8077 where
8078 T: std::convert::Into<crate::model::UpdateAuthorizedViewRequest>,
8079 {
8080 self.original_request = v.map(|x| x.into());
8081 self
8082 }
8083
8084 /// Sets the value of [request_time][crate::model::UpdateAuthorizedViewMetadata::request_time].
8085 ///
8086 /// # Example
8087 /// ```ignore,no_run
8088 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8089 /// use wkt::Timestamp;
8090 /// let x = UpdateAuthorizedViewMetadata::new().set_request_time(Timestamp::default()/* use setters */);
8091 /// ```
8092 pub fn set_request_time<T>(mut self, v: T) -> Self
8093 where
8094 T: std::convert::Into<wkt::Timestamp>,
8095 {
8096 self.request_time = std::option::Option::Some(v.into());
8097 self
8098 }
8099
8100 /// Sets or clears the value of [request_time][crate::model::UpdateAuthorizedViewMetadata::request_time].
8101 ///
8102 /// # Example
8103 /// ```ignore,no_run
8104 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8105 /// use wkt::Timestamp;
8106 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
8107 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_request_time(None::<Timestamp>);
8108 /// ```
8109 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
8110 where
8111 T: std::convert::Into<wkt::Timestamp>,
8112 {
8113 self.request_time = v.map(|x| x.into());
8114 self
8115 }
8116
8117 /// Sets the value of [finish_time][crate::model::UpdateAuthorizedViewMetadata::finish_time].
8118 ///
8119 /// # Example
8120 /// ```ignore,no_run
8121 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8122 /// use wkt::Timestamp;
8123 /// let x = UpdateAuthorizedViewMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
8124 /// ```
8125 pub fn set_finish_time<T>(mut self, v: T) -> Self
8126 where
8127 T: std::convert::Into<wkt::Timestamp>,
8128 {
8129 self.finish_time = std::option::Option::Some(v.into());
8130 self
8131 }
8132
8133 /// Sets or clears the value of [finish_time][crate::model::UpdateAuthorizedViewMetadata::finish_time].
8134 ///
8135 /// # Example
8136 /// ```ignore,no_run
8137 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8138 /// use wkt::Timestamp;
8139 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
8140 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
8141 /// ```
8142 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
8143 where
8144 T: std::convert::Into<wkt::Timestamp>,
8145 {
8146 self.finish_time = v.map(|x| x.into());
8147 self
8148 }
8149}
8150
8151impl wkt::message::Message for UpdateAuthorizedViewMetadata {
8152 fn typename() -> &'static str {
8153 "type.googleapis.com/google.bigtable.admin.v2.UpdateAuthorizedViewMetadata"
8154 }
8155}
8156
8157/// Request message for
8158/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView]
8159///
8160/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView]: crate::client::BigtableTableAdmin::delete_authorized_view
8161#[derive(Clone, Default, PartialEq)]
8162#[non_exhaustive]
8163pub struct DeleteAuthorizedViewRequest {
8164 /// Required. The unique name of the AuthorizedView to be deleted.
8165 /// Values are of the form
8166 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
8167 pub name: std::string::String,
8168
8169 /// Optional. The current etag of the AuthorizedView.
8170 /// If an etag is provided and does not match the current etag of the
8171 /// AuthorizedView, deletion will be blocked and an ABORTED error will be
8172 /// returned.
8173 pub etag: std::string::String,
8174
8175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8176}
8177
8178impl DeleteAuthorizedViewRequest {
8179 pub fn new() -> Self {
8180 std::default::Default::default()
8181 }
8182
8183 /// Sets the value of [name][crate::model::DeleteAuthorizedViewRequest::name].
8184 ///
8185 /// # Example
8186 /// ```ignore,no_run
8187 /// # use google_cloud_bigtable_admin_v2::model::DeleteAuthorizedViewRequest;
8188 /// let x = DeleteAuthorizedViewRequest::new().set_name("example");
8189 /// ```
8190 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8191 self.name = v.into();
8192 self
8193 }
8194
8195 /// Sets the value of [etag][crate::model::DeleteAuthorizedViewRequest::etag].
8196 ///
8197 /// # Example
8198 /// ```ignore,no_run
8199 /// # use google_cloud_bigtable_admin_v2::model::DeleteAuthorizedViewRequest;
8200 /// let x = DeleteAuthorizedViewRequest::new().set_etag("example");
8201 /// ```
8202 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8203 self.etag = v.into();
8204 self
8205 }
8206}
8207
8208impl wkt::message::Message for DeleteAuthorizedViewRequest {
8209 fn typename() -> &'static str {
8210 "type.googleapis.com/google.bigtable.admin.v2.DeleteAuthorizedViewRequest"
8211 }
8212}
8213
8214/// The request for
8215/// [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle].
8216///
8217/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]: crate::client::BigtableTableAdmin::create_schema_bundle
8218#[derive(Clone, Default, PartialEq)]
8219#[non_exhaustive]
8220pub struct CreateSchemaBundleRequest {
8221 /// Required. The parent resource where this schema bundle will be created.
8222 /// Values are of the form
8223 /// `projects/{project}/instances/{instance}/tables/{table}`.
8224 pub parent: std::string::String,
8225
8226 /// Required. The unique ID to use for the schema bundle, which will become the
8227 /// final component of the schema bundle's resource name.
8228 pub schema_bundle_id: std::string::String,
8229
8230 /// Required. The schema bundle to create.
8231 pub schema_bundle: std::option::Option<crate::model::SchemaBundle>,
8232
8233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8234}
8235
8236impl CreateSchemaBundleRequest {
8237 pub fn new() -> Self {
8238 std::default::Default::default()
8239 }
8240
8241 /// Sets the value of [parent][crate::model::CreateSchemaBundleRequest::parent].
8242 ///
8243 /// # Example
8244 /// ```ignore,no_run
8245 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleRequest;
8246 /// let x = CreateSchemaBundleRequest::new().set_parent("example");
8247 /// ```
8248 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8249 self.parent = v.into();
8250 self
8251 }
8252
8253 /// Sets the value of [schema_bundle_id][crate::model::CreateSchemaBundleRequest::schema_bundle_id].
8254 ///
8255 /// # Example
8256 /// ```ignore,no_run
8257 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleRequest;
8258 /// let x = CreateSchemaBundleRequest::new().set_schema_bundle_id("example");
8259 /// ```
8260 pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
8261 mut self,
8262 v: T,
8263 ) -> Self {
8264 self.schema_bundle_id = v.into();
8265 self
8266 }
8267
8268 /// Sets the value of [schema_bundle][crate::model::CreateSchemaBundleRequest::schema_bundle].
8269 ///
8270 /// # Example
8271 /// ```ignore,no_run
8272 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleRequest;
8273 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
8274 /// let x = CreateSchemaBundleRequest::new().set_schema_bundle(SchemaBundle::default()/* use setters */);
8275 /// ```
8276 pub fn set_schema_bundle<T>(mut self, v: T) -> Self
8277 where
8278 T: std::convert::Into<crate::model::SchemaBundle>,
8279 {
8280 self.schema_bundle = std::option::Option::Some(v.into());
8281 self
8282 }
8283
8284 /// Sets or clears the value of [schema_bundle][crate::model::CreateSchemaBundleRequest::schema_bundle].
8285 ///
8286 /// # Example
8287 /// ```ignore,no_run
8288 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleRequest;
8289 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
8290 /// let x = CreateSchemaBundleRequest::new().set_or_clear_schema_bundle(Some(SchemaBundle::default()/* use setters */));
8291 /// let x = CreateSchemaBundleRequest::new().set_or_clear_schema_bundle(None::<SchemaBundle>);
8292 /// ```
8293 pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
8294 where
8295 T: std::convert::Into<crate::model::SchemaBundle>,
8296 {
8297 self.schema_bundle = v.map(|x| x.into());
8298 self
8299 }
8300}
8301
8302impl wkt::message::Message for CreateSchemaBundleRequest {
8303 fn typename() -> &'static str {
8304 "type.googleapis.com/google.bigtable.admin.v2.CreateSchemaBundleRequest"
8305 }
8306}
8307
8308/// The metadata for the Operation returned by
8309/// [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle].
8310///
8311/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]: crate::client::BigtableTableAdmin::create_schema_bundle
8312#[derive(Clone, Default, PartialEq)]
8313#[non_exhaustive]
8314pub struct CreateSchemaBundleMetadata {
8315 /// The unique name identifying this schema bundle.
8316 /// Values are of the form
8317 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
8318 pub name: std::string::String,
8319
8320 /// The time at which this operation started.
8321 pub start_time: std::option::Option<wkt::Timestamp>,
8322
8323 /// If set, the time at which this operation finished or was canceled.
8324 pub end_time: std::option::Option<wkt::Timestamp>,
8325
8326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8327}
8328
8329impl CreateSchemaBundleMetadata {
8330 pub fn new() -> Self {
8331 std::default::Default::default()
8332 }
8333
8334 /// Sets the value of [name][crate::model::CreateSchemaBundleMetadata::name].
8335 ///
8336 /// # Example
8337 /// ```ignore,no_run
8338 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
8339 /// let x = CreateSchemaBundleMetadata::new().set_name("example");
8340 /// ```
8341 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8342 self.name = v.into();
8343 self
8344 }
8345
8346 /// Sets the value of [start_time][crate::model::CreateSchemaBundleMetadata::start_time].
8347 ///
8348 /// # Example
8349 /// ```ignore,no_run
8350 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
8351 /// use wkt::Timestamp;
8352 /// let x = CreateSchemaBundleMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8353 /// ```
8354 pub fn set_start_time<T>(mut self, v: T) -> Self
8355 where
8356 T: std::convert::Into<wkt::Timestamp>,
8357 {
8358 self.start_time = std::option::Option::Some(v.into());
8359 self
8360 }
8361
8362 /// Sets or clears the value of [start_time][crate::model::CreateSchemaBundleMetadata::start_time].
8363 ///
8364 /// # Example
8365 /// ```ignore,no_run
8366 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
8367 /// use wkt::Timestamp;
8368 /// let x = CreateSchemaBundleMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8369 /// let x = CreateSchemaBundleMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8370 /// ```
8371 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8372 where
8373 T: std::convert::Into<wkt::Timestamp>,
8374 {
8375 self.start_time = v.map(|x| x.into());
8376 self
8377 }
8378
8379 /// Sets the value of [end_time][crate::model::CreateSchemaBundleMetadata::end_time].
8380 ///
8381 /// # Example
8382 /// ```ignore,no_run
8383 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
8384 /// use wkt::Timestamp;
8385 /// let x = CreateSchemaBundleMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8386 /// ```
8387 pub fn set_end_time<T>(mut self, v: T) -> Self
8388 where
8389 T: std::convert::Into<wkt::Timestamp>,
8390 {
8391 self.end_time = std::option::Option::Some(v.into());
8392 self
8393 }
8394
8395 /// Sets or clears the value of [end_time][crate::model::CreateSchemaBundleMetadata::end_time].
8396 ///
8397 /// # Example
8398 /// ```ignore,no_run
8399 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
8400 /// use wkt::Timestamp;
8401 /// let x = CreateSchemaBundleMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8402 /// let x = CreateSchemaBundleMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8403 /// ```
8404 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8405 where
8406 T: std::convert::Into<wkt::Timestamp>,
8407 {
8408 self.end_time = v.map(|x| x.into());
8409 self
8410 }
8411}
8412
8413impl wkt::message::Message for CreateSchemaBundleMetadata {
8414 fn typename() -> &'static str {
8415 "type.googleapis.com/google.bigtable.admin.v2.CreateSchemaBundleMetadata"
8416 }
8417}
8418
8419/// The request for
8420/// [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle].
8421///
8422/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]: crate::client::BigtableTableAdmin::update_schema_bundle
8423#[derive(Clone, Default, PartialEq)]
8424#[non_exhaustive]
8425pub struct UpdateSchemaBundleRequest {
8426 /// Required. The schema bundle to update.
8427 ///
8428 /// The schema bundle's `name` field is used to identify the schema bundle to
8429 /// update. Values are of the form
8430 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
8431 pub schema_bundle: std::option::Option<crate::model::SchemaBundle>,
8432
8433 /// Optional. The list of fields to update.
8434 pub update_mask: std::option::Option<wkt::FieldMask>,
8435
8436 /// Optional. If set, ignore the safety checks when updating the Schema Bundle.
8437 /// The safety checks are:
8438 ///
8439 /// - The new Schema Bundle is backwards compatible with the existing Schema
8440 /// Bundle.
8441 pub ignore_warnings: bool,
8442
8443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8444}
8445
8446impl UpdateSchemaBundleRequest {
8447 pub fn new() -> Self {
8448 std::default::Default::default()
8449 }
8450
8451 /// Sets the value of [schema_bundle][crate::model::UpdateSchemaBundleRequest::schema_bundle].
8452 ///
8453 /// # Example
8454 /// ```ignore,no_run
8455 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
8456 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
8457 /// let x = UpdateSchemaBundleRequest::new().set_schema_bundle(SchemaBundle::default()/* use setters */);
8458 /// ```
8459 pub fn set_schema_bundle<T>(mut self, v: T) -> Self
8460 where
8461 T: std::convert::Into<crate::model::SchemaBundle>,
8462 {
8463 self.schema_bundle = std::option::Option::Some(v.into());
8464 self
8465 }
8466
8467 /// Sets or clears the value of [schema_bundle][crate::model::UpdateSchemaBundleRequest::schema_bundle].
8468 ///
8469 /// # Example
8470 /// ```ignore,no_run
8471 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
8472 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
8473 /// let x = UpdateSchemaBundleRequest::new().set_or_clear_schema_bundle(Some(SchemaBundle::default()/* use setters */));
8474 /// let x = UpdateSchemaBundleRequest::new().set_or_clear_schema_bundle(None::<SchemaBundle>);
8475 /// ```
8476 pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
8477 where
8478 T: std::convert::Into<crate::model::SchemaBundle>,
8479 {
8480 self.schema_bundle = v.map(|x| x.into());
8481 self
8482 }
8483
8484 /// Sets the value of [update_mask][crate::model::UpdateSchemaBundleRequest::update_mask].
8485 ///
8486 /// # Example
8487 /// ```ignore,no_run
8488 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
8489 /// use wkt::FieldMask;
8490 /// let x = UpdateSchemaBundleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8491 /// ```
8492 pub fn set_update_mask<T>(mut self, v: T) -> Self
8493 where
8494 T: std::convert::Into<wkt::FieldMask>,
8495 {
8496 self.update_mask = std::option::Option::Some(v.into());
8497 self
8498 }
8499
8500 /// Sets or clears the value of [update_mask][crate::model::UpdateSchemaBundleRequest::update_mask].
8501 ///
8502 /// # Example
8503 /// ```ignore,no_run
8504 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
8505 /// use wkt::FieldMask;
8506 /// let x = UpdateSchemaBundleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8507 /// let x = UpdateSchemaBundleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8508 /// ```
8509 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8510 where
8511 T: std::convert::Into<wkt::FieldMask>,
8512 {
8513 self.update_mask = v.map(|x| x.into());
8514 self
8515 }
8516
8517 /// Sets the value of [ignore_warnings][crate::model::UpdateSchemaBundleRequest::ignore_warnings].
8518 ///
8519 /// # Example
8520 /// ```ignore,no_run
8521 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
8522 /// let x = UpdateSchemaBundleRequest::new().set_ignore_warnings(true);
8523 /// ```
8524 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8525 self.ignore_warnings = v.into();
8526 self
8527 }
8528}
8529
8530impl wkt::message::Message for UpdateSchemaBundleRequest {
8531 fn typename() -> &'static str {
8532 "type.googleapis.com/google.bigtable.admin.v2.UpdateSchemaBundleRequest"
8533 }
8534}
8535
8536/// The metadata for the Operation returned by
8537/// [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle].
8538///
8539/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]: crate::client::BigtableTableAdmin::update_schema_bundle
8540#[derive(Clone, Default, PartialEq)]
8541#[non_exhaustive]
8542pub struct UpdateSchemaBundleMetadata {
8543 /// The unique name identifying this schema bundle.
8544 /// Values are of the form
8545 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
8546 pub name: std::string::String,
8547
8548 /// The time at which this operation started.
8549 pub start_time: std::option::Option<wkt::Timestamp>,
8550
8551 /// If set, the time at which this operation finished or was canceled.
8552 pub end_time: std::option::Option<wkt::Timestamp>,
8553
8554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8555}
8556
8557impl UpdateSchemaBundleMetadata {
8558 pub fn new() -> Self {
8559 std::default::Default::default()
8560 }
8561
8562 /// Sets the value of [name][crate::model::UpdateSchemaBundleMetadata::name].
8563 ///
8564 /// # Example
8565 /// ```ignore,no_run
8566 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
8567 /// let x = UpdateSchemaBundleMetadata::new().set_name("example");
8568 /// ```
8569 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8570 self.name = v.into();
8571 self
8572 }
8573
8574 /// Sets the value of [start_time][crate::model::UpdateSchemaBundleMetadata::start_time].
8575 ///
8576 /// # Example
8577 /// ```ignore,no_run
8578 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
8579 /// use wkt::Timestamp;
8580 /// let x = UpdateSchemaBundleMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8581 /// ```
8582 pub fn set_start_time<T>(mut self, v: T) -> Self
8583 where
8584 T: std::convert::Into<wkt::Timestamp>,
8585 {
8586 self.start_time = std::option::Option::Some(v.into());
8587 self
8588 }
8589
8590 /// Sets or clears the value of [start_time][crate::model::UpdateSchemaBundleMetadata::start_time].
8591 ///
8592 /// # Example
8593 /// ```ignore,no_run
8594 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
8595 /// use wkt::Timestamp;
8596 /// let x = UpdateSchemaBundleMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8597 /// let x = UpdateSchemaBundleMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8598 /// ```
8599 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8600 where
8601 T: std::convert::Into<wkt::Timestamp>,
8602 {
8603 self.start_time = v.map(|x| x.into());
8604 self
8605 }
8606
8607 /// Sets the value of [end_time][crate::model::UpdateSchemaBundleMetadata::end_time].
8608 ///
8609 /// # Example
8610 /// ```ignore,no_run
8611 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
8612 /// use wkt::Timestamp;
8613 /// let x = UpdateSchemaBundleMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8614 /// ```
8615 pub fn set_end_time<T>(mut self, v: T) -> Self
8616 where
8617 T: std::convert::Into<wkt::Timestamp>,
8618 {
8619 self.end_time = std::option::Option::Some(v.into());
8620 self
8621 }
8622
8623 /// Sets or clears the value of [end_time][crate::model::UpdateSchemaBundleMetadata::end_time].
8624 ///
8625 /// # Example
8626 /// ```ignore,no_run
8627 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
8628 /// use wkt::Timestamp;
8629 /// let x = UpdateSchemaBundleMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8630 /// let x = UpdateSchemaBundleMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8631 /// ```
8632 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8633 where
8634 T: std::convert::Into<wkt::Timestamp>,
8635 {
8636 self.end_time = v.map(|x| x.into());
8637 self
8638 }
8639}
8640
8641impl wkt::message::Message for UpdateSchemaBundleMetadata {
8642 fn typename() -> &'static str {
8643 "type.googleapis.com/google.bigtable.admin.v2.UpdateSchemaBundleMetadata"
8644 }
8645}
8646
8647/// The request for
8648/// [GetSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle].
8649///
8650/// [google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle]: crate::client::BigtableTableAdmin::get_schema_bundle
8651#[derive(Clone, Default, PartialEq)]
8652#[non_exhaustive]
8653pub struct GetSchemaBundleRequest {
8654 /// Required. The unique name of the schema bundle to retrieve.
8655 /// Values are of the form
8656 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
8657 pub name: std::string::String,
8658
8659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8660}
8661
8662impl GetSchemaBundleRequest {
8663 pub fn new() -> Self {
8664 std::default::Default::default()
8665 }
8666
8667 /// Sets the value of [name][crate::model::GetSchemaBundleRequest::name].
8668 ///
8669 /// # Example
8670 /// ```ignore,no_run
8671 /// # use google_cloud_bigtable_admin_v2::model::GetSchemaBundleRequest;
8672 /// let x = GetSchemaBundleRequest::new().set_name("example");
8673 /// ```
8674 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8675 self.name = v.into();
8676 self
8677 }
8678}
8679
8680impl wkt::message::Message for GetSchemaBundleRequest {
8681 fn typename() -> &'static str {
8682 "type.googleapis.com/google.bigtable.admin.v2.GetSchemaBundleRequest"
8683 }
8684}
8685
8686/// The request for
8687/// [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles].
8688///
8689/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]: crate::client::BigtableTableAdmin::list_schema_bundles
8690#[derive(Clone, Default, PartialEq)]
8691#[non_exhaustive]
8692pub struct ListSchemaBundlesRequest {
8693 /// Required. The parent, which owns this collection of schema bundles.
8694 /// Values are of the form
8695 /// `projects/{project}/instances/{instance}/tables/{table}`.
8696 pub parent: std::string::String,
8697
8698 /// The maximum number of schema bundles to return. If the value is positive,
8699 /// the server may return at most this value. If unspecified, the server will
8700 /// return the maximum allowed page size.
8701 pub page_size: i32,
8702
8703 /// A page token, received from a previous `ListSchemaBundles` call.
8704 /// Provide this to retrieve the subsequent page.
8705 ///
8706 /// When paginating, all other parameters provided to `ListSchemaBundles` must
8707 /// match the call that provided the page token.
8708 pub page_token: std::string::String,
8709
8710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8711}
8712
8713impl ListSchemaBundlesRequest {
8714 pub fn new() -> Self {
8715 std::default::Default::default()
8716 }
8717
8718 /// Sets the value of [parent][crate::model::ListSchemaBundlesRequest::parent].
8719 ///
8720 /// # Example
8721 /// ```ignore,no_run
8722 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesRequest;
8723 /// let x = ListSchemaBundlesRequest::new().set_parent("example");
8724 /// ```
8725 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8726 self.parent = v.into();
8727 self
8728 }
8729
8730 /// Sets the value of [page_size][crate::model::ListSchemaBundlesRequest::page_size].
8731 ///
8732 /// # Example
8733 /// ```ignore,no_run
8734 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesRequest;
8735 /// let x = ListSchemaBundlesRequest::new().set_page_size(42);
8736 /// ```
8737 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8738 self.page_size = v.into();
8739 self
8740 }
8741
8742 /// Sets the value of [page_token][crate::model::ListSchemaBundlesRequest::page_token].
8743 ///
8744 /// # Example
8745 /// ```ignore,no_run
8746 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesRequest;
8747 /// let x = ListSchemaBundlesRequest::new().set_page_token("example");
8748 /// ```
8749 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8750 self.page_token = v.into();
8751 self
8752 }
8753}
8754
8755impl wkt::message::Message for ListSchemaBundlesRequest {
8756 fn typename() -> &'static str {
8757 "type.googleapis.com/google.bigtable.admin.v2.ListSchemaBundlesRequest"
8758 }
8759}
8760
8761/// The response for
8762/// [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles].
8763///
8764/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]: crate::client::BigtableTableAdmin::list_schema_bundles
8765#[derive(Clone, Default, PartialEq)]
8766#[non_exhaustive]
8767pub struct ListSchemaBundlesResponse {
8768 /// The schema bundles from the specified table.
8769 pub schema_bundles: std::vec::Vec<crate::model::SchemaBundle>,
8770
8771 /// A token, which can be sent as `page_token` to retrieve the next page.
8772 /// If this field is omitted, there are no subsequent pages.
8773 pub next_page_token: std::string::String,
8774
8775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8776}
8777
8778impl ListSchemaBundlesResponse {
8779 pub fn new() -> Self {
8780 std::default::Default::default()
8781 }
8782
8783 /// Sets the value of [schema_bundles][crate::model::ListSchemaBundlesResponse::schema_bundles].
8784 ///
8785 /// # Example
8786 /// ```ignore,no_run
8787 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesResponse;
8788 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
8789 /// let x = ListSchemaBundlesResponse::new()
8790 /// .set_schema_bundles([
8791 /// SchemaBundle::default()/* use setters */,
8792 /// SchemaBundle::default()/* use (different) setters */,
8793 /// ]);
8794 /// ```
8795 pub fn set_schema_bundles<T, V>(mut self, v: T) -> Self
8796 where
8797 T: std::iter::IntoIterator<Item = V>,
8798 V: std::convert::Into<crate::model::SchemaBundle>,
8799 {
8800 use std::iter::Iterator;
8801 self.schema_bundles = v.into_iter().map(|i| i.into()).collect();
8802 self
8803 }
8804
8805 /// Sets the value of [next_page_token][crate::model::ListSchemaBundlesResponse::next_page_token].
8806 ///
8807 /// # Example
8808 /// ```ignore,no_run
8809 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesResponse;
8810 /// let x = ListSchemaBundlesResponse::new().set_next_page_token("example");
8811 /// ```
8812 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8813 self.next_page_token = v.into();
8814 self
8815 }
8816}
8817
8818impl wkt::message::Message for ListSchemaBundlesResponse {
8819 fn typename() -> &'static str {
8820 "type.googleapis.com/google.bigtable.admin.v2.ListSchemaBundlesResponse"
8821 }
8822}
8823
8824#[doc(hidden)]
8825impl google_cloud_gax::paginator::internal::PageableResponse for ListSchemaBundlesResponse {
8826 type PageItem = crate::model::SchemaBundle;
8827
8828 fn items(self) -> std::vec::Vec<Self::PageItem> {
8829 self.schema_bundles
8830 }
8831
8832 fn next_page_token(&self) -> std::string::String {
8833 use std::clone::Clone;
8834 self.next_page_token.clone()
8835 }
8836}
8837
8838/// The request for
8839/// [DeleteSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle].
8840///
8841/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle]: crate::client::BigtableTableAdmin::delete_schema_bundle
8842#[derive(Clone, Default, PartialEq)]
8843#[non_exhaustive]
8844pub struct DeleteSchemaBundleRequest {
8845 /// Required. The unique name of the schema bundle to delete.
8846 /// Values are of the form
8847 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
8848 pub name: std::string::String,
8849
8850 /// Optional. The etag of the schema bundle.
8851 /// If this is provided, it must match the server's etag. The server
8852 /// returns an ABORTED error on a mismatched etag.
8853 pub etag: std::string::String,
8854
8855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8856}
8857
8858impl DeleteSchemaBundleRequest {
8859 pub fn new() -> Self {
8860 std::default::Default::default()
8861 }
8862
8863 /// Sets the value of [name][crate::model::DeleteSchemaBundleRequest::name].
8864 ///
8865 /// # Example
8866 /// ```ignore,no_run
8867 /// # use google_cloud_bigtable_admin_v2::model::DeleteSchemaBundleRequest;
8868 /// let x = DeleteSchemaBundleRequest::new().set_name("example");
8869 /// ```
8870 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8871 self.name = v.into();
8872 self
8873 }
8874
8875 /// Sets the value of [etag][crate::model::DeleteSchemaBundleRequest::etag].
8876 ///
8877 /// # Example
8878 /// ```ignore,no_run
8879 /// # use google_cloud_bigtable_admin_v2::model::DeleteSchemaBundleRequest;
8880 /// let x = DeleteSchemaBundleRequest::new().set_etag("example");
8881 /// ```
8882 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8883 self.etag = v.into();
8884 self
8885 }
8886}
8887
8888impl wkt::message::Message for DeleteSchemaBundleRequest {
8889 fn typename() -> &'static str {
8890 "type.googleapis.com/google.bigtable.admin.v2.DeleteSchemaBundleRequest"
8891 }
8892}
8893
8894/// Encapsulates progress related information for a Cloud Bigtable long
8895/// running operation.
8896#[derive(Clone, Default, PartialEq)]
8897#[non_exhaustive]
8898pub struct OperationProgress {
8899 /// Percent completion of the operation.
8900 /// Values are between 0 and 100 inclusive.
8901 pub progress_percent: i32,
8902
8903 /// Time the request was received.
8904 pub start_time: std::option::Option<wkt::Timestamp>,
8905
8906 /// If set, the time at which this operation failed or was completed
8907 /// successfully.
8908 pub end_time: std::option::Option<wkt::Timestamp>,
8909
8910 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8911}
8912
8913impl OperationProgress {
8914 pub fn new() -> Self {
8915 std::default::Default::default()
8916 }
8917
8918 /// Sets the value of [progress_percent][crate::model::OperationProgress::progress_percent].
8919 ///
8920 /// # Example
8921 /// ```ignore,no_run
8922 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
8923 /// let x = OperationProgress::new().set_progress_percent(42);
8924 /// ```
8925 pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8926 self.progress_percent = v.into();
8927 self
8928 }
8929
8930 /// Sets the value of [start_time][crate::model::OperationProgress::start_time].
8931 ///
8932 /// # Example
8933 /// ```ignore,no_run
8934 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
8935 /// use wkt::Timestamp;
8936 /// let x = OperationProgress::new().set_start_time(Timestamp::default()/* use setters */);
8937 /// ```
8938 pub fn set_start_time<T>(mut self, v: T) -> Self
8939 where
8940 T: std::convert::Into<wkt::Timestamp>,
8941 {
8942 self.start_time = std::option::Option::Some(v.into());
8943 self
8944 }
8945
8946 /// Sets or clears the value of [start_time][crate::model::OperationProgress::start_time].
8947 ///
8948 /// # Example
8949 /// ```ignore,no_run
8950 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
8951 /// use wkt::Timestamp;
8952 /// let x = OperationProgress::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8953 /// let x = OperationProgress::new().set_or_clear_start_time(None::<Timestamp>);
8954 /// ```
8955 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8956 where
8957 T: std::convert::Into<wkt::Timestamp>,
8958 {
8959 self.start_time = v.map(|x| x.into());
8960 self
8961 }
8962
8963 /// Sets the value of [end_time][crate::model::OperationProgress::end_time].
8964 ///
8965 /// # Example
8966 /// ```ignore,no_run
8967 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
8968 /// use wkt::Timestamp;
8969 /// let x = OperationProgress::new().set_end_time(Timestamp::default()/* use setters */);
8970 /// ```
8971 pub fn set_end_time<T>(mut self, v: T) -> Self
8972 where
8973 T: std::convert::Into<wkt::Timestamp>,
8974 {
8975 self.end_time = std::option::Option::Some(v.into());
8976 self
8977 }
8978
8979 /// Sets or clears the value of [end_time][crate::model::OperationProgress::end_time].
8980 ///
8981 /// # Example
8982 /// ```ignore,no_run
8983 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
8984 /// use wkt::Timestamp;
8985 /// let x = OperationProgress::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8986 /// let x = OperationProgress::new().set_or_clear_end_time(None::<Timestamp>);
8987 /// ```
8988 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8989 where
8990 T: std::convert::Into<wkt::Timestamp>,
8991 {
8992 self.end_time = v.map(|x| x.into());
8993 self
8994 }
8995}
8996
8997impl wkt::message::Message for OperationProgress {
8998 fn typename() -> &'static str {
8999 "type.googleapis.com/google.bigtable.admin.v2.OperationProgress"
9000 }
9001}
9002
9003/// A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
9004/// the resources that serve them.
9005/// All tables in an instance are served from all
9006/// [Clusters][google.bigtable.admin.v2.Cluster] in the instance.
9007///
9008/// [google.bigtable.admin.v2.Cluster]: crate::model::Cluster
9009/// [google.bigtable.admin.v2.Table]: crate::model::Table
9010#[derive(Clone, Default, PartialEq)]
9011#[non_exhaustive]
9012pub struct Instance {
9013 /// The unique name of the instance. Values are of the form
9014 /// `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
9015 pub name: std::string::String,
9016
9017 /// Required. The descriptive name for this instance as it appears in UIs.
9018 /// Can be changed at any time, but should be kept globally unique
9019 /// to avoid confusion.
9020 pub display_name: std::string::String,
9021
9022 /// Output only. The current state of the instance.
9023 pub state: crate::model::instance::State,
9024
9025 /// The type of the instance. Defaults to `PRODUCTION`.
9026 pub r#type: crate::model::instance::Type,
9027
9028 /// Labels are a flexible and lightweight mechanism for organizing cloud
9029 /// resources into groups that reflect a customer's organizational needs and
9030 /// deployment strategies. They can be used to filter resources and aggregate
9031 /// metrics.
9032 ///
9033 /// * Label keys must be between 1 and 63 characters long and must conform to
9034 /// the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
9035 /// * Label values must be between 0 and 63 characters long and must conform to
9036 /// the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
9037 /// * No more than 64 labels can be associated with a given resource.
9038 /// * Keys and values must both be under 128 bytes.
9039 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9040
9041 /// Output only. A commit timestamp representing when this Instance was
9042 /// created. For instances created before this field was added (August 2021),
9043 /// this value is `seconds: 0, nanos: 1`.
9044 pub create_time: std::option::Option<wkt::Timestamp>,
9045
9046 /// Output only. Reserved for future use.
9047 pub satisfies_pzs: std::option::Option<bool>,
9048
9049 /// Output only. Reserved for future use.
9050 pub satisfies_pzi: std::option::Option<bool>,
9051
9052 /// Optional. Input only. Immutable. Tag keys/values directly bound to this
9053 /// resource. For example:
9054 ///
9055 /// - "123/environment": "production",
9056 /// - "123/costCenter": "marketing"
9057 ///
9058 /// Tags and Labels (above) are both used to bind metadata to resources, with
9059 /// different use-cases. See
9060 /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview> for an
9061 /// in-depth overview on the difference between tags and labels.
9062 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
9063
9064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9065}
9066
9067impl Instance {
9068 pub fn new() -> Self {
9069 std::default::Default::default()
9070 }
9071
9072 /// Sets the value of [name][crate::model::Instance::name].
9073 ///
9074 /// # Example
9075 /// ```ignore,no_run
9076 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9077 /// let x = Instance::new().set_name("example");
9078 /// ```
9079 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9080 self.name = v.into();
9081 self
9082 }
9083
9084 /// Sets the value of [display_name][crate::model::Instance::display_name].
9085 ///
9086 /// # Example
9087 /// ```ignore,no_run
9088 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9089 /// let x = Instance::new().set_display_name("example");
9090 /// ```
9091 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9092 self.display_name = v.into();
9093 self
9094 }
9095
9096 /// Sets the value of [state][crate::model::Instance::state].
9097 ///
9098 /// # Example
9099 /// ```ignore,no_run
9100 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9101 /// use google_cloud_bigtable_admin_v2::model::instance::State;
9102 /// let x0 = Instance::new().set_state(State::Ready);
9103 /// let x1 = Instance::new().set_state(State::Creating);
9104 /// ```
9105 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
9106 self.state = v.into();
9107 self
9108 }
9109
9110 /// Sets the value of [r#type][crate::model::Instance::type].
9111 ///
9112 /// # Example
9113 /// ```ignore,no_run
9114 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9115 /// use google_cloud_bigtable_admin_v2::model::instance::Type;
9116 /// let x0 = Instance::new().set_type(Type::Production);
9117 /// let x1 = Instance::new().set_type(Type::Development);
9118 /// ```
9119 pub fn set_type<T: std::convert::Into<crate::model::instance::Type>>(mut self, v: T) -> Self {
9120 self.r#type = v.into();
9121 self
9122 }
9123
9124 /// Sets the value of [labels][crate::model::Instance::labels].
9125 ///
9126 /// # Example
9127 /// ```ignore,no_run
9128 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9129 /// let x = Instance::new().set_labels([
9130 /// ("key0", "abc"),
9131 /// ("key1", "xyz"),
9132 /// ]);
9133 /// ```
9134 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9135 where
9136 T: std::iter::IntoIterator<Item = (K, V)>,
9137 K: std::convert::Into<std::string::String>,
9138 V: std::convert::Into<std::string::String>,
9139 {
9140 use std::iter::Iterator;
9141 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9142 self
9143 }
9144
9145 /// Sets the value of [create_time][crate::model::Instance::create_time].
9146 ///
9147 /// # Example
9148 /// ```ignore,no_run
9149 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9150 /// use wkt::Timestamp;
9151 /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
9152 /// ```
9153 pub fn set_create_time<T>(mut self, v: T) -> Self
9154 where
9155 T: std::convert::Into<wkt::Timestamp>,
9156 {
9157 self.create_time = std::option::Option::Some(v.into());
9158 self
9159 }
9160
9161 /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
9162 ///
9163 /// # Example
9164 /// ```ignore,no_run
9165 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9166 /// use wkt::Timestamp;
9167 /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9168 /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
9169 /// ```
9170 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9171 where
9172 T: std::convert::Into<wkt::Timestamp>,
9173 {
9174 self.create_time = v.map(|x| x.into());
9175 self
9176 }
9177
9178 /// Sets the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
9179 ///
9180 /// # Example
9181 /// ```ignore,no_run
9182 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9183 /// let x = Instance::new().set_satisfies_pzs(true);
9184 /// ```
9185 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
9186 where
9187 T: std::convert::Into<bool>,
9188 {
9189 self.satisfies_pzs = std::option::Option::Some(v.into());
9190 self
9191 }
9192
9193 /// Sets or clears the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
9194 ///
9195 /// # Example
9196 /// ```ignore,no_run
9197 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9198 /// let x = Instance::new().set_or_clear_satisfies_pzs(Some(false));
9199 /// let x = Instance::new().set_or_clear_satisfies_pzs(None::<bool>);
9200 /// ```
9201 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
9202 where
9203 T: std::convert::Into<bool>,
9204 {
9205 self.satisfies_pzs = v.map(|x| x.into());
9206 self
9207 }
9208
9209 /// Sets the value of [satisfies_pzi][crate::model::Instance::satisfies_pzi].
9210 ///
9211 /// # Example
9212 /// ```ignore,no_run
9213 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9214 /// let x = Instance::new().set_satisfies_pzi(true);
9215 /// ```
9216 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
9217 where
9218 T: std::convert::Into<bool>,
9219 {
9220 self.satisfies_pzi = std::option::Option::Some(v.into());
9221 self
9222 }
9223
9224 /// Sets or clears the value of [satisfies_pzi][crate::model::Instance::satisfies_pzi].
9225 ///
9226 /// # Example
9227 /// ```ignore,no_run
9228 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9229 /// let x = Instance::new().set_or_clear_satisfies_pzi(Some(false));
9230 /// let x = Instance::new().set_or_clear_satisfies_pzi(None::<bool>);
9231 /// ```
9232 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
9233 where
9234 T: std::convert::Into<bool>,
9235 {
9236 self.satisfies_pzi = v.map(|x| x.into());
9237 self
9238 }
9239
9240 /// Sets the value of [tags][crate::model::Instance::tags].
9241 ///
9242 /// # Example
9243 /// ```ignore,no_run
9244 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9245 /// let x = Instance::new().set_tags([
9246 /// ("key0", "abc"),
9247 /// ("key1", "xyz"),
9248 /// ]);
9249 /// ```
9250 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
9251 where
9252 T: std::iter::IntoIterator<Item = (K, V)>,
9253 K: std::convert::Into<std::string::String>,
9254 V: std::convert::Into<std::string::String>,
9255 {
9256 use std::iter::Iterator;
9257 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9258 self
9259 }
9260}
9261
9262impl wkt::message::Message for Instance {
9263 fn typename() -> &'static str {
9264 "type.googleapis.com/google.bigtable.admin.v2.Instance"
9265 }
9266}
9267
9268/// Defines additional types related to [Instance].
9269pub mod instance {
9270 #[allow(unused_imports)]
9271 use super::*;
9272
9273 /// Possible states of an instance.
9274 ///
9275 /// # Working with unknown values
9276 ///
9277 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9278 /// additional enum variants at any time. Adding new variants is not considered
9279 /// a breaking change. Applications should write their code in anticipation of:
9280 ///
9281 /// - New values appearing in future releases of the client library, **and**
9282 /// - New values received dynamically, without application changes.
9283 ///
9284 /// Please consult the [Working with enums] section in the user guide for some
9285 /// guidelines.
9286 ///
9287 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9288 #[derive(Clone, Debug, PartialEq)]
9289 #[non_exhaustive]
9290 pub enum State {
9291 /// The state of the instance could not be determined.
9292 NotKnown,
9293 /// The instance has been successfully created and can serve requests
9294 /// to its tables.
9295 Ready,
9296 /// The instance is currently being created, and may be destroyed
9297 /// if the creation process encounters an error.
9298 Creating,
9299 /// If set, the enum was initialized with an unknown value.
9300 ///
9301 /// Applications can examine the value using [State::value] or
9302 /// [State::name].
9303 UnknownValue(state::UnknownValue),
9304 }
9305
9306 #[doc(hidden)]
9307 pub mod state {
9308 #[allow(unused_imports)]
9309 use super::*;
9310 #[derive(Clone, Debug, PartialEq)]
9311 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9312 }
9313
9314 impl State {
9315 /// Gets the enum value.
9316 ///
9317 /// Returns `None` if the enum contains an unknown value deserialized from
9318 /// the string representation of enums.
9319 pub fn value(&self) -> std::option::Option<i32> {
9320 match self {
9321 Self::NotKnown => std::option::Option::Some(0),
9322 Self::Ready => std::option::Option::Some(1),
9323 Self::Creating => std::option::Option::Some(2),
9324 Self::UnknownValue(u) => u.0.value(),
9325 }
9326 }
9327
9328 /// Gets the enum value as a string.
9329 ///
9330 /// Returns `None` if the enum contains an unknown value deserialized from
9331 /// the integer representation of enums.
9332 pub fn name(&self) -> std::option::Option<&str> {
9333 match self {
9334 Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
9335 Self::Ready => std::option::Option::Some("READY"),
9336 Self::Creating => std::option::Option::Some("CREATING"),
9337 Self::UnknownValue(u) => u.0.name(),
9338 }
9339 }
9340 }
9341
9342 impl std::default::Default for State {
9343 fn default() -> Self {
9344 use std::convert::From;
9345 Self::from(0)
9346 }
9347 }
9348
9349 impl std::fmt::Display for State {
9350 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9351 wkt::internal::display_enum(f, self.name(), self.value())
9352 }
9353 }
9354
9355 impl std::convert::From<i32> for State {
9356 fn from(value: i32) -> Self {
9357 match value {
9358 0 => Self::NotKnown,
9359 1 => Self::Ready,
9360 2 => Self::Creating,
9361 _ => Self::UnknownValue(state::UnknownValue(
9362 wkt::internal::UnknownEnumValue::Integer(value),
9363 )),
9364 }
9365 }
9366 }
9367
9368 impl std::convert::From<&str> for State {
9369 fn from(value: &str) -> Self {
9370 use std::string::ToString;
9371 match value {
9372 "STATE_NOT_KNOWN" => Self::NotKnown,
9373 "READY" => Self::Ready,
9374 "CREATING" => Self::Creating,
9375 _ => Self::UnknownValue(state::UnknownValue(
9376 wkt::internal::UnknownEnumValue::String(value.to_string()),
9377 )),
9378 }
9379 }
9380 }
9381
9382 impl serde::ser::Serialize for State {
9383 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9384 where
9385 S: serde::Serializer,
9386 {
9387 match self {
9388 Self::NotKnown => serializer.serialize_i32(0),
9389 Self::Ready => serializer.serialize_i32(1),
9390 Self::Creating => serializer.serialize_i32(2),
9391 Self::UnknownValue(u) => u.0.serialize(serializer),
9392 }
9393 }
9394 }
9395
9396 impl<'de> serde::de::Deserialize<'de> for State {
9397 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9398 where
9399 D: serde::Deserializer<'de>,
9400 {
9401 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9402 ".google.bigtable.admin.v2.Instance.State",
9403 ))
9404 }
9405 }
9406
9407 /// The type of the instance.
9408 ///
9409 /// # Working with unknown values
9410 ///
9411 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9412 /// additional enum variants at any time. Adding new variants is not considered
9413 /// a breaking change. Applications should write their code in anticipation of:
9414 ///
9415 /// - New values appearing in future releases of the client library, **and**
9416 /// - New values received dynamically, without application changes.
9417 ///
9418 /// Please consult the [Working with enums] section in the user guide for some
9419 /// guidelines.
9420 ///
9421 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9422 #[derive(Clone, Debug, PartialEq)]
9423 #[non_exhaustive]
9424 pub enum Type {
9425 /// The type of the instance is unspecified. If set when creating an
9426 /// instance, a `PRODUCTION` instance will be created. If set when updating
9427 /// an instance, the type will be left unchanged.
9428 Unspecified,
9429 /// An instance meant for production use. `serve_nodes` must be set
9430 /// on the cluster.
9431 Production,
9432 /// DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces
9433 /// a higher minimum node count than DEVELOPMENT.
9434 Development,
9435 /// If set, the enum was initialized with an unknown value.
9436 ///
9437 /// Applications can examine the value using [Type::value] or
9438 /// [Type::name].
9439 UnknownValue(r#type::UnknownValue),
9440 }
9441
9442 #[doc(hidden)]
9443 pub mod r#type {
9444 #[allow(unused_imports)]
9445 use super::*;
9446 #[derive(Clone, Debug, PartialEq)]
9447 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9448 }
9449
9450 impl Type {
9451 /// Gets the enum value.
9452 ///
9453 /// Returns `None` if the enum contains an unknown value deserialized from
9454 /// the string representation of enums.
9455 pub fn value(&self) -> std::option::Option<i32> {
9456 match self {
9457 Self::Unspecified => std::option::Option::Some(0),
9458 Self::Production => std::option::Option::Some(1),
9459 Self::Development => std::option::Option::Some(2),
9460 Self::UnknownValue(u) => u.0.value(),
9461 }
9462 }
9463
9464 /// Gets the enum value as a string.
9465 ///
9466 /// Returns `None` if the enum contains an unknown value deserialized from
9467 /// the integer representation of enums.
9468 pub fn name(&self) -> std::option::Option<&str> {
9469 match self {
9470 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
9471 Self::Production => std::option::Option::Some("PRODUCTION"),
9472 Self::Development => std::option::Option::Some("DEVELOPMENT"),
9473 Self::UnknownValue(u) => u.0.name(),
9474 }
9475 }
9476 }
9477
9478 impl std::default::Default for Type {
9479 fn default() -> Self {
9480 use std::convert::From;
9481 Self::from(0)
9482 }
9483 }
9484
9485 impl std::fmt::Display for Type {
9486 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9487 wkt::internal::display_enum(f, self.name(), self.value())
9488 }
9489 }
9490
9491 impl std::convert::From<i32> for Type {
9492 fn from(value: i32) -> Self {
9493 match value {
9494 0 => Self::Unspecified,
9495 1 => Self::Production,
9496 2 => Self::Development,
9497 _ => Self::UnknownValue(r#type::UnknownValue(
9498 wkt::internal::UnknownEnumValue::Integer(value),
9499 )),
9500 }
9501 }
9502 }
9503
9504 impl std::convert::From<&str> for Type {
9505 fn from(value: &str) -> Self {
9506 use std::string::ToString;
9507 match value {
9508 "TYPE_UNSPECIFIED" => Self::Unspecified,
9509 "PRODUCTION" => Self::Production,
9510 "DEVELOPMENT" => Self::Development,
9511 _ => Self::UnknownValue(r#type::UnknownValue(
9512 wkt::internal::UnknownEnumValue::String(value.to_string()),
9513 )),
9514 }
9515 }
9516 }
9517
9518 impl serde::ser::Serialize for Type {
9519 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9520 where
9521 S: serde::Serializer,
9522 {
9523 match self {
9524 Self::Unspecified => serializer.serialize_i32(0),
9525 Self::Production => serializer.serialize_i32(1),
9526 Self::Development => serializer.serialize_i32(2),
9527 Self::UnknownValue(u) => u.0.serialize(serializer),
9528 }
9529 }
9530 }
9531
9532 impl<'de> serde::de::Deserialize<'de> for Type {
9533 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9534 where
9535 D: serde::Deserializer<'de>,
9536 {
9537 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
9538 ".google.bigtable.admin.v2.Instance.Type",
9539 ))
9540 }
9541 }
9542}
9543
9544/// The Autoscaling targets for a Cluster. These determine the recommended nodes.
9545#[derive(Clone, Default, PartialEq)]
9546#[non_exhaustive]
9547pub struct AutoscalingTargets {
9548 /// The cpu utilization that the Autoscaler should be trying to achieve.
9549 /// This number is on a scale from 0 (no utilization) to
9550 /// 100 (total utilization), and is limited between 10 and 80, otherwise it
9551 /// will return INVALID_ARGUMENT error.
9552 pub cpu_utilization_percent: i32,
9553
9554 /// The storage utilization that the Autoscaler should be trying to achieve.
9555 /// This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
9556 /// cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
9557 /// otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
9558 /// it will be treated as if it were set to the default value: 2560 for SSD,
9559 /// 8192 for HDD.
9560 pub storage_utilization_gib_per_node: i32,
9561
9562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9563}
9564
9565impl AutoscalingTargets {
9566 pub fn new() -> Self {
9567 std::default::Default::default()
9568 }
9569
9570 /// Sets the value of [cpu_utilization_percent][crate::model::AutoscalingTargets::cpu_utilization_percent].
9571 ///
9572 /// # Example
9573 /// ```ignore,no_run
9574 /// # use google_cloud_bigtable_admin_v2::model::AutoscalingTargets;
9575 /// let x = AutoscalingTargets::new().set_cpu_utilization_percent(42);
9576 /// ```
9577 pub fn set_cpu_utilization_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9578 self.cpu_utilization_percent = v.into();
9579 self
9580 }
9581
9582 /// Sets the value of [storage_utilization_gib_per_node][crate::model::AutoscalingTargets::storage_utilization_gib_per_node].
9583 ///
9584 /// # Example
9585 /// ```ignore,no_run
9586 /// # use google_cloud_bigtable_admin_v2::model::AutoscalingTargets;
9587 /// let x = AutoscalingTargets::new().set_storage_utilization_gib_per_node(42);
9588 /// ```
9589 pub fn set_storage_utilization_gib_per_node<T: std::convert::Into<i32>>(
9590 mut self,
9591 v: T,
9592 ) -> Self {
9593 self.storage_utilization_gib_per_node = v.into();
9594 self
9595 }
9596}
9597
9598impl wkt::message::Message for AutoscalingTargets {
9599 fn typename() -> &'static str {
9600 "type.googleapis.com/google.bigtable.admin.v2.AutoscalingTargets"
9601 }
9602}
9603
9604/// Limits for the number of nodes a Cluster can autoscale up/down to.
9605#[derive(Clone, Default, PartialEq)]
9606#[non_exhaustive]
9607pub struct AutoscalingLimits {
9608 /// Required. Minimum number of nodes to scale down to.
9609 pub min_serve_nodes: i32,
9610
9611 /// Required. Maximum number of nodes to scale up to.
9612 pub max_serve_nodes: i32,
9613
9614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9615}
9616
9617impl AutoscalingLimits {
9618 pub fn new() -> Self {
9619 std::default::Default::default()
9620 }
9621
9622 /// Sets the value of [min_serve_nodes][crate::model::AutoscalingLimits::min_serve_nodes].
9623 ///
9624 /// # Example
9625 /// ```ignore,no_run
9626 /// # use google_cloud_bigtable_admin_v2::model::AutoscalingLimits;
9627 /// let x = AutoscalingLimits::new().set_min_serve_nodes(42);
9628 /// ```
9629 pub fn set_min_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9630 self.min_serve_nodes = v.into();
9631 self
9632 }
9633
9634 /// Sets the value of [max_serve_nodes][crate::model::AutoscalingLimits::max_serve_nodes].
9635 ///
9636 /// # Example
9637 /// ```ignore,no_run
9638 /// # use google_cloud_bigtable_admin_v2::model::AutoscalingLimits;
9639 /// let x = AutoscalingLimits::new().set_max_serve_nodes(42);
9640 /// ```
9641 pub fn set_max_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9642 self.max_serve_nodes = v.into();
9643 self
9644 }
9645}
9646
9647impl wkt::message::Message for AutoscalingLimits {
9648 fn typename() -> &'static str {
9649 "type.googleapis.com/google.bigtable.admin.v2.AutoscalingLimits"
9650 }
9651}
9652
9653/// A resizable group of nodes in a particular cloud location, capable
9654/// of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
9655/// [Instance][google.bigtable.admin.v2.Instance].
9656///
9657/// [google.bigtable.admin.v2.Instance]: crate::model::Instance
9658/// [google.bigtable.admin.v2.Table]: crate::model::Table
9659#[derive(Clone, Default, PartialEq)]
9660#[non_exhaustive]
9661pub struct Cluster {
9662 /// The unique name of the cluster. Values are of the form
9663 /// `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
9664 pub name: std::string::String,
9665
9666 /// Immutable. The location where this cluster's nodes and storage reside. For
9667 /// best performance, clients should be located as close as possible to this
9668 /// cluster. Currently only zones are supported, so values should be of the
9669 /// form `projects/{project}/locations/{zone}`.
9670 pub location: std::string::String,
9671
9672 /// Output only. The current state of the cluster.
9673 pub state: crate::model::cluster::State,
9674
9675 /// The number of nodes in the cluster. If no value is set,
9676 /// Cloud Bigtable automatically allocates nodes based on your data footprint
9677 /// and optimized for 50% storage utilization.
9678 pub serve_nodes: i32,
9679
9680 /// Immutable. The node scaling factor of this cluster.
9681 pub node_scaling_factor: crate::model::cluster::NodeScalingFactor,
9682
9683 /// Immutable. The type of storage used by this cluster to serve its
9684 /// parent instance's tables, unless explicitly overridden.
9685 pub default_storage_type: crate::model::StorageType,
9686
9687 /// Immutable. The encryption configuration for CMEK-protected clusters.
9688 pub encryption_config: std::option::Option<crate::model::cluster::EncryptionConfig>,
9689
9690 pub config: std::option::Option<crate::model::cluster::Config>,
9691
9692 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9693}
9694
9695impl Cluster {
9696 pub fn new() -> Self {
9697 std::default::Default::default()
9698 }
9699
9700 /// Sets the value of [name][crate::model::Cluster::name].
9701 ///
9702 /// # Example
9703 /// ```ignore,no_run
9704 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9705 /// let x = Cluster::new().set_name("example");
9706 /// ```
9707 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9708 self.name = v.into();
9709 self
9710 }
9711
9712 /// Sets the value of [location][crate::model::Cluster::location].
9713 ///
9714 /// # Example
9715 /// ```ignore,no_run
9716 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9717 /// let x = Cluster::new().set_location("example");
9718 /// ```
9719 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9720 self.location = v.into();
9721 self
9722 }
9723
9724 /// Sets the value of [state][crate::model::Cluster::state].
9725 ///
9726 /// # Example
9727 /// ```ignore,no_run
9728 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9729 /// use google_cloud_bigtable_admin_v2::model::cluster::State;
9730 /// let x0 = Cluster::new().set_state(State::Ready);
9731 /// let x1 = Cluster::new().set_state(State::Creating);
9732 /// let x2 = Cluster::new().set_state(State::Resizing);
9733 /// ```
9734 pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
9735 self.state = v.into();
9736 self
9737 }
9738
9739 /// Sets the value of [serve_nodes][crate::model::Cluster::serve_nodes].
9740 ///
9741 /// # Example
9742 /// ```ignore,no_run
9743 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9744 /// let x = Cluster::new().set_serve_nodes(42);
9745 /// ```
9746 pub fn set_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9747 self.serve_nodes = v.into();
9748 self
9749 }
9750
9751 /// Sets the value of [node_scaling_factor][crate::model::Cluster::node_scaling_factor].
9752 ///
9753 /// # Example
9754 /// ```ignore,no_run
9755 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9756 /// use google_cloud_bigtable_admin_v2::model::cluster::NodeScalingFactor;
9757 /// let x0 = Cluster::new().set_node_scaling_factor(NodeScalingFactor::NodeScalingFactor1X);
9758 /// let x1 = Cluster::new().set_node_scaling_factor(NodeScalingFactor::NodeScalingFactor2X);
9759 /// ```
9760 pub fn set_node_scaling_factor<
9761 T: std::convert::Into<crate::model::cluster::NodeScalingFactor>,
9762 >(
9763 mut self,
9764 v: T,
9765 ) -> Self {
9766 self.node_scaling_factor = v.into();
9767 self
9768 }
9769
9770 /// Sets the value of [default_storage_type][crate::model::Cluster::default_storage_type].
9771 ///
9772 /// # Example
9773 /// ```ignore,no_run
9774 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9775 /// use google_cloud_bigtable_admin_v2::model::StorageType;
9776 /// let x0 = Cluster::new().set_default_storage_type(StorageType::Ssd);
9777 /// let x1 = Cluster::new().set_default_storage_type(StorageType::Hdd);
9778 /// ```
9779 pub fn set_default_storage_type<T: std::convert::Into<crate::model::StorageType>>(
9780 mut self,
9781 v: T,
9782 ) -> Self {
9783 self.default_storage_type = v.into();
9784 self
9785 }
9786
9787 /// Sets the value of [encryption_config][crate::model::Cluster::encryption_config].
9788 ///
9789 /// # Example
9790 /// ```ignore,no_run
9791 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9792 /// use google_cloud_bigtable_admin_v2::model::cluster::EncryptionConfig;
9793 /// let x = Cluster::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
9794 /// ```
9795 pub fn set_encryption_config<T>(mut self, v: T) -> Self
9796 where
9797 T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
9798 {
9799 self.encryption_config = std::option::Option::Some(v.into());
9800 self
9801 }
9802
9803 /// Sets or clears the value of [encryption_config][crate::model::Cluster::encryption_config].
9804 ///
9805 /// # Example
9806 /// ```ignore,no_run
9807 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9808 /// use google_cloud_bigtable_admin_v2::model::cluster::EncryptionConfig;
9809 /// let x = Cluster::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
9810 /// let x = Cluster::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
9811 /// ```
9812 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
9813 where
9814 T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
9815 {
9816 self.encryption_config = v.map(|x| x.into());
9817 self
9818 }
9819
9820 /// Sets the value of [config][crate::model::Cluster::config].
9821 ///
9822 /// Note that all the setters affecting `config` are mutually
9823 /// exclusive.
9824 ///
9825 /// # Example
9826 /// ```ignore,no_run
9827 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9828 /// use google_cloud_bigtable_admin_v2::model::cluster::ClusterConfig;
9829 /// let x = Cluster::new().set_config(Some(
9830 /// google_cloud_bigtable_admin_v2::model::cluster::Config::ClusterConfig(ClusterConfig::default().into())));
9831 /// ```
9832 pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::cluster::Config>>>(
9833 mut self,
9834 v: T,
9835 ) -> Self {
9836 self.config = v.into();
9837 self
9838 }
9839
9840 /// The value of [config][crate::model::Cluster::config]
9841 /// if it holds a `ClusterConfig`, `None` if the field is not set or
9842 /// holds a different branch.
9843 pub fn cluster_config(
9844 &self,
9845 ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::ClusterConfig>> {
9846 #[allow(unreachable_patterns)]
9847 self.config.as_ref().and_then(|v| match v {
9848 crate::model::cluster::Config::ClusterConfig(v) => std::option::Option::Some(v),
9849 _ => std::option::Option::None,
9850 })
9851 }
9852
9853 /// Sets the value of [config][crate::model::Cluster::config]
9854 /// to hold a `ClusterConfig`.
9855 ///
9856 /// Note that all the setters affecting `config` are
9857 /// mutually exclusive.
9858 ///
9859 /// # Example
9860 /// ```ignore,no_run
9861 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
9862 /// use google_cloud_bigtable_admin_v2::model::cluster::ClusterConfig;
9863 /// let x = Cluster::new().set_cluster_config(ClusterConfig::default()/* use setters */);
9864 /// assert!(x.cluster_config().is_some());
9865 /// ```
9866 pub fn set_cluster_config<
9867 T: std::convert::Into<std::boxed::Box<crate::model::cluster::ClusterConfig>>,
9868 >(
9869 mut self,
9870 v: T,
9871 ) -> Self {
9872 self.config =
9873 std::option::Option::Some(crate::model::cluster::Config::ClusterConfig(v.into()));
9874 self
9875 }
9876}
9877
9878impl wkt::message::Message for Cluster {
9879 fn typename() -> &'static str {
9880 "type.googleapis.com/google.bigtable.admin.v2.Cluster"
9881 }
9882}
9883
9884/// Defines additional types related to [Cluster].
9885pub mod cluster {
9886 #[allow(unused_imports)]
9887 use super::*;
9888
9889 /// Autoscaling config for a cluster.
9890 #[derive(Clone, Default, PartialEq)]
9891 #[non_exhaustive]
9892 pub struct ClusterAutoscalingConfig {
9893 /// Required. Autoscaling limits for this cluster.
9894 pub autoscaling_limits: std::option::Option<crate::model::AutoscalingLimits>,
9895
9896 /// Required. Autoscaling targets for this cluster.
9897 pub autoscaling_targets: std::option::Option<crate::model::AutoscalingTargets>,
9898
9899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9900 }
9901
9902 impl ClusterAutoscalingConfig {
9903 pub fn new() -> Self {
9904 std::default::Default::default()
9905 }
9906
9907 /// Sets the value of [autoscaling_limits][crate::model::cluster::ClusterAutoscalingConfig::autoscaling_limits].
9908 ///
9909 /// # Example
9910 /// ```ignore,no_run
9911 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
9912 /// use google_cloud_bigtable_admin_v2::model::AutoscalingLimits;
9913 /// let x = ClusterAutoscalingConfig::new().set_autoscaling_limits(AutoscalingLimits::default()/* use setters */);
9914 /// ```
9915 pub fn set_autoscaling_limits<T>(mut self, v: T) -> Self
9916 where
9917 T: std::convert::Into<crate::model::AutoscalingLimits>,
9918 {
9919 self.autoscaling_limits = std::option::Option::Some(v.into());
9920 self
9921 }
9922
9923 /// Sets or clears the value of [autoscaling_limits][crate::model::cluster::ClusterAutoscalingConfig::autoscaling_limits].
9924 ///
9925 /// # Example
9926 /// ```ignore,no_run
9927 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
9928 /// use google_cloud_bigtable_admin_v2::model::AutoscalingLimits;
9929 /// let x = ClusterAutoscalingConfig::new().set_or_clear_autoscaling_limits(Some(AutoscalingLimits::default()/* use setters */));
9930 /// let x = ClusterAutoscalingConfig::new().set_or_clear_autoscaling_limits(None::<AutoscalingLimits>);
9931 /// ```
9932 pub fn set_or_clear_autoscaling_limits<T>(mut self, v: std::option::Option<T>) -> Self
9933 where
9934 T: std::convert::Into<crate::model::AutoscalingLimits>,
9935 {
9936 self.autoscaling_limits = v.map(|x| x.into());
9937 self
9938 }
9939
9940 /// Sets the value of [autoscaling_targets][crate::model::cluster::ClusterAutoscalingConfig::autoscaling_targets].
9941 ///
9942 /// # Example
9943 /// ```ignore,no_run
9944 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
9945 /// use google_cloud_bigtable_admin_v2::model::AutoscalingTargets;
9946 /// let x = ClusterAutoscalingConfig::new().set_autoscaling_targets(AutoscalingTargets::default()/* use setters */);
9947 /// ```
9948 pub fn set_autoscaling_targets<T>(mut self, v: T) -> Self
9949 where
9950 T: std::convert::Into<crate::model::AutoscalingTargets>,
9951 {
9952 self.autoscaling_targets = std::option::Option::Some(v.into());
9953 self
9954 }
9955
9956 /// Sets or clears the value of [autoscaling_targets][crate::model::cluster::ClusterAutoscalingConfig::autoscaling_targets].
9957 ///
9958 /// # Example
9959 /// ```ignore,no_run
9960 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
9961 /// use google_cloud_bigtable_admin_v2::model::AutoscalingTargets;
9962 /// let x = ClusterAutoscalingConfig::new().set_or_clear_autoscaling_targets(Some(AutoscalingTargets::default()/* use setters */));
9963 /// let x = ClusterAutoscalingConfig::new().set_or_clear_autoscaling_targets(None::<AutoscalingTargets>);
9964 /// ```
9965 pub fn set_or_clear_autoscaling_targets<T>(mut self, v: std::option::Option<T>) -> Self
9966 where
9967 T: std::convert::Into<crate::model::AutoscalingTargets>,
9968 {
9969 self.autoscaling_targets = v.map(|x| x.into());
9970 self
9971 }
9972 }
9973
9974 impl wkt::message::Message for ClusterAutoscalingConfig {
9975 fn typename() -> &'static str {
9976 "type.googleapis.com/google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig"
9977 }
9978 }
9979
9980 /// Configuration for a cluster.
9981 #[derive(Clone, Default, PartialEq)]
9982 #[non_exhaustive]
9983 pub struct ClusterConfig {
9984 /// Autoscaling configuration for this cluster.
9985 pub cluster_autoscaling_config:
9986 std::option::Option<crate::model::cluster::ClusterAutoscalingConfig>,
9987
9988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9989 }
9990
9991 impl ClusterConfig {
9992 pub fn new() -> Self {
9993 std::default::Default::default()
9994 }
9995
9996 /// Sets the value of [cluster_autoscaling_config][crate::model::cluster::ClusterConfig::cluster_autoscaling_config].
9997 ///
9998 /// # Example
9999 /// ```ignore,no_run
10000 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterConfig;
10001 /// use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
10002 /// let x = ClusterConfig::new().set_cluster_autoscaling_config(ClusterAutoscalingConfig::default()/* use setters */);
10003 /// ```
10004 pub fn set_cluster_autoscaling_config<T>(mut self, v: T) -> Self
10005 where
10006 T: std::convert::Into<crate::model::cluster::ClusterAutoscalingConfig>,
10007 {
10008 self.cluster_autoscaling_config = std::option::Option::Some(v.into());
10009 self
10010 }
10011
10012 /// Sets or clears the value of [cluster_autoscaling_config][crate::model::cluster::ClusterConfig::cluster_autoscaling_config].
10013 ///
10014 /// # Example
10015 /// ```ignore,no_run
10016 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterConfig;
10017 /// use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
10018 /// let x = ClusterConfig::new().set_or_clear_cluster_autoscaling_config(Some(ClusterAutoscalingConfig::default()/* use setters */));
10019 /// let x = ClusterConfig::new().set_or_clear_cluster_autoscaling_config(None::<ClusterAutoscalingConfig>);
10020 /// ```
10021 pub fn set_or_clear_cluster_autoscaling_config<T>(
10022 mut self,
10023 v: std::option::Option<T>,
10024 ) -> Self
10025 where
10026 T: std::convert::Into<crate::model::cluster::ClusterAutoscalingConfig>,
10027 {
10028 self.cluster_autoscaling_config = v.map(|x| x.into());
10029 self
10030 }
10031 }
10032
10033 impl wkt::message::Message for ClusterConfig {
10034 fn typename() -> &'static str {
10035 "type.googleapis.com/google.bigtable.admin.v2.Cluster.ClusterConfig"
10036 }
10037 }
10038
10039 /// Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
10040 /// cluster.
10041 #[derive(Clone, Default, PartialEq)]
10042 #[non_exhaustive]
10043 pub struct EncryptionConfig {
10044 /// Describes the Cloud KMS encryption key that will be used to protect the
10045 /// destination Bigtable cluster. The requirements for this key are:
10046 ///
10047 /// 1. The Cloud Bigtable service account associated with the project that
10048 /// contains this cluster must be granted the
10049 /// `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
10050 /// 1. Only regional keys can be used and the region of the CMEK key must
10051 /// match the region of the cluster.
10052 /// Values are of the form
10053 /// `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
10054 pub kms_key_name: std::string::String,
10055
10056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10057 }
10058
10059 impl EncryptionConfig {
10060 pub fn new() -> Self {
10061 std::default::Default::default()
10062 }
10063
10064 /// Sets the value of [kms_key_name][crate::model::cluster::EncryptionConfig::kms_key_name].
10065 ///
10066 /// # Example
10067 /// ```ignore,no_run
10068 /// # use google_cloud_bigtable_admin_v2::model::cluster::EncryptionConfig;
10069 /// let x = EncryptionConfig::new().set_kms_key_name("example");
10070 /// ```
10071 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
10072 mut self,
10073 v: T,
10074 ) -> Self {
10075 self.kms_key_name = v.into();
10076 self
10077 }
10078 }
10079
10080 impl wkt::message::Message for EncryptionConfig {
10081 fn typename() -> &'static str {
10082 "type.googleapis.com/google.bigtable.admin.v2.Cluster.EncryptionConfig"
10083 }
10084 }
10085
10086 /// Possible states of a cluster.
10087 ///
10088 /// # Working with unknown values
10089 ///
10090 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10091 /// additional enum variants at any time. Adding new variants is not considered
10092 /// a breaking change. Applications should write their code in anticipation of:
10093 ///
10094 /// - New values appearing in future releases of the client library, **and**
10095 /// - New values received dynamically, without application changes.
10096 ///
10097 /// Please consult the [Working with enums] section in the user guide for some
10098 /// guidelines.
10099 ///
10100 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10101 #[derive(Clone, Debug, PartialEq)]
10102 #[non_exhaustive]
10103 pub enum State {
10104 /// The state of the cluster could not be determined.
10105 NotKnown,
10106 /// The cluster has been successfully created and is ready to serve requests.
10107 Ready,
10108 /// The cluster is currently being created, and may be destroyed
10109 /// if the creation process encounters an error.
10110 /// A cluster may not be able to serve requests while being created.
10111 Creating,
10112 /// The cluster is currently being resized, and may revert to its previous
10113 /// node count if the process encounters an error.
10114 /// A cluster is still capable of serving requests while being resized,
10115 /// but may exhibit performance as if its number of allocated nodes is
10116 /// between the starting and requested states.
10117 Resizing,
10118 /// The cluster has no backing nodes. The data (tables) still
10119 /// exist, but no operations can be performed on the cluster.
10120 Disabled,
10121 /// If set, the enum was initialized with an unknown value.
10122 ///
10123 /// Applications can examine the value using [State::value] or
10124 /// [State::name].
10125 UnknownValue(state::UnknownValue),
10126 }
10127
10128 #[doc(hidden)]
10129 pub mod state {
10130 #[allow(unused_imports)]
10131 use super::*;
10132 #[derive(Clone, Debug, PartialEq)]
10133 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10134 }
10135
10136 impl State {
10137 /// Gets the enum value.
10138 ///
10139 /// Returns `None` if the enum contains an unknown value deserialized from
10140 /// the string representation of enums.
10141 pub fn value(&self) -> std::option::Option<i32> {
10142 match self {
10143 Self::NotKnown => std::option::Option::Some(0),
10144 Self::Ready => std::option::Option::Some(1),
10145 Self::Creating => std::option::Option::Some(2),
10146 Self::Resizing => std::option::Option::Some(3),
10147 Self::Disabled => std::option::Option::Some(4),
10148 Self::UnknownValue(u) => u.0.value(),
10149 }
10150 }
10151
10152 /// Gets the enum value as a string.
10153 ///
10154 /// Returns `None` if the enum contains an unknown value deserialized from
10155 /// the integer representation of enums.
10156 pub fn name(&self) -> std::option::Option<&str> {
10157 match self {
10158 Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
10159 Self::Ready => std::option::Option::Some("READY"),
10160 Self::Creating => std::option::Option::Some("CREATING"),
10161 Self::Resizing => std::option::Option::Some("RESIZING"),
10162 Self::Disabled => std::option::Option::Some("DISABLED"),
10163 Self::UnknownValue(u) => u.0.name(),
10164 }
10165 }
10166 }
10167
10168 impl std::default::Default for State {
10169 fn default() -> Self {
10170 use std::convert::From;
10171 Self::from(0)
10172 }
10173 }
10174
10175 impl std::fmt::Display for State {
10176 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10177 wkt::internal::display_enum(f, self.name(), self.value())
10178 }
10179 }
10180
10181 impl std::convert::From<i32> for State {
10182 fn from(value: i32) -> Self {
10183 match value {
10184 0 => Self::NotKnown,
10185 1 => Self::Ready,
10186 2 => Self::Creating,
10187 3 => Self::Resizing,
10188 4 => Self::Disabled,
10189 _ => Self::UnknownValue(state::UnknownValue(
10190 wkt::internal::UnknownEnumValue::Integer(value),
10191 )),
10192 }
10193 }
10194 }
10195
10196 impl std::convert::From<&str> for State {
10197 fn from(value: &str) -> Self {
10198 use std::string::ToString;
10199 match value {
10200 "STATE_NOT_KNOWN" => Self::NotKnown,
10201 "READY" => Self::Ready,
10202 "CREATING" => Self::Creating,
10203 "RESIZING" => Self::Resizing,
10204 "DISABLED" => Self::Disabled,
10205 _ => Self::UnknownValue(state::UnknownValue(
10206 wkt::internal::UnknownEnumValue::String(value.to_string()),
10207 )),
10208 }
10209 }
10210 }
10211
10212 impl serde::ser::Serialize for State {
10213 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10214 where
10215 S: serde::Serializer,
10216 {
10217 match self {
10218 Self::NotKnown => serializer.serialize_i32(0),
10219 Self::Ready => serializer.serialize_i32(1),
10220 Self::Creating => serializer.serialize_i32(2),
10221 Self::Resizing => serializer.serialize_i32(3),
10222 Self::Disabled => serializer.serialize_i32(4),
10223 Self::UnknownValue(u) => u.0.serialize(serializer),
10224 }
10225 }
10226 }
10227
10228 impl<'de> serde::de::Deserialize<'de> for State {
10229 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10230 where
10231 D: serde::Deserializer<'de>,
10232 {
10233 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10234 ".google.bigtable.admin.v2.Cluster.State",
10235 ))
10236 }
10237 }
10238
10239 /// Possible node scaling factors of the clusters. Node scaling delivers better
10240 /// latency and more throughput by removing node boundaries.
10241 ///
10242 /// # Working with unknown values
10243 ///
10244 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10245 /// additional enum variants at any time. Adding new variants is not considered
10246 /// a breaking change. Applications should write their code in anticipation of:
10247 ///
10248 /// - New values appearing in future releases of the client library, **and**
10249 /// - New values received dynamically, without application changes.
10250 ///
10251 /// Please consult the [Working with enums] section in the user guide for some
10252 /// guidelines.
10253 ///
10254 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10255 #[derive(Clone, Debug, PartialEq)]
10256 #[non_exhaustive]
10257 pub enum NodeScalingFactor {
10258 /// No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X.
10259 Unspecified,
10260 /// The cluster is running with a scaling factor of 1.
10261 NodeScalingFactor1X,
10262 /// The cluster is running with a scaling factor of 2.
10263 /// All node count values must be in increments of 2 with this scaling factor
10264 /// enabled, otherwise an INVALID_ARGUMENT error will be returned.
10265 NodeScalingFactor2X,
10266 /// If set, the enum was initialized with an unknown value.
10267 ///
10268 /// Applications can examine the value using [NodeScalingFactor::value] or
10269 /// [NodeScalingFactor::name].
10270 UnknownValue(node_scaling_factor::UnknownValue),
10271 }
10272
10273 #[doc(hidden)]
10274 pub mod node_scaling_factor {
10275 #[allow(unused_imports)]
10276 use super::*;
10277 #[derive(Clone, Debug, PartialEq)]
10278 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10279 }
10280
10281 impl NodeScalingFactor {
10282 /// Gets the enum value.
10283 ///
10284 /// Returns `None` if the enum contains an unknown value deserialized from
10285 /// the string representation of enums.
10286 pub fn value(&self) -> std::option::Option<i32> {
10287 match self {
10288 Self::Unspecified => std::option::Option::Some(0),
10289 Self::NodeScalingFactor1X => std::option::Option::Some(1),
10290 Self::NodeScalingFactor2X => std::option::Option::Some(2),
10291 Self::UnknownValue(u) => u.0.value(),
10292 }
10293 }
10294
10295 /// Gets the enum value as a string.
10296 ///
10297 /// Returns `None` if the enum contains an unknown value deserialized from
10298 /// the integer representation of enums.
10299 pub fn name(&self) -> std::option::Option<&str> {
10300 match self {
10301 Self::Unspecified => std::option::Option::Some("NODE_SCALING_FACTOR_UNSPECIFIED"),
10302 Self::NodeScalingFactor1X => std::option::Option::Some("NODE_SCALING_FACTOR_1X"),
10303 Self::NodeScalingFactor2X => std::option::Option::Some("NODE_SCALING_FACTOR_2X"),
10304 Self::UnknownValue(u) => u.0.name(),
10305 }
10306 }
10307 }
10308
10309 impl std::default::Default for NodeScalingFactor {
10310 fn default() -> Self {
10311 use std::convert::From;
10312 Self::from(0)
10313 }
10314 }
10315
10316 impl std::fmt::Display for NodeScalingFactor {
10317 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10318 wkt::internal::display_enum(f, self.name(), self.value())
10319 }
10320 }
10321
10322 impl std::convert::From<i32> for NodeScalingFactor {
10323 fn from(value: i32) -> Self {
10324 match value {
10325 0 => Self::Unspecified,
10326 1 => Self::NodeScalingFactor1X,
10327 2 => Self::NodeScalingFactor2X,
10328 _ => Self::UnknownValue(node_scaling_factor::UnknownValue(
10329 wkt::internal::UnknownEnumValue::Integer(value),
10330 )),
10331 }
10332 }
10333 }
10334
10335 impl std::convert::From<&str> for NodeScalingFactor {
10336 fn from(value: &str) -> Self {
10337 use std::string::ToString;
10338 match value {
10339 "NODE_SCALING_FACTOR_UNSPECIFIED" => Self::Unspecified,
10340 "NODE_SCALING_FACTOR_1X" => Self::NodeScalingFactor1X,
10341 "NODE_SCALING_FACTOR_2X" => Self::NodeScalingFactor2X,
10342 _ => Self::UnknownValue(node_scaling_factor::UnknownValue(
10343 wkt::internal::UnknownEnumValue::String(value.to_string()),
10344 )),
10345 }
10346 }
10347 }
10348
10349 impl serde::ser::Serialize for NodeScalingFactor {
10350 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10351 where
10352 S: serde::Serializer,
10353 {
10354 match self {
10355 Self::Unspecified => serializer.serialize_i32(0),
10356 Self::NodeScalingFactor1X => serializer.serialize_i32(1),
10357 Self::NodeScalingFactor2X => serializer.serialize_i32(2),
10358 Self::UnknownValue(u) => u.0.serialize(serializer),
10359 }
10360 }
10361 }
10362
10363 impl<'de> serde::de::Deserialize<'de> for NodeScalingFactor {
10364 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10365 where
10366 D: serde::Deserializer<'de>,
10367 {
10368 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeScalingFactor>::new(
10369 ".google.bigtable.admin.v2.Cluster.NodeScalingFactor",
10370 ))
10371 }
10372 }
10373
10374 #[derive(Clone, Debug, PartialEq)]
10375 #[non_exhaustive]
10376 pub enum Config {
10377 /// Configuration for this cluster.
10378 ClusterConfig(std::boxed::Box<crate::model::cluster::ClusterConfig>),
10379 }
10380}
10381
10382/// A configuration object describing how Cloud Bigtable should treat traffic
10383/// from a particular end user application.
10384#[derive(Clone, Default, PartialEq)]
10385#[non_exhaustive]
10386pub struct AppProfile {
10387 /// The unique name of the app profile. Values are of the form
10388 /// `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
10389 pub name: std::string::String,
10390
10391 /// Strongly validated etag for optimistic concurrency control. Preserve the
10392 /// value returned from `GetAppProfile` when calling `UpdateAppProfile` to
10393 /// fail the request if there has been a modification in the mean time. The
10394 /// `update_mask` of the request need not include `etag` for this protection
10395 /// to apply.
10396 /// See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
10397 /// [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
10398 /// details.
10399 pub etag: std::string::String,
10400
10401 /// Long form description of the use case for this AppProfile.
10402 pub description: std::string::String,
10403
10404 /// The routing policy for all read/write requests that use this app profile.
10405 /// A value must be explicitly set.
10406 pub routing_policy: std::option::Option<crate::model::app_profile::RoutingPolicy>,
10407
10408 /// Options for isolating this app profile's traffic from other use cases.
10409 pub isolation: std::option::Option<crate::model::app_profile::Isolation>,
10410
10411 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10412}
10413
10414impl AppProfile {
10415 pub fn new() -> Self {
10416 std::default::Default::default()
10417 }
10418
10419 /// Sets the value of [name][crate::model::AppProfile::name].
10420 ///
10421 /// # Example
10422 /// ```ignore,no_run
10423 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10424 /// let x = AppProfile::new().set_name("example");
10425 /// ```
10426 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10427 self.name = v.into();
10428 self
10429 }
10430
10431 /// Sets the value of [etag][crate::model::AppProfile::etag].
10432 ///
10433 /// # Example
10434 /// ```ignore,no_run
10435 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10436 /// let x = AppProfile::new().set_etag("example");
10437 /// ```
10438 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10439 self.etag = v.into();
10440 self
10441 }
10442
10443 /// Sets the value of [description][crate::model::AppProfile::description].
10444 ///
10445 /// # Example
10446 /// ```ignore,no_run
10447 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10448 /// let x = AppProfile::new().set_description("example");
10449 /// ```
10450 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10451 self.description = v.into();
10452 self
10453 }
10454
10455 /// Sets the value of [routing_policy][crate::model::AppProfile::routing_policy].
10456 ///
10457 /// Note that all the setters affecting `routing_policy` are mutually
10458 /// exclusive.
10459 ///
10460 /// # Example
10461 /// ```ignore,no_run
10462 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10463 /// use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
10464 /// let x = AppProfile::new().set_routing_policy(Some(
10465 /// google_cloud_bigtable_admin_v2::model::app_profile::RoutingPolicy::MultiClusterRoutingUseAny(MultiClusterRoutingUseAny::default().into())));
10466 /// ```
10467 pub fn set_routing_policy<
10468 T: std::convert::Into<std::option::Option<crate::model::app_profile::RoutingPolicy>>,
10469 >(
10470 mut self,
10471 v: T,
10472 ) -> Self {
10473 self.routing_policy = v.into();
10474 self
10475 }
10476
10477 /// The value of [routing_policy][crate::model::AppProfile::routing_policy]
10478 /// if it holds a `MultiClusterRoutingUseAny`, `None` if the field is not set or
10479 /// holds a different branch.
10480 pub fn multi_cluster_routing_use_any(
10481 &self,
10482 ) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>>
10483 {
10484 #[allow(unreachable_patterns)]
10485 self.routing_policy.as_ref().and_then(|v| match v {
10486 crate::model::app_profile::RoutingPolicy::MultiClusterRoutingUseAny(v) => {
10487 std::option::Option::Some(v)
10488 }
10489 _ => std::option::Option::None,
10490 })
10491 }
10492
10493 /// Sets the value of [routing_policy][crate::model::AppProfile::routing_policy]
10494 /// to hold a `MultiClusterRoutingUseAny`.
10495 ///
10496 /// Note that all the setters affecting `routing_policy` are
10497 /// mutually exclusive.
10498 ///
10499 /// # Example
10500 /// ```ignore,no_run
10501 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10502 /// use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
10503 /// let x = AppProfile::new().set_multi_cluster_routing_use_any(MultiClusterRoutingUseAny::default()/* use setters */);
10504 /// assert!(x.multi_cluster_routing_use_any().is_some());
10505 /// assert!(x.single_cluster_routing().is_none());
10506 /// ```
10507 pub fn set_multi_cluster_routing_use_any<
10508 T: std::convert::Into<std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>>,
10509 >(
10510 mut self,
10511 v: T,
10512 ) -> Self {
10513 self.routing_policy = std::option::Option::Some(
10514 crate::model::app_profile::RoutingPolicy::MultiClusterRoutingUseAny(v.into()),
10515 );
10516 self
10517 }
10518
10519 /// The value of [routing_policy][crate::model::AppProfile::routing_policy]
10520 /// if it holds a `SingleClusterRouting`, `None` if the field is not set or
10521 /// holds a different branch.
10522 pub fn single_cluster_routing(
10523 &self,
10524 ) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::SingleClusterRouting>>
10525 {
10526 #[allow(unreachable_patterns)]
10527 self.routing_policy.as_ref().and_then(|v| match v {
10528 crate::model::app_profile::RoutingPolicy::SingleClusterRouting(v) => {
10529 std::option::Option::Some(v)
10530 }
10531 _ => std::option::Option::None,
10532 })
10533 }
10534
10535 /// Sets the value of [routing_policy][crate::model::AppProfile::routing_policy]
10536 /// to hold a `SingleClusterRouting`.
10537 ///
10538 /// Note that all the setters affecting `routing_policy` are
10539 /// mutually exclusive.
10540 ///
10541 /// # Example
10542 /// ```ignore,no_run
10543 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10544 /// use google_cloud_bigtable_admin_v2::model::app_profile::SingleClusterRouting;
10545 /// let x = AppProfile::new().set_single_cluster_routing(SingleClusterRouting::default()/* use setters */);
10546 /// assert!(x.single_cluster_routing().is_some());
10547 /// assert!(x.multi_cluster_routing_use_any().is_none());
10548 /// ```
10549 pub fn set_single_cluster_routing<
10550 T: std::convert::Into<std::boxed::Box<crate::model::app_profile::SingleClusterRouting>>,
10551 >(
10552 mut self,
10553 v: T,
10554 ) -> Self {
10555 self.routing_policy = std::option::Option::Some(
10556 crate::model::app_profile::RoutingPolicy::SingleClusterRouting(v.into()),
10557 );
10558 self
10559 }
10560
10561 /// Sets the value of [isolation][crate::model::AppProfile::isolation].
10562 ///
10563 /// Note that all the setters affecting `isolation` are mutually
10564 /// exclusive.
10565 ///
10566 /// # Example
10567 /// ```ignore,no_run
10568 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10569 /// use google_cloud_bigtable_admin_v2::model::app_profile::StandardIsolation;
10570 /// let x = AppProfile::new().set_isolation(Some(
10571 /// google_cloud_bigtable_admin_v2::model::app_profile::Isolation::StandardIsolation(StandardIsolation::default().into())));
10572 /// ```
10573 pub fn set_isolation<
10574 T: std::convert::Into<std::option::Option<crate::model::app_profile::Isolation>>,
10575 >(
10576 mut self,
10577 v: T,
10578 ) -> Self {
10579 self.isolation = v.into();
10580 self
10581 }
10582
10583 /// The value of [isolation][crate::model::AppProfile::isolation]
10584 /// if it holds a `Priority`, `None` if the field is not set or
10585 /// holds a different branch.
10586 #[deprecated]
10587 pub fn priority(&self) -> std::option::Option<&crate::model::app_profile::Priority> {
10588 #[allow(unreachable_patterns)]
10589 self.isolation.as_ref().and_then(|v| match v {
10590 crate::model::app_profile::Isolation::Priority(v) => std::option::Option::Some(v),
10591 _ => std::option::Option::None,
10592 })
10593 }
10594
10595 /// Sets the value of [isolation][crate::model::AppProfile::isolation]
10596 /// to hold a `Priority`.
10597 ///
10598 /// Note that all the setters affecting `isolation` are
10599 /// mutually exclusive.
10600 ///
10601 /// # Example
10602 /// ```ignore,no_run
10603 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10604 /// use google_cloud_bigtable_admin_v2::model::app_profile::Priority;
10605 /// let x0 = AppProfile::new().set_priority(Priority::Low);
10606 /// let x1 = AppProfile::new().set_priority(Priority::Medium);
10607 /// let x2 = AppProfile::new().set_priority(Priority::High);
10608 /// assert!(x0.priority().is_some());
10609 /// assert!(x0.standard_isolation().is_none());
10610 /// assert!(x0.data_boost_isolation_read_only().is_none());
10611 /// assert!(x1.priority().is_some());
10612 /// assert!(x1.standard_isolation().is_none());
10613 /// assert!(x1.data_boost_isolation_read_only().is_none());
10614 /// assert!(x2.priority().is_some());
10615 /// assert!(x2.standard_isolation().is_none());
10616 /// assert!(x2.data_boost_isolation_read_only().is_none());
10617 /// ```
10618 #[deprecated]
10619 pub fn set_priority<T: std::convert::Into<crate::model::app_profile::Priority>>(
10620 mut self,
10621 v: T,
10622 ) -> Self {
10623 self.isolation =
10624 std::option::Option::Some(crate::model::app_profile::Isolation::Priority(v.into()));
10625 self
10626 }
10627
10628 /// The value of [isolation][crate::model::AppProfile::isolation]
10629 /// if it holds a `StandardIsolation`, `None` if the field is not set or
10630 /// holds a different branch.
10631 pub fn standard_isolation(
10632 &self,
10633 ) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::StandardIsolation>> {
10634 #[allow(unreachable_patterns)]
10635 self.isolation.as_ref().and_then(|v| match v {
10636 crate::model::app_profile::Isolation::StandardIsolation(v) => {
10637 std::option::Option::Some(v)
10638 }
10639 _ => std::option::Option::None,
10640 })
10641 }
10642
10643 /// Sets the value of [isolation][crate::model::AppProfile::isolation]
10644 /// to hold a `StandardIsolation`.
10645 ///
10646 /// Note that all the setters affecting `isolation` are
10647 /// mutually exclusive.
10648 ///
10649 /// # Example
10650 /// ```ignore,no_run
10651 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10652 /// use google_cloud_bigtable_admin_v2::model::app_profile::StandardIsolation;
10653 /// let x = AppProfile::new().set_standard_isolation(StandardIsolation::default()/* use setters */);
10654 /// assert!(x.standard_isolation().is_some());
10655 /// assert!(x.priority().is_none());
10656 /// assert!(x.data_boost_isolation_read_only().is_none());
10657 /// ```
10658 pub fn set_standard_isolation<
10659 T: std::convert::Into<std::boxed::Box<crate::model::app_profile::StandardIsolation>>,
10660 >(
10661 mut self,
10662 v: T,
10663 ) -> Self {
10664 self.isolation = std::option::Option::Some(
10665 crate::model::app_profile::Isolation::StandardIsolation(v.into()),
10666 );
10667 self
10668 }
10669
10670 /// The value of [isolation][crate::model::AppProfile::isolation]
10671 /// if it holds a `DataBoostIsolationReadOnly`, `None` if the field is not set or
10672 /// holds a different branch.
10673 pub fn data_boost_isolation_read_only(
10674 &self,
10675 ) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>>
10676 {
10677 #[allow(unreachable_patterns)]
10678 self.isolation.as_ref().and_then(|v| match v {
10679 crate::model::app_profile::Isolation::DataBoostIsolationReadOnly(v) => {
10680 std::option::Option::Some(v)
10681 }
10682 _ => std::option::Option::None,
10683 })
10684 }
10685
10686 /// Sets the value of [isolation][crate::model::AppProfile::isolation]
10687 /// to hold a `DataBoostIsolationReadOnly`.
10688 ///
10689 /// Note that all the setters affecting `isolation` are
10690 /// mutually exclusive.
10691 ///
10692 /// # Example
10693 /// ```ignore,no_run
10694 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
10695 /// use google_cloud_bigtable_admin_v2::model::app_profile::DataBoostIsolationReadOnly;
10696 /// let x = AppProfile::new().set_data_boost_isolation_read_only(DataBoostIsolationReadOnly::default()/* use setters */);
10697 /// assert!(x.data_boost_isolation_read_only().is_some());
10698 /// assert!(x.priority().is_none());
10699 /// assert!(x.standard_isolation().is_none());
10700 /// ```
10701 pub fn set_data_boost_isolation_read_only<
10702 T: std::convert::Into<std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>>,
10703 >(
10704 mut self,
10705 v: T,
10706 ) -> Self {
10707 self.isolation = std::option::Option::Some(
10708 crate::model::app_profile::Isolation::DataBoostIsolationReadOnly(v.into()),
10709 );
10710 self
10711 }
10712}
10713
10714impl wkt::message::Message for AppProfile {
10715 fn typename() -> &'static str {
10716 "type.googleapis.com/google.bigtable.admin.v2.AppProfile"
10717 }
10718}
10719
10720/// Defines additional types related to [AppProfile].
10721pub mod app_profile {
10722 #[allow(unused_imports)]
10723 use super::*;
10724
10725 /// Read/write requests are routed to the nearest cluster in the instance, and
10726 /// will fail over to the nearest cluster that is available in the event of
10727 /// transient errors or delays. Clusters in a region are considered
10728 /// equidistant. Choosing this option sacrifices read-your-writes consistency
10729 /// to improve availability.
10730 #[derive(Clone, Default, PartialEq)]
10731 #[non_exhaustive]
10732 pub struct MultiClusterRoutingUseAny {
10733 /// The set of clusters to route to. The order is ignored; clusters will be
10734 /// tried in order of distance. If left empty, all clusters are eligible.
10735 pub cluster_ids: std::vec::Vec<std::string::String>,
10736
10737 /// Possible algorithms for routing affinity. If enabled, Bigtable will
10738 /// route between equidistant clusters in a deterministic order rather than
10739 /// choosing randomly.
10740 ///
10741 /// This mechanism gives read-your-writes consistency for *most* requests
10742 /// under *most* circumstances, without sacrificing availability. Consistency
10743 /// is *not* guaranteed, as requests might still fail over between clusters
10744 /// in the event of errors or latency.
10745 pub affinity:
10746 std::option::Option<crate::model::app_profile::multi_cluster_routing_use_any::Affinity>,
10747
10748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10749 }
10750
10751 impl MultiClusterRoutingUseAny {
10752 pub fn new() -> Self {
10753 std::default::Default::default()
10754 }
10755
10756 /// Sets the value of [cluster_ids][crate::model::app_profile::MultiClusterRoutingUseAny::cluster_ids].
10757 ///
10758 /// # Example
10759 /// ```ignore,no_run
10760 /// # use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
10761 /// let x = MultiClusterRoutingUseAny::new().set_cluster_ids(["a", "b", "c"]);
10762 /// ```
10763 pub fn set_cluster_ids<T, V>(mut self, v: T) -> Self
10764 where
10765 T: std::iter::IntoIterator<Item = V>,
10766 V: std::convert::Into<std::string::String>,
10767 {
10768 use std::iter::Iterator;
10769 self.cluster_ids = v.into_iter().map(|i| i.into()).collect();
10770 self
10771 }
10772
10773 /// Sets the value of [affinity][crate::model::app_profile::MultiClusterRoutingUseAny::affinity].
10774 ///
10775 /// Note that all the setters affecting `affinity` are mutually
10776 /// exclusive.
10777 ///
10778 /// # Example
10779 /// ```ignore,no_run
10780 /// # use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
10781 /// use google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::RowAffinity;
10782 /// let x = MultiClusterRoutingUseAny::new().set_affinity(Some(
10783 /// google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(RowAffinity::default().into())));
10784 /// ```
10785 pub fn set_affinity<
10786 T: std::convert::Into<
10787 std::option::Option<
10788 crate::model::app_profile::multi_cluster_routing_use_any::Affinity,
10789 >,
10790 >,
10791 >(
10792 mut self,
10793 v: T,
10794 ) -> Self {
10795 self.affinity = v.into();
10796 self
10797 }
10798
10799 /// The value of [affinity][crate::model::app_profile::MultiClusterRoutingUseAny::affinity]
10800 /// if it holds a `RowAffinity`, `None` if the field is not set or
10801 /// holds a different branch.
10802 pub fn row_affinity(
10803 &self,
10804 ) -> std::option::Option<
10805 &std::boxed::Box<crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity>,
10806 > {
10807 #[allow(unreachable_patterns)]
10808 self.affinity.as_ref().and_then(|v| match v {
10809 crate::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(
10810 v,
10811 ) => std::option::Option::Some(v),
10812 _ => std::option::Option::None,
10813 })
10814 }
10815
10816 /// Sets the value of [affinity][crate::model::app_profile::MultiClusterRoutingUseAny::affinity]
10817 /// to hold a `RowAffinity`.
10818 ///
10819 /// Note that all the setters affecting `affinity` are
10820 /// mutually exclusive.
10821 ///
10822 /// # Example
10823 /// ```ignore,no_run
10824 /// # use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
10825 /// use google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::RowAffinity;
10826 /// let x = MultiClusterRoutingUseAny::new().set_row_affinity(RowAffinity::default()/* use setters */);
10827 /// assert!(x.row_affinity().is_some());
10828 /// ```
10829 pub fn set_row_affinity<
10830 T: std::convert::Into<
10831 std::boxed::Box<
10832 crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity,
10833 >,
10834 >,
10835 >(
10836 mut self,
10837 v: T,
10838 ) -> Self {
10839 self.affinity = std::option::Option::Some(
10840 crate::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(
10841 v.into(),
10842 ),
10843 );
10844 self
10845 }
10846 }
10847
10848 impl wkt::message::Message for MultiClusterRoutingUseAny {
10849 fn typename() -> &'static str {
10850 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny"
10851 }
10852 }
10853
10854 /// Defines additional types related to [MultiClusterRoutingUseAny].
10855 pub mod multi_cluster_routing_use_any {
10856 #[allow(unused_imports)]
10857 use super::*;
10858
10859 /// If enabled, Bigtable will route the request based on the row key of the
10860 /// request, rather than randomly. Instead, each row key will be assigned
10861 /// to a cluster, and will stick to that cluster. If clusters are added or
10862 /// removed, then this may affect which row keys stick to which clusters.
10863 /// To avoid this, users can use a cluster group to specify which clusters
10864 /// are to be used. In this case, new clusters that are not a part of the
10865 /// cluster group will not be routed to, and routing will be unaffected by
10866 /// the new cluster. Moreover, clusters specified in the cluster group cannot
10867 /// be deleted unless removed from the cluster group.
10868 #[derive(Clone, Default, PartialEq)]
10869 #[non_exhaustive]
10870 pub struct RowAffinity {
10871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10872 }
10873
10874 impl RowAffinity {
10875 pub fn new() -> Self {
10876 std::default::Default::default()
10877 }
10878 }
10879
10880 impl wkt::message::Message for RowAffinity {
10881 fn typename() -> &'static str {
10882 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity"
10883 }
10884 }
10885
10886 /// Possible algorithms for routing affinity. If enabled, Bigtable will
10887 /// route between equidistant clusters in a deterministic order rather than
10888 /// choosing randomly.
10889 ///
10890 /// This mechanism gives read-your-writes consistency for *most* requests
10891 /// under *most* circumstances, without sacrificing availability. Consistency
10892 /// is *not* guaranteed, as requests might still fail over between clusters
10893 /// in the event of errors or latency.
10894 #[derive(Clone, Debug, PartialEq)]
10895 #[non_exhaustive]
10896 pub enum Affinity {
10897 /// Row affinity sticky routing based on the row key of the request.
10898 /// Requests that span multiple rows are routed non-deterministically.
10899 RowAffinity(
10900 std::boxed::Box<
10901 crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity,
10902 >,
10903 ),
10904 }
10905 }
10906
10907 /// Unconditionally routes all read/write requests to a specific cluster.
10908 /// This option preserves read-your-writes consistency but does not improve
10909 /// availability.
10910 #[derive(Clone, Default, PartialEq)]
10911 #[non_exhaustive]
10912 pub struct SingleClusterRouting {
10913 /// The cluster to which read/write requests should be routed.
10914 pub cluster_id: std::string::String,
10915
10916 /// Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
10917 /// allowed by this app profile. It is unsafe to send these requests to
10918 /// the same table/row/column in multiple clusters.
10919 pub allow_transactional_writes: bool,
10920
10921 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10922 }
10923
10924 impl SingleClusterRouting {
10925 pub fn new() -> Self {
10926 std::default::Default::default()
10927 }
10928
10929 /// Sets the value of [cluster_id][crate::model::app_profile::SingleClusterRouting::cluster_id].
10930 ///
10931 /// # Example
10932 /// ```ignore,no_run
10933 /// # use google_cloud_bigtable_admin_v2::model::app_profile::SingleClusterRouting;
10934 /// let x = SingleClusterRouting::new().set_cluster_id("example");
10935 /// ```
10936 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10937 self.cluster_id = v.into();
10938 self
10939 }
10940
10941 /// Sets the value of [allow_transactional_writes][crate::model::app_profile::SingleClusterRouting::allow_transactional_writes].
10942 ///
10943 /// # Example
10944 /// ```ignore,no_run
10945 /// # use google_cloud_bigtable_admin_v2::model::app_profile::SingleClusterRouting;
10946 /// let x = SingleClusterRouting::new().set_allow_transactional_writes(true);
10947 /// ```
10948 pub fn set_allow_transactional_writes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10949 self.allow_transactional_writes = v.into();
10950 self
10951 }
10952 }
10953
10954 impl wkt::message::Message for SingleClusterRouting {
10955 fn typename() -> &'static str {
10956 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.SingleClusterRouting"
10957 }
10958 }
10959
10960 /// Standard options for isolating this app profile's traffic from other use
10961 /// cases.
10962 #[derive(Clone, Default, PartialEq)]
10963 #[non_exhaustive]
10964 pub struct StandardIsolation {
10965 /// The priority of requests sent using this app profile.
10966 pub priority: crate::model::app_profile::Priority,
10967
10968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10969 }
10970
10971 impl StandardIsolation {
10972 pub fn new() -> Self {
10973 std::default::Default::default()
10974 }
10975
10976 /// Sets the value of [priority][crate::model::app_profile::StandardIsolation::priority].
10977 ///
10978 /// # Example
10979 /// ```ignore,no_run
10980 /// # use google_cloud_bigtable_admin_v2::model::app_profile::StandardIsolation;
10981 /// use google_cloud_bigtable_admin_v2::model::app_profile::Priority;
10982 /// let x0 = StandardIsolation::new().set_priority(Priority::Low);
10983 /// let x1 = StandardIsolation::new().set_priority(Priority::Medium);
10984 /// let x2 = StandardIsolation::new().set_priority(Priority::High);
10985 /// ```
10986 pub fn set_priority<T: std::convert::Into<crate::model::app_profile::Priority>>(
10987 mut self,
10988 v: T,
10989 ) -> Self {
10990 self.priority = v.into();
10991 self
10992 }
10993 }
10994
10995 impl wkt::message::Message for StandardIsolation {
10996 fn typename() -> &'static str {
10997 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.StandardIsolation"
10998 }
10999 }
11000
11001 /// Data Boost is a serverless compute capability that lets you run
11002 /// high-throughput read jobs and queries on your Bigtable data, without
11003 /// impacting the performance of the clusters that handle your application
11004 /// traffic. Data Boost supports read-only use cases with single-cluster
11005 /// routing.
11006 #[derive(Clone, Default, PartialEq)]
11007 #[non_exhaustive]
11008 pub struct DataBoostIsolationReadOnly {
11009 /// The Compute Billing Owner for this Data Boost App Profile.
11010 pub compute_billing_owner: std::option::Option<
11011 crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
11012 >,
11013
11014 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11015 }
11016
11017 impl DataBoostIsolationReadOnly {
11018 pub fn new() -> Self {
11019 std::default::Default::default()
11020 }
11021
11022 /// Sets the value of [compute_billing_owner][crate::model::app_profile::DataBoostIsolationReadOnly::compute_billing_owner].
11023 ///
11024 /// # Example
11025 /// ```ignore,no_run
11026 /// # use google_cloud_bigtable_admin_v2::model::app_profile::DataBoostIsolationReadOnly;
11027 /// use google_cloud_bigtable_admin_v2::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner;
11028 /// let x0 = DataBoostIsolationReadOnly::new().set_compute_billing_owner(ComputeBillingOwner::HostPays);
11029 /// ```
11030 pub fn set_compute_billing_owner<T>(mut self, v: T) -> Self
11031 where
11032 T: std::convert::Into<
11033 crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
11034 >,
11035 {
11036 self.compute_billing_owner = std::option::Option::Some(v.into());
11037 self
11038 }
11039
11040 /// Sets or clears the value of [compute_billing_owner][crate::model::app_profile::DataBoostIsolationReadOnly::compute_billing_owner].
11041 ///
11042 /// # Example
11043 /// ```ignore,no_run
11044 /// # use google_cloud_bigtable_admin_v2::model::app_profile::DataBoostIsolationReadOnly;
11045 /// use google_cloud_bigtable_admin_v2::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner;
11046 /// let x0 = DataBoostIsolationReadOnly::new().set_or_clear_compute_billing_owner(Some(ComputeBillingOwner::HostPays));
11047 /// let x_none = DataBoostIsolationReadOnly::new().set_or_clear_compute_billing_owner(None::<ComputeBillingOwner>);
11048 /// ```
11049 pub fn set_or_clear_compute_billing_owner<T>(mut self, v: std::option::Option<T>) -> Self
11050 where
11051 T: std::convert::Into<
11052 crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
11053 >,
11054 {
11055 self.compute_billing_owner = v.map(|x| x.into());
11056 self
11057 }
11058 }
11059
11060 impl wkt::message::Message for DataBoostIsolationReadOnly {
11061 fn typename() -> &'static str {
11062 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly"
11063 }
11064 }
11065
11066 /// Defines additional types related to [DataBoostIsolationReadOnly].
11067 pub mod data_boost_isolation_read_only {
11068 #[allow(unused_imports)]
11069 use super::*;
11070
11071 /// Compute Billing Owner specifies how usage should be accounted when using
11072 /// Data Boost. Compute Billing Owner also configures which Cloud Project is
11073 /// charged for relevant quota.
11074 ///
11075 /// # Working with unknown values
11076 ///
11077 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11078 /// additional enum variants at any time. Adding new variants is not considered
11079 /// a breaking change. Applications should write their code in anticipation of:
11080 ///
11081 /// - New values appearing in future releases of the client library, **and**
11082 /// - New values received dynamically, without application changes.
11083 ///
11084 /// Please consult the [Working with enums] section in the user guide for some
11085 /// guidelines.
11086 ///
11087 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11088 #[derive(Clone, Debug, PartialEq)]
11089 #[non_exhaustive]
11090 pub enum ComputeBillingOwner {
11091 /// Unspecified value.
11092 Unspecified,
11093 /// The host Cloud Project containing the targeted Bigtable Instance /
11094 /// Table pays for compute.
11095 HostPays,
11096 /// If set, the enum was initialized with an unknown value.
11097 ///
11098 /// Applications can examine the value using [ComputeBillingOwner::value] or
11099 /// [ComputeBillingOwner::name].
11100 UnknownValue(compute_billing_owner::UnknownValue),
11101 }
11102
11103 #[doc(hidden)]
11104 pub mod compute_billing_owner {
11105 #[allow(unused_imports)]
11106 use super::*;
11107 #[derive(Clone, Debug, PartialEq)]
11108 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11109 }
11110
11111 impl ComputeBillingOwner {
11112 /// Gets the enum value.
11113 ///
11114 /// Returns `None` if the enum contains an unknown value deserialized from
11115 /// the string representation of enums.
11116 pub fn value(&self) -> std::option::Option<i32> {
11117 match self {
11118 Self::Unspecified => std::option::Option::Some(0),
11119 Self::HostPays => std::option::Option::Some(1),
11120 Self::UnknownValue(u) => u.0.value(),
11121 }
11122 }
11123
11124 /// Gets the enum value as a string.
11125 ///
11126 /// Returns `None` if the enum contains an unknown value deserialized from
11127 /// the integer representation of enums.
11128 pub fn name(&self) -> std::option::Option<&str> {
11129 match self {
11130 Self::Unspecified => {
11131 std::option::Option::Some("COMPUTE_BILLING_OWNER_UNSPECIFIED")
11132 }
11133 Self::HostPays => std::option::Option::Some("HOST_PAYS"),
11134 Self::UnknownValue(u) => u.0.name(),
11135 }
11136 }
11137 }
11138
11139 impl std::default::Default for ComputeBillingOwner {
11140 fn default() -> Self {
11141 use std::convert::From;
11142 Self::from(0)
11143 }
11144 }
11145
11146 impl std::fmt::Display for ComputeBillingOwner {
11147 fn fmt(
11148 &self,
11149 f: &mut std::fmt::Formatter<'_>,
11150 ) -> std::result::Result<(), std::fmt::Error> {
11151 wkt::internal::display_enum(f, self.name(), self.value())
11152 }
11153 }
11154
11155 impl std::convert::From<i32> for ComputeBillingOwner {
11156 fn from(value: i32) -> Self {
11157 match value {
11158 0 => Self::Unspecified,
11159 1 => Self::HostPays,
11160 _ => Self::UnknownValue(compute_billing_owner::UnknownValue(
11161 wkt::internal::UnknownEnumValue::Integer(value),
11162 )),
11163 }
11164 }
11165 }
11166
11167 impl std::convert::From<&str> for ComputeBillingOwner {
11168 fn from(value: &str) -> Self {
11169 use std::string::ToString;
11170 match value {
11171 "COMPUTE_BILLING_OWNER_UNSPECIFIED" => Self::Unspecified,
11172 "HOST_PAYS" => Self::HostPays,
11173 _ => Self::UnknownValue(compute_billing_owner::UnknownValue(
11174 wkt::internal::UnknownEnumValue::String(value.to_string()),
11175 )),
11176 }
11177 }
11178 }
11179
11180 impl serde::ser::Serialize for ComputeBillingOwner {
11181 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11182 where
11183 S: serde::Serializer,
11184 {
11185 match self {
11186 Self::Unspecified => serializer.serialize_i32(0),
11187 Self::HostPays => serializer.serialize_i32(1),
11188 Self::UnknownValue(u) => u.0.serialize(serializer),
11189 }
11190 }
11191 }
11192
11193 impl<'de> serde::de::Deserialize<'de> for ComputeBillingOwner {
11194 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11195 where
11196 D: serde::Deserializer<'de>,
11197 {
11198 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeBillingOwner>::new(
11199 ".google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner"))
11200 }
11201 }
11202 }
11203
11204 /// Possible priorities for an app profile. Note that higher priority writes
11205 /// can sometimes queue behind lower priority writes to the same tablet, as
11206 /// writes must be strictly sequenced in the durability log.
11207 ///
11208 /// # Working with unknown values
11209 ///
11210 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11211 /// additional enum variants at any time. Adding new variants is not considered
11212 /// a breaking change. Applications should write their code in anticipation of:
11213 ///
11214 /// - New values appearing in future releases of the client library, **and**
11215 /// - New values received dynamically, without application changes.
11216 ///
11217 /// Please consult the [Working with enums] section in the user guide for some
11218 /// guidelines.
11219 ///
11220 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11221 #[derive(Clone, Debug, PartialEq)]
11222 #[non_exhaustive]
11223 pub enum Priority {
11224 /// Default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation.
11225 Unspecified,
11226 Low,
11227 Medium,
11228 High,
11229 /// If set, the enum was initialized with an unknown value.
11230 ///
11231 /// Applications can examine the value using [Priority::value] or
11232 /// [Priority::name].
11233 UnknownValue(priority::UnknownValue),
11234 }
11235
11236 #[doc(hidden)]
11237 pub mod priority {
11238 #[allow(unused_imports)]
11239 use super::*;
11240 #[derive(Clone, Debug, PartialEq)]
11241 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11242 }
11243
11244 impl Priority {
11245 /// Gets the enum value.
11246 ///
11247 /// Returns `None` if the enum contains an unknown value deserialized from
11248 /// the string representation of enums.
11249 pub fn value(&self) -> std::option::Option<i32> {
11250 match self {
11251 Self::Unspecified => std::option::Option::Some(0),
11252 Self::Low => std::option::Option::Some(1),
11253 Self::Medium => std::option::Option::Some(2),
11254 Self::High => std::option::Option::Some(3),
11255 Self::UnknownValue(u) => u.0.value(),
11256 }
11257 }
11258
11259 /// Gets the enum value as a string.
11260 ///
11261 /// Returns `None` if the enum contains an unknown value deserialized from
11262 /// the integer representation of enums.
11263 pub fn name(&self) -> std::option::Option<&str> {
11264 match self {
11265 Self::Unspecified => std::option::Option::Some("PRIORITY_UNSPECIFIED"),
11266 Self::Low => std::option::Option::Some("PRIORITY_LOW"),
11267 Self::Medium => std::option::Option::Some("PRIORITY_MEDIUM"),
11268 Self::High => std::option::Option::Some("PRIORITY_HIGH"),
11269 Self::UnknownValue(u) => u.0.name(),
11270 }
11271 }
11272 }
11273
11274 impl std::default::Default for Priority {
11275 fn default() -> Self {
11276 use std::convert::From;
11277 Self::from(0)
11278 }
11279 }
11280
11281 impl std::fmt::Display for Priority {
11282 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11283 wkt::internal::display_enum(f, self.name(), self.value())
11284 }
11285 }
11286
11287 impl std::convert::From<i32> for Priority {
11288 fn from(value: i32) -> Self {
11289 match value {
11290 0 => Self::Unspecified,
11291 1 => Self::Low,
11292 2 => Self::Medium,
11293 3 => Self::High,
11294 _ => Self::UnknownValue(priority::UnknownValue(
11295 wkt::internal::UnknownEnumValue::Integer(value),
11296 )),
11297 }
11298 }
11299 }
11300
11301 impl std::convert::From<&str> for Priority {
11302 fn from(value: &str) -> Self {
11303 use std::string::ToString;
11304 match value {
11305 "PRIORITY_UNSPECIFIED" => Self::Unspecified,
11306 "PRIORITY_LOW" => Self::Low,
11307 "PRIORITY_MEDIUM" => Self::Medium,
11308 "PRIORITY_HIGH" => Self::High,
11309 _ => Self::UnknownValue(priority::UnknownValue(
11310 wkt::internal::UnknownEnumValue::String(value.to_string()),
11311 )),
11312 }
11313 }
11314 }
11315
11316 impl serde::ser::Serialize for Priority {
11317 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11318 where
11319 S: serde::Serializer,
11320 {
11321 match self {
11322 Self::Unspecified => serializer.serialize_i32(0),
11323 Self::Low => serializer.serialize_i32(1),
11324 Self::Medium => serializer.serialize_i32(2),
11325 Self::High => serializer.serialize_i32(3),
11326 Self::UnknownValue(u) => u.0.serialize(serializer),
11327 }
11328 }
11329 }
11330
11331 impl<'de> serde::de::Deserialize<'de> for Priority {
11332 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11333 where
11334 D: serde::Deserializer<'de>,
11335 {
11336 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Priority>::new(
11337 ".google.bigtable.admin.v2.AppProfile.Priority",
11338 ))
11339 }
11340 }
11341
11342 /// The routing policy for all read/write requests that use this app profile.
11343 /// A value must be explicitly set.
11344 #[derive(Clone, Debug, PartialEq)]
11345 #[non_exhaustive]
11346 pub enum RoutingPolicy {
11347 /// Use a multi-cluster routing policy.
11348 MultiClusterRoutingUseAny(
11349 std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>,
11350 ),
11351 /// Use a single-cluster routing policy.
11352 SingleClusterRouting(std::boxed::Box<crate::model::app_profile::SingleClusterRouting>),
11353 }
11354
11355 /// Options for isolating this app profile's traffic from other use cases.
11356 #[derive(Clone, Debug, PartialEq)]
11357 #[non_exhaustive]
11358 pub enum Isolation {
11359 /// This field has been deprecated in favor of `standard_isolation.priority`.
11360 /// If you set this field, `standard_isolation.priority` will be set instead.
11361 ///
11362 /// The priority of requests sent using this app profile.
11363 #[deprecated]
11364 Priority(crate::model::app_profile::Priority),
11365 /// The standard options used for isolating this app profile's traffic from
11366 /// other use cases.
11367 StandardIsolation(std::boxed::Box<crate::model::app_profile::StandardIsolation>),
11368 /// Specifies that this app profile is intended for read-only usage via the
11369 /// Data Boost feature.
11370 DataBoostIsolationReadOnly(
11371 std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>,
11372 ),
11373 }
11374}
11375
11376/// A tablet is a defined by a start and end key and is explained in
11377/// <https://cloud.google.com/bigtable/docs/overview#architecture> and
11378/// <https://cloud.google.com/bigtable/docs/performance#optimization>.
11379/// A Hot tablet is a tablet that exhibits high average cpu usage during the time
11380/// interval from start time to end time.
11381#[derive(Clone, Default, PartialEq)]
11382#[non_exhaustive]
11383pub struct HotTablet {
11384 /// The unique name of the hot tablet. Values are of the form
11385 /// `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
11386 pub name: std::string::String,
11387
11388 /// Name of the table that contains the tablet. Values are of the form
11389 /// `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
11390 pub table_name: std::string::String,
11391
11392 /// Output only. The start time of the hot tablet.
11393 pub start_time: std::option::Option<wkt::Timestamp>,
11394
11395 /// Output only. The end time of the hot tablet.
11396 pub end_time: std::option::Option<wkt::Timestamp>,
11397
11398 /// Tablet Start Key (inclusive).
11399 pub start_key: std::string::String,
11400
11401 /// Tablet End Key (inclusive).
11402 pub end_key: std::string::String,
11403
11404 /// Output only. The average CPU usage spent by a node on this tablet over the
11405 /// start_time to end_time time range. The percentage is the amount of CPU used
11406 /// by the node to serve the tablet, from 0% (tablet was not interacted with)
11407 /// to 100% (the node spent all cycles serving the hot tablet).
11408 pub node_cpu_usage_percent: f32,
11409
11410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11411}
11412
11413impl HotTablet {
11414 pub fn new() -> Self {
11415 std::default::Default::default()
11416 }
11417
11418 /// Sets the value of [name][crate::model::HotTablet::name].
11419 ///
11420 /// # Example
11421 /// ```ignore,no_run
11422 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11423 /// let x = HotTablet::new().set_name("example");
11424 /// ```
11425 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11426 self.name = v.into();
11427 self
11428 }
11429
11430 /// Sets the value of [table_name][crate::model::HotTablet::table_name].
11431 ///
11432 /// # Example
11433 /// ```ignore,no_run
11434 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11435 /// let x = HotTablet::new().set_table_name("example");
11436 /// ```
11437 pub fn set_table_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11438 self.table_name = v.into();
11439 self
11440 }
11441
11442 /// Sets the value of [start_time][crate::model::HotTablet::start_time].
11443 ///
11444 /// # Example
11445 /// ```ignore,no_run
11446 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11447 /// use wkt::Timestamp;
11448 /// let x = HotTablet::new().set_start_time(Timestamp::default()/* use setters */);
11449 /// ```
11450 pub fn set_start_time<T>(mut self, v: T) -> Self
11451 where
11452 T: std::convert::Into<wkt::Timestamp>,
11453 {
11454 self.start_time = std::option::Option::Some(v.into());
11455 self
11456 }
11457
11458 /// Sets or clears the value of [start_time][crate::model::HotTablet::start_time].
11459 ///
11460 /// # Example
11461 /// ```ignore,no_run
11462 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11463 /// use wkt::Timestamp;
11464 /// let x = HotTablet::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
11465 /// let x = HotTablet::new().set_or_clear_start_time(None::<Timestamp>);
11466 /// ```
11467 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
11468 where
11469 T: std::convert::Into<wkt::Timestamp>,
11470 {
11471 self.start_time = v.map(|x| x.into());
11472 self
11473 }
11474
11475 /// Sets the value of [end_time][crate::model::HotTablet::end_time].
11476 ///
11477 /// # Example
11478 /// ```ignore,no_run
11479 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11480 /// use wkt::Timestamp;
11481 /// let x = HotTablet::new().set_end_time(Timestamp::default()/* use setters */);
11482 /// ```
11483 pub fn set_end_time<T>(mut self, v: T) -> Self
11484 where
11485 T: std::convert::Into<wkt::Timestamp>,
11486 {
11487 self.end_time = std::option::Option::Some(v.into());
11488 self
11489 }
11490
11491 /// Sets or clears the value of [end_time][crate::model::HotTablet::end_time].
11492 ///
11493 /// # Example
11494 /// ```ignore,no_run
11495 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11496 /// use wkt::Timestamp;
11497 /// let x = HotTablet::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
11498 /// let x = HotTablet::new().set_or_clear_end_time(None::<Timestamp>);
11499 /// ```
11500 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
11501 where
11502 T: std::convert::Into<wkt::Timestamp>,
11503 {
11504 self.end_time = v.map(|x| x.into());
11505 self
11506 }
11507
11508 /// Sets the value of [start_key][crate::model::HotTablet::start_key].
11509 ///
11510 /// # Example
11511 /// ```ignore,no_run
11512 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11513 /// let x = HotTablet::new().set_start_key("example");
11514 /// ```
11515 pub fn set_start_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11516 self.start_key = v.into();
11517 self
11518 }
11519
11520 /// Sets the value of [end_key][crate::model::HotTablet::end_key].
11521 ///
11522 /// # Example
11523 /// ```ignore,no_run
11524 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11525 /// let x = HotTablet::new().set_end_key("example");
11526 /// ```
11527 pub fn set_end_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11528 self.end_key = v.into();
11529 self
11530 }
11531
11532 /// Sets the value of [node_cpu_usage_percent][crate::model::HotTablet::node_cpu_usage_percent].
11533 ///
11534 /// # Example
11535 /// ```ignore,no_run
11536 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
11537 /// let x = HotTablet::new().set_node_cpu_usage_percent(42.0);
11538 /// ```
11539 pub fn set_node_cpu_usage_percent<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
11540 self.node_cpu_usage_percent = v.into();
11541 self
11542 }
11543}
11544
11545impl wkt::message::Message for HotTablet {
11546 fn typename() -> &'static str {
11547 "type.googleapis.com/google.bigtable.admin.v2.HotTablet"
11548 }
11549}
11550
11551/// A SQL logical view object that can be referenced in SQL queries.
11552#[derive(Clone, Default, PartialEq)]
11553#[non_exhaustive]
11554pub struct LogicalView {
11555 /// Identifier. The unique name of the logical view.
11556 /// Format:
11557 /// `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
11558 pub name: std::string::String,
11559
11560 /// Required. The logical view's select query.
11561 pub query: std::string::String,
11562
11563 /// Optional. The etag for this logical view.
11564 /// This may be sent on update requests to ensure that the client has an
11565 /// up-to-date value before proceeding. The server returns an ABORTED error on
11566 /// a mismatched etag.
11567 pub etag: std::string::String,
11568
11569 /// Optional. Set to true to make the LogicalView protected against deletion.
11570 pub deletion_protection: bool,
11571
11572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11573}
11574
11575impl LogicalView {
11576 pub fn new() -> Self {
11577 std::default::Default::default()
11578 }
11579
11580 /// Sets the value of [name][crate::model::LogicalView::name].
11581 ///
11582 /// # Example
11583 /// ```ignore,no_run
11584 /// # use google_cloud_bigtable_admin_v2::model::LogicalView;
11585 /// let x = LogicalView::new().set_name("example");
11586 /// ```
11587 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11588 self.name = v.into();
11589 self
11590 }
11591
11592 /// Sets the value of [query][crate::model::LogicalView::query].
11593 ///
11594 /// # Example
11595 /// ```ignore,no_run
11596 /// # use google_cloud_bigtable_admin_v2::model::LogicalView;
11597 /// let x = LogicalView::new().set_query("example");
11598 /// ```
11599 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11600 self.query = v.into();
11601 self
11602 }
11603
11604 /// Sets the value of [etag][crate::model::LogicalView::etag].
11605 ///
11606 /// # Example
11607 /// ```ignore,no_run
11608 /// # use google_cloud_bigtable_admin_v2::model::LogicalView;
11609 /// let x = LogicalView::new().set_etag("example");
11610 /// ```
11611 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11612 self.etag = v.into();
11613 self
11614 }
11615
11616 /// Sets the value of [deletion_protection][crate::model::LogicalView::deletion_protection].
11617 ///
11618 /// # Example
11619 /// ```ignore,no_run
11620 /// # use google_cloud_bigtable_admin_v2::model::LogicalView;
11621 /// let x = LogicalView::new().set_deletion_protection(true);
11622 /// ```
11623 pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11624 self.deletion_protection = v.into();
11625 self
11626 }
11627}
11628
11629impl wkt::message::Message for LogicalView {
11630 fn typename() -> &'static str {
11631 "type.googleapis.com/google.bigtable.admin.v2.LogicalView"
11632 }
11633}
11634
11635/// A materialized view object that can be referenced in SQL queries.
11636#[derive(Clone, Default, PartialEq)]
11637#[non_exhaustive]
11638pub struct MaterializedView {
11639 /// Identifier. The unique name of the materialized view.
11640 /// Format:
11641 /// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
11642 pub name: std::string::String,
11643
11644 /// Required. Immutable. The materialized view's select query.
11645 pub query: std::string::String,
11646
11647 /// Optional. The etag for this materialized view.
11648 /// This may be sent on update requests to ensure that the client has an
11649 /// up-to-date value before proceeding. The server returns an ABORTED error on
11650 /// a mismatched etag.
11651 pub etag: std::string::String,
11652
11653 /// Set to true to make the MaterializedView protected against deletion.
11654 pub deletion_protection: bool,
11655
11656 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11657}
11658
11659impl MaterializedView {
11660 pub fn new() -> Self {
11661 std::default::Default::default()
11662 }
11663
11664 /// Sets the value of [name][crate::model::MaterializedView::name].
11665 ///
11666 /// # Example
11667 /// ```ignore,no_run
11668 /// # use google_cloud_bigtable_admin_v2::model::MaterializedView;
11669 /// let x = MaterializedView::new().set_name("example");
11670 /// ```
11671 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11672 self.name = v.into();
11673 self
11674 }
11675
11676 /// Sets the value of [query][crate::model::MaterializedView::query].
11677 ///
11678 /// # Example
11679 /// ```ignore,no_run
11680 /// # use google_cloud_bigtable_admin_v2::model::MaterializedView;
11681 /// let x = MaterializedView::new().set_query("example");
11682 /// ```
11683 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11684 self.query = v.into();
11685 self
11686 }
11687
11688 /// Sets the value of [etag][crate::model::MaterializedView::etag].
11689 ///
11690 /// # Example
11691 /// ```ignore,no_run
11692 /// # use google_cloud_bigtable_admin_v2::model::MaterializedView;
11693 /// let x = MaterializedView::new().set_etag("example");
11694 /// ```
11695 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11696 self.etag = v.into();
11697 self
11698 }
11699
11700 /// Sets the value of [deletion_protection][crate::model::MaterializedView::deletion_protection].
11701 ///
11702 /// # Example
11703 /// ```ignore,no_run
11704 /// # use google_cloud_bigtable_admin_v2::model::MaterializedView;
11705 /// let x = MaterializedView::new().set_deletion_protection(true);
11706 /// ```
11707 pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11708 self.deletion_protection = v.into();
11709 self
11710 }
11711}
11712
11713impl wkt::message::Message for MaterializedView {
11714 fn typename() -> &'static str {
11715 "type.googleapis.com/google.bigtable.admin.v2.MaterializedView"
11716 }
11717}
11718
11719/// Information about a table restore.
11720#[derive(Clone, Default, PartialEq)]
11721#[non_exhaustive]
11722pub struct RestoreInfo {
11723 /// The type of the restore source.
11724 pub source_type: crate::model::RestoreSourceType,
11725
11726 /// Information about the source used to restore the table.
11727 pub source_info: std::option::Option<crate::model::restore_info::SourceInfo>,
11728
11729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11730}
11731
11732impl RestoreInfo {
11733 pub fn new() -> Self {
11734 std::default::Default::default()
11735 }
11736
11737 /// Sets the value of [source_type][crate::model::RestoreInfo::source_type].
11738 ///
11739 /// # Example
11740 /// ```ignore,no_run
11741 /// # use google_cloud_bigtable_admin_v2::model::RestoreInfo;
11742 /// use google_cloud_bigtable_admin_v2::model::RestoreSourceType;
11743 /// let x0 = RestoreInfo::new().set_source_type(RestoreSourceType::Backup);
11744 /// ```
11745 pub fn set_source_type<T: std::convert::Into<crate::model::RestoreSourceType>>(
11746 mut self,
11747 v: T,
11748 ) -> Self {
11749 self.source_type = v.into();
11750 self
11751 }
11752
11753 /// Sets the value of [source_info][crate::model::RestoreInfo::source_info].
11754 ///
11755 /// Note that all the setters affecting `source_info` are mutually
11756 /// exclusive.
11757 ///
11758 /// # Example
11759 /// ```ignore,no_run
11760 /// # use google_cloud_bigtable_admin_v2::model::RestoreInfo;
11761 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
11762 /// let x = RestoreInfo::new().set_source_info(Some(
11763 /// google_cloud_bigtable_admin_v2::model::restore_info::SourceInfo::BackupInfo(BackupInfo::default().into())));
11764 /// ```
11765 pub fn set_source_info<
11766 T: std::convert::Into<std::option::Option<crate::model::restore_info::SourceInfo>>,
11767 >(
11768 mut self,
11769 v: T,
11770 ) -> Self {
11771 self.source_info = v.into();
11772 self
11773 }
11774
11775 /// The value of [source_info][crate::model::RestoreInfo::source_info]
11776 /// if it holds a `BackupInfo`, `None` if the field is not set or
11777 /// holds a different branch.
11778 pub fn backup_info(&self) -> std::option::Option<&std::boxed::Box<crate::model::BackupInfo>> {
11779 #[allow(unreachable_patterns)]
11780 self.source_info.as_ref().and_then(|v| match v {
11781 crate::model::restore_info::SourceInfo::BackupInfo(v) => std::option::Option::Some(v),
11782 _ => std::option::Option::None,
11783 })
11784 }
11785
11786 /// Sets the value of [source_info][crate::model::RestoreInfo::source_info]
11787 /// to hold a `BackupInfo`.
11788 ///
11789 /// Note that all the setters affecting `source_info` are
11790 /// mutually exclusive.
11791 ///
11792 /// # Example
11793 /// ```ignore,no_run
11794 /// # use google_cloud_bigtable_admin_v2::model::RestoreInfo;
11795 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
11796 /// let x = RestoreInfo::new().set_backup_info(BackupInfo::default()/* use setters */);
11797 /// assert!(x.backup_info().is_some());
11798 /// ```
11799 pub fn set_backup_info<T: std::convert::Into<std::boxed::Box<crate::model::BackupInfo>>>(
11800 mut self,
11801 v: T,
11802 ) -> Self {
11803 self.source_info =
11804 std::option::Option::Some(crate::model::restore_info::SourceInfo::BackupInfo(v.into()));
11805 self
11806 }
11807}
11808
11809impl wkt::message::Message for RestoreInfo {
11810 fn typename() -> &'static str {
11811 "type.googleapis.com/google.bigtable.admin.v2.RestoreInfo"
11812 }
11813}
11814
11815/// Defines additional types related to [RestoreInfo].
11816pub mod restore_info {
11817 #[allow(unused_imports)]
11818 use super::*;
11819
11820 /// Information about the source used to restore the table.
11821 #[derive(Clone, Debug, PartialEq)]
11822 #[non_exhaustive]
11823 pub enum SourceInfo {
11824 /// Information about the backup used to restore the table. The backup
11825 /// may no longer exist.
11826 BackupInfo(std::boxed::Box<crate::model::BackupInfo>),
11827 }
11828}
11829
11830/// Change stream configuration.
11831#[derive(Clone, Default, PartialEq)]
11832#[non_exhaustive]
11833pub struct ChangeStreamConfig {
11834 /// How long the change stream should be retained. Change stream data older
11835 /// than the retention period will not be returned when reading the change
11836 /// stream from the table.
11837 /// Values must be at least 1 day and at most 7 days, and will be truncated to
11838 /// microsecond granularity.
11839 pub retention_period: std::option::Option<wkt::Duration>,
11840
11841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11842}
11843
11844impl ChangeStreamConfig {
11845 pub fn new() -> Self {
11846 std::default::Default::default()
11847 }
11848
11849 /// Sets the value of [retention_period][crate::model::ChangeStreamConfig::retention_period].
11850 ///
11851 /// # Example
11852 /// ```ignore,no_run
11853 /// # use google_cloud_bigtable_admin_v2::model::ChangeStreamConfig;
11854 /// use wkt::Duration;
11855 /// let x = ChangeStreamConfig::new().set_retention_period(Duration::default()/* use setters */);
11856 /// ```
11857 pub fn set_retention_period<T>(mut self, v: T) -> Self
11858 where
11859 T: std::convert::Into<wkt::Duration>,
11860 {
11861 self.retention_period = std::option::Option::Some(v.into());
11862 self
11863 }
11864
11865 /// Sets or clears the value of [retention_period][crate::model::ChangeStreamConfig::retention_period].
11866 ///
11867 /// # Example
11868 /// ```ignore,no_run
11869 /// # use google_cloud_bigtable_admin_v2::model::ChangeStreamConfig;
11870 /// use wkt::Duration;
11871 /// let x = ChangeStreamConfig::new().set_or_clear_retention_period(Some(Duration::default()/* use setters */));
11872 /// let x = ChangeStreamConfig::new().set_or_clear_retention_period(None::<Duration>);
11873 /// ```
11874 pub fn set_or_clear_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
11875 where
11876 T: std::convert::Into<wkt::Duration>,
11877 {
11878 self.retention_period = v.map(|x| x.into());
11879 self
11880 }
11881}
11882
11883impl wkt::message::Message for ChangeStreamConfig {
11884 fn typename() -> &'static str {
11885 "type.googleapis.com/google.bigtable.admin.v2.ChangeStreamConfig"
11886 }
11887}
11888
11889/// A collection of user data indexed by row, column, and timestamp.
11890/// Each table is served using the resources of its parent cluster.
11891#[derive(Clone, Default, PartialEq)]
11892#[non_exhaustive]
11893pub struct Table {
11894 /// The unique name of the table. Values are of the form
11895 /// `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
11896 /// Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
11897 pub name: std::string::String,
11898
11899 /// Output only. Map from cluster ID to per-cluster table state.
11900 /// If it could not be determined whether or not the table has data in a
11901 /// particular cluster (for example, if its zone is unavailable), then
11902 /// there will be an entry for the cluster with UNKNOWN `replication_status`.
11903 /// Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
11904 pub cluster_states:
11905 std::collections::HashMap<std::string::String, crate::model::table::ClusterState>,
11906
11907 /// The column families configured for this table, mapped by column family ID.
11908 /// Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
11909 pub column_families: std::collections::HashMap<std::string::String, crate::model::ColumnFamily>,
11910
11911 /// Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
11912 /// in this table. Timestamps not matching the granularity will be rejected. If
11913 /// unspecified at creation time, the value will be set to `MILLIS`. Views:
11914 /// `SCHEMA_VIEW`, `FULL`.
11915 pub granularity: crate::model::table::TimestampGranularity,
11916
11917 /// Output only. If this table was restored from another data source (e.g. a
11918 /// backup), this field will be populated with information about the restore.
11919 pub restore_info: std::option::Option<crate::model::RestoreInfo>,
11920
11921 /// If specified, enable the change stream on this table.
11922 /// Otherwise, the change stream is disabled and the change stream is not
11923 /// retained.
11924 pub change_stream_config: std::option::Option<crate::model::ChangeStreamConfig>,
11925
11926 /// Set to true to make the table protected against data loss. i.e. deleting
11927 /// the following resources through Admin APIs are prohibited:
11928 ///
11929 /// * The table.
11930 /// * The column families in the table.
11931 /// * The instance containing the table.
11932 ///
11933 /// Note one can still delete the data stored in the table through Data APIs.
11934 pub deletion_protection: bool,
11935
11936 /// Rules to specify what data is stored in each storage tier.
11937 /// Different tiers store data differently, providing different trade-offs
11938 /// between cost and performance. Different parts of a table can be stored
11939 /// separately on different tiers.
11940 /// If a config is specified, tiered storage is enabled for this table.
11941 /// Otherwise, tiered storage is disabled.
11942 /// Only SSD instances can configure tiered storage.
11943 pub tiered_storage_config: std::option::Option<crate::model::TieredStorageConfig>,
11944
11945 /// The row key schema for this table. The schema is used to decode the raw row
11946 /// key bytes into a structured format. The order of field declarations in this
11947 /// schema is important, as it reflects how the raw row key bytes are
11948 /// structured. Currently, this only affects how the key is read via a
11949 /// GoogleSQL query from the ExecuteQuery API.
11950 ///
11951 /// For a SQL query, the _key column is still read as raw bytes. But queries
11952 /// can reference the key fields by name, which will be decoded from _key using
11953 /// provided type and encoding. Queries that reference key fields will fail if
11954 /// they encounter an invalid row key.
11955 ///
11956 /// For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
11957 /// following schema:
11958 /// {
11959 /// fields {
11960 /// field_name: "id"
11961 /// type { string { encoding: utf8_bytes {} } }
11962 /// }
11963 /// fields {
11964 /// field_name: "date"
11965 /// type { string { encoding: utf8_bytes {} } }
11966 /// }
11967 /// fields {
11968 /// field_name: "product_code"
11969 /// type { int64 { encoding: big_endian_bytes {} } }
11970 /// }
11971 /// encoding { delimited_bytes { delimiter: "#" } }
11972 /// }
11973 ///
11974 /// The decoded key parts would be:
11975 /// id = "some_id", date = "2024-04-30", product_code = 1245427
11976 /// The query "SELECT _key, product_code FROM table" will return two columns:
11977 /// /------------------------------------------------------\
11978 /// | _key | product_code |
11979 /// | --------------------------------------|--------------|
11980 /// | "some_id#2024-04-30#\x00\x13\x00\xf3" | 1245427 |
11981 /// \------------------------------------------------------/
11982 ///
11983 /// The schema has the following invariants:
11984 /// (1) The decoded field values are order-preserved. For read, the field
11985 /// values will be decoded in sorted mode from the raw bytes.
11986 /// (2) Every field in the schema must specify a non-empty name.
11987 /// (3) Every field must specify a type with an associated encoding. The type
11988 /// is limited to scalar types only: Array, Map, Aggregate, and Struct are not
11989 /// allowed.
11990 /// (4) The field names must not collide with existing column family
11991 /// names and reserved keywords "_key" and "_timestamp".
11992 ///
11993 /// The following update operations are allowed for row_key_schema:
11994 ///
11995 /// - Update from an empty schema to a new schema.
11996 /// - Remove the existing schema. This operation requires setting the
11997 /// `ignore_warnings` flag to `true`, since it might be a backward
11998 /// incompatible change. Without the flag, the update request will fail with
11999 /// an INVALID_ARGUMENT error.
12000 /// Any other row key schema update operation (e.g. update existing schema
12001 /// columns names or types) is currently unsupported.
12002 pub row_key_schema: std::option::Option<crate::model::r#type::Struct>,
12003
12004 pub automated_backup_config: std::option::Option<crate::model::table::AutomatedBackupConfig>,
12005
12006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12007}
12008
12009impl Table {
12010 pub fn new() -> Self {
12011 std::default::Default::default()
12012 }
12013
12014 /// Sets the value of [name][crate::model::Table::name].
12015 ///
12016 /// # Example
12017 /// ```ignore,no_run
12018 /// # use google_cloud_bigtable_admin_v2::model::Table;
12019 /// let x = Table::new().set_name("example");
12020 /// ```
12021 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12022 self.name = v.into();
12023 self
12024 }
12025
12026 /// Sets the value of [cluster_states][crate::model::Table::cluster_states].
12027 ///
12028 /// # Example
12029 /// ```ignore,no_run
12030 /// # use google_cloud_bigtable_admin_v2::model::Table;
12031 /// use google_cloud_bigtable_admin_v2::model::table::ClusterState;
12032 /// let x = Table::new().set_cluster_states([
12033 /// ("key0", ClusterState::default()/* use setters */),
12034 /// ("key1", ClusterState::default()/* use (different) setters */),
12035 /// ]);
12036 /// ```
12037 pub fn set_cluster_states<T, K, V>(mut self, v: T) -> Self
12038 where
12039 T: std::iter::IntoIterator<Item = (K, V)>,
12040 K: std::convert::Into<std::string::String>,
12041 V: std::convert::Into<crate::model::table::ClusterState>,
12042 {
12043 use std::iter::Iterator;
12044 self.cluster_states = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12045 self
12046 }
12047
12048 /// Sets the value of [column_families][crate::model::Table::column_families].
12049 ///
12050 /// # Example
12051 /// ```ignore,no_run
12052 /// # use google_cloud_bigtable_admin_v2::model::Table;
12053 /// use google_cloud_bigtable_admin_v2::model::ColumnFamily;
12054 /// let x = Table::new().set_column_families([
12055 /// ("key0", ColumnFamily::default()/* use setters */),
12056 /// ("key1", ColumnFamily::default()/* use (different) setters */),
12057 /// ]);
12058 /// ```
12059 pub fn set_column_families<T, K, V>(mut self, v: T) -> Self
12060 where
12061 T: std::iter::IntoIterator<Item = (K, V)>,
12062 K: std::convert::Into<std::string::String>,
12063 V: std::convert::Into<crate::model::ColumnFamily>,
12064 {
12065 use std::iter::Iterator;
12066 self.column_families = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12067 self
12068 }
12069
12070 /// Sets the value of [granularity][crate::model::Table::granularity].
12071 ///
12072 /// # Example
12073 /// ```ignore,no_run
12074 /// # use google_cloud_bigtable_admin_v2::model::Table;
12075 /// use google_cloud_bigtable_admin_v2::model::table::TimestampGranularity;
12076 /// let x0 = Table::new().set_granularity(TimestampGranularity::Millis);
12077 /// ```
12078 pub fn set_granularity<T: std::convert::Into<crate::model::table::TimestampGranularity>>(
12079 mut self,
12080 v: T,
12081 ) -> Self {
12082 self.granularity = v.into();
12083 self
12084 }
12085
12086 /// Sets the value of [restore_info][crate::model::Table::restore_info].
12087 ///
12088 /// # Example
12089 /// ```ignore,no_run
12090 /// # use google_cloud_bigtable_admin_v2::model::Table;
12091 /// use google_cloud_bigtable_admin_v2::model::RestoreInfo;
12092 /// let x = Table::new().set_restore_info(RestoreInfo::default()/* use setters */);
12093 /// ```
12094 pub fn set_restore_info<T>(mut self, v: T) -> Self
12095 where
12096 T: std::convert::Into<crate::model::RestoreInfo>,
12097 {
12098 self.restore_info = std::option::Option::Some(v.into());
12099 self
12100 }
12101
12102 /// Sets or clears the value of [restore_info][crate::model::Table::restore_info].
12103 ///
12104 /// # Example
12105 /// ```ignore,no_run
12106 /// # use google_cloud_bigtable_admin_v2::model::Table;
12107 /// use google_cloud_bigtable_admin_v2::model::RestoreInfo;
12108 /// let x = Table::new().set_or_clear_restore_info(Some(RestoreInfo::default()/* use setters */));
12109 /// let x = Table::new().set_or_clear_restore_info(None::<RestoreInfo>);
12110 /// ```
12111 pub fn set_or_clear_restore_info<T>(mut self, v: std::option::Option<T>) -> Self
12112 where
12113 T: std::convert::Into<crate::model::RestoreInfo>,
12114 {
12115 self.restore_info = v.map(|x| x.into());
12116 self
12117 }
12118
12119 /// Sets the value of [change_stream_config][crate::model::Table::change_stream_config].
12120 ///
12121 /// # Example
12122 /// ```ignore,no_run
12123 /// # use google_cloud_bigtable_admin_v2::model::Table;
12124 /// use google_cloud_bigtable_admin_v2::model::ChangeStreamConfig;
12125 /// let x = Table::new().set_change_stream_config(ChangeStreamConfig::default()/* use setters */);
12126 /// ```
12127 pub fn set_change_stream_config<T>(mut self, v: T) -> Self
12128 where
12129 T: std::convert::Into<crate::model::ChangeStreamConfig>,
12130 {
12131 self.change_stream_config = std::option::Option::Some(v.into());
12132 self
12133 }
12134
12135 /// Sets or clears the value of [change_stream_config][crate::model::Table::change_stream_config].
12136 ///
12137 /// # Example
12138 /// ```ignore,no_run
12139 /// # use google_cloud_bigtable_admin_v2::model::Table;
12140 /// use google_cloud_bigtable_admin_v2::model::ChangeStreamConfig;
12141 /// let x = Table::new().set_or_clear_change_stream_config(Some(ChangeStreamConfig::default()/* use setters */));
12142 /// let x = Table::new().set_or_clear_change_stream_config(None::<ChangeStreamConfig>);
12143 /// ```
12144 pub fn set_or_clear_change_stream_config<T>(mut self, v: std::option::Option<T>) -> Self
12145 where
12146 T: std::convert::Into<crate::model::ChangeStreamConfig>,
12147 {
12148 self.change_stream_config = v.map(|x| x.into());
12149 self
12150 }
12151
12152 /// Sets the value of [deletion_protection][crate::model::Table::deletion_protection].
12153 ///
12154 /// # Example
12155 /// ```ignore,no_run
12156 /// # use google_cloud_bigtable_admin_v2::model::Table;
12157 /// let x = Table::new().set_deletion_protection(true);
12158 /// ```
12159 pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12160 self.deletion_protection = v.into();
12161 self
12162 }
12163
12164 /// Sets the value of [tiered_storage_config][crate::model::Table::tiered_storage_config].
12165 ///
12166 /// # Example
12167 /// ```ignore,no_run
12168 /// # use google_cloud_bigtable_admin_v2::model::Table;
12169 /// use google_cloud_bigtable_admin_v2::model::TieredStorageConfig;
12170 /// let x = Table::new().set_tiered_storage_config(TieredStorageConfig::default()/* use setters */);
12171 /// ```
12172 pub fn set_tiered_storage_config<T>(mut self, v: T) -> Self
12173 where
12174 T: std::convert::Into<crate::model::TieredStorageConfig>,
12175 {
12176 self.tiered_storage_config = std::option::Option::Some(v.into());
12177 self
12178 }
12179
12180 /// Sets or clears the value of [tiered_storage_config][crate::model::Table::tiered_storage_config].
12181 ///
12182 /// # Example
12183 /// ```ignore,no_run
12184 /// # use google_cloud_bigtable_admin_v2::model::Table;
12185 /// use google_cloud_bigtable_admin_v2::model::TieredStorageConfig;
12186 /// let x = Table::new().set_or_clear_tiered_storage_config(Some(TieredStorageConfig::default()/* use setters */));
12187 /// let x = Table::new().set_or_clear_tiered_storage_config(None::<TieredStorageConfig>);
12188 /// ```
12189 pub fn set_or_clear_tiered_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
12190 where
12191 T: std::convert::Into<crate::model::TieredStorageConfig>,
12192 {
12193 self.tiered_storage_config = v.map(|x| x.into());
12194 self
12195 }
12196
12197 /// Sets the value of [row_key_schema][crate::model::Table::row_key_schema].
12198 ///
12199 /// # Example
12200 /// ```ignore,no_run
12201 /// # use google_cloud_bigtable_admin_v2::model::Table;
12202 /// use google_cloud_bigtable_admin_v2::model::r#type::Struct;
12203 /// let x = Table::new().set_row_key_schema(Struct::default()/* use setters */);
12204 /// ```
12205 pub fn set_row_key_schema<T>(mut self, v: T) -> Self
12206 where
12207 T: std::convert::Into<crate::model::r#type::Struct>,
12208 {
12209 self.row_key_schema = std::option::Option::Some(v.into());
12210 self
12211 }
12212
12213 /// Sets or clears the value of [row_key_schema][crate::model::Table::row_key_schema].
12214 ///
12215 /// # Example
12216 /// ```ignore,no_run
12217 /// # use google_cloud_bigtable_admin_v2::model::Table;
12218 /// use google_cloud_bigtable_admin_v2::model::r#type::Struct;
12219 /// let x = Table::new().set_or_clear_row_key_schema(Some(Struct::default()/* use setters */));
12220 /// let x = Table::new().set_or_clear_row_key_schema(None::<Struct>);
12221 /// ```
12222 pub fn set_or_clear_row_key_schema<T>(mut self, v: std::option::Option<T>) -> Self
12223 where
12224 T: std::convert::Into<crate::model::r#type::Struct>,
12225 {
12226 self.row_key_schema = v.map(|x| x.into());
12227 self
12228 }
12229
12230 /// Sets the value of [automated_backup_config][crate::model::Table::automated_backup_config].
12231 ///
12232 /// Note that all the setters affecting `automated_backup_config` are mutually
12233 /// exclusive.
12234 ///
12235 /// # Example
12236 /// ```ignore,no_run
12237 /// # use google_cloud_bigtable_admin_v2::model::Table;
12238 /// use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
12239 /// let x = Table::new().set_automated_backup_config(Some(
12240 /// google_cloud_bigtable_admin_v2::model::table::AutomatedBackupConfig::AutomatedBackupPolicy(AutomatedBackupPolicy::default().into())));
12241 /// ```
12242 pub fn set_automated_backup_config<
12243 T: std::convert::Into<std::option::Option<crate::model::table::AutomatedBackupConfig>>,
12244 >(
12245 mut self,
12246 v: T,
12247 ) -> Self {
12248 self.automated_backup_config = v.into();
12249 self
12250 }
12251
12252 /// The value of [automated_backup_config][crate::model::Table::automated_backup_config]
12253 /// if it holds a `AutomatedBackupPolicy`, `None` if the field is not set or
12254 /// holds a different branch.
12255 pub fn automated_backup_policy(
12256 &self,
12257 ) -> std::option::Option<&std::boxed::Box<crate::model::table::AutomatedBackupPolicy>> {
12258 #[allow(unreachable_patterns)]
12259 self.automated_backup_config.as_ref().and_then(|v| match v {
12260 crate::model::table::AutomatedBackupConfig::AutomatedBackupPolicy(v) => {
12261 std::option::Option::Some(v)
12262 }
12263 _ => std::option::Option::None,
12264 })
12265 }
12266
12267 /// Sets the value of [automated_backup_config][crate::model::Table::automated_backup_config]
12268 /// to hold a `AutomatedBackupPolicy`.
12269 ///
12270 /// Note that all the setters affecting `automated_backup_config` are
12271 /// mutually exclusive.
12272 ///
12273 /// # Example
12274 /// ```ignore,no_run
12275 /// # use google_cloud_bigtable_admin_v2::model::Table;
12276 /// use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
12277 /// let x = Table::new().set_automated_backup_policy(AutomatedBackupPolicy::default()/* use setters */);
12278 /// assert!(x.automated_backup_policy().is_some());
12279 /// ```
12280 pub fn set_automated_backup_policy<
12281 T: std::convert::Into<std::boxed::Box<crate::model::table::AutomatedBackupPolicy>>,
12282 >(
12283 mut self,
12284 v: T,
12285 ) -> Self {
12286 self.automated_backup_config = std::option::Option::Some(
12287 crate::model::table::AutomatedBackupConfig::AutomatedBackupPolicy(v.into()),
12288 );
12289 self
12290 }
12291}
12292
12293impl wkt::message::Message for Table {
12294 fn typename() -> &'static str {
12295 "type.googleapis.com/google.bigtable.admin.v2.Table"
12296 }
12297}
12298
12299/// Defines additional types related to [Table].
12300pub mod table {
12301 #[allow(unused_imports)]
12302 use super::*;
12303
12304 /// The state of a table's data in a particular cluster.
12305 #[derive(Clone, Default, PartialEq)]
12306 #[non_exhaustive]
12307 pub struct ClusterState {
12308 /// Output only. The state of replication for the table in this cluster.
12309 pub replication_state: crate::model::table::cluster_state::ReplicationState,
12310
12311 /// Output only. The encryption information for the table in this cluster.
12312 /// If the encryption key protecting this resource is customer managed, then
12313 /// its version can be rotated in Cloud Key Management Service (Cloud KMS).
12314 /// The primary version of the key and its status will be reflected here when
12315 /// changes propagate from Cloud KMS.
12316 pub encryption_info: std::vec::Vec<crate::model::EncryptionInfo>,
12317
12318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12319 }
12320
12321 impl ClusterState {
12322 pub fn new() -> Self {
12323 std::default::Default::default()
12324 }
12325
12326 /// Sets the value of [replication_state][crate::model::table::ClusterState::replication_state].
12327 ///
12328 /// # Example
12329 /// ```ignore,no_run
12330 /// # use google_cloud_bigtable_admin_v2::model::table::ClusterState;
12331 /// use google_cloud_bigtable_admin_v2::model::table::cluster_state::ReplicationState;
12332 /// let x0 = ClusterState::new().set_replication_state(ReplicationState::Initializing);
12333 /// let x1 = ClusterState::new().set_replication_state(ReplicationState::PlannedMaintenance);
12334 /// let x2 = ClusterState::new().set_replication_state(ReplicationState::UnplannedMaintenance);
12335 /// ```
12336 pub fn set_replication_state<
12337 T: std::convert::Into<crate::model::table::cluster_state::ReplicationState>,
12338 >(
12339 mut self,
12340 v: T,
12341 ) -> Self {
12342 self.replication_state = v.into();
12343 self
12344 }
12345
12346 /// Sets the value of [encryption_info][crate::model::table::ClusterState::encryption_info].
12347 ///
12348 /// # Example
12349 /// ```ignore,no_run
12350 /// # use google_cloud_bigtable_admin_v2::model::table::ClusterState;
12351 /// use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
12352 /// let x = ClusterState::new()
12353 /// .set_encryption_info([
12354 /// EncryptionInfo::default()/* use setters */,
12355 /// EncryptionInfo::default()/* use (different) setters */,
12356 /// ]);
12357 /// ```
12358 pub fn set_encryption_info<T, V>(mut self, v: T) -> Self
12359 where
12360 T: std::iter::IntoIterator<Item = V>,
12361 V: std::convert::Into<crate::model::EncryptionInfo>,
12362 {
12363 use std::iter::Iterator;
12364 self.encryption_info = v.into_iter().map(|i| i.into()).collect();
12365 self
12366 }
12367 }
12368
12369 impl wkt::message::Message for ClusterState {
12370 fn typename() -> &'static str {
12371 "type.googleapis.com/google.bigtable.admin.v2.Table.ClusterState"
12372 }
12373 }
12374
12375 /// Defines additional types related to [ClusterState].
12376 pub mod cluster_state {
12377 #[allow(unused_imports)]
12378 use super::*;
12379
12380 /// Table replication states.
12381 ///
12382 /// # Working with unknown values
12383 ///
12384 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12385 /// additional enum variants at any time. Adding new variants is not considered
12386 /// a breaking change. Applications should write their code in anticipation of:
12387 ///
12388 /// - New values appearing in future releases of the client library, **and**
12389 /// - New values received dynamically, without application changes.
12390 ///
12391 /// Please consult the [Working with enums] section in the user guide for some
12392 /// guidelines.
12393 ///
12394 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12395 #[derive(Clone, Debug, PartialEq)]
12396 #[non_exhaustive]
12397 pub enum ReplicationState {
12398 /// The replication state of the table is unknown in this cluster.
12399 StateNotKnown,
12400 /// The cluster was recently created, and the table must finish copying
12401 /// over pre-existing data from other clusters before it can begin
12402 /// receiving live replication updates and serving Data API requests.
12403 Initializing,
12404 /// The table is temporarily unable to serve Data API requests from this
12405 /// cluster due to planned internal maintenance.
12406 PlannedMaintenance,
12407 /// The table is temporarily unable to serve Data API requests from this
12408 /// cluster due to unplanned or emergency maintenance.
12409 UnplannedMaintenance,
12410 /// The table can serve Data API requests from this cluster. Depending on
12411 /// replication delay, reads may not immediately reflect the state of the
12412 /// table in other clusters.
12413 Ready,
12414 /// The table is fully created and ready for use after a restore, and is
12415 /// being optimized for performance. When optimizations are complete, the
12416 /// table will transition to `READY` state.
12417 ReadyOptimizing,
12418 /// If set, the enum was initialized with an unknown value.
12419 ///
12420 /// Applications can examine the value using [ReplicationState::value] or
12421 /// [ReplicationState::name].
12422 UnknownValue(replication_state::UnknownValue),
12423 }
12424
12425 #[doc(hidden)]
12426 pub mod replication_state {
12427 #[allow(unused_imports)]
12428 use super::*;
12429 #[derive(Clone, Debug, PartialEq)]
12430 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12431 }
12432
12433 impl ReplicationState {
12434 /// Gets the enum value.
12435 ///
12436 /// Returns `None` if the enum contains an unknown value deserialized from
12437 /// the string representation of enums.
12438 pub fn value(&self) -> std::option::Option<i32> {
12439 match self {
12440 Self::StateNotKnown => std::option::Option::Some(0),
12441 Self::Initializing => std::option::Option::Some(1),
12442 Self::PlannedMaintenance => std::option::Option::Some(2),
12443 Self::UnplannedMaintenance => std::option::Option::Some(3),
12444 Self::Ready => std::option::Option::Some(4),
12445 Self::ReadyOptimizing => std::option::Option::Some(5),
12446 Self::UnknownValue(u) => u.0.value(),
12447 }
12448 }
12449
12450 /// Gets the enum value as a string.
12451 ///
12452 /// Returns `None` if the enum contains an unknown value deserialized from
12453 /// the integer representation of enums.
12454 pub fn name(&self) -> std::option::Option<&str> {
12455 match self {
12456 Self::StateNotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
12457 Self::Initializing => std::option::Option::Some("INITIALIZING"),
12458 Self::PlannedMaintenance => std::option::Option::Some("PLANNED_MAINTENANCE"),
12459 Self::UnplannedMaintenance => {
12460 std::option::Option::Some("UNPLANNED_MAINTENANCE")
12461 }
12462 Self::Ready => std::option::Option::Some("READY"),
12463 Self::ReadyOptimizing => std::option::Option::Some("READY_OPTIMIZING"),
12464 Self::UnknownValue(u) => u.0.name(),
12465 }
12466 }
12467 }
12468
12469 impl std::default::Default for ReplicationState {
12470 fn default() -> Self {
12471 use std::convert::From;
12472 Self::from(0)
12473 }
12474 }
12475
12476 impl std::fmt::Display for ReplicationState {
12477 fn fmt(
12478 &self,
12479 f: &mut std::fmt::Formatter<'_>,
12480 ) -> std::result::Result<(), std::fmt::Error> {
12481 wkt::internal::display_enum(f, self.name(), self.value())
12482 }
12483 }
12484
12485 impl std::convert::From<i32> for ReplicationState {
12486 fn from(value: i32) -> Self {
12487 match value {
12488 0 => Self::StateNotKnown,
12489 1 => Self::Initializing,
12490 2 => Self::PlannedMaintenance,
12491 3 => Self::UnplannedMaintenance,
12492 4 => Self::Ready,
12493 5 => Self::ReadyOptimizing,
12494 _ => Self::UnknownValue(replication_state::UnknownValue(
12495 wkt::internal::UnknownEnumValue::Integer(value),
12496 )),
12497 }
12498 }
12499 }
12500
12501 impl std::convert::From<&str> for ReplicationState {
12502 fn from(value: &str) -> Self {
12503 use std::string::ToString;
12504 match value {
12505 "STATE_NOT_KNOWN" => Self::StateNotKnown,
12506 "INITIALIZING" => Self::Initializing,
12507 "PLANNED_MAINTENANCE" => Self::PlannedMaintenance,
12508 "UNPLANNED_MAINTENANCE" => Self::UnplannedMaintenance,
12509 "READY" => Self::Ready,
12510 "READY_OPTIMIZING" => Self::ReadyOptimizing,
12511 _ => Self::UnknownValue(replication_state::UnknownValue(
12512 wkt::internal::UnknownEnumValue::String(value.to_string()),
12513 )),
12514 }
12515 }
12516 }
12517
12518 impl serde::ser::Serialize for ReplicationState {
12519 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12520 where
12521 S: serde::Serializer,
12522 {
12523 match self {
12524 Self::StateNotKnown => serializer.serialize_i32(0),
12525 Self::Initializing => serializer.serialize_i32(1),
12526 Self::PlannedMaintenance => serializer.serialize_i32(2),
12527 Self::UnplannedMaintenance => serializer.serialize_i32(3),
12528 Self::Ready => serializer.serialize_i32(4),
12529 Self::ReadyOptimizing => serializer.serialize_i32(5),
12530 Self::UnknownValue(u) => u.0.serialize(serializer),
12531 }
12532 }
12533 }
12534
12535 impl<'de> serde::de::Deserialize<'de> for ReplicationState {
12536 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12537 where
12538 D: serde::Deserializer<'de>,
12539 {
12540 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationState>::new(
12541 ".google.bigtable.admin.v2.Table.ClusterState.ReplicationState",
12542 ))
12543 }
12544 }
12545 }
12546
12547 /// Defines an automated backup policy for a table
12548 #[derive(Clone, Default, PartialEq)]
12549 #[non_exhaustive]
12550 pub struct AutomatedBackupPolicy {
12551 /// Required. How long the automated backups should be retained. The only
12552 /// supported value at this time is 3 days.
12553 pub retention_period: std::option::Option<wkt::Duration>,
12554
12555 /// Required. How frequently automated backups should occur. The only
12556 /// supported value at this time is 24 hours.
12557 pub frequency: std::option::Option<wkt::Duration>,
12558
12559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12560 }
12561
12562 impl AutomatedBackupPolicy {
12563 pub fn new() -> Self {
12564 std::default::Default::default()
12565 }
12566
12567 /// Sets the value of [retention_period][crate::model::table::AutomatedBackupPolicy::retention_period].
12568 ///
12569 /// # Example
12570 /// ```ignore,no_run
12571 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
12572 /// use wkt::Duration;
12573 /// let x = AutomatedBackupPolicy::new().set_retention_period(Duration::default()/* use setters */);
12574 /// ```
12575 pub fn set_retention_period<T>(mut self, v: T) -> Self
12576 where
12577 T: std::convert::Into<wkt::Duration>,
12578 {
12579 self.retention_period = std::option::Option::Some(v.into());
12580 self
12581 }
12582
12583 /// Sets or clears the value of [retention_period][crate::model::table::AutomatedBackupPolicy::retention_period].
12584 ///
12585 /// # Example
12586 /// ```ignore,no_run
12587 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
12588 /// use wkt::Duration;
12589 /// let x = AutomatedBackupPolicy::new().set_or_clear_retention_period(Some(Duration::default()/* use setters */));
12590 /// let x = AutomatedBackupPolicy::new().set_or_clear_retention_period(None::<Duration>);
12591 /// ```
12592 pub fn set_or_clear_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
12593 where
12594 T: std::convert::Into<wkt::Duration>,
12595 {
12596 self.retention_period = v.map(|x| x.into());
12597 self
12598 }
12599
12600 /// Sets the value of [frequency][crate::model::table::AutomatedBackupPolicy::frequency].
12601 ///
12602 /// # Example
12603 /// ```ignore,no_run
12604 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
12605 /// use wkt::Duration;
12606 /// let x = AutomatedBackupPolicy::new().set_frequency(Duration::default()/* use setters */);
12607 /// ```
12608 pub fn set_frequency<T>(mut self, v: T) -> Self
12609 where
12610 T: std::convert::Into<wkt::Duration>,
12611 {
12612 self.frequency = std::option::Option::Some(v.into());
12613 self
12614 }
12615
12616 /// Sets or clears the value of [frequency][crate::model::table::AutomatedBackupPolicy::frequency].
12617 ///
12618 /// # Example
12619 /// ```ignore,no_run
12620 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
12621 /// use wkt::Duration;
12622 /// let x = AutomatedBackupPolicy::new().set_or_clear_frequency(Some(Duration::default()/* use setters */));
12623 /// let x = AutomatedBackupPolicy::new().set_or_clear_frequency(None::<Duration>);
12624 /// ```
12625 pub fn set_or_clear_frequency<T>(mut self, v: std::option::Option<T>) -> Self
12626 where
12627 T: std::convert::Into<wkt::Duration>,
12628 {
12629 self.frequency = v.map(|x| x.into());
12630 self
12631 }
12632 }
12633
12634 impl wkt::message::Message for AutomatedBackupPolicy {
12635 fn typename() -> &'static str {
12636 "type.googleapis.com/google.bigtable.admin.v2.Table.AutomatedBackupPolicy"
12637 }
12638 }
12639
12640 /// Possible timestamp granularities to use when keeping multiple versions
12641 /// of data in a table.
12642 ///
12643 /// # Working with unknown values
12644 ///
12645 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12646 /// additional enum variants at any time. Adding new variants is not considered
12647 /// a breaking change. Applications should write their code in anticipation of:
12648 ///
12649 /// - New values appearing in future releases of the client library, **and**
12650 /// - New values received dynamically, without application changes.
12651 ///
12652 /// Please consult the [Working with enums] section in the user guide for some
12653 /// guidelines.
12654 ///
12655 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12656 #[derive(Clone, Debug, PartialEq)]
12657 #[non_exhaustive]
12658 pub enum TimestampGranularity {
12659 /// The user did not specify a granularity. Should not be returned.
12660 /// When specified during table creation, MILLIS will be used.
12661 Unspecified,
12662 /// The table keeps data versioned at a granularity of 1ms.
12663 Millis,
12664 /// If set, the enum was initialized with an unknown value.
12665 ///
12666 /// Applications can examine the value using [TimestampGranularity::value] or
12667 /// [TimestampGranularity::name].
12668 UnknownValue(timestamp_granularity::UnknownValue),
12669 }
12670
12671 #[doc(hidden)]
12672 pub mod timestamp_granularity {
12673 #[allow(unused_imports)]
12674 use super::*;
12675 #[derive(Clone, Debug, PartialEq)]
12676 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12677 }
12678
12679 impl TimestampGranularity {
12680 /// Gets the enum value.
12681 ///
12682 /// Returns `None` if the enum contains an unknown value deserialized from
12683 /// the string representation of enums.
12684 pub fn value(&self) -> std::option::Option<i32> {
12685 match self {
12686 Self::Unspecified => std::option::Option::Some(0),
12687 Self::Millis => std::option::Option::Some(1),
12688 Self::UnknownValue(u) => u.0.value(),
12689 }
12690 }
12691
12692 /// Gets the enum value as a string.
12693 ///
12694 /// Returns `None` if the enum contains an unknown value deserialized from
12695 /// the integer representation of enums.
12696 pub fn name(&self) -> std::option::Option<&str> {
12697 match self {
12698 Self::Unspecified => std::option::Option::Some("TIMESTAMP_GRANULARITY_UNSPECIFIED"),
12699 Self::Millis => std::option::Option::Some("MILLIS"),
12700 Self::UnknownValue(u) => u.0.name(),
12701 }
12702 }
12703 }
12704
12705 impl std::default::Default for TimestampGranularity {
12706 fn default() -> Self {
12707 use std::convert::From;
12708 Self::from(0)
12709 }
12710 }
12711
12712 impl std::fmt::Display for TimestampGranularity {
12713 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12714 wkt::internal::display_enum(f, self.name(), self.value())
12715 }
12716 }
12717
12718 impl std::convert::From<i32> for TimestampGranularity {
12719 fn from(value: i32) -> Self {
12720 match value {
12721 0 => Self::Unspecified,
12722 1 => Self::Millis,
12723 _ => Self::UnknownValue(timestamp_granularity::UnknownValue(
12724 wkt::internal::UnknownEnumValue::Integer(value),
12725 )),
12726 }
12727 }
12728 }
12729
12730 impl std::convert::From<&str> for TimestampGranularity {
12731 fn from(value: &str) -> Self {
12732 use std::string::ToString;
12733 match value {
12734 "TIMESTAMP_GRANULARITY_UNSPECIFIED" => Self::Unspecified,
12735 "MILLIS" => Self::Millis,
12736 _ => Self::UnknownValue(timestamp_granularity::UnknownValue(
12737 wkt::internal::UnknownEnumValue::String(value.to_string()),
12738 )),
12739 }
12740 }
12741 }
12742
12743 impl serde::ser::Serialize for TimestampGranularity {
12744 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12745 where
12746 S: serde::Serializer,
12747 {
12748 match self {
12749 Self::Unspecified => serializer.serialize_i32(0),
12750 Self::Millis => serializer.serialize_i32(1),
12751 Self::UnknownValue(u) => u.0.serialize(serializer),
12752 }
12753 }
12754 }
12755
12756 impl<'de> serde::de::Deserialize<'de> for TimestampGranularity {
12757 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12758 where
12759 D: serde::Deserializer<'de>,
12760 {
12761 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TimestampGranularity>::new(
12762 ".google.bigtable.admin.v2.Table.TimestampGranularity",
12763 ))
12764 }
12765 }
12766
12767 /// Defines a view over a table's fields.
12768 ///
12769 /// # Working with unknown values
12770 ///
12771 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12772 /// additional enum variants at any time. Adding new variants is not considered
12773 /// a breaking change. Applications should write their code in anticipation of:
12774 ///
12775 /// - New values appearing in future releases of the client library, **and**
12776 /// - New values received dynamically, without application changes.
12777 ///
12778 /// Please consult the [Working with enums] section in the user guide for some
12779 /// guidelines.
12780 ///
12781 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12782 #[derive(Clone, Debug, PartialEq)]
12783 #[non_exhaustive]
12784 pub enum View {
12785 /// Uses the default view for each method as documented in its request.
12786 Unspecified,
12787 /// Only populates `name`.
12788 NameOnly,
12789 /// Only populates `name` and fields related to the table's schema.
12790 SchemaView,
12791 /// Only populates `name` and fields related to the table's replication
12792 /// state.
12793 ReplicationView,
12794 /// Only populates `name` and fields related to the table's encryption state.
12795 EncryptionView,
12796 /// Populates all fields.
12797 Full,
12798 /// If set, the enum was initialized with an unknown value.
12799 ///
12800 /// Applications can examine the value using [View::value] or
12801 /// [View::name].
12802 UnknownValue(view::UnknownValue),
12803 }
12804
12805 #[doc(hidden)]
12806 pub mod view {
12807 #[allow(unused_imports)]
12808 use super::*;
12809 #[derive(Clone, Debug, PartialEq)]
12810 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12811 }
12812
12813 impl View {
12814 /// Gets the enum value.
12815 ///
12816 /// Returns `None` if the enum contains an unknown value deserialized from
12817 /// the string representation of enums.
12818 pub fn value(&self) -> std::option::Option<i32> {
12819 match self {
12820 Self::Unspecified => std::option::Option::Some(0),
12821 Self::NameOnly => std::option::Option::Some(1),
12822 Self::SchemaView => std::option::Option::Some(2),
12823 Self::ReplicationView => std::option::Option::Some(3),
12824 Self::EncryptionView => std::option::Option::Some(5),
12825 Self::Full => std::option::Option::Some(4),
12826 Self::UnknownValue(u) => u.0.value(),
12827 }
12828 }
12829
12830 /// Gets the enum value as a string.
12831 ///
12832 /// Returns `None` if the enum contains an unknown value deserialized from
12833 /// the integer representation of enums.
12834 pub fn name(&self) -> std::option::Option<&str> {
12835 match self {
12836 Self::Unspecified => std::option::Option::Some("VIEW_UNSPECIFIED"),
12837 Self::NameOnly => std::option::Option::Some("NAME_ONLY"),
12838 Self::SchemaView => std::option::Option::Some("SCHEMA_VIEW"),
12839 Self::ReplicationView => std::option::Option::Some("REPLICATION_VIEW"),
12840 Self::EncryptionView => std::option::Option::Some("ENCRYPTION_VIEW"),
12841 Self::Full => std::option::Option::Some("FULL"),
12842 Self::UnknownValue(u) => u.0.name(),
12843 }
12844 }
12845 }
12846
12847 impl std::default::Default for View {
12848 fn default() -> Self {
12849 use std::convert::From;
12850 Self::from(0)
12851 }
12852 }
12853
12854 impl std::fmt::Display for View {
12855 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12856 wkt::internal::display_enum(f, self.name(), self.value())
12857 }
12858 }
12859
12860 impl std::convert::From<i32> for View {
12861 fn from(value: i32) -> Self {
12862 match value {
12863 0 => Self::Unspecified,
12864 1 => Self::NameOnly,
12865 2 => Self::SchemaView,
12866 3 => Self::ReplicationView,
12867 4 => Self::Full,
12868 5 => Self::EncryptionView,
12869 _ => Self::UnknownValue(view::UnknownValue(
12870 wkt::internal::UnknownEnumValue::Integer(value),
12871 )),
12872 }
12873 }
12874 }
12875
12876 impl std::convert::From<&str> for View {
12877 fn from(value: &str) -> Self {
12878 use std::string::ToString;
12879 match value {
12880 "VIEW_UNSPECIFIED" => Self::Unspecified,
12881 "NAME_ONLY" => Self::NameOnly,
12882 "SCHEMA_VIEW" => Self::SchemaView,
12883 "REPLICATION_VIEW" => Self::ReplicationView,
12884 "ENCRYPTION_VIEW" => Self::EncryptionView,
12885 "FULL" => Self::Full,
12886 _ => Self::UnknownValue(view::UnknownValue(
12887 wkt::internal::UnknownEnumValue::String(value.to_string()),
12888 )),
12889 }
12890 }
12891 }
12892
12893 impl serde::ser::Serialize for View {
12894 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12895 where
12896 S: serde::Serializer,
12897 {
12898 match self {
12899 Self::Unspecified => serializer.serialize_i32(0),
12900 Self::NameOnly => serializer.serialize_i32(1),
12901 Self::SchemaView => serializer.serialize_i32(2),
12902 Self::ReplicationView => serializer.serialize_i32(3),
12903 Self::EncryptionView => serializer.serialize_i32(5),
12904 Self::Full => serializer.serialize_i32(4),
12905 Self::UnknownValue(u) => u.0.serialize(serializer),
12906 }
12907 }
12908 }
12909
12910 impl<'de> serde::de::Deserialize<'de> for View {
12911 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12912 where
12913 D: serde::Deserializer<'de>,
12914 {
12915 deserializer.deserialize_any(wkt::internal::EnumVisitor::<View>::new(
12916 ".google.bigtable.admin.v2.Table.View",
12917 ))
12918 }
12919 }
12920
12921 #[derive(Clone, Debug, PartialEq)]
12922 #[non_exhaustive]
12923 pub enum AutomatedBackupConfig {
12924 /// If specified, automated backups are enabled for this table.
12925 /// Otherwise, automated backups are disabled.
12926 AutomatedBackupPolicy(std::boxed::Box<crate::model::table::AutomatedBackupPolicy>),
12927 }
12928}
12929
12930/// AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users
12931/// can configure access to each Authorized View independently from the table and
12932/// use the existing Data APIs to access the subset of data.
12933#[derive(Clone, Default, PartialEq)]
12934#[non_exhaustive]
12935pub struct AuthorizedView {
12936 /// Identifier. The name of this AuthorizedView.
12937 /// Values are of the form
12938 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
12939 pub name: std::string::String,
12940
12941 /// The etag for this AuthorizedView.
12942 /// If this is provided on update, it must match the server's etag. The server
12943 /// returns ABORTED error on a mismatched etag.
12944 pub etag: std::string::String,
12945
12946 /// Set to true to make the AuthorizedView protected against deletion.
12947 /// The parent Table and containing Instance cannot be deleted if an
12948 /// AuthorizedView has this bit set.
12949 pub deletion_protection: bool,
12950
12951 /// The type of this AuthorizedView.
12952 pub authorized_view: std::option::Option<crate::model::authorized_view::AuthorizedView>,
12953
12954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12955}
12956
12957impl AuthorizedView {
12958 pub fn new() -> Self {
12959 std::default::Default::default()
12960 }
12961
12962 /// Sets the value of [name][crate::model::AuthorizedView::name].
12963 ///
12964 /// # Example
12965 /// ```ignore,no_run
12966 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
12967 /// let x = AuthorizedView::new().set_name("example");
12968 /// ```
12969 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12970 self.name = v.into();
12971 self
12972 }
12973
12974 /// Sets the value of [etag][crate::model::AuthorizedView::etag].
12975 ///
12976 /// # Example
12977 /// ```ignore,no_run
12978 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
12979 /// let x = AuthorizedView::new().set_etag("example");
12980 /// ```
12981 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12982 self.etag = v.into();
12983 self
12984 }
12985
12986 /// Sets the value of [deletion_protection][crate::model::AuthorizedView::deletion_protection].
12987 ///
12988 /// # Example
12989 /// ```ignore,no_run
12990 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
12991 /// let x = AuthorizedView::new().set_deletion_protection(true);
12992 /// ```
12993 pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12994 self.deletion_protection = v.into();
12995 self
12996 }
12997
12998 /// Sets the value of [authorized_view][crate::model::AuthorizedView::authorized_view].
12999 ///
13000 /// Note that all the setters affecting `authorized_view` are mutually
13001 /// exclusive.
13002 ///
13003 /// # Example
13004 /// ```ignore,no_run
13005 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
13006 /// use google_cloud_bigtable_admin_v2::model::authorized_view::SubsetView;
13007 /// let x = AuthorizedView::new().set_authorized_view(Some(
13008 /// google_cloud_bigtable_admin_v2::model::authorized_view::AuthorizedView::SubsetView(SubsetView::default().into())));
13009 /// ```
13010 pub fn set_authorized_view<
13011 T: std::convert::Into<std::option::Option<crate::model::authorized_view::AuthorizedView>>,
13012 >(
13013 mut self,
13014 v: T,
13015 ) -> Self {
13016 self.authorized_view = v.into();
13017 self
13018 }
13019
13020 /// The value of [authorized_view][crate::model::AuthorizedView::authorized_view]
13021 /// if it holds a `SubsetView`, `None` if the field is not set or
13022 /// holds a different branch.
13023 pub fn subset_view(
13024 &self,
13025 ) -> std::option::Option<&std::boxed::Box<crate::model::authorized_view::SubsetView>> {
13026 #[allow(unreachable_patterns)]
13027 self.authorized_view.as_ref().and_then(|v| match v {
13028 crate::model::authorized_view::AuthorizedView::SubsetView(v) => {
13029 std::option::Option::Some(v)
13030 }
13031 _ => std::option::Option::None,
13032 })
13033 }
13034
13035 /// Sets the value of [authorized_view][crate::model::AuthorizedView::authorized_view]
13036 /// to hold a `SubsetView`.
13037 ///
13038 /// Note that all the setters affecting `authorized_view` are
13039 /// mutually exclusive.
13040 ///
13041 /// # Example
13042 /// ```ignore,no_run
13043 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
13044 /// use google_cloud_bigtable_admin_v2::model::authorized_view::SubsetView;
13045 /// let x = AuthorizedView::new().set_subset_view(SubsetView::default()/* use setters */);
13046 /// assert!(x.subset_view().is_some());
13047 /// ```
13048 pub fn set_subset_view<
13049 T: std::convert::Into<std::boxed::Box<crate::model::authorized_view::SubsetView>>,
13050 >(
13051 mut self,
13052 v: T,
13053 ) -> Self {
13054 self.authorized_view = std::option::Option::Some(
13055 crate::model::authorized_view::AuthorizedView::SubsetView(v.into()),
13056 );
13057 self
13058 }
13059}
13060
13061impl wkt::message::Message for AuthorizedView {
13062 fn typename() -> &'static str {
13063 "type.googleapis.com/google.bigtable.admin.v2.AuthorizedView"
13064 }
13065}
13066
13067/// Defines additional types related to [AuthorizedView].
13068pub mod authorized_view {
13069 #[allow(unused_imports)]
13070 use super::*;
13071
13072 /// Subsets of a column family that are included in this AuthorizedView.
13073 #[derive(Clone, Default, PartialEq)]
13074 #[non_exhaustive]
13075 pub struct FamilySubsets {
13076 /// Individual exact column qualifiers to be included in the AuthorizedView.
13077 pub qualifiers: std::vec::Vec<::bytes::Bytes>,
13078
13079 /// Prefixes for qualifiers to be included in the AuthorizedView. Every
13080 /// qualifier starting with one of these prefixes is included in the
13081 /// AuthorizedView. To provide access to all qualifiers, include the empty
13082 /// string as a prefix
13083 /// ("").
13084 pub qualifier_prefixes: std::vec::Vec<::bytes::Bytes>,
13085
13086 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13087 }
13088
13089 impl FamilySubsets {
13090 pub fn new() -> Self {
13091 std::default::Default::default()
13092 }
13093
13094 /// Sets the value of [qualifiers][crate::model::authorized_view::FamilySubsets::qualifiers].
13095 ///
13096 /// # Example
13097 /// ```ignore,no_run
13098 /// # use google_cloud_bigtable_admin_v2::model::authorized_view::FamilySubsets;
13099 /// let b1 = bytes::Bytes::from_static(b"abc");
13100 /// let b2 = bytes::Bytes::from_static(b"xyz");
13101 /// let x = FamilySubsets::new().set_qualifiers([b1, b2]);
13102 /// ```
13103 pub fn set_qualifiers<T, V>(mut self, v: T) -> Self
13104 where
13105 T: std::iter::IntoIterator<Item = V>,
13106 V: std::convert::Into<::bytes::Bytes>,
13107 {
13108 use std::iter::Iterator;
13109 self.qualifiers = v.into_iter().map(|i| i.into()).collect();
13110 self
13111 }
13112
13113 /// Sets the value of [qualifier_prefixes][crate::model::authorized_view::FamilySubsets::qualifier_prefixes].
13114 ///
13115 /// # Example
13116 /// ```ignore,no_run
13117 /// # use google_cloud_bigtable_admin_v2::model::authorized_view::FamilySubsets;
13118 /// let b1 = bytes::Bytes::from_static(b"abc");
13119 /// let b2 = bytes::Bytes::from_static(b"xyz");
13120 /// let x = FamilySubsets::new().set_qualifier_prefixes([b1, b2]);
13121 /// ```
13122 pub fn set_qualifier_prefixes<T, V>(mut self, v: T) -> Self
13123 where
13124 T: std::iter::IntoIterator<Item = V>,
13125 V: std::convert::Into<::bytes::Bytes>,
13126 {
13127 use std::iter::Iterator;
13128 self.qualifier_prefixes = v.into_iter().map(|i| i.into()).collect();
13129 self
13130 }
13131 }
13132
13133 impl wkt::message::Message for FamilySubsets {
13134 fn typename() -> &'static str {
13135 "type.googleapis.com/google.bigtable.admin.v2.AuthorizedView.FamilySubsets"
13136 }
13137 }
13138
13139 /// Defines a simple AuthorizedView that is a subset of the underlying Table.
13140 #[derive(Clone, Default, PartialEq)]
13141 #[non_exhaustive]
13142 pub struct SubsetView {
13143 /// Row prefixes to be included in the AuthorizedView.
13144 /// To provide access to all rows, include the empty string as a prefix ("").
13145 pub row_prefixes: std::vec::Vec<::bytes::Bytes>,
13146
13147 /// Map from column family name to the columns in this family to be included
13148 /// in the AuthorizedView.
13149 pub family_subsets: std::collections::HashMap<
13150 std::string::String,
13151 crate::model::authorized_view::FamilySubsets,
13152 >,
13153
13154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13155 }
13156
13157 impl SubsetView {
13158 pub fn new() -> Self {
13159 std::default::Default::default()
13160 }
13161
13162 /// Sets the value of [row_prefixes][crate::model::authorized_view::SubsetView::row_prefixes].
13163 ///
13164 /// # Example
13165 /// ```ignore,no_run
13166 /// # use google_cloud_bigtable_admin_v2::model::authorized_view::SubsetView;
13167 /// let b1 = bytes::Bytes::from_static(b"abc");
13168 /// let b2 = bytes::Bytes::from_static(b"xyz");
13169 /// let x = SubsetView::new().set_row_prefixes([b1, b2]);
13170 /// ```
13171 pub fn set_row_prefixes<T, V>(mut self, v: T) -> Self
13172 where
13173 T: std::iter::IntoIterator<Item = V>,
13174 V: std::convert::Into<::bytes::Bytes>,
13175 {
13176 use std::iter::Iterator;
13177 self.row_prefixes = v.into_iter().map(|i| i.into()).collect();
13178 self
13179 }
13180
13181 /// Sets the value of [family_subsets][crate::model::authorized_view::SubsetView::family_subsets].
13182 ///
13183 /// # Example
13184 /// ```ignore,no_run
13185 /// # use google_cloud_bigtable_admin_v2::model::authorized_view::SubsetView;
13186 /// use google_cloud_bigtable_admin_v2::model::authorized_view::FamilySubsets;
13187 /// let x = SubsetView::new().set_family_subsets([
13188 /// ("key0", FamilySubsets::default()/* use setters */),
13189 /// ("key1", FamilySubsets::default()/* use (different) setters */),
13190 /// ]);
13191 /// ```
13192 pub fn set_family_subsets<T, K, V>(mut self, v: T) -> Self
13193 where
13194 T: std::iter::IntoIterator<Item = (K, V)>,
13195 K: std::convert::Into<std::string::String>,
13196 V: std::convert::Into<crate::model::authorized_view::FamilySubsets>,
13197 {
13198 use std::iter::Iterator;
13199 self.family_subsets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13200 self
13201 }
13202 }
13203
13204 impl wkt::message::Message for SubsetView {
13205 fn typename() -> &'static str {
13206 "type.googleapis.com/google.bigtable.admin.v2.AuthorizedView.SubsetView"
13207 }
13208 }
13209
13210 /// Defines a subset of an AuthorizedView's fields.
13211 ///
13212 /// # Working with unknown values
13213 ///
13214 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13215 /// additional enum variants at any time. Adding new variants is not considered
13216 /// a breaking change. Applications should write their code in anticipation of:
13217 ///
13218 /// - New values appearing in future releases of the client library, **and**
13219 /// - New values received dynamically, without application changes.
13220 ///
13221 /// Please consult the [Working with enums] section in the user guide for some
13222 /// guidelines.
13223 ///
13224 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13225 #[derive(Clone, Debug, PartialEq)]
13226 #[non_exhaustive]
13227 pub enum ResponseView {
13228 /// Uses the default view for each method as documented in the request.
13229 Unspecified,
13230 /// Only populates `name`.
13231 NameOnly,
13232 /// Only populates the AuthorizedView's basic metadata. This includes:
13233 /// name, deletion_protection, etag.
13234 Basic,
13235 /// Populates every fields.
13236 Full,
13237 /// If set, the enum was initialized with an unknown value.
13238 ///
13239 /// Applications can examine the value using [ResponseView::value] or
13240 /// [ResponseView::name].
13241 UnknownValue(response_view::UnknownValue),
13242 }
13243
13244 #[doc(hidden)]
13245 pub mod response_view {
13246 #[allow(unused_imports)]
13247 use super::*;
13248 #[derive(Clone, Debug, PartialEq)]
13249 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13250 }
13251
13252 impl ResponseView {
13253 /// Gets the enum value.
13254 ///
13255 /// Returns `None` if the enum contains an unknown value deserialized from
13256 /// the string representation of enums.
13257 pub fn value(&self) -> std::option::Option<i32> {
13258 match self {
13259 Self::Unspecified => std::option::Option::Some(0),
13260 Self::NameOnly => std::option::Option::Some(1),
13261 Self::Basic => std::option::Option::Some(2),
13262 Self::Full => std::option::Option::Some(3),
13263 Self::UnknownValue(u) => u.0.value(),
13264 }
13265 }
13266
13267 /// Gets the enum value as a string.
13268 ///
13269 /// Returns `None` if the enum contains an unknown value deserialized from
13270 /// the integer representation of enums.
13271 pub fn name(&self) -> std::option::Option<&str> {
13272 match self {
13273 Self::Unspecified => std::option::Option::Some("RESPONSE_VIEW_UNSPECIFIED"),
13274 Self::NameOnly => std::option::Option::Some("NAME_ONLY"),
13275 Self::Basic => std::option::Option::Some("BASIC"),
13276 Self::Full => std::option::Option::Some("FULL"),
13277 Self::UnknownValue(u) => u.0.name(),
13278 }
13279 }
13280 }
13281
13282 impl std::default::Default for ResponseView {
13283 fn default() -> Self {
13284 use std::convert::From;
13285 Self::from(0)
13286 }
13287 }
13288
13289 impl std::fmt::Display for ResponseView {
13290 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13291 wkt::internal::display_enum(f, self.name(), self.value())
13292 }
13293 }
13294
13295 impl std::convert::From<i32> for ResponseView {
13296 fn from(value: i32) -> Self {
13297 match value {
13298 0 => Self::Unspecified,
13299 1 => Self::NameOnly,
13300 2 => Self::Basic,
13301 3 => Self::Full,
13302 _ => Self::UnknownValue(response_view::UnknownValue(
13303 wkt::internal::UnknownEnumValue::Integer(value),
13304 )),
13305 }
13306 }
13307 }
13308
13309 impl std::convert::From<&str> for ResponseView {
13310 fn from(value: &str) -> Self {
13311 use std::string::ToString;
13312 match value {
13313 "RESPONSE_VIEW_UNSPECIFIED" => Self::Unspecified,
13314 "NAME_ONLY" => Self::NameOnly,
13315 "BASIC" => Self::Basic,
13316 "FULL" => Self::Full,
13317 _ => Self::UnknownValue(response_view::UnknownValue(
13318 wkt::internal::UnknownEnumValue::String(value.to_string()),
13319 )),
13320 }
13321 }
13322 }
13323
13324 impl serde::ser::Serialize for ResponseView {
13325 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13326 where
13327 S: serde::Serializer,
13328 {
13329 match self {
13330 Self::Unspecified => serializer.serialize_i32(0),
13331 Self::NameOnly => serializer.serialize_i32(1),
13332 Self::Basic => serializer.serialize_i32(2),
13333 Self::Full => serializer.serialize_i32(3),
13334 Self::UnknownValue(u) => u.0.serialize(serializer),
13335 }
13336 }
13337 }
13338
13339 impl<'de> serde::de::Deserialize<'de> for ResponseView {
13340 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13341 where
13342 D: serde::Deserializer<'de>,
13343 {
13344 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResponseView>::new(
13345 ".google.bigtable.admin.v2.AuthorizedView.ResponseView",
13346 ))
13347 }
13348 }
13349
13350 /// The type of this AuthorizedView.
13351 #[derive(Clone, Debug, PartialEq)]
13352 #[non_exhaustive]
13353 pub enum AuthorizedView {
13354 /// An AuthorizedView permitting access to an explicit subset of a Table.
13355 SubsetView(std::boxed::Box<crate::model::authorized_view::SubsetView>),
13356 }
13357}
13358
13359/// A set of columns within a table which share a common configuration.
13360#[derive(Clone, Default, PartialEq)]
13361#[non_exhaustive]
13362pub struct ColumnFamily {
13363 /// Garbage collection rule specified as a protobuf.
13364 /// Must serialize to at most 500 bytes.
13365 ///
13366 /// NOTE: Garbage collection executes opportunistically in the background, and
13367 /// so it's possible for reads to return a cell even if it matches the active
13368 /// GC expression for its family.
13369 pub gc_rule: std::option::Option<crate::model::GcRule>,
13370
13371 /// The type of data stored in each of this family's cell values, including its
13372 /// full encoding. If omitted, the family only serves raw untyped bytes.
13373 ///
13374 /// For now, only the `Aggregate` type is supported.
13375 ///
13376 /// `Aggregate` can only be set at family creation and is immutable afterwards.
13377 ///
13378 /// If `value_type` is `Aggregate`, written data must be compatible with:
13379 ///
13380 /// * `value_type.input_type` for `AddInput` mutations
13381 pub value_type: std::option::Option<crate::model::Type>,
13382
13383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13384}
13385
13386impl ColumnFamily {
13387 pub fn new() -> Self {
13388 std::default::Default::default()
13389 }
13390
13391 /// Sets the value of [gc_rule][crate::model::ColumnFamily::gc_rule].
13392 ///
13393 /// # Example
13394 /// ```ignore,no_run
13395 /// # use google_cloud_bigtable_admin_v2::model::ColumnFamily;
13396 /// use google_cloud_bigtable_admin_v2::model::GcRule;
13397 /// let x = ColumnFamily::new().set_gc_rule(GcRule::default()/* use setters */);
13398 /// ```
13399 pub fn set_gc_rule<T>(mut self, v: T) -> Self
13400 where
13401 T: std::convert::Into<crate::model::GcRule>,
13402 {
13403 self.gc_rule = std::option::Option::Some(v.into());
13404 self
13405 }
13406
13407 /// Sets or clears the value of [gc_rule][crate::model::ColumnFamily::gc_rule].
13408 ///
13409 /// # Example
13410 /// ```ignore,no_run
13411 /// # use google_cloud_bigtable_admin_v2::model::ColumnFamily;
13412 /// use google_cloud_bigtable_admin_v2::model::GcRule;
13413 /// let x = ColumnFamily::new().set_or_clear_gc_rule(Some(GcRule::default()/* use setters */));
13414 /// let x = ColumnFamily::new().set_or_clear_gc_rule(None::<GcRule>);
13415 /// ```
13416 pub fn set_or_clear_gc_rule<T>(mut self, v: std::option::Option<T>) -> Self
13417 where
13418 T: std::convert::Into<crate::model::GcRule>,
13419 {
13420 self.gc_rule = v.map(|x| x.into());
13421 self
13422 }
13423
13424 /// Sets the value of [value_type][crate::model::ColumnFamily::value_type].
13425 ///
13426 /// # Example
13427 /// ```ignore,no_run
13428 /// # use google_cloud_bigtable_admin_v2::model::ColumnFamily;
13429 /// use google_cloud_bigtable_admin_v2::model::Type;
13430 /// let x = ColumnFamily::new().set_value_type(Type::default()/* use setters */);
13431 /// ```
13432 pub fn set_value_type<T>(mut self, v: T) -> Self
13433 where
13434 T: std::convert::Into<crate::model::Type>,
13435 {
13436 self.value_type = std::option::Option::Some(v.into());
13437 self
13438 }
13439
13440 /// Sets or clears the value of [value_type][crate::model::ColumnFamily::value_type].
13441 ///
13442 /// # Example
13443 /// ```ignore,no_run
13444 /// # use google_cloud_bigtable_admin_v2::model::ColumnFamily;
13445 /// use google_cloud_bigtable_admin_v2::model::Type;
13446 /// let x = ColumnFamily::new().set_or_clear_value_type(Some(Type::default()/* use setters */));
13447 /// let x = ColumnFamily::new().set_or_clear_value_type(None::<Type>);
13448 /// ```
13449 pub fn set_or_clear_value_type<T>(mut self, v: std::option::Option<T>) -> Self
13450 where
13451 T: std::convert::Into<crate::model::Type>,
13452 {
13453 self.value_type = v.map(|x| x.into());
13454 self
13455 }
13456}
13457
13458impl wkt::message::Message for ColumnFamily {
13459 fn typename() -> &'static str {
13460 "type.googleapis.com/google.bigtable.admin.v2.ColumnFamily"
13461 }
13462}
13463
13464/// Rule for determining which cells to delete during garbage collection.
13465#[derive(Clone, Default, PartialEq)]
13466#[non_exhaustive]
13467pub struct GcRule {
13468 /// Garbage collection rules.
13469 pub rule: std::option::Option<crate::model::gc_rule::Rule>,
13470
13471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13472}
13473
13474impl GcRule {
13475 pub fn new() -> Self {
13476 std::default::Default::default()
13477 }
13478
13479 /// Sets the value of [rule][crate::model::GcRule::rule].
13480 ///
13481 /// Note that all the setters affecting `rule` are mutually
13482 /// exclusive.
13483 ///
13484 /// # Example
13485 /// ```ignore,no_run
13486 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
13487 /// use google_cloud_bigtable_admin_v2::model::gc_rule::Rule;
13488 /// let x = GcRule::new().set_rule(Some(Rule::MaxNumVersions(42)));
13489 /// ```
13490 pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::gc_rule::Rule>>>(
13491 mut self,
13492 v: T,
13493 ) -> Self {
13494 self.rule = v.into();
13495 self
13496 }
13497
13498 /// The value of [rule][crate::model::GcRule::rule]
13499 /// if it holds a `MaxNumVersions`, `None` if the field is not set or
13500 /// holds a different branch.
13501 pub fn max_num_versions(&self) -> std::option::Option<&i32> {
13502 #[allow(unreachable_patterns)]
13503 self.rule.as_ref().and_then(|v| match v {
13504 crate::model::gc_rule::Rule::MaxNumVersions(v) => std::option::Option::Some(v),
13505 _ => std::option::Option::None,
13506 })
13507 }
13508
13509 /// Sets the value of [rule][crate::model::GcRule::rule]
13510 /// to hold a `MaxNumVersions`.
13511 ///
13512 /// Note that all the setters affecting `rule` are
13513 /// mutually exclusive.
13514 ///
13515 /// # Example
13516 /// ```ignore,no_run
13517 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
13518 /// let x = GcRule::new().set_max_num_versions(42);
13519 /// assert!(x.max_num_versions().is_some());
13520 /// assert!(x.max_age().is_none());
13521 /// assert!(x.intersection().is_none());
13522 /// assert!(x.union().is_none());
13523 /// ```
13524 pub fn set_max_num_versions<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13525 self.rule =
13526 std::option::Option::Some(crate::model::gc_rule::Rule::MaxNumVersions(v.into()));
13527 self
13528 }
13529
13530 /// The value of [rule][crate::model::GcRule::rule]
13531 /// if it holds a `MaxAge`, `None` if the field is not set or
13532 /// holds a different branch.
13533 pub fn max_age(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
13534 #[allow(unreachable_patterns)]
13535 self.rule.as_ref().and_then(|v| match v {
13536 crate::model::gc_rule::Rule::MaxAge(v) => std::option::Option::Some(v),
13537 _ => std::option::Option::None,
13538 })
13539 }
13540
13541 /// Sets the value of [rule][crate::model::GcRule::rule]
13542 /// to hold a `MaxAge`.
13543 ///
13544 /// Note that all the setters affecting `rule` are
13545 /// mutually exclusive.
13546 ///
13547 /// # Example
13548 /// ```ignore,no_run
13549 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
13550 /// use wkt::Duration;
13551 /// let x = GcRule::new().set_max_age(Duration::default()/* use setters */);
13552 /// assert!(x.max_age().is_some());
13553 /// assert!(x.max_num_versions().is_none());
13554 /// assert!(x.intersection().is_none());
13555 /// assert!(x.union().is_none());
13556 /// ```
13557 pub fn set_max_age<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
13558 mut self,
13559 v: T,
13560 ) -> Self {
13561 self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::MaxAge(v.into()));
13562 self
13563 }
13564
13565 /// The value of [rule][crate::model::GcRule::rule]
13566 /// if it holds a `Intersection`, `None` if the field is not set or
13567 /// holds a different branch.
13568 pub fn intersection(
13569 &self,
13570 ) -> std::option::Option<&std::boxed::Box<crate::model::gc_rule::Intersection>> {
13571 #[allow(unreachable_patterns)]
13572 self.rule.as_ref().and_then(|v| match v {
13573 crate::model::gc_rule::Rule::Intersection(v) => std::option::Option::Some(v),
13574 _ => std::option::Option::None,
13575 })
13576 }
13577
13578 /// Sets the value of [rule][crate::model::GcRule::rule]
13579 /// to hold a `Intersection`.
13580 ///
13581 /// Note that all the setters affecting `rule` are
13582 /// mutually exclusive.
13583 ///
13584 /// # Example
13585 /// ```ignore,no_run
13586 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
13587 /// use google_cloud_bigtable_admin_v2::model::gc_rule::Intersection;
13588 /// let x = GcRule::new().set_intersection(Intersection::default()/* use setters */);
13589 /// assert!(x.intersection().is_some());
13590 /// assert!(x.max_num_versions().is_none());
13591 /// assert!(x.max_age().is_none());
13592 /// assert!(x.union().is_none());
13593 /// ```
13594 pub fn set_intersection<
13595 T: std::convert::Into<std::boxed::Box<crate::model::gc_rule::Intersection>>,
13596 >(
13597 mut self,
13598 v: T,
13599 ) -> Self {
13600 self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::Intersection(v.into()));
13601 self
13602 }
13603
13604 /// The value of [rule][crate::model::GcRule::rule]
13605 /// if it holds a `Union`, `None` if the field is not set or
13606 /// holds a different branch.
13607 pub fn union(&self) -> std::option::Option<&std::boxed::Box<crate::model::gc_rule::Union>> {
13608 #[allow(unreachable_patterns)]
13609 self.rule.as_ref().and_then(|v| match v {
13610 crate::model::gc_rule::Rule::Union(v) => std::option::Option::Some(v),
13611 _ => std::option::Option::None,
13612 })
13613 }
13614
13615 /// Sets the value of [rule][crate::model::GcRule::rule]
13616 /// to hold a `Union`.
13617 ///
13618 /// Note that all the setters affecting `rule` are
13619 /// mutually exclusive.
13620 ///
13621 /// # Example
13622 /// ```ignore,no_run
13623 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
13624 /// use google_cloud_bigtable_admin_v2::model::gc_rule::Union;
13625 /// let x = GcRule::new().set_union(Union::default()/* use setters */);
13626 /// assert!(x.union().is_some());
13627 /// assert!(x.max_num_versions().is_none());
13628 /// assert!(x.max_age().is_none());
13629 /// assert!(x.intersection().is_none());
13630 /// ```
13631 pub fn set_union<T: std::convert::Into<std::boxed::Box<crate::model::gc_rule::Union>>>(
13632 mut self,
13633 v: T,
13634 ) -> Self {
13635 self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::Union(v.into()));
13636 self
13637 }
13638}
13639
13640impl wkt::message::Message for GcRule {
13641 fn typename() -> &'static str {
13642 "type.googleapis.com/google.bigtable.admin.v2.GcRule"
13643 }
13644}
13645
13646/// Defines additional types related to [GcRule].
13647pub mod gc_rule {
13648 #[allow(unused_imports)]
13649 use super::*;
13650
13651 /// A GcRule which deletes cells matching all of the given rules.
13652 #[derive(Clone, Default, PartialEq)]
13653 #[non_exhaustive]
13654 pub struct Intersection {
13655 /// Only delete cells which would be deleted by every element of `rules`.
13656 pub rules: std::vec::Vec<crate::model::GcRule>,
13657
13658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13659 }
13660
13661 impl Intersection {
13662 pub fn new() -> Self {
13663 std::default::Default::default()
13664 }
13665
13666 /// Sets the value of [rules][crate::model::gc_rule::Intersection::rules].
13667 ///
13668 /// # Example
13669 /// ```ignore,no_run
13670 /// # use google_cloud_bigtable_admin_v2::model::gc_rule::Intersection;
13671 /// use google_cloud_bigtable_admin_v2::model::GcRule;
13672 /// let x = Intersection::new()
13673 /// .set_rules([
13674 /// GcRule::default()/* use setters */,
13675 /// GcRule::default()/* use (different) setters */,
13676 /// ]);
13677 /// ```
13678 pub fn set_rules<T, V>(mut self, v: T) -> Self
13679 where
13680 T: std::iter::IntoIterator<Item = V>,
13681 V: std::convert::Into<crate::model::GcRule>,
13682 {
13683 use std::iter::Iterator;
13684 self.rules = v.into_iter().map(|i| i.into()).collect();
13685 self
13686 }
13687 }
13688
13689 impl wkt::message::Message for Intersection {
13690 fn typename() -> &'static str {
13691 "type.googleapis.com/google.bigtable.admin.v2.GcRule.Intersection"
13692 }
13693 }
13694
13695 /// A GcRule which deletes cells matching any of the given rules.
13696 #[derive(Clone, Default, PartialEq)]
13697 #[non_exhaustive]
13698 pub struct Union {
13699 /// Delete cells which would be deleted by any element of `rules`.
13700 pub rules: std::vec::Vec<crate::model::GcRule>,
13701
13702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13703 }
13704
13705 impl Union {
13706 pub fn new() -> Self {
13707 std::default::Default::default()
13708 }
13709
13710 /// Sets the value of [rules][crate::model::gc_rule::Union::rules].
13711 ///
13712 /// # Example
13713 /// ```ignore,no_run
13714 /// # use google_cloud_bigtable_admin_v2::model::gc_rule::Union;
13715 /// use google_cloud_bigtable_admin_v2::model::GcRule;
13716 /// let x = Union::new()
13717 /// .set_rules([
13718 /// GcRule::default()/* use setters */,
13719 /// GcRule::default()/* use (different) setters */,
13720 /// ]);
13721 /// ```
13722 pub fn set_rules<T, V>(mut self, v: T) -> Self
13723 where
13724 T: std::iter::IntoIterator<Item = V>,
13725 V: std::convert::Into<crate::model::GcRule>,
13726 {
13727 use std::iter::Iterator;
13728 self.rules = v.into_iter().map(|i| i.into()).collect();
13729 self
13730 }
13731 }
13732
13733 impl wkt::message::Message for Union {
13734 fn typename() -> &'static str {
13735 "type.googleapis.com/google.bigtable.admin.v2.GcRule.Union"
13736 }
13737 }
13738
13739 /// Garbage collection rules.
13740 #[derive(Clone, Debug, PartialEq)]
13741 #[non_exhaustive]
13742 pub enum Rule {
13743 /// Delete all cells in a column except the most recent N.
13744 MaxNumVersions(i32),
13745 /// Delete cells in a column older than the given age.
13746 /// Values must be at least one millisecond, and will be truncated to
13747 /// microsecond granularity.
13748 MaxAge(std::boxed::Box<wkt::Duration>),
13749 /// Delete cells that would be deleted by every nested rule.
13750 Intersection(std::boxed::Box<crate::model::gc_rule::Intersection>),
13751 /// Delete cells that would be deleted by any nested rule.
13752 Union(std::boxed::Box<crate::model::gc_rule::Union>),
13753 }
13754}
13755
13756/// Encryption information for a given resource.
13757/// If this resource is protected with customer managed encryption, the in-use
13758/// Cloud Key Management Service (Cloud KMS) key version is specified along with
13759/// its status.
13760#[derive(Clone, Default, PartialEq)]
13761#[non_exhaustive]
13762pub struct EncryptionInfo {
13763 /// Output only. The type of encryption used to protect this resource.
13764 pub encryption_type: crate::model::encryption_info::EncryptionType,
13765
13766 /// Output only. The status of encrypt/decrypt calls on underlying data for
13767 /// this resource. Regardless of status, the existing data is always encrypted
13768 /// at rest.
13769 pub encryption_status: std::option::Option<google_cloud_rpc::model::Status>,
13770
13771 /// Output only. The version of the Cloud KMS key specified in the parent
13772 /// cluster that is in use for the data underlying this table.
13773 pub kms_key_version: std::string::String,
13774
13775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13776}
13777
13778impl EncryptionInfo {
13779 pub fn new() -> Self {
13780 std::default::Default::default()
13781 }
13782
13783 /// Sets the value of [encryption_type][crate::model::EncryptionInfo::encryption_type].
13784 ///
13785 /// # Example
13786 /// ```ignore,no_run
13787 /// # use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
13788 /// use google_cloud_bigtable_admin_v2::model::encryption_info::EncryptionType;
13789 /// let x0 = EncryptionInfo::new().set_encryption_type(EncryptionType::GoogleDefaultEncryption);
13790 /// let x1 = EncryptionInfo::new().set_encryption_type(EncryptionType::CustomerManagedEncryption);
13791 /// ```
13792 pub fn set_encryption_type<
13793 T: std::convert::Into<crate::model::encryption_info::EncryptionType>,
13794 >(
13795 mut self,
13796 v: T,
13797 ) -> Self {
13798 self.encryption_type = v.into();
13799 self
13800 }
13801
13802 /// Sets the value of [encryption_status][crate::model::EncryptionInfo::encryption_status].
13803 ///
13804 /// # Example
13805 /// ```ignore,no_run
13806 /// # use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
13807 /// use google_cloud_rpc::model::Status;
13808 /// let x = EncryptionInfo::new().set_encryption_status(Status::default()/* use setters */);
13809 /// ```
13810 pub fn set_encryption_status<T>(mut self, v: T) -> Self
13811 where
13812 T: std::convert::Into<google_cloud_rpc::model::Status>,
13813 {
13814 self.encryption_status = std::option::Option::Some(v.into());
13815 self
13816 }
13817
13818 /// Sets or clears the value of [encryption_status][crate::model::EncryptionInfo::encryption_status].
13819 ///
13820 /// # Example
13821 /// ```ignore,no_run
13822 /// # use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
13823 /// use google_cloud_rpc::model::Status;
13824 /// let x = EncryptionInfo::new().set_or_clear_encryption_status(Some(Status::default()/* use setters */));
13825 /// let x = EncryptionInfo::new().set_or_clear_encryption_status(None::<Status>);
13826 /// ```
13827 pub fn set_or_clear_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
13828 where
13829 T: std::convert::Into<google_cloud_rpc::model::Status>,
13830 {
13831 self.encryption_status = v.map(|x| x.into());
13832 self
13833 }
13834
13835 /// Sets the value of [kms_key_version][crate::model::EncryptionInfo::kms_key_version].
13836 ///
13837 /// # Example
13838 /// ```ignore,no_run
13839 /// # use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
13840 /// let x = EncryptionInfo::new().set_kms_key_version("example");
13841 /// ```
13842 pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13843 self.kms_key_version = v.into();
13844 self
13845 }
13846}
13847
13848impl wkt::message::Message for EncryptionInfo {
13849 fn typename() -> &'static str {
13850 "type.googleapis.com/google.bigtable.admin.v2.EncryptionInfo"
13851 }
13852}
13853
13854/// Defines additional types related to [EncryptionInfo].
13855pub mod encryption_info {
13856 #[allow(unused_imports)]
13857 use super::*;
13858
13859 /// Possible encryption types for a resource.
13860 ///
13861 /// # Working with unknown values
13862 ///
13863 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13864 /// additional enum variants at any time. Adding new variants is not considered
13865 /// a breaking change. Applications should write their code in anticipation of:
13866 ///
13867 /// - New values appearing in future releases of the client library, **and**
13868 /// - New values received dynamically, without application changes.
13869 ///
13870 /// Please consult the [Working with enums] section in the user guide for some
13871 /// guidelines.
13872 ///
13873 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13874 #[derive(Clone, Debug, PartialEq)]
13875 #[non_exhaustive]
13876 pub enum EncryptionType {
13877 /// Encryption type was not specified, though data at rest remains encrypted.
13878 Unspecified,
13879 /// The data backing this resource is encrypted at rest with a key that is
13880 /// fully managed by Google. No key version or status will be populated.
13881 /// This is the default state.
13882 GoogleDefaultEncryption,
13883 /// The data backing this resource is encrypted at rest with a key that is
13884 /// managed by the customer.
13885 /// The in-use version of the key and its status are populated for
13886 /// CMEK-protected tables.
13887 /// CMEK-protected backups are pinned to the key version that was in use at
13888 /// the time the backup was taken. This key version is populated but its
13889 /// status is not tracked and is reported as `UNKNOWN`.
13890 CustomerManagedEncryption,
13891 /// If set, the enum was initialized with an unknown value.
13892 ///
13893 /// Applications can examine the value using [EncryptionType::value] or
13894 /// [EncryptionType::name].
13895 UnknownValue(encryption_type::UnknownValue),
13896 }
13897
13898 #[doc(hidden)]
13899 pub mod encryption_type {
13900 #[allow(unused_imports)]
13901 use super::*;
13902 #[derive(Clone, Debug, PartialEq)]
13903 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13904 }
13905
13906 impl EncryptionType {
13907 /// Gets the enum value.
13908 ///
13909 /// Returns `None` if the enum contains an unknown value deserialized from
13910 /// the string representation of enums.
13911 pub fn value(&self) -> std::option::Option<i32> {
13912 match self {
13913 Self::Unspecified => std::option::Option::Some(0),
13914 Self::GoogleDefaultEncryption => std::option::Option::Some(1),
13915 Self::CustomerManagedEncryption => std::option::Option::Some(2),
13916 Self::UnknownValue(u) => u.0.value(),
13917 }
13918 }
13919
13920 /// Gets the enum value as a string.
13921 ///
13922 /// Returns `None` if the enum contains an unknown value deserialized from
13923 /// the integer representation of enums.
13924 pub fn name(&self) -> std::option::Option<&str> {
13925 match self {
13926 Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
13927 Self::GoogleDefaultEncryption => {
13928 std::option::Option::Some("GOOGLE_DEFAULT_ENCRYPTION")
13929 }
13930 Self::CustomerManagedEncryption => {
13931 std::option::Option::Some("CUSTOMER_MANAGED_ENCRYPTION")
13932 }
13933 Self::UnknownValue(u) => u.0.name(),
13934 }
13935 }
13936 }
13937
13938 impl std::default::Default for EncryptionType {
13939 fn default() -> Self {
13940 use std::convert::From;
13941 Self::from(0)
13942 }
13943 }
13944
13945 impl std::fmt::Display for EncryptionType {
13946 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13947 wkt::internal::display_enum(f, self.name(), self.value())
13948 }
13949 }
13950
13951 impl std::convert::From<i32> for EncryptionType {
13952 fn from(value: i32) -> Self {
13953 match value {
13954 0 => Self::Unspecified,
13955 1 => Self::GoogleDefaultEncryption,
13956 2 => Self::CustomerManagedEncryption,
13957 _ => Self::UnknownValue(encryption_type::UnknownValue(
13958 wkt::internal::UnknownEnumValue::Integer(value),
13959 )),
13960 }
13961 }
13962 }
13963
13964 impl std::convert::From<&str> for EncryptionType {
13965 fn from(value: &str) -> Self {
13966 use std::string::ToString;
13967 match value {
13968 "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
13969 "GOOGLE_DEFAULT_ENCRYPTION" => Self::GoogleDefaultEncryption,
13970 "CUSTOMER_MANAGED_ENCRYPTION" => Self::CustomerManagedEncryption,
13971 _ => Self::UnknownValue(encryption_type::UnknownValue(
13972 wkt::internal::UnknownEnumValue::String(value.to_string()),
13973 )),
13974 }
13975 }
13976 }
13977
13978 impl serde::ser::Serialize for EncryptionType {
13979 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13980 where
13981 S: serde::Serializer,
13982 {
13983 match self {
13984 Self::Unspecified => serializer.serialize_i32(0),
13985 Self::GoogleDefaultEncryption => serializer.serialize_i32(1),
13986 Self::CustomerManagedEncryption => serializer.serialize_i32(2),
13987 Self::UnknownValue(u) => u.0.serialize(serializer),
13988 }
13989 }
13990 }
13991
13992 impl<'de> serde::de::Deserialize<'de> for EncryptionType {
13993 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13994 where
13995 D: serde::Deserializer<'de>,
13996 {
13997 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
13998 ".google.bigtable.admin.v2.EncryptionInfo.EncryptionType",
13999 ))
14000 }
14001 }
14002}
14003
14004/// A snapshot of a table at a particular time. A snapshot can be used as a
14005/// checkpoint for data restoration or a data source for a new table.
14006///
14007/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
14008/// feature is not currently available to most Cloud Bigtable customers. This
14009/// feature might be changed in backward-incompatible ways and is not recommended
14010/// for production use. It is not subject to any SLA or deprecation policy.
14011#[derive(Clone, Default, PartialEq)]
14012#[non_exhaustive]
14013pub struct Snapshot {
14014 /// The unique name of the snapshot.
14015 /// Values are of the form
14016 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
14017 pub name: std::string::String,
14018
14019 /// Output only. The source table at the time the snapshot was taken.
14020 pub source_table: std::option::Option<crate::model::Table>,
14021
14022 /// Output only. The size of the data in the source table at the time the
14023 /// snapshot was taken. In some cases, this value may be computed
14024 /// asynchronously via a background process and a placeholder of 0 will be used
14025 /// in the meantime.
14026 pub data_size_bytes: i64,
14027
14028 /// Output only. The time when the snapshot is created.
14029 pub create_time: std::option::Option<wkt::Timestamp>,
14030
14031 /// The time when the snapshot will be deleted. The maximum amount of time a
14032 /// snapshot can stay active is 365 days. If 'ttl' is not specified,
14033 /// the default maximum of 365 days will be used.
14034 pub delete_time: std::option::Option<wkt::Timestamp>,
14035
14036 /// Output only. The current state of the snapshot.
14037 pub state: crate::model::snapshot::State,
14038
14039 /// Description of the snapshot.
14040 pub description: std::string::String,
14041
14042 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14043}
14044
14045impl Snapshot {
14046 pub fn new() -> Self {
14047 std::default::Default::default()
14048 }
14049
14050 /// Sets the value of [name][crate::model::Snapshot::name].
14051 ///
14052 /// # Example
14053 /// ```ignore,no_run
14054 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14055 /// let x = Snapshot::new().set_name("example");
14056 /// ```
14057 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14058 self.name = v.into();
14059 self
14060 }
14061
14062 /// Sets the value of [source_table][crate::model::Snapshot::source_table].
14063 ///
14064 /// # Example
14065 /// ```ignore,no_run
14066 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14067 /// use google_cloud_bigtable_admin_v2::model::Table;
14068 /// let x = Snapshot::new().set_source_table(Table::default()/* use setters */);
14069 /// ```
14070 pub fn set_source_table<T>(mut self, v: T) -> Self
14071 where
14072 T: std::convert::Into<crate::model::Table>,
14073 {
14074 self.source_table = std::option::Option::Some(v.into());
14075 self
14076 }
14077
14078 /// Sets or clears the value of [source_table][crate::model::Snapshot::source_table].
14079 ///
14080 /// # Example
14081 /// ```ignore,no_run
14082 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14083 /// use google_cloud_bigtable_admin_v2::model::Table;
14084 /// let x = Snapshot::new().set_or_clear_source_table(Some(Table::default()/* use setters */));
14085 /// let x = Snapshot::new().set_or_clear_source_table(None::<Table>);
14086 /// ```
14087 pub fn set_or_clear_source_table<T>(mut self, v: std::option::Option<T>) -> Self
14088 where
14089 T: std::convert::Into<crate::model::Table>,
14090 {
14091 self.source_table = v.map(|x| x.into());
14092 self
14093 }
14094
14095 /// Sets the value of [data_size_bytes][crate::model::Snapshot::data_size_bytes].
14096 ///
14097 /// # Example
14098 /// ```ignore,no_run
14099 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14100 /// let x = Snapshot::new().set_data_size_bytes(42);
14101 /// ```
14102 pub fn set_data_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14103 self.data_size_bytes = v.into();
14104 self
14105 }
14106
14107 /// Sets the value of [create_time][crate::model::Snapshot::create_time].
14108 ///
14109 /// # Example
14110 /// ```ignore,no_run
14111 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14112 /// use wkt::Timestamp;
14113 /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
14114 /// ```
14115 pub fn set_create_time<T>(mut self, v: T) -> Self
14116 where
14117 T: std::convert::Into<wkt::Timestamp>,
14118 {
14119 self.create_time = std::option::Option::Some(v.into());
14120 self
14121 }
14122
14123 /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
14124 ///
14125 /// # Example
14126 /// ```ignore,no_run
14127 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14128 /// use wkt::Timestamp;
14129 /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14130 /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
14131 /// ```
14132 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14133 where
14134 T: std::convert::Into<wkt::Timestamp>,
14135 {
14136 self.create_time = v.map(|x| x.into());
14137 self
14138 }
14139
14140 /// Sets the value of [delete_time][crate::model::Snapshot::delete_time].
14141 ///
14142 /// # Example
14143 /// ```ignore,no_run
14144 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14145 /// use wkt::Timestamp;
14146 /// let x = Snapshot::new().set_delete_time(Timestamp::default()/* use setters */);
14147 /// ```
14148 pub fn set_delete_time<T>(mut self, v: T) -> Self
14149 where
14150 T: std::convert::Into<wkt::Timestamp>,
14151 {
14152 self.delete_time = std::option::Option::Some(v.into());
14153 self
14154 }
14155
14156 /// Sets or clears the value of [delete_time][crate::model::Snapshot::delete_time].
14157 ///
14158 /// # Example
14159 /// ```ignore,no_run
14160 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14161 /// use wkt::Timestamp;
14162 /// let x = Snapshot::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
14163 /// let x = Snapshot::new().set_or_clear_delete_time(None::<Timestamp>);
14164 /// ```
14165 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
14166 where
14167 T: std::convert::Into<wkt::Timestamp>,
14168 {
14169 self.delete_time = v.map(|x| x.into());
14170 self
14171 }
14172
14173 /// Sets the value of [state][crate::model::Snapshot::state].
14174 ///
14175 /// # Example
14176 /// ```ignore,no_run
14177 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14178 /// use google_cloud_bigtable_admin_v2::model::snapshot::State;
14179 /// let x0 = Snapshot::new().set_state(State::Ready);
14180 /// let x1 = Snapshot::new().set_state(State::Creating);
14181 /// ```
14182 pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
14183 self.state = v.into();
14184 self
14185 }
14186
14187 /// Sets the value of [description][crate::model::Snapshot::description].
14188 ///
14189 /// # Example
14190 /// ```ignore,no_run
14191 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
14192 /// let x = Snapshot::new().set_description("example");
14193 /// ```
14194 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14195 self.description = v.into();
14196 self
14197 }
14198}
14199
14200impl wkt::message::Message for Snapshot {
14201 fn typename() -> &'static str {
14202 "type.googleapis.com/google.bigtable.admin.v2.Snapshot"
14203 }
14204}
14205
14206/// Defines additional types related to [Snapshot].
14207pub mod snapshot {
14208 #[allow(unused_imports)]
14209 use super::*;
14210
14211 /// Possible states of a snapshot.
14212 ///
14213 /// # Working with unknown values
14214 ///
14215 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14216 /// additional enum variants at any time. Adding new variants is not considered
14217 /// a breaking change. Applications should write their code in anticipation of:
14218 ///
14219 /// - New values appearing in future releases of the client library, **and**
14220 /// - New values received dynamically, without application changes.
14221 ///
14222 /// Please consult the [Working with enums] section in the user guide for some
14223 /// guidelines.
14224 ///
14225 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14226 #[derive(Clone, Debug, PartialEq)]
14227 #[non_exhaustive]
14228 pub enum State {
14229 /// The state of the snapshot could not be determined.
14230 NotKnown,
14231 /// The snapshot has been successfully created and can serve all requests.
14232 Ready,
14233 /// The snapshot is currently being created, and may be destroyed if the
14234 /// creation process encounters an error. A snapshot may not be restored to a
14235 /// table while it is being created.
14236 Creating,
14237 /// If set, the enum was initialized with an unknown value.
14238 ///
14239 /// Applications can examine the value using [State::value] or
14240 /// [State::name].
14241 UnknownValue(state::UnknownValue),
14242 }
14243
14244 #[doc(hidden)]
14245 pub mod state {
14246 #[allow(unused_imports)]
14247 use super::*;
14248 #[derive(Clone, Debug, PartialEq)]
14249 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14250 }
14251
14252 impl State {
14253 /// Gets the enum value.
14254 ///
14255 /// Returns `None` if the enum contains an unknown value deserialized from
14256 /// the string representation of enums.
14257 pub fn value(&self) -> std::option::Option<i32> {
14258 match self {
14259 Self::NotKnown => std::option::Option::Some(0),
14260 Self::Ready => std::option::Option::Some(1),
14261 Self::Creating => std::option::Option::Some(2),
14262 Self::UnknownValue(u) => u.0.value(),
14263 }
14264 }
14265
14266 /// Gets the enum value as a string.
14267 ///
14268 /// Returns `None` if the enum contains an unknown value deserialized from
14269 /// the integer representation of enums.
14270 pub fn name(&self) -> std::option::Option<&str> {
14271 match self {
14272 Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
14273 Self::Ready => std::option::Option::Some("READY"),
14274 Self::Creating => std::option::Option::Some("CREATING"),
14275 Self::UnknownValue(u) => u.0.name(),
14276 }
14277 }
14278 }
14279
14280 impl std::default::Default for State {
14281 fn default() -> Self {
14282 use std::convert::From;
14283 Self::from(0)
14284 }
14285 }
14286
14287 impl std::fmt::Display for State {
14288 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14289 wkt::internal::display_enum(f, self.name(), self.value())
14290 }
14291 }
14292
14293 impl std::convert::From<i32> for State {
14294 fn from(value: i32) -> Self {
14295 match value {
14296 0 => Self::NotKnown,
14297 1 => Self::Ready,
14298 2 => Self::Creating,
14299 _ => Self::UnknownValue(state::UnknownValue(
14300 wkt::internal::UnknownEnumValue::Integer(value),
14301 )),
14302 }
14303 }
14304 }
14305
14306 impl std::convert::From<&str> for State {
14307 fn from(value: &str) -> Self {
14308 use std::string::ToString;
14309 match value {
14310 "STATE_NOT_KNOWN" => Self::NotKnown,
14311 "READY" => Self::Ready,
14312 "CREATING" => Self::Creating,
14313 _ => Self::UnknownValue(state::UnknownValue(
14314 wkt::internal::UnknownEnumValue::String(value.to_string()),
14315 )),
14316 }
14317 }
14318 }
14319
14320 impl serde::ser::Serialize for State {
14321 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14322 where
14323 S: serde::Serializer,
14324 {
14325 match self {
14326 Self::NotKnown => serializer.serialize_i32(0),
14327 Self::Ready => serializer.serialize_i32(1),
14328 Self::Creating => serializer.serialize_i32(2),
14329 Self::UnknownValue(u) => u.0.serialize(serializer),
14330 }
14331 }
14332 }
14333
14334 impl<'de> serde::de::Deserialize<'de> for State {
14335 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14336 where
14337 D: serde::Deserializer<'de>,
14338 {
14339 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14340 ".google.bigtable.admin.v2.Snapshot.State",
14341 ))
14342 }
14343 }
14344}
14345
14346/// A backup of a Cloud Bigtable table.
14347#[derive(Clone, Default, PartialEq)]
14348#[non_exhaustive]
14349pub struct Backup {
14350 /// A globally unique identifier for the backup which cannot be
14351 /// changed. Values are of the form
14352 /// `projects/{project}/instances/{instance}/clusters/{cluster}/
14353 /// backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
14354 /// The final segment of the name must be between 1 and 50 characters
14355 /// in length.
14356 ///
14357 /// The backup is stored in the cluster identified by the prefix of the backup
14358 /// name of the form
14359 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
14360 pub name: std::string::String,
14361
14362 /// Required. Immutable. Name of the table from which this backup was created.
14363 /// This needs to be in the same instance as the backup. Values are of the form
14364 /// `projects/{project}/instances/{instance}/tables/{source_table}`.
14365 pub source_table: std::string::String,
14366
14367 /// Output only. Name of the backup from which this backup was copied. If a
14368 /// backup is not created by copying a backup, this field will be empty. Values
14369 /// are of the form:
14370 /// projects/\<project\>/instances/\<instance\>/clusters/\<cluster\>/backups/\<backup\>
14371 pub source_backup: std::string::String,
14372
14373 /// Required. The expiration time of the backup.
14374 /// When creating a backup or updating its `expire_time`, the value must be
14375 /// greater than the backup creation time by:
14376 ///
14377 /// - At least 6 hours
14378 /// - At most 90 days
14379 ///
14380 /// Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
14381 pub expire_time: std::option::Option<wkt::Timestamp>,
14382
14383 /// Output only. `start_time` is the time that the backup was started
14384 /// (i.e. approximately the time the
14385 /// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
14386 /// request is received). The row data in this backup will be no older than
14387 /// this timestamp.
14388 ///
14389 /// [google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]: crate::client::BigtableTableAdmin::create_backup
14390 pub start_time: std::option::Option<wkt::Timestamp>,
14391
14392 /// Output only. `end_time` is the time that the backup was finished. The row
14393 /// data in the backup will be no newer than this timestamp.
14394 pub end_time: std::option::Option<wkt::Timestamp>,
14395
14396 /// Output only. Size of the backup in bytes.
14397 pub size_bytes: i64,
14398
14399 /// Output only. The current state of the backup.
14400 pub state: crate::model::backup::State,
14401
14402 /// Output only. The encryption information for the backup.
14403 pub encryption_info: std::option::Option<crate::model::EncryptionInfo>,
14404
14405 /// Indicates the backup type of the backup.
14406 pub backup_type: crate::model::backup::BackupType,
14407
14408 /// The time at which the hot backup will be converted to a standard backup.
14409 /// Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
14410 /// hot backup to a standard backup. This value must be greater than the backup
14411 /// creation time by:
14412 ///
14413 /// - At least 24 hours
14414 ///
14415 /// This field only applies for hot backups. When creating or updating a
14416 /// standard backup, attempting to set this field will fail the request.
14417 pub hot_to_standard_time: std::option::Option<wkt::Timestamp>,
14418
14419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14420}
14421
14422impl Backup {
14423 pub fn new() -> Self {
14424 std::default::Default::default()
14425 }
14426
14427 /// Sets the value of [name][crate::model::Backup::name].
14428 ///
14429 /// # Example
14430 /// ```ignore,no_run
14431 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14432 /// let x = Backup::new().set_name("example");
14433 /// ```
14434 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14435 self.name = v.into();
14436 self
14437 }
14438
14439 /// Sets the value of [source_table][crate::model::Backup::source_table].
14440 ///
14441 /// # Example
14442 /// ```ignore,no_run
14443 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14444 /// let x = Backup::new().set_source_table("example");
14445 /// ```
14446 pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14447 self.source_table = v.into();
14448 self
14449 }
14450
14451 /// Sets the value of [source_backup][crate::model::Backup::source_backup].
14452 ///
14453 /// # Example
14454 /// ```ignore,no_run
14455 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14456 /// let x = Backup::new().set_source_backup("example");
14457 /// ```
14458 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14459 self.source_backup = v.into();
14460 self
14461 }
14462
14463 /// Sets the value of [expire_time][crate::model::Backup::expire_time].
14464 ///
14465 /// # Example
14466 /// ```ignore,no_run
14467 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14468 /// use wkt::Timestamp;
14469 /// let x = Backup::new().set_expire_time(Timestamp::default()/* use setters */);
14470 /// ```
14471 pub fn set_expire_time<T>(mut self, v: T) -> Self
14472 where
14473 T: std::convert::Into<wkt::Timestamp>,
14474 {
14475 self.expire_time = std::option::Option::Some(v.into());
14476 self
14477 }
14478
14479 /// Sets or clears the value of [expire_time][crate::model::Backup::expire_time].
14480 ///
14481 /// # Example
14482 /// ```ignore,no_run
14483 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14484 /// use wkt::Timestamp;
14485 /// let x = Backup::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
14486 /// let x = Backup::new().set_or_clear_expire_time(None::<Timestamp>);
14487 /// ```
14488 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
14489 where
14490 T: std::convert::Into<wkt::Timestamp>,
14491 {
14492 self.expire_time = v.map(|x| x.into());
14493 self
14494 }
14495
14496 /// Sets the value of [start_time][crate::model::Backup::start_time].
14497 ///
14498 /// # Example
14499 /// ```ignore,no_run
14500 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14501 /// use wkt::Timestamp;
14502 /// let x = Backup::new().set_start_time(Timestamp::default()/* use setters */);
14503 /// ```
14504 pub fn set_start_time<T>(mut self, v: T) -> Self
14505 where
14506 T: std::convert::Into<wkt::Timestamp>,
14507 {
14508 self.start_time = std::option::Option::Some(v.into());
14509 self
14510 }
14511
14512 /// Sets or clears the value of [start_time][crate::model::Backup::start_time].
14513 ///
14514 /// # Example
14515 /// ```ignore,no_run
14516 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14517 /// use wkt::Timestamp;
14518 /// let x = Backup::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
14519 /// let x = Backup::new().set_or_clear_start_time(None::<Timestamp>);
14520 /// ```
14521 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
14522 where
14523 T: std::convert::Into<wkt::Timestamp>,
14524 {
14525 self.start_time = v.map(|x| x.into());
14526 self
14527 }
14528
14529 /// Sets the value of [end_time][crate::model::Backup::end_time].
14530 ///
14531 /// # Example
14532 /// ```ignore,no_run
14533 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14534 /// use wkt::Timestamp;
14535 /// let x = Backup::new().set_end_time(Timestamp::default()/* use setters */);
14536 /// ```
14537 pub fn set_end_time<T>(mut self, v: T) -> Self
14538 where
14539 T: std::convert::Into<wkt::Timestamp>,
14540 {
14541 self.end_time = std::option::Option::Some(v.into());
14542 self
14543 }
14544
14545 /// Sets or clears the value of [end_time][crate::model::Backup::end_time].
14546 ///
14547 /// # Example
14548 /// ```ignore,no_run
14549 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14550 /// use wkt::Timestamp;
14551 /// let x = Backup::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
14552 /// let x = Backup::new().set_or_clear_end_time(None::<Timestamp>);
14553 /// ```
14554 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
14555 where
14556 T: std::convert::Into<wkt::Timestamp>,
14557 {
14558 self.end_time = v.map(|x| x.into());
14559 self
14560 }
14561
14562 /// Sets the value of [size_bytes][crate::model::Backup::size_bytes].
14563 ///
14564 /// # Example
14565 /// ```ignore,no_run
14566 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14567 /// let x = Backup::new().set_size_bytes(42);
14568 /// ```
14569 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14570 self.size_bytes = v.into();
14571 self
14572 }
14573
14574 /// Sets the value of [state][crate::model::Backup::state].
14575 ///
14576 /// # Example
14577 /// ```ignore,no_run
14578 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14579 /// use google_cloud_bigtable_admin_v2::model::backup::State;
14580 /// let x0 = Backup::new().set_state(State::Creating);
14581 /// let x1 = Backup::new().set_state(State::Ready);
14582 /// ```
14583 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
14584 self.state = v.into();
14585 self
14586 }
14587
14588 /// Sets the value of [encryption_info][crate::model::Backup::encryption_info].
14589 ///
14590 /// # Example
14591 /// ```ignore,no_run
14592 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14593 /// use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
14594 /// let x = Backup::new().set_encryption_info(EncryptionInfo::default()/* use setters */);
14595 /// ```
14596 pub fn set_encryption_info<T>(mut self, v: T) -> Self
14597 where
14598 T: std::convert::Into<crate::model::EncryptionInfo>,
14599 {
14600 self.encryption_info = std::option::Option::Some(v.into());
14601 self
14602 }
14603
14604 /// Sets or clears the value of [encryption_info][crate::model::Backup::encryption_info].
14605 ///
14606 /// # Example
14607 /// ```ignore,no_run
14608 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14609 /// use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
14610 /// let x = Backup::new().set_or_clear_encryption_info(Some(EncryptionInfo::default()/* use setters */));
14611 /// let x = Backup::new().set_or_clear_encryption_info(None::<EncryptionInfo>);
14612 /// ```
14613 pub fn set_or_clear_encryption_info<T>(mut self, v: std::option::Option<T>) -> Self
14614 where
14615 T: std::convert::Into<crate::model::EncryptionInfo>,
14616 {
14617 self.encryption_info = v.map(|x| x.into());
14618 self
14619 }
14620
14621 /// Sets the value of [backup_type][crate::model::Backup::backup_type].
14622 ///
14623 /// # Example
14624 /// ```ignore,no_run
14625 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14626 /// use google_cloud_bigtable_admin_v2::model::backup::BackupType;
14627 /// let x0 = Backup::new().set_backup_type(BackupType::Standard);
14628 /// let x1 = Backup::new().set_backup_type(BackupType::Hot);
14629 /// ```
14630 pub fn set_backup_type<T: std::convert::Into<crate::model::backup::BackupType>>(
14631 mut self,
14632 v: T,
14633 ) -> Self {
14634 self.backup_type = v.into();
14635 self
14636 }
14637
14638 /// Sets the value of [hot_to_standard_time][crate::model::Backup::hot_to_standard_time].
14639 ///
14640 /// # Example
14641 /// ```ignore,no_run
14642 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14643 /// use wkt::Timestamp;
14644 /// let x = Backup::new().set_hot_to_standard_time(Timestamp::default()/* use setters */);
14645 /// ```
14646 pub fn set_hot_to_standard_time<T>(mut self, v: T) -> Self
14647 where
14648 T: std::convert::Into<wkt::Timestamp>,
14649 {
14650 self.hot_to_standard_time = std::option::Option::Some(v.into());
14651 self
14652 }
14653
14654 /// Sets or clears the value of [hot_to_standard_time][crate::model::Backup::hot_to_standard_time].
14655 ///
14656 /// # Example
14657 /// ```ignore,no_run
14658 /// # use google_cloud_bigtable_admin_v2::model::Backup;
14659 /// use wkt::Timestamp;
14660 /// let x = Backup::new().set_or_clear_hot_to_standard_time(Some(Timestamp::default()/* use setters */));
14661 /// let x = Backup::new().set_or_clear_hot_to_standard_time(None::<Timestamp>);
14662 /// ```
14663 pub fn set_or_clear_hot_to_standard_time<T>(mut self, v: std::option::Option<T>) -> Self
14664 where
14665 T: std::convert::Into<wkt::Timestamp>,
14666 {
14667 self.hot_to_standard_time = v.map(|x| x.into());
14668 self
14669 }
14670}
14671
14672impl wkt::message::Message for Backup {
14673 fn typename() -> &'static str {
14674 "type.googleapis.com/google.bigtable.admin.v2.Backup"
14675 }
14676}
14677
14678/// Defines additional types related to [Backup].
14679pub mod backup {
14680 #[allow(unused_imports)]
14681 use super::*;
14682
14683 /// Indicates the current state of the backup.
14684 ///
14685 /// # Working with unknown values
14686 ///
14687 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14688 /// additional enum variants at any time. Adding new variants is not considered
14689 /// a breaking change. Applications should write their code in anticipation of:
14690 ///
14691 /// - New values appearing in future releases of the client library, **and**
14692 /// - New values received dynamically, without application changes.
14693 ///
14694 /// Please consult the [Working with enums] section in the user guide for some
14695 /// guidelines.
14696 ///
14697 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14698 #[derive(Clone, Debug, PartialEq)]
14699 #[non_exhaustive]
14700 pub enum State {
14701 /// Not specified.
14702 Unspecified,
14703 /// The pending backup is still being created. Operations on the
14704 /// backup may fail with `FAILED_PRECONDITION` in this state.
14705 Creating,
14706 /// The backup is complete and ready for use.
14707 Ready,
14708 /// If set, the enum was initialized with an unknown value.
14709 ///
14710 /// Applications can examine the value using [State::value] or
14711 /// [State::name].
14712 UnknownValue(state::UnknownValue),
14713 }
14714
14715 #[doc(hidden)]
14716 pub mod state {
14717 #[allow(unused_imports)]
14718 use super::*;
14719 #[derive(Clone, Debug, PartialEq)]
14720 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14721 }
14722
14723 impl State {
14724 /// Gets the enum value.
14725 ///
14726 /// Returns `None` if the enum contains an unknown value deserialized from
14727 /// the string representation of enums.
14728 pub fn value(&self) -> std::option::Option<i32> {
14729 match self {
14730 Self::Unspecified => std::option::Option::Some(0),
14731 Self::Creating => std::option::Option::Some(1),
14732 Self::Ready => std::option::Option::Some(2),
14733 Self::UnknownValue(u) => u.0.value(),
14734 }
14735 }
14736
14737 /// Gets the enum value as a string.
14738 ///
14739 /// Returns `None` if the enum contains an unknown value deserialized from
14740 /// the integer representation of enums.
14741 pub fn name(&self) -> std::option::Option<&str> {
14742 match self {
14743 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14744 Self::Creating => std::option::Option::Some("CREATING"),
14745 Self::Ready => std::option::Option::Some("READY"),
14746 Self::UnknownValue(u) => u.0.name(),
14747 }
14748 }
14749 }
14750
14751 impl std::default::Default for State {
14752 fn default() -> Self {
14753 use std::convert::From;
14754 Self::from(0)
14755 }
14756 }
14757
14758 impl std::fmt::Display for State {
14759 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14760 wkt::internal::display_enum(f, self.name(), self.value())
14761 }
14762 }
14763
14764 impl std::convert::From<i32> for State {
14765 fn from(value: i32) -> Self {
14766 match value {
14767 0 => Self::Unspecified,
14768 1 => Self::Creating,
14769 2 => Self::Ready,
14770 _ => Self::UnknownValue(state::UnknownValue(
14771 wkt::internal::UnknownEnumValue::Integer(value),
14772 )),
14773 }
14774 }
14775 }
14776
14777 impl std::convert::From<&str> for State {
14778 fn from(value: &str) -> Self {
14779 use std::string::ToString;
14780 match value {
14781 "STATE_UNSPECIFIED" => Self::Unspecified,
14782 "CREATING" => Self::Creating,
14783 "READY" => Self::Ready,
14784 _ => Self::UnknownValue(state::UnknownValue(
14785 wkt::internal::UnknownEnumValue::String(value.to_string()),
14786 )),
14787 }
14788 }
14789 }
14790
14791 impl serde::ser::Serialize for State {
14792 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14793 where
14794 S: serde::Serializer,
14795 {
14796 match self {
14797 Self::Unspecified => serializer.serialize_i32(0),
14798 Self::Creating => serializer.serialize_i32(1),
14799 Self::Ready => serializer.serialize_i32(2),
14800 Self::UnknownValue(u) => u.0.serialize(serializer),
14801 }
14802 }
14803 }
14804
14805 impl<'de> serde::de::Deserialize<'de> for State {
14806 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14807 where
14808 D: serde::Deserializer<'de>,
14809 {
14810 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14811 ".google.bigtable.admin.v2.Backup.State",
14812 ))
14813 }
14814 }
14815
14816 /// The type of the backup.
14817 ///
14818 /// # Working with unknown values
14819 ///
14820 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14821 /// additional enum variants at any time. Adding new variants is not considered
14822 /// a breaking change. Applications should write their code in anticipation of:
14823 ///
14824 /// - New values appearing in future releases of the client library, **and**
14825 /// - New values received dynamically, without application changes.
14826 ///
14827 /// Please consult the [Working with enums] section in the user guide for some
14828 /// guidelines.
14829 ///
14830 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14831 #[derive(Clone, Debug, PartialEq)]
14832 #[non_exhaustive]
14833 pub enum BackupType {
14834 /// Not specified.
14835 Unspecified,
14836 /// The default type for Cloud Bigtable managed backups. Supported for
14837 /// backups created in both HDD and SSD instances. Requires optimization when
14838 /// restored to a table in an SSD instance.
14839 Standard,
14840 /// A backup type with faster restore to SSD performance. Only supported for
14841 /// backups created in SSD instances. A new SSD table restored from a hot
14842 /// backup reaches production performance more quickly than a standard
14843 /// backup.
14844 Hot,
14845 /// If set, the enum was initialized with an unknown value.
14846 ///
14847 /// Applications can examine the value using [BackupType::value] or
14848 /// [BackupType::name].
14849 UnknownValue(backup_type::UnknownValue),
14850 }
14851
14852 #[doc(hidden)]
14853 pub mod backup_type {
14854 #[allow(unused_imports)]
14855 use super::*;
14856 #[derive(Clone, Debug, PartialEq)]
14857 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14858 }
14859
14860 impl BackupType {
14861 /// Gets the enum value.
14862 ///
14863 /// Returns `None` if the enum contains an unknown value deserialized from
14864 /// the string representation of enums.
14865 pub fn value(&self) -> std::option::Option<i32> {
14866 match self {
14867 Self::Unspecified => std::option::Option::Some(0),
14868 Self::Standard => std::option::Option::Some(1),
14869 Self::Hot => std::option::Option::Some(2),
14870 Self::UnknownValue(u) => u.0.value(),
14871 }
14872 }
14873
14874 /// Gets the enum value as a string.
14875 ///
14876 /// Returns `None` if the enum contains an unknown value deserialized from
14877 /// the integer representation of enums.
14878 pub fn name(&self) -> std::option::Option<&str> {
14879 match self {
14880 Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
14881 Self::Standard => std::option::Option::Some("STANDARD"),
14882 Self::Hot => std::option::Option::Some("HOT"),
14883 Self::UnknownValue(u) => u.0.name(),
14884 }
14885 }
14886 }
14887
14888 impl std::default::Default for BackupType {
14889 fn default() -> Self {
14890 use std::convert::From;
14891 Self::from(0)
14892 }
14893 }
14894
14895 impl std::fmt::Display for BackupType {
14896 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14897 wkt::internal::display_enum(f, self.name(), self.value())
14898 }
14899 }
14900
14901 impl std::convert::From<i32> for BackupType {
14902 fn from(value: i32) -> Self {
14903 match value {
14904 0 => Self::Unspecified,
14905 1 => Self::Standard,
14906 2 => Self::Hot,
14907 _ => Self::UnknownValue(backup_type::UnknownValue(
14908 wkt::internal::UnknownEnumValue::Integer(value),
14909 )),
14910 }
14911 }
14912 }
14913
14914 impl std::convert::From<&str> for BackupType {
14915 fn from(value: &str) -> Self {
14916 use std::string::ToString;
14917 match value {
14918 "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
14919 "STANDARD" => Self::Standard,
14920 "HOT" => Self::Hot,
14921 _ => Self::UnknownValue(backup_type::UnknownValue(
14922 wkt::internal::UnknownEnumValue::String(value.to_string()),
14923 )),
14924 }
14925 }
14926 }
14927
14928 impl serde::ser::Serialize for BackupType {
14929 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14930 where
14931 S: serde::Serializer,
14932 {
14933 match self {
14934 Self::Unspecified => serializer.serialize_i32(0),
14935 Self::Standard => serializer.serialize_i32(1),
14936 Self::Hot => serializer.serialize_i32(2),
14937 Self::UnknownValue(u) => u.0.serialize(serializer),
14938 }
14939 }
14940 }
14941
14942 impl<'de> serde::de::Deserialize<'de> for BackupType {
14943 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14944 where
14945 D: serde::Deserializer<'de>,
14946 {
14947 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
14948 ".google.bigtable.admin.v2.Backup.BackupType",
14949 ))
14950 }
14951 }
14952}
14953
14954/// Information about a backup.
14955#[derive(Clone, Default, PartialEq)]
14956#[non_exhaustive]
14957pub struct BackupInfo {
14958 /// Output only. Name of the backup.
14959 pub backup: std::string::String,
14960
14961 /// Output only. The time that the backup was started. Row data in the backup
14962 /// will be no older than this timestamp.
14963 pub start_time: std::option::Option<wkt::Timestamp>,
14964
14965 /// Output only. This time that the backup was finished. Row data in the
14966 /// backup will be no newer than this timestamp.
14967 pub end_time: std::option::Option<wkt::Timestamp>,
14968
14969 /// Output only. Name of the table the backup was created from.
14970 pub source_table: std::string::String,
14971
14972 /// Output only. Name of the backup from which this backup was copied. If a
14973 /// backup is not created by copying a backup, this field will be empty. Values
14974 /// are of the form:
14975 /// projects/\<project\>/instances/\<instance\>/clusters/\<cluster\>/backups/\<backup\>
14976 pub source_backup: std::string::String,
14977
14978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14979}
14980
14981impl BackupInfo {
14982 pub fn new() -> Self {
14983 std::default::Default::default()
14984 }
14985
14986 /// Sets the value of [backup][crate::model::BackupInfo::backup].
14987 ///
14988 /// # Example
14989 /// ```ignore,no_run
14990 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
14991 /// let x = BackupInfo::new().set_backup("example");
14992 /// ```
14993 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14994 self.backup = v.into();
14995 self
14996 }
14997
14998 /// Sets the value of [start_time][crate::model::BackupInfo::start_time].
14999 ///
15000 /// # Example
15001 /// ```ignore,no_run
15002 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
15003 /// use wkt::Timestamp;
15004 /// let x = BackupInfo::new().set_start_time(Timestamp::default()/* use setters */);
15005 /// ```
15006 pub fn set_start_time<T>(mut self, v: T) -> Self
15007 where
15008 T: std::convert::Into<wkt::Timestamp>,
15009 {
15010 self.start_time = std::option::Option::Some(v.into());
15011 self
15012 }
15013
15014 /// Sets or clears the value of [start_time][crate::model::BackupInfo::start_time].
15015 ///
15016 /// # Example
15017 /// ```ignore,no_run
15018 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
15019 /// use wkt::Timestamp;
15020 /// let x = BackupInfo::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
15021 /// let x = BackupInfo::new().set_or_clear_start_time(None::<Timestamp>);
15022 /// ```
15023 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15024 where
15025 T: std::convert::Into<wkt::Timestamp>,
15026 {
15027 self.start_time = v.map(|x| x.into());
15028 self
15029 }
15030
15031 /// Sets the value of [end_time][crate::model::BackupInfo::end_time].
15032 ///
15033 /// # Example
15034 /// ```ignore,no_run
15035 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
15036 /// use wkt::Timestamp;
15037 /// let x = BackupInfo::new().set_end_time(Timestamp::default()/* use setters */);
15038 /// ```
15039 pub fn set_end_time<T>(mut self, v: T) -> Self
15040 where
15041 T: std::convert::Into<wkt::Timestamp>,
15042 {
15043 self.end_time = std::option::Option::Some(v.into());
15044 self
15045 }
15046
15047 /// Sets or clears the value of [end_time][crate::model::BackupInfo::end_time].
15048 ///
15049 /// # Example
15050 /// ```ignore,no_run
15051 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
15052 /// use wkt::Timestamp;
15053 /// let x = BackupInfo::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15054 /// let x = BackupInfo::new().set_or_clear_end_time(None::<Timestamp>);
15055 /// ```
15056 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15057 where
15058 T: std::convert::Into<wkt::Timestamp>,
15059 {
15060 self.end_time = v.map(|x| x.into());
15061 self
15062 }
15063
15064 /// Sets the value of [source_table][crate::model::BackupInfo::source_table].
15065 ///
15066 /// # Example
15067 /// ```ignore,no_run
15068 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
15069 /// let x = BackupInfo::new().set_source_table("example");
15070 /// ```
15071 pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15072 self.source_table = v.into();
15073 self
15074 }
15075
15076 /// Sets the value of [source_backup][crate::model::BackupInfo::source_backup].
15077 ///
15078 /// # Example
15079 /// ```ignore,no_run
15080 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
15081 /// let x = BackupInfo::new().set_source_backup("example");
15082 /// ```
15083 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15084 self.source_backup = v.into();
15085 self
15086 }
15087}
15088
15089impl wkt::message::Message for BackupInfo {
15090 fn typename() -> &'static str {
15091 "type.googleapis.com/google.bigtable.admin.v2.BackupInfo"
15092 }
15093}
15094
15095/// Config for tiered storage.
15096/// A valid config must have a valid TieredStorageRule. Otherwise the whole
15097/// TieredStorageConfig must be unset.
15098/// By default all data is stored in the SSD tier (only SSD instances can
15099/// configure tiered storage).
15100#[derive(Clone, Default, PartialEq)]
15101#[non_exhaustive]
15102pub struct TieredStorageConfig {
15103 /// Rule to specify what data is stored in the infrequent access(IA) tier.
15104 /// The IA tier allows storing more data per node with reduced performance.
15105 pub infrequent_access: std::option::Option<crate::model::TieredStorageRule>,
15106
15107 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15108}
15109
15110impl TieredStorageConfig {
15111 pub fn new() -> Self {
15112 std::default::Default::default()
15113 }
15114
15115 /// Sets the value of [infrequent_access][crate::model::TieredStorageConfig::infrequent_access].
15116 ///
15117 /// # Example
15118 /// ```ignore,no_run
15119 /// # use google_cloud_bigtable_admin_v2::model::TieredStorageConfig;
15120 /// use google_cloud_bigtable_admin_v2::model::TieredStorageRule;
15121 /// let x = TieredStorageConfig::new().set_infrequent_access(TieredStorageRule::default()/* use setters */);
15122 /// ```
15123 pub fn set_infrequent_access<T>(mut self, v: T) -> Self
15124 where
15125 T: std::convert::Into<crate::model::TieredStorageRule>,
15126 {
15127 self.infrequent_access = std::option::Option::Some(v.into());
15128 self
15129 }
15130
15131 /// Sets or clears the value of [infrequent_access][crate::model::TieredStorageConfig::infrequent_access].
15132 ///
15133 /// # Example
15134 /// ```ignore,no_run
15135 /// # use google_cloud_bigtable_admin_v2::model::TieredStorageConfig;
15136 /// use google_cloud_bigtable_admin_v2::model::TieredStorageRule;
15137 /// let x = TieredStorageConfig::new().set_or_clear_infrequent_access(Some(TieredStorageRule::default()/* use setters */));
15138 /// let x = TieredStorageConfig::new().set_or_clear_infrequent_access(None::<TieredStorageRule>);
15139 /// ```
15140 pub fn set_or_clear_infrequent_access<T>(mut self, v: std::option::Option<T>) -> Self
15141 where
15142 T: std::convert::Into<crate::model::TieredStorageRule>,
15143 {
15144 self.infrequent_access = v.map(|x| x.into());
15145 self
15146 }
15147}
15148
15149impl wkt::message::Message for TieredStorageConfig {
15150 fn typename() -> &'static str {
15151 "type.googleapis.com/google.bigtable.admin.v2.TieredStorageConfig"
15152 }
15153}
15154
15155/// Rule to specify what data is stored in a storage tier.
15156#[derive(Clone, Default, PartialEq)]
15157#[non_exhaustive]
15158pub struct TieredStorageRule {
15159 /// Rules to specify what data is stored in this tier.
15160 pub rule: std::option::Option<crate::model::tiered_storage_rule::Rule>,
15161
15162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15163}
15164
15165impl TieredStorageRule {
15166 pub fn new() -> Self {
15167 std::default::Default::default()
15168 }
15169
15170 /// Sets the value of [rule][crate::model::TieredStorageRule::rule].
15171 ///
15172 /// Note that all the setters affecting `rule` are mutually
15173 /// exclusive.
15174 ///
15175 /// # Example
15176 /// ```ignore,no_run
15177 /// # use google_cloud_bigtable_admin_v2::model::TieredStorageRule;
15178 /// use wkt::Duration;
15179 /// let x = TieredStorageRule::new().set_rule(Some(
15180 /// google_cloud_bigtable_admin_v2::model::tiered_storage_rule::Rule::IncludeIfOlderThan(Duration::default().into())));
15181 /// ```
15182 pub fn set_rule<
15183 T: std::convert::Into<std::option::Option<crate::model::tiered_storage_rule::Rule>>,
15184 >(
15185 mut self,
15186 v: T,
15187 ) -> Self {
15188 self.rule = v.into();
15189 self
15190 }
15191
15192 /// The value of [rule][crate::model::TieredStorageRule::rule]
15193 /// if it holds a `IncludeIfOlderThan`, `None` if the field is not set or
15194 /// holds a different branch.
15195 pub fn include_if_older_than(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
15196 #[allow(unreachable_patterns)]
15197 self.rule.as_ref().and_then(|v| match v {
15198 crate::model::tiered_storage_rule::Rule::IncludeIfOlderThan(v) => {
15199 std::option::Option::Some(v)
15200 }
15201 _ => std::option::Option::None,
15202 })
15203 }
15204
15205 /// Sets the value of [rule][crate::model::TieredStorageRule::rule]
15206 /// to hold a `IncludeIfOlderThan`.
15207 ///
15208 /// Note that all the setters affecting `rule` are
15209 /// mutually exclusive.
15210 ///
15211 /// # Example
15212 /// ```ignore,no_run
15213 /// # use google_cloud_bigtable_admin_v2::model::TieredStorageRule;
15214 /// use wkt::Duration;
15215 /// let x = TieredStorageRule::new().set_include_if_older_than(Duration::default()/* use setters */);
15216 /// assert!(x.include_if_older_than().is_some());
15217 /// ```
15218 pub fn set_include_if_older_than<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
15219 mut self,
15220 v: T,
15221 ) -> Self {
15222 self.rule = std::option::Option::Some(
15223 crate::model::tiered_storage_rule::Rule::IncludeIfOlderThan(v.into()),
15224 );
15225 self
15226 }
15227}
15228
15229impl wkt::message::Message for TieredStorageRule {
15230 fn typename() -> &'static str {
15231 "type.googleapis.com/google.bigtable.admin.v2.TieredStorageRule"
15232 }
15233}
15234
15235/// Defines additional types related to [TieredStorageRule].
15236pub mod tiered_storage_rule {
15237 #[allow(unused_imports)]
15238 use super::*;
15239
15240 /// Rules to specify what data is stored in this tier.
15241 #[derive(Clone, Debug, PartialEq)]
15242 #[non_exhaustive]
15243 pub enum Rule {
15244 /// Include cells older than the given age.
15245 /// For the infrequent access tier, this value must be at least 30 days.
15246 IncludeIfOlderThan(std::boxed::Box<wkt::Duration>),
15247 }
15248}
15249
15250/// Represents a protobuf schema.
15251#[derive(Clone, Default, PartialEq)]
15252#[non_exhaustive]
15253pub struct ProtoSchema {
15254 /// Required. Contains a protobuf-serialized
15255 /// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto),
15256 /// which could include multiple proto files.
15257 /// To generate it, [install](https://grpc.io/docs/protoc-installation/) and
15258 /// run `protoc` with
15259 /// `--include_imports` and `--descriptor_set_out`. For example, to generate
15260 /// for moon/shot/app.proto, run
15261 ///
15262 /// ```norust
15263 /// $protoc --proto_path=/app_path --proto_path=/lib_path \
15264 /// --include_imports \
15265 /// --descriptor_set_out=descriptors.pb \
15266 /// moon/shot/app.proto
15267 /// ```
15268 ///
15269 /// For more details, see protobuffer [self
15270 /// description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
15271 pub proto_descriptors: ::bytes::Bytes,
15272
15273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15274}
15275
15276impl ProtoSchema {
15277 pub fn new() -> Self {
15278 std::default::Default::default()
15279 }
15280
15281 /// Sets the value of [proto_descriptors][crate::model::ProtoSchema::proto_descriptors].
15282 ///
15283 /// # Example
15284 /// ```ignore,no_run
15285 /// # use google_cloud_bigtable_admin_v2::model::ProtoSchema;
15286 /// let x = ProtoSchema::new().set_proto_descriptors(bytes::Bytes::from_static(b"example"));
15287 /// ```
15288 pub fn set_proto_descriptors<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
15289 self.proto_descriptors = v.into();
15290 self
15291 }
15292}
15293
15294impl wkt::message::Message for ProtoSchema {
15295 fn typename() -> &'static str {
15296 "type.googleapis.com/google.bigtable.admin.v2.ProtoSchema"
15297 }
15298}
15299
15300/// A named collection of related schemas.
15301#[derive(Clone, Default, PartialEq)]
15302#[non_exhaustive]
15303pub struct SchemaBundle {
15304 /// Identifier. The unique name identifying this schema bundle.
15305 /// Values are of the form
15306 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
15307 pub name: std::string::String,
15308
15309 /// Optional. The etag for this schema bundle.
15310 /// This may be sent on update and delete requests to ensure the
15311 /// client has an up-to-date value before proceeding. The server
15312 /// returns an ABORTED error on a mismatched etag.
15313 pub etag: std::string::String,
15314
15315 /// The type of this schema bundle. The oneof case cannot change after
15316 /// creation.
15317 pub r#type: std::option::Option<crate::model::schema_bundle::Type>,
15318
15319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15320}
15321
15322impl SchemaBundle {
15323 pub fn new() -> Self {
15324 std::default::Default::default()
15325 }
15326
15327 /// Sets the value of [name][crate::model::SchemaBundle::name].
15328 ///
15329 /// # Example
15330 /// ```ignore,no_run
15331 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
15332 /// let x = SchemaBundle::new().set_name("example");
15333 /// ```
15334 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15335 self.name = v.into();
15336 self
15337 }
15338
15339 /// Sets the value of [etag][crate::model::SchemaBundle::etag].
15340 ///
15341 /// # Example
15342 /// ```ignore,no_run
15343 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
15344 /// let x = SchemaBundle::new().set_etag("example");
15345 /// ```
15346 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15347 self.etag = v.into();
15348 self
15349 }
15350
15351 /// Sets the value of [r#type][crate::model::SchemaBundle::type].
15352 ///
15353 /// Note that all the setters affecting `r#type` are mutually
15354 /// exclusive.
15355 ///
15356 /// # Example
15357 /// ```ignore,no_run
15358 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
15359 /// use google_cloud_bigtable_admin_v2::model::ProtoSchema;
15360 /// let x = SchemaBundle::new().set_type(Some(
15361 /// google_cloud_bigtable_admin_v2::model::schema_bundle::Type::ProtoSchema(ProtoSchema::default().into())));
15362 /// ```
15363 pub fn set_type<
15364 T: std::convert::Into<std::option::Option<crate::model::schema_bundle::Type>>,
15365 >(
15366 mut self,
15367 v: T,
15368 ) -> Self {
15369 self.r#type = v.into();
15370 self
15371 }
15372
15373 /// The value of [r#type][crate::model::SchemaBundle::r#type]
15374 /// if it holds a `ProtoSchema`, `None` if the field is not set or
15375 /// holds a different branch.
15376 pub fn proto_schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::ProtoSchema>> {
15377 #[allow(unreachable_patterns)]
15378 self.r#type.as_ref().and_then(|v| match v {
15379 crate::model::schema_bundle::Type::ProtoSchema(v) => std::option::Option::Some(v),
15380 _ => std::option::Option::None,
15381 })
15382 }
15383
15384 /// Sets the value of [r#type][crate::model::SchemaBundle::r#type]
15385 /// to hold a `ProtoSchema`.
15386 ///
15387 /// Note that all the setters affecting `r#type` are
15388 /// mutually exclusive.
15389 ///
15390 /// # Example
15391 /// ```ignore,no_run
15392 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
15393 /// use google_cloud_bigtable_admin_v2::model::ProtoSchema;
15394 /// let x = SchemaBundle::new().set_proto_schema(ProtoSchema::default()/* use setters */);
15395 /// assert!(x.proto_schema().is_some());
15396 /// ```
15397 pub fn set_proto_schema<T: std::convert::Into<std::boxed::Box<crate::model::ProtoSchema>>>(
15398 mut self,
15399 v: T,
15400 ) -> Self {
15401 self.r#type =
15402 std::option::Option::Some(crate::model::schema_bundle::Type::ProtoSchema(v.into()));
15403 self
15404 }
15405}
15406
15407impl wkt::message::Message for SchemaBundle {
15408 fn typename() -> &'static str {
15409 "type.googleapis.com/google.bigtable.admin.v2.SchemaBundle"
15410 }
15411}
15412
15413/// Defines additional types related to [SchemaBundle].
15414pub mod schema_bundle {
15415 #[allow(unused_imports)]
15416 use super::*;
15417
15418 /// The type of this schema bundle. The oneof case cannot change after
15419 /// creation.
15420 #[derive(Clone, Debug, PartialEq)]
15421 #[non_exhaustive]
15422 pub enum Type {
15423 /// Schema for Protobufs.
15424 ProtoSchema(std::boxed::Box<crate::model::ProtoSchema>),
15425 }
15426}
15427
15428/// `Type` represents the type of data that is written to, read from, or stored
15429/// in Bigtable. It is heavily based on the GoogleSQL standard to help maintain
15430/// familiarity and consistency across products and features.
15431///
15432/// For compatibility with Bigtable's existing untyped APIs, each `Type` includes
15433/// an `Encoding` which describes how to convert to or from the underlying data.
15434///
15435/// Each encoding can operate in one of two modes:
15436///
15437/// - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)`
15438/// if and only if `X <= Y`. This is useful anywhere sort order is important,
15439/// for example when encoding keys.
15440/// - Distinct: In this mode, Bigtable guarantees that if `X != Y` then
15441/// `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For
15442/// example, both "{'foo': '1', 'bar': '2'}" and "{'bar': '2', 'foo': '1'}"
15443/// are valid encodings of the same JSON value.
15444///
15445/// The API clearly documents which mode is used wherever an encoding can be
15446/// configured. Each encoding also documents which values are supported in which
15447/// modes. For example, when encoding INT64 as a numeric STRING, negative numbers
15448/// cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but
15449/// `STRING("-00001") > STRING("00001")`.
15450#[derive(Clone, Default, PartialEq)]
15451#[non_exhaustive]
15452pub struct Type {
15453 /// The kind of type that this represents.
15454 pub kind: std::option::Option<crate::model::r#type::Kind>,
15455
15456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15457}
15458
15459impl Type {
15460 pub fn new() -> Self {
15461 std::default::Default::default()
15462 }
15463
15464 /// Sets the value of [kind][crate::model::Type::kind].
15465 ///
15466 /// Note that all the setters affecting `kind` are mutually
15467 /// exclusive.
15468 ///
15469 /// # Example
15470 /// ```ignore,no_run
15471 /// # use google_cloud_bigtable_admin_v2::model::Type;
15472 /// use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
15473 /// let x = Type::new().set_kind(Some(
15474 /// google_cloud_bigtable_admin_v2::model::r#type::Kind::BytesType(Bytes::default().into())));
15475 /// ```
15476 pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::r#type::Kind>>>(
15477 mut self,
15478 v: T,
15479 ) -> Self {
15480 self.kind = v.into();
15481 self
15482 }
15483
15484 /// The value of [kind][crate::model::Type::kind]
15485 /// if it holds a `BytesType`, `None` if the field is not set or
15486 /// holds a different branch.
15487 pub fn bytes_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Bytes>> {
15488 #[allow(unreachable_patterns)]
15489 self.kind.as_ref().and_then(|v| match v {
15490 crate::model::r#type::Kind::BytesType(v) => std::option::Option::Some(v),
15491 _ => std::option::Option::None,
15492 })
15493 }
15494
15495 /// Sets the value of [kind][crate::model::Type::kind]
15496 /// to hold a `BytesType`.
15497 ///
15498 /// Note that all the setters affecting `kind` are
15499 /// mutually exclusive.
15500 ///
15501 /// # Example
15502 /// ```ignore,no_run
15503 /// # use google_cloud_bigtable_admin_v2::model::Type;
15504 /// use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
15505 /// let x = Type::new().set_bytes_type(Bytes::default()/* use setters */);
15506 /// assert!(x.bytes_type().is_some());
15507 /// assert!(x.string_type().is_none());
15508 /// assert!(x.int64_type().is_none());
15509 /// assert!(x.float32_type().is_none());
15510 /// assert!(x.float64_type().is_none());
15511 /// assert!(x.bool_type().is_none());
15512 /// assert!(x.timestamp_type().is_none());
15513 /// assert!(x.date_type().is_none());
15514 /// assert!(x.aggregate_type().is_none());
15515 /// assert!(x.struct_type().is_none());
15516 /// assert!(x.array_type().is_none());
15517 /// assert!(x.map_type().is_none());
15518 /// assert!(x.proto_type().is_none());
15519 /// assert!(x.enum_type().is_none());
15520 /// ```
15521 pub fn set_bytes_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Bytes>>>(
15522 mut self,
15523 v: T,
15524 ) -> Self {
15525 self.kind = std::option::Option::Some(crate::model::r#type::Kind::BytesType(v.into()));
15526 self
15527 }
15528
15529 /// The value of [kind][crate::model::Type::kind]
15530 /// if it holds a `StringType`, `None` if the field is not set or
15531 /// holds a different branch.
15532 pub fn string_type(
15533 &self,
15534 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::String>> {
15535 #[allow(unreachable_patterns)]
15536 self.kind.as_ref().and_then(|v| match v {
15537 crate::model::r#type::Kind::StringType(v) => std::option::Option::Some(v),
15538 _ => std::option::Option::None,
15539 })
15540 }
15541
15542 /// Sets the value of [kind][crate::model::Type::kind]
15543 /// to hold a `StringType`.
15544 ///
15545 /// Note that all the setters affecting `kind` are
15546 /// mutually exclusive.
15547 ///
15548 /// # Example
15549 /// ```ignore,no_run
15550 /// # use google_cloud_bigtable_admin_v2::model::Type;
15551 /// use google_cloud_bigtable_admin_v2::model::r#type::String;
15552 /// let x = Type::new().set_string_type(String::default()/* use setters */);
15553 /// assert!(x.string_type().is_some());
15554 /// assert!(x.bytes_type().is_none());
15555 /// assert!(x.int64_type().is_none());
15556 /// assert!(x.float32_type().is_none());
15557 /// assert!(x.float64_type().is_none());
15558 /// assert!(x.bool_type().is_none());
15559 /// assert!(x.timestamp_type().is_none());
15560 /// assert!(x.date_type().is_none());
15561 /// assert!(x.aggregate_type().is_none());
15562 /// assert!(x.struct_type().is_none());
15563 /// assert!(x.array_type().is_none());
15564 /// assert!(x.map_type().is_none());
15565 /// assert!(x.proto_type().is_none());
15566 /// assert!(x.enum_type().is_none());
15567 /// ```
15568 pub fn set_string_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::String>>>(
15569 mut self,
15570 v: T,
15571 ) -> Self {
15572 self.kind = std::option::Option::Some(crate::model::r#type::Kind::StringType(v.into()));
15573 self
15574 }
15575
15576 /// The value of [kind][crate::model::Type::kind]
15577 /// if it holds a `Int64Type`, `None` if the field is not set or
15578 /// holds a different branch.
15579 pub fn int64_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Int64>> {
15580 #[allow(unreachable_patterns)]
15581 self.kind.as_ref().and_then(|v| match v {
15582 crate::model::r#type::Kind::Int64Type(v) => std::option::Option::Some(v),
15583 _ => std::option::Option::None,
15584 })
15585 }
15586
15587 /// Sets the value of [kind][crate::model::Type::kind]
15588 /// to hold a `Int64Type`.
15589 ///
15590 /// Note that all the setters affecting `kind` are
15591 /// mutually exclusive.
15592 ///
15593 /// # Example
15594 /// ```ignore,no_run
15595 /// # use google_cloud_bigtable_admin_v2::model::Type;
15596 /// use google_cloud_bigtable_admin_v2::model::r#type::Int64;
15597 /// let x = Type::new().set_int64_type(Int64::default()/* use setters */);
15598 /// assert!(x.int64_type().is_some());
15599 /// assert!(x.bytes_type().is_none());
15600 /// assert!(x.string_type().is_none());
15601 /// assert!(x.float32_type().is_none());
15602 /// assert!(x.float64_type().is_none());
15603 /// assert!(x.bool_type().is_none());
15604 /// assert!(x.timestamp_type().is_none());
15605 /// assert!(x.date_type().is_none());
15606 /// assert!(x.aggregate_type().is_none());
15607 /// assert!(x.struct_type().is_none());
15608 /// assert!(x.array_type().is_none());
15609 /// assert!(x.map_type().is_none());
15610 /// assert!(x.proto_type().is_none());
15611 /// assert!(x.enum_type().is_none());
15612 /// ```
15613 pub fn set_int64_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Int64>>>(
15614 mut self,
15615 v: T,
15616 ) -> Self {
15617 self.kind = std::option::Option::Some(crate::model::r#type::Kind::Int64Type(v.into()));
15618 self
15619 }
15620
15621 /// The value of [kind][crate::model::Type::kind]
15622 /// if it holds a `Float32Type`, `None` if the field is not set or
15623 /// holds a different branch.
15624 pub fn float32_type(
15625 &self,
15626 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Float32>> {
15627 #[allow(unreachable_patterns)]
15628 self.kind.as_ref().and_then(|v| match v {
15629 crate::model::r#type::Kind::Float32Type(v) => std::option::Option::Some(v),
15630 _ => std::option::Option::None,
15631 })
15632 }
15633
15634 /// Sets the value of [kind][crate::model::Type::kind]
15635 /// to hold a `Float32Type`.
15636 ///
15637 /// Note that all the setters affecting `kind` are
15638 /// mutually exclusive.
15639 ///
15640 /// # Example
15641 /// ```ignore,no_run
15642 /// # use google_cloud_bigtable_admin_v2::model::Type;
15643 /// use google_cloud_bigtable_admin_v2::model::r#type::Float32;
15644 /// let x = Type::new().set_float32_type(Float32::default()/* use setters */);
15645 /// assert!(x.float32_type().is_some());
15646 /// assert!(x.bytes_type().is_none());
15647 /// assert!(x.string_type().is_none());
15648 /// assert!(x.int64_type().is_none());
15649 /// assert!(x.float64_type().is_none());
15650 /// assert!(x.bool_type().is_none());
15651 /// assert!(x.timestamp_type().is_none());
15652 /// assert!(x.date_type().is_none());
15653 /// assert!(x.aggregate_type().is_none());
15654 /// assert!(x.struct_type().is_none());
15655 /// assert!(x.array_type().is_none());
15656 /// assert!(x.map_type().is_none());
15657 /// assert!(x.proto_type().is_none());
15658 /// assert!(x.enum_type().is_none());
15659 /// ```
15660 pub fn set_float32_type<
15661 T: std::convert::Into<std::boxed::Box<crate::model::r#type::Float32>>,
15662 >(
15663 mut self,
15664 v: T,
15665 ) -> Self {
15666 self.kind = std::option::Option::Some(crate::model::r#type::Kind::Float32Type(v.into()));
15667 self
15668 }
15669
15670 /// The value of [kind][crate::model::Type::kind]
15671 /// if it holds a `Float64Type`, `None` if the field is not set or
15672 /// holds a different branch.
15673 pub fn float64_type(
15674 &self,
15675 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Float64>> {
15676 #[allow(unreachable_patterns)]
15677 self.kind.as_ref().and_then(|v| match v {
15678 crate::model::r#type::Kind::Float64Type(v) => std::option::Option::Some(v),
15679 _ => std::option::Option::None,
15680 })
15681 }
15682
15683 /// Sets the value of [kind][crate::model::Type::kind]
15684 /// to hold a `Float64Type`.
15685 ///
15686 /// Note that all the setters affecting `kind` are
15687 /// mutually exclusive.
15688 ///
15689 /// # Example
15690 /// ```ignore,no_run
15691 /// # use google_cloud_bigtable_admin_v2::model::Type;
15692 /// use google_cloud_bigtable_admin_v2::model::r#type::Float64;
15693 /// let x = Type::new().set_float64_type(Float64::default()/* use setters */);
15694 /// assert!(x.float64_type().is_some());
15695 /// assert!(x.bytes_type().is_none());
15696 /// assert!(x.string_type().is_none());
15697 /// assert!(x.int64_type().is_none());
15698 /// assert!(x.float32_type().is_none());
15699 /// assert!(x.bool_type().is_none());
15700 /// assert!(x.timestamp_type().is_none());
15701 /// assert!(x.date_type().is_none());
15702 /// assert!(x.aggregate_type().is_none());
15703 /// assert!(x.struct_type().is_none());
15704 /// assert!(x.array_type().is_none());
15705 /// assert!(x.map_type().is_none());
15706 /// assert!(x.proto_type().is_none());
15707 /// assert!(x.enum_type().is_none());
15708 /// ```
15709 pub fn set_float64_type<
15710 T: std::convert::Into<std::boxed::Box<crate::model::r#type::Float64>>,
15711 >(
15712 mut self,
15713 v: T,
15714 ) -> Self {
15715 self.kind = std::option::Option::Some(crate::model::r#type::Kind::Float64Type(v.into()));
15716 self
15717 }
15718
15719 /// The value of [kind][crate::model::Type::kind]
15720 /// if it holds a `BoolType`, `None` if the field is not set or
15721 /// holds a different branch.
15722 pub fn bool_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Bool>> {
15723 #[allow(unreachable_patterns)]
15724 self.kind.as_ref().and_then(|v| match v {
15725 crate::model::r#type::Kind::BoolType(v) => std::option::Option::Some(v),
15726 _ => std::option::Option::None,
15727 })
15728 }
15729
15730 /// Sets the value of [kind][crate::model::Type::kind]
15731 /// to hold a `BoolType`.
15732 ///
15733 /// Note that all the setters affecting `kind` are
15734 /// mutually exclusive.
15735 ///
15736 /// # Example
15737 /// ```ignore,no_run
15738 /// # use google_cloud_bigtable_admin_v2::model::Type;
15739 /// use google_cloud_bigtable_admin_v2::model::r#type::Bool;
15740 /// let x = Type::new().set_bool_type(Bool::default()/* use setters */);
15741 /// assert!(x.bool_type().is_some());
15742 /// assert!(x.bytes_type().is_none());
15743 /// assert!(x.string_type().is_none());
15744 /// assert!(x.int64_type().is_none());
15745 /// assert!(x.float32_type().is_none());
15746 /// assert!(x.float64_type().is_none());
15747 /// assert!(x.timestamp_type().is_none());
15748 /// assert!(x.date_type().is_none());
15749 /// assert!(x.aggregate_type().is_none());
15750 /// assert!(x.struct_type().is_none());
15751 /// assert!(x.array_type().is_none());
15752 /// assert!(x.map_type().is_none());
15753 /// assert!(x.proto_type().is_none());
15754 /// assert!(x.enum_type().is_none());
15755 /// ```
15756 pub fn set_bool_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Bool>>>(
15757 mut self,
15758 v: T,
15759 ) -> Self {
15760 self.kind = std::option::Option::Some(crate::model::r#type::Kind::BoolType(v.into()));
15761 self
15762 }
15763
15764 /// The value of [kind][crate::model::Type::kind]
15765 /// if it holds a `TimestampType`, `None` if the field is not set or
15766 /// holds a different branch.
15767 pub fn timestamp_type(
15768 &self,
15769 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Timestamp>> {
15770 #[allow(unreachable_patterns)]
15771 self.kind.as_ref().and_then(|v| match v {
15772 crate::model::r#type::Kind::TimestampType(v) => std::option::Option::Some(v),
15773 _ => std::option::Option::None,
15774 })
15775 }
15776
15777 /// Sets the value of [kind][crate::model::Type::kind]
15778 /// to hold a `TimestampType`.
15779 ///
15780 /// Note that all the setters affecting `kind` are
15781 /// mutually exclusive.
15782 ///
15783 /// # Example
15784 /// ```ignore,no_run
15785 /// # use google_cloud_bigtable_admin_v2::model::Type;
15786 /// use google_cloud_bigtable_admin_v2::model::r#type::Timestamp;
15787 /// let x = Type::new().set_timestamp_type(Timestamp::default()/* use setters */);
15788 /// assert!(x.timestamp_type().is_some());
15789 /// assert!(x.bytes_type().is_none());
15790 /// assert!(x.string_type().is_none());
15791 /// assert!(x.int64_type().is_none());
15792 /// assert!(x.float32_type().is_none());
15793 /// assert!(x.float64_type().is_none());
15794 /// assert!(x.bool_type().is_none());
15795 /// assert!(x.date_type().is_none());
15796 /// assert!(x.aggregate_type().is_none());
15797 /// assert!(x.struct_type().is_none());
15798 /// assert!(x.array_type().is_none());
15799 /// assert!(x.map_type().is_none());
15800 /// assert!(x.proto_type().is_none());
15801 /// assert!(x.enum_type().is_none());
15802 /// ```
15803 pub fn set_timestamp_type<
15804 T: std::convert::Into<std::boxed::Box<crate::model::r#type::Timestamp>>,
15805 >(
15806 mut self,
15807 v: T,
15808 ) -> Self {
15809 self.kind = std::option::Option::Some(crate::model::r#type::Kind::TimestampType(v.into()));
15810 self
15811 }
15812
15813 /// The value of [kind][crate::model::Type::kind]
15814 /// if it holds a `DateType`, `None` if the field is not set or
15815 /// holds a different branch.
15816 pub fn date_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Date>> {
15817 #[allow(unreachable_patterns)]
15818 self.kind.as_ref().and_then(|v| match v {
15819 crate::model::r#type::Kind::DateType(v) => std::option::Option::Some(v),
15820 _ => std::option::Option::None,
15821 })
15822 }
15823
15824 /// Sets the value of [kind][crate::model::Type::kind]
15825 /// to hold a `DateType`.
15826 ///
15827 /// Note that all the setters affecting `kind` are
15828 /// mutually exclusive.
15829 ///
15830 /// # Example
15831 /// ```ignore,no_run
15832 /// # use google_cloud_bigtable_admin_v2::model::Type;
15833 /// use google_cloud_bigtable_admin_v2::model::r#type::Date;
15834 /// let x = Type::new().set_date_type(Date::default()/* use setters */);
15835 /// assert!(x.date_type().is_some());
15836 /// assert!(x.bytes_type().is_none());
15837 /// assert!(x.string_type().is_none());
15838 /// assert!(x.int64_type().is_none());
15839 /// assert!(x.float32_type().is_none());
15840 /// assert!(x.float64_type().is_none());
15841 /// assert!(x.bool_type().is_none());
15842 /// assert!(x.timestamp_type().is_none());
15843 /// assert!(x.aggregate_type().is_none());
15844 /// assert!(x.struct_type().is_none());
15845 /// assert!(x.array_type().is_none());
15846 /// assert!(x.map_type().is_none());
15847 /// assert!(x.proto_type().is_none());
15848 /// assert!(x.enum_type().is_none());
15849 /// ```
15850 pub fn set_date_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Date>>>(
15851 mut self,
15852 v: T,
15853 ) -> Self {
15854 self.kind = std::option::Option::Some(crate::model::r#type::Kind::DateType(v.into()));
15855 self
15856 }
15857
15858 /// The value of [kind][crate::model::Type::kind]
15859 /// if it holds a `AggregateType`, `None` if the field is not set or
15860 /// holds a different branch.
15861 pub fn aggregate_type(
15862 &self,
15863 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Aggregate>> {
15864 #[allow(unreachable_patterns)]
15865 self.kind.as_ref().and_then(|v| match v {
15866 crate::model::r#type::Kind::AggregateType(v) => std::option::Option::Some(v),
15867 _ => std::option::Option::None,
15868 })
15869 }
15870
15871 /// Sets the value of [kind][crate::model::Type::kind]
15872 /// to hold a `AggregateType`.
15873 ///
15874 /// Note that all the setters affecting `kind` are
15875 /// mutually exclusive.
15876 ///
15877 /// # Example
15878 /// ```ignore,no_run
15879 /// # use google_cloud_bigtable_admin_v2::model::Type;
15880 /// use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
15881 /// let x = Type::new().set_aggregate_type(Aggregate::default()/* use setters */);
15882 /// assert!(x.aggregate_type().is_some());
15883 /// assert!(x.bytes_type().is_none());
15884 /// assert!(x.string_type().is_none());
15885 /// assert!(x.int64_type().is_none());
15886 /// assert!(x.float32_type().is_none());
15887 /// assert!(x.float64_type().is_none());
15888 /// assert!(x.bool_type().is_none());
15889 /// assert!(x.timestamp_type().is_none());
15890 /// assert!(x.date_type().is_none());
15891 /// assert!(x.struct_type().is_none());
15892 /// assert!(x.array_type().is_none());
15893 /// assert!(x.map_type().is_none());
15894 /// assert!(x.proto_type().is_none());
15895 /// assert!(x.enum_type().is_none());
15896 /// ```
15897 pub fn set_aggregate_type<
15898 T: std::convert::Into<std::boxed::Box<crate::model::r#type::Aggregate>>,
15899 >(
15900 mut self,
15901 v: T,
15902 ) -> Self {
15903 self.kind = std::option::Option::Some(crate::model::r#type::Kind::AggregateType(v.into()));
15904 self
15905 }
15906
15907 /// The value of [kind][crate::model::Type::kind]
15908 /// if it holds a `StructType`, `None` if the field is not set or
15909 /// holds a different branch.
15910 pub fn struct_type(
15911 &self,
15912 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Struct>> {
15913 #[allow(unreachable_patterns)]
15914 self.kind.as_ref().and_then(|v| match v {
15915 crate::model::r#type::Kind::StructType(v) => std::option::Option::Some(v),
15916 _ => std::option::Option::None,
15917 })
15918 }
15919
15920 /// Sets the value of [kind][crate::model::Type::kind]
15921 /// to hold a `StructType`.
15922 ///
15923 /// Note that all the setters affecting `kind` are
15924 /// mutually exclusive.
15925 ///
15926 /// # Example
15927 /// ```ignore,no_run
15928 /// # use google_cloud_bigtable_admin_v2::model::Type;
15929 /// use google_cloud_bigtable_admin_v2::model::r#type::Struct;
15930 /// let x = Type::new().set_struct_type(Struct::default()/* use setters */);
15931 /// assert!(x.struct_type().is_some());
15932 /// assert!(x.bytes_type().is_none());
15933 /// assert!(x.string_type().is_none());
15934 /// assert!(x.int64_type().is_none());
15935 /// assert!(x.float32_type().is_none());
15936 /// assert!(x.float64_type().is_none());
15937 /// assert!(x.bool_type().is_none());
15938 /// assert!(x.timestamp_type().is_none());
15939 /// assert!(x.date_type().is_none());
15940 /// assert!(x.aggregate_type().is_none());
15941 /// assert!(x.array_type().is_none());
15942 /// assert!(x.map_type().is_none());
15943 /// assert!(x.proto_type().is_none());
15944 /// assert!(x.enum_type().is_none());
15945 /// ```
15946 pub fn set_struct_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Struct>>>(
15947 mut self,
15948 v: T,
15949 ) -> Self {
15950 self.kind = std::option::Option::Some(crate::model::r#type::Kind::StructType(v.into()));
15951 self
15952 }
15953
15954 /// The value of [kind][crate::model::Type::kind]
15955 /// if it holds a `ArrayType`, `None` if the field is not set or
15956 /// holds a different branch.
15957 pub fn array_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Array>> {
15958 #[allow(unreachable_patterns)]
15959 self.kind.as_ref().and_then(|v| match v {
15960 crate::model::r#type::Kind::ArrayType(v) => std::option::Option::Some(v),
15961 _ => std::option::Option::None,
15962 })
15963 }
15964
15965 /// Sets the value of [kind][crate::model::Type::kind]
15966 /// to hold a `ArrayType`.
15967 ///
15968 /// Note that all the setters affecting `kind` are
15969 /// mutually exclusive.
15970 ///
15971 /// # Example
15972 /// ```ignore,no_run
15973 /// # use google_cloud_bigtable_admin_v2::model::Type;
15974 /// use google_cloud_bigtable_admin_v2::model::r#type::Array;
15975 /// let x = Type::new().set_array_type(Array::default()/* use setters */);
15976 /// assert!(x.array_type().is_some());
15977 /// assert!(x.bytes_type().is_none());
15978 /// assert!(x.string_type().is_none());
15979 /// assert!(x.int64_type().is_none());
15980 /// assert!(x.float32_type().is_none());
15981 /// assert!(x.float64_type().is_none());
15982 /// assert!(x.bool_type().is_none());
15983 /// assert!(x.timestamp_type().is_none());
15984 /// assert!(x.date_type().is_none());
15985 /// assert!(x.aggregate_type().is_none());
15986 /// assert!(x.struct_type().is_none());
15987 /// assert!(x.map_type().is_none());
15988 /// assert!(x.proto_type().is_none());
15989 /// assert!(x.enum_type().is_none());
15990 /// ```
15991 pub fn set_array_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Array>>>(
15992 mut self,
15993 v: T,
15994 ) -> Self {
15995 self.kind = std::option::Option::Some(crate::model::r#type::Kind::ArrayType(v.into()));
15996 self
15997 }
15998
15999 /// The value of [kind][crate::model::Type::kind]
16000 /// if it holds a `MapType`, `None` if the field is not set or
16001 /// holds a different branch.
16002 pub fn map_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Map>> {
16003 #[allow(unreachable_patterns)]
16004 self.kind.as_ref().and_then(|v| match v {
16005 crate::model::r#type::Kind::MapType(v) => std::option::Option::Some(v),
16006 _ => std::option::Option::None,
16007 })
16008 }
16009
16010 /// Sets the value of [kind][crate::model::Type::kind]
16011 /// to hold a `MapType`.
16012 ///
16013 /// Note that all the setters affecting `kind` are
16014 /// mutually exclusive.
16015 ///
16016 /// # Example
16017 /// ```ignore,no_run
16018 /// # use google_cloud_bigtable_admin_v2::model::Type;
16019 /// use google_cloud_bigtable_admin_v2::model::r#type::Map;
16020 /// let x = Type::new().set_map_type(Map::default()/* use setters */);
16021 /// assert!(x.map_type().is_some());
16022 /// assert!(x.bytes_type().is_none());
16023 /// assert!(x.string_type().is_none());
16024 /// assert!(x.int64_type().is_none());
16025 /// assert!(x.float32_type().is_none());
16026 /// assert!(x.float64_type().is_none());
16027 /// assert!(x.bool_type().is_none());
16028 /// assert!(x.timestamp_type().is_none());
16029 /// assert!(x.date_type().is_none());
16030 /// assert!(x.aggregate_type().is_none());
16031 /// assert!(x.struct_type().is_none());
16032 /// assert!(x.array_type().is_none());
16033 /// assert!(x.proto_type().is_none());
16034 /// assert!(x.enum_type().is_none());
16035 /// ```
16036 pub fn set_map_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Map>>>(
16037 mut self,
16038 v: T,
16039 ) -> Self {
16040 self.kind = std::option::Option::Some(crate::model::r#type::Kind::MapType(v.into()));
16041 self
16042 }
16043
16044 /// The value of [kind][crate::model::Type::kind]
16045 /// if it holds a `ProtoType`, `None` if the field is not set or
16046 /// holds a different branch.
16047 pub fn proto_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Proto>> {
16048 #[allow(unreachable_patterns)]
16049 self.kind.as_ref().and_then(|v| match v {
16050 crate::model::r#type::Kind::ProtoType(v) => std::option::Option::Some(v),
16051 _ => std::option::Option::None,
16052 })
16053 }
16054
16055 /// Sets the value of [kind][crate::model::Type::kind]
16056 /// to hold a `ProtoType`.
16057 ///
16058 /// Note that all the setters affecting `kind` are
16059 /// mutually exclusive.
16060 ///
16061 /// # Example
16062 /// ```ignore,no_run
16063 /// # use google_cloud_bigtable_admin_v2::model::Type;
16064 /// use google_cloud_bigtable_admin_v2::model::r#type::Proto;
16065 /// let x = Type::new().set_proto_type(Proto::default()/* use setters */);
16066 /// assert!(x.proto_type().is_some());
16067 /// assert!(x.bytes_type().is_none());
16068 /// assert!(x.string_type().is_none());
16069 /// assert!(x.int64_type().is_none());
16070 /// assert!(x.float32_type().is_none());
16071 /// assert!(x.float64_type().is_none());
16072 /// assert!(x.bool_type().is_none());
16073 /// assert!(x.timestamp_type().is_none());
16074 /// assert!(x.date_type().is_none());
16075 /// assert!(x.aggregate_type().is_none());
16076 /// assert!(x.struct_type().is_none());
16077 /// assert!(x.array_type().is_none());
16078 /// assert!(x.map_type().is_none());
16079 /// assert!(x.enum_type().is_none());
16080 /// ```
16081 pub fn set_proto_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Proto>>>(
16082 mut self,
16083 v: T,
16084 ) -> Self {
16085 self.kind = std::option::Option::Some(crate::model::r#type::Kind::ProtoType(v.into()));
16086 self
16087 }
16088
16089 /// The value of [kind][crate::model::Type::kind]
16090 /// if it holds a `EnumType`, `None` if the field is not set or
16091 /// holds a different branch.
16092 pub fn enum_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Enum>> {
16093 #[allow(unreachable_patterns)]
16094 self.kind.as_ref().and_then(|v| match v {
16095 crate::model::r#type::Kind::EnumType(v) => std::option::Option::Some(v),
16096 _ => std::option::Option::None,
16097 })
16098 }
16099
16100 /// Sets the value of [kind][crate::model::Type::kind]
16101 /// to hold a `EnumType`.
16102 ///
16103 /// Note that all the setters affecting `kind` are
16104 /// mutually exclusive.
16105 ///
16106 /// # Example
16107 /// ```ignore,no_run
16108 /// # use google_cloud_bigtable_admin_v2::model::Type;
16109 /// use google_cloud_bigtable_admin_v2::model::r#type::Enum;
16110 /// let x = Type::new().set_enum_type(Enum::default()/* use setters */);
16111 /// assert!(x.enum_type().is_some());
16112 /// assert!(x.bytes_type().is_none());
16113 /// assert!(x.string_type().is_none());
16114 /// assert!(x.int64_type().is_none());
16115 /// assert!(x.float32_type().is_none());
16116 /// assert!(x.float64_type().is_none());
16117 /// assert!(x.bool_type().is_none());
16118 /// assert!(x.timestamp_type().is_none());
16119 /// assert!(x.date_type().is_none());
16120 /// assert!(x.aggregate_type().is_none());
16121 /// assert!(x.struct_type().is_none());
16122 /// assert!(x.array_type().is_none());
16123 /// assert!(x.map_type().is_none());
16124 /// assert!(x.proto_type().is_none());
16125 /// ```
16126 pub fn set_enum_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Enum>>>(
16127 mut self,
16128 v: T,
16129 ) -> Self {
16130 self.kind = std::option::Option::Some(crate::model::r#type::Kind::EnumType(v.into()));
16131 self
16132 }
16133}
16134
16135impl wkt::message::Message for Type {
16136 fn typename() -> &'static str {
16137 "type.googleapis.com/google.bigtable.admin.v2.Type"
16138 }
16139}
16140
16141/// Defines additional types related to [Type].
16142pub mod r#type {
16143 #[allow(unused_imports)]
16144 use super::*;
16145
16146 /// Bytes
16147 /// Values of type `Bytes` are stored in `Value.bytes_value`.
16148 #[derive(Clone, Default, PartialEq)]
16149 #[non_exhaustive]
16150 pub struct Bytes {
16151 /// The encoding to use when converting to or from lower level types.
16152 pub encoding: std::option::Option<crate::model::r#type::bytes::Encoding>,
16153
16154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16155 }
16156
16157 impl Bytes {
16158 pub fn new() -> Self {
16159 std::default::Default::default()
16160 }
16161
16162 /// Sets the value of [encoding][crate::model::r#type::Bytes::encoding].
16163 ///
16164 /// # Example
16165 /// ```ignore,no_run
16166 /// # use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
16167 /// use google_cloud_bigtable_admin_v2::model::r#type::bytes::Encoding;
16168 /// let x = Bytes::new().set_encoding(Encoding::default()/* use setters */);
16169 /// ```
16170 pub fn set_encoding<T>(mut self, v: T) -> Self
16171 where
16172 T: std::convert::Into<crate::model::r#type::bytes::Encoding>,
16173 {
16174 self.encoding = std::option::Option::Some(v.into());
16175 self
16176 }
16177
16178 /// Sets or clears the value of [encoding][crate::model::r#type::Bytes::encoding].
16179 ///
16180 /// # Example
16181 /// ```ignore,no_run
16182 /// # use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
16183 /// use google_cloud_bigtable_admin_v2::model::r#type::bytes::Encoding;
16184 /// let x = Bytes::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
16185 /// let x = Bytes::new().set_or_clear_encoding(None::<Encoding>);
16186 /// ```
16187 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
16188 where
16189 T: std::convert::Into<crate::model::r#type::bytes::Encoding>,
16190 {
16191 self.encoding = v.map(|x| x.into());
16192 self
16193 }
16194 }
16195
16196 impl wkt::message::Message for Bytes {
16197 fn typename() -> &'static str {
16198 "type.googleapis.com/google.bigtable.admin.v2.Type.Bytes"
16199 }
16200 }
16201
16202 /// Defines additional types related to [Bytes].
16203 pub mod bytes {
16204 #[allow(unused_imports)]
16205 use super::*;
16206
16207 /// Rules used to convert to or from lower level types.
16208 #[derive(Clone, Default, PartialEq)]
16209 #[non_exhaustive]
16210 pub struct Encoding {
16211 /// Which encoding to use.
16212 pub encoding: std::option::Option<crate::model::r#type::bytes::encoding::Encoding>,
16213
16214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16215 }
16216
16217 impl Encoding {
16218 pub fn new() -> Self {
16219 std::default::Default::default()
16220 }
16221
16222 /// Sets the value of [encoding][crate::model::r#type::bytes::Encoding::encoding].
16223 ///
16224 /// Note that all the setters affecting `encoding` are mutually
16225 /// exclusive.
16226 ///
16227 /// # Example
16228 /// ```ignore,no_run
16229 /// # use google_cloud_bigtable_admin_v2::model::r#type::bytes::Encoding;
16230 /// use google_cloud_bigtable_admin_v2::model::r#type::bytes::encoding::Raw;
16231 /// let x = Encoding::new().set_encoding(Some(
16232 /// google_cloud_bigtable_admin_v2::model::r#type::bytes::encoding::Encoding::Raw(Raw::default().into())));
16233 /// ```
16234 pub fn set_encoding<
16235 T: std::convert::Into<
16236 std::option::Option<crate::model::r#type::bytes::encoding::Encoding>,
16237 >,
16238 >(
16239 mut self,
16240 v: T,
16241 ) -> Self {
16242 self.encoding = v.into();
16243 self
16244 }
16245
16246 /// The value of [encoding][crate::model::r#type::bytes::Encoding::encoding]
16247 /// if it holds a `Raw`, `None` if the field is not set or
16248 /// holds a different branch.
16249 pub fn raw(
16250 &self,
16251 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>>
16252 {
16253 #[allow(unreachable_patterns)]
16254 self.encoding.as_ref().and_then(|v| match v {
16255 crate::model::r#type::bytes::encoding::Encoding::Raw(v) => {
16256 std::option::Option::Some(v)
16257 }
16258 _ => std::option::Option::None,
16259 })
16260 }
16261
16262 /// Sets the value of [encoding][crate::model::r#type::bytes::Encoding::encoding]
16263 /// to hold a `Raw`.
16264 ///
16265 /// Note that all the setters affecting `encoding` are
16266 /// mutually exclusive.
16267 ///
16268 /// # Example
16269 /// ```ignore,no_run
16270 /// # use google_cloud_bigtable_admin_v2::model::r#type::bytes::Encoding;
16271 /// use google_cloud_bigtable_admin_v2::model::r#type::bytes::encoding::Raw;
16272 /// let x = Encoding::new().set_raw(Raw::default()/* use setters */);
16273 /// assert!(x.raw().is_some());
16274 /// ```
16275 pub fn set_raw<
16276 T: std::convert::Into<std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>>,
16277 >(
16278 mut self,
16279 v: T,
16280 ) -> Self {
16281 self.encoding = std::option::Option::Some(
16282 crate::model::r#type::bytes::encoding::Encoding::Raw(v.into()),
16283 );
16284 self
16285 }
16286 }
16287
16288 impl wkt::message::Message for Encoding {
16289 fn typename() -> &'static str {
16290 "type.googleapis.com/google.bigtable.admin.v2.Type.Bytes.Encoding"
16291 }
16292 }
16293
16294 /// Defines additional types related to [Encoding].
16295 pub mod encoding {
16296 #[allow(unused_imports)]
16297 use super::*;
16298
16299 /// Leaves the value as-is.
16300 ///
16301 /// Sorted mode: all values are supported.
16302 ///
16303 /// Distinct mode: all values are supported.
16304 #[derive(Clone, Default, PartialEq)]
16305 #[non_exhaustive]
16306 pub struct Raw {
16307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16308 }
16309
16310 impl Raw {
16311 pub fn new() -> Self {
16312 std::default::Default::default()
16313 }
16314 }
16315
16316 impl wkt::message::Message for Raw {
16317 fn typename() -> &'static str {
16318 "type.googleapis.com/google.bigtable.admin.v2.Type.Bytes.Encoding.Raw"
16319 }
16320 }
16321
16322 /// Which encoding to use.
16323 #[derive(Clone, Debug, PartialEq)]
16324 #[non_exhaustive]
16325 pub enum Encoding {
16326 /// Use `Raw` encoding.
16327 Raw(std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>),
16328 }
16329 }
16330 }
16331
16332 /// String
16333 /// Values of type `String` are stored in `Value.string_value`.
16334 #[derive(Clone, Default, PartialEq)]
16335 #[non_exhaustive]
16336 pub struct String {
16337 /// The encoding to use when converting to or from lower level types.
16338 pub encoding: std::option::Option<crate::model::r#type::string::Encoding>,
16339
16340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16341 }
16342
16343 impl String {
16344 pub fn new() -> Self {
16345 std::default::Default::default()
16346 }
16347
16348 /// Sets the value of [encoding][crate::model::r#type::String::encoding].
16349 ///
16350 /// # Example
16351 /// ```ignore,no_run
16352 /// # use google_cloud_bigtable_admin_v2::model::r#type::String;
16353 /// use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
16354 /// let x = String::new().set_encoding(Encoding::default()/* use setters */);
16355 /// ```
16356 pub fn set_encoding<T>(mut self, v: T) -> Self
16357 where
16358 T: std::convert::Into<crate::model::r#type::string::Encoding>,
16359 {
16360 self.encoding = std::option::Option::Some(v.into());
16361 self
16362 }
16363
16364 /// Sets or clears the value of [encoding][crate::model::r#type::String::encoding].
16365 ///
16366 /// # Example
16367 /// ```ignore,no_run
16368 /// # use google_cloud_bigtable_admin_v2::model::r#type::String;
16369 /// use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
16370 /// let x = String::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
16371 /// let x = String::new().set_or_clear_encoding(None::<Encoding>);
16372 /// ```
16373 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
16374 where
16375 T: std::convert::Into<crate::model::r#type::string::Encoding>,
16376 {
16377 self.encoding = v.map(|x| x.into());
16378 self
16379 }
16380 }
16381
16382 impl wkt::message::Message for String {
16383 fn typename() -> &'static str {
16384 "type.googleapis.com/google.bigtable.admin.v2.Type.String"
16385 }
16386 }
16387
16388 /// Defines additional types related to [String].
16389 pub mod string {
16390 #[allow(unused_imports)]
16391 use super::*;
16392
16393 /// Rules used to convert to or from lower level types.
16394 #[derive(Clone, Default, PartialEq)]
16395 #[non_exhaustive]
16396 pub struct Encoding {
16397 /// Which encoding to use.
16398 pub encoding: std::option::Option<crate::model::r#type::string::encoding::Encoding>,
16399
16400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16401 }
16402
16403 impl Encoding {
16404 pub fn new() -> Self {
16405 std::default::Default::default()
16406 }
16407
16408 /// Sets the value of [encoding][crate::model::r#type::string::Encoding::encoding].
16409 ///
16410 /// Note that all the setters affecting `encoding` are mutually
16411 /// exclusive.
16412 ///
16413 /// # Example
16414 /// ```ignore,no_run
16415 /// # use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
16416 /// use google_cloud_bigtable_admin_v2::model::r#type::string::encoding::Utf8Bytes;
16417 /// let x = Encoding::new().set_encoding(Some(
16418 /// google_cloud_bigtable_admin_v2::model::r#type::string::encoding::Encoding::Utf8Bytes(Utf8Bytes::default().into())));
16419 /// ```
16420 pub fn set_encoding<
16421 T: std::convert::Into<
16422 std::option::Option<crate::model::r#type::string::encoding::Encoding>,
16423 >,
16424 >(
16425 mut self,
16426 v: T,
16427 ) -> Self {
16428 self.encoding = v.into();
16429 self
16430 }
16431
16432 /// The value of [encoding][crate::model::r#type::string::Encoding::encoding]
16433 /// if it holds a `Utf8Raw`, `None` if the field is not set or
16434 /// holds a different branch.
16435 #[deprecated]
16436 pub fn utf8_raw(
16437 &self,
16438 ) -> std::option::Option<
16439 &std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>,
16440 > {
16441 #[allow(unreachable_patterns)]
16442 self.encoding.as_ref().and_then(|v| match v {
16443 crate::model::r#type::string::encoding::Encoding::Utf8Raw(v) => {
16444 std::option::Option::Some(v)
16445 }
16446 _ => std::option::Option::None,
16447 })
16448 }
16449
16450 /// Sets the value of [encoding][crate::model::r#type::string::Encoding::encoding]
16451 /// to hold a `Utf8Raw`.
16452 ///
16453 /// Note that all the setters affecting `encoding` are
16454 /// mutually exclusive.
16455 ///
16456 /// # Example
16457 /// ```ignore,no_run
16458 /// # use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
16459 /// use google_cloud_bigtable_admin_v2::model::r#type::string::encoding::Utf8Raw;
16460 /// let x = Encoding::new().set_utf8_raw(Utf8Raw::default()/* use setters */);
16461 /// assert!(x.utf8_raw().is_some());
16462 /// assert!(x.utf8_bytes().is_none());
16463 /// ```
16464 #[deprecated]
16465 pub fn set_utf8_raw<
16466 T: std::convert::Into<
16467 std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>,
16468 >,
16469 >(
16470 mut self,
16471 v: T,
16472 ) -> Self {
16473 self.encoding = std::option::Option::Some(
16474 crate::model::r#type::string::encoding::Encoding::Utf8Raw(v.into()),
16475 );
16476 self
16477 }
16478
16479 /// The value of [encoding][crate::model::r#type::string::Encoding::encoding]
16480 /// if it holds a `Utf8Bytes`, `None` if the field is not set or
16481 /// holds a different branch.
16482 pub fn utf8_bytes(
16483 &self,
16484 ) -> std::option::Option<
16485 &std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>,
16486 > {
16487 #[allow(unreachable_patterns)]
16488 self.encoding.as_ref().and_then(|v| match v {
16489 crate::model::r#type::string::encoding::Encoding::Utf8Bytes(v) => {
16490 std::option::Option::Some(v)
16491 }
16492 _ => std::option::Option::None,
16493 })
16494 }
16495
16496 /// Sets the value of [encoding][crate::model::r#type::string::Encoding::encoding]
16497 /// to hold a `Utf8Bytes`.
16498 ///
16499 /// Note that all the setters affecting `encoding` are
16500 /// mutually exclusive.
16501 ///
16502 /// # Example
16503 /// ```ignore,no_run
16504 /// # use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
16505 /// use google_cloud_bigtable_admin_v2::model::r#type::string::encoding::Utf8Bytes;
16506 /// let x = Encoding::new().set_utf8_bytes(Utf8Bytes::default()/* use setters */);
16507 /// assert!(x.utf8_bytes().is_some());
16508 /// assert!(x.utf8_raw().is_none());
16509 /// ```
16510 pub fn set_utf8_bytes<
16511 T: std::convert::Into<
16512 std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>,
16513 >,
16514 >(
16515 mut self,
16516 v: T,
16517 ) -> Self {
16518 self.encoding = std::option::Option::Some(
16519 crate::model::r#type::string::encoding::Encoding::Utf8Bytes(v.into()),
16520 );
16521 self
16522 }
16523 }
16524
16525 impl wkt::message::Message for Encoding {
16526 fn typename() -> &'static str {
16527 "type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding"
16528 }
16529 }
16530
16531 /// Defines additional types related to [Encoding].
16532 pub mod encoding {
16533 #[allow(unused_imports)]
16534 use super::*;
16535
16536 /// Deprecated: prefer the equivalent `Utf8Bytes`.
16537 #[derive(Clone, Default, PartialEq)]
16538 #[non_exhaustive]
16539 #[deprecated]
16540 pub struct Utf8Raw {
16541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16542 }
16543
16544 impl Utf8Raw {
16545 pub fn new() -> Self {
16546 std::default::Default::default()
16547 }
16548 }
16549
16550 impl wkt::message::Message for Utf8Raw {
16551 fn typename() -> &'static str {
16552 "type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw"
16553 }
16554 }
16555
16556 /// UTF-8 encoding.
16557 ///
16558 /// Sorted mode:
16559 ///
16560 /// - All values are supported.
16561 /// - Code point order is preserved.
16562 ///
16563 /// Distinct mode: all values are supported.
16564 ///
16565 /// Compatible with:
16566 ///
16567 /// - BigQuery `TEXT` encoding
16568 /// - HBase `Bytes.toBytes`
16569 /// - Java `String#getBytes(StandardCharsets.UTF_8)`
16570 #[derive(Clone, Default, PartialEq)]
16571 #[non_exhaustive]
16572 pub struct Utf8Bytes {
16573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16574 }
16575
16576 impl Utf8Bytes {
16577 pub fn new() -> Self {
16578 std::default::Default::default()
16579 }
16580 }
16581
16582 impl wkt::message::Message for Utf8Bytes {
16583 fn typename() -> &'static str {
16584 "type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes"
16585 }
16586 }
16587
16588 /// Which encoding to use.
16589 #[derive(Clone, Debug, PartialEq)]
16590 #[non_exhaustive]
16591 pub enum Encoding {
16592 /// Deprecated: if set, converts to an empty `utf8_bytes`.
16593 #[deprecated]
16594 Utf8Raw(std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>),
16595 /// Use `Utf8Bytes` encoding.
16596 Utf8Bytes(std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>),
16597 }
16598 }
16599 }
16600
16601 /// Int64
16602 /// Values of type `Int64` are stored in `Value.int_value`.
16603 #[derive(Clone, Default, PartialEq)]
16604 #[non_exhaustive]
16605 pub struct Int64 {
16606 /// The encoding to use when converting to or from lower level types.
16607 pub encoding: std::option::Option<crate::model::r#type::int_64::Encoding>,
16608
16609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16610 }
16611
16612 impl Int64 {
16613 pub fn new() -> Self {
16614 std::default::Default::default()
16615 }
16616
16617 /// Sets the value of [encoding][crate::model::r#type::Int64::encoding].
16618 ///
16619 /// # Example
16620 /// ```ignore,no_run
16621 /// # use google_cloud_bigtable_admin_v2::model::r#type::Int64;
16622 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
16623 /// let x = Int64::new().set_encoding(Encoding::default()/* use setters */);
16624 /// ```
16625 pub fn set_encoding<T>(mut self, v: T) -> Self
16626 where
16627 T: std::convert::Into<crate::model::r#type::int_64::Encoding>,
16628 {
16629 self.encoding = std::option::Option::Some(v.into());
16630 self
16631 }
16632
16633 /// Sets or clears the value of [encoding][crate::model::r#type::Int64::encoding].
16634 ///
16635 /// # Example
16636 /// ```ignore,no_run
16637 /// # use google_cloud_bigtable_admin_v2::model::r#type::Int64;
16638 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
16639 /// let x = Int64::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
16640 /// let x = Int64::new().set_or_clear_encoding(None::<Encoding>);
16641 /// ```
16642 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
16643 where
16644 T: std::convert::Into<crate::model::r#type::int_64::Encoding>,
16645 {
16646 self.encoding = v.map(|x| x.into());
16647 self
16648 }
16649 }
16650
16651 impl wkt::message::Message for Int64 {
16652 fn typename() -> &'static str {
16653 "type.googleapis.com/google.bigtable.admin.v2.Type.Int64"
16654 }
16655 }
16656
16657 /// Defines additional types related to [Int64].
16658 pub mod int_64 {
16659 #[allow(unused_imports)]
16660 use super::*;
16661
16662 /// Rules used to convert to or from lower level types.
16663 #[derive(Clone, Default, PartialEq)]
16664 #[non_exhaustive]
16665 pub struct Encoding {
16666 /// Which encoding to use.
16667 pub encoding: std::option::Option<crate::model::r#type::int_64::encoding::Encoding>,
16668
16669 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16670 }
16671
16672 impl Encoding {
16673 pub fn new() -> Self {
16674 std::default::Default::default()
16675 }
16676
16677 /// Sets the value of [encoding][crate::model::r#type::int_64::Encoding::encoding].
16678 ///
16679 /// Note that all the setters affecting `encoding` are mutually
16680 /// exclusive.
16681 ///
16682 /// # Example
16683 /// ```ignore,no_run
16684 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
16685 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::BigEndianBytes;
16686 /// let x = Encoding::new().set_encoding(Some(
16687 /// google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::Encoding::BigEndianBytes(BigEndianBytes::default().into())));
16688 /// ```
16689 pub fn set_encoding<
16690 T: std::convert::Into<
16691 std::option::Option<crate::model::r#type::int_64::encoding::Encoding>,
16692 >,
16693 >(
16694 mut self,
16695 v: T,
16696 ) -> Self {
16697 self.encoding = v.into();
16698 self
16699 }
16700
16701 /// The value of [encoding][crate::model::r#type::int_64::Encoding::encoding]
16702 /// if it holds a `BigEndianBytes`, `None` if the field is not set or
16703 /// holds a different branch.
16704 pub fn big_endian_bytes(
16705 &self,
16706 ) -> std::option::Option<
16707 &std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
16708 > {
16709 #[allow(unreachable_patterns)]
16710 self.encoding.as_ref().and_then(|v| match v {
16711 crate::model::r#type::int_64::encoding::Encoding::BigEndianBytes(v) => {
16712 std::option::Option::Some(v)
16713 }
16714 _ => std::option::Option::None,
16715 })
16716 }
16717
16718 /// Sets the value of [encoding][crate::model::r#type::int_64::Encoding::encoding]
16719 /// to hold a `BigEndianBytes`.
16720 ///
16721 /// Note that all the setters affecting `encoding` are
16722 /// mutually exclusive.
16723 ///
16724 /// # Example
16725 /// ```ignore,no_run
16726 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
16727 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::BigEndianBytes;
16728 /// let x = Encoding::new().set_big_endian_bytes(BigEndianBytes::default()/* use setters */);
16729 /// assert!(x.big_endian_bytes().is_some());
16730 /// assert!(x.ordered_code_bytes().is_none());
16731 /// ```
16732 pub fn set_big_endian_bytes<
16733 T: std::convert::Into<
16734 std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
16735 >,
16736 >(
16737 mut self,
16738 v: T,
16739 ) -> Self {
16740 self.encoding = std::option::Option::Some(
16741 crate::model::r#type::int_64::encoding::Encoding::BigEndianBytes(v.into()),
16742 );
16743 self
16744 }
16745
16746 /// The value of [encoding][crate::model::r#type::int_64::Encoding::encoding]
16747 /// if it holds a `OrderedCodeBytes`, `None` if the field is not set or
16748 /// holds a different branch.
16749 pub fn ordered_code_bytes(
16750 &self,
16751 ) -> std::option::Option<
16752 &std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
16753 > {
16754 #[allow(unreachable_patterns)]
16755 self.encoding.as_ref().and_then(|v| match v {
16756 crate::model::r#type::int_64::encoding::Encoding::OrderedCodeBytes(v) => {
16757 std::option::Option::Some(v)
16758 }
16759 _ => std::option::Option::None,
16760 })
16761 }
16762
16763 /// Sets the value of [encoding][crate::model::r#type::int_64::Encoding::encoding]
16764 /// to hold a `OrderedCodeBytes`.
16765 ///
16766 /// Note that all the setters affecting `encoding` are
16767 /// mutually exclusive.
16768 ///
16769 /// # Example
16770 /// ```ignore,no_run
16771 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
16772 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::OrderedCodeBytes;
16773 /// let x = Encoding::new().set_ordered_code_bytes(OrderedCodeBytes::default()/* use setters */);
16774 /// assert!(x.ordered_code_bytes().is_some());
16775 /// assert!(x.big_endian_bytes().is_none());
16776 /// ```
16777 pub fn set_ordered_code_bytes<
16778 T: std::convert::Into<
16779 std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
16780 >,
16781 >(
16782 mut self,
16783 v: T,
16784 ) -> Self {
16785 self.encoding = std::option::Option::Some(
16786 crate::model::r#type::int_64::encoding::Encoding::OrderedCodeBytes(v.into()),
16787 );
16788 self
16789 }
16790 }
16791
16792 impl wkt::message::Message for Encoding {
16793 fn typename() -> &'static str {
16794 "type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding"
16795 }
16796 }
16797
16798 /// Defines additional types related to [Encoding].
16799 pub mod encoding {
16800 #[allow(unused_imports)]
16801 use super::*;
16802
16803 /// Encodes the value as an 8-byte big-endian two's complement value.
16804 ///
16805 /// Sorted mode: non-negative values are supported.
16806 ///
16807 /// Distinct mode: all values are supported.
16808 ///
16809 /// Compatible with:
16810 ///
16811 /// - BigQuery `BINARY` encoding
16812 /// - HBase `Bytes.toBytes`
16813 /// - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN`
16814 #[derive(Clone, Default, PartialEq)]
16815 #[non_exhaustive]
16816 pub struct BigEndianBytes {
16817 /// Deprecated: ignored if set.
16818 #[deprecated]
16819 pub bytes_type: std::option::Option<crate::model::r#type::Bytes>,
16820
16821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16822 }
16823
16824 impl BigEndianBytes {
16825 pub fn new() -> Self {
16826 std::default::Default::default()
16827 }
16828
16829 /// Sets the value of [bytes_type][crate::model::r#type::int_64::encoding::BigEndianBytes::bytes_type].
16830 ///
16831 /// # Example
16832 /// ```ignore,no_run
16833 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::BigEndianBytes;
16834 /// use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
16835 /// let x = BigEndianBytes::new().set_bytes_type(Bytes::default()/* use setters */);
16836 /// ```
16837 #[deprecated]
16838 pub fn set_bytes_type<T>(mut self, v: T) -> Self
16839 where
16840 T: std::convert::Into<crate::model::r#type::Bytes>,
16841 {
16842 self.bytes_type = std::option::Option::Some(v.into());
16843 self
16844 }
16845
16846 /// Sets or clears the value of [bytes_type][crate::model::r#type::int_64::encoding::BigEndianBytes::bytes_type].
16847 ///
16848 /// # Example
16849 /// ```ignore,no_run
16850 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::BigEndianBytes;
16851 /// use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
16852 /// let x = BigEndianBytes::new().set_or_clear_bytes_type(Some(Bytes::default()/* use setters */));
16853 /// let x = BigEndianBytes::new().set_or_clear_bytes_type(None::<Bytes>);
16854 /// ```
16855 #[deprecated]
16856 pub fn set_or_clear_bytes_type<T>(mut self, v: std::option::Option<T>) -> Self
16857 where
16858 T: std::convert::Into<crate::model::r#type::Bytes>,
16859 {
16860 self.bytes_type = v.map(|x| x.into());
16861 self
16862 }
16863 }
16864
16865 impl wkt::message::Message for BigEndianBytes {
16866 fn typename() -> &'static str {
16867 "type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes"
16868 }
16869 }
16870
16871 /// Encodes the value in a variable length binary format of up to 10 bytes.
16872 /// Values that are closer to zero use fewer bytes.
16873 ///
16874 /// Sorted mode: all values are supported.
16875 ///
16876 /// Distinct mode: all values are supported.
16877 #[derive(Clone, Default, PartialEq)]
16878 #[non_exhaustive]
16879 pub struct OrderedCodeBytes {
16880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16881 }
16882
16883 impl OrderedCodeBytes {
16884 pub fn new() -> Self {
16885 std::default::Default::default()
16886 }
16887 }
16888
16889 impl wkt::message::Message for OrderedCodeBytes {
16890 fn typename() -> &'static str {
16891 "type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes"
16892 }
16893 }
16894
16895 /// Which encoding to use.
16896 #[derive(Clone, Debug, PartialEq)]
16897 #[non_exhaustive]
16898 pub enum Encoding {
16899 /// Use `BigEndianBytes` encoding.
16900 BigEndianBytes(
16901 std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
16902 ),
16903 /// Use `OrderedCodeBytes` encoding.
16904 OrderedCodeBytes(
16905 std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
16906 ),
16907 }
16908 }
16909 }
16910
16911 /// bool
16912 /// Values of type `Bool` are stored in `Value.bool_value`.
16913 #[derive(Clone, Default, PartialEq)]
16914 #[non_exhaustive]
16915 pub struct Bool {
16916 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16917 }
16918
16919 impl Bool {
16920 pub fn new() -> Self {
16921 std::default::Default::default()
16922 }
16923 }
16924
16925 impl wkt::message::Message for Bool {
16926 fn typename() -> &'static str {
16927 "type.googleapis.com/google.bigtable.admin.v2.Type.Bool"
16928 }
16929 }
16930
16931 /// Float32
16932 /// Values of type `Float32` are stored in `Value.float_value`.
16933 #[derive(Clone, Default, PartialEq)]
16934 #[non_exhaustive]
16935 pub struct Float32 {
16936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16937 }
16938
16939 impl Float32 {
16940 pub fn new() -> Self {
16941 std::default::Default::default()
16942 }
16943 }
16944
16945 impl wkt::message::Message for Float32 {
16946 fn typename() -> &'static str {
16947 "type.googleapis.com/google.bigtable.admin.v2.Type.Float32"
16948 }
16949 }
16950
16951 /// Float64
16952 /// Values of type `Float64` are stored in `Value.float_value`.
16953 #[derive(Clone, Default, PartialEq)]
16954 #[non_exhaustive]
16955 pub struct Float64 {
16956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16957 }
16958
16959 impl Float64 {
16960 pub fn new() -> Self {
16961 std::default::Default::default()
16962 }
16963 }
16964
16965 impl wkt::message::Message for Float64 {
16966 fn typename() -> &'static str {
16967 "type.googleapis.com/google.bigtable.admin.v2.Type.Float64"
16968 }
16969 }
16970
16971 /// Timestamp
16972 /// Values of type `Timestamp` are stored in `Value.timestamp_value`.
16973 #[derive(Clone, Default, PartialEq)]
16974 #[non_exhaustive]
16975 pub struct Timestamp {
16976 /// The encoding to use when converting to or from lower level types.
16977 pub encoding: std::option::Option<crate::model::r#type::timestamp::Encoding>,
16978
16979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16980 }
16981
16982 impl Timestamp {
16983 pub fn new() -> Self {
16984 std::default::Default::default()
16985 }
16986
16987 /// Sets the value of [encoding][crate::model::r#type::Timestamp::encoding].
16988 ///
16989 /// # Example
16990 /// ```ignore,no_run
16991 /// # use google_cloud_bigtable_admin_v2::model::r#type::Timestamp;
16992 /// use google_cloud_bigtable_admin_v2::model::r#type::timestamp::Encoding;
16993 /// let x = Timestamp::new().set_encoding(Encoding::default()/* use setters */);
16994 /// ```
16995 pub fn set_encoding<T>(mut self, v: T) -> Self
16996 where
16997 T: std::convert::Into<crate::model::r#type::timestamp::Encoding>,
16998 {
16999 self.encoding = std::option::Option::Some(v.into());
17000 self
17001 }
17002
17003 /// Sets or clears the value of [encoding][crate::model::r#type::Timestamp::encoding].
17004 ///
17005 /// # Example
17006 /// ```ignore,no_run
17007 /// # use google_cloud_bigtable_admin_v2::model::r#type::Timestamp;
17008 /// use google_cloud_bigtable_admin_v2::model::r#type::timestamp::Encoding;
17009 /// let x = Timestamp::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
17010 /// let x = Timestamp::new().set_or_clear_encoding(None::<Encoding>);
17011 /// ```
17012 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
17013 where
17014 T: std::convert::Into<crate::model::r#type::timestamp::Encoding>,
17015 {
17016 self.encoding = v.map(|x| x.into());
17017 self
17018 }
17019 }
17020
17021 impl wkt::message::Message for Timestamp {
17022 fn typename() -> &'static str {
17023 "type.googleapis.com/google.bigtable.admin.v2.Type.Timestamp"
17024 }
17025 }
17026
17027 /// Defines additional types related to [Timestamp].
17028 pub mod timestamp {
17029 #[allow(unused_imports)]
17030 use super::*;
17031
17032 /// Rules used to convert to or from lower level types.
17033 #[derive(Clone, Default, PartialEq)]
17034 #[non_exhaustive]
17035 pub struct Encoding {
17036 /// Which encoding to use.
17037 pub encoding: std::option::Option<crate::model::r#type::timestamp::encoding::Encoding>,
17038
17039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17040 }
17041
17042 impl Encoding {
17043 pub fn new() -> Self {
17044 std::default::Default::default()
17045 }
17046
17047 /// Sets the value of [encoding][crate::model::r#type::timestamp::Encoding::encoding].
17048 ///
17049 /// Note that all the setters affecting `encoding` are mutually
17050 /// exclusive.
17051 ///
17052 /// # Example
17053 /// ```ignore,no_run
17054 /// # use google_cloud_bigtable_admin_v2::model::r#type::timestamp::Encoding;
17055 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding as UnixMicrosInt64;
17056 /// let x = Encoding::new().set_encoding(Some(
17057 /// google_cloud_bigtable_admin_v2::model::r#type::timestamp::encoding::Encoding::UnixMicrosInt64(UnixMicrosInt64::default().into())));
17058 /// ```
17059 pub fn set_encoding<
17060 T: std::convert::Into<
17061 std::option::Option<crate::model::r#type::timestamp::encoding::Encoding>,
17062 >,
17063 >(
17064 mut self,
17065 v: T,
17066 ) -> Self {
17067 self.encoding = v.into();
17068 self
17069 }
17070
17071 /// The value of [encoding][crate::model::r#type::timestamp::Encoding::encoding]
17072 /// if it holds a `UnixMicrosInt64`, `None` if the field is not set or
17073 /// holds a different branch.
17074 pub fn unix_micros_int64(
17075 &self,
17076 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::int_64::Encoding>>
17077 {
17078 #[allow(unreachable_patterns)]
17079 self.encoding.as_ref().and_then(|v| match v {
17080 crate::model::r#type::timestamp::encoding::Encoding::UnixMicrosInt64(v) => {
17081 std::option::Option::Some(v)
17082 }
17083 _ => std::option::Option::None,
17084 })
17085 }
17086
17087 /// Sets the value of [encoding][crate::model::r#type::timestamp::Encoding::encoding]
17088 /// to hold a `UnixMicrosInt64`.
17089 ///
17090 /// Note that all the setters affecting `encoding` are
17091 /// mutually exclusive.
17092 ///
17093 /// # Example
17094 /// ```ignore,no_run
17095 /// # use google_cloud_bigtable_admin_v2::model::r#type::timestamp::Encoding;
17096 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding as UnixMicrosInt64;
17097 /// let x = Encoding::new().set_unix_micros_int64(UnixMicrosInt64::default()/* use setters */);
17098 /// assert!(x.unix_micros_int64().is_some());
17099 /// ```
17100 pub fn set_unix_micros_int64<
17101 T: std::convert::Into<std::boxed::Box<crate::model::r#type::int_64::Encoding>>,
17102 >(
17103 mut self,
17104 v: T,
17105 ) -> Self {
17106 self.encoding = std::option::Option::Some(
17107 crate::model::r#type::timestamp::encoding::Encoding::UnixMicrosInt64(v.into()),
17108 );
17109 self
17110 }
17111 }
17112
17113 impl wkt::message::Message for Encoding {
17114 fn typename() -> &'static str {
17115 "type.googleapis.com/google.bigtable.admin.v2.Type.Timestamp.Encoding"
17116 }
17117 }
17118
17119 /// Defines additional types related to [Encoding].
17120 pub mod encoding {
17121 #[allow(unused_imports)]
17122 use super::*;
17123
17124 /// Which encoding to use.
17125 #[derive(Clone, Debug, PartialEq)]
17126 #[non_exhaustive]
17127 pub enum Encoding {
17128 /// Encodes the number of microseconds since the Unix epoch using the
17129 /// given `Int64` encoding. Values must be microsecond-aligned.
17130 ///
17131 /// Compatible with:
17132 ///
17133 /// - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
17134 UnixMicrosInt64(std::boxed::Box<crate::model::r#type::int_64::Encoding>),
17135 }
17136 }
17137 }
17138
17139 /// Date
17140 /// Values of type `Date` are stored in `Value.date_value`.
17141 #[derive(Clone, Default, PartialEq)]
17142 #[non_exhaustive]
17143 pub struct Date {
17144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17145 }
17146
17147 impl Date {
17148 pub fn new() -> Self {
17149 std::default::Default::default()
17150 }
17151 }
17152
17153 impl wkt::message::Message for Date {
17154 fn typename() -> &'static str {
17155 "type.googleapis.com/google.bigtable.admin.v2.Type.Date"
17156 }
17157 }
17158
17159 /// A structured data value, consisting of fields which map to dynamically
17160 /// typed values.
17161 /// Values of type `Struct` are stored in `Value.array_value` where entries are
17162 /// in the same order and number as `field_types`.
17163 #[derive(Clone, Default, PartialEq)]
17164 #[non_exhaustive]
17165 pub struct Struct {
17166 /// The names and types of the fields in this struct.
17167 pub fields: std::vec::Vec<crate::model::r#type::r#struct::Field>,
17168
17169 /// The encoding to use when converting to or from lower level types.
17170 pub encoding: std::option::Option<crate::model::r#type::r#struct::Encoding>,
17171
17172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17173 }
17174
17175 impl Struct {
17176 pub fn new() -> Self {
17177 std::default::Default::default()
17178 }
17179
17180 /// Sets the value of [fields][crate::model::r#type::Struct::fields].
17181 ///
17182 /// # Example
17183 /// ```ignore,no_run
17184 /// # use google_cloud_bigtable_admin_v2::model::r#type::Struct;
17185 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Field;
17186 /// let x = Struct::new()
17187 /// .set_fields([
17188 /// Field::default()/* use setters */,
17189 /// Field::default()/* use (different) setters */,
17190 /// ]);
17191 /// ```
17192 pub fn set_fields<T, V>(mut self, v: T) -> Self
17193 where
17194 T: std::iter::IntoIterator<Item = V>,
17195 V: std::convert::Into<crate::model::r#type::r#struct::Field>,
17196 {
17197 use std::iter::Iterator;
17198 self.fields = v.into_iter().map(|i| i.into()).collect();
17199 self
17200 }
17201
17202 /// Sets the value of [encoding][crate::model::r#type::Struct::encoding].
17203 ///
17204 /// # Example
17205 /// ```ignore,no_run
17206 /// # use google_cloud_bigtable_admin_v2::model::r#type::Struct;
17207 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
17208 /// let x = Struct::new().set_encoding(Encoding::default()/* use setters */);
17209 /// ```
17210 pub fn set_encoding<T>(mut self, v: T) -> Self
17211 where
17212 T: std::convert::Into<crate::model::r#type::r#struct::Encoding>,
17213 {
17214 self.encoding = std::option::Option::Some(v.into());
17215 self
17216 }
17217
17218 /// Sets or clears the value of [encoding][crate::model::r#type::Struct::encoding].
17219 ///
17220 /// # Example
17221 /// ```ignore,no_run
17222 /// # use google_cloud_bigtable_admin_v2::model::r#type::Struct;
17223 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
17224 /// let x = Struct::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
17225 /// let x = Struct::new().set_or_clear_encoding(None::<Encoding>);
17226 /// ```
17227 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
17228 where
17229 T: std::convert::Into<crate::model::r#type::r#struct::Encoding>,
17230 {
17231 self.encoding = v.map(|x| x.into());
17232 self
17233 }
17234 }
17235
17236 impl wkt::message::Message for Struct {
17237 fn typename() -> &'static str {
17238 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct"
17239 }
17240 }
17241
17242 /// Defines additional types related to [Struct].
17243 pub mod r#struct {
17244 #[allow(unused_imports)]
17245 use super::*;
17246
17247 /// A struct field and its type.
17248 #[derive(Clone, Default, PartialEq)]
17249 #[non_exhaustive]
17250 pub struct Field {
17251 /// The field name (optional). Fields without a `field_name` are considered
17252 /// anonymous and cannot be referenced by name.
17253 pub field_name: std::string::String,
17254
17255 /// The type of values in this field.
17256 pub r#type: std::option::Option<std::boxed::Box<crate::model::Type>>,
17257
17258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17259 }
17260
17261 impl Field {
17262 pub fn new() -> Self {
17263 std::default::Default::default()
17264 }
17265
17266 /// Sets the value of [field_name][crate::model::r#type::r#struct::Field::field_name].
17267 ///
17268 /// # Example
17269 /// ```ignore,no_run
17270 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Field;
17271 /// let x = Field::new().set_field_name("example");
17272 /// ```
17273 pub fn set_field_name<T: std::convert::Into<std::string::String>>(
17274 mut self,
17275 v: T,
17276 ) -> Self {
17277 self.field_name = v.into();
17278 self
17279 }
17280
17281 /// Sets the value of [r#type][crate::model::r#type::r#struct::Field::type].
17282 ///
17283 /// # Example
17284 /// ```ignore,no_run
17285 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Field;
17286 /// use google_cloud_bigtable_admin_v2::model::Type;
17287 /// let x = Field::new().set_type(Type::default()/* use setters */);
17288 /// ```
17289 pub fn set_type<T>(mut self, v: T) -> Self
17290 where
17291 T: std::convert::Into<crate::model::Type>,
17292 {
17293 self.r#type = std::option::Option::Some(std::boxed::Box::new(v.into()));
17294 self
17295 }
17296
17297 /// Sets or clears the value of [r#type][crate::model::r#type::r#struct::Field::type].
17298 ///
17299 /// # Example
17300 /// ```ignore,no_run
17301 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Field;
17302 /// use google_cloud_bigtable_admin_v2::model::Type;
17303 /// let x = Field::new().set_or_clear_type(Some(Type::default()/* use setters */));
17304 /// let x = Field::new().set_or_clear_type(None::<Type>);
17305 /// ```
17306 pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
17307 where
17308 T: std::convert::Into<crate::model::Type>,
17309 {
17310 self.r#type = v.map(|x| std::boxed::Box::new(x.into()));
17311 self
17312 }
17313 }
17314
17315 impl wkt::message::Message for Field {
17316 fn typename() -> &'static str {
17317 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Field"
17318 }
17319 }
17320
17321 /// Rules used to convert to or from lower level types.
17322 #[derive(Clone, Default, PartialEq)]
17323 #[non_exhaustive]
17324 pub struct Encoding {
17325 /// Which encoding to use.
17326 pub encoding: std::option::Option<crate::model::r#type::r#struct::encoding::Encoding>,
17327
17328 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17329 }
17330
17331 impl Encoding {
17332 pub fn new() -> Self {
17333 std::default::Default::default()
17334 }
17335
17336 /// Sets the value of [encoding][crate::model::r#type::r#struct::Encoding::encoding].
17337 ///
17338 /// Note that all the setters affecting `encoding` are mutually
17339 /// exclusive.
17340 ///
17341 /// # Example
17342 /// ```ignore,no_run
17343 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
17344 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::Singleton;
17345 /// let x = Encoding::new().set_encoding(Some(
17346 /// google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::Encoding::Singleton(Singleton::default().into())));
17347 /// ```
17348 pub fn set_encoding<
17349 T: std::convert::Into<
17350 std::option::Option<crate::model::r#type::r#struct::encoding::Encoding>,
17351 >,
17352 >(
17353 mut self,
17354 v: T,
17355 ) -> Self {
17356 self.encoding = v.into();
17357 self
17358 }
17359
17360 /// The value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
17361 /// if it holds a `Singleton`, `None` if the field is not set or
17362 /// holds a different branch.
17363 pub fn singleton(
17364 &self,
17365 ) -> std::option::Option<
17366 &std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>,
17367 > {
17368 #[allow(unreachable_patterns)]
17369 self.encoding.as_ref().and_then(|v| match v {
17370 crate::model::r#type::r#struct::encoding::Encoding::Singleton(v) => {
17371 std::option::Option::Some(v)
17372 }
17373 _ => std::option::Option::None,
17374 })
17375 }
17376
17377 /// Sets the value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
17378 /// to hold a `Singleton`.
17379 ///
17380 /// Note that all the setters affecting `encoding` are
17381 /// mutually exclusive.
17382 ///
17383 /// # Example
17384 /// ```ignore,no_run
17385 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
17386 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::Singleton;
17387 /// let x = Encoding::new().set_singleton(Singleton::default()/* use setters */);
17388 /// assert!(x.singleton().is_some());
17389 /// assert!(x.delimited_bytes().is_none());
17390 /// assert!(x.ordered_code_bytes().is_none());
17391 /// ```
17392 pub fn set_singleton<
17393 T: std::convert::Into<
17394 std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>,
17395 >,
17396 >(
17397 mut self,
17398 v: T,
17399 ) -> Self {
17400 self.encoding = std::option::Option::Some(
17401 crate::model::r#type::r#struct::encoding::Encoding::Singleton(v.into()),
17402 );
17403 self
17404 }
17405
17406 /// The value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
17407 /// if it holds a `DelimitedBytes`, `None` if the field is not set or
17408 /// holds a different branch.
17409 pub fn delimited_bytes(
17410 &self,
17411 ) -> std::option::Option<
17412 &std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
17413 > {
17414 #[allow(unreachable_patterns)]
17415 self.encoding.as_ref().and_then(|v| match v {
17416 crate::model::r#type::r#struct::encoding::Encoding::DelimitedBytes(v) => {
17417 std::option::Option::Some(v)
17418 }
17419 _ => std::option::Option::None,
17420 })
17421 }
17422
17423 /// Sets the value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
17424 /// to hold a `DelimitedBytes`.
17425 ///
17426 /// Note that all the setters affecting `encoding` are
17427 /// mutually exclusive.
17428 ///
17429 /// # Example
17430 /// ```ignore,no_run
17431 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
17432 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::DelimitedBytes;
17433 /// let x = Encoding::new().set_delimited_bytes(DelimitedBytes::default()/* use setters */);
17434 /// assert!(x.delimited_bytes().is_some());
17435 /// assert!(x.singleton().is_none());
17436 /// assert!(x.ordered_code_bytes().is_none());
17437 /// ```
17438 pub fn set_delimited_bytes<
17439 T: std::convert::Into<
17440 std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
17441 >,
17442 >(
17443 mut self,
17444 v: T,
17445 ) -> Self {
17446 self.encoding = std::option::Option::Some(
17447 crate::model::r#type::r#struct::encoding::Encoding::DelimitedBytes(v.into()),
17448 );
17449 self
17450 }
17451
17452 /// The value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
17453 /// if it holds a `OrderedCodeBytes`, `None` if the field is not set or
17454 /// holds a different branch.
17455 pub fn ordered_code_bytes(
17456 &self,
17457 ) -> std::option::Option<
17458 &std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
17459 > {
17460 #[allow(unreachable_patterns)]
17461 self.encoding.as_ref().and_then(|v| match v {
17462 crate::model::r#type::r#struct::encoding::Encoding::OrderedCodeBytes(v) => {
17463 std::option::Option::Some(v)
17464 }
17465 _ => std::option::Option::None,
17466 })
17467 }
17468
17469 /// Sets the value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
17470 /// to hold a `OrderedCodeBytes`.
17471 ///
17472 /// Note that all the setters affecting `encoding` are
17473 /// mutually exclusive.
17474 ///
17475 /// # Example
17476 /// ```ignore,no_run
17477 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
17478 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::OrderedCodeBytes;
17479 /// let x = Encoding::new().set_ordered_code_bytes(OrderedCodeBytes::default()/* use setters */);
17480 /// assert!(x.ordered_code_bytes().is_some());
17481 /// assert!(x.singleton().is_none());
17482 /// assert!(x.delimited_bytes().is_none());
17483 /// ```
17484 pub fn set_ordered_code_bytes<
17485 T: std::convert::Into<
17486 std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
17487 >,
17488 >(
17489 mut self,
17490 v: T,
17491 ) -> Self {
17492 self.encoding = std::option::Option::Some(
17493 crate::model::r#type::r#struct::encoding::Encoding::OrderedCodeBytes(v.into()),
17494 );
17495 self
17496 }
17497 }
17498
17499 impl wkt::message::Message for Encoding {
17500 fn typename() -> &'static str {
17501 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding"
17502 }
17503 }
17504
17505 /// Defines additional types related to [Encoding].
17506 pub mod encoding {
17507 #[allow(unused_imports)]
17508 use super::*;
17509
17510 /// Uses the encoding of `fields[0].type` as-is.
17511 /// Only valid if `fields.size == 1`.
17512 #[derive(Clone, Default, PartialEq)]
17513 #[non_exhaustive]
17514 pub struct Singleton {
17515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17516 }
17517
17518 impl Singleton {
17519 pub fn new() -> Self {
17520 std::default::Default::default()
17521 }
17522 }
17523
17524 impl wkt::message::Message for Singleton {
17525 fn typename() -> &'static str {
17526 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.Singleton"
17527 }
17528 }
17529
17530 /// Fields are encoded independently and concatenated with a configurable
17531 /// `delimiter` in between.
17532 ///
17533 /// A struct with no fields defined is encoded as a single `delimiter`.
17534 ///
17535 /// Sorted mode:
17536 ///
17537 /// - Fields are encoded in sorted mode.
17538 /// - Encoded field values must not contain any bytes <= `delimiter[0]`
17539 /// - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
17540 /// `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
17541 ///
17542 /// Distinct mode:
17543 ///
17544 /// - Fields are encoded in distinct mode.
17545 /// - Encoded field values must not contain `delimiter[0]`.
17546 #[derive(Clone, Default, PartialEq)]
17547 #[non_exhaustive]
17548 pub struct DelimitedBytes {
17549 /// Byte sequence used to delimit concatenated fields. The delimiter must
17550 /// contain at least 1 character and at most 50 characters.
17551 pub delimiter: ::bytes::Bytes,
17552
17553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17554 }
17555
17556 impl DelimitedBytes {
17557 pub fn new() -> Self {
17558 std::default::Default::default()
17559 }
17560
17561 /// Sets the value of [delimiter][crate::model::r#type::r#struct::encoding::DelimitedBytes::delimiter].
17562 ///
17563 /// # Example
17564 /// ```ignore,no_run
17565 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::DelimitedBytes;
17566 /// let x = DelimitedBytes::new().set_delimiter(bytes::Bytes::from_static(b"example"));
17567 /// ```
17568 pub fn set_delimiter<T: std::convert::Into<::bytes::Bytes>>(
17569 mut self,
17570 v: T,
17571 ) -> Self {
17572 self.delimiter = v.into();
17573 self
17574 }
17575 }
17576
17577 impl wkt::message::Message for DelimitedBytes {
17578 fn typename() -> &'static str {
17579 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes"
17580 }
17581 }
17582
17583 /// Fields are encoded independently and concatenated with the fixed byte
17584 /// pair {0x00, 0x01} in between.
17585 ///
17586 /// Any null (0x00) byte in an encoded field is replaced by the fixed byte
17587 /// pair {0x00, 0xFF}.
17588 ///
17589 /// Fields that encode to the empty string "" have special handling:
17590 ///
17591 /// - If *every* field encodes to "", or if the STRUCT has no fields
17592 /// defined, then the STRUCT is encoded as the fixed byte pair
17593 /// {0x00, 0x00}.
17594 /// - Otherwise, the STRUCT only encodes until the last non-empty field,
17595 /// omitting any trailing empty fields. Any empty fields that aren't
17596 /// omitted are replaced with the fixed byte pair {0x00, 0x00}.
17597 ///
17598 /// Examples:
17599 ///
17600 /// - STRUCT() -> "\00\00"
17601 /// - STRUCT("") -> "\00\00"
17602 /// - STRUCT("", "") -> "\00\00"
17603 /// - STRUCT("", "B") -> "\00\00" + "\00\01" + "B"
17604 /// - STRUCT("A", "") -> "A"
17605 /// - STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B"
17606 /// - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
17607 ///
17608 /// Since null bytes are always escaped, this encoding can cause size
17609 /// blowup for encodings like `Int64.BigEndianBytes` that are likely to
17610 /// produce many such bytes.
17611 ///
17612 /// Sorted mode:
17613 ///
17614 /// - Fields are encoded in sorted mode.
17615 /// - All values supported by the field encodings are allowed
17616 /// - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
17617 /// `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
17618 ///
17619 /// Distinct mode:
17620 ///
17621 /// - Fields are encoded in distinct mode.
17622 /// - All values supported by the field encodings are allowed.
17623 #[derive(Clone, Default, PartialEq)]
17624 #[non_exhaustive]
17625 pub struct OrderedCodeBytes {
17626 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17627 }
17628
17629 impl OrderedCodeBytes {
17630 pub fn new() -> Self {
17631 std::default::Default::default()
17632 }
17633 }
17634
17635 impl wkt::message::Message for OrderedCodeBytes {
17636 fn typename() -> &'static str {
17637 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes"
17638 }
17639 }
17640
17641 /// Which encoding to use.
17642 #[derive(Clone, Debug, PartialEq)]
17643 #[non_exhaustive]
17644 pub enum Encoding {
17645 /// Use `Singleton` encoding.
17646 Singleton(std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>),
17647 /// Use `DelimitedBytes` encoding.
17648 DelimitedBytes(
17649 std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
17650 ),
17651 /// User `OrderedCodeBytes` encoding.
17652 OrderedCodeBytes(
17653 std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
17654 ),
17655 }
17656 }
17657 }
17658
17659 /// A protobuf message type.
17660 /// Values of type `Proto` are stored in `Value.bytes_value`.
17661 #[derive(Clone, Default, PartialEq)]
17662 #[non_exhaustive]
17663 pub struct Proto {
17664 /// The ID of the schema bundle that this proto is defined in.
17665 pub schema_bundle_id: std::string::String,
17666
17667 /// The fully qualified name of the protobuf message, including package. In
17668 /// the format of "foo.bar.Message".
17669 pub message_name: std::string::String,
17670
17671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17672 }
17673
17674 impl Proto {
17675 pub fn new() -> Self {
17676 std::default::Default::default()
17677 }
17678
17679 /// Sets the value of [schema_bundle_id][crate::model::r#type::Proto::schema_bundle_id].
17680 ///
17681 /// # Example
17682 /// ```ignore,no_run
17683 /// # use google_cloud_bigtable_admin_v2::model::r#type::Proto;
17684 /// let x = Proto::new().set_schema_bundle_id("example");
17685 /// ```
17686 pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
17687 mut self,
17688 v: T,
17689 ) -> Self {
17690 self.schema_bundle_id = v.into();
17691 self
17692 }
17693
17694 /// Sets the value of [message_name][crate::model::r#type::Proto::message_name].
17695 ///
17696 /// # Example
17697 /// ```ignore,no_run
17698 /// # use google_cloud_bigtable_admin_v2::model::r#type::Proto;
17699 /// let x = Proto::new().set_message_name("example");
17700 /// ```
17701 pub fn set_message_name<T: std::convert::Into<std::string::String>>(
17702 mut self,
17703 v: T,
17704 ) -> Self {
17705 self.message_name = v.into();
17706 self
17707 }
17708 }
17709
17710 impl wkt::message::Message for Proto {
17711 fn typename() -> &'static str {
17712 "type.googleapis.com/google.bigtable.admin.v2.Type.Proto"
17713 }
17714 }
17715
17716 /// A protobuf enum type.
17717 /// Values of type `Enum` are stored in `Value.int_value`.
17718 #[derive(Clone, Default, PartialEq)]
17719 #[non_exhaustive]
17720 pub struct Enum {
17721 /// The ID of the schema bundle that this enum is defined in.
17722 pub schema_bundle_id: std::string::String,
17723
17724 /// The fully qualified name of the protobuf enum message, including package.
17725 /// In the format of "foo.bar.EnumMessage".
17726 pub enum_name: std::string::String,
17727
17728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17729 }
17730
17731 impl Enum {
17732 pub fn new() -> Self {
17733 std::default::Default::default()
17734 }
17735
17736 /// Sets the value of [schema_bundle_id][crate::model::r#type::Enum::schema_bundle_id].
17737 ///
17738 /// # Example
17739 /// ```ignore,no_run
17740 /// # use google_cloud_bigtable_admin_v2::model::r#type::Enum;
17741 /// let x = Enum::new().set_schema_bundle_id("example");
17742 /// ```
17743 pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
17744 mut self,
17745 v: T,
17746 ) -> Self {
17747 self.schema_bundle_id = v.into();
17748 self
17749 }
17750
17751 /// Sets the value of [enum_name][crate::model::r#type::Enum::enum_name].
17752 ///
17753 /// # Example
17754 /// ```ignore,no_run
17755 /// # use google_cloud_bigtable_admin_v2::model::r#type::Enum;
17756 /// let x = Enum::new().set_enum_name("example");
17757 /// ```
17758 pub fn set_enum_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17759 self.enum_name = v.into();
17760 self
17761 }
17762 }
17763
17764 impl wkt::message::Message for Enum {
17765 fn typename() -> &'static str {
17766 "type.googleapis.com/google.bigtable.admin.v2.Type.Enum"
17767 }
17768 }
17769
17770 /// An ordered list of elements of a given type.
17771 /// Values of type `Array` are stored in `Value.array_value`.
17772 #[derive(Clone, Default, PartialEq)]
17773 #[non_exhaustive]
17774 pub struct Array {
17775 /// The type of the elements in the array. This must not be `Array`.
17776 pub element_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
17777
17778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17779 }
17780
17781 impl Array {
17782 pub fn new() -> Self {
17783 std::default::Default::default()
17784 }
17785
17786 /// Sets the value of [element_type][crate::model::r#type::Array::element_type].
17787 ///
17788 /// # Example
17789 /// ```ignore,no_run
17790 /// # use google_cloud_bigtable_admin_v2::model::r#type::Array;
17791 /// use google_cloud_bigtable_admin_v2::model::Type;
17792 /// let x = Array::new().set_element_type(Type::default()/* use setters */);
17793 /// ```
17794 pub fn set_element_type<T>(mut self, v: T) -> Self
17795 where
17796 T: std::convert::Into<crate::model::Type>,
17797 {
17798 self.element_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
17799 self
17800 }
17801
17802 /// Sets or clears the value of [element_type][crate::model::r#type::Array::element_type].
17803 ///
17804 /// # Example
17805 /// ```ignore,no_run
17806 /// # use google_cloud_bigtable_admin_v2::model::r#type::Array;
17807 /// use google_cloud_bigtable_admin_v2::model::Type;
17808 /// let x = Array::new().set_or_clear_element_type(Some(Type::default()/* use setters */));
17809 /// let x = Array::new().set_or_clear_element_type(None::<Type>);
17810 /// ```
17811 pub fn set_or_clear_element_type<T>(mut self, v: std::option::Option<T>) -> Self
17812 where
17813 T: std::convert::Into<crate::model::Type>,
17814 {
17815 self.element_type = v.map(|x| std::boxed::Box::new(x.into()));
17816 self
17817 }
17818 }
17819
17820 impl wkt::message::Message for Array {
17821 fn typename() -> &'static str {
17822 "type.googleapis.com/google.bigtable.admin.v2.Type.Array"
17823 }
17824 }
17825
17826 /// A mapping of keys to values of a given type.
17827 /// Values of type `Map` are stored in a `Value.array_value` where each entry
17828 /// is another `Value.array_value` with two elements (the key and the value,
17829 /// in that order).
17830 /// Normally encoded Map values won't have repeated keys, however, clients are
17831 /// expected to handle the case in which they do. If the same key appears
17832 /// multiple times, the _last_ value takes precedence.
17833 #[derive(Clone, Default, PartialEq)]
17834 #[non_exhaustive]
17835 pub struct Map {
17836 /// The type of a map key.
17837 /// Only `Bytes`, `String`, and `Int64` are allowed as key types.
17838 pub key_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
17839
17840 /// The type of the values in a map.
17841 pub value_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
17842
17843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17844 }
17845
17846 impl Map {
17847 pub fn new() -> Self {
17848 std::default::Default::default()
17849 }
17850
17851 /// Sets the value of [key_type][crate::model::r#type::Map::key_type].
17852 ///
17853 /// # Example
17854 /// ```ignore,no_run
17855 /// # use google_cloud_bigtable_admin_v2::model::r#type::Map;
17856 /// use google_cloud_bigtable_admin_v2::model::Type;
17857 /// let x = Map::new().set_key_type(Type::default()/* use setters */);
17858 /// ```
17859 pub fn set_key_type<T>(mut self, v: T) -> Self
17860 where
17861 T: std::convert::Into<crate::model::Type>,
17862 {
17863 self.key_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
17864 self
17865 }
17866
17867 /// Sets or clears the value of [key_type][crate::model::r#type::Map::key_type].
17868 ///
17869 /// # Example
17870 /// ```ignore,no_run
17871 /// # use google_cloud_bigtable_admin_v2::model::r#type::Map;
17872 /// use google_cloud_bigtable_admin_v2::model::Type;
17873 /// let x = Map::new().set_or_clear_key_type(Some(Type::default()/* use setters */));
17874 /// let x = Map::new().set_or_clear_key_type(None::<Type>);
17875 /// ```
17876 pub fn set_or_clear_key_type<T>(mut self, v: std::option::Option<T>) -> Self
17877 where
17878 T: std::convert::Into<crate::model::Type>,
17879 {
17880 self.key_type = v.map(|x| std::boxed::Box::new(x.into()));
17881 self
17882 }
17883
17884 /// Sets the value of [value_type][crate::model::r#type::Map::value_type].
17885 ///
17886 /// # Example
17887 /// ```ignore,no_run
17888 /// # use google_cloud_bigtable_admin_v2::model::r#type::Map;
17889 /// use google_cloud_bigtable_admin_v2::model::Type;
17890 /// let x = Map::new().set_value_type(Type::default()/* use setters */);
17891 /// ```
17892 pub fn set_value_type<T>(mut self, v: T) -> Self
17893 where
17894 T: std::convert::Into<crate::model::Type>,
17895 {
17896 self.value_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
17897 self
17898 }
17899
17900 /// Sets or clears the value of [value_type][crate::model::r#type::Map::value_type].
17901 ///
17902 /// # Example
17903 /// ```ignore,no_run
17904 /// # use google_cloud_bigtable_admin_v2::model::r#type::Map;
17905 /// use google_cloud_bigtable_admin_v2::model::Type;
17906 /// let x = Map::new().set_or_clear_value_type(Some(Type::default()/* use setters */));
17907 /// let x = Map::new().set_or_clear_value_type(None::<Type>);
17908 /// ```
17909 pub fn set_or_clear_value_type<T>(mut self, v: std::option::Option<T>) -> Self
17910 where
17911 T: std::convert::Into<crate::model::Type>,
17912 {
17913 self.value_type = v.map(|x| std::boxed::Box::new(x.into()));
17914 self
17915 }
17916 }
17917
17918 impl wkt::message::Message for Map {
17919 fn typename() -> &'static str {
17920 "type.googleapis.com/google.bigtable.admin.v2.Type.Map"
17921 }
17922 }
17923
17924 /// A value that combines incremental updates into a summarized value.
17925 ///
17926 /// Data is never directly written or read using type `Aggregate`. Writes will
17927 /// provide either the `input_type` or `state_type`, and reads will always
17928 /// return the `state_type` .
17929 #[derive(Clone, Default, PartialEq)]
17930 #[non_exhaustive]
17931 pub struct Aggregate {
17932 /// Type of the inputs that are accumulated by this `Aggregate`, which must
17933 /// specify a full encoding.
17934 /// Use `AddInput` mutations to accumulate new inputs.
17935 pub input_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
17936
17937 /// Output only. Type that holds the internal accumulator state for the
17938 /// `Aggregate`. This is a function of the `input_type` and `aggregator`
17939 /// chosen, and will always specify a full encoding.
17940 pub state_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
17941
17942 /// Which aggregator function to use. The configured types must match.
17943 pub aggregator: std::option::Option<crate::model::r#type::aggregate::Aggregator>,
17944
17945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17946 }
17947
17948 impl Aggregate {
17949 pub fn new() -> Self {
17950 std::default::Default::default()
17951 }
17952
17953 /// Sets the value of [input_type][crate::model::r#type::Aggregate::input_type].
17954 ///
17955 /// # Example
17956 /// ```ignore,no_run
17957 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
17958 /// use google_cloud_bigtable_admin_v2::model::Type;
17959 /// let x = Aggregate::new().set_input_type(Type::default()/* use setters */);
17960 /// ```
17961 pub fn set_input_type<T>(mut self, v: T) -> Self
17962 where
17963 T: std::convert::Into<crate::model::Type>,
17964 {
17965 self.input_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
17966 self
17967 }
17968
17969 /// Sets or clears the value of [input_type][crate::model::r#type::Aggregate::input_type].
17970 ///
17971 /// # Example
17972 /// ```ignore,no_run
17973 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
17974 /// use google_cloud_bigtable_admin_v2::model::Type;
17975 /// let x = Aggregate::new().set_or_clear_input_type(Some(Type::default()/* use setters */));
17976 /// let x = Aggregate::new().set_or_clear_input_type(None::<Type>);
17977 /// ```
17978 pub fn set_or_clear_input_type<T>(mut self, v: std::option::Option<T>) -> Self
17979 where
17980 T: std::convert::Into<crate::model::Type>,
17981 {
17982 self.input_type = v.map(|x| std::boxed::Box::new(x.into()));
17983 self
17984 }
17985
17986 /// Sets the value of [state_type][crate::model::r#type::Aggregate::state_type].
17987 ///
17988 /// # Example
17989 /// ```ignore,no_run
17990 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
17991 /// use google_cloud_bigtable_admin_v2::model::Type;
17992 /// let x = Aggregate::new().set_state_type(Type::default()/* use setters */);
17993 /// ```
17994 pub fn set_state_type<T>(mut self, v: T) -> Self
17995 where
17996 T: std::convert::Into<crate::model::Type>,
17997 {
17998 self.state_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
17999 self
18000 }
18001
18002 /// Sets or clears the value of [state_type][crate::model::r#type::Aggregate::state_type].
18003 ///
18004 /// # Example
18005 /// ```ignore,no_run
18006 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
18007 /// use google_cloud_bigtable_admin_v2::model::Type;
18008 /// let x = Aggregate::new().set_or_clear_state_type(Some(Type::default()/* use setters */));
18009 /// let x = Aggregate::new().set_or_clear_state_type(None::<Type>);
18010 /// ```
18011 pub fn set_or_clear_state_type<T>(mut self, v: std::option::Option<T>) -> Self
18012 where
18013 T: std::convert::Into<crate::model::Type>,
18014 {
18015 self.state_type = v.map(|x| std::boxed::Box::new(x.into()));
18016 self
18017 }
18018
18019 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator].
18020 ///
18021 /// Note that all the setters affecting `aggregator` are mutually
18022 /// exclusive.
18023 ///
18024 /// # Example
18025 /// ```ignore,no_run
18026 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
18027 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::Sum;
18028 /// let x = Aggregate::new().set_aggregator(Some(
18029 /// google_cloud_bigtable_admin_v2::model::r#type::aggregate::Aggregator::Sum(Sum::default().into())));
18030 /// ```
18031 pub fn set_aggregator<
18032 T: std::convert::Into<std::option::Option<crate::model::r#type::aggregate::Aggregator>>,
18033 >(
18034 mut self,
18035 v: T,
18036 ) -> Self {
18037 self.aggregator = v.into();
18038 self
18039 }
18040
18041 /// The value of [aggregator][crate::model::r#type::Aggregate::aggregator]
18042 /// if it holds a `Sum`, `None` if the field is not set or
18043 /// holds a different branch.
18044 pub fn sum(
18045 &self,
18046 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Sum>> {
18047 #[allow(unreachable_patterns)]
18048 self.aggregator.as_ref().and_then(|v| match v {
18049 crate::model::r#type::aggregate::Aggregator::Sum(v) => std::option::Option::Some(v),
18050 _ => std::option::Option::None,
18051 })
18052 }
18053
18054 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator]
18055 /// to hold a `Sum`.
18056 ///
18057 /// Note that all the setters affecting `aggregator` are
18058 /// mutually exclusive.
18059 ///
18060 /// # Example
18061 /// ```ignore,no_run
18062 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
18063 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::Sum;
18064 /// let x = Aggregate::new().set_sum(Sum::default()/* use setters */);
18065 /// assert!(x.sum().is_some());
18066 /// assert!(x.hllpp_unique_count().is_none());
18067 /// assert!(x.max().is_none());
18068 /// assert!(x.min().is_none());
18069 /// ```
18070 pub fn set_sum<
18071 T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Sum>>,
18072 >(
18073 mut self,
18074 v: T,
18075 ) -> Self {
18076 self.aggregator = std::option::Option::Some(
18077 crate::model::r#type::aggregate::Aggregator::Sum(v.into()),
18078 );
18079 self
18080 }
18081
18082 /// The value of [aggregator][crate::model::r#type::Aggregate::aggregator]
18083 /// if it holds a `HllppUniqueCount`, `None` if the field is not set or
18084 /// holds a different branch.
18085 pub fn hllpp_unique_count(
18086 &self,
18087 ) -> std::option::Option<
18088 &std::boxed::Box<crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount>,
18089 > {
18090 #[allow(unreachable_patterns)]
18091 self.aggregator.as_ref().and_then(|v| match v {
18092 crate::model::r#type::aggregate::Aggregator::HllppUniqueCount(v) => {
18093 std::option::Option::Some(v)
18094 }
18095 _ => std::option::Option::None,
18096 })
18097 }
18098
18099 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator]
18100 /// to hold a `HllppUniqueCount`.
18101 ///
18102 /// Note that all the setters affecting `aggregator` are
18103 /// mutually exclusive.
18104 ///
18105 /// # Example
18106 /// ```ignore,no_run
18107 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
18108 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount;
18109 /// let x = Aggregate::new().set_hllpp_unique_count(HyperLogLogPlusPlusUniqueCount::default()/* use setters */);
18110 /// assert!(x.hllpp_unique_count().is_some());
18111 /// assert!(x.sum().is_none());
18112 /// assert!(x.max().is_none());
18113 /// assert!(x.min().is_none());
18114 /// ```
18115 pub fn set_hllpp_unique_count<
18116 T: std::convert::Into<
18117 std::boxed::Box<
18118 crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount,
18119 >,
18120 >,
18121 >(
18122 mut self,
18123 v: T,
18124 ) -> Self {
18125 self.aggregator = std::option::Option::Some(
18126 crate::model::r#type::aggregate::Aggregator::HllppUniqueCount(v.into()),
18127 );
18128 self
18129 }
18130
18131 /// The value of [aggregator][crate::model::r#type::Aggregate::aggregator]
18132 /// if it holds a `Max`, `None` if the field is not set or
18133 /// holds a different branch.
18134 pub fn max(
18135 &self,
18136 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Max>> {
18137 #[allow(unreachable_patterns)]
18138 self.aggregator.as_ref().and_then(|v| match v {
18139 crate::model::r#type::aggregate::Aggregator::Max(v) => std::option::Option::Some(v),
18140 _ => std::option::Option::None,
18141 })
18142 }
18143
18144 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator]
18145 /// to hold a `Max`.
18146 ///
18147 /// Note that all the setters affecting `aggregator` are
18148 /// mutually exclusive.
18149 ///
18150 /// # Example
18151 /// ```ignore,no_run
18152 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
18153 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::Max;
18154 /// let x = Aggregate::new().set_max(Max::default()/* use setters */);
18155 /// assert!(x.max().is_some());
18156 /// assert!(x.sum().is_none());
18157 /// assert!(x.hllpp_unique_count().is_none());
18158 /// assert!(x.min().is_none());
18159 /// ```
18160 pub fn set_max<
18161 T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Max>>,
18162 >(
18163 mut self,
18164 v: T,
18165 ) -> Self {
18166 self.aggregator = std::option::Option::Some(
18167 crate::model::r#type::aggregate::Aggregator::Max(v.into()),
18168 );
18169 self
18170 }
18171
18172 /// The value of [aggregator][crate::model::r#type::Aggregate::aggregator]
18173 /// if it holds a `Min`, `None` if the field is not set or
18174 /// holds a different branch.
18175 pub fn min(
18176 &self,
18177 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Min>> {
18178 #[allow(unreachable_patterns)]
18179 self.aggregator.as_ref().and_then(|v| match v {
18180 crate::model::r#type::aggregate::Aggregator::Min(v) => std::option::Option::Some(v),
18181 _ => std::option::Option::None,
18182 })
18183 }
18184
18185 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator]
18186 /// to hold a `Min`.
18187 ///
18188 /// Note that all the setters affecting `aggregator` are
18189 /// mutually exclusive.
18190 ///
18191 /// # Example
18192 /// ```ignore,no_run
18193 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
18194 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::Min;
18195 /// let x = Aggregate::new().set_min(Min::default()/* use setters */);
18196 /// assert!(x.min().is_some());
18197 /// assert!(x.sum().is_none());
18198 /// assert!(x.hllpp_unique_count().is_none());
18199 /// assert!(x.max().is_none());
18200 /// ```
18201 pub fn set_min<
18202 T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Min>>,
18203 >(
18204 mut self,
18205 v: T,
18206 ) -> Self {
18207 self.aggregator = std::option::Option::Some(
18208 crate::model::r#type::aggregate::Aggregator::Min(v.into()),
18209 );
18210 self
18211 }
18212 }
18213
18214 impl wkt::message::Message for Aggregate {
18215 fn typename() -> &'static str {
18216 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate"
18217 }
18218 }
18219
18220 /// Defines additional types related to [Aggregate].
18221 pub mod aggregate {
18222 #[allow(unused_imports)]
18223 use super::*;
18224
18225 /// Computes the sum of the input values.
18226 /// Allowed input: `Int64`
18227 /// State: same as input
18228 #[derive(Clone, Default, PartialEq)]
18229 #[non_exhaustive]
18230 pub struct Sum {
18231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18232 }
18233
18234 impl Sum {
18235 pub fn new() -> Self {
18236 std::default::Default::default()
18237 }
18238 }
18239
18240 impl wkt::message::Message for Sum {
18241 fn typename() -> &'static str {
18242 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Sum"
18243 }
18244 }
18245
18246 /// Computes the max of the input values.
18247 /// Allowed input: `Int64`
18248 /// State: same as input
18249 #[derive(Clone, Default, PartialEq)]
18250 #[non_exhaustive]
18251 pub struct Max {
18252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18253 }
18254
18255 impl Max {
18256 pub fn new() -> Self {
18257 std::default::Default::default()
18258 }
18259 }
18260
18261 impl wkt::message::Message for Max {
18262 fn typename() -> &'static str {
18263 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Max"
18264 }
18265 }
18266
18267 /// Computes the min of the input values.
18268 /// Allowed input: `Int64`
18269 /// State: same as input
18270 #[derive(Clone, Default, PartialEq)]
18271 #[non_exhaustive]
18272 pub struct Min {
18273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18274 }
18275
18276 impl Min {
18277 pub fn new() -> Self {
18278 std::default::Default::default()
18279 }
18280 }
18281
18282 impl wkt::message::Message for Min {
18283 fn typename() -> &'static str {
18284 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Min"
18285 }
18286 }
18287
18288 /// Computes an approximate unique count over the input values. When using
18289 /// raw data as input, be careful to use a consistent encoding. Otherwise
18290 /// the same value encoded differently could count more than once, or two
18291 /// distinct values could count as identical.
18292 /// Input: Any, or omit for Raw
18293 /// State: TBD
18294 /// Special state conversions: `Int64` (the unique count estimate)
18295 #[derive(Clone, Default, PartialEq)]
18296 #[non_exhaustive]
18297 pub struct HyperLogLogPlusPlusUniqueCount {
18298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18299 }
18300
18301 impl HyperLogLogPlusPlusUniqueCount {
18302 pub fn new() -> Self {
18303 std::default::Default::default()
18304 }
18305 }
18306
18307 impl wkt::message::Message for HyperLogLogPlusPlusUniqueCount {
18308 fn typename() -> &'static str {
18309 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount"
18310 }
18311 }
18312
18313 /// Which aggregator function to use. The configured types must match.
18314 #[derive(Clone, Debug, PartialEq)]
18315 #[non_exhaustive]
18316 pub enum Aggregator {
18317 /// Sum aggregator.
18318 Sum(std::boxed::Box<crate::model::r#type::aggregate::Sum>),
18319 /// HyperLogLogPlusPlusUniqueCount aggregator.
18320 HllppUniqueCount(
18321 std::boxed::Box<crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount>,
18322 ),
18323 /// Max aggregator.
18324 Max(std::boxed::Box<crate::model::r#type::aggregate::Max>),
18325 /// Min aggregator.
18326 Min(std::boxed::Box<crate::model::r#type::aggregate::Min>),
18327 }
18328 }
18329
18330 /// The kind of type that this represents.
18331 #[derive(Clone, Debug, PartialEq)]
18332 #[non_exhaustive]
18333 pub enum Kind {
18334 /// Bytes
18335 BytesType(std::boxed::Box<crate::model::r#type::Bytes>),
18336 /// String
18337 StringType(std::boxed::Box<crate::model::r#type::String>),
18338 /// Int64
18339 Int64Type(std::boxed::Box<crate::model::r#type::Int64>),
18340 /// Float32
18341 Float32Type(std::boxed::Box<crate::model::r#type::Float32>),
18342 /// Float64
18343 Float64Type(std::boxed::Box<crate::model::r#type::Float64>),
18344 /// Bool
18345 BoolType(std::boxed::Box<crate::model::r#type::Bool>),
18346 /// Timestamp
18347 TimestampType(std::boxed::Box<crate::model::r#type::Timestamp>),
18348 /// Date
18349 DateType(std::boxed::Box<crate::model::r#type::Date>),
18350 /// Aggregate
18351 AggregateType(std::boxed::Box<crate::model::r#type::Aggregate>),
18352 /// Struct
18353 StructType(std::boxed::Box<crate::model::r#type::Struct>),
18354 /// Array
18355 ArrayType(std::boxed::Box<crate::model::r#type::Array>),
18356 /// Map
18357 MapType(std::boxed::Box<crate::model::r#type::Map>),
18358 /// Proto
18359 ProtoType(std::boxed::Box<crate::model::r#type::Proto>),
18360 /// Enum
18361 EnumType(std::boxed::Box<crate::model::r#type::Enum>),
18362 }
18363}
18364
18365/// Storage media types for persisting Bigtable data.
18366///
18367/// # Working with unknown values
18368///
18369/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18370/// additional enum variants at any time. Adding new variants is not considered
18371/// a breaking change. Applications should write their code in anticipation of:
18372///
18373/// - New values appearing in future releases of the client library, **and**
18374/// - New values received dynamically, without application changes.
18375///
18376/// Please consult the [Working with enums] section in the user guide for some
18377/// guidelines.
18378///
18379/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18380#[derive(Clone, Debug, PartialEq)]
18381#[non_exhaustive]
18382pub enum StorageType {
18383 /// The user did not specify a storage type.
18384 Unspecified,
18385 /// Flash (SSD) storage should be used.
18386 Ssd,
18387 /// Magnetic drive (HDD) storage should be used.
18388 Hdd,
18389 /// If set, the enum was initialized with an unknown value.
18390 ///
18391 /// Applications can examine the value using [StorageType::value] or
18392 /// [StorageType::name].
18393 UnknownValue(storage_type::UnknownValue),
18394}
18395
18396#[doc(hidden)]
18397pub mod storage_type {
18398 #[allow(unused_imports)]
18399 use super::*;
18400 #[derive(Clone, Debug, PartialEq)]
18401 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18402}
18403
18404impl StorageType {
18405 /// Gets the enum value.
18406 ///
18407 /// Returns `None` if the enum contains an unknown value deserialized from
18408 /// the string representation of enums.
18409 pub fn value(&self) -> std::option::Option<i32> {
18410 match self {
18411 Self::Unspecified => std::option::Option::Some(0),
18412 Self::Ssd => std::option::Option::Some(1),
18413 Self::Hdd => std::option::Option::Some(2),
18414 Self::UnknownValue(u) => u.0.value(),
18415 }
18416 }
18417
18418 /// Gets the enum value as a string.
18419 ///
18420 /// Returns `None` if the enum contains an unknown value deserialized from
18421 /// the integer representation of enums.
18422 pub fn name(&self) -> std::option::Option<&str> {
18423 match self {
18424 Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
18425 Self::Ssd => std::option::Option::Some("SSD"),
18426 Self::Hdd => std::option::Option::Some("HDD"),
18427 Self::UnknownValue(u) => u.0.name(),
18428 }
18429 }
18430}
18431
18432impl std::default::Default for StorageType {
18433 fn default() -> Self {
18434 use std::convert::From;
18435 Self::from(0)
18436 }
18437}
18438
18439impl std::fmt::Display for StorageType {
18440 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18441 wkt::internal::display_enum(f, self.name(), self.value())
18442 }
18443}
18444
18445impl std::convert::From<i32> for StorageType {
18446 fn from(value: i32) -> Self {
18447 match value {
18448 0 => Self::Unspecified,
18449 1 => Self::Ssd,
18450 2 => Self::Hdd,
18451 _ => Self::UnknownValue(storage_type::UnknownValue(
18452 wkt::internal::UnknownEnumValue::Integer(value),
18453 )),
18454 }
18455 }
18456}
18457
18458impl std::convert::From<&str> for StorageType {
18459 fn from(value: &str) -> Self {
18460 use std::string::ToString;
18461 match value {
18462 "STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
18463 "SSD" => Self::Ssd,
18464 "HDD" => Self::Hdd,
18465 _ => Self::UnknownValue(storage_type::UnknownValue(
18466 wkt::internal::UnknownEnumValue::String(value.to_string()),
18467 )),
18468 }
18469 }
18470}
18471
18472impl serde::ser::Serialize for StorageType {
18473 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18474 where
18475 S: serde::Serializer,
18476 {
18477 match self {
18478 Self::Unspecified => serializer.serialize_i32(0),
18479 Self::Ssd => serializer.serialize_i32(1),
18480 Self::Hdd => serializer.serialize_i32(2),
18481 Self::UnknownValue(u) => u.0.serialize(serializer),
18482 }
18483 }
18484}
18485
18486impl<'de> serde::de::Deserialize<'de> for StorageType {
18487 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18488 where
18489 D: serde::Deserializer<'de>,
18490 {
18491 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
18492 ".google.bigtable.admin.v2.StorageType",
18493 ))
18494 }
18495}
18496
18497/// Indicates the type of the restore source.
18498///
18499/// # Working with unknown values
18500///
18501/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18502/// additional enum variants at any time. Adding new variants is not considered
18503/// a breaking change. Applications should write their code in anticipation of:
18504///
18505/// - New values appearing in future releases of the client library, **and**
18506/// - New values received dynamically, without application changes.
18507///
18508/// Please consult the [Working with enums] section in the user guide for some
18509/// guidelines.
18510///
18511/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18512#[derive(Clone, Debug, PartialEq)]
18513#[non_exhaustive]
18514pub enum RestoreSourceType {
18515 /// No restore associated.
18516 Unspecified,
18517 /// A backup was used as the source of the restore.
18518 Backup,
18519 /// If set, the enum was initialized with an unknown value.
18520 ///
18521 /// Applications can examine the value using [RestoreSourceType::value] or
18522 /// [RestoreSourceType::name].
18523 UnknownValue(restore_source_type::UnknownValue),
18524}
18525
18526#[doc(hidden)]
18527pub mod restore_source_type {
18528 #[allow(unused_imports)]
18529 use super::*;
18530 #[derive(Clone, Debug, PartialEq)]
18531 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18532}
18533
18534impl RestoreSourceType {
18535 /// Gets the enum value.
18536 ///
18537 /// Returns `None` if the enum contains an unknown value deserialized from
18538 /// the string representation of enums.
18539 pub fn value(&self) -> std::option::Option<i32> {
18540 match self {
18541 Self::Unspecified => std::option::Option::Some(0),
18542 Self::Backup => std::option::Option::Some(1),
18543 Self::UnknownValue(u) => u.0.value(),
18544 }
18545 }
18546
18547 /// Gets the enum value as a string.
18548 ///
18549 /// Returns `None` if the enum contains an unknown value deserialized from
18550 /// the integer representation of enums.
18551 pub fn name(&self) -> std::option::Option<&str> {
18552 match self {
18553 Self::Unspecified => std::option::Option::Some("RESTORE_SOURCE_TYPE_UNSPECIFIED"),
18554 Self::Backup => std::option::Option::Some("BACKUP"),
18555 Self::UnknownValue(u) => u.0.name(),
18556 }
18557 }
18558}
18559
18560impl std::default::Default for RestoreSourceType {
18561 fn default() -> Self {
18562 use std::convert::From;
18563 Self::from(0)
18564 }
18565}
18566
18567impl std::fmt::Display for RestoreSourceType {
18568 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18569 wkt::internal::display_enum(f, self.name(), self.value())
18570 }
18571}
18572
18573impl std::convert::From<i32> for RestoreSourceType {
18574 fn from(value: i32) -> Self {
18575 match value {
18576 0 => Self::Unspecified,
18577 1 => Self::Backup,
18578 _ => Self::UnknownValue(restore_source_type::UnknownValue(
18579 wkt::internal::UnknownEnumValue::Integer(value),
18580 )),
18581 }
18582 }
18583}
18584
18585impl std::convert::From<&str> for RestoreSourceType {
18586 fn from(value: &str) -> Self {
18587 use std::string::ToString;
18588 match value {
18589 "RESTORE_SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
18590 "BACKUP" => Self::Backup,
18591 _ => Self::UnknownValue(restore_source_type::UnknownValue(
18592 wkt::internal::UnknownEnumValue::String(value.to_string()),
18593 )),
18594 }
18595 }
18596}
18597
18598impl serde::ser::Serialize for RestoreSourceType {
18599 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18600 where
18601 S: serde::Serializer,
18602 {
18603 match self {
18604 Self::Unspecified => serializer.serialize_i32(0),
18605 Self::Backup => serializer.serialize_i32(1),
18606 Self::UnknownValue(u) => u.0.serialize(serializer),
18607 }
18608 }
18609}
18610
18611impl<'de> serde::de::Deserialize<'de> for RestoreSourceType {
18612 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18613 where
18614 D: serde::Deserializer<'de>,
18615 {
18616 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestoreSourceType>::new(
18617 ".google.bigtable.admin.v2.RestoreSourceType",
18618 ))
18619 }
18620}