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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
29extern crate google_cloud_rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Request message for BigtableInstanceAdmin.CreateInstance.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct CreateInstanceRequest {
45 /// Required. The unique name of the project in which to create the new
46 /// instance. Values are of the form `projects/{project}`.
47 pub parent: std::string::String,
48
49 /// Required. The ID to be used when referring to the new instance within its
50 /// project, e.g., just `myinstance` rather than
51 /// `projects/myproject/instances/myinstance`.
52 pub instance_id: std::string::String,
53
54 /// Required. The instance to create.
55 /// Fields marked `OutputOnly` must be left blank.
56 pub instance: std::option::Option<crate::model::Instance>,
57
58 /// Required. The clusters to be created within the instance, mapped by desired
59 /// cluster ID, e.g., just `mycluster` rather than
60 /// `projects/myproject/instances/myinstance/clusters/mycluster`.
61 /// Fields marked `OutputOnly` must be left blank.
62 pub clusters: std::collections::HashMap<std::string::String, crate::model::Cluster>,
63
64 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
65}
66
67impl CreateInstanceRequest {
68 /// Creates a new default instance.
69 pub fn new() -> Self {
70 std::default::Default::default()
71 }
72
73 /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
74 ///
75 /// # Example
76 /// ```ignore,no_run
77 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
78 /// let x = CreateInstanceRequest::new().set_parent("example");
79 /// ```
80 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
81 self.parent = v.into();
82 self
83 }
84
85 /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
90 /// let x = CreateInstanceRequest::new().set_instance_id("example");
91 /// ```
92 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
93 self.instance_id = v.into();
94 self
95 }
96
97 /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
98 ///
99 /// # Example
100 /// ```ignore,no_run
101 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
102 /// use google_cloud_bigtable_admin_v2::model::Instance;
103 /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
104 /// ```
105 pub fn set_instance<T>(mut self, v: T) -> Self
106 where
107 T: std::convert::Into<crate::model::Instance>,
108 {
109 self.instance = std::option::Option::Some(v.into());
110 self
111 }
112
113 /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
114 ///
115 /// # Example
116 /// ```ignore,no_run
117 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
118 /// use google_cloud_bigtable_admin_v2::model::Instance;
119 /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
120 /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
121 /// ```
122 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
123 where
124 T: std::convert::Into<crate::model::Instance>,
125 {
126 self.instance = v.map(|x| x.into());
127 self
128 }
129
130 /// Sets the value of [clusters][crate::model::CreateInstanceRequest::clusters].
131 ///
132 /// # Example
133 /// ```ignore,no_run
134 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
135 /// use google_cloud_bigtable_admin_v2::model::Cluster;
136 /// let x = CreateInstanceRequest::new().set_clusters([
137 /// ("key0", Cluster::default()/* use setters */),
138 /// ("key1", Cluster::default()/* use (different) setters */),
139 /// ]);
140 /// ```
141 pub fn set_clusters<T, K, V>(mut self, v: T) -> Self
142 where
143 T: std::iter::IntoIterator<Item = (K, V)>,
144 K: std::convert::Into<std::string::String>,
145 V: std::convert::Into<crate::model::Cluster>,
146 {
147 use std::iter::Iterator;
148 self.clusters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
149 self
150 }
151}
152
153impl wkt::message::Message for CreateInstanceRequest {
154 fn typename() -> &'static str {
155 "type.googleapis.com/google.bigtable.admin.v2.CreateInstanceRequest"
156 }
157}
158
159/// Request message for BigtableInstanceAdmin.GetInstance.
160#[derive(Clone, Default, PartialEq)]
161#[non_exhaustive]
162pub struct GetInstanceRequest {
163 /// Required. The unique name of the requested instance. Values are of the form
164 /// `projects/{project}/instances/{instance}`.
165 pub name: std::string::String,
166
167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
168}
169
170impl GetInstanceRequest {
171 /// Creates a new default instance.
172 pub fn new() -> Self {
173 std::default::Default::default()
174 }
175
176 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
177 ///
178 /// # Example
179 /// ```ignore,no_run
180 /// # use google_cloud_bigtable_admin_v2::model::GetInstanceRequest;
181 /// # let project_id = "project_id";
182 /// # let instance_id = "instance_id";
183 /// let x = GetInstanceRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}"));
184 /// ```
185 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
186 self.name = v.into();
187 self
188 }
189}
190
191impl wkt::message::Message for GetInstanceRequest {
192 fn typename() -> &'static str {
193 "type.googleapis.com/google.bigtable.admin.v2.GetInstanceRequest"
194 }
195}
196
197/// Request message for BigtableInstanceAdmin.ListInstances.
198#[derive(Clone, Default, PartialEq)]
199#[non_exhaustive]
200pub struct ListInstancesRequest {
201 /// Required. The unique name of the project for which a list of instances is
202 /// requested. Values are of the form `projects/{project}`.
203 pub parent: std::string::String,
204
205 /// DEPRECATED: This field is unused and ignored.
206 pub page_token: std::string::String,
207
208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
209}
210
211impl ListInstancesRequest {
212 /// Creates a new default instance.
213 pub fn new() -> Self {
214 std::default::Default::default()
215 }
216
217 /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
218 ///
219 /// # Example
220 /// ```ignore,no_run
221 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesRequest;
222 /// let x = ListInstancesRequest::new().set_parent("example");
223 /// ```
224 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
225 self.parent = v.into();
226 self
227 }
228
229 /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
230 ///
231 /// # Example
232 /// ```ignore,no_run
233 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesRequest;
234 /// let x = ListInstancesRequest::new().set_page_token("example");
235 /// ```
236 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
237 self.page_token = v.into();
238 self
239 }
240}
241
242impl wkt::message::Message for ListInstancesRequest {
243 fn typename() -> &'static str {
244 "type.googleapis.com/google.bigtable.admin.v2.ListInstancesRequest"
245 }
246}
247
248/// Response message for BigtableInstanceAdmin.ListInstances.
249#[derive(Clone, Default, PartialEq)]
250#[non_exhaustive]
251pub struct ListInstancesResponse {
252 /// The list of requested instances.
253 pub instances: std::vec::Vec<crate::model::Instance>,
254
255 /// Locations from which Instance information could not be retrieved,
256 /// due to an outage or some other transient condition.
257 /// Instances whose Clusters are all in one of the failed locations
258 /// may be missing from `instances`, and Instances with at least one
259 /// Cluster in a failed location may only have partial information returned.
260 /// Values are of the form `projects/<project>/locations/<zone_id>`
261 pub failed_locations: std::vec::Vec<std::string::String>,
262
263 /// DEPRECATED: This field is unused and ignored.
264 pub next_page_token: std::string::String,
265
266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
267}
268
269impl ListInstancesResponse {
270 /// Creates a new default instance.
271 pub fn new() -> Self {
272 std::default::Default::default()
273 }
274
275 /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
276 ///
277 /// # Example
278 /// ```ignore,no_run
279 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesResponse;
280 /// use google_cloud_bigtable_admin_v2::model::Instance;
281 /// let x = ListInstancesResponse::new()
282 /// .set_instances([
283 /// Instance::default()/* use setters */,
284 /// Instance::default()/* use (different) setters */,
285 /// ]);
286 /// ```
287 pub fn set_instances<T, V>(mut self, v: T) -> Self
288 where
289 T: std::iter::IntoIterator<Item = V>,
290 V: std::convert::Into<crate::model::Instance>,
291 {
292 use std::iter::Iterator;
293 self.instances = v.into_iter().map(|i| i.into()).collect();
294 self
295 }
296
297 /// Sets the value of [failed_locations][crate::model::ListInstancesResponse::failed_locations].
298 ///
299 /// # Example
300 /// ```ignore,no_run
301 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesResponse;
302 /// let x = ListInstancesResponse::new().set_failed_locations(["a", "b", "c"]);
303 /// ```
304 pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
305 where
306 T: std::iter::IntoIterator<Item = V>,
307 V: std::convert::Into<std::string::String>,
308 {
309 use std::iter::Iterator;
310 self.failed_locations = v.into_iter().map(|i| i.into()).collect();
311 self
312 }
313
314 /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
315 ///
316 /// # Example
317 /// ```ignore,no_run
318 /// # use google_cloud_bigtable_admin_v2::model::ListInstancesResponse;
319 /// let x = ListInstancesResponse::new().set_next_page_token("example");
320 /// ```
321 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
322 self.next_page_token = v.into();
323 self
324 }
325}
326
327impl wkt::message::Message for ListInstancesResponse {
328 fn typename() -> &'static str {
329 "type.googleapis.com/google.bigtable.admin.v2.ListInstancesResponse"
330 }
331}
332
333/// Request message for BigtableInstanceAdmin.PartialUpdateInstance.
334#[derive(Clone, Default, PartialEq)]
335#[non_exhaustive]
336pub struct PartialUpdateInstanceRequest {
337 /// Required. The Instance which will (partially) replace the current value.
338 pub instance: std::option::Option<crate::model::Instance>,
339
340 /// Required. The subset of Instance fields which should be replaced.
341 /// Must be explicitly set.
342 pub update_mask: std::option::Option<wkt::FieldMask>,
343
344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
345}
346
347impl PartialUpdateInstanceRequest {
348 /// Creates a new default instance.
349 pub fn new() -> Self {
350 std::default::Default::default()
351 }
352
353 /// Sets the value of [instance][crate::model::PartialUpdateInstanceRequest::instance].
354 ///
355 /// # Example
356 /// ```ignore,no_run
357 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
358 /// use google_cloud_bigtable_admin_v2::model::Instance;
359 /// let x = PartialUpdateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
360 /// ```
361 pub fn set_instance<T>(mut self, v: T) -> Self
362 where
363 T: std::convert::Into<crate::model::Instance>,
364 {
365 self.instance = std::option::Option::Some(v.into());
366 self
367 }
368
369 /// Sets or clears the value of [instance][crate::model::PartialUpdateInstanceRequest::instance].
370 ///
371 /// # Example
372 /// ```ignore,no_run
373 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
374 /// use google_cloud_bigtable_admin_v2::model::Instance;
375 /// let x = PartialUpdateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
376 /// let x = PartialUpdateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
377 /// ```
378 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
379 where
380 T: std::convert::Into<crate::model::Instance>,
381 {
382 self.instance = v.map(|x| x.into());
383 self
384 }
385
386 /// Sets the value of [update_mask][crate::model::PartialUpdateInstanceRequest::update_mask].
387 ///
388 /// # Example
389 /// ```ignore,no_run
390 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
391 /// use wkt::FieldMask;
392 /// let x = PartialUpdateInstanceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
393 /// ```
394 pub fn set_update_mask<T>(mut self, v: T) -> Self
395 where
396 T: std::convert::Into<wkt::FieldMask>,
397 {
398 self.update_mask = std::option::Option::Some(v.into());
399 self
400 }
401
402 /// Sets or clears the value of [update_mask][crate::model::PartialUpdateInstanceRequest::update_mask].
403 ///
404 /// # Example
405 /// ```ignore,no_run
406 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
407 /// use wkt::FieldMask;
408 /// let x = PartialUpdateInstanceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
409 /// let x = PartialUpdateInstanceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
410 /// ```
411 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
412 where
413 T: std::convert::Into<wkt::FieldMask>,
414 {
415 self.update_mask = v.map(|x| x.into());
416 self
417 }
418}
419
420impl wkt::message::Message for PartialUpdateInstanceRequest {
421 fn typename() -> &'static str {
422 "type.googleapis.com/google.bigtable.admin.v2.PartialUpdateInstanceRequest"
423 }
424}
425
426/// Request message for BigtableInstanceAdmin.DeleteInstance.
427#[derive(Clone, Default, PartialEq)]
428#[non_exhaustive]
429pub struct DeleteInstanceRequest {
430 /// Required. The unique name of the instance to be deleted.
431 /// Values are of the form `projects/{project}/instances/{instance}`.
432 pub name: std::string::String,
433
434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
435}
436
437impl DeleteInstanceRequest {
438 /// Creates a new default instance.
439 pub fn new() -> Self {
440 std::default::Default::default()
441 }
442
443 /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
444 ///
445 /// # Example
446 /// ```ignore,no_run
447 /// # use google_cloud_bigtable_admin_v2::model::DeleteInstanceRequest;
448 /// # let project_id = "project_id";
449 /// # let instance_id = "instance_id";
450 /// let x = DeleteInstanceRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}"));
451 /// ```
452 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
453 self.name = v.into();
454 self
455 }
456}
457
458impl wkt::message::Message for DeleteInstanceRequest {
459 fn typename() -> &'static str {
460 "type.googleapis.com/google.bigtable.admin.v2.DeleteInstanceRequest"
461 }
462}
463
464/// Request message for BigtableInstanceAdmin.CreateCluster.
465#[derive(Clone, Default, PartialEq)]
466#[non_exhaustive]
467pub struct CreateClusterRequest {
468 /// Required. The unique name of the instance in which to create the new
469 /// cluster. Values are of the form `projects/{project}/instances/{instance}`.
470 pub parent: std::string::String,
471
472 /// Required. The ID to be used when referring to the new cluster within its
473 /// instance, e.g., just `mycluster` rather than
474 /// `projects/myproject/instances/myinstance/clusters/mycluster`.
475 pub cluster_id: std::string::String,
476
477 /// Required. The cluster to be created.
478 /// Fields marked `OutputOnly` must be left blank.
479 pub cluster: std::option::Option<crate::model::Cluster>,
480
481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
482}
483
484impl CreateClusterRequest {
485 /// Creates a new default instance.
486 pub fn new() -> Self {
487 std::default::Default::default()
488 }
489
490 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
491 ///
492 /// # Example
493 /// ```ignore,no_run
494 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
495 /// # let project_id = "project_id";
496 /// # let instance_id = "instance_id";
497 /// let x = CreateClusterRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
498 /// ```
499 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
500 self.parent = v.into();
501 self
502 }
503
504 /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
505 ///
506 /// # Example
507 /// ```ignore,no_run
508 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
509 /// let x = CreateClusterRequest::new().set_cluster_id("example");
510 /// ```
511 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
512 self.cluster_id = v.into();
513 self
514 }
515
516 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
517 ///
518 /// # Example
519 /// ```ignore,no_run
520 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
521 /// use google_cloud_bigtable_admin_v2::model::Cluster;
522 /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
523 /// ```
524 pub fn set_cluster<T>(mut self, v: T) -> Self
525 where
526 T: std::convert::Into<crate::model::Cluster>,
527 {
528 self.cluster = std::option::Option::Some(v.into());
529 self
530 }
531
532 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
533 ///
534 /// # Example
535 /// ```ignore,no_run
536 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
537 /// use google_cloud_bigtable_admin_v2::model::Cluster;
538 /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
539 /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
540 /// ```
541 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
542 where
543 T: std::convert::Into<crate::model::Cluster>,
544 {
545 self.cluster = v.map(|x| x.into());
546 self
547 }
548}
549
550impl wkt::message::Message for CreateClusterRequest {
551 fn typename() -> &'static str {
552 "type.googleapis.com/google.bigtable.admin.v2.CreateClusterRequest"
553 }
554}
555
556/// Request message for BigtableInstanceAdmin.GetCluster.
557#[derive(Clone, Default, PartialEq)]
558#[non_exhaustive]
559pub struct GetClusterRequest {
560 /// Required. The unique name of the requested cluster. Values are of the form
561 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
562 pub name: std::string::String,
563
564 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
565}
566
567impl GetClusterRequest {
568 /// Creates a new default instance.
569 pub fn new() -> Self {
570 std::default::Default::default()
571 }
572
573 /// Sets the value of [name][crate::model::GetClusterRequest::name].
574 ///
575 /// # Example
576 /// ```ignore,no_run
577 /// # use google_cloud_bigtable_admin_v2::model::GetClusterRequest;
578 /// # let project_id = "project_id";
579 /// # let instance_id = "instance_id";
580 /// # let cluster_id = "cluster_id";
581 /// let x = GetClusterRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
582 /// ```
583 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
584 self.name = v.into();
585 self
586 }
587}
588
589impl wkt::message::Message for GetClusterRequest {
590 fn typename() -> &'static str {
591 "type.googleapis.com/google.bigtable.admin.v2.GetClusterRequest"
592 }
593}
594
595/// Request message for BigtableInstanceAdmin.ListClusters.
596#[derive(Clone, Default, PartialEq)]
597#[non_exhaustive]
598pub struct ListClustersRequest {
599 /// Required. The unique name of the instance for which a list of clusters is
600 /// requested. Values are of the form
601 /// `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
602 /// Clusters for all Instances in a project, e.g.,
603 /// `projects/myproject/instances/-`.
604 pub parent: std::string::String,
605
606 /// DEPRECATED: This field is unused and ignored.
607 pub page_token: std::string::String,
608
609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
610}
611
612impl ListClustersRequest {
613 /// Creates a new default instance.
614 pub fn new() -> Self {
615 std::default::Default::default()
616 }
617
618 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
619 ///
620 /// # Example
621 /// ```ignore,no_run
622 /// # use google_cloud_bigtable_admin_v2::model::ListClustersRequest;
623 /// # let project_id = "project_id";
624 /// # let instance_id = "instance_id";
625 /// let x = ListClustersRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
626 /// ```
627 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
628 self.parent = v.into();
629 self
630 }
631
632 /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_bigtable_admin_v2::model::ListClustersRequest;
637 /// let x = ListClustersRequest::new().set_page_token("example");
638 /// ```
639 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
640 self.page_token = v.into();
641 self
642 }
643}
644
645impl wkt::message::Message for ListClustersRequest {
646 fn typename() -> &'static str {
647 "type.googleapis.com/google.bigtable.admin.v2.ListClustersRequest"
648 }
649}
650
651/// Response message for BigtableInstanceAdmin.ListClusters.
652#[derive(Clone, Default, PartialEq)]
653#[non_exhaustive]
654pub struct ListClustersResponse {
655 /// The list of requested clusters.
656 pub clusters: std::vec::Vec<crate::model::Cluster>,
657
658 /// Locations from which Cluster information could not be retrieved,
659 /// due to an outage or some other transient condition.
660 /// Clusters from these locations may be missing from `clusters`,
661 /// or may only have partial information returned.
662 /// Values are of the form `projects/<project>/locations/<zone_id>`
663 pub failed_locations: std::vec::Vec<std::string::String>,
664
665 /// DEPRECATED: This field is unused and ignored.
666 pub next_page_token: std::string::String,
667
668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
669}
670
671impl ListClustersResponse {
672 /// Creates a new default instance.
673 pub fn new() -> Self {
674 std::default::Default::default()
675 }
676
677 /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
678 ///
679 /// # Example
680 /// ```ignore,no_run
681 /// # use google_cloud_bigtable_admin_v2::model::ListClustersResponse;
682 /// use google_cloud_bigtable_admin_v2::model::Cluster;
683 /// let x = ListClustersResponse::new()
684 /// .set_clusters([
685 /// Cluster::default()/* use setters */,
686 /// Cluster::default()/* use (different) setters */,
687 /// ]);
688 /// ```
689 pub fn set_clusters<T, V>(mut self, v: T) -> Self
690 where
691 T: std::iter::IntoIterator<Item = V>,
692 V: std::convert::Into<crate::model::Cluster>,
693 {
694 use std::iter::Iterator;
695 self.clusters = v.into_iter().map(|i| i.into()).collect();
696 self
697 }
698
699 /// Sets the value of [failed_locations][crate::model::ListClustersResponse::failed_locations].
700 ///
701 /// # Example
702 /// ```ignore,no_run
703 /// # use google_cloud_bigtable_admin_v2::model::ListClustersResponse;
704 /// let x = ListClustersResponse::new().set_failed_locations(["a", "b", "c"]);
705 /// ```
706 pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
707 where
708 T: std::iter::IntoIterator<Item = V>,
709 V: std::convert::Into<std::string::String>,
710 {
711 use std::iter::Iterator;
712 self.failed_locations = v.into_iter().map(|i| i.into()).collect();
713 self
714 }
715
716 /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
717 ///
718 /// # Example
719 /// ```ignore,no_run
720 /// # use google_cloud_bigtable_admin_v2::model::ListClustersResponse;
721 /// let x = ListClustersResponse::new().set_next_page_token("example");
722 /// ```
723 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
724 self.next_page_token = v.into();
725 self
726 }
727}
728
729impl wkt::message::Message for ListClustersResponse {
730 fn typename() -> &'static str {
731 "type.googleapis.com/google.bigtable.admin.v2.ListClustersResponse"
732 }
733}
734
735/// Request message for BigtableInstanceAdmin.DeleteCluster.
736#[derive(Clone, Default, PartialEq)]
737#[non_exhaustive]
738pub struct DeleteClusterRequest {
739 /// Required. The unique name of the cluster to be deleted. Values are of the
740 /// form `projects/{project}/instances/{instance}/clusters/{cluster}`.
741 pub name: std::string::String,
742
743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
744}
745
746impl DeleteClusterRequest {
747 /// Creates a new default instance.
748 pub fn new() -> Self {
749 std::default::Default::default()
750 }
751
752 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
753 ///
754 /// # Example
755 /// ```ignore,no_run
756 /// # use google_cloud_bigtable_admin_v2::model::DeleteClusterRequest;
757 /// # let project_id = "project_id";
758 /// # let instance_id = "instance_id";
759 /// # let cluster_id = "cluster_id";
760 /// let x = DeleteClusterRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
761 /// ```
762 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
763 self.name = v.into();
764 self
765 }
766}
767
768impl wkt::message::Message for DeleteClusterRequest {
769 fn typename() -> &'static str {
770 "type.googleapis.com/google.bigtable.admin.v2.DeleteClusterRequest"
771 }
772}
773
774/// The metadata for the Operation returned by CreateInstance.
775#[derive(Clone, Default, PartialEq)]
776#[non_exhaustive]
777pub struct CreateInstanceMetadata {
778 /// The request that prompted the initiation of this CreateInstance operation.
779 pub original_request: std::option::Option<crate::model::CreateInstanceRequest>,
780
781 /// The time at which the original request was received.
782 pub request_time: std::option::Option<wkt::Timestamp>,
783
784 /// The time at which the operation failed or was completed successfully.
785 pub finish_time: std::option::Option<wkt::Timestamp>,
786
787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
788}
789
790impl CreateInstanceMetadata {
791 /// Creates a new default instance.
792 pub fn new() -> Self {
793 std::default::Default::default()
794 }
795
796 /// Sets the value of [original_request][crate::model::CreateInstanceMetadata::original_request].
797 ///
798 /// # Example
799 /// ```ignore,no_run
800 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
801 /// use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
802 /// let x = CreateInstanceMetadata::new().set_original_request(CreateInstanceRequest::default()/* use setters */);
803 /// ```
804 pub fn set_original_request<T>(mut self, v: T) -> Self
805 where
806 T: std::convert::Into<crate::model::CreateInstanceRequest>,
807 {
808 self.original_request = std::option::Option::Some(v.into());
809 self
810 }
811
812 /// Sets or clears the value of [original_request][crate::model::CreateInstanceMetadata::original_request].
813 ///
814 /// # Example
815 /// ```ignore,no_run
816 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
817 /// use google_cloud_bigtable_admin_v2::model::CreateInstanceRequest;
818 /// let x = CreateInstanceMetadata::new().set_or_clear_original_request(Some(CreateInstanceRequest::default()/* use setters */));
819 /// let x = CreateInstanceMetadata::new().set_or_clear_original_request(None::<CreateInstanceRequest>);
820 /// ```
821 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
822 where
823 T: std::convert::Into<crate::model::CreateInstanceRequest>,
824 {
825 self.original_request = v.map(|x| x.into());
826 self
827 }
828
829 /// Sets the value of [request_time][crate::model::CreateInstanceMetadata::request_time].
830 ///
831 /// # Example
832 /// ```ignore,no_run
833 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
834 /// use wkt::Timestamp;
835 /// let x = CreateInstanceMetadata::new().set_request_time(Timestamp::default()/* use setters */);
836 /// ```
837 pub fn set_request_time<T>(mut self, v: T) -> Self
838 where
839 T: std::convert::Into<wkt::Timestamp>,
840 {
841 self.request_time = std::option::Option::Some(v.into());
842 self
843 }
844
845 /// Sets or clears the value of [request_time][crate::model::CreateInstanceMetadata::request_time].
846 ///
847 /// # Example
848 /// ```ignore,no_run
849 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
850 /// use wkt::Timestamp;
851 /// let x = CreateInstanceMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
852 /// let x = CreateInstanceMetadata::new().set_or_clear_request_time(None::<Timestamp>);
853 /// ```
854 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
855 where
856 T: std::convert::Into<wkt::Timestamp>,
857 {
858 self.request_time = v.map(|x| x.into());
859 self
860 }
861
862 /// Sets the value of [finish_time][crate::model::CreateInstanceMetadata::finish_time].
863 ///
864 /// # Example
865 /// ```ignore,no_run
866 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
867 /// use wkt::Timestamp;
868 /// let x = CreateInstanceMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
869 /// ```
870 pub fn set_finish_time<T>(mut self, v: T) -> Self
871 where
872 T: std::convert::Into<wkt::Timestamp>,
873 {
874 self.finish_time = std::option::Option::Some(v.into());
875 self
876 }
877
878 /// Sets or clears the value of [finish_time][crate::model::CreateInstanceMetadata::finish_time].
879 ///
880 /// # Example
881 /// ```ignore,no_run
882 /// # use google_cloud_bigtable_admin_v2::model::CreateInstanceMetadata;
883 /// use wkt::Timestamp;
884 /// let x = CreateInstanceMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
885 /// let x = CreateInstanceMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
886 /// ```
887 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
888 where
889 T: std::convert::Into<wkt::Timestamp>,
890 {
891 self.finish_time = v.map(|x| x.into());
892 self
893 }
894}
895
896impl wkt::message::Message for CreateInstanceMetadata {
897 fn typename() -> &'static str {
898 "type.googleapis.com/google.bigtable.admin.v2.CreateInstanceMetadata"
899 }
900}
901
902/// The metadata for the Operation returned by UpdateInstance.
903#[derive(Clone, Default, PartialEq)]
904#[non_exhaustive]
905pub struct UpdateInstanceMetadata {
906 /// The request that prompted the initiation of this UpdateInstance operation.
907 pub original_request: std::option::Option<crate::model::PartialUpdateInstanceRequest>,
908
909 /// The time at which the original request was received.
910 pub request_time: std::option::Option<wkt::Timestamp>,
911
912 /// The time at which the operation failed or was completed successfully.
913 pub finish_time: std::option::Option<wkt::Timestamp>,
914
915 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
916}
917
918impl UpdateInstanceMetadata {
919 /// Creates a new default instance.
920 pub fn new() -> Self {
921 std::default::Default::default()
922 }
923
924 /// Sets the value of [original_request][crate::model::UpdateInstanceMetadata::original_request].
925 ///
926 /// # Example
927 /// ```ignore,no_run
928 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
929 /// use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
930 /// let x = UpdateInstanceMetadata::new().set_original_request(PartialUpdateInstanceRequest::default()/* use setters */);
931 /// ```
932 pub fn set_original_request<T>(mut self, v: T) -> Self
933 where
934 T: std::convert::Into<crate::model::PartialUpdateInstanceRequest>,
935 {
936 self.original_request = std::option::Option::Some(v.into());
937 self
938 }
939
940 /// Sets or clears the value of [original_request][crate::model::UpdateInstanceMetadata::original_request].
941 ///
942 /// # Example
943 /// ```ignore,no_run
944 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
945 /// use google_cloud_bigtable_admin_v2::model::PartialUpdateInstanceRequest;
946 /// let x = UpdateInstanceMetadata::new().set_or_clear_original_request(Some(PartialUpdateInstanceRequest::default()/* use setters */));
947 /// let x = UpdateInstanceMetadata::new().set_or_clear_original_request(None::<PartialUpdateInstanceRequest>);
948 /// ```
949 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
950 where
951 T: std::convert::Into<crate::model::PartialUpdateInstanceRequest>,
952 {
953 self.original_request = v.map(|x| x.into());
954 self
955 }
956
957 /// Sets the value of [request_time][crate::model::UpdateInstanceMetadata::request_time].
958 ///
959 /// # Example
960 /// ```ignore,no_run
961 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
962 /// use wkt::Timestamp;
963 /// let x = UpdateInstanceMetadata::new().set_request_time(Timestamp::default()/* use setters */);
964 /// ```
965 pub fn set_request_time<T>(mut self, v: T) -> Self
966 where
967 T: std::convert::Into<wkt::Timestamp>,
968 {
969 self.request_time = std::option::Option::Some(v.into());
970 self
971 }
972
973 /// Sets or clears the value of [request_time][crate::model::UpdateInstanceMetadata::request_time].
974 ///
975 /// # Example
976 /// ```ignore,no_run
977 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
978 /// use wkt::Timestamp;
979 /// let x = UpdateInstanceMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
980 /// let x = UpdateInstanceMetadata::new().set_or_clear_request_time(None::<Timestamp>);
981 /// ```
982 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
983 where
984 T: std::convert::Into<wkt::Timestamp>,
985 {
986 self.request_time = v.map(|x| x.into());
987 self
988 }
989
990 /// Sets the value of [finish_time][crate::model::UpdateInstanceMetadata::finish_time].
991 ///
992 /// # Example
993 /// ```ignore,no_run
994 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
995 /// use wkt::Timestamp;
996 /// let x = UpdateInstanceMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
997 /// ```
998 pub fn set_finish_time<T>(mut self, v: T) -> Self
999 where
1000 T: std::convert::Into<wkt::Timestamp>,
1001 {
1002 self.finish_time = std::option::Option::Some(v.into());
1003 self
1004 }
1005
1006 /// Sets or clears the value of [finish_time][crate::model::UpdateInstanceMetadata::finish_time].
1007 ///
1008 /// # Example
1009 /// ```ignore,no_run
1010 /// # use google_cloud_bigtable_admin_v2::model::UpdateInstanceMetadata;
1011 /// use wkt::Timestamp;
1012 /// let x = UpdateInstanceMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1013 /// let x = UpdateInstanceMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
1014 /// ```
1015 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1016 where
1017 T: std::convert::Into<wkt::Timestamp>,
1018 {
1019 self.finish_time = v.map(|x| x.into());
1020 self
1021 }
1022}
1023
1024impl wkt::message::Message for UpdateInstanceMetadata {
1025 fn typename() -> &'static str {
1026 "type.googleapis.com/google.bigtable.admin.v2.UpdateInstanceMetadata"
1027 }
1028}
1029
1030/// The metadata for the Operation returned by CreateCluster.
1031#[derive(Clone, Default, PartialEq)]
1032#[non_exhaustive]
1033pub struct CreateClusterMetadata {
1034 /// The request that prompted the initiation of this CreateCluster operation.
1035 pub original_request: std::option::Option<crate::model::CreateClusterRequest>,
1036
1037 /// The time at which the original request was received.
1038 pub request_time: std::option::Option<wkt::Timestamp>,
1039
1040 /// The time at which the operation failed or was completed successfully.
1041 pub finish_time: std::option::Option<wkt::Timestamp>,
1042
1043 /// Keys: the full `name` of each table that existed in the instance when
1044 /// CreateCluster was first called, i.e.
1045 /// `projects/<project>/instances/<instance>/tables/<table>`. Any table added
1046 /// to the instance by a later API call will be created in the new cluster by
1047 /// that API call, not this one.
1048 ///
1049 /// Values: information on how much of a table's data has been copied to the
1050 /// newly-created cluster so far.
1051 pub tables: std::collections::HashMap<
1052 std::string::String,
1053 crate::model::create_cluster_metadata::TableProgress,
1054 >,
1055
1056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1057}
1058
1059impl CreateClusterMetadata {
1060 /// Creates a new default instance.
1061 pub fn new() -> Self {
1062 std::default::Default::default()
1063 }
1064
1065 /// Sets the value of [original_request][crate::model::CreateClusterMetadata::original_request].
1066 ///
1067 /// # Example
1068 /// ```ignore,no_run
1069 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1070 /// use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
1071 /// let x = CreateClusterMetadata::new().set_original_request(CreateClusterRequest::default()/* use setters */);
1072 /// ```
1073 pub fn set_original_request<T>(mut self, v: T) -> Self
1074 where
1075 T: std::convert::Into<crate::model::CreateClusterRequest>,
1076 {
1077 self.original_request = std::option::Option::Some(v.into());
1078 self
1079 }
1080
1081 /// Sets or clears the value of [original_request][crate::model::CreateClusterMetadata::original_request].
1082 ///
1083 /// # Example
1084 /// ```ignore,no_run
1085 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1086 /// use google_cloud_bigtable_admin_v2::model::CreateClusterRequest;
1087 /// let x = CreateClusterMetadata::new().set_or_clear_original_request(Some(CreateClusterRequest::default()/* use setters */));
1088 /// let x = CreateClusterMetadata::new().set_or_clear_original_request(None::<CreateClusterRequest>);
1089 /// ```
1090 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
1091 where
1092 T: std::convert::Into<crate::model::CreateClusterRequest>,
1093 {
1094 self.original_request = v.map(|x| x.into());
1095 self
1096 }
1097
1098 /// Sets the value of [request_time][crate::model::CreateClusterMetadata::request_time].
1099 ///
1100 /// # Example
1101 /// ```ignore,no_run
1102 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1103 /// use wkt::Timestamp;
1104 /// let x = CreateClusterMetadata::new().set_request_time(Timestamp::default()/* use setters */);
1105 /// ```
1106 pub fn set_request_time<T>(mut self, v: T) -> Self
1107 where
1108 T: std::convert::Into<wkt::Timestamp>,
1109 {
1110 self.request_time = std::option::Option::Some(v.into());
1111 self
1112 }
1113
1114 /// Sets or clears the value of [request_time][crate::model::CreateClusterMetadata::request_time].
1115 ///
1116 /// # Example
1117 /// ```ignore,no_run
1118 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1119 /// use wkt::Timestamp;
1120 /// let x = CreateClusterMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
1121 /// let x = CreateClusterMetadata::new().set_or_clear_request_time(None::<Timestamp>);
1122 /// ```
1123 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
1124 where
1125 T: std::convert::Into<wkt::Timestamp>,
1126 {
1127 self.request_time = v.map(|x| x.into());
1128 self
1129 }
1130
1131 /// Sets the value of [finish_time][crate::model::CreateClusterMetadata::finish_time].
1132 ///
1133 /// # Example
1134 /// ```ignore,no_run
1135 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1136 /// use wkt::Timestamp;
1137 /// let x = CreateClusterMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
1138 /// ```
1139 pub fn set_finish_time<T>(mut self, v: T) -> Self
1140 where
1141 T: std::convert::Into<wkt::Timestamp>,
1142 {
1143 self.finish_time = std::option::Option::Some(v.into());
1144 self
1145 }
1146
1147 /// Sets or clears the value of [finish_time][crate::model::CreateClusterMetadata::finish_time].
1148 ///
1149 /// # Example
1150 /// ```ignore,no_run
1151 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1152 /// use wkt::Timestamp;
1153 /// let x = CreateClusterMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1154 /// let x = CreateClusterMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
1155 /// ```
1156 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1157 where
1158 T: std::convert::Into<wkt::Timestamp>,
1159 {
1160 self.finish_time = v.map(|x| x.into());
1161 self
1162 }
1163
1164 /// Sets the value of [tables][crate::model::CreateClusterMetadata::tables].
1165 ///
1166 /// # Example
1167 /// ```ignore,no_run
1168 /// # use google_cloud_bigtable_admin_v2::model::CreateClusterMetadata;
1169 /// use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::TableProgress;
1170 /// let x = CreateClusterMetadata::new().set_tables([
1171 /// ("key0", TableProgress::default()/* use setters */),
1172 /// ("key1", TableProgress::default()/* use (different) setters */),
1173 /// ]);
1174 /// ```
1175 pub fn set_tables<T, K, V>(mut self, v: T) -> Self
1176 where
1177 T: std::iter::IntoIterator<Item = (K, V)>,
1178 K: std::convert::Into<std::string::String>,
1179 V: std::convert::Into<crate::model::create_cluster_metadata::TableProgress>,
1180 {
1181 use std::iter::Iterator;
1182 self.tables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1183 self
1184 }
1185}
1186
1187impl wkt::message::Message for CreateClusterMetadata {
1188 fn typename() -> &'static str {
1189 "type.googleapis.com/google.bigtable.admin.v2.CreateClusterMetadata"
1190 }
1191}
1192
1193/// Defines additional types related to [CreateClusterMetadata].
1194pub mod create_cluster_metadata {
1195 #[allow(unused_imports)]
1196 use super::*;
1197
1198 /// Progress info for copying a table's data to the new cluster.
1199 #[derive(Clone, Default, PartialEq)]
1200 #[non_exhaustive]
1201 pub struct TableProgress {
1202 /// Estimate of the size of the table to be copied.
1203 pub estimated_size_bytes: i64,
1204
1205 /// Estimate of the number of bytes copied so far for this table.
1206 /// This will eventually reach 'estimated_size_bytes' unless the table copy
1207 /// is CANCELLED.
1208 pub estimated_copied_bytes: i64,
1209
1210 #[allow(missing_docs)]
1211 pub state: crate::model::create_cluster_metadata::table_progress::State,
1212
1213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1214 }
1215
1216 impl TableProgress {
1217 /// Creates a new default instance.
1218 pub fn new() -> Self {
1219 std::default::Default::default()
1220 }
1221
1222 /// Sets the value of [estimated_size_bytes][crate::model::create_cluster_metadata::TableProgress::estimated_size_bytes].
1223 ///
1224 /// # Example
1225 /// ```ignore,no_run
1226 /// # use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::TableProgress;
1227 /// let x = TableProgress::new().set_estimated_size_bytes(42);
1228 /// ```
1229 pub fn set_estimated_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1230 self.estimated_size_bytes = v.into();
1231 self
1232 }
1233
1234 /// Sets the value of [estimated_copied_bytes][crate::model::create_cluster_metadata::TableProgress::estimated_copied_bytes].
1235 ///
1236 /// # Example
1237 /// ```ignore,no_run
1238 /// # use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::TableProgress;
1239 /// let x = TableProgress::new().set_estimated_copied_bytes(42);
1240 /// ```
1241 pub fn set_estimated_copied_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1242 self.estimated_copied_bytes = v.into();
1243 self
1244 }
1245
1246 /// Sets the value of [state][crate::model::create_cluster_metadata::TableProgress::state].
1247 ///
1248 /// # Example
1249 /// ```ignore,no_run
1250 /// # use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::TableProgress;
1251 /// use google_cloud_bigtable_admin_v2::model::create_cluster_metadata::table_progress::State;
1252 /// let x0 = TableProgress::new().set_state(State::Pending);
1253 /// let x1 = TableProgress::new().set_state(State::Copying);
1254 /// let x2 = TableProgress::new().set_state(State::Completed);
1255 /// ```
1256 pub fn set_state<
1257 T: std::convert::Into<crate::model::create_cluster_metadata::table_progress::State>,
1258 >(
1259 mut self,
1260 v: T,
1261 ) -> Self {
1262 self.state = v.into();
1263 self
1264 }
1265 }
1266
1267 impl wkt::message::Message for TableProgress {
1268 fn typename() -> &'static str {
1269 "type.googleapis.com/google.bigtable.admin.v2.CreateClusterMetadata.TableProgress"
1270 }
1271 }
1272
1273 /// Defines additional types related to [TableProgress].
1274 pub mod table_progress {
1275 #[allow(unused_imports)]
1276 use super::*;
1277
1278 /// Enum for [State].
1279 ///
1280 /// # Working with unknown values
1281 ///
1282 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1283 /// additional enum variants at any time. Adding new variants is not considered
1284 /// a breaking change. Applications should write their code in anticipation of:
1285 ///
1286 /// - New values appearing in future releases of the client library, **and**
1287 /// - New values received dynamically, without application changes.
1288 ///
1289 /// Please consult the [Working with enums] section in the user guide for some
1290 /// guidelines.
1291 ///
1292 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1293 #[derive(Clone, Debug, PartialEq)]
1294 #[non_exhaustive]
1295 pub enum State {
1296 #[allow(missing_docs)]
1297 Unspecified,
1298 /// The table has not yet begun copying to the new cluster.
1299 Pending,
1300 /// The table is actively being copied to the new cluster.
1301 Copying,
1302 /// The table has been fully copied to the new cluster.
1303 Completed,
1304 /// The table was deleted before it finished copying to the new cluster.
1305 /// Note that tables deleted after completion will stay marked as
1306 /// COMPLETED, not CANCELLED.
1307 Cancelled,
1308 /// If set, the enum was initialized with an unknown value.
1309 ///
1310 /// Applications can examine the value using [State::value] or
1311 /// [State::name].
1312 UnknownValue(state::UnknownValue),
1313 }
1314
1315 #[doc(hidden)]
1316 pub mod state {
1317 #[allow(unused_imports)]
1318 use super::*;
1319 #[derive(Clone, Debug, PartialEq)]
1320 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1321 }
1322
1323 impl State {
1324 /// Gets the enum value.
1325 ///
1326 /// Returns `None` if the enum contains an unknown value deserialized from
1327 /// the string representation of enums.
1328 pub fn value(&self) -> std::option::Option<i32> {
1329 match self {
1330 Self::Unspecified => std::option::Option::Some(0),
1331 Self::Pending => std::option::Option::Some(1),
1332 Self::Copying => std::option::Option::Some(2),
1333 Self::Completed => std::option::Option::Some(3),
1334 Self::Cancelled => std::option::Option::Some(4),
1335 Self::UnknownValue(u) => u.0.value(),
1336 }
1337 }
1338
1339 /// Gets the enum value as a string.
1340 ///
1341 /// Returns `None` if the enum contains an unknown value deserialized from
1342 /// the integer representation of enums.
1343 pub fn name(&self) -> std::option::Option<&str> {
1344 match self {
1345 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1346 Self::Pending => std::option::Option::Some("PENDING"),
1347 Self::Copying => std::option::Option::Some("COPYING"),
1348 Self::Completed => std::option::Option::Some("COMPLETED"),
1349 Self::Cancelled => std::option::Option::Some("CANCELLED"),
1350 Self::UnknownValue(u) => u.0.name(),
1351 }
1352 }
1353 }
1354
1355 impl std::default::Default for State {
1356 fn default() -> Self {
1357 use std::convert::From;
1358 Self::from(0)
1359 }
1360 }
1361
1362 impl std::fmt::Display for State {
1363 fn fmt(
1364 &self,
1365 f: &mut std::fmt::Formatter<'_>,
1366 ) -> std::result::Result<(), std::fmt::Error> {
1367 wkt::internal::display_enum(f, self.name(), self.value())
1368 }
1369 }
1370
1371 impl std::convert::From<i32> for State {
1372 fn from(value: i32) -> Self {
1373 match value {
1374 0 => Self::Unspecified,
1375 1 => Self::Pending,
1376 2 => Self::Copying,
1377 3 => Self::Completed,
1378 4 => Self::Cancelled,
1379 _ => Self::UnknownValue(state::UnknownValue(
1380 wkt::internal::UnknownEnumValue::Integer(value),
1381 )),
1382 }
1383 }
1384 }
1385
1386 impl std::convert::From<&str> for State {
1387 fn from(value: &str) -> Self {
1388 use std::string::ToString;
1389 match value {
1390 "STATE_UNSPECIFIED" => Self::Unspecified,
1391 "PENDING" => Self::Pending,
1392 "COPYING" => Self::Copying,
1393 "COMPLETED" => Self::Completed,
1394 "CANCELLED" => Self::Cancelled,
1395 _ => Self::UnknownValue(state::UnknownValue(
1396 wkt::internal::UnknownEnumValue::String(value.to_string()),
1397 )),
1398 }
1399 }
1400 }
1401
1402 impl serde::ser::Serialize for State {
1403 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1404 where
1405 S: serde::Serializer,
1406 {
1407 match self {
1408 Self::Unspecified => serializer.serialize_i32(0),
1409 Self::Pending => serializer.serialize_i32(1),
1410 Self::Copying => serializer.serialize_i32(2),
1411 Self::Completed => serializer.serialize_i32(3),
1412 Self::Cancelled => serializer.serialize_i32(4),
1413 Self::UnknownValue(u) => u.0.serialize(serializer),
1414 }
1415 }
1416 }
1417
1418 impl<'de> serde::de::Deserialize<'de> for State {
1419 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1420 where
1421 D: serde::Deserializer<'de>,
1422 {
1423 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1424 ".google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State",
1425 ))
1426 }
1427 }
1428 }
1429}
1430
1431/// The metadata for the Operation returned by UpdateCluster.
1432#[derive(Clone, Default, PartialEq)]
1433#[non_exhaustive]
1434pub struct UpdateClusterMetadata {
1435 /// The request that prompted the initiation of this UpdateCluster operation.
1436 pub original_request: std::option::Option<crate::model::Cluster>,
1437
1438 /// The time at which the original request was received.
1439 pub request_time: std::option::Option<wkt::Timestamp>,
1440
1441 /// The time at which the operation failed or was completed successfully.
1442 pub finish_time: std::option::Option<wkt::Timestamp>,
1443
1444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1445}
1446
1447impl UpdateClusterMetadata {
1448 /// Creates a new default instance.
1449 pub fn new() -> Self {
1450 std::default::Default::default()
1451 }
1452
1453 /// Sets the value of [original_request][crate::model::UpdateClusterMetadata::original_request].
1454 ///
1455 /// # Example
1456 /// ```ignore,no_run
1457 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1458 /// use google_cloud_bigtable_admin_v2::model::Cluster;
1459 /// let x = UpdateClusterMetadata::new().set_original_request(Cluster::default()/* use setters */);
1460 /// ```
1461 pub fn set_original_request<T>(mut self, v: T) -> Self
1462 where
1463 T: std::convert::Into<crate::model::Cluster>,
1464 {
1465 self.original_request = std::option::Option::Some(v.into());
1466 self
1467 }
1468
1469 /// Sets or clears the value of [original_request][crate::model::UpdateClusterMetadata::original_request].
1470 ///
1471 /// # Example
1472 /// ```ignore,no_run
1473 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1474 /// use google_cloud_bigtable_admin_v2::model::Cluster;
1475 /// let x = UpdateClusterMetadata::new().set_or_clear_original_request(Some(Cluster::default()/* use setters */));
1476 /// let x = UpdateClusterMetadata::new().set_or_clear_original_request(None::<Cluster>);
1477 /// ```
1478 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
1479 where
1480 T: std::convert::Into<crate::model::Cluster>,
1481 {
1482 self.original_request = v.map(|x| x.into());
1483 self
1484 }
1485
1486 /// Sets the value of [request_time][crate::model::UpdateClusterMetadata::request_time].
1487 ///
1488 /// # Example
1489 /// ```ignore,no_run
1490 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1491 /// use wkt::Timestamp;
1492 /// let x = UpdateClusterMetadata::new().set_request_time(Timestamp::default()/* use setters */);
1493 /// ```
1494 pub fn set_request_time<T>(mut self, v: T) -> Self
1495 where
1496 T: std::convert::Into<wkt::Timestamp>,
1497 {
1498 self.request_time = std::option::Option::Some(v.into());
1499 self
1500 }
1501
1502 /// Sets or clears the value of [request_time][crate::model::UpdateClusterMetadata::request_time].
1503 ///
1504 /// # Example
1505 /// ```ignore,no_run
1506 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1507 /// use wkt::Timestamp;
1508 /// let x = UpdateClusterMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
1509 /// let x = UpdateClusterMetadata::new().set_or_clear_request_time(None::<Timestamp>);
1510 /// ```
1511 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
1512 where
1513 T: std::convert::Into<wkt::Timestamp>,
1514 {
1515 self.request_time = v.map(|x| x.into());
1516 self
1517 }
1518
1519 /// Sets the value of [finish_time][crate::model::UpdateClusterMetadata::finish_time].
1520 ///
1521 /// # Example
1522 /// ```ignore,no_run
1523 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1524 /// use wkt::Timestamp;
1525 /// let x = UpdateClusterMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
1526 /// ```
1527 pub fn set_finish_time<T>(mut self, v: T) -> Self
1528 where
1529 T: std::convert::Into<wkt::Timestamp>,
1530 {
1531 self.finish_time = std::option::Option::Some(v.into());
1532 self
1533 }
1534
1535 /// Sets or clears the value of [finish_time][crate::model::UpdateClusterMetadata::finish_time].
1536 ///
1537 /// # Example
1538 /// ```ignore,no_run
1539 /// # use google_cloud_bigtable_admin_v2::model::UpdateClusterMetadata;
1540 /// use wkt::Timestamp;
1541 /// let x = UpdateClusterMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1542 /// let x = UpdateClusterMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
1543 /// ```
1544 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1545 where
1546 T: std::convert::Into<wkt::Timestamp>,
1547 {
1548 self.finish_time = v.map(|x| x.into());
1549 self
1550 }
1551}
1552
1553impl wkt::message::Message for UpdateClusterMetadata {
1554 fn typename() -> &'static str {
1555 "type.googleapis.com/google.bigtable.admin.v2.UpdateClusterMetadata"
1556 }
1557}
1558
1559/// The metadata for the Operation returned by PartialUpdateCluster.
1560#[derive(Clone, Default, PartialEq)]
1561#[non_exhaustive]
1562pub struct PartialUpdateClusterMetadata {
1563 /// The time at which the original request was received.
1564 pub request_time: std::option::Option<wkt::Timestamp>,
1565
1566 /// The time at which the operation failed or was completed successfully.
1567 pub finish_time: std::option::Option<wkt::Timestamp>,
1568
1569 /// The original request for PartialUpdateCluster.
1570 pub original_request: std::option::Option<crate::model::PartialUpdateClusterRequest>,
1571
1572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1573}
1574
1575impl PartialUpdateClusterMetadata {
1576 /// Creates a new default instance.
1577 pub fn new() -> Self {
1578 std::default::Default::default()
1579 }
1580
1581 /// Sets the value of [request_time][crate::model::PartialUpdateClusterMetadata::request_time].
1582 ///
1583 /// # Example
1584 /// ```ignore,no_run
1585 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1586 /// use wkt::Timestamp;
1587 /// let x = PartialUpdateClusterMetadata::new().set_request_time(Timestamp::default()/* use setters */);
1588 /// ```
1589 pub fn set_request_time<T>(mut self, v: T) -> Self
1590 where
1591 T: std::convert::Into<wkt::Timestamp>,
1592 {
1593 self.request_time = std::option::Option::Some(v.into());
1594 self
1595 }
1596
1597 /// Sets or clears the value of [request_time][crate::model::PartialUpdateClusterMetadata::request_time].
1598 ///
1599 /// # Example
1600 /// ```ignore,no_run
1601 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1602 /// use wkt::Timestamp;
1603 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
1604 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_request_time(None::<Timestamp>);
1605 /// ```
1606 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
1607 where
1608 T: std::convert::Into<wkt::Timestamp>,
1609 {
1610 self.request_time = v.map(|x| x.into());
1611 self
1612 }
1613
1614 /// Sets the value of [finish_time][crate::model::PartialUpdateClusterMetadata::finish_time].
1615 ///
1616 /// # Example
1617 /// ```ignore,no_run
1618 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1619 /// use wkt::Timestamp;
1620 /// let x = PartialUpdateClusterMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
1621 /// ```
1622 pub fn set_finish_time<T>(mut self, v: T) -> Self
1623 where
1624 T: std::convert::Into<wkt::Timestamp>,
1625 {
1626 self.finish_time = std::option::Option::Some(v.into());
1627 self
1628 }
1629
1630 /// Sets or clears the value of [finish_time][crate::model::PartialUpdateClusterMetadata::finish_time].
1631 ///
1632 /// # Example
1633 /// ```ignore,no_run
1634 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1635 /// use wkt::Timestamp;
1636 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1637 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
1638 /// ```
1639 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1640 where
1641 T: std::convert::Into<wkt::Timestamp>,
1642 {
1643 self.finish_time = v.map(|x| x.into());
1644 self
1645 }
1646
1647 /// Sets the value of [original_request][crate::model::PartialUpdateClusterMetadata::original_request].
1648 ///
1649 /// # Example
1650 /// ```ignore,no_run
1651 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1652 /// use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1653 /// let x = PartialUpdateClusterMetadata::new().set_original_request(PartialUpdateClusterRequest::default()/* use setters */);
1654 /// ```
1655 pub fn set_original_request<T>(mut self, v: T) -> Self
1656 where
1657 T: std::convert::Into<crate::model::PartialUpdateClusterRequest>,
1658 {
1659 self.original_request = std::option::Option::Some(v.into());
1660 self
1661 }
1662
1663 /// Sets or clears the value of [original_request][crate::model::PartialUpdateClusterMetadata::original_request].
1664 ///
1665 /// # Example
1666 /// ```ignore,no_run
1667 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterMetadata;
1668 /// use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1669 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_original_request(Some(PartialUpdateClusterRequest::default()/* use setters */));
1670 /// let x = PartialUpdateClusterMetadata::new().set_or_clear_original_request(None::<PartialUpdateClusterRequest>);
1671 /// ```
1672 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
1673 where
1674 T: std::convert::Into<crate::model::PartialUpdateClusterRequest>,
1675 {
1676 self.original_request = v.map(|x| x.into());
1677 self
1678 }
1679}
1680
1681impl wkt::message::Message for PartialUpdateClusterMetadata {
1682 fn typename() -> &'static str {
1683 "type.googleapis.com/google.bigtable.admin.v2.PartialUpdateClusterMetadata"
1684 }
1685}
1686
1687/// Request message for BigtableInstanceAdmin.PartialUpdateCluster.
1688#[derive(Clone, Default, PartialEq)]
1689#[non_exhaustive]
1690pub struct PartialUpdateClusterRequest {
1691 /// Required. The Cluster which contains the partial updates to be applied,
1692 /// subject to the update_mask.
1693 pub cluster: std::option::Option<crate::model::Cluster>,
1694
1695 /// Required. The subset of Cluster fields which should be replaced.
1696 pub update_mask: std::option::Option<wkt::FieldMask>,
1697
1698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1699}
1700
1701impl PartialUpdateClusterRequest {
1702 /// Creates a new default instance.
1703 pub fn new() -> Self {
1704 std::default::Default::default()
1705 }
1706
1707 /// Sets the value of [cluster][crate::model::PartialUpdateClusterRequest::cluster].
1708 ///
1709 /// # Example
1710 /// ```ignore,no_run
1711 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1712 /// use google_cloud_bigtable_admin_v2::model::Cluster;
1713 /// let x = PartialUpdateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1714 /// ```
1715 pub fn set_cluster<T>(mut self, v: T) -> Self
1716 where
1717 T: std::convert::Into<crate::model::Cluster>,
1718 {
1719 self.cluster = std::option::Option::Some(v.into());
1720 self
1721 }
1722
1723 /// Sets or clears the value of [cluster][crate::model::PartialUpdateClusterRequest::cluster].
1724 ///
1725 /// # Example
1726 /// ```ignore,no_run
1727 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1728 /// use google_cloud_bigtable_admin_v2::model::Cluster;
1729 /// let x = PartialUpdateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1730 /// let x = PartialUpdateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1731 /// ```
1732 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1733 where
1734 T: std::convert::Into<crate::model::Cluster>,
1735 {
1736 self.cluster = v.map(|x| x.into());
1737 self
1738 }
1739
1740 /// Sets the value of [update_mask][crate::model::PartialUpdateClusterRequest::update_mask].
1741 ///
1742 /// # Example
1743 /// ```ignore,no_run
1744 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1745 /// use wkt::FieldMask;
1746 /// let x = PartialUpdateClusterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1747 /// ```
1748 pub fn set_update_mask<T>(mut self, v: T) -> Self
1749 where
1750 T: std::convert::Into<wkt::FieldMask>,
1751 {
1752 self.update_mask = std::option::Option::Some(v.into());
1753 self
1754 }
1755
1756 /// Sets or clears the value of [update_mask][crate::model::PartialUpdateClusterRequest::update_mask].
1757 ///
1758 /// # Example
1759 /// ```ignore,no_run
1760 /// # use google_cloud_bigtable_admin_v2::model::PartialUpdateClusterRequest;
1761 /// use wkt::FieldMask;
1762 /// let x = PartialUpdateClusterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1763 /// let x = PartialUpdateClusterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1764 /// ```
1765 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1766 where
1767 T: std::convert::Into<wkt::FieldMask>,
1768 {
1769 self.update_mask = v.map(|x| x.into());
1770 self
1771 }
1772}
1773
1774impl wkt::message::Message for PartialUpdateClusterRequest {
1775 fn typename() -> &'static str {
1776 "type.googleapis.com/google.bigtable.admin.v2.PartialUpdateClusterRequest"
1777 }
1778}
1779
1780/// Request message for BigtableInstanceAdmin.UpdateMemoryLayer.
1781#[derive(Clone, Default, PartialEq)]
1782#[non_exhaustive]
1783pub struct UpdateMemoryLayerRequest {
1784 /// Required. The memory layer to update.
1785 ///
1786 /// The memory layer's `name` format is as follows:
1787 /// `projects/{project}/instances/{instance}/clusters/{cluster}/memoryLayer`.
1788 pub memory_layer: std::option::Option<crate::model::MemoryLayer>,
1789
1790 /// Optional. The list of fields to update.
1791 pub update_mask: std::option::Option<wkt::FieldMask>,
1792
1793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1794}
1795
1796impl UpdateMemoryLayerRequest {
1797 /// Creates a new default instance.
1798 pub fn new() -> Self {
1799 std::default::Default::default()
1800 }
1801
1802 /// Sets the value of [memory_layer][crate::model::UpdateMemoryLayerRequest::memory_layer].
1803 ///
1804 /// # Example
1805 /// ```ignore,no_run
1806 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerRequest;
1807 /// use google_cloud_bigtable_admin_v2::model::MemoryLayer;
1808 /// let x = UpdateMemoryLayerRequest::new().set_memory_layer(MemoryLayer::default()/* use setters */);
1809 /// ```
1810 pub fn set_memory_layer<T>(mut self, v: T) -> Self
1811 where
1812 T: std::convert::Into<crate::model::MemoryLayer>,
1813 {
1814 self.memory_layer = std::option::Option::Some(v.into());
1815 self
1816 }
1817
1818 /// Sets or clears the value of [memory_layer][crate::model::UpdateMemoryLayerRequest::memory_layer].
1819 ///
1820 /// # Example
1821 /// ```ignore,no_run
1822 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerRequest;
1823 /// use google_cloud_bigtable_admin_v2::model::MemoryLayer;
1824 /// let x = UpdateMemoryLayerRequest::new().set_or_clear_memory_layer(Some(MemoryLayer::default()/* use setters */));
1825 /// let x = UpdateMemoryLayerRequest::new().set_or_clear_memory_layer(None::<MemoryLayer>);
1826 /// ```
1827 pub fn set_or_clear_memory_layer<T>(mut self, v: std::option::Option<T>) -> Self
1828 where
1829 T: std::convert::Into<crate::model::MemoryLayer>,
1830 {
1831 self.memory_layer = v.map(|x| x.into());
1832 self
1833 }
1834
1835 /// Sets the value of [update_mask][crate::model::UpdateMemoryLayerRequest::update_mask].
1836 ///
1837 /// # Example
1838 /// ```ignore,no_run
1839 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerRequest;
1840 /// use wkt::FieldMask;
1841 /// let x = UpdateMemoryLayerRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1842 /// ```
1843 pub fn set_update_mask<T>(mut self, v: T) -> Self
1844 where
1845 T: std::convert::Into<wkt::FieldMask>,
1846 {
1847 self.update_mask = std::option::Option::Some(v.into());
1848 self
1849 }
1850
1851 /// Sets or clears the value of [update_mask][crate::model::UpdateMemoryLayerRequest::update_mask].
1852 ///
1853 /// # Example
1854 /// ```ignore,no_run
1855 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerRequest;
1856 /// use wkt::FieldMask;
1857 /// let x = UpdateMemoryLayerRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1858 /// let x = UpdateMemoryLayerRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1859 /// ```
1860 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1861 where
1862 T: std::convert::Into<wkt::FieldMask>,
1863 {
1864 self.update_mask = v.map(|x| x.into());
1865 self
1866 }
1867}
1868
1869impl wkt::message::Message for UpdateMemoryLayerRequest {
1870 fn typename() -> &'static str {
1871 "type.googleapis.com/google.bigtable.admin.v2.UpdateMemoryLayerRequest"
1872 }
1873}
1874
1875/// The metadata for the Operation returned by UpdateMemoryLayer.
1876#[derive(Clone, Default, PartialEq)]
1877#[non_exhaustive]
1878pub struct UpdateMemoryLayerMetadata {
1879 /// The request that prompted the initiation of this UpdateMemoryLayer
1880 /// operation.
1881 pub original_request: std::option::Option<crate::model::UpdateMemoryLayerRequest>,
1882
1883 /// The time at which the original request was received.
1884 pub request_time: std::option::Option<wkt::Timestamp>,
1885
1886 /// The time at which the operation failed or was completed successfully.
1887 pub finish_time: std::option::Option<wkt::Timestamp>,
1888
1889 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1890}
1891
1892impl UpdateMemoryLayerMetadata {
1893 /// Creates a new default instance.
1894 pub fn new() -> Self {
1895 std::default::Default::default()
1896 }
1897
1898 /// Sets the value of [original_request][crate::model::UpdateMemoryLayerMetadata::original_request].
1899 ///
1900 /// # Example
1901 /// ```ignore,no_run
1902 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerMetadata;
1903 /// use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerRequest;
1904 /// let x = UpdateMemoryLayerMetadata::new().set_original_request(UpdateMemoryLayerRequest::default()/* use setters */);
1905 /// ```
1906 pub fn set_original_request<T>(mut self, v: T) -> Self
1907 where
1908 T: std::convert::Into<crate::model::UpdateMemoryLayerRequest>,
1909 {
1910 self.original_request = std::option::Option::Some(v.into());
1911 self
1912 }
1913
1914 /// Sets or clears the value of [original_request][crate::model::UpdateMemoryLayerMetadata::original_request].
1915 ///
1916 /// # Example
1917 /// ```ignore,no_run
1918 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerMetadata;
1919 /// use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerRequest;
1920 /// let x = UpdateMemoryLayerMetadata::new().set_or_clear_original_request(Some(UpdateMemoryLayerRequest::default()/* use setters */));
1921 /// let x = UpdateMemoryLayerMetadata::new().set_or_clear_original_request(None::<UpdateMemoryLayerRequest>);
1922 /// ```
1923 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
1924 where
1925 T: std::convert::Into<crate::model::UpdateMemoryLayerRequest>,
1926 {
1927 self.original_request = v.map(|x| x.into());
1928 self
1929 }
1930
1931 /// Sets the value of [request_time][crate::model::UpdateMemoryLayerMetadata::request_time].
1932 ///
1933 /// # Example
1934 /// ```ignore,no_run
1935 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerMetadata;
1936 /// use wkt::Timestamp;
1937 /// let x = UpdateMemoryLayerMetadata::new().set_request_time(Timestamp::default()/* use setters */);
1938 /// ```
1939 pub fn set_request_time<T>(mut self, v: T) -> Self
1940 where
1941 T: std::convert::Into<wkt::Timestamp>,
1942 {
1943 self.request_time = std::option::Option::Some(v.into());
1944 self
1945 }
1946
1947 /// Sets or clears the value of [request_time][crate::model::UpdateMemoryLayerMetadata::request_time].
1948 ///
1949 /// # Example
1950 /// ```ignore,no_run
1951 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerMetadata;
1952 /// use wkt::Timestamp;
1953 /// let x = UpdateMemoryLayerMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
1954 /// let x = UpdateMemoryLayerMetadata::new().set_or_clear_request_time(None::<Timestamp>);
1955 /// ```
1956 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
1957 where
1958 T: std::convert::Into<wkt::Timestamp>,
1959 {
1960 self.request_time = v.map(|x| x.into());
1961 self
1962 }
1963
1964 /// Sets the value of [finish_time][crate::model::UpdateMemoryLayerMetadata::finish_time].
1965 ///
1966 /// # Example
1967 /// ```ignore,no_run
1968 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerMetadata;
1969 /// use wkt::Timestamp;
1970 /// let x = UpdateMemoryLayerMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
1971 /// ```
1972 pub fn set_finish_time<T>(mut self, v: T) -> Self
1973 where
1974 T: std::convert::Into<wkt::Timestamp>,
1975 {
1976 self.finish_time = std::option::Option::Some(v.into());
1977 self
1978 }
1979
1980 /// Sets or clears the value of [finish_time][crate::model::UpdateMemoryLayerMetadata::finish_time].
1981 ///
1982 /// # Example
1983 /// ```ignore,no_run
1984 /// # use google_cloud_bigtable_admin_v2::model::UpdateMemoryLayerMetadata;
1985 /// use wkt::Timestamp;
1986 /// let x = UpdateMemoryLayerMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1987 /// let x = UpdateMemoryLayerMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
1988 /// ```
1989 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1990 where
1991 T: std::convert::Into<wkt::Timestamp>,
1992 {
1993 self.finish_time = v.map(|x| x.into());
1994 self
1995 }
1996}
1997
1998impl wkt::message::Message for UpdateMemoryLayerMetadata {
1999 fn typename() -> &'static str {
2000 "type.googleapis.com/google.bigtable.admin.v2.UpdateMemoryLayerMetadata"
2001 }
2002}
2003
2004/// Request message for BigtableInstanceAdmin.ListMemoryLayers.
2005#[derive(Clone, Default, PartialEq)]
2006#[non_exhaustive]
2007pub struct ListMemoryLayersRequest {
2008 /// Required. The unique name of the cluster for which a list of memory layers
2009 /// is requested. Values are of the form
2010 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
2011 /// Use `{cluster} = '-'` to list MemoryLayers for all Clusters in an instance,
2012 /// e.g., `projects/myproject/instances/myinstance/clusters/-`.
2013 pub parent: std::string::String,
2014
2015 /// Optional. The maximum number of memory layers to return. The service may
2016 /// return fewer than this value.
2017 pub page_size: i32,
2018
2019 /// Optional. A page token, received from a previous `ListMemoryLayers` call.
2020 /// Provide this to retrieve the subsequent page.
2021 ///
2022 /// When paginating, all other parameters provided to `ListMemoryLayers`
2023 /// must match the call that provided the page token.
2024 pub page_token: std::string::String,
2025
2026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2027}
2028
2029impl ListMemoryLayersRequest {
2030 /// Creates a new default instance.
2031 pub fn new() -> Self {
2032 std::default::Default::default()
2033 }
2034
2035 /// Sets the value of [parent][crate::model::ListMemoryLayersRequest::parent].
2036 ///
2037 /// # Example
2038 /// ```ignore,no_run
2039 /// # use google_cloud_bigtable_admin_v2::model::ListMemoryLayersRequest;
2040 /// # let project_id = "project_id";
2041 /// # let instance_id = "instance_id";
2042 /// # let cluster_id = "cluster_id";
2043 /// let x = ListMemoryLayersRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
2044 /// ```
2045 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2046 self.parent = v.into();
2047 self
2048 }
2049
2050 /// Sets the value of [page_size][crate::model::ListMemoryLayersRequest::page_size].
2051 ///
2052 /// # Example
2053 /// ```ignore,no_run
2054 /// # use google_cloud_bigtable_admin_v2::model::ListMemoryLayersRequest;
2055 /// let x = ListMemoryLayersRequest::new().set_page_size(42);
2056 /// ```
2057 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2058 self.page_size = v.into();
2059 self
2060 }
2061
2062 /// Sets the value of [page_token][crate::model::ListMemoryLayersRequest::page_token].
2063 ///
2064 /// # Example
2065 /// ```ignore,no_run
2066 /// # use google_cloud_bigtable_admin_v2::model::ListMemoryLayersRequest;
2067 /// let x = ListMemoryLayersRequest::new().set_page_token("example");
2068 /// ```
2069 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2070 self.page_token = v.into();
2071 self
2072 }
2073}
2074
2075impl wkt::message::Message for ListMemoryLayersRequest {
2076 fn typename() -> &'static str {
2077 "type.googleapis.com/google.bigtable.admin.v2.ListMemoryLayersRequest"
2078 }
2079}
2080
2081/// Response message for BigtableInstanceAdmin.ListMemoryLayers.
2082#[derive(Clone, Default, PartialEq)]
2083#[non_exhaustive]
2084pub struct ListMemoryLayersResponse {
2085 /// The list of requested memory layers.
2086 pub memory_layers: std::vec::Vec<crate::model::MemoryLayer>,
2087
2088 /// Locations from which MemoryLayer information could not be retrieved,
2089 /// due to an outage or some other transient condition.
2090 /// MemoryLayers from these locations may be missing from `memory_layers`,
2091 /// or may only have partial information returned.
2092 /// Values are of the form `projects/<project>/locations/<zone_id>`
2093 pub failed_locations: std::vec::Vec<std::string::String>,
2094
2095 /// A token, which can be sent as `page_token` to retrieve the next page.
2096 /// If this field is omitted, there are no subsequent pages.
2097 pub next_page_token: std::string::String,
2098
2099 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2100}
2101
2102impl ListMemoryLayersResponse {
2103 /// Creates a new default instance.
2104 pub fn new() -> Self {
2105 std::default::Default::default()
2106 }
2107
2108 /// Sets the value of [memory_layers][crate::model::ListMemoryLayersResponse::memory_layers].
2109 ///
2110 /// # Example
2111 /// ```ignore,no_run
2112 /// # use google_cloud_bigtable_admin_v2::model::ListMemoryLayersResponse;
2113 /// use google_cloud_bigtable_admin_v2::model::MemoryLayer;
2114 /// let x = ListMemoryLayersResponse::new()
2115 /// .set_memory_layers([
2116 /// MemoryLayer::default()/* use setters */,
2117 /// MemoryLayer::default()/* use (different) setters */,
2118 /// ]);
2119 /// ```
2120 pub fn set_memory_layers<T, V>(mut self, v: T) -> Self
2121 where
2122 T: std::iter::IntoIterator<Item = V>,
2123 V: std::convert::Into<crate::model::MemoryLayer>,
2124 {
2125 use std::iter::Iterator;
2126 self.memory_layers = v.into_iter().map(|i| i.into()).collect();
2127 self
2128 }
2129
2130 /// Sets the value of [failed_locations][crate::model::ListMemoryLayersResponse::failed_locations].
2131 ///
2132 /// # Example
2133 /// ```ignore,no_run
2134 /// # use google_cloud_bigtable_admin_v2::model::ListMemoryLayersResponse;
2135 /// let x = ListMemoryLayersResponse::new().set_failed_locations(["a", "b", "c"]);
2136 /// ```
2137 pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
2138 where
2139 T: std::iter::IntoIterator<Item = V>,
2140 V: std::convert::Into<std::string::String>,
2141 {
2142 use std::iter::Iterator;
2143 self.failed_locations = v.into_iter().map(|i| i.into()).collect();
2144 self
2145 }
2146
2147 /// Sets the value of [next_page_token][crate::model::ListMemoryLayersResponse::next_page_token].
2148 ///
2149 /// # Example
2150 /// ```ignore,no_run
2151 /// # use google_cloud_bigtable_admin_v2::model::ListMemoryLayersResponse;
2152 /// let x = ListMemoryLayersResponse::new().set_next_page_token("example");
2153 /// ```
2154 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2155 self.next_page_token = v.into();
2156 self
2157 }
2158}
2159
2160impl wkt::message::Message for ListMemoryLayersResponse {
2161 fn typename() -> &'static str {
2162 "type.googleapis.com/google.bigtable.admin.v2.ListMemoryLayersResponse"
2163 }
2164}
2165
2166#[doc(hidden)]
2167impl google_cloud_gax::paginator::internal::PageableResponse for ListMemoryLayersResponse {
2168 type PageItem = crate::model::MemoryLayer;
2169
2170 fn items(self) -> std::vec::Vec<Self::PageItem> {
2171 self.memory_layers
2172 }
2173
2174 fn next_page_token(&self) -> std::string::String {
2175 use std::clone::Clone;
2176 self.next_page_token.clone()
2177 }
2178}
2179
2180/// Request message for BigtableInstanceAdmin.GetMemoryLayer.
2181#[derive(Clone, Default, PartialEq)]
2182#[non_exhaustive]
2183pub struct GetMemoryLayerRequest {
2184 /// Required. The unique name of the requested cluster's memory layer. Values
2185 /// are of the form
2186 /// `projects/{project}/instances/{instance}/clusters/{cluster}/memoryLayer`.
2187 pub name: std::string::String,
2188
2189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2190}
2191
2192impl GetMemoryLayerRequest {
2193 /// Creates a new default instance.
2194 pub fn new() -> Self {
2195 std::default::Default::default()
2196 }
2197
2198 /// Sets the value of [name][crate::model::GetMemoryLayerRequest::name].
2199 ///
2200 /// # Example
2201 /// ```ignore,no_run
2202 /// # use google_cloud_bigtable_admin_v2::model::GetMemoryLayerRequest;
2203 /// # let project_id = "project_id";
2204 /// # let instance_id = "instance_id";
2205 /// # let cluster_id = "cluster_id";
2206 /// let x = GetMemoryLayerRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/memoryLayer"));
2207 /// ```
2208 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2209 self.name = v.into();
2210 self
2211 }
2212}
2213
2214impl wkt::message::Message for GetMemoryLayerRequest {
2215 fn typename() -> &'static str {
2216 "type.googleapis.com/google.bigtable.admin.v2.GetMemoryLayerRequest"
2217 }
2218}
2219
2220/// Request message for BigtableInstanceAdmin.CreateAppProfile.
2221#[derive(Clone, Default, PartialEq)]
2222#[non_exhaustive]
2223pub struct CreateAppProfileRequest {
2224 /// Required. The unique name of the instance in which to create the new app
2225 /// profile. Values are of the form `projects/{project}/instances/{instance}`.
2226 pub parent: std::string::String,
2227
2228 /// Required. The ID to be used when referring to the new app profile within
2229 /// its instance, e.g., just `myprofile` rather than
2230 /// `projects/myproject/instances/myinstance/appProfiles/myprofile`.
2231 pub app_profile_id: std::string::String,
2232
2233 /// Required. The app profile to be created.
2234 /// Fields marked `OutputOnly` will be ignored.
2235 pub app_profile: std::option::Option<crate::model::AppProfile>,
2236
2237 /// If true, ignore safety checks when creating the app profile.
2238 pub ignore_warnings: bool,
2239
2240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2241}
2242
2243impl CreateAppProfileRequest {
2244 /// Creates a new default instance.
2245 pub fn new() -> Self {
2246 std::default::Default::default()
2247 }
2248
2249 /// Sets the value of [parent][crate::model::CreateAppProfileRequest::parent].
2250 ///
2251 /// # Example
2252 /// ```ignore,no_run
2253 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
2254 /// # let project_id = "project_id";
2255 /// # let instance_id = "instance_id";
2256 /// let x = CreateAppProfileRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
2257 /// ```
2258 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2259 self.parent = v.into();
2260 self
2261 }
2262
2263 /// Sets the value of [app_profile_id][crate::model::CreateAppProfileRequest::app_profile_id].
2264 ///
2265 /// # Example
2266 /// ```ignore,no_run
2267 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
2268 /// let x = CreateAppProfileRequest::new().set_app_profile_id("example");
2269 /// ```
2270 pub fn set_app_profile_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2271 self.app_profile_id = v.into();
2272 self
2273 }
2274
2275 /// Sets the value of [app_profile][crate::model::CreateAppProfileRequest::app_profile].
2276 ///
2277 /// # Example
2278 /// ```ignore,no_run
2279 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
2280 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
2281 /// let x = CreateAppProfileRequest::new().set_app_profile(AppProfile::default()/* use setters */);
2282 /// ```
2283 pub fn set_app_profile<T>(mut self, v: T) -> Self
2284 where
2285 T: std::convert::Into<crate::model::AppProfile>,
2286 {
2287 self.app_profile = std::option::Option::Some(v.into());
2288 self
2289 }
2290
2291 /// Sets or clears the value of [app_profile][crate::model::CreateAppProfileRequest::app_profile].
2292 ///
2293 /// # Example
2294 /// ```ignore,no_run
2295 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
2296 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
2297 /// let x = CreateAppProfileRequest::new().set_or_clear_app_profile(Some(AppProfile::default()/* use setters */));
2298 /// let x = CreateAppProfileRequest::new().set_or_clear_app_profile(None::<AppProfile>);
2299 /// ```
2300 pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
2301 where
2302 T: std::convert::Into<crate::model::AppProfile>,
2303 {
2304 self.app_profile = v.map(|x| x.into());
2305 self
2306 }
2307
2308 /// Sets the value of [ignore_warnings][crate::model::CreateAppProfileRequest::ignore_warnings].
2309 ///
2310 /// # Example
2311 /// ```ignore,no_run
2312 /// # use google_cloud_bigtable_admin_v2::model::CreateAppProfileRequest;
2313 /// let x = CreateAppProfileRequest::new().set_ignore_warnings(true);
2314 /// ```
2315 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2316 self.ignore_warnings = v.into();
2317 self
2318 }
2319}
2320
2321impl wkt::message::Message for CreateAppProfileRequest {
2322 fn typename() -> &'static str {
2323 "type.googleapis.com/google.bigtable.admin.v2.CreateAppProfileRequest"
2324 }
2325}
2326
2327/// Request message for BigtableInstanceAdmin.GetAppProfile.
2328#[derive(Clone, Default, PartialEq)]
2329#[non_exhaustive]
2330pub struct GetAppProfileRequest {
2331 /// Required. The unique name of the requested app profile. Values are of the
2332 /// form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
2333 pub name: std::string::String,
2334
2335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2336}
2337
2338impl GetAppProfileRequest {
2339 /// Creates a new default instance.
2340 pub fn new() -> Self {
2341 std::default::Default::default()
2342 }
2343
2344 /// Sets the value of [name][crate::model::GetAppProfileRequest::name].
2345 ///
2346 /// # Example
2347 /// ```ignore,no_run
2348 /// # use google_cloud_bigtable_admin_v2::model::GetAppProfileRequest;
2349 /// # let project_id = "project_id";
2350 /// # let instance_id = "instance_id";
2351 /// # let app_profile_id = "app_profile_id";
2352 /// let x = GetAppProfileRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/appProfiles/{app_profile_id}"));
2353 /// ```
2354 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2355 self.name = v.into();
2356 self
2357 }
2358}
2359
2360impl wkt::message::Message for GetAppProfileRequest {
2361 fn typename() -> &'static str {
2362 "type.googleapis.com/google.bigtable.admin.v2.GetAppProfileRequest"
2363 }
2364}
2365
2366/// Request message for BigtableInstanceAdmin.ListAppProfiles.
2367#[derive(Clone, Default, PartialEq)]
2368#[non_exhaustive]
2369pub struct ListAppProfilesRequest {
2370 /// Required. The unique name of the instance for which a list of app profiles
2371 /// is requested. Values are of the form
2372 /// `projects/{project}/instances/{instance}`.
2373 /// Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
2374 /// e.g., `projects/myproject/instances/-`.
2375 pub parent: std::string::String,
2376
2377 /// Maximum number of results per page.
2378 ///
2379 /// A page_size of zero lets the server choose the number of items to return.
2380 /// A page_size which is strictly positive will return at most that many items.
2381 /// A negative page_size will cause an error.
2382 ///
2383 /// Following the first request, subsequent paginated calls are not required
2384 /// to pass a page_size. If a page_size is set in subsequent calls, it must
2385 /// match the page_size given in the first request.
2386 pub page_size: i32,
2387
2388 /// The value of `next_page_token` returned by a previous call.
2389 pub page_token: std::string::String,
2390
2391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2392}
2393
2394impl ListAppProfilesRequest {
2395 /// Creates a new default instance.
2396 pub fn new() -> Self {
2397 std::default::Default::default()
2398 }
2399
2400 /// Sets the value of [parent][crate::model::ListAppProfilesRequest::parent].
2401 ///
2402 /// # Example
2403 /// ```ignore,no_run
2404 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesRequest;
2405 /// # let project_id = "project_id";
2406 /// # let instance_id = "instance_id";
2407 /// let x = ListAppProfilesRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
2408 /// ```
2409 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2410 self.parent = v.into();
2411 self
2412 }
2413
2414 /// Sets the value of [page_size][crate::model::ListAppProfilesRequest::page_size].
2415 ///
2416 /// # Example
2417 /// ```ignore,no_run
2418 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesRequest;
2419 /// let x = ListAppProfilesRequest::new().set_page_size(42);
2420 /// ```
2421 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2422 self.page_size = v.into();
2423 self
2424 }
2425
2426 /// Sets the value of [page_token][crate::model::ListAppProfilesRequest::page_token].
2427 ///
2428 /// # Example
2429 /// ```ignore,no_run
2430 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesRequest;
2431 /// let x = ListAppProfilesRequest::new().set_page_token("example");
2432 /// ```
2433 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2434 self.page_token = v.into();
2435 self
2436 }
2437}
2438
2439impl wkt::message::Message for ListAppProfilesRequest {
2440 fn typename() -> &'static str {
2441 "type.googleapis.com/google.bigtable.admin.v2.ListAppProfilesRequest"
2442 }
2443}
2444
2445/// Response message for BigtableInstanceAdmin.ListAppProfiles.
2446#[derive(Clone, Default, PartialEq)]
2447#[non_exhaustive]
2448pub struct ListAppProfilesResponse {
2449 /// The list of requested app profiles.
2450 pub app_profiles: std::vec::Vec<crate::model::AppProfile>,
2451
2452 /// Set if not all app profiles could be returned in a single response.
2453 /// Pass this value to `page_token` in another request to get the next
2454 /// page of results.
2455 pub next_page_token: std::string::String,
2456
2457 /// Locations from which AppProfile information could not be retrieved,
2458 /// due to an outage or some other transient condition.
2459 /// AppProfiles from these locations may be missing from `app_profiles`.
2460 /// Values are of the form `projects/<project>/locations/<zone_id>`
2461 pub failed_locations: std::vec::Vec<std::string::String>,
2462
2463 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2464}
2465
2466impl ListAppProfilesResponse {
2467 /// Creates a new default instance.
2468 pub fn new() -> Self {
2469 std::default::Default::default()
2470 }
2471
2472 /// Sets the value of [app_profiles][crate::model::ListAppProfilesResponse::app_profiles].
2473 ///
2474 /// # Example
2475 /// ```ignore,no_run
2476 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesResponse;
2477 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
2478 /// let x = ListAppProfilesResponse::new()
2479 /// .set_app_profiles([
2480 /// AppProfile::default()/* use setters */,
2481 /// AppProfile::default()/* use (different) setters */,
2482 /// ]);
2483 /// ```
2484 pub fn set_app_profiles<T, V>(mut self, v: T) -> Self
2485 where
2486 T: std::iter::IntoIterator<Item = V>,
2487 V: std::convert::Into<crate::model::AppProfile>,
2488 {
2489 use std::iter::Iterator;
2490 self.app_profiles = v.into_iter().map(|i| i.into()).collect();
2491 self
2492 }
2493
2494 /// Sets the value of [next_page_token][crate::model::ListAppProfilesResponse::next_page_token].
2495 ///
2496 /// # Example
2497 /// ```ignore,no_run
2498 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesResponse;
2499 /// let x = ListAppProfilesResponse::new().set_next_page_token("example");
2500 /// ```
2501 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2502 self.next_page_token = v.into();
2503 self
2504 }
2505
2506 /// Sets the value of [failed_locations][crate::model::ListAppProfilesResponse::failed_locations].
2507 ///
2508 /// # Example
2509 /// ```ignore,no_run
2510 /// # use google_cloud_bigtable_admin_v2::model::ListAppProfilesResponse;
2511 /// let x = ListAppProfilesResponse::new().set_failed_locations(["a", "b", "c"]);
2512 /// ```
2513 pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
2514 where
2515 T: std::iter::IntoIterator<Item = V>,
2516 V: std::convert::Into<std::string::String>,
2517 {
2518 use std::iter::Iterator;
2519 self.failed_locations = v.into_iter().map(|i| i.into()).collect();
2520 self
2521 }
2522}
2523
2524impl wkt::message::Message for ListAppProfilesResponse {
2525 fn typename() -> &'static str {
2526 "type.googleapis.com/google.bigtable.admin.v2.ListAppProfilesResponse"
2527 }
2528}
2529
2530#[doc(hidden)]
2531impl google_cloud_gax::paginator::internal::PageableResponse for ListAppProfilesResponse {
2532 type PageItem = crate::model::AppProfile;
2533
2534 fn items(self) -> std::vec::Vec<Self::PageItem> {
2535 self.app_profiles
2536 }
2537
2538 fn next_page_token(&self) -> std::string::String {
2539 use std::clone::Clone;
2540 self.next_page_token.clone()
2541 }
2542}
2543
2544/// Request message for BigtableInstanceAdmin.UpdateAppProfile.
2545#[derive(Clone, Default, PartialEq)]
2546#[non_exhaustive]
2547pub struct UpdateAppProfileRequest {
2548 /// Required. The app profile which will (partially) replace the current value.
2549 pub app_profile: std::option::Option<crate::model::AppProfile>,
2550
2551 /// Required. The subset of app profile fields which should be replaced.
2552 /// If unset, all fields will be replaced.
2553 pub update_mask: std::option::Option<wkt::FieldMask>,
2554
2555 /// If true, ignore safety checks when updating the app profile.
2556 pub ignore_warnings: bool,
2557
2558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2559}
2560
2561impl UpdateAppProfileRequest {
2562 /// Creates a new default instance.
2563 pub fn new() -> Self {
2564 std::default::Default::default()
2565 }
2566
2567 /// Sets the value of [app_profile][crate::model::UpdateAppProfileRequest::app_profile].
2568 ///
2569 /// # Example
2570 /// ```ignore,no_run
2571 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2572 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
2573 /// let x = UpdateAppProfileRequest::new().set_app_profile(AppProfile::default()/* use setters */);
2574 /// ```
2575 pub fn set_app_profile<T>(mut self, v: T) -> Self
2576 where
2577 T: std::convert::Into<crate::model::AppProfile>,
2578 {
2579 self.app_profile = std::option::Option::Some(v.into());
2580 self
2581 }
2582
2583 /// Sets or clears the value of [app_profile][crate::model::UpdateAppProfileRequest::app_profile].
2584 ///
2585 /// # Example
2586 /// ```ignore,no_run
2587 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2588 /// use google_cloud_bigtable_admin_v2::model::AppProfile;
2589 /// let x = UpdateAppProfileRequest::new().set_or_clear_app_profile(Some(AppProfile::default()/* use setters */));
2590 /// let x = UpdateAppProfileRequest::new().set_or_clear_app_profile(None::<AppProfile>);
2591 /// ```
2592 pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
2593 where
2594 T: std::convert::Into<crate::model::AppProfile>,
2595 {
2596 self.app_profile = v.map(|x| x.into());
2597 self
2598 }
2599
2600 /// Sets the value of [update_mask][crate::model::UpdateAppProfileRequest::update_mask].
2601 ///
2602 /// # Example
2603 /// ```ignore,no_run
2604 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2605 /// use wkt::FieldMask;
2606 /// let x = UpdateAppProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2607 /// ```
2608 pub fn set_update_mask<T>(mut self, v: T) -> Self
2609 where
2610 T: std::convert::Into<wkt::FieldMask>,
2611 {
2612 self.update_mask = std::option::Option::Some(v.into());
2613 self
2614 }
2615
2616 /// Sets or clears the value of [update_mask][crate::model::UpdateAppProfileRequest::update_mask].
2617 ///
2618 /// # Example
2619 /// ```ignore,no_run
2620 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2621 /// use wkt::FieldMask;
2622 /// let x = UpdateAppProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2623 /// let x = UpdateAppProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2624 /// ```
2625 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2626 where
2627 T: std::convert::Into<wkt::FieldMask>,
2628 {
2629 self.update_mask = v.map(|x| x.into());
2630 self
2631 }
2632
2633 /// Sets the value of [ignore_warnings][crate::model::UpdateAppProfileRequest::ignore_warnings].
2634 ///
2635 /// # Example
2636 /// ```ignore,no_run
2637 /// # use google_cloud_bigtable_admin_v2::model::UpdateAppProfileRequest;
2638 /// let x = UpdateAppProfileRequest::new().set_ignore_warnings(true);
2639 /// ```
2640 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2641 self.ignore_warnings = v.into();
2642 self
2643 }
2644}
2645
2646impl wkt::message::Message for UpdateAppProfileRequest {
2647 fn typename() -> &'static str {
2648 "type.googleapis.com/google.bigtable.admin.v2.UpdateAppProfileRequest"
2649 }
2650}
2651
2652/// Request message for BigtableInstanceAdmin.DeleteAppProfile.
2653#[derive(Clone, Default, PartialEq)]
2654#[non_exhaustive]
2655pub struct DeleteAppProfileRequest {
2656 /// Required. The unique name of the app profile to be deleted. Values are of
2657 /// the form
2658 /// `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
2659 pub name: std::string::String,
2660
2661 /// Required. If true, ignore safety checks when deleting the app profile.
2662 pub ignore_warnings: bool,
2663
2664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2665}
2666
2667impl DeleteAppProfileRequest {
2668 /// Creates a new default instance.
2669 pub fn new() -> Self {
2670 std::default::Default::default()
2671 }
2672
2673 /// Sets the value of [name][crate::model::DeleteAppProfileRequest::name].
2674 ///
2675 /// # Example
2676 /// ```ignore,no_run
2677 /// # use google_cloud_bigtable_admin_v2::model::DeleteAppProfileRequest;
2678 /// # let project_id = "project_id";
2679 /// # let instance_id = "instance_id";
2680 /// # let app_profile_id = "app_profile_id";
2681 /// let x = DeleteAppProfileRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/appProfiles/{app_profile_id}"));
2682 /// ```
2683 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2684 self.name = v.into();
2685 self
2686 }
2687
2688 /// Sets the value of [ignore_warnings][crate::model::DeleteAppProfileRequest::ignore_warnings].
2689 ///
2690 /// # Example
2691 /// ```ignore,no_run
2692 /// # use google_cloud_bigtable_admin_v2::model::DeleteAppProfileRequest;
2693 /// let x = DeleteAppProfileRequest::new().set_ignore_warnings(true);
2694 /// ```
2695 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2696 self.ignore_warnings = v.into();
2697 self
2698 }
2699}
2700
2701impl wkt::message::Message for DeleteAppProfileRequest {
2702 fn typename() -> &'static str {
2703 "type.googleapis.com/google.bigtable.admin.v2.DeleteAppProfileRequest"
2704 }
2705}
2706
2707/// The metadata for the Operation returned by UpdateAppProfile.
2708#[derive(Clone, Default, PartialEq)]
2709#[non_exhaustive]
2710pub struct UpdateAppProfileMetadata {
2711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2712}
2713
2714impl UpdateAppProfileMetadata {
2715 /// Creates a new default instance.
2716 pub fn new() -> Self {
2717 std::default::Default::default()
2718 }
2719}
2720
2721impl wkt::message::Message for UpdateAppProfileMetadata {
2722 fn typename() -> &'static str {
2723 "type.googleapis.com/google.bigtable.admin.v2.UpdateAppProfileMetadata"
2724 }
2725}
2726
2727/// Request message for BigtableInstanceAdmin.ListHotTablets.
2728#[derive(Clone, Default, PartialEq)]
2729#[non_exhaustive]
2730pub struct ListHotTabletsRequest {
2731 /// Required. The cluster name to list hot tablets.
2732 /// Value is in the following form:
2733 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
2734 pub parent: std::string::String,
2735
2736 /// The start time to list hot tablets. The hot tablets in the response will
2737 /// have start times between the requested start time and end time. Start time
2738 /// defaults to Now if it is unset, and end time defaults to Now - 24 hours if
2739 /// it is unset. The start time should be less than the end time, and the
2740 /// maximum allowed time range between start time and end time is 48 hours.
2741 /// Start time and end time should have values between Now and Now - 14 days.
2742 pub start_time: std::option::Option<wkt::Timestamp>,
2743
2744 /// The end time to list hot tablets.
2745 pub end_time: std::option::Option<wkt::Timestamp>,
2746
2747 /// Maximum number of results per page.
2748 ///
2749 /// A page_size that is empty or zero lets the server choose the number of
2750 /// items to return. A page_size which is strictly positive will return at most
2751 /// that many items. A negative page_size will cause an error.
2752 ///
2753 /// Following the first request, subsequent paginated calls do not need a
2754 /// page_size field. If a page_size is set in subsequent calls, it must match
2755 /// the page_size given in the first request.
2756 pub page_size: i32,
2757
2758 /// The value of `next_page_token` returned by a previous call.
2759 pub page_token: std::string::String,
2760
2761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2762}
2763
2764impl ListHotTabletsRequest {
2765 /// Creates a new default instance.
2766 pub fn new() -> Self {
2767 std::default::Default::default()
2768 }
2769
2770 /// Sets the value of [parent][crate::model::ListHotTabletsRequest::parent].
2771 ///
2772 /// # Example
2773 /// ```ignore,no_run
2774 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2775 /// # let project_id = "project_id";
2776 /// # let instance_id = "instance_id";
2777 /// # let cluster_id = "cluster_id";
2778 /// let x = ListHotTabletsRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
2779 /// ```
2780 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2781 self.parent = v.into();
2782 self
2783 }
2784
2785 /// Sets the value of [start_time][crate::model::ListHotTabletsRequest::start_time].
2786 ///
2787 /// # Example
2788 /// ```ignore,no_run
2789 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2790 /// use wkt::Timestamp;
2791 /// let x = ListHotTabletsRequest::new().set_start_time(Timestamp::default()/* use setters */);
2792 /// ```
2793 pub fn set_start_time<T>(mut self, v: T) -> Self
2794 where
2795 T: std::convert::Into<wkt::Timestamp>,
2796 {
2797 self.start_time = std::option::Option::Some(v.into());
2798 self
2799 }
2800
2801 /// Sets or clears the value of [start_time][crate::model::ListHotTabletsRequest::start_time].
2802 ///
2803 /// # Example
2804 /// ```ignore,no_run
2805 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2806 /// use wkt::Timestamp;
2807 /// let x = ListHotTabletsRequest::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
2808 /// let x = ListHotTabletsRequest::new().set_or_clear_start_time(None::<Timestamp>);
2809 /// ```
2810 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2811 where
2812 T: std::convert::Into<wkt::Timestamp>,
2813 {
2814 self.start_time = v.map(|x| x.into());
2815 self
2816 }
2817
2818 /// Sets the value of [end_time][crate::model::ListHotTabletsRequest::end_time].
2819 ///
2820 /// # Example
2821 /// ```ignore,no_run
2822 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2823 /// use wkt::Timestamp;
2824 /// let x = ListHotTabletsRequest::new().set_end_time(Timestamp::default()/* use setters */);
2825 /// ```
2826 pub fn set_end_time<T>(mut self, v: T) -> Self
2827 where
2828 T: std::convert::Into<wkt::Timestamp>,
2829 {
2830 self.end_time = std::option::Option::Some(v.into());
2831 self
2832 }
2833
2834 /// Sets or clears the value of [end_time][crate::model::ListHotTabletsRequest::end_time].
2835 ///
2836 /// # Example
2837 /// ```ignore,no_run
2838 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2839 /// use wkt::Timestamp;
2840 /// let x = ListHotTabletsRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2841 /// let x = ListHotTabletsRequest::new().set_or_clear_end_time(None::<Timestamp>);
2842 /// ```
2843 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2844 where
2845 T: std::convert::Into<wkt::Timestamp>,
2846 {
2847 self.end_time = v.map(|x| x.into());
2848 self
2849 }
2850
2851 /// Sets the value of [page_size][crate::model::ListHotTabletsRequest::page_size].
2852 ///
2853 /// # Example
2854 /// ```ignore,no_run
2855 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2856 /// let x = ListHotTabletsRequest::new().set_page_size(42);
2857 /// ```
2858 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2859 self.page_size = v.into();
2860 self
2861 }
2862
2863 /// Sets the value of [page_token][crate::model::ListHotTabletsRequest::page_token].
2864 ///
2865 /// # Example
2866 /// ```ignore,no_run
2867 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsRequest;
2868 /// let x = ListHotTabletsRequest::new().set_page_token("example");
2869 /// ```
2870 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2871 self.page_token = v.into();
2872 self
2873 }
2874}
2875
2876impl wkt::message::Message for ListHotTabletsRequest {
2877 fn typename() -> &'static str {
2878 "type.googleapis.com/google.bigtable.admin.v2.ListHotTabletsRequest"
2879 }
2880}
2881
2882/// Response message for BigtableInstanceAdmin.ListHotTablets.
2883#[derive(Clone, Default, PartialEq)]
2884#[non_exhaustive]
2885pub struct ListHotTabletsResponse {
2886 /// List of hot tablets in the tables of the requested cluster that fall
2887 /// within the requested time range. Hot tablets are ordered by node cpu usage
2888 /// percent. If there are multiple hot tablets that correspond to the same
2889 /// tablet within a 15-minute interval, only the hot tablet with the highest
2890 /// node cpu usage will be included in the response.
2891 pub hot_tablets: std::vec::Vec<crate::model::HotTablet>,
2892
2893 /// Set if not all hot tablets could be returned in a single response.
2894 /// Pass this value to `page_token` in another request to get the next
2895 /// page of results.
2896 pub next_page_token: std::string::String,
2897
2898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2899}
2900
2901impl ListHotTabletsResponse {
2902 /// Creates a new default instance.
2903 pub fn new() -> Self {
2904 std::default::Default::default()
2905 }
2906
2907 /// Sets the value of [hot_tablets][crate::model::ListHotTabletsResponse::hot_tablets].
2908 ///
2909 /// # Example
2910 /// ```ignore,no_run
2911 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsResponse;
2912 /// use google_cloud_bigtable_admin_v2::model::HotTablet;
2913 /// let x = ListHotTabletsResponse::new()
2914 /// .set_hot_tablets([
2915 /// HotTablet::default()/* use setters */,
2916 /// HotTablet::default()/* use (different) setters */,
2917 /// ]);
2918 /// ```
2919 pub fn set_hot_tablets<T, V>(mut self, v: T) -> Self
2920 where
2921 T: std::iter::IntoIterator<Item = V>,
2922 V: std::convert::Into<crate::model::HotTablet>,
2923 {
2924 use std::iter::Iterator;
2925 self.hot_tablets = v.into_iter().map(|i| i.into()).collect();
2926 self
2927 }
2928
2929 /// Sets the value of [next_page_token][crate::model::ListHotTabletsResponse::next_page_token].
2930 ///
2931 /// # Example
2932 /// ```ignore,no_run
2933 /// # use google_cloud_bigtable_admin_v2::model::ListHotTabletsResponse;
2934 /// let x = ListHotTabletsResponse::new().set_next_page_token("example");
2935 /// ```
2936 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2937 self.next_page_token = v.into();
2938 self
2939 }
2940}
2941
2942impl wkt::message::Message for ListHotTabletsResponse {
2943 fn typename() -> &'static str {
2944 "type.googleapis.com/google.bigtable.admin.v2.ListHotTabletsResponse"
2945 }
2946}
2947
2948#[doc(hidden)]
2949impl google_cloud_gax::paginator::internal::PageableResponse for ListHotTabletsResponse {
2950 type PageItem = crate::model::HotTablet;
2951
2952 fn items(self) -> std::vec::Vec<Self::PageItem> {
2953 self.hot_tablets
2954 }
2955
2956 fn next_page_token(&self) -> std::string::String {
2957 use std::clone::Clone;
2958 self.next_page_token.clone()
2959 }
2960}
2961
2962/// Request message for BigtableInstanceAdmin.CreateLogicalView.
2963#[derive(Clone, Default, PartialEq)]
2964#[non_exhaustive]
2965pub struct CreateLogicalViewRequest {
2966 /// Required. The parent instance where this logical view will be created.
2967 /// Format: `projects/{project}/instances/{instance}`.
2968 pub parent: std::string::String,
2969
2970 /// Required. The ID to use for the logical view, which will become the final
2971 /// component of the logical view's resource name.
2972 pub logical_view_id: std::string::String,
2973
2974 /// Required. The logical view to create.
2975 pub logical_view: std::option::Option<crate::model::LogicalView>,
2976
2977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2978}
2979
2980impl CreateLogicalViewRequest {
2981 /// Creates a new default instance.
2982 pub fn new() -> Self {
2983 std::default::Default::default()
2984 }
2985
2986 /// Sets the value of [parent][crate::model::CreateLogicalViewRequest::parent].
2987 ///
2988 /// # Example
2989 /// ```ignore,no_run
2990 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
2991 /// # let project_id = "project_id";
2992 /// # let instance_id = "instance_id";
2993 /// let x = CreateLogicalViewRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
2994 /// ```
2995 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2996 self.parent = v.into();
2997 self
2998 }
2999
3000 /// Sets the value of [logical_view_id][crate::model::CreateLogicalViewRequest::logical_view_id].
3001 ///
3002 /// # Example
3003 /// ```ignore,no_run
3004 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
3005 /// let x = CreateLogicalViewRequest::new().set_logical_view_id("example");
3006 /// ```
3007 pub fn set_logical_view_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3008 self.logical_view_id = v.into();
3009 self
3010 }
3011
3012 /// Sets the value of [logical_view][crate::model::CreateLogicalViewRequest::logical_view].
3013 ///
3014 /// # Example
3015 /// ```ignore,no_run
3016 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
3017 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
3018 /// let x = CreateLogicalViewRequest::new().set_logical_view(LogicalView::default()/* use setters */);
3019 /// ```
3020 pub fn set_logical_view<T>(mut self, v: T) -> Self
3021 where
3022 T: std::convert::Into<crate::model::LogicalView>,
3023 {
3024 self.logical_view = std::option::Option::Some(v.into());
3025 self
3026 }
3027
3028 /// Sets or clears the value of [logical_view][crate::model::CreateLogicalViewRequest::logical_view].
3029 ///
3030 /// # Example
3031 /// ```ignore,no_run
3032 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
3033 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
3034 /// let x = CreateLogicalViewRequest::new().set_or_clear_logical_view(Some(LogicalView::default()/* use setters */));
3035 /// let x = CreateLogicalViewRequest::new().set_or_clear_logical_view(None::<LogicalView>);
3036 /// ```
3037 pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
3038 where
3039 T: std::convert::Into<crate::model::LogicalView>,
3040 {
3041 self.logical_view = v.map(|x| x.into());
3042 self
3043 }
3044}
3045
3046impl wkt::message::Message for CreateLogicalViewRequest {
3047 fn typename() -> &'static str {
3048 "type.googleapis.com/google.bigtable.admin.v2.CreateLogicalViewRequest"
3049 }
3050}
3051
3052/// The metadata for the Operation returned by CreateLogicalView.
3053#[derive(Clone, Default, PartialEq)]
3054#[non_exhaustive]
3055pub struct CreateLogicalViewMetadata {
3056 /// The request that prompted the initiation of this CreateLogicalView
3057 /// operation.
3058 pub original_request: std::option::Option<crate::model::CreateLogicalViewRequest>,
3059
3060 /// The time at which this operation started.
3061 pub start_time: std::option::Option<wkt::Timestamp>,
3062
3063 /// If set, the time at which this operation finished or was canceled.
3064 pub end_time: std::option::Option<wkt::Timestamp>,
3065
3066 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3067}
3068
3069impl CreateLogicalViewMetadata {
3070 /// Creates a new default instance.
3071 pub fn new() -> Self {
3072 std::default::Default::default()
3073 }
3074
3075 /// Sets the value of [original_request][crate::model::CreateLogicalViewMetadata::original_request].
3076 ///
3077 /// # Example
3078 /// ```ignore,no_run
3079 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
3080 /// use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
3081 /// let x = CreateLogicalViewMetadata::new().set_original_request(CreateLogicalViewRequest::default()/* use setters */);
3082 /// ```
3083 pub fn set_original_request<T>(mut self, v: T) -> Self
3084 where
3085 T: std::convert::Into<crate::model::CreateLogicalViewRequest>,
3086 {
3087 self.original_request = std::option::Option::Some(v.into());
3088 self
3089 }
3090
3091 /// Sets or clears the value of [original_request][crate::model::CreateLogicalViewMetadata::original_request].
3092 ///
3093 /// # Example
3094 /// ```ignore,no_run
3095 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
3096 /// use google_cloud_bigtable_admin_v2::model::CreateLogicalViewRequest;
3097 /// let x = CreateLogicalViewMetadata::new().set_or_clear_original_request(Some(CreateLogicalViewRequest::default()/* use setters */));
3098 /// let x = CreateLogicalViewMetadata::new().set_or_clear_original_request(None::<CreateLogicalViewRequest>);
3099 /// ```
3100 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
3101 where
3102 T: std::convert::Into<crate::model::CreateLogicalViewRequest>,
3103 {
3104 self.original_request = v.map(|x| x.into());
3105 self
3106 }
3107
3108 /// Sets the value of [start_time][crate::model::CreateLogicalViewMetadata::start_time].
3109 ///
3110 /// # Example
3111 /// ```ignore,no_run
3112 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
3113 /// use wkt::Timestamp;
3114 /// let x = CreateLogicalViewMetadata::new().set_start_time(Timestamp::default()/* use setters */);
3115 /// ```
3116 pub fn set_start_time<T>(mut self, v: T) -> Self
3117 where
3118 T: std::convert::Into<wkt::Timestamp>,
3119 {
3120 self.start_time = std::option::Option::Some(v.into());
3121 self
3122 }
3123
3124 /// Sets or clears the value of [start_time][crate::model::CreateLogicalViewMetadata::start_time].
3125 ///
3126 /// # Example
3127 /// ```ignore,no_run
3128 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
3129 /// use wkt::Timestamp;
3130 /// let x = CreateLogicalViewMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3131 /// let x = CreateLogicalViewMetadata::new().set_or_clear_start_time(None::<Timestamp>);
3132 /// ```
3133 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3134 where
3135 T: std::convert::Into<wkt::Timestamp>,
3136 {
3137 self.start_time = v.map(|x| x.into());
3138 self
3139 }
3140
3141 /// Sets the value of [end_time][crate::model::CreateLogicalViewMetadata::end_time].
3142 ///
3143 /// # Example
3144 /// ```ignore,no_run
3145 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
3146 /// use wkt::Timestamp;
3147 /// let x = CreateLogicalViewMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3148 /// ```
3149 pub fn set_end_time<T>(mut self, v: T) -> Self
3150 where
3151 T: std::convert::Into<wkt::Timestamp>,
3152 {
3153 self.end_time = std::option::Option::Some(v.into());
3154 self
3155 }
3156
3157 /// Sets or clears the value of [end_time][crate::model::CreateLogicalViewMetadata::end_time].
3158 ///
3159 /// # Example
3160 /// ```ignore,no_run
3161 /// # use google_cloud_bigtable_admin_v2::model::CreateLogicalViewMetadata;
3162 /// use wkt::Timestamp;
3163 /// let x = CreateLogicalViewMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3164 /// let x = CreateLogicalViewMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3165 /// ```
3166 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3167 where
3168 T: std::convert::Into<wkt::Timestamp>,
3169 {
3170 self.end_time = v.map(|x| x.into());
3171 self
3172 }
3173}
3174
3175impl wkt::message::Message for CreateLogicalViewMetadata {
3176 fn typename() -> &'static str {
3177 "type.googleapis.com/google.bigtable.admin.v2.CreateLogicalViewMetadata"
3178 }
3179}
3180
3181/// Request message for BigtableInstanceAdmin.GetLogicalView.
3182#[derive(Clone, Default, PartialEq)]
3183#[non_exhaustive]
3184pub struct GetLogicalViewRequest {
3185 /// Required. The unique name of the requested logical view. Values are of the
3186 /// form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
3187 pub name: std::string::String,
3188
3189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3190}
3191
3192impl GetLogicalViewRequest {
3193 /// Creates a new default instance.
3194 pub fn new() -> Self {
3195 std::default::Default::default()
3196 }
3197
3198 /// Sets the value of [name][crate::model::GetLogicalViewRequest::name].
3199 ///
3200 /// # Example
3201 /// ```ignore,no_run
3202 /// # use google_cloud_bigtable_admin_v2::model::GetLogicalViewRequest;
3203 /// # let project_id = "project_id";
3204 /// # let instance_id = "instance_id";
3205 /// # let logical_view_id = "logical_view_id";
3206 /// let x = GetLogicalViewRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/logicalViews/{logical_view_id}"));
3207 /// ```
3208 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3209 self.name = v.into();
3210 self
3211 }
3212}
3213
3214impl wkt::message::Message for GetLogicalViewRequest {
3215 fn typename() -> &'static str {
3216 "type.googleapis.com/google.bigtable.admin.v2.GetLogicalViewRequest"
3217 }
3218}
3219
3220/// Request message for BigtableInstanceAdmin.ListLogicalViews.
3221#[derive(Clone, Default, PartialEq)]
3222#[non_exhaustive]
3223pub struct ListLogicalViewsRequest {
3224 /// Required. The unique name of the instance for which the list of logical
3225 /// views is requested. Values are of the form
3226 /// `projects/{project}/instances/{instance}`.
3227 pub parent: std::string::String,
3228
3229 /// Optional. The maximum number of logical views to return. The service may
3230 /// return fewer than this value
3231 pub page_size: i32,
3232
3233 /// Optional. A page token, received from a previous `ListLogicalViews` call.
3234 /// Provide this to retrieve the subsequent page.
3235 ///
3236 /// When paginating, all other parameters provided to `ListLogicalViews` must
3237 /// match the call that provided the page token.
3238 pub page_token: std::string::String,
3239
3240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3241}
3242
3243impl ListLogicalViewsRequest {
3244 /// Creates a new default instance.
3245 pub fn new() -> Self {
3246 std::default::Default::default()
3247 }
3248
3249 /// Sets the value of [parent][crate::model::ListLogicalViewsRequest::parent].
3250 ///
3251 /// # Example
3252 /// ```ignore,no_run
3253 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsRequest;
3254 /// # let project_id = "project_id";
3255 /// # let instance_id = "instance_id";
3256 /// let x = ListLogicalViewsRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
3257 /// ```
3258 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3259 self.parent = v.into();
3260 self
3261 }
3262
3263 /// Sets the value of [page_size][crate::model::ListLogicalViewsRequest::page_size].
3264 ///
3265 /// # Example
3266 /// ```ignore,no_run
3267 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsRequest;
3268 /// let x = ListLogicalViewsRequest::new().set_page_size(42);
3269 /// ```
3270 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3271 self.page_size = v.into();
3272 self
3273 }
3274
3275 /// Sets the value of [page_token][crate::model::ListLogicalViewsRequest::page_token].
3276 ///
3277 /// # Example
3278 /// ```ignore,no_run
3279 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsRequest;
3280 /// let x = ListLogicalViewsRequest::new().set_page_token("example");
3281 /// ```
3282 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3283 self.page_token = v.into();
3284 self
3285 }
3286}
3287
3288impl wkt::message::Message for ListLogicalViewsRequest {
3289 fn typename() -> &'static str {
3290 "type.googleapis.com/google.bigtable.admin.v2.ListLogicalViewsRequest"
3291 }
3292}
3293
3294/// Response message for BigtableInstanceAdmin.ListLogicalViews.
3295#[derive(Clone, Default, PartialEq)]
3296#[non_exhaustive]
3297pub struct ListLogicalViewsResponse {
3298 /// The list of requested logical views.
3299 pub logical_views: std::vec::Vec<crate::model::LogicalView>,
3300
3301 /// A token, which can be sent as `page_token` to retrieve the next page.
3302 /// If this field is omitted, there are no subsequent pages.
3303 pub next_page_token: std::string::String,
3304
3305 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3306}
3307
3308impl ListLogicalViewsResponse {
3309 /// Creates a new default instance.
3310 pub fn new() -> Self {
3311 std::default::Default::default()
3312 }
3313
3314 /// Sets the value of [logical_views][crate::model::ListLogicalViewsResponse::logical_views].
3315 ///
3316 /// # Example
3317 /// ```ignore,no_run
3318 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsResponse;
3319 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
3320 /// let x = ListLogicalViewsResponse::new()
3321 /// .set_logical_views([
3322 /// LogicalView::default()/* use setters */,
3323 /// LogicalView::default()/* use (different) setters */,
3324 /// ]);
3325 /// ```
3326 pub fn set_logical_views<T, V>(mut self, v: T) -> Self
3327 where
3328 T: std::iter::IntoIterator<Item = V>,
3329 V: std::convert::Into<crate::model::LogicalView>,
3330 {
3331 use std::iter::Iterator;
3332 self.logical_views = v.into_iter().map(|i| i.into()).collect();
3333 self
3334 }
3335
3336 /// Sets the value of [next_page_token][crate::model::ListLogicalViewsResponse::next_page_token].
3337 ///
3338 /// # Example
3339 /// ```ignore,no_run
3340 /// # use google_cloud_bigtable_admin_v2::model::ListLogicalViewsResponse;
3341 /// let x = ListLogicalViewsResponse::new().set_next_page_token("example");
3342 /// ```
3343 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3344 self.next_page_token = v.into();
3345 self
3346 }
3347}
3348
3349impl wkt::message::Message for ListLogicalViewsResponse {
3350 fn typename() -> &'static str {
3351 "type.googleapis.com/google.bigtable.admin.v2.ListLogicalViewsResponse"
3352 }
3353}
3354
3355#[doc(hidden)]
3356impl google_cloud_gax::paginator::internal::PageableResponse for ListLogicalViewsResponse {
3357 type PageItem = crate::model::LogicalView;
3358
3359 fn items(self) -> std::vec::Vec<Self::PageItem> {
3360 self.logical_views
3361 }
3362
3363 fn next_page_token(&self) -> std::string::String {
3364 use std::clone::Clone;
3365 self.next_page_token.clone()
3366 }
3367}
3368
3369/// Request message for BigtableInstanceAdmin.UpdateLogicalView.
3370#[derive(Clone, Default, PartialEq)]
3371#[non_exhaustive]
3372pub struct UpdateLogicalViewRequest {
3373 /// Required. The logical view to update.
3374 ///
3375 /// The logical view's `name` field is used to identify the view to update.
3376 /// Format:
3377 /// `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
3378 pub logical_view: std::option::Option<crate::model::LogicalView>,
3379
3380 /// Optional. The list of fields to update.
3381 pub update_mask: std::option::Option<wkt::FieldMask>,
3382
3383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3384}
3385
3386impl UpdateLogicalViewRequest {
3387 /// Creates a new default instance.
3388 pub fn new() -> Self {
3389 std::default::Default::default()
3390 }
3391
3392 /// Sets the value of [logical_view][crate::model::UpdateLogicalViewRequest::logical_view].
3393 ///
3394 /// # Example
3395 /// ```ignore,no_run
3396 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
3397 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
3398 /// let x = UpdateLogicalViewRequest::new().set_logical_view(LogicalView::default()/* use setters */);
3399 /// ```
3400 pub fn set_logical_view<T>(mut self, v: T) -> Self
3401 where
3402 T: std::convert::Into<crate::model::LogicalView>,
3403 {
3404 self.logical_view = std::option::Option::Some(v.into());
3405 self
3406 }
3407
3408 /// Sets or clears the value of [logical_view][crate::model::UpdateLogicalViewRequest::logical_view].
3409 ///
3410 /// # Example
3411 /// ```ignore,no_run
3412 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
3413 /// use google_cloud_bigtable_admin_v2::model::LogicalView;
3414 /// let x = UpdateLogicalViewRequest::new().set_or_clear_logical_view(Some(LogicalView::default()/* use setters */));
3415 /// let x = UpdateLogicalViewRequest::new().set_or_clear_logical_view(None::<LogicalView>);
3416 /// ```
3417 pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
3418 where
3419 T: std::convert::Into<crate::model::LogicalView>,
3420 {
3421 self.logical_view = v.map(|x| x.into());
3422 self
3423 }
3424
3425 /// Sets the value of [update_mask][crate::model::UpdateLogicalViewRequest::update_mask].
3426 ///
3427 /// # Example
3428 /// ```ignore,no_run
3429 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
3430 /// use wkt::FieldMask;
3431 /// let x = UpdateLogicalViewRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3432 /// ```
3433 pub fn set_update_mask<T>(mut self, v: T) -> Self
3434 where
3435 T: std::convert::Into<wkt::FieldMask>,
3436 {
3437 self.update_mask = std::option::Option::Some(v.into());
3438 self
3439 }
3440
3441 /// Sets or clears the value of [update_mask][crate::model::UpdateLogicalViewRequest::update_mask].
3442 ///
3443 /// # Example
3444 /// ```ignore,no_run
3445 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
3446 /// use wkt::FieldMask;
3447 /// let x = UpdateLogicalViewRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3448 /// let x = UpdateLogicalViewRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3449 /// ```
3450 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3451 where
3452 T: std::convert::Into<wkt::FieldMask>,
3453 {
3454 self.update_mask = v.map(|x| x.into());
3455 self
3456 }
3457}
3458
3459impl wkt::message::Message for UpdateLogicalViewRequest {
3460 fn typename() -> &'static str {
3461 "type.googleapis.com/google.bigtable.admin.v2.UpdateLogicalViewRequest"
3462 }
3463}
3464
3465/// The metadata for the Operation returned by UpdateLogicalView.
3466#[derive(Clone, Default, PartialEq)]
3467#[non_exhaustive]
3468pub struct UpdateLogicalViewMetadata {
3469 /// The request that prompted the initiation of this UpdateLogicalView
3470 /// operation.
3471 pub original_request: std::option::Option<crate::model::UpdateLogicalViewRequest>,
3472
3473 /// The time at which this operation was started.
3474 pub start_time: std::option::Option<wkt::Timestamp>,
3475
3476 /// If set, the time at which this operation finished or was canceled.
3477 pub end_time: std::option::Option<wkt::Timestamp>,
3478
3479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3480}
3481
3482impl UpdateLogicalViewMetadata {
3483 /// Creates a new default instance.
3484 pub fn new() -> Self {
3485 std::default::Default::default()
3486 }
3487
3488 /// Sets the value of [original_request][crate::model::UpdateLogicalViewMetadata::original_request].
3489 ///
3490 /// # Example
3491 /// ```ignore,no_run
3492 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3493 /// use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
3494 /// let x = UpdateLogicalViewMetadata::new().set_original_request(UpdateLogicalViewRequest::default()/* use setters */);
3495 /// ```
3496 pub fn set_original_request<T>(mut self, v: T) -> Self
3497 where
3498 T: std::convert::Into<crate::model::UpdateLogicalViewRequest>,
3499 {
3500 self.original_request = std::option::Option::Some(v.into());
3501 self
3502 }
3503
3504 /// Sets or clears the value of [original_request][crate::model::UpdateLogicalViewMetadata::original_request].
3505 ///
3506 /// # Example
3507 /// ```ignore,no_run
3508 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3509 /// use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewRequest;
3510 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_original_request(Some(UpdateLogicalViewRequest::default()/* use setters */));
3511 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_original_request(None::<UpdateLogicalViewRequest>);
3512 /// ```
3513 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
3514 where
3515 T: std::convert::Into<crate::model::UpdateLogicalViewRequest>,
3516 {
3517 self.original_request = v.map(|x| x.into());
3518 self
3519 }
3520
3521 /// Sets the value of [start_time][crate::model::UpdateLogicalViewMetadata::start_time].
3522 ///
3523 /// # Example
3524 /// ```ignore,no_run
3525 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3526 /// use wkt::Timestamp;
3527 /// let x = UpdateLogicalViewMetadata::new().set_start_time(Timestamp::default()/* use setters */);
3528 /// ```
3529 pub fn set_start_time<T>(mut self, v: T) -> Self
3530 where
3531 T: std::convert::Into<wkt::Timestamp>,
3532 {
3533 self.start_time = std::option::Option::Some(v.into());
3534 self
3535 }
3536
3537 /// Sets or clears the value of [start_time][crate::model::UpdateLogicalViewMetadata::start_time].
3538 ///
3539 /// # Example
3540 /// ```ignore,no_run
3541 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3542 /// use wkt::Timestamp;
3543 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3544 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_start_time(None::<Timestamp>);
3545 /// ```
3546 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3547 where
3548 T: std::convert::Into<wkt::Timestamp>,
3549 {
3550 self.start_time = v.map(|x| x.into());
3551 self
3552 }
3553
3554 /// Sets the value of [end_time][crate::model::UpdateLogicalViewMetadata::end_time].
3555 ///
3556 /// # Example
3557 /// ```ignore,no_run
3558 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3559 /// use wkt::Timestamp;
3560 /// let x = UpdateLogicalViewMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3561 /// ```
3562 pub fn set_end_time<T>(mut self, v: T) -> Self
3563 where
3564 T: std::convert::Into<wkt::Timestamp>,
3565 {
3566 self.end_time = std::option::Option::Some(v.into());
3567 self
3568 }
3569
3570 /// Sets or clears the value of [end_time][crate::model::UpdateLogicalViewMetadata::end_time].
3571 ///
3572 /// # Example
3573 /// ```ignore,no_run
3574 /// # use google_cloud_bigtable_admin_v2::model::UpdateLogicalViewMetadata;
3575 /// use wkt::Timestamp;
3576 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3577 /// let x = UpdateLogicalViewMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3578 /// ```
3579 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3580 where
3581 T: std::convert::Into<wkt::Timestamp>,
3582 {
3583 self.end_time = v.map(|x| x.into());
3584 self
3585 }
3586}
3587
3588impl wkt::message::Message for UpdateLogicalViewMetadata {
3589 fn typename() -> &'static str {
3590 "type.googleapis.com/google.bigtable.admin.v2.UpdateLogicalViewMetadata"
3591 }
3592}
3593
3594/// Request message for BigtableInstanceAdmin.DeleteLogicalView.
3595#[derive(Clone, Default, PartialEq)]
3596#[non_exhaustive]
3597pub struct DeleteLogicalViewRequest {
3598 /// Required. The unique name of the logical view to be deleted.
3599 /// Format:
3600 /// `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
3601 pub name: std::string::String,
3602
3603 /// Optional. The current etag of the logical view.
3604 /// If an etag is provided and does not match the current etag of the
3605 /// logical view, deletion will be blocked and an ABORTED error will be
3606 /// returned.
3607 pub etag: std::string::String,
3608
3609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3610}
3611
3612impl DeleteLogicalViewRequest {
3613 /// Creates a new default instance.
3614 pub fn new() -> Self {
3615 std::default::Default::default()
3616 }
3617
3618 /// Sets the value of [name][crate::model::DeleteLogicalViewRequest::name].
3619 ///
3620 /// # Example
3621 /// ```ignore,no_run
3622 /// # use google_cloud_bigtable_admin_v2::model::DeleteLogicalViewRequest;
3623 /// # let project_id = "project_id";
3624 /// # let instance_id = "instance_id";
3625 /// # let logical_view_id = "logical_view_id";
3626 /// let x = DeleteLogicalViewRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/logicalViews/{logical_view_id}"));
3627 /// ```
3628 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3629 self.name = v.into();
3630 self
3631 }
3632
3633 /// Sets the value of [etag][crate::model::DeleteLogicalViewRequest::etag].
3634 ///
3635 /// # Example
3636 /// ```ignore,no_run
3637 /// # use google_cloud_bigtable_admin_v2::model::DeleteLogicalViewRequest;
3638 /// let x = DeleteLogicalViewRequest::new().set_etag("example");
3639 /// ```
3640 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3641 self.etag = v.into();
3642 self
3643 }
3644}
3645
3646impl wkt::message::Message for DeleteLogicalViewRequest {
3647 fn typename() -> &'static str {
3648 "type.googleapis.com/google.bigtable.admin.v2.DeleteLogicalViewRequest"
3649 }
3650}
3651
3652/// Request message for BigtableInstanceAdmin.CreateMaterializedView.
3653#[derive(Clone, Default, PartialEq)]
3654#[non_exhaustive]
3655pub struct CreateMaterializedViewRequest {
3656 /// Required. The parent instance where this materialized view will be created.
3657 /// Format: `projects/{project}/instances/{instance}`.
3658 pub parent: std::string::String,
3659
3660 /// Required. The ID to use for the materialized view, which will become the
3661 /// final component of the materialized view's resource name.
3662 pub materialized_view_id: std::string::String,
3663
3664 /// Required. The materialized view to create.
3665 pub materialized_view: std::option::Option<crate::model::MaterializedView>,
3666
3667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3668}
3669
3670impl CreateMaterializedViewRequest {
3671 /// Creates a new default instance.
3672 pub fn new() -> Self {
3673 std::default::Default::default()
3674 }
3675
3676 /// Sets the value of [parent][crate::model::CreateMaterializedViewRequest::parent].
3677 ///
3678 /// # Example
3679 /// ```ignore,no_run
3680 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3681 /// # let project_id = "project_id";
3682 /// # let instance_id = "instance_id";
3683 /// let x = CreateMaterializedViewRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
3684 /// ```
3685 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3686 self.parent = v.into();
3687 self
3688 }
3689
3690 /// Sets the value of [materialized_view_id][crate::model::CreateMaterializedViewRequest::materialized_view_id].
3691 ///
3692 /// # Example
3693 /// ```ignore,no_run
3694 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3695 /// let x = CreateMaterializedViewRequest::new().set_materialized_view_id("example");
3696 /// ```
3697 pub fn set_materialized_view_id<T: std::convert::Into<std::string::String>>(
3698 mut self,
3699 v: T,
3700 ) -> Self {
3701 self.materialized_view_id = v.into();
3702 self
3703 }
3704
3705 /// Sets the value of [materialized_view][crate::model::CreateMaterializedViewRequest::materialized_view].
3706 ///
3707 /// # Example
3708 /// ```ignore,no_run
3709 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3710 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
3711 /// let x = CreateMaterializedViewRequest::new().set_materialized_view(MaterializedView::default()/* use setters */);
3712 /// ```
3713 pub fn set_materialized_view<T>(mut self, v: T) -> Self
3714 where
3715 T: std::convert::Into<crate::model::MaterializedView>,
3716 {
3717 self.materialized_view = std::option::Option::Some(v.into());
3718 self
3719 }
3720
3721 /// Sets or clears the value of [materialized_view][crate::model::CreateMaterializedViewRequest::materialized_view].
3722 ///
3723 /// # Example
3724 /// ```ignore,no_run
3725 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3726 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
3727 /// let x = CreateMaterializedViewRequest::new().set_or_clear_materialized_view(Some(MaterializedView::default()/* use setters */));
3728 /// let x = CreateMaterializedViewRequest::new().set_or_clear_materialized_view(None::<MaterializedView>);
3729 /// ```
3730 pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
3731 where
3732 T: std::convert::Into<crate::model::MaterializedView>,
3733 {
3734 self.materialized_view = v.map(|x| x.into());
3735 self
3736 }
3737}
3738
3739impl wkt::message::Message for CreateMaterializedViewRequest {
3740 fn typename() -> &'static str {
3741 "type.googleapis.com/google.bigtable.admin.v2.CreateMaterializedViewRequest"
3742 }
3743}
3744
3745/// The metadata for the Operation returned by CreateMaterializedView.
3746#[derive(Clone, Default, PartialEq)]
3747#[non_exhaustive]
3748pub struct CreateMaterializedViewMetadata {
3749 /// The request that prompted the initiation of this CreateMaterializedView
3750 /// operation.
3751 pub original_request: std::option::Option<crate::model::CreateMaterializedViewRequest>,
3752
3753 /// The time at which this operation started.
3754 pub start_time: std::option::Option<wkt::Timestamp>,
3755
3756 /// If set, the time at which this operation finished or was canceled.
3757 pub end_time: std::option::Option<wkt::Timestamp>,
3758
3759 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3760}
3761
3762impl CreateMaterializedViewMetadata {
3763 /// Creates a new default instance.
3764 pub fn new() -> Self {
3765 std::default::Default::default()
3766 }
3767
3768 /// Sets the value of [original_request][crate::model::CreateMaterializedViewMetadata::original_request].
3769 ///
3770 /// # Example
3771 /// ```ignore,no_run
3772 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3773 /// use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3774 /// let x = CreateMaterializedViewMetadata::new().set_original_request(CreateMaterializedViewRequest::default()/* use setters */);
3775 /// ```
3776 pub fn set_original_request<T>(mut self, v: T) -> Self
3777 where
3778 T: std::convert::Into<crate::model::CreateMaterializedViewRequest>,
3779 {
3780 self.original_request = std::option::Option::Some(v.into());
3781 self
3782 }
3783
3784 /// Sets or clears the value of [original_request][crate::model::CreateMaterializedViewMetadata::original_request].
3785 ///
3786 /// # Example
3787 /// ```ignore,no_run
3788 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3789 /// use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewRequest;
3790 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_original_request(Some(CreateMaterializedViewRequest::default()/* use setters */));
3791 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_original_request(None::<CreateMaterializedViewRequest>);
3792 /// ```
3793 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
3794 where
3795 T: std::convert::Into<crate::model::CreateMaterializedViewRequest>,
3796 {
3797 self.original_request = v.map(|x| x.into());
3798 self
3799 }
3800
3801 /// Sets the value of [start_time][crate::model::CreateMaterializedViewMetadata::start_time].
3802 ///
3803 /// # Example
3804 /// ```ignore,no_run
3805 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3806 /// use wkt::Timestamp;
3807 /// let x = CreateMaterializedViewMetadata::new().set_start_time(Timestamp::default()/* use setters */);
3808 /// ```
3809 pub fn set_start_time<T>(mut self, v: T) -> Self
3810 where
3811 T: std::convert::Into<wkt::Timestamp>,
3812 {
3813 self.start_time = std::option::Option::Some(v.into());
3814 self
3815 }
3816
3817 /// Sets or clears the value of [start_time][crate::model::CreateMaterializedViewMetadata::start_time].
3818 ///
3819 /// # Example
3820 /// ```ignore,no_run
3821 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3822 /// use wkt::Timestamp;
3823 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3824 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_start_time(None::<Timestamp>);
3825 /// ```
3826 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3827 where
3828 T: std::convert::Into<wkt::Timestamp>,
3829 {
3830 self.start_time = v.map(|x| x.into());
3831 self
3832 }
3833
3834 /// Sets the value of [end_time][crate::model::CreateMaterializedViewMetadata::end_time].
3835 ///
3836 /// # Example
3837 /// ```ignore,no_run
3838 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3839 /// use wkt::Timestamp;
3840 /// let x = CreateMaterializedViewMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3841 /// ```
3842 pub fn set_end_time<T>(mut self, v: T) -> Self
3843 where
3844 T: std::convert::Into<wkt::Timestamp>,
3845 {
3846 self.end_time = std::option::Option::Some(v.into());
3847 self
3848 }
3849
3850 /// Sets or clears the value of [end_time][crate::model::CreateMaterializedViewMetadata::end_time].
3851 ///
3852 /// # Example
3853 /// ```ignore,no_run
3854 /// # use google_cloud_bigtable_admin_v2::model::CreateMaterializedViewMetadata;
3855 /// use wkt::Timestamp;
3856 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3857 /// let x = CreateMaterializedViewMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3858 /// ```
3859 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3860 where
3861 T: std::convert::Into<wkt::Timestamp>,
3862 {
3863 self.end_time = v.map(|x| x.into());
3864 self
3865 }
3866}
3867
3868impl wkt::message::Message for CreateMaterializedViewMetadata {
3869 fn typename() -> &'static str {
3870 "type.googleapis.com/google.bigtable.admin.v2.CreateMaterializedViewMetadata"
3871 }
3872}
3873
3874/// Request message for BigtableInstanceAdmin.GetMaterializedView.
3875#[derive(Clone, Default, PartialEq)]
3876#[non_exhaustive]
3877pub struct GetMaterializedViewRequest {
3878 /// Required. The unique name of the requested materialized view. Values are of
3879 /// the form
3880 /// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
3881 pub name: std::string::String,
3882
3883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3884}
3885
3886impl GetMaterializedViewRequest {
3887 /// Creates a new default instance.
3888 pub fn new() -> Self {
3889 std::default::Default::default()
3890 }
3891
3892 /// Sets the value of [name][crate::model::GetMaterializedViewRequest::name].
3893 ///
3894 /// # Example
3895 /// ```ignore,no_run
3896 /// # use google_cloud_bigtable_admin_v2::model::GetMaterializedViewRequest;
3897 /// # let project_id = "project_id";
3898 /// # let instance_id = "instance_id";
3899 /// # let materialized_view_id = "materialized_view_id";
3900 /// let x = GetMaterializedViewRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/materializedViews/{materialized_view_id}"));
3901 /// ```
3902 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3903 self.name = v.into();
3904 self
3905 }
3906}
3907
3908impl wkt::message::Message for GetMaterializedViewRequest {
3909 fn typename() -> &'static str {
3910 "type.googleapis.com/google.bigtable.admin.v2.GetMaterializedViewRequest"
3911 }
3912}
3913
3914/// Request message for BigtableInstanceAdmin.ListMaterializedViews.
3915#[derive(Clone, Default, PartialEq)]
3916#[non_exhaustive]
3917pub struct ListMaterializedViewsRequest {
3918 /// Required. The unique name of the instance for which the list of
3919 /// materialized views is requested. Values are of the form
3920 /// `projects/{project}/instances/{instance}`.
3921 pub parent: std::string::String,
3922
3923 /// Optional. The maximum number of materialized views to return. The service
3924 /// may return fewer than this value
3925 pub page_size: i32,
3926
3927 /// Optional. A page token, received from a previous `ListMaterializedViews`
3928 /// call. Provide this to retrieve the subsequent page.
3929 ///
3930 /// When paginating, all other parameters provided to `ListMaterializedViews`
3931 /// must match the call that provided the page token.
3932 pub page_token: std::string::String,
3933
3934 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3935}
3936
3937impl ListMaterializedViewsRequest {
3938 /// Creates a new default instance.
3939 pub fn new() -> Self {
3940 std::default::Default::default()
3941 }
3942
3943 /// Sets the value of [parent][crate::model::ListMaterializedViewsRequest::parent].
3944 ///
3945 /// # Example
3946 /// ```ignore,no_run
3947 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsRequest;
3948 /// # let project_id = "project_id";
3949 /// # let instance_id = "instance_id";
3950 /// let x = ListMaterializedViewsRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
3951 /// ```
3952 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3953 self.parent = v.into();
3954 self
3955 }
3956
3957 /// Sets the value of [page_size][crate::model::ListMaterializedViewsRequest::page_size].
3958 ///
3959 /// # Example
3960 /// ```ignore,no_run
3961 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsRequest;
3962 /// let x = ListMaterializedViewsRequest::new().set_page_size(42);
3963 /// ```
3964 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3965 self.page_size = v.into();
3966 self
3967 }
3968
3969 /// Sets the value of [page_token][crate::model::ListMaterializedViewsRequest::page_token].
3970 ///
3971 /// # Example
3972 /// ```ignore,no_run
3973 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsRequest;
3974 /// let x = ListMaterializedViewsRequest::new().set_page_token("example");
3975 /// ```
3976 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3977 self.page_token = v.into();
3978 self
3979 }
3980}
3981
3982impl wkt::message::Message for ListMaterializedViewsRequest {
3983 fn typename() -> &'static str {
3984 "type.googleapis.com/google.bigtable.admin.v2.ListMaterializedViewsRequest"
3985 }
3986}
3987
3988/// Response message for BigtableInstanceAdmin.ListMaterializedViews.
3989#[derive(Clone, Default, PartialEq)]
3990#[non_exhaustive]
3991pub struct ListMaterializedViewsResponse {
3992 /// The list of requested materialized views.
3993 pub materialized_views: std::vec::Vec<crate::model::MaterializedView>,
3994
3995 /// A token, which can be sent as `page_token` to retrieve the next page.
3996 /// If this field is omitted, there are no subsequent pages.
3997 pub next_page_token: std::string::String,
3998
3999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4000}
4001
4002impl ListMaterializedViewsResponse {
4003 /// Creates a new default instance.
4004 pub fn new() -> Self {
4005 std::default::Default::default()
4006 }
4007
4008 /// Sets the value of [materialized_views][crate::model::ListMaterializedViewsResponse::materialized_views].
4009 ///
4010 /// # Example
4011 /// ```ignore,no_run
4012 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsResponse;
4013 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
4014 /// let x = ListMaterializedViewsResponse::new()
4015 /// .set_materialized_views([
4016 /// MaterializedView::default()/* use setters */,
4017 /// MaterializedView::default()/* use (different) setters */,
4018 /// ]);
4019 /// ```
4020 pub fn set_materialized_views<T, V>(mut self, v: T) -> Self
4021 where
4022 T: std::iter::IntoIterator<Item = V>,
4023 V: std::convert::Into<crate::model::MaterializedView>,
4024 {
4025 use std::iter::Iterator;
4026 self.materialized_views = v.into_iter().map(|i| i.into()).collect();
4027 self
4028 }
4029
4030 /// Sets the value of [next_page_token][crate::model::ListMaterializedViewsResponse::next_page_token].
4031 ///
4032 /// # Example
4033 /// ```ignore,no_run
4034 /// # use google_cloud_bigtable_admin_v2::model::ListMaterializedViewsResponse;
4035 /// let x = ListMaterializedViewsResponse::new().set_next_page_token("example");
4036 /// ```
4037 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4038 self.next_page_token = v.into();
4039 self
4040 }
4041}
4042
4043impl wkt::message::Message for ListMaterializedViewsResponse {
4044 fn typename() -> &'static str {
4045 "type.googleapis.com/google.bigtable.admin.v2.ListMaterializedViewsResponse"
4046 }
4047}
4048
4049#[doc(hidden)]
4050impl google_cloud_gax::paginator::internal::PageableResponse for ListMaterializedViewsResponse {
4051 type PageItem = crate::model::MaterializedView;
4052
4053 fn items(self) -> std::vec::Vec<Self::PageItem> {
4054 self.materialized_views
4055 }
4056
4057 fn next_page_token(&self) -> std::string::String {
4058 use std::clone::Clone;
4059 self.next_page_token.clone()
4060 }
4061}
4062
4063/// Request message for BigtableInstanceAdmin.UpdateMaterializedView.
4064#[derive(Clone, Default, PartialEq)]
4065#[non_exhaustive]
4066pub struct UpdateMaterializedViewRequest {
4067 /// Required. The materialized view to update.
4068 ///
4069 /// The materialized view's `name` field is used to identify the view to
4070 /// update. Format:
4071 /// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
4072 pub materialized_view: std::option::Option<crate::model::MaterializedView>,
4073
4074 /// Optional. The list of fields to update.
4075 pub update_mask: std::option::Option<wkt::FieldMask>,
4076
4077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4078}
4079
4080impl UpdateMaterializedViewRequest {
4081 /// Creates a new default instance.
4082 pub fn new() -> Self {
4083 std::default::Default::default()
4084 }
4085
4086 /// Sets the value of [materialized_view][crate::model::UpdateMaterializedViewRequest::materialized_view].
4087 ///
4088 /// # Example
4089 /// ```ignore,no_run
4090 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
4091 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
4092 /// let x = UpdateMaterializedViewRequest::new().set_materialized_view(MaterializedView::default()/* use setters */);
4093 /// ```
4094 pub fn set_materialized_view<T>(mut self, v: T) -> Self
4095 where
4096 T: std::convert::Into<crate::model::MaterializedView>,
4097 {
4098 self.materialized_view = std::option::Option::Some(v.into());
4099 self
4100 }
4101
4102 /// Sets or clears the value of [materialized_view][crate::model::UpdateMaterializedViewRequest::materialized_view].
4103 ///
4104 /// # Example
4105 /// ```ignore,no_run
4106 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
4107 /// use google_cloud_bigtable_admin_v2::model::MaterializedView;
4108 /// let x = UpdateMaterializedViewRequest::new().set_or_clear_materialized_view(Some(MaterializedView::default()/* use setters */));
4109 /// let x = UpdateMaterializedViewRequest::new().set_or_clear_materialized_view(None::<MaterializedView>);
4110 /// ```
4111 pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
4112 where
4113 T: std::convert::Into<crate::model::MaterializedView>,
4114 {
4115 self.materialized_view = v.map(|x| x.into());
4116 self
4117 }
4118
4119 /// Sets the value of [update_mask][crate::model::UpdateMaterializedViewRequest::update_mask].
4120 ///
4121 /// # Example
4122 /// ```ignore,no_run
4123 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
4124 /// use wkt::FieldMask;
4125 /// let x = UpdateMaterializedViewRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4126 /// ```
4127 pub fn set_update_mask<T>(mut self, v: T) -> Self
4128 where
4129 T: std::convert::Into<wkt::FieldMask>,
4130 {
4131 self.update_mask = std::option::Option::Some(v.into());
4132 self
4133 }
4134
4135 /// Sets or clears the value of [update_mask][crate::model::UpdateMaterializedViewRequest::update_mask].
4136 ///
4137 /// # Example
4138 /// ```ignore,no_run
4139 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
4140 /// use wkt::FieldMask;
4141 /// let x = UpdateMaterializedViewRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4142 /// let x = UpdateMaterializedViewRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4143 /// ```
4144 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4145 where
4146 T: std::convert::Into<wkt::FieldMask>,
4147 {
4148 self.update_mask = v.map(|x| x.into());
4149 self
4150 }
4151}
4152
4153impl wkt::message::Message for UpdateMaterializedViewRequest {
4154 fn typename() -> &'static str {
4155 "type.googleapis.com/google.bigtable.admin.v2.UpdateMaterializedViewRequest"
4156 }
4157}
4158
4159/// The metadata for the Operation returned by UpdateMaterializedView.
4160#[derive(Clone, Default, PartialEq)]
4161#[non_exhaustive]
4162pub struct UpdateMaterializedViewMetadata {
4163 /// The request that prompted the initiation of this UpdateMaterializedView
4164 /// operation.
4165 pub original_request: std::option::Option<crate::model::UpdateMaterializedViewRequest>,
4166
4167 /// The time at which this operation was started.
4168 pub start_time: std::option::Option<wkt::Timestamp>,
4169
4170 /// If set, the time at which this operation finished or was canceled.
4171 pub end_time: std::option::Option<wkt::Timestamp>,
4172
4173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4174}
4175
4176impl UpdateMaterializedViewMetadata {
4177 /// Creates a new default instance.
4178 pub fn new() -> Self {
4179 std::default::Default::default()
4180 }
4181
4182 /// Sets the value of [original_request][crate::model::UpdateMaterializedViewMetadata::original_request].
4183 ///
4184 /// # Example
4185 /// ```ignore,no_run
4186 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
4187 /// use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
4188 /// let x = UpdateMaterializedViewMetadata::new().set_original_request(UpdateMaterializedViewRequest::default()/* use setters */);
4189 /// ```
4190 pub fn set_original_request<T>(mut self, v: T) -> Self
4191 where
4192 T: std::convert::Into<crate::model::UpdateMaterializedViewRequest>,
4193 {
4194 self.original_request = std::option::Option::Some(v.into());
4195 self
4196 }
4197
4198 /// Sets or clears the value of [original_request][crate::model::UpdateMaterializedViewMetadata::original_request].
4199 ///
4200 /// # Example
4201 /// ```ignore,no_run
4202 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
4203 /// use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewRequest;
4204 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_original_request(Some(UpdateMaterializedViewRequest::default()/* use setters */));
4205 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_original_request(None::<UpdateMaterializedViewRequest>);
4206 /// ```
4207 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
4208 where
4209 T: std::convert::Into<crate::model::UpdateMaterializedViewRequest>,
4210 {
4211 self.original_request = v.map(|x| x.into());
4212 self
4213 }
4214
4215 /// Sets the value of [start_time][crate::model::UpdateMaterializedViewMetadata::start_time].
4216 ///
4217 /// # Example
4218 /// ```ignore,no_run
4219 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
4220 /// use wkt::Timestamp;
4221 /// let x = UpdateMaterializedViewMetadata::new().set_start_time(Timestamp::default()/* use setters */);
4222 /// ```
4223 pub fn set_start_time<T>(mut self, v: T) -> Self
4224 where
4225 T: std::convert::Into<wkt::Timestamp>,
4226 {
4227 self.start_time = std::option::Option::Some(v.into());
4228 self
4229 }
4230
4231 /// Sets or clears the value of [start_time][crate::model::UpdateMaterializedViewMetadata::start_time].
4232 ///
4233 /// # Example
4234 /// ```ignore,no_run
4235 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
4236 /// use wkt::Timestamp;
4237 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
4238 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_start_time(None::<Timestamp>);
4239 /// ```
4240 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
4241 where
4242 T: std::convert::Into<wkt::Timestamp>,
4243 {
4244 self.start_time = v.map(|x| x.into());
4245 self
4246 }
4247
4248 /// Sets the value of [end_time][crate::model::UpdateMaterializedViewMetadata::end_time].
4249 ///
4250 /// # Example
4251 /// ```ignore,no_run
4252 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
4253 /// use wkt::Timestamp;
4254 /// let x = UpdateMaterializedViewMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4255 /// ```
4256 pub fn set_end_time<T>(mut self, v: T) -> Self
4257 where
4258 T: std::convert::Into<wkt::Timestamp>,
4259 {
4260 self.end_time = std::option::Option::Some(v.into());
4261 self
4262 }
4263
4264 /// Sets or clears the value of [end_time][crate::model::UpdateMaterializedViewMetadata::end_time].
4265 ///
4266 /// # Example
4267 /// ```ignore,no_run
4268 /// # use google_cloud_bigtable_admin_v2::model::UpdateMaterializedViewMetadata;
4269 /// use wkt::Timestamp;
4270 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4271 /// let x = UpdateMaterializedViewMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4272 /// ```
4273 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4274 where
4275 T: std::convert::Into<wkt::Timestamp>,
4276 {
4277 self.end_time = v.map(|x| x.into());
4278 self
4279 }
4280}
4281
4282impl wkt::message::Message for UpdateMaterializedViewMetadata {
4283 fn typename() -> &'static str {
4284 "type.googleapis.com/google.bigtable.admin.v2.UpdateMaterializedViewMetadata"
4285 }
4286}
4287
4288/// Request message for BigtableInstanceAdmin.DeleteMaterializedView.
4289#[derive(Clone, Default, PartialEq)]
4290#[non_exhaustive]
4291pub struct DeleteMaterializedViewRequest {
4292 /// Required. The unique name of the materialized view to be deleted.
4293 /// Format:
4294 /// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
4295 pub name: std::string::String,
4296
4297 /// Optional. The current etag of the materialized view.
4298 /// If an etag is provided and does not match the current etag of the
4299 /// materialized view, deletion will be blocked and an ABORTED error will be
4300 /// returned.
4301 pub etag: std::string::String,
4302
4303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4304}
4305
4306impl DeleteMaterializedViewRequest {
4307 /// Creates a new default instance.
4308 pub fn new() -> Self {
4309 std::default::Default::default()
4310 }
4311
4312 /// Sets the value of [name][crate::model::DeleteMaterializedViewRequest::name].
4313 ///
4314 /// # Example
4315 /// ```ignore,no_run
4316 /// # use google_cloud_bigtable_admin_v2::model::DeleteMaterializedViewRequest;
4317 /// # let project_id = "project_id";
4318 /// # let instance_id = "instance_id";
4319 /// # let materialized_view_id = "materialized_view_id";
4320 /// let x = DeleteMaterializedViewRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/materializedViews/{materialized_view_id}"));
4321 /// ```
4322 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4323 self.name = v.into();
4324 self
4325 }
4326
4327 /// Sets the value of [etag][crate::model::DeleteMaterializedViewRequest::etag].
4328 ///
4329 /// # Example
4330 /// ```ignore,no_run
4331 /// # use google_cloud_bigtable_admin_v2::model::DeleteMaterializedViewRequest;
4332 /// let x = DeleteMaterializedViewRequest::new().set_etag("example");
4333 /// ```
4334 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4335 self.etag = v.into();
4336 self
4337 }
4338}
4339
4340impl wkt::message::Message for DeleteMaterializedViewRequest {
4341 fn typename() -> &'static str {
4342 "type.googleapis.com/google.bigtable.admin.v2.DeleteMaterializedViewRequest"
4343 }
4344}
4345
4346/// The request for
4347/// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
4348///
4349/// [google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]: crate::client::BigtableTableAdmin::restore_table
4350#[derive(Clone, Default, PartialEq)]
4351#[non_exhaustive]
4352pub struct RestoreTableRequest {
4353 /// Required. The name of the instance in which to create the restored
4354 /// table. Values are of the form `projects/<project>/instances/<instance>`.
4355 pub parent: std::string::String,
4356
4357 /// Required. The id of the table to create and restore to. This
4358 /// table must not already exist. The `table_id` appended to
4359 /// `parent` forms the full table name of the form
4360 /// `projects/<project>/instances/<instance>/tables/<table_id>`.
4361 pub table_id: std::string::String,
4362
4363 /// Required. The source from which to restore.
4364 pub source: std::option::Option<crate::model::restore_table_request::Source>,
4365
4366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4367}
4368
4369impl RestoreTableRequest {
4370 /// Creates a new default instance.
4371 pub fn new() -> Self {
4372 std::default::Default::default()
4373 }
4374
4375 /// Sets the value of [parent][crate::model::RestoreTableRequest::parent].
4376 ///
4377 /// # Example
4378 /// ```ignore,no_run
4379 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableRequest;
4380 /// # let project_id = "project_id";
4381 /// # let instance_id = "instance_id";
4382 /// let x = RestoreTableRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
4383 /// ```
4384 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4385 self.parent = v.into();
4386 self
4387 }
4388
4389 /// Sets the value of [table_id][crate::model::RestoreTableRequest::table_id].
4390 ///
4391 /// # Example
4392 /// ```ignore,no_run
4393 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableRequest;
4394 /// let x = RestoreTableRequest::new().set_table_id("example");
4395 /// ```
4396 pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4397 self.table_id = v.into();
4398 self
4399 }
4400
4401 /// Sets the value of [source][crate::model::RestoreTableRequest::source].
4402 ///
4403 /// Note that all the setters affecting `source` are mutually
4404 /// exclusive.
4405 ///
4406 /// # Example
4407 /// ```ignore,no_run
4408 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableRequest;
4409 /// use google_cloud_bigtable_admin_v2::model::restore_table_request::Source;
4410 /// let x = RestoreTableRequest::new().set_source(Some(Source::Backup("example".to_string())));
4411 /// ```
4412 pub fn set_source<
4413 T: std::convert::Into<std::option::Option<crate::model::restore_table_request::Source>>,
4414 >(
4415 mut self,
4416 v: T,
4417 ) -> Self {
4418 self.source = v.into();
4419 self
4420 }
4421
4422 /// The value of [source][crate::model::RestoreTableRequest::source]
4423 /// if it holds a `Backup`, `None` if the field is not set or
4424 /// holds a different branch.
4425 pub fn backup(&self) -> std::option::Option<&std::string::String> {
4426 #[allow(unreachable_patterns)]
4427 self.source.as_ref().and_then(|v| match v {
4428 crate::model::restore_table_request::Source::Backup(v) => std::option::Option::Some(v),
4429 _ => std::option::Option::None,
4430 })
4431 }
4432
4433 /// Sets the value of [source][crate::model::RestoreTableRequest::source]
4434 /// to hold a `Backup`.
4435 ///
4436 /// Note that all the setters affecting `source` are
4437 /// mutually exclusive.
4438 ///
4439 /// # Example
4440 /// ```ignore,no_run
4441 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableRequest;
4442 /// # let project_id = "project_id";
4443 /// # let instance_id = "instance_id";
4444 /// # let cluster_id = "cluster_id";
4445 /// # let backup_id = "backup_id";
4446 /// let x = RestoreTableRequest::new().set_backup(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"));
4447 /// assert!(x.backup().is_some());
4448 /// ```
4449 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4450 self.source = std::option::Option::Some(
4451 crate::model::restore_table_request::Source::Backup(v.into()),
4452 );
4453 self
4454 }
4455}
4456
4457impl wkt::message::Message for RestoreTableRequest {
4458 fn typename() -> &'static str {
4459 "type.googleapis.com/google.bigtable.admin.v2.RestoreTableRequest"
4460 }
4461}
4462
4463/// Defines additional types related to [RestoreTableRequest].
4464pub mod restore_table_request {
4465 #[allow(unused_imports)]
4466 use super::*;
4467
4468 /// Required. The source from which to restore.
4469 #[derive(Clone, Debug, PartialEq)]
4470 #[non_exhaustive]
4471 pub enum Source {
4472 /// Name of the backup from which to restore. Values are of the form
4473 /// `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
4474 Backup(std::string::String),
4475 }
4476}
4477
4478/// Metadata type for the long-running operation returned by
4479/// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
4480///
4481/// [google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]: crate::client::BigtableTableAdmin::restore_table
4482#[derive(Clone, Default, PartialEq)]
4483#[non_exhaustive]
4484pub struct RestoreTableMetadata {
4485 /// Name of the table being created and restored to.
4486 pub name: std::string::String,
4487
4488 /// The type of the restore source.
4489 pub source_type: crate::model::RestoreSourceType,
4490
4491 /// If exists, the name of the long-running operation that will be used to
4492 /// track the post-restore optimization process to optimize the performance of
4493 /// the restored table. The metadata type of the long-running operation is
4494 /// [OptimizeRestoreTableMetadata][]. The response type is
4495 /// [Empty][google.protobuf.Empty]. This long-running operation may be
4496 /// automatically created by the system if applicable after the
4497 /// RestoreTable long-running operation completes successfully. This operation
4498 /// may not be created if the table is already optimized or the restore was
4499 /// not successful.
4500 pub optimize_table_operation_name: std::string::String,
4501
4502 /// The progress of the
4503 /// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
4504 /// operation.
4505 ///
4506 /// [google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]: crate::client::BigtableTableAdmin::restore_table
4507 pub progress: std::option::Option<crate::model::OperationProgress>,
4508
4509 /// Information about the source used to restore the table, as specified by
4510 /// `source` in
4511 /// [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest].
4512 ///
4513 /// [google.bigtable.admin.v2.RestoreTableRequest]: crate::model::RestoreTableRequest
4514 pub source_info: std::option::Option<crate::model::restore_table_metadata::SourceInfo>,
4515
4516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4517}
4518
4519impl RestoreTableMetadata {
4520 /// Creates a new default instance.
4521 pub fn new() -> Self {
4522 std::default::Default::default()
4523 }
4524
4525 /// Sets the value of [name][crate::model::RestoreTableMetadata::name].
4526 ///
4527 /// # Example
4528 /// ```ignore,no_run
4529 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4530 /// let x = RestoreTableMetadata::new().set_name("example");
4531 /// ```
4532 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4533 self.name = v.into();
4534 self
4535 }
4536
4537 /// Sets the value of [source_type][crate::model::RestoreTableMetadata::source_type].
4538 ///
4539 /// # Example
4540 /// ```ignore,no_run
4541 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4542 /// use google_cloud_bigtable_admin_v2::model::RestoreSourceType;
4543 /// let x0 = RestoreTableMetadata::new().set_source_type(RestoreSourceType::Backup);
4544 /// ```
4545 pub fn set_source_type<T: std::convert::Into<crate::model::RestoreSourceType>>(
4546 mut self,
4547 v: T,
4548 ) -> Self {
4549 self.source_type = v.into();
4550 self
4551 }
4552
4553 /// Sets the value of [optimize_table_operation_name][crate::model::RestoreTableMetadata::optimize_table_operation_name].
4554 ///
4555 /// # Example
4556 /// ```ignore,no_run
4557 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4558 /// let x = RestoreTableMetadata::new().set_optimize_table_operation_name("example");
4559 /// ```
4560 pub fn set_optimize_table_operation_name<T: std::convert::Into<std::string::String>>(
4561 mut self,
4562 v: T,
4563 ) -> Self {
4564 self.optimize_table_operation_name = v.into();
4565 self
4566 }
4567
4568 /// Sets the value of [progress][crate::model::RestoreTableMetadata::progress].
4569 ///
4570 /// # Example
4571 /// ```ignore,no_run
4572 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4573 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
4574 /// let x = RestoreTableMetadata::new().set_progress(OperationProgress::default()/* use setters */);
4575 /// ```
4576 pub fn set_progress<T>(mut self, v: T) -> Self
4577 where
4578 T: std::convert::Into<crate::model::OperationProgress>,
4579 {
4580 self.progress = std::option::Option::Some(v.into());
4581 self
4582 }
4583
4584 /// Sets or clears the value of [progress][crate::model::RestoreTableMetadata::progress].
4585 ///
4586 /// # Example
4587 /// ```ignore,no_run
4588 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4589 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
4590 /// let x = RestoreTableMetadata::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
4591 /// let x = RestoreTableMetadata::new().set_or_clear_progress(None::<OperationProgress>);
4592 /// ```
4593 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
4594 where
4595 T: std::convert::Into<crate::model::OperationProgress>,
4596 {
4597 self.progress = v.map(|x| x.into());
4598 self
4599 }
4600
4601 /// Sets the value of [source_info][crate::model::RestoreTableMetadata::source_info].
4602 ///
4603 /// Note that all the setters affecting `source_info` are mutually
4604 /// exclusive.
4605 ///
4606 /// # Example
4607 /// ```ignore,no_run
4608 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4609 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
4610 /// let x = RestoreTableMetadata::new().set_source_info(Some(
4611 /// google_cloud_bigtable_admin_v2::model::restore_table_metadata::SourceInfo::BackupInfo(BackupInfo::default().into())));
4612 /// ```
4613 pub fn set_source_info<
4614 T: std::convert::Into<std::option::Option<crate::model::restore_table_metadata::SourceInfo>>,
4615 >(
4616 mut self,
4617 v: T,
4618 ) -> Self {
4619 self.source_info = v.into();
4620 self
4621 }
4622
4623 /// The value of [source_info][crate::model::RestoreTableMetadata::source_info]
4624 /// if it holds a `BackupInfo`, `None` if the field is not set or
4625 /// holds a different branch.
4626 pub fn backup_info(&self) -> std::option::Option<&std::boxed::Box<crate::model::BackupInfo>> {
4627 #[allow(unreachable_patterns)]
4628 self.source_info.as_ref().and_then(|v| match v {
4629 crate::model::restore_table_metadata::SourceInfo::BackupInfo(v) => {
4630 std::option::Option::Some(v)
4631 }
4632 _ => std::option::Option::None,
4633 })
4634 }
4635
4636 /// Sets the value of [source_info][crate::model::RestoreTableMetadata::source_info]
4637 /// to hold a `BackupInfo`.
4638 ///
4639 /// Note that all the setters affecting `source_info` are
4640 /// mutually exclusive.
4641 ///
4642 /// # Example
4643 /// ```ignore,no_run
4644 /// # use google_cloud_bigtable_admin_v2::model::RestoreTableMetadata;
4645 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
4646 /// let x = RestoreTableMetadata::new().set_backup_info(BackupInfo::default()/* use setters */);
4647 /// assert!(x.backup_info().is_some());
4648 /// ```
4649 pub fn set_backup_info<T: std::convert::Into<std::boxed::Box<crate::model::BackupInfo>>>(
4650 mut self,
4651 v: T,
4652 ) -> Self {
4653 self.source_info = std::option::Option::Some(
4654 crate::model::restore_table_metadata::SourceInfo::BackupInfo(v.into()),
4655 );
4656 self
4657 }
4658}
4659
4660impl wkt::message::Message for RestoreTableMetadata {
4661 fn typename() -> &'static str {
4662 "type.googleapis.com/google.bigtable.admin.v2.RestoreTableMetadata"
4663 }
4664}
4665
4666/// Defines additional types related to [RestoreTableMetadata].
4667pub mod restore_table_metadata {
4668 #[allow(unused_imports)]
4669 use super::*;
4670
4671 /// Information about the source used to restore the table, as specified by
4672 /// `source` in
4673 /// [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest].
4674 ///
4675 /// [google.bigtable.admin.v2.RestoreTableRequest]: crate::model::RestoreTableRequest
4676 #[derive(Clone, Debug, PartialEq)]
4677 #[non_exhaustive]
4678 pub enum SourceInfo {
4679 #[allow(missing_docs)]
4680 BackupInfo(std::boxed::Box<crate::model::BackupInfo>),
4681 }
4682}
4683
4684/// Metadata type for the long-running operation used to track the progress
4685/// of optimizations performed on a newly restored table. This long-running
4686/// operation is automatically created by the system after the successful
4687/// completion of a table restore, and cannot be cancelled.
4688#[derive(Clone, Default, PartialEq)]
4689#[non_exhaustive]
4690pub struct OptimizeRestoredTableMetadata {
4691 /// Name of the restored table being optimized.
4692 pub name: std::string::String,
4693
4694 /// The progress of the post-restore optimizations.
4695 pub progress: std::option::Option<crate::model::OperationProgress>,
4696
4697 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4698}
4699
4700impl OptimizeRestoredTableMetadata {
4701 /// Creates a new default instance.
4702 pub fn new() -> Self {
4703 std::default::Default::default()
4704 }
4705
4706 /// Sets the value of [name][crate::model::OptimizeRestoredTableMetadata::name].
4707 ///
4708 /// # Example
4709 /// ```ignore,no_run
4710 /// # use google_cloud_bigtable_admin_v2::model::OptimizeRestoredTableMetadata;
4711 /// let x = OptimizeRestoredTableMetadata::new().set_name("example");
4712 /// ```
4713 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4714 self.name = v.into();
4715 self
4716 }
4717
4718 /// Sets the value of [progress][crate::model::OptimizeRestoredTableMetadata::progress].
4719 ///
4720 /// # Example
4721 /// ```ignore,no_run
4722 /// # use google_cloud_bigtable_admin_v2::model::OptimizeRestoredTableMetadata;
4723 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
4724 /// let x = OptimizeRestoredTableMetadata::new().set_progress(OperationProgress::default()/* use setters */);
4725 /// ```
4726 pub fn set_progress<T>(mut self, v: T) -> Self
4727 where
4728 T: std::convert::Into<crate::model::OperationProgress>,
4729 {
4730 self.progress = std::option::Option::Some(v.into());
4731 self
4732 }
4733
4734 /// Sets or clears the value of [progress][crate::model::OptimizeRestoredTableMetadata::progress].
4735 ///
4736 /// # Example
4737 /// ```ignore,no_run
4738 /// # use google_cloud_bigtable_admin_v2::model::OptimizeRestoredTableMetadata;
4739 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
4740 /// let x = OptimizeRestoredTableMetadata::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
4741 /// let x = OptimizeRestoredTableMetadata::new().set_or_clear_progress(None::<OperationProgress>);
4742 /// ```
4743 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
4744 where
4745 T: std::convert::Into<crate::model::OperationProgress>,
4746 {
4747 self.progress = v.map(|x| x.into());
4748 self
4749 }
4750}
4751
4752impl wkt::message::Message for OptimizeRestoredTableMetadata {
4753 fn typename() -> &'static str {
4754 "type.googleapis.com/google.bigtable.admin.v2.OptimizeRestoredTableMetadata"
4755 }
4756}
4757
4758/// Request message for
4759/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]
4760///
4761/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]: crate::client::BigtableTableAdmin::create_table
4762#[derive(Clone, Default, PartialEq)]
4763#[non_exhaustive]
4764pub struct CreateTableRequest {
4765 /// Required. The unique name of the instance in which to create the table.
4766 /// Values are of the form `projects/{project}/instances/{instance}`.
4767 pub parent: std::string::String,
4768
4769 /// Required. The name by which the new table should be referred to within the
4770 /// parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
4771 /// Maximum 50 characters.
4772 pub table_id: std::string::String,
4773
4774 /// Required. The Table to create.
4775 pub table: std::option::Option<crate::model::Table>,
4776
4777 /// The optional list of row keys that will be used to initially split the
4778 /// table into several tablets (tablets are similar to HBase regions).
4779 /// Given two split keys, `s1` and `s2`, three tablets will be created,
4780 /// spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
4781 ///
4782 /// Example:
4783 ///
4784 /// * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
4785 /// `"other", "zz"]`
4786 /// * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
4787 /// * Key assignment:
4788 /// - Tablet 1 `[, apple) => {"a"}.`
4789 /// - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.`
4790 /// - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
4791 /// - Tablet 4 `[customer_2, other) => {"customer_2"}.`
4792 /// - Tablet 5 `[other, ) => {"other", "zz"}.`
4793 pub initial_splits: std::vec::Vec<crate::model::create_table_request::Split>,
4794
4795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4796}
4797
4798impl CreateTableRequest {
4799 /// Creates a new default instance.
4800 pub fn new() -> Self {
4801 std::default::Default::default()
4802 }
4803
4804 /// Sets the value of [parent][crate::model::CreateTableRequest::parent].
4805 ///
4806 /// # Example
4807 /// ```ignore,no_run
4808 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4809 /// # let project_id = "project_id";
4810 /// # let instance_id = "instance_id";
4811 /// let x = CreateTableRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
4812 /// ```
4813 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4814 self.parent = v.into();
4815 self
4816 }
4817
4818 /// Sets the value of [table_id][crate::model::CreateTableRequest::table_id].
4819 ///
4820 /// # Example
4821 /// ```ignore,no_run
4822 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4823 /// let x = CreateTableRequest::new().set_table_id("example");
4824 /// ```
4825 pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4826 self.table_id = v.into();
4827 self
4828 }
4829
4830 /// Sets the value of [table][crate::model::CreateTableRequest::table].
4831 ///
4832 /// # Example
4833 /// ```ignore,no_run
4834 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4835 /// use google_cloud_bigtable_admin_v2::model::Table;
4836 /// let x = CreateTableRequest::new().set_table(Table::default()/* use setters */);
4837 /// ```
4838 pub fn set_table<T>(mut self, v: T) -> Self
4839 where
4840 T: std::convert::Into<crate::model::Table>,
4841 {
4842 self.table = std::option::Option::Some(v.into());
4843 self
4844 }
4845
4846 /// Sets or clears the value of [table][crate::model::CreateTableRequest::table].
4847 ///
4848 /// # Example
4849 /// ```ignore,no_run
4850 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4851 /// use google_cloud_bigtable_admin_v2::model::Table;
4852 /// let x = CreateTableRequest::new().set_or_clear_table(Some(Table::default()/* use setters */));
4853 /// let x = CreateTableRequest::new().set_or_clear_table(None::<Table>);
4854 /// ```
4855 pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
4856 where
4857 T: std::convert::Into<crate::model::Table>,
4858 {
4859 self.table = v.map(|x| x.into());
4860 self
4861 }
4862
4863 /// Sets the value of [initial_splits][crate::model::CreateTableRequest::initial_splits].
4864 ///
4865 /// # Example
4866 /// ```ignore,no_run
4867 /// # use google_cloud_bigtable_admin_v2::model::CreateTableRequest;
4868 /// use google_cloud_bigtable_admin_v2::model::create_table_request::Split;
4869 /// let x = CreateTableRequest::new()
4870 /// .set_initial_splits([
4871 /// Split::default()/* use setters */,
4872 /// Split::default()/* use (different) setters */,
4873 /// ]);
4874 /// ```
4875 pub fn set_initial_splits<T, V>(mut self, v: T) -> Self
4876 where
4877 T: std::iter::IntoIterator<Item = V>,
4878 V: std::convert::Into<crate::model::create_table_request::Split>,
4879 {
4880 use std::iter::Iterator;
4881 self.initial_splits = v.into_iter().map(|i| i.into()).collect();
4882 self
4883 }
4884}
4885
4886impl wkt::message::Message for CreateTableRequest {
4887 fn typename() -> &'static str {
4888 "type.googleapis.com/google.bigtable.admin.v2.CreateTableRequest"
4889 }
4890}
4891
4892/// Defines additional types related to [CreateTableRequest].
4893pub mod create_table_request {
4894 #[allow(unused_imports)]
4895 use super::*;
4896
4897 /// An initial split point for a newly created table.
4898 #[derive(Clone, Default, PartialEq)]
4899 #[non_exhaustive]
4900 pub struct Split {
4901 /// Row key to use as an initial tablet boundary.
4902 pub key: ::bytes::Bytes,
4903
4904 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4905 }
4906
4907 impl Split {
4908 /// Creates a new default instance.
4909 pub fn new() -> Self {
4910 std::default::Default::default()
4911 }
4912
4913 /// Sets the value of [key][crate::model::create_table_request::Split::key].
4914 ///
4915 /// # Example
4916 /// ```ignore,no_run
4917 /// # use google_cloud_bigtable_admin_v2::model::create_table_request::Split;
4918 /// let x = Split::new().set_key(bytes::Bytes::from_static(b"example"));
4919 /// ```
4920 pub fn set_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4921 self.key = v.into();
4922 self
4923 }
4924 }
4925
4926 impl wkt::message::Message for Split {
4927 fn typename() -> &'static str {
4928 "type.googleapis.com/google.bigtable.admin.v2.CreateTableRequest.Split"
4929 }
4930 }
4931}
4932
4933/// Request message for
4934/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]
4935///
4936/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
4937/// feature is not currently available to most Cloud Bigtable customers. This
4938/// feature might be changed in backward-incompatible ways and is not recommended
4939/// for production use. It is not subject to any SLA or deprecation policy.
4940///
4941/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]: crate::client::BigtableTableAdmin::create_table_from_snapshot
4942#[derive(Clone, Default, PartialEq)]
4943#[non_exhaustive]
4944pub struct CreateTableFromSnapshotRequest {
4945 /// Required. The unique name of the instance in which to create the table.
4946 /// Values are of the form `projects/{project}/instances/{instance}`.
4947 pub parent: std::string::String,
4948
4949 /// Required. The name by which the new table should be referred to within the
4950 /// parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
4951 pub table_id: std::string::String,
4952
4953 /// Required. The unique name of the snapshot from which to restore the table.
4954 /// The snapshot and the table must be in the same instance. Values are of the
4955 /// form
4956 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
4957 pub source_snapshot: std::string::String,
4958
4959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4960}
4961
4962impl CreateTableFromSnapshotRequest {
4963 /// Creates a new default instance.
4964 pub fn new() -> Self {
4965 std::default::Default::default()
4966 }
4967
4968 /// Sets the value of [parent][crate::model::CreateTableFromSnapshotRequest::parent].
4969 ///
4970 /// # Example
4971 /// ```ignore,no_run
4972 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
4973 /// # let project_id = "project_id";
4974 /// # let instance_id = "instance_id";
4975 /// let x = CreateTableFromSnapshotRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
4976 /// ```
4977 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4978 self.parent = v.into();
4979 self
4980 }
4981
4982 /// Sets the value of [table_id][crate::model::CreateTableFromSnapshotRequest::table_id].
4983 ///
4984 /// # Example
4985 /// ```ignore,no_run
4986 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
4987 /// let x = CreateTableFromSnapshotRequest::new().set_table_id("example");
4988 /// ```
4989 pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4990 self.table_id = v.into();
4991 self
4992 }
4993
4994 /// Sets the value of [source_snapshot][crate::model::CreateTableFromSnapshotRequest::source_snapshot].
4995 ///
4996 /// # Example
4997 /// ```ignore,no_run
4998 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
4999 /// # let project_id = "project_id";
5000 /// # let instance_id = "instance_id";
5001 /// # let cluster_id = "cluster_id";
5002 /// # let snapshot_id = "snapshot_id";
5003 /// let x = CreateTableFromSnapshotRequest::new().set_source_snapshot(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/snapshots/{snapshot_id}"));
5004 /// ```
5005 pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5006 self.source_snapshot = v.into();
5007 self
5008 }
5009}
5010
5011impl wkt::message::Message for CreateTableFromSnapshotRequest {
5012 fn typename() -> &'static str {
5013 "type.googleapis.com/google.bigtable.admin.v2.CreateTableFromSnapshotRequest"
5014 }
5015}
5016
5017/// Request message for
5018/// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]
5019///
5020/// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]: crate::client::BigtableTableAdmin::drop_row_range
5021#[derive(Clone, Default, PartialEq)]
5022#[non_exhaustive]
5023pub struct DropRowRangeRequest {
5024 /// Required. The unique name of the table on which to drop a range of rows.
5025 /// Values are of the form
5026 /// `projects/{project}/instances/{instance}/tables/{table}`.
5027 pub name: std::string::String,
5028
5029 /// Delete all rows or by prefix.
5030 pub target: std::option::Option<crate::model::drop_row_range_request::Target>,
5031
5032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5033}
5034
5035impl DropRowRangeRequest {
5036 /// Creates a new default instance.
5037 pub fn new() -> Self {
5038 std::default::Default::default()
5039 }
5040
5041 /// Sets the value of [name][crate::model::DropRowRangeRequest::name].
5042 ///
5043 /// # Example
5044 /// ```ignore,no_run
5045 /// # use google_cloud_bigtable_admin_v2::model::DropRowRangeRequest;
5046 /// # let project_id = "project_id";
5047 /// # let instance_id = "instance_id";
5048 /// # let table_id = "table_id";
5049 /// let x = DropRowRangeRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
5050 /// ```
5051 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5052 self.name = v.into();
5053 self
5054 }
5055
5056 /// Sets the value of [target][crate::model::DropRowRangeRequest::target].
5057 ///
5058 /// Note that all the setters affecting `target` are mutually
5059 /// exclusive.
5060 ///
5061 /// # Example
5062 /// ```ignore,no_run
5063 /// # use google_cloud_bigtable_admin_v2::model::DropRowRangeRequest;
5064 /// use google_cloud_bigtable_admin_v2::model::drop_row_range_request::Target;
5065 /// let x = DropRowRangeRequest::new().set_target(Some(Target::RowKeyPrefix(bytes::Bytes::from_static(b"example"))));
5066 /// ```
5067 pub fn set_target<
5068 T: std::convert::Into<std::option::Option<crate::model::drop_row_range_request::Target>>,
5069 >(
5070 mut self,
5071 v: T,
5072 ) -> Self {
5073 self.target = v.into();
5074 self
5075 }
5076
5077 /// The value of [target][crate::model::DropRowRangeRequest::target]
5078 /// if it holds a `RowKeyPrefix`, `None` if the field is not set or
5079 /// holds a different branch.
5080 pub fn row_key_prefix(&self) -> std::option::Option<&::bytes::Bytes> {
5081 #[allow(unreachable_patterns)]
5082 self.target.as_ref().and_then(|v| match v {
5083 crate::model::drop_row_range_request::Target::RowKeyPrefix(v) => {
5084 std::option::Option::Some(v)
5085 }
5086 _ => std::option::Option::None,
5087 })
5088 }
5089
5090 /// Sets the value of [target][crate::model::DropRowRangeRequest::target]
5091 /// to hold a `RowKeyPrefix`.
5092 ///
5093 /// Note that all the setters affecting `target` are
5094 /// mutually exclusive.
5095 ///
5096 /// # Example
5097 /// ```ignore,no_run
5098 /// # use google_cloud_bigtable_admin_v2::model::DropRowRangeRequest;
5099 /// let x = DropRowRangeRequest::new().set_row_key_prefix(bytes::Bytes::from_static(b"example"));
5100 /// assert!(x.row_key_prefix().is_some());
5101 /// assert!(x.delete_all_data_from_table().is_none());
5102 /// ```
5103 pub fn set_row_key_prefix<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5104 self.target = std::option::Option::Some(
5105 crate::model::drop_row_range_request::Target::RowKeyPrefix(v.into()),
5106 );
5107 self
5108 }
5109
5110 /// The value of [target][crate::model::DropRowRangeRequest::target]
5111 /// if it holds a `DeleteAllDataFromTable`, `None` if the field is not set or
5112 /// holds a different branch.
5113 pub fn delete_all_data_from_table(&self) -> std::option::Option<&bool> {
5114 #[allow(unreachable_patterns)]
5115 self.target.as_ref().and_then(|v| match v {
5116 crate::model::drop_row_range_request::Target::DeleteAllDataFromTable(v) => {
5117 std::option::Option::Some(v)
5118 }
5119 _ => std::option::Option::None,
5120 })
5121 }
5122
5123 /// Sets the value of [target][crate::model::DropRowRangeRequest::target]
5124 /// to hold a `DeleteAllDataFromTable`.
5125 ///
5126 /// Note that all the setters affecting `target` are
5127 /// mutually exclusive.
5128 ///
5129 /// # Example
5130 /// ```ignore,no_run
5131 /// # use google_cloud_bigtable_admin_v2::model::DropRowRangeRequest;
5132 /// let x = DropRowRangeRequest::new().set_delete_all_data_from_table(true);
5133 /// assert!(x.delete_all_data_from_table().is_some());
5134 /// assert!(x.row_key_prefix().is_none());
5135 /// ```
5136 pub fn set_delete_all_data_from_table<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5137 self.target = std::option::Option::Some(
5138 crate::model::drop_row_range_request::Target::DeleteAllDataFromTable(v.into()),
5139 );
5140 self
5141 }
5142}
5143
5144impl wkt::message::Message for DropRowRangeRequest {
5145 fn typename() -> &'static str {
5146 "type.googleapis.com/google.bigtable.admin.v2.DropRowRangeRequest"
5147 }
5148}
5149
5150/// Defines additional types related to [DropRowRangeRequest].
5151pub mod drop_row_range_request {
5152 #[allow(unused_imports)]
5153 use super::*;
5154
5155 /// Delete all rows or by prefix.
5156 #[derive(Clone, Debug, PartialEq)]
5157 #[non_exhaustive]
5158 pub enum Target {
5159 /// Delete all rows that start with this row key prefix. Prefix cannot be
5160 /// zero length.
5161 RowKeyPrefix(::bytes::Bytes),
5162 /// Delete all rows in the table. Setting this to false is a no-op.
5163 DeleteAllDataFromTable(bool),
5164 }
5165}
5166
5167/// Request message for
5168/// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
5169///
5170/// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables]: crate::client::BigtableTableAdmin::list_tables
5171#[derive(Clone, Default, PartialEq)]
5172#[non_exhaustive]
5173pub struct ListTablesRequest {
5174 /// Required. The unique name of the instance for which tables should be
5175 /// listed. Values are of the form `projects/{project}/instances/{instance}`.
5176 pub parent: std::string::String,
5177
5178 /// The view to be applied to the returned tables' fields.
5179 /// NAME_ONLY view (default) and REPLICATION_VIEW are supported.
5180 pub view: crate::model::table::View,
5181
5182 /// Maximum number of results per page.
5183 ///
5184 /// A page_size of zero lets the server choose the number of items to return.
5185 /// A page_size which is strictly positive will return at most that many items.
5186 /// A negative page_size will cause an error.
5187 ///
5188 /// Following the first request, subsequent paginated calls are not required
5189 /// to pass a page_size. If a page_size is set in subsequent calls, it must
5190 /// match the page_size given in the first request.
5191 pub page_size: i32,
5192
5193 /// The value of `next_page_token` returned by a previous call.
5194 pub page_token: std::string::String,
5195
5196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5197}
5198
5199impl ListTablesRequest {
5200 /// Creates a new default instance.
5201 pub fn new() -> Self {
5202 std::default::Default::default()
5203 }
5204
5205 /// Sets the value of [parent][crate::model::ListTablesRequest::parent].
5206 ///
5207 /// # Example
5208 /// ```ignore,no_run
5209 /// # use google_cloud_bigtable_admin_v2::model::ListTablesRequest;
5210 /// # let project_id = "project_id";
5211 /// # let instance_id = "instance_id";
5212 /// let x = ListTablesRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}"));
5213 /// ```
5214 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5215 self.parent = v.into();
5216 self
5217 }
5218
5219 /// Sets the value of [view][crate::model::ListTablesRequest::view].
5220 ///
5221 /// # Example
5222 /// ```ignore,no_run
5223 /// # use google_cloud_bigtable_admin_v2::model::ListTablesRequest;
5224 /// use google_cloud_bigtable_admin_v2::model::table::View;
5225 /// let x0 = ListTablesRequest::new().set_view(View::NameOnly);
5226 /// let x1 = ListTablesRequest::new().set_view(View::SchemaView);
5227 /// let x2 = ListTablesRequest::new().set_view(View::ReplicationView);
5228 /// ```
5229 pub fn set_view<T: std::convert::Into<crate::model::table::View>>(mut self, v: T) -> Self {
5230 self.view = v.into();
5231 self
5232 }
5233
5234 /// Sets the value of [page_size][crate::model::ListTablesRequest::page_size].
5235 ///
5236 /// # Example
5237 /// ```ignore,no_run
5238 /// # use google_cloud_bigtable_admin_v2::model::ListTablesRequest;
5239 /// let x = ListTablesRequest::new().set_page_size(42);
5240 /// ```
5241 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5242 self.page_size = v.into();
5243 self
5244 }
5245
5246 /// Sets the value of [page_token][crate::model::ListTablesRequest::page_token].
5247 ///
5248 /// # Example
5249 /// ```ignore,no_run
5250 /// # use google_cloud_bigtable_admin_v2::model::ListTablesRequest;
5251 /// let x = ListTablesRequest::new().set_page_token("example");
5252 /// ```
5253 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5254 self.page_token = v.into();
5255 self
5256 }
5257}
5258
5259impl wkt::message::Message for ListTablesRequest {
5260 fn typename() -> &'static str {
5261 "type.googleapis.com/google.bigtable.admin.v2.ListTablesRequest"
5262 }
5263}
5264
5265/// Response message for
5266/// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
5267///
5268/// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables]: crate::client::BigtableTableAdmin::list_tables
5269#[derive(Clone, Default, PartialEq)]
5270#[non_exhaustive]
5271pub struct ListTablesResponse {
5272 /// The tables present in the requested instance.
5273 pub tables: std::vec::Vec<crate::model::Table>,
5274
5275 /// Set if not all tables could be returned in a single response.
5276 /// Pass this value to `page_token` in another request to get the next
5277 /// page of results.
5278 pub next_page_token: std::string::String,
5279
5280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5281}
5282
5283impl ListTablesResponse {
5284 /// Creates a new default instance.
5285 pub fn new() -> Self {
5286 std::default::Default::default()
5287 }
5288
5289 /// Sets the value of [tables][crate::model::ListTablesResponse::tables].
5290 ///
5291 /// # Example
5292 /// ```ignore,no_run
5293 /// # use google_cloud_bigtable_admin_v2::model::ListTablesResponse;
5294 /// use google_cloud_bigtable_admin_v2::model::Table;
5295 /// let x = ListTablesResponse::new()
5296 /// .set_tables([
5297 /// Table::default()/* use setters */,
5298 /// Table::default()/* use (different) setters */,
5299 /// ]);
5300 /// ```
5301 pub fn set_tables<T, V>(mut self, v: T) -> Self
5302 where
5303 T: std::iter::IntoIterator<Item = V>,
5304 V: std::convert::Into<crate::model::Table>,
5305 {
5306 use std::iter::Iterator;
5307 self.tables = v.into_iter().map(|i| i.into()).collect();
5308 self
5309 }
5310
5311 /// Sets the value of [next_page_token][crate::model::ListTablesResponse::next_page_token].
5312 ///
5313 /// # Example
5314 /// ```ignore,no_run
5315 /// # use google_cloud_bigtable_admin_v2::model::ListTablesResponse;
5316 /// let x = ListTablesResponse::new().set_next_page_token("example");
5317 /// ```
5318 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5319 self.next_page_token = v.into();
5320 self
5321 }
5322}
5323
5324impl wkt::message::Message for ListTablesResponse {
5325 fn typename() -> &'static str {
5326 "type.googleapis.com/google.bigtable.admin.v2.ListTablesResponse"
5327 }
5328}
5329
5330#[doc(hidden)]
5331impl google_cloud_gax::paginator::internal::PageableResponse for ListTablesResponse {
5332 type PageItem = crate::model::Table;
5333
5334 fn items(self) -> std::vec::Vec<Self::PageItem> {
5335 self.tables
5336 }
5337
5338 fn next_page_token(&self) -> std::string::String {
5339 use std::clone::Clone;
5340 self.next_page_token.clone()
5341 }
5342}
5343
5344/// Request message for
5345/// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable]
5346///
5347/// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable]: crate::client::BigtableTableAdmin::get_table
5348#[derive(Clone, Default, PartialEq)]
5349#[non_exhaustive]
5350pub struct GetTableRequest {
5351 /// Required. The unique name of the requested table.
5352 /// Values are of the form
5353 /// `projects/{project}/instances/{instance}/tables/{table}`.
5354 pub name: std::string::String,
5355
5356 /// The view to be applied to the returned table's fields.
5357 /// Defaults to `SCHEMA_VIEW` if unspecified.
5358 pub view: crate::model::table::View,
5359
5360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5361}
5362
5363impl GetTableRequest {
5364 /// Creates a new default instance.
5365 pub fn new() -> Self {
5366 std::default::Default::default()
5367 }
5368
5369 /// Sets the value of [name][crate::model::GetTableRequest::name].
5370 ///
5371 /// # Example
5372 /// ```ignore,no_run
5373 /// # use google_cloud_bigtable_admin_v2::model::GetTableRequest;
5374 /// # let project_id = "project_id";
5375 /// # let instance_id = "instance_id";
5376 /// # let table_id = "table_id";
5377 /// let x = GetTableRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
5378 /// ```
5379 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5380 self.name = v.into();
5381 self
5382 }
5383
5384 /// Sets the value of [view][crate::model::GetTableRequest::view].
5385 ///
5386 /// # Example
5387 /// ```ignore,no_run
5388 /// # use google_cloud_bigtable_admin_v2::model::GetTableRequest;
5389 /// use google_cloud_bigtable_admin_v2::model::table::View;
5390 /// let x0 = GetTableRequest::new().set_view(View::NameOnly);
5391 /// let x1 = GetTableRequest::new().set_view(View::SchemaView);
5392 /// let x2 = GetTableRequest::new().set_view(View::ReplicationView);
5393 /// ```
5394 pub fn set_view<T: std::convert::Into<crate::model::table::View>>(mut self, v: T) -> Self {
5395 self.view = v.into();
5396 self
5397 }
5398}
5399
5400impl wkt::message::Message for GetTableRequest {
5401 fn typename() -> &'static str {
5402 "type.googleapis.com/google.bigtable.admin.v2.GetTableRequest"
5403 }
5404}
5405
5406/// The request for
5407/// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
5408///
5409/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]: crate::client::BigtableTableAdmin::update_table
5410#[derive(Clone, Default, PartialEq)]
5411#[non_exhaustive]
5412pub struct UpdateTableRequest {
5413 /// Required. The table to update.
5414 /// The table's `name` field is used to identify the table to update.
5415 pub table: std::option::Option<crate::model::Table>,
5416
5417 /// Required. The list of fields to update.
5418 /// A mask specifying which fields (e.g. `change_stream_config`) in the `table`
5419 /// field should be updated. This mask is relative to the `table` field, not to
5420 /// the request message. The wildcard (*) path is currently not supported.
5421 /// Currently UpdateTable is only supported for the following fields:
5422 ///
5423 /// * `change_stream_config`
5424 /// * `change_stream_config.retention_period`
5425 /// * `deletion_protection`
5426 /// * `row_key_schema`
5427 ///
5428 /// If `column_families` is set in `update_mask`, it will return an
5429 /// UNIMPLEMENTED error.
5430 pub update_mask: std::option::Option<wkt::FieldMask>,
5431
5432 /// Optional. If true, ignore safety checks when updating the table.
5433 pub ignore_warnings: bool,
5434
5435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5436}
5437
5438impl UpdateTableRequest {
5439 /// Creates a new default instance.
5440 pub fn new() -> Self {
5441 std::default::Default::default()
5442 }
5443
5444 /// Sets the value of [table][crate::model::UpdateTableRequest::table].
5445 ///
5446 /// # Example
5447 /// ```ignore,no_run
5448 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
5449 /// use google_cloud_bigtable_admin_v2::model::Table;
5450 /// let x = UpdateTableRequest::new().set_table(Table::default()/* use setters */);
5451 /// ```
5452 pub fn set_table<T>(mut self, v: T) -> Self
5453 where
5454 T: std::convert::Into<crate::model::Table>,
5455 {
5456 self.table = std::option::Option::Some(v.into());
5457 self
5458 }
5459
5460 /// Sets or clears the value of [table][crate::model::UpdateTableRequest::table].
5461 ///
5462 /// # Example
5463 /// ```ignore,no_run
5464 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
5465 /// use google_cloud_bigtable_admin_v2::model::Table;
5466 /// let x = UpdateTableRequest::new().set_or_clear_table(Some(Table::default()/* use setters */));
5467 /// let x = UpdateTableRequest::new().set_or_clear_table(None::<Table>);
5468 /// ```
5469 pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
5470 where
5471 T: std::convert::Into<crate::model::Table>,
5472 {
5473 self.table = v.map(|x| x.into());
5474 self
5475 }
5476
5477 /// Sets the value of [update_mask][crate::model::UpdateTableRequest::update_mask].
5478 ///
5479 /// # Example
5480 /// ```ignore,no_run
5481 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
5482 /// use wkt::FieldMask;
5483 /// let x = UpdateTableRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5484 /// ```
5485 pub fn set_update_mask<T>(mut self, v: T) -> Self
5486 where
5487 T: std::convert::Into<wkt::FieldMask>,
5488 {
5489 self.update_mask = std::option::Option::Some(v.into());
5490 self
5491 }
5492
5493 /// Sets or clears the value of [update_mask][crate::model::UpdateTableRequest::update_mask].
5494 ///
5495 /// # Example
5496 /// ```ignore,no_run
5497 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
5498 /// use wkt::FieldMask;
5499 /// let x = UpdateTableRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5500 /// let x = UpdateTableRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5501 /// ```
5502 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5503 where
5504 T: std::convert::Into<wkt::FieldMask>,
5505 {
5506 self.update_mask = v.map(|x| x.into());
5507 self
5508 }
5509
5510 /// Sets the value of [ignore_warnings][crate::model::UpdateTableRequest::ignore_warnings].
5511 ///
5512 /// # Example
5513 /// ```ignore,no_run
5514 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableRequest;
5515 /// let x = UpdateTableRequest::new().set_ignore_warnings(true);
5516 /// ```
5517 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5518 self.ignore_warnings = v.into();
5519 self
5520 }
5521}
5522
5523impl wkt::message::Message for UpdateTableRequest {
5524 fn typename() -> &'static str {
5525 "type.googleapis.com/google.bigtable.admin.v2.UpdateTableRequest"
5526 }
5527}
5528
5529/// Metadata type for the operation returned by
5530/// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
5531///
5532/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]: crate::client::BigtableTableAdmin::update_table
5533#[derive(Clone, Default, PartialEq)]
5534#[non_exhaustive]
5535pub struct UpdateTableMetadata {
5536 /// The name of the table being updated.
5537 pub name: std::string::String,
5538
5539 /// The time at which this operation started.
5540 pub start_time: std::option::Option<wkt::Timestamp>,
5541
5542 /// If set, the time at which this operation finished or was canceled.
5543 pub end_time: std::option::Option<wkt::Timestamp>,
5544
5545 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5546}
5547
5548impl UpdateTableMetadata {
5549 /// Creates a new default instance.
5550 pub fn new() -> Self {
5551 std::default::Default::default()
5552 }
5553
5554 /// Sets the value of [name][crate::model::UpdateTableMetadata::name].
5555 ///
5556 /// # Example
5557 /// ```ignore,no_run
5558 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5559 /// let x = UpdateTableMetadata::new().set_name("example");
5560 /// ```
5561 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5562 self.name = v.into();
5563 self
5564 }
5565
5566 /// Sets the value of [start_time][crate::model::UpdateTableMetadata::start_time].
5567 ///
5568 /// # Example
5569 /// ```ignore,no_run
5570 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5571 /// use wkt::Timestamp;
5572 /// let x = UpdateTableMetadata::new().set_start_time(Timestamp::default()/* use setters */);
5573 /// ```
5574 pub fn set_start_time<T>(mut self, v: T) -> Self
5575 where
5576 T: std::convert::Into<wkt::Timestamp>,
5577 {
5578 self.start_time = std::option::Option::Some(v.into());
5579 self
5580 }
5581
5582 /// Sets or clears the value of [start_time][crate::model::UpdateTableMetadata::start_time].
5583 ///
5584 /// # Example
5585 /// ```ignore,no_run
5586 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5587 /// use wkt::Timestamp;
5588 /// let x = UpdateTableMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
5589 /// let x = UpdateTableMetadata::new().set_or_clear_start_time(None::<Timestamp>);
5590 /// ```
5591 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5592 where
5593 T: std::convert::Into<wkt::Timestamp>,
5594 {
5595 self.start_time = v.map(|x| x.into());
5596 self
5597 }
5598
5599 /// Sets the value of [end_time][crate::model::UpdateTableMetadata::end_time].
5600 ///
5601 /// # Example
5602 /// ```ignore,no_run
5603 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5604 /// use wkt::Timestamp;
5605 /// let x = UpdateTableMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5606 /// ```
5607 pub fn set_end_time<T>(mut self, v: T) -> Self
5608 where
5609 T: std::convert::Into<wkt::Timestamp>,
5610 {
5611 self.end_time = std::option::Option::Some(v.into());
5612 self
5613 }
5614
5615 /// Sets or clears the value of [end_time][crate::model::UpdateTableMetadata::end_time].
5616 ///
5617 /// # Example
5618 /// ```ignore,no_run
5619 /// # use google_cloud_bigtable_admin_v2::model::UpdateTableMetadata;
5620 /// use wkt::Timestamp;
5621 /// let x = UpdateTableMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5622 /// let x = UpdateTableMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5623 /// ```
5624 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5625 where
5626 T: std::convert::Into<wkt::Timestamp>,
5627 {
5628 self.end_time = v.map(|x| x.into());
5629 self
5630 }
5631}
5632
5633impl wkt::message::Message for UpdateTableMetadata {
5634 fn typename() -> &'static str {
5635 "type.googleapis.com/google.bigtable.admin.v2.UpdateTableMetadata"
5636 }
5637}
5638
5639/// Request message for
5640/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]
5641///
5642/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]: crate::client::BigtableTableAdmin::delete_table
5643#[derive(Clone, Default, PartialEq)]
5644#[non_exhaustive]
5645pub struct DeleteTableRequest {
5646 /// Required. The unique name of the table to be deleted.
5647 /// Values are of the form
5648 /// `projects/{project}/instances/{instance}/tables/{table}`.
5649 pub name: std::string::String,
5650
5651 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5652}
5653
5654impl DeleteTableRequest {
5655 /// Creates a new default instance.
5656 pub fn new() -> Self {
5657 std::default::Default::default()
5658 }
5659
5660 /// Sets the value of [name][crate::model::DeleteTableRequest::name].
5661 ///
5662 /// # Example
5663 /// ```ignore,no_run
5664 /// # use google_cloud_bigtable_admin_v2::model::DeleteTableRequest;
5665 /// # let project_id = "project_id";
5666 /// # let instance_id = "instance_id";
5667 /// # let table_id = "table_id";
5668 /// let x = DeleteTableRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
5669 /// ```
5670 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5671 self.name = v.into();
5672 self
5673 }
5674}
5675
5676impl wkt::message::Message for DeleteTableRequest {
5677 fn typename() -> &'static str {
5678 "type.googleapis.com/google.bigtable.admin.v2.DeleteTableRequest"
5679 }
5680}
5681
5682/// Request message for
5683/// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]
5684///
5685/// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]: crate::client::BigtableTableAdmin::undelete_table
5686#[derive(Clone, Default, PartialEq)]
5687#[non_exhaustive]
5688pub struct UndeleteTableRequest {
5689 /// Required. The unique name of the table to be restored.
5690 /// Values are of the form
5691 /// `projects/{project}/instances/{instance}/tables/{table}`.
5692 pub name: std::string::String,
5693
5694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5695}
5696
5697impl UndeleteTableRequest {
5698 /// Creates a new default instance.
5699 pub fn new() -> Self {
5700 std::default::Default::default()
5701 }
5702
5703 /// Sets the value of [name][crate::model::UndeleteTableRequest::name].
5704 ///
5705 /// # Example
5706 /// ```ignore,no_run
5707 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableRequest;
5708 /// # let project_id = "project_id";
5709 /// # let instance_id = "instance_id";
5710 /// # let table_id = "table_id";
5711 /// let x = UndeleteTableRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
5712 /// ```
5713 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5714 self.name = v.into();
5715 self
5716 }
5717}
5718
5719impl wkt::message::Message for UndeleteTableRequest {
5720 fn typename() -> &'static str {
5721 "type.googleapis.com/google.bigtable.admin.v2.UndeleteTableRequest"
5722 }
5723}
5724
5725/// Metadata type for the operation returned by
5726/// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable].
5727///
5728/// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]: crate::client::BigtableTableAdmin::undelete_table
5729#[derive(Clone, Default, PartialEq)]
5730#[non_exhaustive]
5731pub struct UndeleteTableMetadata {
5732 /// The name of the table being restored.
5733 pub name: std::string::String,
5734
5735 /// The time at which this operation started.
5736 pub start_time: std::option::Option<wkt::Timestamp>,
5737
5738 /// If set, the time at which this operation finished or was cancelled.
5739 pub end_time: std::option::Option<wkt::Timestamp>,
5740
5741 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5742}
5743
5744impl UndeleteTableMetadata {
5745 /// Creates a new default instance.
5746 pub fn new() -> Self {
5747 std::default::Default::default()
5748 }
5749
5750 /// Sets the value of [name][crate::model::UndeleteTableMetadata::name].
5751 ///
5752 /// # Example
5753 /// ```ignore,no_run
5754 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5755 /// let x = UndeleteTableMetadata::new().set_name("example");
5756 /// ```
5757 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5758 self.name = v.into();
5759 self
5760 }
5761
5762 /// Sets the value of [start_time][crate::model::UndeleteTableMetadata::start_time].
5763 ///
5764 /// # Example
5765 /// ```ignore,no_run
5766 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5767 /// use wkt::Timestamp;
5768 /// let x = UndeleteTableMetadata::new().set_start_time(Timestamp::default()/* use setters */);
5769 /// ```
5770 pub fn set_start_time<T>(mut self, v: T) -> Self
5771 where
5772 T: std::convert::Into<wkt::Timestamp>,
5773 {
5774 self.start_time = std::option::Option::Some(v.into());
5775 self
5776 }
5777
5778 /// Sets or clears the value of [start_time][crate::model::UndeleteTableMetadata::start_time].
5779 ///
5780 /// # Example
5781 /// ```ignore,no_run
5782 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5783 /// use wkt::Timestamp;
5784 /// let x = UndeleteTableMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
5785 /// let x = UndeleteTableMetadata::new().set_or_clear_start_time(None::<Timestamp>);
5786 /// ```
5787 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5788 where
5789 T: std::convert::Into<wkt::Timestamp>,
5790 {
5791 self.start_time = v.map(|x| x.into());
5792 self
5793 }
5794
5795 /// Sets the value of [end_time][crate::model::UndeleteTableMetadata::end_time].
5796 ///
5797 /// # Example
5798 /// ```ignore,no_run
5799 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5800 /// use wkt::Timestamp;
5801 /// let x = UndeleteTableMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5802 /// ```
5803 pub fn set_end_time<T>(mut self, v: T) -> Self
5804 where
5805 T: std::convert::Into<wkt::Timestamp>,
5806 {
5807 self.end_time = std::option::Option::Some(v.into());
5808 self
5809 }
5810
5811 /// Sets or clears the value of [end_time][crate::model::UndeleteTableMetadata::end_time].
5812 ///
5813 /// # Example
5814 /// ```ignore,no_run
5815 /// # use google_cloud_bigtable_admin_v2::model::UndeleteTableMetadata;
5816 /// use wkt::Timestamp;
5817 /// let x = UndeleteTableMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5818 /// let x = UndeleteTableMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5819 /// ```
5820 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5821 where
5822 T: std::convert::Into<wkt::Timestamp>,
5823 {
5824 self.end_time = v.map(|x| x.into());
5825 self
5826 }
5827}
5828
5829impl wkt::message::Message for UndeleteTableMetadata {
5830 fn typename() -> &'static str {
5831 "type.googleapis.com/google.bigtable.admin.v2.UndeleteTableMetadata"
5832 }
5833}
5834
5835/// Request message for
5836/// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]
5837///
5838/// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]: crate::client::BigtableTableAdmin::modify_column_families
5839#[derive(Clone, Default, PartialEq)]
5840#[non_exhaustive]
5841pub struct ModifyColumnFamiliesRequest {
5842 /// Required. The unique name of the table whose families should be modified.
5843 /// Values are of the form
5844 /// `projects/{project}/instances/{instance}/tables/{table}`.
5845 pub name: std::string::String,
5846
5847 /// Required. Modifications to be atomically applied to the specified table's
5848 /// families. Entries are applied in order, meaning that earlier modifications
5849 /// can be masked by later ones (in the case of repeated updates to the same
5850 /// family, for example).
5851 pub modifications: std::vec::Vec<crate::model::modify_column_families_request::Modification>,
5852
5853 /// Optional. If true, ignore safety checks when modifying the column families.
5854 pub ignore_warnings: bool,
5855
5856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5857}
5858
5859impl ModifyColumnFamiliesRequest {
5860 /// Creates a new default instance.
5861 pub fn new() -> Self {
5862 std::default::Default::default()
5863 }
5864
5865 /// Sets the value of [name][crate::model::ModifyColumnFamiliesRequest::name].
5866 ///
5867 /// # Example
5868 /// ```ignore,no_run
5869 /// # use google_cloud_bigtable_admin_v2::model::ModifyColumnFamiliesRequest;
5870 /// # let project_id = "project_id";
5871 /// # let instance_id = "instance_id";
5872 /// # let table_id = "table_id";
5873 /// let x = ModifyColumnFamiliesRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
5874 /// ```
5875 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5876 self.name = v.into();
5877 self
5878 }
5879
5880 /// Sets the value of [modifications][crate::model::ModifyColumnFamiliesRequest::modifications].
5881 ///
5882 /// # Example
5883 /// ```ignore,no_run
5884 /// # use google_cloud_bigtable_admin_v2::model::ModifyColumnFamiliesRequest;
5885 /// use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5886 /// let x = ModifyColumnFamiliesRequest::new()
5887 /// .set_modifications([
5888 /// Modification::default()/* use setters */,
5889 /// Modification::default()/* use (different) setters */,
5890 /// ]);
5891 /// ```
5892 pub fn set_modifications<T, V>(mut self, v: T) -> Self
5893 where
5894 T: std::iter::IntoIterator<Item = V>,
5895 V: std::convert::Into<crate::model::modify_column_families_request::Modification>,
5896 {
5897 use std::iter::Iterator;
5898 self.modifications = v.into_iter().map(|i| i.into()).collect();
5899 self
5900 }
5901
5902 /// Sets the value of [ignore_warnings][crate::model::ModifyColumnFamiliesRequest::ignore_warnings].
5903 ///
5904 /// # Example
5905 /// ```ignore,no_run
5906 /// # use google_cloud_bigtable_admin_v2::model::ModifyColumnFamiliesRequest;
5907 /// let x = ModifyColumnFamiliesRequest::new().set_ignore_warnings(true);
5908 /// ```
5909 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5910 self.ignore_warnings = v.into();
5911 self
5912 }
5913}
5914
5915impl wkt::message::Message for ModifyColumnFamiliesRequest {
5916 fn typename() -> &'static str {
5917 "type.googleapis.com/google.bigtable.admin.v2.ModifyColumnFamiliesRequest"
5918 }
5919}
5920
5921/// Defines additional types related to [ModifyColumnFamiliesRequest].
5922pub mod modify_column_families_request {
5923 #[allow(unused_imports)]
5924 use super::*;
5925
5926 /// A create, update, or delete of a particular column family.
5927 #[derive(Clone, Default, PartialEq)]
5928 #[non_exhaustive]
5929 pub struct Modification {
5930 /// The ID of the column family to be modified.
5931 pub id: std::string::String,
5932
5933 /// Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
5934 /// mod should be updated, ignored for other modification types. If unset or
5935 /// empty, we treat it as updating `gc_rule` to be backward compatible.
5936 pub update_mask: std::option::Option<wkt::FieldMask>,
5937
5938 /// Column family modifications.
5939 pub r#mod:
5940 std::option::Option<crate::model::modify_column_families_request::modification::Mod>,
5941
5942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5943 }
5944
5945 impl Modification {
5946 /// Creates a new default instance.
5947 pub fn new() -> Self {
5948 std::default::Default::default()
5949 }
5950
5951 /// Sets the value of [id][crate::model::modify_column_families_request::Modification::id].
5952 ///
5953 /// # Example
5954 /// ```ignore,no_run
5955 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5956 /// let x = Modification::new().set_id("example");
5957 /// ```
5958 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5959 self.id = v.into();
5960 self
5961 }
5962
5963 /// Sets the value of [update_mask][crate::model::modify_column_families_request::Modification::update_mask].
5964 ///
5965 /// # Example
5966 /// ```ignore,no_run
5967 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5968 /// use wkt::FieldMask;
5969 /// let x = Modification::new().set_update_mask(FieldMask::default()/* use setters */);
5970 /// ```
5971 pub fn set_update_mask<T>(mut self, v: T) -> Self
5972 where
5973 T: std::convert::Into<wkt::FieldMask>,
5974 {
5975 self.update_mask = std::option::Option::Some(v.into());
5976 self
5977 }
5978
5979 /// Sets or clears the value of [update_mask][crate::model::modify_column_families_request::Modification::update_mask].
5980 ///
5981 /// # Example
5982 /// ```ignore,no_run
5983 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
5984 /// use wkt::FieldMask;
5985 /// let x = Modification::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5986 /// let x = Modification::new().set_or_clear_update_mask(None::<FieldMask>);
5987 /// ```
5988 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5989 where
5990 T: std::convert::Into<wkt::FieldMask>,
5991 {
5992 self.update_mask = v.map(|x| x.into());
5993 self
5994 }
5995
5996 /// Sets the value of [r#mod][crate::model::modify_column_families_request::Modification::mod].
5997 ///
5998 /// Note that all the setters affecting `r#mod` are mutually
5999 /// exclusive.
6000 ///
6001 /// # Example
6002 /// ```ignore,no_run
6003 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
6004 /// use google_cloud_bigtable_admin_v2::model::modify_column_families_request::modification::Mod;
6005 /// let x = Modification::new().set_mod(Some(Mod::Drop(true)));
6006 /// ```
6007 pub fn set_mod<
6008 T: std::convert::Into<
6009 std::option::Option<
6010 crate::model::modify_column_families_request::modification::Mod,
6011 >,
6012 >,
6013 >(
6014 mut self,
6015 v: T,
6016 ) -> Self {
6017 self.r#mod = v.into();
6018 self
6019 }
6020
6021 /// The value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
6022 /// if it holds a `Create`, `None` if the field is not set or
6023 /// holds a different branch.
6024 pub fn create(&self) -> std::option::Option<&std::boxed::Box<crate::model::ColumnFamily>> {
6025 #[allow(unreachable_patterns)]
6026 self.r#mod.as_ref().and_then(|v| match v {
6027 crate::model::modify_column_families_request::modification::Mod::Create(v) => {
6028 std::option::Option::Some(v)
6029 }
6030 _ => std::option::Option::None,
6031 })
6032 }
6033
6034 /// Sets the value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
6035 /// to hold a `Create`.
6036 ///
6037 /// Note that all the setters affecting `r#mod` are
6038 /// mutually exclusive.
6039 ///
6040 /// # Example
6041 /// ```ignore,no_run
6042 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
6043 /// use google_cloud_bigtable_admin_v2::model::ColumnFamily;
6044 /// let x = Modification::new().set_create(ColumnFamily::default()/* use setters */);
6045 /// assert!(x.create().is_some());
6046 /// assert!(x.update().is_none());
6047 /// assert!(x.drop().is_none());
6048 /// ```
6049 pub fn set_create<T: std::convert::Into<std::boxed::Box<crate::model::ColumnFamily>>>(
6050 mut self,
6051 v: T,
6052 ) -> Self {
6053 self.r#mod = std::option::Option::Some(
6054 crate::model::modify_column_families_request::modification::Mod::Create(v.into()),
6055 );
6056 self
6057 }
6058
6059 /// The value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
6060 /// if it holds a `Update`, `None` if the field is not set or
6061 /// holds a different branch.
6062 pub fn update(&self) -> std::option::Option<&std::boxed::Box<crate::model::ColumnFamily>> {
6063 #[allow(unreachable_patterns)]
6064 self.r#mod.as_ref().and_then(|v| match v {
6065 crate::model::modify_column_families_request::modification::Mod::Update(v) => {
6066 std::option::Option::Some(v)
6067 }
6068 _ => std::option::Option::None,
6069 })
6070 }
6071
6072 /// Sets the value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
6073 /// to hold a `Update`.
6074 ///
6075 /// Note that all the setters affecting `r#mod` are
6076 /// mutually exclusive.
6077 ///
6078 /// # Example
6079 /// ```ignore,no_run
6080 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
6081 /// use google_cloud_bigtable_admin_v2::model::ColumnFamily;
6082 /// let x = Modification::new().set_update(ColumnFamily::default()/* use setters */);
6083 /// assert!(x.update().is_some());
6084 /// assert!(x.create().is_none());
6085 /// assert!(x.drop().is_none());
6086 /// ```
6087 pub fn set_update<T: std::convert::Into<std::boxed::Box<crate::model::ColumnFamily>>>(
6088 mut self,
6089 v: T,
6090 ) -> Self {
6091 self.r#mod = std::option::Option::Some(
6092 crate::model::modify_column_families_request::modification::Mod::Update(v.into()),
6093 );
6094 self
6095 }
6096
6097 /// The value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
6098 /// if it holds a `Drop`, `None` if the field is not set or
6099 /// holds a different branch.
6100 pub fn drop(&self) -> std::option::Option<&bool> {
6101 #[allow(unreachable_patterns)]
6102 self.r#mod.as_ref().and_then(|v| match v {
6103 crate::model::modify_column_families_request::modification::Mod::Drop(v) => {
6104 std::option::Option::Some(v)
6105 }
6106 _ => std::option::Option::None,
6107 })
6108 }
6109
6110 /// Sets the value of [r#mod][crate::model::modify_column_families_request::Modification::r#mod]
6111 /// to hold a `Drop`.
6112 ///
6113 /// Note that all the setters affecting `r#mod` are
6114 /// mutually exclusive.
6115 ///
6116 /// # Example
6117 /// ```ignore,no_run
6118 /// # use google_cloud_bigtable_admin_v2::model::modify_column_families_request::Modification;
6119 /// let x = Modification::new().set_drop(true);
6120 /// assert!(x.drop().is_some());
6121 /// assert!(x.create().is_none());
6122 /// assert!(x.update().is_none());
6123 /// ```
6124 pub fn set_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6125 self.r#mod = std::option::Option::Some(
6126 crate::model::modify_column_families_request::modification::Mod::Drop(v.into()),
6127 );
6128 self
6129 }
6130 }
6131
6132 impl wkt::message::Message for Modification {
6133 fn typename() -> &'static str {
6134 "type.googleapis.com/google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification"
6135 }
6136 }
6137
6138 /// Defines additional types related to [Modification].
6139 pub mod modification {
6140 #[allow(unused_imports)]
6141 use super::*;
6142
6143 /// Column family modifications.
6144 #[derive(Clone, Debug, PartialEq)]
6145 #[non_exhaustive]
6146 pub enum Mod {
6147 /// Create a new column family with the specified schema, or fail if
6148 /// one already exists with the given ID.
6149 Create(std::boxed::Box<crate::model::ColumnFamily>),
6150 /// Update an existing column family to the specified schema, or fail
6151 /// if no column family exists with the given ID.
6152 Update(std::boxed::Box<crate::model::ColumnFamily>),
6153 /// Drop (delete) the column family with the given ID, or fail if no such
6154 /// family exists.
6155 Drop(bool),
6156 }
6157 }
6158}
6159
6160/// Request message for
6161/// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
6162///
6163/// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]: crate::client::BigtableTableAdmin::generate_consistency_token
6164#[derive(Clone, Default, PartialEq)]
6165#[non_exhaustive]
6166pub struct GenerateConsistencyTokenRequest {
6167 /// Required. The unique name of the Table for which to create a consistency
6168 /// token. Values are of the form
6169 /// `projects/{project}/instances/{instance}/tables/{table}`.
6170 pub name: std::string::String,
6171
6172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6173}
6174
6175impl GenerateConsistencyTokenRequest {
6176 /// Creates a new default instance.
6177 pub fn new() -> Self {
6178 std::default::Default::default()
6179 }
6180
6181 /// Sets the value of [name][crate::model::GenerateConsistencyTokenRequest::name].
6182 ///
6183 /// # Example
6184 /// ```ignore,no_run
6185 /// # use google_cloud_bigtable_admin_v2::model::GenerateConsistencyTokenRequest;
6186 /// # let project_id = "project_id";
6187 /// # let instance_id = "instance_id";
6188 /// # let table_id = "table_id";
6189 /// let x = GenerateConsistencyTokenRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
6190 /// ```
6191 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6192 self.name = v.into();
6193 self
6194 }
6195}
6196
6197impl wkt::message::Message for GenerateConsistencyTokenRequest {
6198 fn typename() -> &'static str {
6199 "type.googleapis.com/google.bigtable.admin.v2.GenerateConsistencyTokenRequest"
6200 }
6201}
6202
6203/// Response message for
6204/// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
6205///
6206/// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]: crate::client::BigtableTableAdmin::generate_consistency_token
6207#[derive(Clone, Default, PartialEq)]
6208#[non_exhaustive]
6209pub struct GenerateConsistencyTokenResponse {
6210 /// The generated consistency token.
6211 pub consistency_token: std::string::String,
6212
6213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6214}
6215
6216impl GenerateConsistencyTokenResponse {
6217 /// Creates a new default instance.
6218 pub fn new() -> Self {
6219 std::default::Default::default()
6220 }
6221
6222 /// Sets the value of [consistency_token][crate::model::GenerateConsistencyTokenResponse::consistency_token].
6223 ///
6224 /// # Example
6225 /// ```ignore,no_run
6226 /// # use google_cloud_bigtable_admin_v2::model::GenerateConsistencyTokenResponse;
6227 /// let x = GenerateConsistencyTokenResponse::new().set_consistency_token("example");
6228 /// ```
6229 pub fn set_consistency_token<T: std::convert::Into<std::string::String>>(
6230 mut self,
6231 v: T,
6232 ) -> Self {
6233 self.consistency_token = v.into();
6234 self
6235 }
6236}
6237
6238impl wkt::message::Message for GenerateConsistencyTokenResponse {
6239 fn typename() -> &'static str {
6240 "type.googleapis.com/google.bigtable.admin.v2.GenerateConsistencyTokenResponse"
6241 }
6242}
6243
6244/// Request message for
6245/// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
6246///
6247/// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]: crate::client::BigtableTableAdmin::check_consistency
6248#[derive(Clone, Default, PartialEq)]
6249#[non_exhaustive]
6250pub struct CheckConsistencyRequest {
6251 /// Required. The unique name of the Table for which to check replication
6252 /// consistency. Values are of the form
6253 /// `projects/{project}/instances/{instance}/tables/{table}`.
6254 pub name: std::string::String,
6255
6256 /// Required. The token created using GenerateConsistencyToken for the Table.
6257 pub consistency_token: std::string::String,
6258
6259 /// Which type of read needs to consistently observe which type of write?
6260 /// Default: `standard_read_remote_writes`
6261 pub mode: std::option::Option<crate::model::check_consistency_request::Mode>,
6262
6263 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6264}
6265
6266impl CheckConsistencyRequest {
6267 /// Creates a new default instance.
6268 pub fn new() -> Self {
6269 std::default::Default::default()
6270 }
6271
6272 /// Sets the value of [name][crate::model::CheckConsistencyRequest::name].
6273 ///
6274 /// # Example
6275 /// ```ignore,no_run
6276 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
6277 /// # let project_id = "project_id";
6278 /// # let instance_id = "instance_id";
6279 /// # let table_id = "table_id";
6280 /// let x = CheckConsistencyRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
6281 /// ```
6282 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6283 self.name = v.into();
6284 self
6285 }
6286
6287 /// Sets the value of [consistency_token][crate::model::CheckConsistencyRequest::consistency_token].
6288 ///
6289 /// # Example
6290 /// ```ignore,no_run
6291 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
6292 /// let x = CheckConsistencyRequest::new().set_consistency_token("example");
6293 /// ```
6294 pub fn set_consistency_token<T: std::convert::Into<std::string::String>>(
6295 mut self,
6296 v: T,
6297 ) -> Self {
6298 self.consistency_token = v.into();
6299 self
6300 }
6301
6302 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode].
6303 ///
6304 /// Note that all the setters affecting `mode` are mutually
6305 /// exclusive.
6306 ///
6307 /// # Example
6308 /// ```ignore,no_run
6309 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
6310 /// use google_cloud_bigtable_admin_v2::model::StandardReadRemoteWrites;
6311 /// let x = CheckConsistencyRequest::new().set_mode(Some(
6312 /// google_cloud_bigtable_admin_v2::model::check_consistency_request::Mode::StandardReadRemoteWrites(StandardReadRemoteWrites::default().into())));
6313 /// ```
6314 pub fn set_mode<
6315 T: std::convert::Into<std::option::Option<crate::model::check_consistency_request::Mode>>,
6316 >(
6317 mut self,
6318 v: T,
6319 ) -> Self {
6320 self.mode = v.into();
6321 self
6322 }
6323
6324 /// The value of [mode][crate::model::CheckConsistencyRequest::mode]
6325 /// if it holds a `StandardReadRemoteWrites`, `None` if the field is not set or
6326 /// holds a different branch.
6327 pub fn standard_read_remote_writes(
6328 &self,
6329 ) -> std::option::Option<&std::boxed::Box<crate::model::StandardReadRemoteWrites>> {
6330 #[allow(unreachable_patterns)]
6331 self.mode.as_ref().and_then(|v| match v {
6332 crate::model::check_consistency_request::Mode::StandardReadRemoteWrites(v) => {
6333 std::option::Option::Some(v)
6334 }
6335 _ => std::option::Option::None,
6336 })
6337 }
6338
6339 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode]
6340 /// to hold a `StandardReadRemoteWrites`.
6341 ///
6342 /// Note that all the setters affecting `mode` are
6343 /// mutually exclusive.
6344 ///
6345 /// # Example
6346 /// ```ignore,no_run
6347 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
6348 /// use google_cloud_bigtable_admin_v2::model::StandardReadRemoteWrites;
6349 /// let x = CheckConsistencyRequest::new().set_standard_read_remote_writes(StandardReadRemoteWrites::default()/* use setters */);
6350 /// assert!(x.standard_read_remote_writes().is_some());
6351 /// assert!(x.data_boost_read_local_writes().is_none());
6352 /// ```
6353 pub fn set_standard_read_remote_writes<
6354 T: std::convert::Into<std::boxed::Box<crate::model::StandardReadRemoteWrites>>,
6355 >(
6356 mut self,
6357 v: T,
6358 ) -> Self {
6359 self.mode = std::option::Option::Some(
6360 crate::model::check_consistency_request::Mode::StandardReadRemoteWrites(v.into()),
6361 );
6362 self
6363 }
6364
6365 /// The value of [mode][crate::model::CheckConsistencyRequest::mode]
6366 /// if it holds a `DataBoostReadLocalWrites`, `None` if the field is not set or
6367 /// holds a different branch.
6368 pub fn data_boost_read_local_writes(
6369 &self,
6370 ) -> std::option::Option<&std::boxed::Box<crate::model::DataBoostReadLocalWrites>> {
6371 #[allow(unreachable_patterns)]
6372 self.mode.as_ref().and_then(|v| match v {
6373 crate::model::check_consistency_request::Mode::DataBoostReadLocalWrites(v) => {
6374 std::option::Option::Some(v)
6375 }
6376 _ => std::option::Option::None,
6377 })
6378 }
6379
6380 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode]
6381 /// to hold a `DataBoostReadLocalWrites`.
6382 ///
6383 /// Note that all the setters affecting `mode` are
6384 /// mutually exclusive.
6385 ///
6386 /// # Example
6387 /// ```ignore,no_run
6388 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyRequest;
6389 /// use google_cloud_bigtable_admin_v2::model::DataBoostReadLocalWrites;
6390 /// let x = CheckConsistencyRequest::new().set_data_boost_read_local_writes(DataBoostReadLocalWrites::default()/* use setters */);
6391 /// assert!(x.data_boost_read_local_writes().is_some());
6392 /// assert!(x.standard_read_remote_writes().is_none());
6393 /// ```
6394 pub fn set_data_boost_read_local_writes<
6395 T: std::convert::Into<std::boxed::Box<crate::model::DataBoostReadLocalWrites>>,
6396 >(
6397 mut self,
6398 v: T,
6399 ) -> Self {
6400 self.mode = std::option::Option::Some(
6401 crate::model::check_consistency_request::Mode::DataBoostReadLocalWrites(v.into()),
6402 );
6403 self
6404 }
6405}
6406
6407impl wkt::message::Message for CheckConsistencyRequest {
6408 fn typename() -> &'static str {
6409 "type.googleapis.com/google.bigtable.admin.v2.CheckConsistencyRequest"
6410 }
6411}
6412
6413/// Defines additional types related to [CheckConsistencyRequest].
6414pub mod check_consistency_request {
6415 #[allow(unused_imports)]
6416 use super::*;
6417
6418 /// Which type of read needs to consistently observe which type of write?
6419 /// Default: `standard_read_remote_writes`
6420 #[derive(Clone, Debug, PartialEq)]
6421 #[non_exhaustive]
6422 pub enum Mode {
6423 /// Checks that reads using an app profile with `StandardIsolation` can
6424 /// see all writes committed before the token was created, even if the
6425 /// read and write target different clusters.
6426 StandardReadRemoteWrites(std::boxed::Box<crate::model::StandardReadRemoteWrites>),
6427 /// Checks that reads using an app profile with `DataBoostIsolationReadOnly`
6428 /// can see all writes committed before the token was created, but only if
6429 /// the read and write target the same cluster.
6430 DataBoostReadLocalWrites(std::boxed::Box<crate::model::DataBoostReadLocalWrites>),
6431 }
6432}
6433
6434/// Checks that all writes before the consistency token was generated are
6435/// replicated in every cluster and readable.
6436#[derive(Clone, Default, PartialEq)]
6437#[non_exhaustive]
6438pub struct StandardReadRemoteWrites {
6439 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6440}
6441
6442impl StandardReadRemoteWrites {
6443 /// Creates a new default instance.
6444 pub fn new() -> Self {
6445 std::default::Default::default()
6446 }
6447}
6448
6449impl wkt::message::Message for StandardReadRemoteWrites {
6450 fn typename() -> &'static str {
6451 "type.googleapis.com/google.bigtable.admin.v2.StandardReadRemoteWrites"
6452 }
6453}
6454
6455/// Checks that all writes before the consistency token was generated in the same
6456/// cluster are readable by Databoost.
6457#[derive(Clone, Default, PartialEq)]
6458#[non_exhaustive]
6459pub struct DataBoostReadLocalWrites {
6460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6461}
6462
6463impl DataBoostReadLocalWrites {
6464 /// Creates a new default instance.
6465 pub fn new() -> Self {
6466 std::default::Default::default()
6467 }
6468}
6469
6470impl wkt::message::Message for DataBoostReadLocalWrites {
6471 fn typename() -> &'static str {
6472 "type.googleapis.com/google.bigtable.admin.v2.DataBoostReadLocalWrites"
6473 }
6474}
6475
6476/// Response message for
6477/// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
6478///
6479/// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]: crate::client::BigtableTableAdmin::check_consistency
6480#[derive(Clone, Default, PartialEq)]
6481#[non_exhaustive]
6482pub struct CheckConsistencyResponse {
6483 /// True only if the token is consistent. A token is consistent if replication
6484 /// has caught up with the restrictions specified in the request.
6485 pub consistent: bool,
6486
6487 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6488}
6489
6490impl CheckConsistencyResponse {
6491 /// Creates a new default instance.
6492 pub fn new() -> Self {
6493 std::default::Default::default()
6494 }
6495
6496 /// Sets the value of [consistent][crate::model::CheckConsistencyResponse::consistent].
6497 ///
6498 /// # Example
6499 /// ```ignore,no_run
6500 /// # use google_cloud_bigtable_admin_v2::model::CheckConsistencyResponse;
6501 /// let x = CheckConsistencyResponse::new().set_consistent(true);
6502 /// ```
6503 pub fn set_consistent<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6504 self.consistent = v.into();
6505 self
6506 }
6507}
6508
6509impl wkt::message::Message for CheckConsistencyResponse {
6510 fn typename() -> &'static str {
6511 "type.googleapis.com/google.bigtable.admin.v2.CheckConsistencyResponse"
6512 }
6513}
6514
6515/// Request message for
6516/// [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]
6517///
6518/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6519/// feature is not currently available to most Cloud Bigtable customers. This
6520/// feature might be changed in backward-incompatible ways and is not recommended
6521/// for production use. It is not subject to any SLA or deprecation policy.
6522///
6523/// [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]: crate::client::BigtableTableAdmin::snapshot_table
6524#[derive(Clone, Default, PartialEq)]
6525#[non_exhaustive]
6526pub struct SnapshotTableRequest {
6527 /// Required. The unique name of the table to have the snapshot taken.
6528 /// Values are of the form
6529 /// `projects/{project}/instances/{instance}/tables/{table}`.
6530 pub name: std::string::String,
6531
6532 /// Required. The name of the cluster where the snapshot will be created in.
6533 /// Values are of the form
6534 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
6535 pub cluster: std::string::String,
6536
6537 /// Required. The ID by which the new snapshot should be referred to within the
6538 /// parent cluster, e.g., `mysnapshot` of the form:
6539 /// `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
6540 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
6541 pub snapshot_id: std::string::String,
6542
6543 /// The amount of time that the new snapshot can stay active after it is
6544 /// created. Once 'ttl' expires, the snapshot will get deleted. The maximum
6545 /// amount of time a snapshot can stay active is 7 days. If 'ttl' is not
6546 /// specified, the default value of 24 hours will be used.
6547 pub ttl: std::option::Option<wkt::Duration>,
6548
6549 /// Description of the snapshot.
6550 pub description: std::string::String,
6551
6552 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6553}
6554
6555impl SnapshotTableRequest {
6556 /// Creates a new default instance.
6557 pub fn new() -> Self {
6558 std::default::Default::default()
6559 }
6560
6561 /// Sets the value of [name][crate::model::SnapshotTableRequest::name].
6562 ///
6563 /// # Example
6564 /// ```ignore,no_run
6565 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6566 /// # let project_id = "project_id";
6567 /// # let instance_id = "instance_id";
6568 /// # let table_id = "table_id";
6569 /// let x = SnapshotTableRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
6570 /// ```
6571 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6572 self.name = v.into();
6573 self
6574 }
6575
6576 /// Sets the value of [cluster][crate::model::SnapshotTableRequest::cluster].
6577 ///
6578 /// # Example
6579 /// ```ignore,no_run
6580 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6581 /// # let project_id = "project_id";
6582 /// # let instance_id = "instance_id";
6583 /// # let cluster_id = "cluster_id";
6584 /// let x = SnapshotTableRequest::new().set_cluster(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
6585 /// ```
6586 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6587 self.cluster = v.into();
6588 self
6589 }
6590
6591 /// Sets the value of [snapshot_id][crate::model::SnapshotTableRequest::snapshot_id].
6592 ///
6593 /// # Example
6594 /// ```ignore,no_run
6595 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6596 /// let x = SnapshotTableRequest::new().set_snapshot_id("example");
6597 /// ```
6598 pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6599 self.snapshot_id = v.into();
6600 self
6601 }
6602
6603 /// Sets the value of [ttl][crate::model::SnapshotTableRequest::ttl].
6604 ///
6605 /// # Example
6606 /// ```ignore,no_run
6607 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6608 /// use wkt::Duration;
6609 /// let x = SnapshotTableRequest::new().set_ttl(Duration::default()/* use setters */);
6610 /// ```
6611 pub fn set_ttl<T>(mut self, v: T) -> Self
6612 where
6613 T: std::convert::Into<wkt::Duration>,
6614 {
6615 self.ttl = std::option::Option::Some(v.into());
6616 self
6617 }
6618
6619 /// Sets or clears the value of [ttl][crate::model::SnapshotTableRequest::ttl].
6620 ///
6621 /// # Example
6622 /// ```ignore,no_run
6623 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6624 /// use wkt::Duration;
6625 /// let x = SnapshotTableRequest::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
6626 /// let x = SnapshotTableRequest::new().set_or_clear_ttl(None::<Duration>);
6627 /// ```
6628 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
6629 where
6630 T: std::convert::Into<wkt::Duration>,
6631 {
6632 self.ttl = v.map(|x| x.into());
6633 self
6634 }
6635
6636 /// Sets the value of [description][crate::model::SnapshotTableRequest::description].
6637 ///
6638 /// # Example
6639 /// ```ignore,no_run
6640 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6641 /// let x = SnapshotTableRequest::new().set_description("example");
6642 /// ```
6643 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6644 self.description = v.into();
6645 self
6646 }
6647}
6648
6649impl wkt::message::Message for SnapshotTableRequest {
6650 fn typename() -> &'static str {
6651 "type.googleapis.com/google.bigtable.admin.v2.SnapshotTableRequest"
6652 }
6653}
6654
6655/// Request message for
6656/// [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]
6657///
6658/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6659/// feature is not currently available to most Cloud Bigtable customers. This
6660/// feature might be changed in backward-incompatible ways and is not recommended
6661/// for production use. It is not subject to any SLA or deprecation policy.
6662///
6663/// [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]: crate::client::BigtableTableAdmin::get_snapshot
6664#[derive(Clone, Default, PartialEq)]
6665#[non_exhaustive]
6666pub struct GetSnapshotRequest {
6667 /// Required. The unique name of the requested snapshot.
6668 /// Values are of the form
6669 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
6670 pub name: std::string::String,
6671
6672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6673}
6674
6675impl GetSnapshotRequest {
6676 /// Creates a new default instance.
6677 pub fn new() -> Self {
6678 std::default::Default::default()
6679 }
6680
6681 /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
6682 ///
6683 /// # Example
6684 /// ```ignore,no_run
6685 /// # use google_cloud_bigtable_admin_v2::model::GetSnapshotRequest;
6686 /// # let project_id = "project_id";
6687 /// # let instance_id = "instance_id";
6688 /// # let cluster_id = "cluster_id";
6689 /// # let snapshot_id = "snapshot_id";
6690 /// let x = GetSnapshotRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/snapshots/{snapshot_id}"));
6691 /// ```
6692 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6693 self.name = v.into();
6694 self
6695 }
6696}
6697
6698impl wkt::message::Message for GetSnapshotRequest {
6699 fn typename() -> &'static str {
6700 "type.googleapis.com/google.bigtable.admin.v2.GetSnapshotRequest"
6701 }
6702}
6703
6704/// Request message for
6705/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
6706///
6707/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6708/// feature is not currently available to most Cloud Bigtable customers. This
6709/// feature might be changed in backward-incompatible ways and is not recommended
6710/// for production use. It is not subject to any SLA or deprecation policy.
6711///
6712/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]: crate::client::BigtableTableAdmin::list_snapshots
6713#[derive(Clone, Default, PartialEq)]
6714#[non_exhaustive]
6715pub struct ListSnapshotsRequest {
6716 /// Required. The unique name of the cluster for which snapshots should be
6717 /// listed. Values are of the form
6718 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
6719 /// Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
6720 /// e.g., `projects/{project}/instances/{instance}/clusters/-`.
6721 pub parent: std::string::String,
6722
6723 /// The maximum number of snapshots to return per page.
6724 /// CURRENTLY UNIMPLEMENTED AND IGNORED.
6725 pub page_size: i32,
6726
6727 /// The value of `next_page_token` returned by a previous call.
6728 pub page_token: std::string::String,
6729
6730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6731}
6732
6733impl ListSnapshotsRequest {
6734 /// Creates a new default instance.
6735 pub fn new() -> Self {
6736 std::default::Default::default()
6737 }
6738
6739 /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
6740 ///
6741 /// # Example
6742 /// ```ignore,no_run
6743 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsRequest;
6744 /// # let project_id = "project_id";
6745 /// # let instance_id = "instance_id";
6746 /// # let cluster_id = "cluster_id";
6747 /// let x = ListSnapshotsRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
6748 /// ```
6749 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6750 self.parent = v.into();
6751 self
6752 }
6753
6754 /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
6755 ///
6756 /// # Example
6757 /// ```ignore,no_run
6758 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsRequest;
6759 /// let x = ListSnapshotsRequest::new().set_page_size(42);
6760 /// ```
6761 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6762 self.page_size = v.into();
6763 self
6764 }
6765
6766 /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
6767 ///
6768 /// # Example
6769 /// ```ignore,no_run
6770 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsRequest;
6771 /// let x = ListSnapshotsRequest::new().set_page_token("example");
6772 /// ```
6773 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6774 self.page_token = v.into();
6775 self
6776 }
6777}
6778
6779impl wkt::message::Message for ListSnapshotsRequest {
6780 fn typename() -> &'static str {
6781 "type.googleapis.com/google.bigtable.admin.v2.ListSnapshotsRequest"
6782 }
6783}
6784
6785/// Response message for
6786/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
6787///
6788/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6789/// feature is not currently available to most Cloud Bigtable customers. This
6790/// feature might be changed in backward-incompatible ways and is not recommended
6791/// for production use. It is not subject to any SLA or deprecation policy.
6792///
6793/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]: crate::client::BigtableTableAdmin::list_snapshots
6794#[derive(Clone, Default, PartialEq)]
6795#[non_exhaustive]
6796pub struct ListSnapshotsResponse {
6797 /// The snapshots present in the requested cluster.
6798 pub snapshots: std::vec::Vec<crate::model::Snapshot>,
6799
6800 /// Set if not all snapshots could be returned in a single response.
6801 /// Pass this value to `page_token` in another request to get the next
6802 /// page of results.
6803 pub next_page_token: std::string::String,
6804
6805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6806}
6807
6808impl ListSnapshotsResponse {
6809 /// Creates a new default instance.
6810 pub fn new() -> Self {
6811 std::default::Default::default()
6812 }
6813
6814 /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
6815 ///
6816 /// # Example
6817 /// ```ignore,no_run
6818 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsResponse;
6819 /// use google_cloud_bigtable_admin_v2::model::Snapshot;
6820 /// let x = ListSnapshotsResponse::new()
6821 /// .set_snapshots([
6822 /// Snapshot::default()/* use setters */,
6823 /// Snapshot::default()/* use (different) setters */,
6824 /// ]);
6825 /// ```
6826 pub fn set_snapshots<T, V>(mut self, v: T) -> Self
6827 where
6828 T: std::iter::IntoIterator<Item = V>,
6829 V: std::convert::Into<crate::model::Snapshot>,
6830 {
6831 use std::iter::Iterator;
6832 self.snapshots = v.into_iter().map(|i| i.into()).collect();
6833 self
6834 }
6835
6836 /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
6837 ///
6838 /// # Example
6839 /// ```ignore,no_run
6840 /// # use google_cloud_bigtable_admin_v2::model::ListSnapshotsResponse;
6841 /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
6842 /// ```
6843 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6844 self.next_page_token = v.into();
6845 self
6846 }
6847}
6848
6849impl wkt::message::Message for ListSnapshotsResponse {
6850 fn typename() -> &'static str {
6851 "type.googleapis.com/google.bigtable.admin.v2.ListSnapshotsResponse"
6852 }
6853}
6854
6855#[doc(hidden)]
6856impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
6857 type PageItem = crate::model::Snapshot;
6858
6859 fn items(self) -> std::vec::Vec<Self::PageItem> {
6860 self.snapshots
6861 }
6862
6863 fn next_page_token(&self) -> std::string::String {
6864 use std::clone::Clone;
6865 self.next_page_token.clone()
6866 }
6867}
6868
6869/// Request message for
6870/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]
6871///
6872/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6873/// feature is not currently available to most Cloud Bigtable customers. This
6874/// feature might be changed in backward-incompatible ways and is not recommended
6875/// for production use. It is not subject to any SLA or deprecation policy.
6876///
6877/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]: crate::client::BigtableTableAdmin::delete_snapshot
6878#[derive(Clone, Default, PartialEq)]
6879#[non_exhaustive]
6880pub struct DeleteSnapshotRequest {
6881 /// Required. The unique name of the snapshot to be deleted.
6882 /// Values are of the form
6883 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
6884 pub name: std::string::String,
6885
6886 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6887}
6888
6889impl DeleteSnapshotRequest {
6890 /// Creates a new default instance.
6891 pub fn new() -> Self {
6892 std::default::Default::default()
6893 }
6894
6895 /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
6896 ///
6897 /// # Example
6898 /// ```ignore,no_run
6899 /// # use google_cloud_bigtable_admin_v2::model::DeleteSnapshotRequest;
6900 /// # let project_id = "project_id";
6901 /// # let instance_id = "instance_id";
6902 /// # let cluster_id = "cluster_id";
6903 /// # let snapshot_id = "snapshot_id";
6904 /// let x = DeleteSnapshotRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/snapshots/{snapshot_id}"));
6905 /// ```
6906 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6907 self.name = v.into();
6908 self
6909 }
6910}
6911
6912impl wkt::message::Message for DeleteSnapshotRequest {
6913 fn typename() -> &'static str {
6914 "type.googleapis.com/google.bigtable.admin.v2.DeleteSnapshotRequest"
6915 }
6916}
6917
6918/// The metadata for the Operation returned by SnapshotTable.
6919///
6920/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
6921/// feature is not currently available to most Cloud Bigtable customers. This
6922/// feature might be changed in backward-incompatible ways and is not recommended
6923/// for production use. It is not subject to any SLA or deprecation policy.
6924#[derive(Clone, Default, PartialEq)]
6925#[non_exhaustive]
6926pub struct SnapshotTableMetadata {
6927 /// The request that prompted the initiation of this SnapshotTable operation.
6928 pub original_request: std::option::Option<crate::model::SnapshotTableRequest>,
6929
6930 /// The time at which the original request was received.
6931 pub request_time: std::option::Option<wkt::Timestamp>,
6932
6933 /// The time at which the operation failed or was completed successfully.
6934 pub finish_time: std::option::Option<wkt::Timestamp>,
6935
6936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6937}
6938
6939impl SnapshotTableMetadata {
6940 /// Creates a new default instance.
6941 pub fn new() -> Self {
6942 std::default::Default::default()
6943 }
6944
6945 /// Sets the value of [original_request][crate::model::SnapshotTableMetadata::original_request].
6946 ///
6947 /// # Example
6948 /// ```ignore,no_run
6949 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6950 /// use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6951 /// let x = SnapshotTableMetadata::new().set_original_request(SnapshotTableRequest::default()/* use setters */);
6952 /// ```
6953 pub fn set_original_request<T>(mut self, v: T) -> Self
6954 where
6955 T: std::convert::Into<crate::model::SnapshotTableRequest>,
6956 {
6957 self.original_request = std::option::Option::Some(v.into());
6958 self
6959 }
6960
6961 /// Sets or clears the value of [original_request][crate::model::SnapshotTableMetadata::original_request].
6962 ///
6963 /// # Example
6964 /// ```ignore,no_run
6965 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6966 /// use google_cloud_bigtable_admin_v2::model::SnapshotTableRequest;
6967 /// let x = SnapshotTableMetadata::new().set_or_clear_original_request(Some(SnapshotTableRequest::default()/* use setters */));
6968 /// let x = SnapshotTableMetadata::new().set_or_clear_original_request(None::<SnapshotTableRequest>);
6969 /// ```
6970 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
6971 where
6972 T: std::convert::Into<crate::model::SnapshotTableRequest>,
6973 {
6974 self.original_request = v.map(|x| x.into());
6975 self
6976 }
6977
6978 /// Sets the value of [request_time][crate::model::SnapshotTableMetadata::request_time].
6979 ///
6980 /// # Example
6981 /// ```ignore,no_run
6982 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6983 /// use wkt::Timestamp;
6984 /// let x = SnapshotTableMetadata::new().set_request_time(Timestamp::default()/* use setters */);
6985 /// ```
6986 pub fn set_request_time<T>(mut self, v: T) -> Self
6987 where
6988 T: std::convert::Into<wkt::Timestamp>,
6989 {
6990 self.request_time = std::option::Option::Some(v.into());
6991 self
6992 }
6993
6994 /// Sets or clears the value of [request_time][crate::model::SnapshotTableMetadata::request_time].
6995 ///
6996 /// # Example
6997 /// ```ignore,no_run
6998 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
6999 /// use wkt::Timestamp;
7000 /// let x = SnapshotTableMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
7001 /// let x = SnapshotTableMetadata::new().set_or_clear_request_time(None::<Timestamp>);
7002 /// ```
7003 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
7004 where
7005 T: std::convert::Into<wkt::Timestamp>,
7006 {
7007 self.request_time = v.map(|x| x.into());
7008 self
7009 }
7010
7011 /// Sets the value of [finish_time][crate::model::SnapshotTableMetadata::finish_time].
7012 ///
7013 /// # Example
7014 /// ```ignore,no_run
7015 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
7016 /// use wkt::Timestamp;
7017 /// let x = SnapshotTableMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
7018 /// ```
7019 pub fn set_finish_time<T>(mut self, v: T) -> Self
7020 where
7021 T: std::convert::Into<wkt::Timestamp>,
7022 {
7023 self.finish_time = std::option::Option::Some(v.into());
7024 self
7025 }
7026
7027 /// Sets or clears the value of [finish_time][crate::model::SnapshotTableMetadata::finish_time].
7028 ///
7029 /// # Example
7030 /// ```ignore,no_run
7031 /// # use google_cloud_bigtable_admin_v2::model::SnapshotTableMetadata;
7032 /// use wkt::Timestamp;
7033 /// let x = SnapshotTableMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
7034 /// let x = SnapshotTableMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
7035 /// ```
7036 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
7037 where
7038 T: std::convert::Into<wkt::Timestamp>,
7039 {
7040 self.finish_time = v.map(|x| x.into());
7041 self
7042 }
7043}
7044
7045impl wkt::message::Message for SnapshotTableMetadata {
7046 fn typename() -> &'static str {
7047 "type.googleapis.com/google.bigtable.admin.v2.SnapshotTableMetadata"
7048 }
7049}
7050
7051/// The metadata for the Operation returned by CreateTableFromSnapshot.
7052///
7053/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
7054/// feature is not currently available to most Cloud Bigtable customers. This
7055/// feature might be changed in backward-incompatible ways and is not recommended
7056/// for production use. It is not subject to any SLA or deprecation policy.
7057#[derive(Clone, Default, PartialEq)]
7058#[non_exhaustive]
7059pub struct CreateTableFromSnapshotMetadata {
7060 /// The request that prompted the initiation of this CreateTableFromSnapshot
7061 /// operation.
7062 pub original_request: std::option::Option<crate::model::CreateTableFromSnapshotRequest>,
7063
7064 /// The time at which the original request was received.
7065 pub request_time: std::option::Option<wkt::Timestamp>,
7066
7067 /// The time at which the operation failed or was completed successfully.
7068 pub finish_time: std::option::Option<wkt::Timestamp>,
7069
7070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7071}
7072
7073impl CreateTableFromSnapshotMetadata {
7074 /// Creates a new default instance.
7075 pub fn new() -> Self {
7076 std::default::Default::default()
7077 }
7078
7079 /// Sets the value of [original_request][crate::model::CreateTableFromSnapshotMetadata::original_request].
7080 ///
7081 /// # Example
7082 /// ```ignore,no_run
7083 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
7084 /// use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
7085 /// let x = CreateTableFromSnapshotMetadata::new().set_original_request(CreateTableFromSnapshotRequest::default()/* use setters */);
7086 /// ```
7087 pub fn set_original_request<T>(mut self, v: T) -> Self
7088 where
7089 T: std::convert::Into<crate::model::CreateTableFromSnapshotRequest>,
7090 {
7091 self.original_request = std::option::Option::Some(v.into());
7092 self
7093 }
7094
7095 /// Sets or clears the value of [original_request][crate::model::CreateTableFromSnapshotMetadata::original_request].
7096 ///
7097 /// # Example
7098 /// ```ignore,no_run
7099 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
7100 /// use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotRequest;
7101 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_original_request(Some(CreateTableFromSnapshotRequest::default()/* use setters */));
7102 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_original_request(None::<CreateTableFromSnapshotRequest>);
7103 /// ```
7104 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
7105 where
7106 T: std::convert::Into<crate::model::CreateTableFromSnapshotRequest>,
7107 {
7108 self.original_request = v.map(|x| x.into());
7109 self
7110 }
7111
7112 /// Sets the value of [request_time][crate::model::CreateTableFromSnapshotMetadata::request_time].
7113 ///
7114 /// # Example
7115 /// ```ignore,no_run
7116 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
7117 /// use wkt::Timestamp;
7118 /// let x = CreateTableFromSnapshotMetadata::new().set_request_time(Timestamp::default()/* use setters */);
7119 /// ```
7120 pub fn set_request_time<T>(mut self, v: T) -> Self
7121 where
7122 T: std::convert::Into<wkt::Timestamp>,
7123 {
7124 self.request_time = std::option::Option::Some(v.into());
7125 self
7126 }
7127
7128 /// Sets or clears the value of [request_time][crate::model::CreateTableFromSnapshotMetadata::request_time].
7129 ///
7130 /// # Example
7131 /// ```ignore,no_run
7132 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
7133 /// use wkt::Timestamp;
7134 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
7135 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_request_time(None::<Timestamp>);
7136 /// ```
7137 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
7138 where
7139 T: std::convert::Into<wkt::Timestamp>,
7140 {
7141 self.request_time = v.map(|x| x.into());
7142 self
7143 }
7144
7145 /// Sets the value of [finish_time][crate::model::CreateTableFromSnapshotMetadata::finish_time].
7146 ///
7147 /// # Example
7148 /// ```ignore,no_run
7149 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
7150 /// use wkt::Timestamp;
7151 /// let x = CreateTableFromSnapshotMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
7152 /// ```
7153 pub fn set_finish_time<T>(mut self, v: T) -> Self
7154 where
7155 T: std::convert::Into<wkt::Timestamp>,
7156 {
7157 self.finish_time = std::option::Option::Some(v.into());
7158 self
7159 }
7160
7161 /// Sets or clears the value of [finish_time][crate::model::CreateTableFromSnapshotMetadata::finish_time].
7162 ///
7163 /// # Example
7164 /// ```ignore,no_run
7165 /// # use google_cloud_bigtable_admin_v2::model::CreateTableFromSnapshotMetadata;
7166 /// use wkt::Timestamp;
7167 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
7168 /// let x = CreateTableFromSnapshotMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
7169 /// ```
7170 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
7171 where
7172 T: std::convert::Into<wkt::Timestamp>,
7173 {
7174 self.finish_time = v.map(|x| x.into());
7175 self
7176 }
7177}
7178
7179impl wkt::message::Message for CreateTableFromSnapshotMetadata {
7180 fn typename() -> &'static str {
7181 "type.googleapis.com/google.bigtable.admin.v2.CreateTableFromSnapshotMetadata"
7182 }
7183}
7184
7185/// The request for
7186/// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
7187///
7188/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]: crate::client::BigtableTableAdmin::create_backup
7189#[derive(Clone, Default, PartialEq)]
7190#[non_exhaustive]
7191pub struct CreateBackupRequest {
7192 /// Required. This must be one of the clusters in the instance in which this
7193 /// table is located. The backup will be stored in this cluster. Values are
7194 /// of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
7195 pub parent: std::string::String,
7196
7197 /// Required. The id of the backup to be created. The `backup_id` along with
7198 /// the parent `parent` are combined as {parent}/backups/{backup_id} to create
7199 /// the full backup name, of the form:
7200 /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
7201 /// This string must be between 1 and 50 characters in length and match the
7202 /// regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
7203 pub backup_id: std::string::String,
7204
7205 /// Required. The backup to create.
7206 pub backup: std::option::Option<crate::model::Backup>,
7207
7208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7209}
7210
7211impl CreateBackupRequest {
7212 /// Creates a new default instance.
7213 pub fn new() -> Self {
7214 std::default::Default::default()
7215 }
7216
7217 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
7218 ///
7219 /// # Example
7220 /// ```ignore,no_run
7221 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupRequest;
7222 /// # let project_id = "project_id";
7223 /// # let instance_id = "instance_id";
7224 /// # let cluster_id = "cluster_id";
7225 /// let x = CreateBackupRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
7226 /// ```
7227 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7228 self.parent = v.into();
7229 self
7230 }
7231
7232 /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
7233 ///
7234 /// # Example
7235 /// ```ignore,no_run
7236 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupRequest;
7237 /// let x = CreateBackupRequest::new().set_backup_id("example");
7238 /// ```
7239 pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7240 self.backup_id = v.into();
7241 self
7242 }
7243
7244 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
7245 ///
7246 /// # Example
7247 /// ```ignore,no_run
7248 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupRequest;
7249 /// use google_cloud_bigtable_admin_v2::model::Backup;
7250 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
7251 /// ```
7252 pub fn set_backup<T>(mut self, v: T) -> Self
7253 where
7254 T: std::convert::Into<crate::model::Backup>,
7255 {
7256 self.backup = std::option::Option::Some(v.into());
7257 self
7258 }
7259
7260 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
7261 ///
7262 /// # Example
7263 /// ```ignore,no_run
7264 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupRequest;
7265 /// use google_cloud_bigtable_admin_v2::model::Backup;
7266 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
7267 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
7268 /// ```
7269 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
7270 where
7271 T: std::convert::Into<crate::model::Backup>,
7272 {
7273 self.backup = v.map(|x| x.into());
7274 self
7275 }
7276}
7277
7278impl wkt::message::Message for CreateBackupRequest {
7279 fn typename() -> &'static str {
7280 "type.googleapis.com/google.bigtable.admin.v2.CreateBackupRequest"
7281 }
7282}
7283
7284/// Metadata type for the operation returned by
7285/// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
7286///
7287/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]: crate::client::BigtableTableAdmin::create_backup
7288#[derive(Clone, Default, PartialEq)]
7289#[non_exhaustive]
7290pub struct CreateBackupMetadata {
7291 /// The name of the backup being created.
7292 pub name: std::string::String,
7293
7294 /// The name of the table the backup is created from.
7295 pub source_table: std::string::String,
7296
7297 /// The time at which this operation started.
7298 pub start_time: std::option::Option<wkt::Timestamp>,
7299
7300 /// If set, the time at which this operation finished or was cancelled.
7301 pub end_time: std::option::Option<wkt::Timestamp>,
7302
7303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7304}
7305
7306impl CreateBackupMetadata {
7307 /// Creates a new default instance.
7308 pub fn new() -> Self {
7309 std::default::Default::default()
7310 }
7311
7312 /// Sets the value of [name][crate::model::CreateBackupMetadata::name].
7313 ///
7314 /// # Example
7315 /// ```ignore,no_run
7316 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
7317 /// let x = CreateBackupMetadata::new().set_name("example");
7318 /// ```
7319 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7320 self.name = v.into();
7321 self
7322 }
7323
7324 /// Sets the value of [source_table][crate::model::CreateBackupMetadata::source_table].
7325 ///
7326 /// # Example
7327 /// ```ignore,no_run
7328 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
7329 /// let x = CreateBackupMetadata::new().set_source_table("example");
7330 /// ```
7331 pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7332 self.source_table = v.into();
7333 self
7334 }
7335
7336 /// Sets the value of [start_time][crate::model::CreateBackupMetadata::start_time].
7337 ///
7338 /// # Example
7339 /// ```ignore,no_run
7340 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
7341 /// use wkt::Timestamp;
7342 /// let x = CreateBackupMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7343 /// ```
7344 pub fn set_start_time<T>(mut self, v: T) -> Self
7345 where
7346 T: std::convert::Into<wkt::Timestamp>,
7347 {
7348 self.start_time = std::option::Option::Some(v.into());
7349 self
7350 }
7351
7352 /// Sets or clears the value of [start_time][crate::model::CreateBackupMetadata::start_time].
7353 ///
7354 /// # Example
7355 /// ```ignore,no_run
7356 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
7357 /// use wkt::Timestamp;
7358 /// let x = CreateBackupMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7359 /// let x = CreateBackupMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7360 /// ```
7361 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7362 where
7363 T: std::convert::Into<wkt::Timestamp>,
7364 {
7365 self.start_time = v.map(|x| x.into());
7366 self
7367 }
7368
7369 /// Sets the value of [end_time][crate::model::CreateBackupMetadata::end_time].
7370 ///
7371 /// # Example
7372 /// ```ignore,no_run
7373 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
7374 /// use wkt::Timestamp;
7375 /// let x = CreateBackupMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7376 /// ```
7377 pub fn set_end_time<T>(mut self, v: T) -> Self
7378 where
7379 T: std::convert::Into<wkt::Timestamp>,
7380 {
7381 self.end_time = std::option::Option::Some(v.into());
7382 self
7383 }
7384
7385 /// Sets or clears the value of [end_time][crate::model::CreateBackupMetadata::end_time].
7386 ///
7387 /// # Example
7388 /// ```ignore,no_run
7389 /// # use google_cloud_bigtable_admin_v2::model::CreateBackupMetadata;
7390 /// use wkt::Timestamp;
7391 /// let x = CreateBackupMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7392 /// let x = CreateBackupMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7393 /// ```
7394 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7395 where
7396 T: std::convert::Into<wkt::Timestamp>,
7397 {
7398 self.end_time = v.map(|x| x.into());
7399 self
7400 }
7401}
7402
7403impl wkt::message::Message for CreateBackupMetadata {
7404 fn typename() -> &'static str {
7405 "type.googleapis.com/google.bigtable.admin.v2.CreateBackupMetadata"
7406 }
7407}
7408
7409/// The request for
7410/// [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup].
7411///
7412/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]: crate::client::BigtableTableAdmin::update_backup
7413#[derive(Clone, Default, PartialEq)]
7414#[non_exhaustive]
7415pub struct UpdateBackupRequest {
7416 /// Required. The backup to update. `backup.name`, and the fields to be updated
7417 /// as specified by `update_mask` are required. Other fields are ignored.
7418 /// Update is only supported for the following fields:
7419 ///
7420 /// * `backup.expire_time`.
7421 pub backup: std::option::Option<crate::model::Backup>,
7422
7423 /// Required. A mask specifying which fields (e.g. `expire_time`) in the
7424 /// Backup resource should be updated. This mask is relative to the Backup
7425 /// resource, not to the request message. The field mask must always be
7426 /// specified; this prevents any future fields from being erased accidentally
7427 /// by clients that do not know about them.
7428 pub update_mask: std::option::Option<wkt::FieldMask>,
7429
7430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7431}
7432
7433impl UpdateBackupRequest {
7434 /// Creates a new default instance.
7435 pub fn new() -> Self {
7436 std::default::Default::default()
7437 }
7438
7439 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
7440 ///
7441 /// # Example
7442 /// ```ignore,no_run
7443 /// # use google_cloud_bigtable_admin_v2::model::UpdateBackupRequest;
7444 /// use google_cloud_bigtable_admin_v2::model::Backup;
7445 /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
7446 /// ```
7447 pub fn set_backup<T>(mut self, v: T) -> Self
7448 where
7449 T: std::convert::Into<crate::model::Backup>,
7450 {
7451 self.backup = std::option::Option::Some(v.into());
7452 self
7453 }
7454
7455 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
7456 ///
7457 /// # Example
7458 /// ```ignore,no_run
7459 /// # use google_cloud_bigtable_admin_v2::model::UpdateBackupRequest;
7460 /// use google_cloud_bigtable_admin_v2::model::Backup;
7461 /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
7462 /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
7463 /// ```
7464 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
7465 where
7466 T: std::convert::Into<crate::model::Backup>,
7467 {
7468 self.backup = v.map(|x| x.into());
7469 self
7470 }
7471
7472 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
7473 ///
7474 /// # Example
7475 /// ```ignore,no_run
7476 /// # use google_cloud_bigtable_admin_v2::model::UpdateBackupRequest;
7477 /// use wkt::FieldMask;
7478 /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7479 /// ```
7480 pub fn set_update_mask<T>(mut self, v: T) -> Self
7481 where
7482 T: std::convert::Into<wkt::FieldMask>,
7483 {
7484 self.update_mask = std::option::Option::Some(v.into());
7485 self
7486 }
7487
7488 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
7489 ///
7490 /// # Example
7491 /// ```ignore,no_run
7492 /// # use google_cloud_bigtable_admin_v2::model::UpdateBackupRequest;
7493 /// use wkt::FieldMask;
7494 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7495 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7496 /// ```
7497 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7498 where
7499 T: std::convert::Into<wkt::FieldMask>,
7500 {
7501 self.update_mask = v.map(|x| x.into());
7502 self
7503 }
7504}
7505
7506impl wkt::message::Message for UpdateBackupRequest {
7507 fn typename() -> &'static str {
7508 "type.googleapis.com/google.bigtable.admin.v2.UpdateBackupRequest"
7509 }
7510}
7511
7512/// The request for
7513/// [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup].
7514///
7515/// [google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]: crate::client::BigtableTableAdmin::get_backup
7516#[derive(Clone, Default, PartialEq)]
7517#[non_exhaustive]
7518pub struct GetBackupRequest {
7519 /// Required. Name of the backup.
7520 /// Values are of the form
7521 /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
7522 pub name: std::string::String,
7523
7524 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7525}
7526
7527impl GetBackupRequest {
7528 /// Creates a new default instance.
7529 pub fn new() -> Self {
7530 std::default::Default::default()
7531 }
7532
7533 /// Sets the value of [name][crate::model::GetBackupRequest::name].
7534 ///
7535 /// # Example
7536 /// ```ignore,no_run
7537 /// # use google_cloud_bigtable_admin_v2::model::GetBackupRequest;
7538 /// # let project_id = "project_id";
7539 /// # let instance_id = "instance_id";
7540 /// # let cluster_id = "cluster_id";
7541 /// # let backup_id = "backup_id";
7542 /// let x = GetBackupRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"));
7543 /// ```
7544 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7545 self.name = v.into();
7546 self
7547 }
7548}
7549
7550impl wkt::message::Message for GetBackupRequest {
7551 fn typename() -> &'static str {
7552 "type.googleapis.com/google.bigtable.admin.v2.GetBackupRequest"
7553 }
7554}
7555
7556/// The request for
7557/// [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup].
7558///
7559/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]: crate::client::BigtableTableAdmin::delete_backup
7560#[derive(Clone, Default, PartialEq)]
7561#[non_exhaustive]
7562pub struct DeleteBackupRequest {
7563 /// Required. Name of the backup to delete.
7564 /// Values are of the form
7565 /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
7566 pub name: std::string::String,
7567
7568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7569}
7570
7571impl DeleteBackupRequest {
7572 /// Creates a new default instance.
7573 pub fn new() -> Self {
7574 std::default::Default::default()
7575 }
7576
7577 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
7578 ///
7579 /// # Example
7580 /// ```ignore,no_run
7581 /// # use google_cloud_bigtable_admin_v2::model::DeleteBackupRequest;
7582 /// # let project_id = "project_id";
7583 /// # let instance_id = "instance_id";
7584 /// # let cluster_id = "cluster_id";
7585 /// # let backup_id = "backup_id";
7586 /// let x = DeleteBackupRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"));
7587 /// ```
7588 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7589 self.name = v.into();
7590 self
7591 }
7592}
7593
7594impl wkt::message::Message for DeleteBackupRequest {
7595 fn typename() -> &'static str {
7596 "type.googleapis.com/google.bigtable.admin.v2.DeleteBackupRequest"
7597 }
7598}
7599
7600/// The request for
7601/// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
7602///
7603/// [google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]: crate::client::BigtableTableAdmin::list_backups
7604#[derive(Clone, Default, PartialEq)]
7605#[non_exhaustive]
7606pub struct ListBackupsRequest {
7607 /// Required. The cluster to list backups from. Values are of the
7608 /// form `projects/{project}/instances/{instance}/clusters/{cluster}`.
7609 /// Use `{cluster} = '-'` to list backups for all clusters in an instance,
7610 /// e.g., `projects/{project}/instances/{instance}/clusters/-`.
7611 pub parent: std::string::String,
7612
7613 /// A filter expression that filters backups listed in the response.
7614 /// The expression must specify the field name, a comparison operator,
7615 /// and the value that you want to use for filtering. The value must be a
7616 /// string, a number, or a boolean. The comparison operator must be
7617 /// <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
7618 /// roughly synonymous with equality. Filter rules are case insensitive.
7619 ///
7620 /// The fields eligible for filtering are:
7621 ///
7622 /// * `name`
7623 /// * `source_table`
7624 /// * `state`
7625 /// * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
7626 /// * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
7627 /// * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
7628 /// * `size_bytes`
7629 ///
7630 /// To filter on multiple expressions, provide each separate expression within
7631 /// parentheses. By default, each expression is an AND expression. However,
7632 /// you can include AND, OR, and NOT expressions explicitly.
7633 ///
7634 /// Some examples of using filters are:
7635 ///
7636 /// * `name:"exact"` --> The backup's name is the string "exact".
7637 /// * `name:howl` --> The backup's name contains the string "howl".
7638 /// * `source_table:prod`
7639 /// --> The source_table's name contains the string "prod".
7640 /// * `state:CREATING` --> The backup is pending creation.
7641 /// * `state:READY` --> The backup is fully created and ready for use.
7642 /// * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
7643 /// --> The backup name contains the string "howl" and start_time
7644 /// of the backup is before 2018-03-28T14:50:00Z.
7645 /// * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
7646 pub filter: std::string::String,
7647
7648 /// An expression for specifying the sort order of the results of the request.
7649 /// The string value should specify one or more fields in
7650 /// [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
7651 /// <https://aip.dev/132#ordering>.
7652 ///
7653 /// Fields supported are:
7654 ///
7655 /// * name
7656 /// * source_table
7657 /// * expire_time
7658 /// * start_time
7659 /// * end_time
7660 /// * size_bytes
7661 /// * state
7662 ///
7663 /// For example, "start_time". The default sorting order is ascending.
7664 /// To specify descending order for the field, a suffix " desc" should
7665 /// be appended to the field name. For example, "start_time desc".
7666 /// Redundant space characters in the syntax are insigificant.
7667 ///
7668 /// If order_by is empty, results will be sorted by `start_time` in descending
7669 /// order starting from the most recently created backup.
7670 ///
7671 /// [google.bigtable.admin.v2.Backup]: crate::model::Backup
7672 pub order_by: std::string::String,
7673
7674 /// Number of backups to be returned in the response. If 0 or
7675 /// less, defaults to the server's maximum allowed page size.
7676 pub page_size: i32,
7677
7678 /// If non-empty, `page_token` should contain a
7679 /// [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
7680 /// from a previous
7681 /// [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
7682 /// same `parent` and with the same `filter`.
7683 ///
7684 /// [google.bigtable.admin.v2.ListBackupsResponse]: crate::model::ListBackupsResponse
7685 /// [google.bigtable.admin.v2.ListBackupsResponse.next_page_token]: crate::model::ListBackupsResponse::next_page_token
7686 pub page_token: std::string::String,
7687
7688 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7689}
7690
7691impl ListBackupsRequest {
7692 /// Creates a new default instance.
7693 pub fn new() -> Self {
7694 std::default::Default::default()
7695 }
7696
7697 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
7698 ///
7699 /// # Example
7700 /// ```ignore,no_run
7701 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7702 /// # let project_id = "project_id";
7703 /// # let instance_id = "instance_id";
7704 /// # let cluster_id = "cluster_id";
7705 /// let x = ListBackupsRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
7706 /// ```
7707 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7708 self.parent = v.into();
7709 self
7710 }
7711
7712 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
7713 ///
7714 /// # Example
7715 /// ```ignore,no_run
7716 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7717 /// let x = ListBackupsRequest::new().set_filter("example");
7718 /// ```
7719 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7720 self.filter = v.into();
7721 self
7722 }
7723
7724 /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
7725 ///
7726 /// # Example
7727 /// ```ignore,no_run
7728 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7729 /// let x = ListBackupsRequest::new().set_order_by("example");
7730 /// ```
7731 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7732 self.order_by = v.into();
7733 self
7734 }
7735
7736 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
7737 ///
7738 /// # Example
7739 /// ```ignore,no_run
7740 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7741 /// let x = ListBackupsRequest::new().set_page_size(42);
7742 /// ```
7743 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7744 self.page_size = v.into();
7745 self
7746 }
7747
7748 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
7749 ///
7750 /// # Example
7751 /// ```ignore,no_run
7752 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsRequest;
7753 /// let x = ListBackupsRequest::new().set_page_token("example");
7754 /// ```
7755 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7756 self.page_token = v.into();
7757 self
7758 }
7759}
7760
7761impl wkt::message::Message for ListBackupsRequest {
7762 fn typename() -> &'static str {
7763 "type.googleapis.com/google.bigtable.admin.v2.ListBackupsRequest"
7764 }
7765}
7766
7767/// The response for
7768/// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
7769///
7770/// [google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]: crate::client::BigtableTableAdmin::list_backups
7771#[derive(Clone, Default, PartialEq)]
7772#[non_exhaustive]
7773pub struct ListBackupsResponse {
7774 /// The list of matching backups.
7775 pub backups: std::vec::Vec<crate::model::Backup>,
7776
7777 /// `next_page_token` can be sent in a subsequent
7778 /// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
7779 /// to fetch more of the matching backups.
7780 ///
7781 /// [google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]: crate::client::BigtableTableAdmin::list_backups
7782 pub next_page_token: std::string::String,
7783
7784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7785}
7786
7787impl ListBackupsResponse {
7788 /// Creates a new default instance.
7789 pub fn new() -> Self {
7790 std::default::Default::default()
7791 }
7792
7793 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
7794 ///
7795 /// # Example
7796 /// ```ignore,no_run
7797 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsResponse;
7798 /// use google_cloud_bigtable_admin_v2::model::Backup;
7799 /// let x = ListBackupsResponse::new()
7800 /// .set_backups([
7801 /// Backup::default()/* use setters */,
7802 /// Backup::default()/* use (different) setters */,
7803 /// ]);
7804 /// ```
7805 pub fn set_backups<T, V>(mut self, v: T) -> Self
7806 where
7807 T: std::iter::IntoIterator<Item = V>,
7808 V: std::convert::Into<crate::model::Backup>,
7809 {
7810 use std::iter::Iterator;
7811 self.backups = v.into_iter().map(|i| i.into()).collect();
7812 self
7813 }
7814
7815 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
7816 ///
7817 /// # Example
7818 /// ```ignore,no_run
7819 /// # use google_cloud_bigtable_admin_v2::model::ListBackupsResponse;
7820 /// let x = ListBackupsResponse::new().set_next_page_token("example");
7821 /// ```
7822 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7823 self.next_page_token = v.into();
7824 self
7825 }
7826}
7827
7828impl wkt::message::Message for ListBackupsResponse {
7829 fn typename() -> &'static str {
7830 "type.googleapis.com/google.bigtable.admin.v2.ListBackupsResponse"
7831 }
7832}
7833
7834#[doc(hidden)]
7835impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
7836 type PageItem = crate::model::Backup;
7837
7838 fn items(self) -> std::vec::Vec<Self::PageItem> {
7839 self.backups
7840 }
7841
7842 fn next_page_token(&self) -> std::string::String {
7843 use std::clone::Clone;
7844 self.next_page_token.clone()
7845 }
7846}
7847
7848/// The request for
7849/// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
7850///
7851/// [google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]: crate::client::BigtableTableAdmin::copy_backup
7852#[derive(Clone, Default, PartialEq)]
7853#[non_exhaustive]
7854pub struct CopyBackupRequest {
7855 /// Required. The name of the destination cluster that will contain the backup
7856 /// copy. The cluster must already exist. Values are of the form:
7857 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
7858 pub parent: std::string::String,
7859
7860 /// Required. The id of the new backup. The `backup_id` along with `parent`
7861 /// are combined as {parent}/backups/{backup_id} to create the full backup
7862 /// name, of the form:
7863 /// `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
7864 /// This string must be between 1 and 50 characters in length and match the
7865 /// regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
7866 pub backup_id: std::string::String,
7867
7868 /// Required. The source backup to be copied from.
7869 /// The source backup needs to be in READY state for it to be copied.
7870 /// Copying a copied backup is not allowed.
7871 /// Once CopyBackup is in progress, the source backup cannot be deleted or
7872 /// cleaned up on expiration until CopyBackup is finished.
7873 /// Values are of the form:
7874 /// `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
7875 pub source_backup: std::string::String,
7876
7877 /// Required. Required. The expiration time of the copied backup with
7878 /// microsecond granularity that must be at least 6 hours and at most 30 days
7879 /// from the time the request is received. Once the `expire_time` has
7880 /// passed, Cloud Bigtable will delete the backup and free the resources used
7881 /// by the backup.
7882 pub expire_time: std::option::Option<wkt::Timestamp>,
7883
7884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7885}
7886
7887impl CopyBackupRequest {
7888 /// Creates a new default instance.
7889 pub fn new() -> Self {
7890 std::default::Default::default()
7891 }
7892
7893 /// Sets the value of [parent][crate::model::CopyBackupRequest::parent].
7894 ///
7895 /// # Example
7896 /// ```ignore,no_run
7897 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7898 /// # let project_id = "project_id";
7899 /// # let instance_id = "instance_id";
7900 /// # let cluster_id = "cluster_id";
7901 /// let x = CopyBackupRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
7902 /// ```
7903 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7904 self.parent = v.into();
7905 self
7906 }
7907
7908 /// Sets the value of [backup_id][crate::model::CopyBackupRequest::backup_id].
7909 ///
7910 /// # Example
7911 /// ```ignore,no_run
7912 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7913 /// let x = CopyBackupRequest::new().set_backup_id("example");
7914 /// ```
7915 pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7916 self.backup_id = v.into();
7917 self
7918 }
7919
7920 /// Sets the value of [source_backup][crate::model::CopyBackupRequest::source_backup].
7921 ///
7922 /// # Example
7923 /// ```ignore,no_run
7924 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7925 /// # let project_id = "project_id";
7926 /// # let instance_id = "instance_id";
7927 /// # let cluster_id = "cluster_id";
7928 /// # let backup_id = "backup_id";
7929 /// let x = CopyBackupRequest::new().set_source_backup(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"));
7930 /// ```
7931 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7932 self.source_backup = v.into();
7933 self
7934 }
7935
7936 /// Sets the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
7937 ///
7938 /// # Example
7939 /// ```ignore,no_run
7940 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7941 /// use wkt::Timestamp;
7942 /// let x = CopyBackupRequest::new().set_expire_time(Timestamp::default()/* use setters */);
7943 /// ```
7944 pub fn set_expire_time<T>(mut self, v: T) -> Self
7945 where
7946 T: std::convert::Into<wkt::Timestamp>,
7947 {
7948 self.expire_time = std::option::Option::Some(v.into());
7949 self
7950 }
7951
7952 /// Sets or clears the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
7953 ///
7954 /// # Example
7955 /// ```ignore,no_run
7956 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupRequest;
7957 /// use wkt::Timestamp;
7958 /// let x = CopyBackupRequest::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
7959 /// let x = CopyBackupRequest::new().set_or_clear_expire_time(None::<Timestamp>);
7960 /// ```
7961 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
7962 where
7963 T: std::convert::Into<wkt::Timestamp>,
7964 {
7965 self.expire_time = v.map(|x| x.into());
7966 self
7967 }
7968}
7969
7970impl wkt::message::Message for CopyBackupRequest {
7971 fn typename() -> &'static str {
7972 "type.googleapis.com/google.bigtable.admin.v2.CopyBackupRequest"
7973 }
7974}
7975
7976/// Metadata type for the google.longrunning.Operation returned by
7977/// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
7978///
7979/// [google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]: crate::client::BigtableTableAdmin::copy_backup
7980#[derive(Clone, Default, PartialEq)]
7981#[non_exhaustive]
7982pub struct CopyBackupMetadata {
7983 /// The name of the backup being created through the copy operation.
7984 /// Values are of the form
7985 /// `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
7986 pub name: std::string::String,
7987
7988 /// Information about the source backup that is being copied from.
7989 pub source_backup_info: std::option::Option<crate::model::BackupInfo>,
7990
7991 /// The progress of the
7992 /// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
7993 /// operation.
7994 ///
7995 /// [google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]: crate::client::BigtableTableAdmin::copy_backup
7996 pub progress: std::option::Option<crate::model::OperationProgress>,
7997
7998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7999}
8000
8001impl CopyBackupMetadata {
8002 /// Creates a new default instance.
8003 pub fn new() -> Self {
8004 std::default::Default::default()
8005 }
8006
8007 /// Sets the value of [name][crate::model::CopyBackupMetadata::name].
8008 ///
8009 /// # Example
8010 /// ```ignore,no_run
8011 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
8012 /// # let project_id = "project_id";
8013 /// # let instance_id = "instance_id";
8014 /// # let cluster_id = "cluster_id";
8015 /// # let backup_id = "backup_id";
8016 /// let x = CopyBackupMetadata::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"));
8017 /// ```
8018 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8019 self.name = v.into();
8020 self
8021 }
8022
8023 /// Sets the value of [source_backup_info][crate::model::CopyBackupMetadata::source_backup_info].
8024 ///
8025 /// # Example
8026 /// ```ignore,no_run
8027 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
8028 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
8029 /// let x = CopyBackupMetadata::new().set_source_backup_info(BackupInfo::default()/* use setters */);
8030 /// ```
8031 pub fn set_source_backup_info<T>(mut self, v: T) -> Self
8032 where
8033 T: std::convert::Into<crate::model::BackupInfo>,
8034 {
8035 self.source_backup_info = std::option::Option::Some(v.into());
8036 self
8037 }
8038
8039 /// Sets or clears the value of [source_backup_info][crate::model::CopyBackupMetadata::source_backup_info].
8040 ///
8041 /// # Example
8042 /// ```ignore,no_run
8043 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
8044 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
8045 /// let x = CopyBackupMetadata::new().set_or_clear_source_backup_info(Some(BackupInfo::default()/* use setters */));
8046 /// let x = CopyBackupMetadata::new().set_or_clear_source_backup_info(None::<BackupInfo>);
8047 /// ```
8048 pub fn set_or_clear_source_backup_info<T>(mut self, v: std::option::Option<T>) -> Self
8049 where
8050 T: std::convert::Into<crate::model::BackupInfo>,
8051 {
8052 self.source_backup_info = v.map(|x| x.into());
8053 self
8054 }
8055
8056 /// Sets the value of [progress][crate::model::CopyBackupMetadata::progress].
8057 ///
8058 /// # Example
8059 /// ```ignore,no_run
8060 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
8061 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
8062 /// let x = CopyBackupMetadata::new().set_progress(OperationProgress::default()/* use setters */);
8063 /// ```
8064 pub fn set_progress<T>(mut self, v: T) -> Self
8065 where
8066 T: std::convert::Into<crate::model::OperationProgress>,
8067 {
8068 self.progress = std::option::Option::Some(v.into());
8069 self
8070 }
8071
8072 /// Sets or clears the value of [progress][crate::model::CopyBackupMetadata::progress].
8073 ///
8074 /// # Example
8075 /// ```ignore,no_run
8076 /// # use google_cloud_bigtable_admin_v2::model::CopyBackupMetadata;
8077 /// use google_cloud_bigtable_admin_v2::model::OperationProgress;
8078 /// let x = CopyBackupMetadata::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
8079 /// let x = CopyBackupMetadata::new().set_or_clear_progress(None::<OperationProgress>);
8080 /// ```
8081 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
8082 where
8083 T: std::convert::Into<crate::model::OperationProgress>,
8084 {
8085 self.progress = v.map(|x| x.into());
8086 self
8087 }
8088}
8089
8090impl wkt::message::Message for CopyBackupMetadata {
8091 fn typename() -> &'static str {
8092 "type.googleapis.com/google.bigtable.admin.v2.CopyBackupMetadata"
8093 }
8094}
8095
8096/// The request for
8097/// [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]
8098///
8099/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]: crate::client::BigtableTableAdmin::create_authorized_view
8100#[derive(Clone, Default, PartialEq)]
8101#[non_exhaustive]
8102pub struct CreateAuthorizedViewRequest {
8103 /// Required. This is the name of the table the AuthorizedView belongs to.
8104 /// Values are of the form
8105 /// `projects/{project}/instances/{instance}/tables/{table}`.
8106 pub parent: std::string::String,
8107
8108 /// Required. The id of the AuthorizedView to create. This AuthorizedView must
8109 /// not already exist. The `authorized_view_id` appended to `parent` forms the
8110 /// full AuthorizedView name of the form
8111 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
8112 pub authorized_view_id: std::string::String,
8113
8114 /// Required. The AuthorizedView to create.
8115 pub authorized_view: std::option::Option<crate::model::AuthorizedView>,
8116
8117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8118}
8119
8120impl CreateAuthorizedViewRequest {
8121 /// Creates a new default instance.
8122 pub fn new() -> Self {
8123 std::default::Default::default()
8124 }
8125
8126 /// Sets the value of [parent][crate::model::CreateAuthorizedViewRequest::parent].
8127 ///
8128 /// # Example
8129 /// ```ignore,no_run
8130 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
8131 /// # let project_id = "project_id";
8132 /// # let instance_id = "instance_id";
8133 /// # let table_id = "table_id";
8134 /// let x = CreateAuthorizedViewRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
8135 /// ```
8136 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8137 self.parent = v.into();
8138 self
8139 }
8140
8141 /// Sets the value of [authorized_view_id][crate::model::CreateAuthorizedViewRequest::authorized_view_id].
8142 ///
8143 /// # Example
8144 /// ```ignore,no_run
8145 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
8146 /// let x = CreateAuthorizedViewRequest::new().set_authorized_view_id("example");
8147 /// ```
8148 pub fn set_authorized_view_id<T: std::convert::Into<std::string::String>>(
8149 mut self,
8150 v: T,
8151 ) -> Self {
8152 self.authorized_view_id = v.into();
8153 self
8154 }
8155
8156 /// Sets the value of [authorized_view][crate::model::CreateAuthorizedViewRequest::authorized_view].
8157 ///
8158 /// # Example
8159 /// ```ignore,no_run
8160 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
8161 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
8162 /// let x = CreateAuthorizedViewRequest::new().set_authorized_view(AuthorizedView::default()/* use setters */);
8163 /// ```
8164 pub fn set_authorized_view<T>(mut self, v: T) -> Self
8165 where
8166 T: std::convert::Into<crate::model::AuthorizedView>,
8167 {
8168 self.authorized_view = std::option::Option::Some(v.into());
8169 self
8170 }
8171
8172 /// Sets or clears the value of [authorized_view][crate::model::CreateAuthorizedViewRequest::authorized_view].
8173 ///
8174 /// # Example
8175 /// ```ignore,no_run
8176 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
8177 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
8178 /// let x = CreateAuthorizedViewRequest::new().set_or_clear_authorized_view(Some(AuthorizedView::default()/* use setters */));
8179 /// let x = CreateAuthorizedViewRequest::new().set_or_clear_authorized_view(None::<AuthorizedView>);
8180 /// ```
8181 pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
8182 where
8183 T: std::convert::Into<crate::model::AuthorizedView>,
8184 {
8185 self.authorized_view = v.map(|x| x.into());
8186 self
8187 }
8188}
8189
8190impl wkt::message::Message for CreateAuthorizedViewRequest {
8191 fn typename() -> &'static str {
8192 "type.googleapis.com/google.bigtable.admin.v2.CreateAuthorizedViewRequest"
8193 }
8194}
8195
8196/// The metadata for the Operation returned by CreateAuthorizedView.
8197#[derive(Clone, Default, PartialEq)]
8198#[non_exhaustive]
8199pub struct CreateAuthorizedViewMetadata {
8200 /// The request that prompted the initiation of this CreateAuthorizedView
8201 /// operation.
8202 pub original_request: std::option::Option<crate::model::CreateAuthorizedViewRequest>,
8203
8204 /// The time at which the original request was received.
8205 pub request_time: std::option::Option<wkt::Timestamp>,
8206
8207 /// The time at which the operation failed or was completed successfully.
8208 pub finish_time: std::option::Option<wkt::Timestamp>,
8209
8210 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8211}
8212
8213impl CreateAuthorizedViewMetadata {
8214 /// Creates a new default instance.
8215 pub fn new() -> Self {
8216 std::default::Default::default()
8217 }
8218
8219 /// Sets the value of [original_request][crate::model::CreateAuthorizedViewMetadata::original_request].
8220 ///
8221 /// # Example
8222 /// ```ignore,no_run
8223 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
8224 /// use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
8225 /// let x = CreateAuthorizedViewMetadata::new().set_original_request(CreateAuthorizedViewRequest::default()/* use setters */);
8226 /// ```
8227 pub fn set_original_request<T>(mut self, v: T) -> Self
8228 where
8229 T: std::convert::Into<crate::model::CreateAuthorizedViewRequest>,
8230 {
8231 self.original_request = std::option::Option::Some(v.into());
8232 self
8233 }
8234
8235 /// Sets or clears the value of [original_request][crate::model::CreateAuthorizedViewMetadata::original_request].
8236 ///
8237 /// # Example
8238 /// ```ignore,no_run
8239 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
8240 /// use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewRequest;
8241 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_original_request(Some(CreateAuthorizedViewRequest::default()/* use setters */));
8242 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_original_request(None::<CreateAuthorizedViewRequest>);
8243 /// ```
8244 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
8245 where
8246 T: std::convert::Into<crate::model::CreateAuthorizedViewRequest>,
8247 {
8248 self.original_request = v.map(|x| x.into());
8249 self
8250 }
8251
8252 /// Sets the value of [request_time][crate::model::CreateAuthorizedViewMetadata::request_time].
8253 ///
8254 /// # Example
8255 /// ```ignore,no_run
8256 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
8257 /// use wkt::Timestamp;
8258 /// let x = CreateAuthorizedViewMetadata::new().set_request_time(Timestamp::default()/* use setters */);
8259 /// ```
8260 pub fn set_request_time<T>(mut self, v: T) -> Self
8261 where
8262 T: std::convert::Into<wkt::Timestamp>,
8263 {
8264 self.request_time = std::option::Option::Some(v.into());
8265 self
8266 }
8267
8268 /// Sets or clears the value of [request_time][crate::model::CreateAuthorizedViewMetadata::request_time].
8269 ///
8270 /// # Example
8271 /// ```ignore,no_run
8272 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
8273 /// use wkt::Timestamp;
8274 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
8275 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_request_time(None::<Timestamp>);
8276 /// ```
8277 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
8278 where
8279 T: std::convert::Into<wkt::Timestamp>,
8280 {
8281 self.request_time = v.map(|x| x.into());
8282 self
8283 }
8284
8285 /// Sets the value of [finish_time][crate::model::CreateAuthorizedViewMetadata::finish_time].
8286 ///
8287 /// # Example
8288 /// ```ignore,no_run
8289 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
8290 /// use wkt::Timestamp;
8291 /// let x = CreateAuthorizedViewMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
8292 /// ```
8293 pub fn set_finish_time<T>(mut self, v: T) -> Self
8294 where
8295 T: std::convert::Into<wkt::Timestamp>,
8296 {
8297 self.finish_time = std::option::Option::Some(v.into());
8298 self
8299 }
8300
8301 /// Sets or clears the value of [finish_time][crate::model::CreateAuthorizedViewMetadata::finish_time].
8302 ///
8303 /// # Example
8304 /// ```ignore,no_run
8305 /// # use google_cloud_bigtable_admin_v2::model::CreateAuthorizedViewMetadata;
8306 /// use wkt::Timestamp;
8307 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
8308 /// let x = CreateAuthorizedViewMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
8309 /// ```
8310 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
8311 where
8312 T: std::convert::Into<wkt::Timestamp>,
8313 {
8314 self.finish_time = v.map(|x| x.into());
8315 self
8316 }
8317}
8318
8319impl wkt::message::Message for CreateAuthorizedViewMetadata {
8320 fn typename() -> &'static str {
8321 "type.googleapis.com/google.bigtable.admin.v2.CreateAuthorizedViewMetadata"
8322 }
8323}
8324
8325/// Request message for
8326/// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
8327///
8328/// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]: crate::client::BigtableTableAdmin::list_authorized_views
8329#[derive(Clone, Default, PartialEq)]
8330#[non_exhaustive]
8331pub struct ListAuthorizedViewsRequest {
8332 /// Required. The unique name of the table for which AuthorizedViews should be
8333 /// listed. Values are of the form
8334 /// `projects/{project}/instances/{instance}/tables/{table}`.
8335 pub parent: std::string::String,
8336
8337 /// Optional. Maximum number of results per page.
8338 ///
8339 /// A page_size of zero lets the server choose the number of items to return.
8340 /// A page_size which is strictly positive will return at most that many items.
8341 /// A negative page_size will cause an error.
8342 ///
8343 /// Following the first request, subsequent paginated calls are not required
8344 /// to pass a page_size. If a page_size is set in subsequent calls, it must
8345 /// match the page_size given in the first request.
8346 pub page_size: i32,
8347
8348 /// Optional. The value of `next_page_token` returned by a previous call.
8349 pub page_token: std::string::String,
8350
8351 /// Optional. The resource_view to be applied to the returned AuthorizedViews'
8352 /// fields. Default to NAME_ONLY.
8353 pub view: crate::model::authorized_view::ResponseView,
8354
8355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8356}
8357
8358impl ListAuthorizedViewsRequest {
8359 /// Creates a new default instance.
8360 pub fn new() -> Self {
8361 std::default::Default::default()
8362 }
8363
8364 /// Sets the value of [parent][crate::model::ListAuthorizedViewsRequest::parent].
8365 ///
8366 /// # Example
8367 /// ```ignore,no_run
8368 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsRequest;
8369 /// # let project_id = "project_id";
8370 /// # let instance_id = "instance_id";
8371 /// # let table_id = "table_id";
8372 /// let x = ListAuthorizedViewsRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
8373 /// ```
8374 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8375 self.parent = v.into();
8376 self
8377 }
8378
8379 /// Sets the value of [page_size][crate::model::ListAuthorizedViewsRequest::page_size].
8380 ///
8381 /// # Example
8382 /// ```ignore,no_run
8383 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsRequest;
8384 /// let x = ListAuthorizedViewsRequest::new().set_page_size(42);
8385 /// ```
8386 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8387 self.page_size = v.into();
8388 self
8389 }
8390
8391 /// Sets the value of [page_token][crate::model::ListAuthorizedViewsRequest::page_token].
8392 ///
8393 /// # Example
8394 /// ```ignore,no_run
8395 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsRequest;
8396 /// let x = ListAuthorizedViewsRequest::new().set_page_token("example");
8397 /// ```
8398 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8399 self.page_token = v.into();
8400 self
8401 }
8402
8403 /// Sets the value of [view][crate::model::ListAuthorizedViewsRequest::view].
8404 ///
8405 /// # Example
8406 /// ```ignore,no_run
8407 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsRequest;
8408 /// use google_cloud_bigtable_admin_v2::model::authorized_view::ResponseView;
8409 /// let x0 = ListAuthorizedViewsRequest::new().set_view(ResponseView::NameOnly);
8410 /// let x1 = ListAuthorizedViewsRequest::new().set_view(ResponseView::Basic);
8411 /// let x2 = ListAuthorizedViewsRequest::new().set_view(ResponseView::Full);
8412 /// ```
8413 pub fn set_view<T: std::convert::Into<crate::model::authorized_view::ResponseView>>(
8414 mut self,
8415 v: T,
8416 ) -> Self {
8417 self.view = v.into();
8418 self
8419 }
8420}
8421
8422impl wkt::message::Message for ListAuthorizedViewsRequest {
8423 fn typename() -> &'static str {
8424 "type.googleapis.com/google.bigtable.admin.v2.ListAuthorizedViewsRequest"
8425 }
8426}
8427
8428/// Response message for
8429/// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
8430///
8431/// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]: crate::client::BigtableTableAdmin::list_authorized_views
8432#[derive(Clone, Default, PartialEq)]
8433#[non_exhaustive]
8434pub struct ListAuthorizedViewsResponse {
8435 /// The AuthorizedViews present in the requested table.
8436 pub authorized_views: std::vec::Vec<crate::model::AuthorizedView>,
8437
8438 /// Set if not all tables could be returned in a single response.
8439 /// Pass this value to `page_token` in another request to get the next
8440 /// page of results.
8441 pub next_page_token: std::string::String,
8442
8443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8444}
8445
8446impl ListAuthorizedViewsResponse {
8447 /// Creates a new default instance.
8448 pub fn new() -> Self {
8449 std::default::Default::default()
8450 }
8451
8452 /// Sets the value of [authorized_views][crate::model::ListAuthorizedViewsResponse::authorized_views].
8453 ///
8454 /// # Example
8455 /// ```ignore,no_run
8456 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsResponse;
8457 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
8458 /// let x = ListAuthorizedViewsResponse::new()
8459 /// .set_authorized_views([
8460 /// AuthorizedView::default()/* use setters */,
8461 /// AuthorizedView::default()/* use (different) setters */,
8462 /// ]);
8463 /// ```
8464 pub fn set_authorized_views<T, V>(mut self, v: T) -> Self
8465 where
8466 T: std::iter::IntoIterator<Item = V>,
8467 V: std::convert::Into<crate::model::AuthorizedView>,
8468 {
8469 use std::iter::Iterator;
8470 self.authorized_views = v.into_iter().map(|i| i.into()).collect();
8471 self
8472 }
8473
8474 /// Sets the value of [next_page_token][crate::model::ListAuthorizedViewsResponse::next_page_token].
8475 ///
8476 /// # Example
8477 /// ```ignore,no_run
8478 /// # use google_cloud_bigtable_admin_v2::model::ListAuthorizedViewsResponse;
8479 /// let x = ListAuthorizedViewsResponse::new().set_next_page_token("example");
8480 /// ```
8481 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8482 self.next_page_token = v.into();
8483 self
8484 }
8485}
8486
8487impl wkt::message::Message for ListAuthorizedViewsResponse {
8488 fn typename() -> &'static str {
8489 "type.googleapis.com/google.bigtable.admin.v2.ListAuthorizedViewsResponse"
8490 }
8491}
8492
8493#[doc(hidden)]
8494impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizedViewsResponse {
8495 type PageItem = crate::model::AuthorizedView;
8496
8497 fn items(self) -> std::vec::Vec<Self::PageItem> {
8498 self.authorized_views
8499 }
8500
8501 fn next_page_token(&self) -> std::string::String {
8502 use std::clone::Clone;
8503 self.next_page_token.clone()
8504 }
8505}
8506
8507/// Request message for
8508/// [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView]
8509///
8510/// [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView]: crate::client::BigtableTableAdmin::get_authorized_view
8511#[derive(Clone, Default, PartialEq)]
8512#[non_exhaustive]
8513pub struct GetAuthorizedViewRequest {
8514 /// Required. The unique name of the requested AuthorizedView.
8515 /// Values are of the form
8516 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
8517 pub name: std::string::String,
8518
8519 /// Optional. The resource_view to be applied to the returned AuthorizedView's
8520 /// fields. Default to BASIC.
8521 pub view: crate::model::authorized_view::ResponseView,
8522
8523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8524}
8525
8526impl GetAuthorizedViewRequest {
8527 /// Creates a new default instance.
8528 pub fn new() -> Self {
8529 std::default::Default::default()
8530 }
8531
8532 /// Sets the value of [name][crate::model::GetAuthorizedViewRequest::name].
8533 ///
8534 /// # Example
8535 /// ```ignore,no_run
8536 /// # use google_cloud_bigtable_admin_v2::model::GetAuthorizedViewRequest;
8537 /// # let project_id = "project_id";
8538 /// # let instance_id = "instance_id";
8539 /// # let table_id = "table_id";
8540 /// # let authorized_view_id = "authorized_view_id";
8541 /// let x = GetAuthorizedViewRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/authorizedViews/{authorized_view_id}"));
8542 /// ```
8543 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8544 self.name = v.into();
8545 self
8546 }
8547
8548 /// Sets the value of [view][crate::model::GetAuthorizedViewRequest::view].
8549 ///
8550 /// # Example
8551 /// ```ignore,no_run
8552 /// # use google_cloud_bigtable_admin_v2::model::GetAuthorizedViewRequest;
8553 /// use google_cloud_bigtable_admin_v2::model::authorized_view::ResponseView;
8554 /// let x0 = GetAuthorizedViewRequest::new().set_view(ResponseView::NameOnly);
8555 /// let x1 = GetAuthorizedViewRequest::new().set_view(ResponseView::Basic);
8556 /// let x2 = GetAuthorizedViewRequest::new().set_view(ResponseView::Full);
8557 /// ```
8558 pub fn set_view<T: std::convert::Into<crate::model::authorized_view::ResponseView>>(
8559 mut self,
8560 v: T,
8561 ) -> Self {
8562 self.view = v.into();
8563 self
8564 }
8565}
8566
8567impl wkt::message::Message for GetAuthorizedViewRequest {
8568 fn typename() -> &'static str {
8569 "type.googleapis.com/google.bigtable.admin.v2.GetAuthorizedViewRequest"
8570 }
8571}
8572
8573/// The request for
8574/// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
8575///
8576/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]: crate::client::BigtableTableAdmin::update_authorized_view
8577#[derive(Clone, Default, PartialEq)]
8578#[non_exhaustive]
8579pub struct UpdateAuthorizedViewRequest {
8580 /// Required. The AuthorizedView to update. The `name` in `authorized_view` is
8581 /// used to identify the AuthorizedView. AuthorizedView name must in this
8582 /// format:
8583 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
8584 pub authorized_view: std::option::Option<crate::model::AuthorizedView>,
8585
8586 /// Optional. The list of fields to update.
8587 /// A mask specifying which fields in the AuthorizedView resource should be
8588 /// updated. This mask is relative to the AuthorizedView resource, not to the
8589 /// request message. A field will be overwritten if it is in the mask. If
8590 /// empty, all fields set in the request will be overwritten. A special value
8591 /// `*` means to overwrite all fields (including fields not set in the
8592 /// request).
8593 pub update_mask: std::option::Option<wkt::FieldMask>,
8594
8595 /// Optional. If true, ignore the safety checks when updating the
8596 /// AuthorizedView.
8597 pub ignore_warnings: bool,
8598
8599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8600}
8601
8602impl UpdateAuthorizedViewRequest {
8603 /// Creates a new default instance.
8604 pub fn new() -> Self {
8605 std::default::Default::default()
8606 }
8607
8608 /// Sets the value of [authorized_view][crate::model::UpdateAuthorizedViewRequest::authorized_view].
8609 ///
8610 /// # Example
8611 /// ```ignore,no_run
8612 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8613 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
8614 /// let x = UpdateAuthorizedViewRequest::new().set_authorized_view(AuthorizedView::default()/* use setters */);
8615 /// ```
8616 pub fn set_authorized_view<T>(mut self, v: T) -> Self
8617 where
8618 T: std::convert::Into<crate::model::AuthorizedView>,
8619 {
8620 self.authorized_view = std::option::Option::Some(v.into());
8621 self
8622 }
8623
8624 /// Sets or clears the value of [authorized_view][crate::model::UpdateAuthorizedViewRequest::authorized_view].
8625 ///
8626 /// # Example
8627 /// ```ignore,no_run
8628 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8629 /// use google_cloud_bigtable_admin_v2::model::AuthorizedView;
8630 /// let x = UpdateAuthorizedViewRequest::new().set_or_clear_authorized_view(Some(AuthorizedView::default()/* use setters */));
8631 /// let x = UpdateAuthorizedViewRequest::new().set_or_clear_authorized_view(None::<AuthorizedView>);
8632 /// ```
8633 pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
8634 where
8635 T: std::convert::Into<crate::model::AuthorizedView>,
8636 {
8637 self.authorized_view = v.map(|x| x.into());
8638 self
8639 }
8640
8641 /// Sets the value of [update_mask][crate::model::UpdateAuthorizedViewRequest::update_mask].
8642 ///
8643 /// # Example
8644 /// ```ignore,no_run
8645 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8646 /// use wkt::FieldMask;
8647 /// let x = UpdateAuthorizedViewRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8648 /// ```
8649 pub fn set_update_mask<T>(mut self, v: T) -> Self
8650 where
8651 T: std::convert::Into<wkt::FieldMask>,
8652 {
8653 self.update_mask = std::option::Option::Some(v.into());
8654 self
8655 }
8656
8657 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizedViewRequest::update_mask].
8658 ///
8659 /// # Example
8660 /// ```ignore,no_run
8661 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8662 /// use wkt::FieldMask;
8663 /// let x = UpdateAuthorizedViewRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8664 /// let x = UpdateAuthorizedViewRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8665 /// ```
8666 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8667 where
8668 T: std::convert::Into<wkt::FieldMask>,
8669 {
8670 self.update_mask = v.map(|x| x.into());
8671 self
8672 }
8673
8674 /// Sets the value of [ignore_warnings][crate::model::UpdateAuthorizedViewRequest::ignore_warnings].
8675 ///
8676 /// # Example
8677 /// ```ignore,no_run
8678 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8679 /// let x = UpdateAuthorizedViewRequest::new().set_ignore_warnings(true);
8680 /// ```
8681 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8682 self.ignore_warnings = v.into();
8683 self
8684 }
8685}
8686
8687impl wkt::message::Message for UpdateAuthorizedViewRequest {
8688 fn typename() -> &'static str {
8689 "type.googleapis.com/google.bigtable.admin.v2.UpdateAuthorizedViewRequest"
8690 }
8691}
8692
8693/// Metadata for the google.longrunning.Operation returned by
8694/// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
8695///
8696/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]: crate::client::BigtableTableAdmin::update_authorized_view
8697#[derive(Clone, Default, PartialEq)]
8698#[non_exhaustive]
8699pub struct UpdateAuthorizedViewMetadata {
8700 /// The request that prompted the initiation of this UpdateAuthorizedView
8701 /// operation.
8702 pub original_request: std::option::Option<crate::model::UpdateAuthorizedViewRequest>,
8703
8704 /// The time at which the original request was received.
8705 pub request_time: std::option::Option<wkt::Timestamp>,
8706
8707 /// The time at which the operation failed or was completed successfully.
8708 pub finish_time: std::option::Option<wkt::Timestamp>,
8709
8710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8711}
8712
8713impl UpdateAuthorizedViewMetadata {
8714 /// Creates a new default instance.
8715 pub fn new() -> Self {
8716 std::default::Default::default()
8717 }
8718
8719 /// Sets the value of [original_request][crate::model::UpdateAuthorizedViewMetadata::original_request].
8720 ///
8721 /// # Example
8722 /// ```ignore,no_run
8723 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8724 /// use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8725 /// let x = UpdateAuthorizedViewMetadata::new().set_original_request(UpdateAuthorizedViewRequest::default()/* use setters */);
8726 /// ```
8727 pub fn set_original_request<T>(mut self, v: T) -> Self
8728 where
8729 T: std::convert::Into<crate::model::UpdateAuthorizedViewRequest>,
8730 {
8731 self.original_request = std::option::Option::Some(v.into());
8732 self
8733 }
8734
8735 /// Sets or clears the value of [original_request][crate::model::UpdateAuthorizedViewMetadata::original_request].
8736 ///
8737 /// # Example
8738 /// ```ignore,no_run
8739 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8740 /// use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewRequest;
8741 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_original_request(Some(UpdateAuthorizedViewRequest::default()/* use setters */));
8742 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_original_request(None::<UpdateAuthorizedViewRequest>);
8743 /// ```
8744 pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
8745 where
8746 T: std::convert::Into<crate::model::UpdateAuthorizedViewRequest>,
8747 {
8748 self.original_request = v.map(|x| x.into());
8749 self
8750 }
8751
8752 /// Sets the value of [request_time][crate::model::UpdateAuthorizedViewMetadata::request_time].
8753 ///
8754 /// # Example
8755 /// ```ignore,no_run
8756 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8757 /// use wkt::Timestamp;
8758 /// let x = UpdateAuthorizedViewMetadata::new().set_request_time(Timestamp::default()/* use setters */);
8759 /// ```
8760 pub fn set_request_time<T>(mut self, v: T) -> Self
8761 where
8762 T: std::convert::Into<wkt::Timestamp>,
8763 {
8764 self.request_time = std::option::Option::Some(v.into());
8765 self
8766 }
8767
8768 /// Sets or clears the value of [request_time][crate::model::UpdateAuthorizedViewMetadata::request_time].
8769 ///
8770 /// # Example
8771 /// ```ignore,no_run
8772 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8773 /// use wkt::Timestamp;
8774 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_request_time(Some(Timestamp::default()/* use setters */));
8775 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_request_time(None::<Timestamp>);
8776 /// ```
8777 pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
8778 where
8779 T: std::convert::Into<wkt::Timestamp>,
8780 {
8781 self.request_time = v.map(|x| x.into());
8782 self
8783 }
8784
8785 /// Sets the value of [finish_time][crate::model::UpdateAuthorizedViewMetadata::finish_time].
8786 ///
8787 /// # Example
8788 /// ```ignore,no_run
8789 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8790 /// use wkt::Timestamp;
8791 /// let x = UpdateAuthorizedViewMetadata::new().set_finish_time(Timestamp::default()/* use setters */);
8792 /// ```
8793 pub fn set_finish_time<T>(mut self, v: T) -> Self
8794 where
8795 T: std::convert::Into<wkt::Timestamp>,
8796 {
8797 self.finish_time = std::option::Option::Some(v.into());
8798 self
8799 }
8800
8801 /// Sets or clears the value of [finish_time][crate::model::UpdateAuthorizedViewMetadata::finish_time].
8802 ///
8803 /// # Example
8804 /// ```ignore,no_run
8805 /// # use google_cloud_bigtable_admin_v2::model::UpdateAuthorizedViewMetadata;
8806 /// use wkt::Timestamp;
8807 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
8808 /// let x = UpdateAuthorizedViewMetadata::new().set_or_clear_finish_time(None::<Timestamp>);
8809 /// ```
8810 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
8811 where
8812 T: std::convert::Into<wkt::Timestamp>,
8813 {
8814 self.finish_time = v.map(|x| x.into());
8815 self
8816 }
8817}
8818
8819impl wkt::message::Message for UpdateAuthorizedViewMetadata {
8820 fn typename() -> &'static str {
8821 "type.googleapis.com/google.bigtable.admin.v2.UpdateAuthorizedViewMetadata"
8822 }
8823}
8824
8825/// Request message for
8826/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView]
8827///
8828/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView]: crate::client::BigtableTableAdmin::delete_authorized_view
8829#[derive(Clone, Default, PartialEq)]
8830#[non_exhaustive]
8831pub struct DeleteAuthorizedViewRequest {
8832 /// Required. The unique name of the AuthorizedView to be deleted.
8833 /// Values are of the form
8834 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
8835 pub name: std::string::String,
8836
8837 /// Optional. The current etag of the AuthorizedView.
8838 /// If an etag is provided and does not match the current etag of the
8839 /// AuthorizedView, deletion will be blocked and an ABORTED error will be
8840 /// returned.
8841 pub etag: std::string::String,
8842
8843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8844}
8845
8846impl DeleteAuthorizedViewRequest {
8847 /// Creates a new default instance.
8848 pub fn new() -> Self {
8849 std::default::Default::default()
8850 }
8851
8852 /// Sets the value of [name][crate::model::DeleteAuthorizedViewRequest::name].
8853 ///
8854 /// # Example
8855 /// ```ignore,no_run
8856 /// # use google_cloud_bigtable_admin_v2::model::DeleteAuthorizedViewRequest;
8857 /// # let project_id = "project_id";
8858 /// # let instance_id = "instance_id";
8859 /// # let table_id = "table_id";
8860 /// # let authorized_view_id = "authorized_view_id";
8861 /// let x = DeleteAuthorizedViewRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/authorizedViews/{authorized_view_id}"));
8862 /// ```
8863 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8864 self.name = v.into();
8865 self
8866 }
8867
8868 /// Sets the value of [etag][crate::model::DeleteAuthorizedViewRequest::etag].
8869 ///
8870 /// # Example
8871 /// ```ignore,no_run
8872 /// # use google_cloud_bigtable_admin_v2::model::DeleteAuthorizedViewRequest;
8873 /// let x = DeleteAuthorizedViewRequest::new().set_etag("example");
8874 /// ```
8875 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8876 self.etag = v.into();
8877 self
8878 }
8879}
8880
8881impl wkt::message::Message for DeleteAuthorizedViewRequest {
8882 fn typename() -> &'static str {
8883 "type.googleapis.com/google.bigtable.admin.v2.DeleteAuthorizedViewRequest"
8884 }
8885}
8886
8887/// The request for
8888/// [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle].
8889///
8890/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]: crate::client::BigtableTableAdmin::create_schema_bundle
8891#[derive(Clone, Default, PartialEq)]
8892#[non_exhaustive]
8893pub struct CreateSchemaBundleRequest {
8894 /// Required. The parent resource where this schema bundle will be created.
8895 /// Values are of the form
8896 /// `projects/{project}/instances/{instance}/tables/{table}`.
8897 pub parent: std::string::String,
8898
8899 /// Required. The unique ID to use for the schema bundle, which will become the
8900 /// final component of the schema bundle's resource name.
8901 pub schema_bundle_id: std::string::String,
8902
8903 /// Required. The schema bundle to create.
8904 pub schema_bundle: std::option::Option<crate::model::SchemaBundle>,
8905
8906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8907}
8908
8909impl CreateSchemaBundleRequest {
8910 /// Creates a new default instance.
8911 pub fn new() -> Self {
8912 std::default::Default::default()
8913 }
8914
8915 /// Sets the value of [parent][crate::model::CreateSchemaBundleRequest::parent].
8916 ///
8917 /// # Example
8918 /// ```ignore,no_run
8919 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleRequest;
8920 /// # let project_id = "project_id";
8921 /// # let instance_id = "instance_id";
8922 /// # let table_id = "table_id";
8923 /// let x = CreateSchemaBundleRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
8924 /// ```
8925 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8926 self.parent = v.into();
8927 self
8928 }
8929
8930 /// Sets the value of [schema_bundle_id][crate::model::CreateSchemaBundleRequest::schema_bundle_id].
8931 ///
8932 /// # Example
8933 /// ```ignore,no_run
8934 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleRequest;
8935 /// let x = CreateSchemaBundleRequest::new().set_schema_bundle_id("example");
8936 /// ```
8937 pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
8938 mut self,
8939 v: T,
8940 ) -> Self {
8941 self.schema_bundle_id = v.into();
8942 self
8943 }
8944
8945 /// Sets the value of [schema_bundle][crate::model::CreateSchemaBundleRequest::schema_bundle].
8946 ///
8947 /// # Example
8948 /// ```ignore,no_run
8949 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleRequest;
8950 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
8951 /// let x = CreateSchemaBundleRequest::new().set_schema_bundle(SchemaBundle::default()/* use setters */);
8952 /// ```
8953 pub fn set_schema_bundle<T>(mut self, v: T) -> Self
8954 where
8955 T: std::convert::Into<crate::model::SchemaBundle>,
8956 {
8957 self.schema_bundle = std::option::Option::Some(v.into());
8958 self
8959 }
8960
8961 /// Sets or clears the value of [schema_bundle][crate::model::CreateSchemaBundleRequest::schema_bundle].
8962 ///
8963 /// # Example
8964 /// ```ignore,no_run
8965 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleRequest;
8966 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
8967 /// let x = CreateSchemaBundleRequest::new().set_or_clear_schema_bundle(Some(SchemaBundle::default()/* use setters */));
8968 /// let x = CreateSchemaBundleRequest::new().set_or_clear_schema_bundle(None::<SchemaBundle>);
8969 /// ```
8970 pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
8971 where
8972 T: std::convert::Into<crate::model::SchemaBundle>,
8973 {
8974 self.schema_bundle = v.map(|x| x.into());
8975 self
8976 }
8977}
8978
8979impl wkt::message::Message for CreateSchemaBundleRequest {
8980 fn typename() -> &'static str {
8981 "type.googleapis.com/google.bigtable.admin.v2.CreateSchemaBundleRequest"
8982 }
8983}
8984
8985/// The metadata for the Operation returned by
8986/// [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle].
8987///
8988/// [google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]: crate::client::BigtableTableAdmin::create_schema_bundle
8989#[derive(Clone, Default, PartialEq)]
8990#[non_exhaustive]
8991pub struct CreateSchemaBundleMetadata {
8992 /// The unique name identifying this schema bundle.
8993 /// Values are of the form
8994 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
8995 pub name: std::string::String,
8996
8997 /// The time at which this operation started.
8998 pub start_time: std::option::Option<wkt::Timestamp>,
8999
9000 /// If set, the time at which this operation finished or was canceled.
9001 pub end_time: std::option::Option<wkt::Timestamp>,
9002
9003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9004}
9005
9006impl CreateSchemaBundleMetadata {
9007 /// Creates a new default instance.
9008 pub fn new() -> Self {
9009 std::default::Default::default()
9010 }
9011
9012 /// Sets the value of [name][crate::model::CreateSchemaBundleMetadata::name].
9013 ///
9014 /// # Example
9015 /// ```ignore,no_run
9016 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
9017 /// let x = CreateSchemaBundleMetadata::new().set_name("example");
9018 /// ```
9019 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9020 self.name = v.into();
9021 self
9022 }
9023
9024 /// Sets the value of [start_time][crate::model::CreateSchemaBundleMetadata::start_time].
9025 ///
9026 /// # Example
9027 /// ```ignore,no_run
9028 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
9029 /// use wkt::Timestamp;
9030 /// let x = CreateSchemaBundleMetadata::new().set_start_time(Timestamp::default()/* use setters */);
9031 /// ```
9032 pub fn set_start_time<T>(mut self, v: T) -> Self
9033 where
9034 T: std::convert::Into<wkt::Timestamp>,
9035 {
9036 self.start_time = std::option::Option::Some(v.into());
9037 self
9038 }
9039
9040 /// Sets or clears the value of [start_time][crate::model::CreateSchemaBundleMetadata::start_time].
9041 ///
9042 /// # Example
9043 /// ```ignore,no_run
9044 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
9045 /// use wkt::Timestamp;
9046 /// let x = CreateSchemaBundleMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9047 /// let x = CreateSchemaBundleMetadata::new().set_or_clear_start_time(None::<Timestamp>);
9048 /// ```
9049 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9050 where
9051 T: std::convert::Into<wkt::Timestamp>,
9052 {
9053 self.start_time = v.map(|x| x.into());
9054 self
9055 }
9056
9057 /// Sets the value of [end_time][crate::model::CreateSchemaBundleMetadata::end_time].
9058 ///
9059 /// # Example
9060 /// ```ignore,no_run
9061 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
9062 /// use wkt::Timestamp;
9063 /// let x = CreateSchemaBundleMetadata::new().set_end_time(Timestamp::default()/* use setters */);
9064 /// ```
9065 pub fn set_end_time<T>(mut self, v: T) -> Self
9066 where
9067 T: std::convert::Into<wkt::Timestamp>,
9068 {
9069 self.end_time = std::option::Option::Some(v.into());
9070 self
9071 }
9072
9073 /// Sets or clears the value of [end_time][crate::model::CreateSchemaBundleMetadata::end_time].
9074 ///
9075 /// # Example
9076 /// ```ignore,no_run
9077 /// # use google_cloud_bigtable_admin_v2::model::CreateSchemaBundleMetadata;
9078 /// use wkt::Timestamp;
9079 /// let x = CreateSchemaBundleMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9080 /// let x = CreateSchemaBundleMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9081 /// ```
9082 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9083 where
9084 T: std::convert::Into<wkt::Timestamp>,
9085 {
9086 self.end_time = v.map(|x| x.into());
9087 self
9088 }
9089}
9090
9091impl wkt::message::Message for CreateSchemaBundleMetadata {
9092 fn typename() -> &'static str {
9093 "type.googleapis.com/google.bigtable.admin.v2.CreateSchemaBundleMetadata"
9094 }
9095}
9096
9097/// The request for
9098/// [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle].
9099///
9100/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]: crate::client::BigtableTableAdmin::update_schema_bundle
9101#[derive(Clone, Default, PartialEq)]
9102#[non_exhaustive]
9103pub struct UpdateSchemaBundleRequest {
9104 /// Required. The schema bundle to update.
9105 ///
9106 /// The schema bundle's `name` field is used to identify the schema bundle to
9107 /// update. Values are of the form
9108 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
9109 pub schema_bundle: std::option::Option<crate::model::SchemaBundle>,
9110
9111 /// Optional. The list of fields to update.
9112 pub update_mask: std::option::Option<wkt::FieldMask>,
9113
9114 /// Optional. If set, ignore the safety checks when updating the Schema Bundle.
9115 /// The safety checks are:
9116 ///
9117 /// - The new Schema Bundle is backwards compatible with the existing Schema
9118 /// Bundle.
9119 pub ignore_warnings: bool,
9120
9121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9122}
9123
9124impl UpdateSchemaBundleRequest {
9125 /// Creates a new default instance.
9126 pub fn new() -> Self {
9127 std::default::Default::default()
9128 }
9129
9130 /// Sets the value of [schema_bundle][crate::model::UpdateSchemaBundleRequest::schema_bundle].
9131 ///
9132 /// # Example
9133 /// ```ignore,no_run
9134 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
9135 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
9136 /// let x = UpdateSchemaBundleRequest::new().set_schema_bundle(SchemaBundle::default()/* use setters */);
9137 /// ```
9138 pub fn set_schema_bundle<T>(mut self, v: T) -> Self
9139 where
9140 T: std::convert::Into<crate::model::SchemaBundle>,
9141 {
9142 self.schema_bundle = std::option::Option::Some(v.into());
9143 self
9144 }
9145
9146 /// Sets or clears the value of [schema_bundle][crate::model::UpdateSchemaBundleRequest::schema_bundle].
9147 ///
9148 /// # Example
9149 /// ```ignore,no_run
9150 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
9151 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
9152 /// let x = UpdateSchemaBundleRequest::new().set_or_clear_schema_bundle(Some(SchemaBundle::default()/* use setters */));
9153 /// let x = UpdateSchemaBundleRequest::new().set_or_clear_schema_bundle(None::<SchemaBundle>);
9154 /// ```
9155 pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
9156 where
9157 T: std::convert::Into<crate::model::SchemaBundle>,
9158 {
9159 self.schema_bundle = v.map(|x| x.into());
9160 self
9161 }
9162
9163 /// Sets the value of [update_mask][crate::model::UpdateSchemaBundleRequest::update_mask].
9164 ///
9165 /// # Example
9166 /// ```ignore,no_run
9167 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
9168 /// use wkt::FieldMask;
9169 /// let x = UpdateSchemaBundleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9170 /// ```
9171 pub fn set_update_mask<T>(mut self, v: T) -> Self
9172 where
9173 T: std::convert::Into<wkt::FieldMask>,
9174 {
9175 self.update_mask = std::option::Option::Some(v.into());
9176 self
9177 }
9178
9179 /// Sets or clears the value of [update_mask][crate::model::UpdateSchemaBundleRequest::update_mask].
9180 ///
9181 /// # Example
9182 /// ```ignore,no_run
9183 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
9184 /// use wkt::FieldMask;
9185 /// let x = UpdateSchemaBundleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9186 /// let x = UpdateSchemaBundleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9187 /// ```
9188 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9189 where
9190 T: std::convert::Into<wkt::FieldMask>,
9191 {
9192 self.update_mask = v.map(|x| x.into());
9193 self
9194 }
9195
9196 /// Sets the value of [ignore_warnings][crate::model::UpdateSchemaBundleRequest::ignore_warnings].
9197 ///
9198 /// # Example
9199 /// ```ignore,no_run
9200 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleRequest;
9201 /// let x = UpdateSchemaBundleRequest::new().set_ignore_warnings(true);
9202 /// ```
9203 pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9204 self.ignore_warnings = v.into();
9205 self
9206 }
9207}
9208
9209impl wkt::message::Message for UpdateSchemaBundleRequest {
9210 fn typename() -> &'static str {
9211 "type.googleapis.com/google.bigtable.admin.v2.UpdateSchemaBundleRequest"
9212 }
9213}
9214
9215/// The metadata for the Operation returned by
9216/// [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle].
9217///
9218/// [google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]: crate::client::BigtableTableAdmin::update_schema_bundle
9219#[derive(Clone, Default, PartialEq)]
9220#[non_exhaustive]
9221pub struct UpdateSchemaBundleMetadata {
9222 /// The unique name identifying this schema bundle.
9223 /// Values are of the form
9224 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
9225 pub name: std::string::String,
9226
9227 /// The time at which this operation started.
9228 pub start_time: std::option::Option<wkt::Timestamp>,
9229
9230 /// If set, the time at which this operation finished or was canceled.
9231 pub end_time: std::option::Option<wkt::Timestamp>,
9232
9233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9234}
9235
9236impl UpdateSchemaBundleMetadata {
9237 /// Creates a new default instance.
9238 pub fn new() -> Self {
9239 std::default::Default::default()
9240 }
9241
9242 /// Sets the value of [name][crate::model::UpdateSchemaBundleMetadata::name].
9243 ///
9244 /// # Example
9245 /// ```ignore,no_run
9246 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
9247 /// let x = UpdateSchemaBundleMetadata::new().set_name("example");
9248 /// ```
9249 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9250 self.name = v.into();
9251 self
9252 }
9253
9254 /// Sets the value of [start_time][crate::model::UpdateSchemaBundleMetadata::start_time].
9255 ///
9256 /// # Example
9257 /// ```ignore,no_run
9258 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
9259 /// use wkt::Timestamp;
9260 /// let x = UpdateSchemaBundleMetadata::new().set_start_time(Timestamp::default()/* use setters */);
9261 /// ```
9262 pub fn set_start_time<T>(mut self, v: T) -> Self
9263 where
9264 T: std::convert::Into<wkt::Timestamp>,
9265 {
9266 self.start_time = std::option::Option::Some(v.into());
9267 self
9268 }
9269
9270 /// Sets or clears the value of [start_time][crate::model::UpdateSchemaBundleMetadata::start_time].
9271 ///
9272 /// # Example
9273 /// ```ignore,no_run
9274 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
9275 /// use wkt::Timestamp;
9276 /// let x = UpdateSchemaBundleMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9277 /// let x = UpdateSchemaBundleMetadata::new().set_or_clear_start_time(None::<Timestamp>);
9278 /// ```
9279 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9280 where
9281 T: std::convert::Into<wkt::Timestamp>,
9282 {
9283 self.start_time = v.map(|x| x.into());
9284 self
9285 }
9286
9287 /// Sets the value of [end_time][crate::model::UpdateSchemaBundleMetadata::end_time].
9288 ///
9289 /// # Example
9290 /// ```ignore,no_run
9291 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
9292 /// use wkt::Timestamp;
9293 /// let x = UpdateSchemaBundleMetadata::new().set_end_time(Timestamp::default()/* use setters */);
9294 /// ```
9295 pub fn set_end_time<T>(mut self, v: T) -> Self
9296 where
9297 T: std::convert::Into<wkt::Timestamp>,
9298 {
9299 self.end_time = std::option::Option::Some(v.into());
9300 self
9301 }
9302
9303 /// Sets or clears the value of [end_time][crate::model::UpdateSchemaBundleMetadata::end_time].
9304 ///
9305 /// # Example
9306 /// ```ignore,no_run
9307 /// # use google_cloud_bigtable_admin_v2::model::UpdateSchemaBundleMetadata;
9308 /// use wkt::Timestamp;
9309 /// let x = UpdateSchemaBundleMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9310 /// let x = UpdateSchemaBundleMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9311 /// ```
9312 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9313 where
9314 T: std::convert::Into<wkt::Timestamp>,
9315 {
9316 self.end_time = v.map(|x| x.into());
9317 self
9318 }
9319}
9320
9321impl wkt::message::Message for UpdateSchemaBundleMetadata {
9322 fn typename() -> &'static str {
9323 "type.googleapis.com/google.bigtable.admin.v2.UpdateSchemaBundleMetadata"
9324 }
9325}
9326
9327/// The request for
9328/// [GetSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle].
9329///
9330/// [google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle]: crate::client::BigtableTableAdmin::get_schema_bundle
9331#[derive(Clone, Default, PartialEq)]
9332#[non_exhaustive]
9333pub struct GetSchemaBundleRequest {
9334 /// Required. The unique name of the schema bundle to retrieve.
9335 /// Values are of the form
9336 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
9337 pub name: std::string::String,
9338
9339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9340}
9341
9342impl GetSchemaBundleRequest {
9343 /// Creates a new default instance.
9344 pub fn new() -> Self {
9345 std::default::Default::default()
9346 }
9347
9348 /// Sets the value of [name][crate::model::GetSchemaBundleRequest::name].
9349 ///
9350 /// # Example
9351 /// ```ignore,no_run
9352 /// # use google_cloud_bigtable_admin_v2::model::GetSchemaBundleRequest;
9353 /// # let project_id = "project_id";
9354 /// # let instance_id = "instance_id";
9355 /// # let table_id = "table_id";
9356 /// # let schema_bundle_id = "schema_bundle_id";
9357 /// let x = GetSchemaBundleRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/schemaBundles/{schema_bundle_id}"));
9358 /// ```
9359 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9360 self.name = v.into();
9361 self
9362 }
9363}
9364
9365impl wkt::message::Message for GetSchemaBundleRequest {
9366 fn typename() -> &'static str {
9367 "type.googleapis.com/google.bigtable.admin.v2.GetSchemaBundleRequest"
9368 }
9369}
9370
9371/// The request for
9372/// [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles].
9373///
9374/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]: crate::client::BigtableTableAdmin::list_schema_bundles
9375#[derive(Clone, Default, PartialEq)]
9376#[non_exhaustive]
9377pub struct ListSchemaBundlesRequest {
9378 /// Required. The parent, which owns this collection of schema bundles.
9379 /// Values are of the form
9380 /// `projects/{project}/instances/{instance}/tables/{table}`.
9381 pub parent: std::string::String,
9382
9383 /// The maximum number of schema bundles to return. If the value is positive,
9384 /// the server may return at most this value. If unspecified, the server will
9385 /// return the maximum allowed page size.
9386 pub page_size: i32,
9387
9388 /// A page token, received from a previous `ListSchemaBundles` call.
9389 /// Provide this to retrieve the subsequent page.
9390 ///
9391 /// When paginating, all other parameters provided to `ListSchemaBundles` must
9392 /// match the call that provided the page token.
9393 pub page_token: std::string::String,
9394
9395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9396}
9397
9398impl ListSchemaBundlesRequest {
9399 /// Creates a new default instance.
9400 pub fn new() -> Self {
9401 std::default::Default::default()
9402 }
9403
9404 /// Sets the value of [parent][crate::model::ListSchemaBundlesRequest::parent].
9405 ///
9406 /// # Example
9407 /// ```ignore,no_run
9408 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesRequest;
9409 /// # let project_id = "project_id";
9410 /// # let instance_id = "instance_id";
9411 /// # let table_id = "table_id";
9412 /// let x = ListSchemaBundlesRequest::new().set_parent(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
9413 /// ```
9414 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9415 self.parent = v.into();
9416 self
9417 }
9418
9419 /// Sets the value of [page_size][crate::model::ListSchemaBundlesRequest::page_size].
9420 ///
9421 /// # Example
9422 /// ```ignore,no_run
9423 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesRequest;
9424 /// let x = ListSchemaBundlesRequest::new().set_page_size(42);
9425 /// ```
9426 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9427 self.page_size = v.into();
9428 self
9429 }
9430
9431 /// Sets the value of [page_token][crate::model::ListSchemaBundlesRequest::page_token].
9432 ///
9433 /// # Example
9434 /// ```ignore,no_run
9435 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesRequest;
9436 /// let x = ListSchemaBundlesRequest::new().set_page_token("example");
9437 /// ```
9438 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9439 self.page_token = v.into();
9440 self
9441 }
9442}
9443
9444impl wkt::message::Message for ListSchemaBundlesRequest {
9445 fn typename() -> &'static str {
9446 "type.googleapis.com/google.bigtable.admin.v2.ListSchemaBundlesRequest"
9447 }
9448}
9449
9450/// The response for
9451/// [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles].
9452///
9453/// [google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]: crate::client::BigtableTableAdmin::list_schema_bundles
9454#[derive(Clone, Default, PartialEq)]
9455#[non_exhaustive]
9456pub struct ListSchemaBundlesResponse {
9457 /// The schema bundles from the specified table.
9458 pub schema_bundles: std::vec::Vec<crate::model::SchemaBundle>,
9459
9460 /// A token, which can be sent as `page_token` to retrieve the next page.
9461 /// If this field is omitted, there are no subsequent pages.
9462 pub next_page_token: std::string::String,
9463
9464 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9465}
9466
9467impl ListSchemaBundlesResponse {
9468 /// Creates a new default instance.
9469 pub fn new() -> Self {
9470 std::default::Default::default()
9471 }
9472
9473 /// Sets the value of [schema_bundles][crate::model::ListSchemaBundlesResponse::schema_bundles].
9474 ///
9475 /// # Example
9476 /// ```ignore,no_run
9477 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesResponse;
9478 /// use google_cloud_bigtable_admin_v2::model::SchemaBundle;
9479 /// let x = ListSchemaBundlesResponse::new()
9480 /// .set_schema_bundles([
9481 /// SchemaBundle::default()/* use setters */,
9482 /// SchemaBundle::default()/* use (different) setters */,
9483 /// ]);
9484 /// ```
9485 pub fn set_schema_bundles<T, V>(mut self, v: T) -> Self
9486 where
9487 T: std::iter::IntoIterator<Item = V>,
9488 V: std::convert::Into<crate::model::SchemaBundle>,
9489 {
9490 use std::iter::Iterator;
9491 self.schema_bundles = v.into_iter().map(|i| i.into()).collect();
9492 self
9493 }
9494
9495 /// Sets the value of [next_page_token][crate::model::ListSchemaBundlesResponse::next_page_token].
9496 ///
9497 /// # Example
9498 /// ```ignore,no_run
9499 /// # use google_cloud_bigtable_admin_v2::model::ListSchemaBundlesResponse;
9500 /// let x = ListSchemaBundlesResponse::new().set_next_page_token("example");
9501 /// ```
9502 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9503 self.next_page_token = v.into();
9504 self
9505 }
9506}
9507
9508impl wkt::message::Message for ListSchemaBundlesResponse {
9509 fn typename() -> &'static str {
9510 "type.googleapis.com/google.bigtable.admin.v2.ListSchemaBundlesResponse"
9511 }
9512}
9513
9514#[doc(hidden)]
9515impl google_cloud_gax::paginator::internal::PageableResponse for ListSchemaBundlesResponse {
9516 type PageItem = crate::model::SchemaBundle;
9517
9518 fn items(self) -> std::vec::Vec<Self::PageItem> {
9519 self.schema_bundles
9520 }
9521
9522 fn next_page_token(&self) -> std::string::String {
9523 use std::clone::Clone;
9524 self.next_page_token.clone()
9525 }
9526}
9527
9528/// The request for
9529/// [DeleteSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle].
9530///
9531/// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle]: crate::client::BigtableTableAdmin::delete_schema_bundle
9532#[derive(Clone, Default, PartialEq)]
9533#[non_exhaustive]
9534pub struct DeleteSchemaBundleRequest {
9535 /// Required. The unique name of the schema bundle to delete.
9536 /// Values are of the form
9537 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
9538 pub name: std::string::String,
9539
9540 /// Optional. The etag of the schema bundle.
9541 /// If this is provided, it must match the server's etag. The server
9542 /// returns an ABORTED error on a mismatched etag.
9543 pub etag: std::string::String,
9544
9545 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9546}
9547
9548impl DeleteSchemaBundleRequest {
9549 /// Creates a new default instance.
9550 pub fn new() -> Self {
9551 std::default::Default::default()
9552 }
9553
9554 /// Sets the value of [name][crate::model::DeleteSchemaBundleRequest::name].
9555 ///
9556 /// # Example
9557 /// ```ignore,no_run
9558 /// # use google_cloud_bigtable_admin_v2::model::DeleteSchemaBundleRequest;
9559 /// # let project_id = "project_id";
9560 /// # let instance_id = "instance_id";
9561 /// # let table_id = "table_id";
9562 /// # let schema_bundle_id = "schema_bundle_id";
9563 /// let x = DeleteSchemaBundleRequest::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/schemaBundles/{schema_bundle_id}"));
9564 /// ```
9565 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9566 self.name = v.into();
9567 self
9568 }
9569
9570 /// Sets the value of [etag][crate::model::DeleteSchemaBundleRequest::etag].
9571 ///
9572 /// # Example
9573 /// ```ignore,no_run
9574 /// # use google_cloud_bigtable_admin_v2::model::DeleteSchemaBundleRequest;
9575 /// let x = DeleteSchemaBundleRequest::new().set_etag("example");
9576 /// ```
9577 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9578 self.etag = v.into();
9579 self
9580 }
9581}
9582
9583impl wkt::message::Message for DeleteSchemaBundleRequest {
9584 fn typename() -> &'static str {
9585 "type.googleapis.com/google.bigtable.admin.v2.DeleteSchemaBundleRequest"
9586 }
9587}
9588
9589/// Encapsulates progress related information for a Cloud Bigtable long
9590/// running operation.
9591#[derive(Clone, Default, PartialEq)]
9592#[non_exhaustive]
9593pub struct OperationProgress {
9594 /// Percent completion of the operation.
9595 /// Values are between 0 and 100 inclusive.
9596 pub progress_percent: i32,
9597
9598 /// Time the request was received.
9599 pub start_time: std::option::Option<wkt::Timestamp>,
9600
9601 /// If set, the time at which this operation failed or was completed
9602 /// successfully.
9603 pub end_time: std::option::Option<wkt::Timestamp>,
9604
9605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9606}
9607
9608impl OperationProgress {
9609 /// Creates a new default instance.
9610 pub fn new() -> Self {
9611 std::default::Default::default()
9612 }
9613
9614 /// Sets the value of [progress_percent][crate::model::OperationProgress::progress_percent].
9615 ///
9616 /// # Example
9617 /// ```ignore,no_run
9618 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
9619 /// let x = OperationProgress::new().set_progress_percent(42);
9620 /// ```
9621 pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9622 self.progress_percent = v.into();
9623 self
9624 }
9625
9626 /// Sets the value of [start_time][crate::model::OperationProgress::start_time].
9627 ///
9628 /// # Example
9629 /// ```ignore,no_run
9630 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
9631 /// use wkt::Timestamp;
9632 /// let x = OperationProgress::new().set_start_time(Timestamp::default()/* use setters */);
9633 /// ```
9634 pub fn set_start_time<T>(mut self, v: T) -> Self
9635 where
9636 T: std::convert::Into<wkt::Timestamp>,
9637 {
9638 self.start_time = std::option::Option::Some(v.into());
9639 self
9640 }
9641
9642 /// Sets or clears the value of [start_time][crate::model::OperationProgress::start_time].
9643 ///
9644 /// # Example
9645 /// ```ignore,no_run
9646 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
9647 /// use wkt::Timestamp;
9648 /// let x = OperationProgress::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9649 /// let x = OperationProgress::new().set_or_clear_start_time(None::<Timestamp>);
9650 /// ```
9651 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9652 where
9653 T: std::convert::Into<wkt::Timestamp>,
9654 {
9655 self.start_time = v.map(|x| x.into());
9656 self
9657 }
9658
9659 /// Sets the value of [end_time][crate::model::OperationProgress::end_time].
9660 ///
9661 /// # Example
9662 /// ```ignore,no_run
9663 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
9664 /// use wkt::Timestamp;
9665 /// let x = OperationProgress::new().set_end_time(Timestamp::default()/* use setters */);
9666 /// ```
9667 pub fn set_end_time<T>(mut self, v: T) -> Self
9668 where
9669 T: std::convert::Into<wkt::Timestamp>,
9670 {
9671 self.end_time = std::option::Option::Some(v.into());
9672 self
9673 }
9674
9675 /// Sets or clears the value of [end_time][crate::model::OperationProgress::end_time].
9676 ///
9677 /// # Example
9678 /// ```ignore,no_run
9679 /// # use google_cloud_bigtable_admin_v2::model::OperationProgress;
9680 /// use wkt::Timestamp;
9681 /// let x = OperationProgress::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9682 /// let x = OperationProgress::new().set_or_clear_end_time(None::<Timestamp>);
9683 /// ```
9684 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9685 where
9686 T: std::convert::Into<wkt::Timestamp>,
9687 {
9688 self.end_time = v.map(|x| x.into());
9689 self
9690 }
9691}
9692
9693impl wkt::message::Message for OperationProgress {
9694 fn typename() -> &'static str {
9695 "type.googleapis.com/google.bigtable.admin.v2.OperationProgress"
9696 }
9697}
9698
9699/// A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
9700/// the resources that serve them.
9701/// All tables in an instance are served from all
9702/// [Clusters][google.bigtable.admin.v2.Cluster] in the instance.
9703///
9704/// [google.bigtable.admin.v2.Cluster]: crate::model::Cluster
9705/// [google.bigtable.admin.v2.Table]: crate::model::Table
9706#[derive(Clone, Default, PartialEq)]
9707#[non_exhaustive]
9708pub struct Instance {
9709 /// The unique name of the instance. Values are of the form
9710 /// `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
9711 pub name: std::string::String,
9712
9713 /// Required. The descriptive name for this instance as it appears in UIs.
9714 /// Can be changed at any time, but should be kept globally unique
9715 /// to avoid confusion.
9716 pub display_name: std::string::String,
9717
9718 /// Output only. The current state of the instance.
9719 pub state: crate::model::instance::State,
9720
9721 /// The type of the instance. Defaults to `PRODUCTION`.
9722 pub r#type: crate::model::instance::Type,
9723
9724 /// Optional. The edition of the instance. See
9725 /// [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
9726 ///
9727 /// [google.bigtable.admin.v2.Instance.Edition]: crate::model::instance::Edition
9728 pub edition: crate::model::instance::Edition,
9729
9730 /// Labels are a flexible and lightweight mechanism for organizing cloud
9731 /// resources into groups that reflect a customer's organizational needs and
9732 /// deployment strategies. They can be used to filter resources and aggregate
9733 /// metrics.
9734 ///
9735 /// * Label keys must be between 1 and 63 characters long and must conform to
9736 /// the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
9737 /// * Label values must be between 0 and 63 characters long and must conform to
9738 /// the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
9739 /// * No more than 64 labels can be associated with a given resource.
9740 /// * Keys and values must both be under 128 bytes.
9741 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9742
9743 /// Output only. A commit timestamp representing when this Instance was
9744 /// created. For instances created before this field was added (August 2021),
9745 /// this value is `seconds: 0, nanos: 1`.
9746 pub create_time: std::option::Option<wkt::Timestamp>,
9747
9748 /// Output only. Reserved for future use.
9749 pub satisfies_pzs: std::option::Option<bool>,
9750
9751 /// Output only. Reserved for future use.
9752 pub satisfies_pzi: std::option::Option<bool>,
9753
9754 /// Optional. Input only. Immutable. Tag keys/values directly bound to this
9755 /// resource. For example:
9756 ///
9757 /// - "123/environment": "production",
9758 /// - "123/costCenter": "marketing"
9759 ///
9760 /// Tags and Labels (above) are both used to bind metadata to resources, with
9761 /// different use-cases. See
9762 /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview> for an
9763 /// in-depth overview on the difference between tags and labels.
9764 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
9765
9766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9767}
9768
9769impl Instance {
9770 /// Creates a new default instance.
9771 pub fn new() -> Self {
9772 std::default::Default::default()
9773 }
9774
9775 /// Sets the value of [name][crate::model::Instance::name].
9776 ///
9777 /// # Example
9778 /// ```ignore,no_run
9779 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9780 /// # let project_id = "project_id";
9781 /// # let instance_id = "instance_id";
9782 /// let x = Instance::new().set_name(format!("projects/{project_id}/instances/{instance_id}"));
9783 /// ```
9784 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9785 self.name = v.into();
9786 self
9787 }
9788
9789 /// Sets the value of [display_name][crate::model::Instance::display_name].
9790 ///
9791 /// # Example
9792 /// ```ignore,no_run
9793 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9794 /// let x = Instance::new().set_display_name("example");
9795 /// ```
9796 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9797 self.display_name = v.into();
9798 self
9799 }
9800
9801 /// Sets the value of [state][crate::model::Instance::state].
9802 ///
9803 /// # Example
9804 /// ```ignore,no_run
9805 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9806 /// use google_cloud_bigtable_admin_v2::model::instance::State;
9807 /// let x0 = Instance::new().set_state(State::Ready);
9808 /// let x1 = Instance::new().set_state(State::Creating);
9809 /// ```
9810 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
9811 self.state = v.into();
9812 self
9813 }
9814
9815 /// Sets the value of [r#type][crate::model::Instance::type].
9816 ///
9817 /// # Example
9818 /// ```ignore,no_run
9819 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9820 /// use google_cloud_bigtable_admin_v2::model::instance::Type;
9821 /// let x0 = Instance::new().set_type(Type::Production);
9822 /// let x1 = Instance::new().set_type(Type::Development);
9823 /// ```
9824 pub fn set_type<T: std::convert::Into<crate::model::instance::Type>>(mut self, v: T) -> Self {
9825 self.r#type = v.into();
9826 self
9827 }
9828
9829 /// Sets the value of [edition][crate::model::Instance::edition].
9830 ///
9831 /// # Example
9832 /// ```ignore,no_run
9833 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9834 /// use google_cloud_bigtable_admin_v2::model::instance::Edition;
9835 /// let x0 = Instance::new().set_edition(Edition::Enterprise);
9836 /// let x1 = Instance::new().set_edition(Edition::EnterprisePlus);
9837 /// ```
9838 pub fn set_edition<T: std::convert::Into<crate::model::instance::Edition>>(
9839 mut self,
9840 v: T,
9841 ) -> Self {
9842 self.edition = v.into();
9843 self
9844 }
9845
9846 /// Sets the value of [labels][crate::model::Instance::labels].
9847 ///
9848 /// # Example
9849 /// ```ignore,no_run
9850 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9851 /// let x = Instance::new().set_labels([
9852 /// ("key0", "abc"),
9853 /// ("key1", "xyz"),
9854 /// ]);
9855 /// ```
9856 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9857 where
9858 T: std::iter::IntoIterator<Item = (K, V)>,
9859 K: std::convert::Into<std::string::String>,
9860 V: std::convert::Into<std::string::String>,
9861 {
9862 use std::iter::Iterator;
9863 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9864 self
9865 }
9866
9867 /// Sets the value of [create_time][crate::model::Instance::create_time].
9868 ///
9869 /// # Example
9870 /// ```ignore,no_run
9871 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9872 /// use wkt::Timestamp;
9873 /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
9874 /// ```
9875 pub fn set_create_time<T>(mut self, v: T) -> Self
9876 where
9877 T: std::convert::Into<wkt::Timestamp>,
9878 {
9879 self.create_time = std::option::Option::Some(v.into());
9880 self
9881 }
9882
9883 /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
9884 ///
9885 /// # Example
9886 /// ```ignore,no_run
9887 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9888 /// use wkt::Timestamp;
9889 /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9890 /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
9891 /// ```
9892 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9893 where
9894 T: std::convert::Into<wkt::Timestamp>,
9895 {
9896 self.create_time = v.map(|x| x.into());
9897 self
9898 }
9899
9900 /// Sets the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
9901 ///
9902 /// # Example
9903 /// ```ignore,no_run
9904 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9905 /// let x = Instance::new().set_satisfies_pzs(true);
9906 /// ```
9907 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
9908 where
9909 T: std::convert::Into<bool>,
9910 {
9911 self.satisfies_pzs = std::option::Option::Some(v.into());
9912 self
9913 }
9914
9915 /// Sets or clears the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
9916 ///
9917 /// # Example
9918 /// ```ignore,no_run
9919 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9920 /// let x = Instance::new().set_or_clear_satisfies_pzs(Some(false));
9921 /// let x = Instance::new().set_or_clear_satisfies_pzs(None::<bool>);
9922 /// ```
9923 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
9924 where
9925 T: std::convert::Into<bool>,
9926 {
9927 self.satisfies_pzs = v.map(|x| x.into());
9928 self
9929 }
9930
9931 /// Sets the value of [satisfies_pzi][crate::model::Instance::satisfies_pzi].
9932 ///
9933 /// # Example
9934 /// ```ignore,no_run
9935 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9936 /// let x = Instance::new().set_satisfies_pzi(true);
9937 /// ```
9938 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
9939 where
9940 T: std::convert::Into<bool>,
9941 {
9942 self.satisfies_pzi = std::option::Option::Some(v.into());
9943 self
9944 }
9945
9946 /// Sets or clears the value of [satisfies_pzi][crate::model::Instance::satisfies_pzi].
9947 ///
9948 /// # Example
9949 /// ```ignore,no_run
9950 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9951 /// let x = Instance::new().set_or_clear_satisfies_pzi(Some(false));
9952 /// let x = Instance::new().set_or_clear_satisfies_pzi(None::<bool>);
9953 /// ```
9954 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
9955 where
9956 T: std::convert::Into<bool>,
9957 {
9958 self.satisfies_pzi = v.map(|x| x.into());
9959 self
9960 }
9961
9962 /// Sets the value of [tags][crate::model::Instance::tags].
9963 ///
9964 /// # Example
9965 /// ```ignore,no_run
9966 /// # use google_cloud_bigtable_admin_v2::model::Instance;
9967 /// let x = Instance::new().set_tags([
9968 /// ("key0", "abc"),
9969 /// ("key1", "xyz"),
9970 /// ]);
9971 /// ```
9972 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
9973 where
9974 T: std::iter::IntoIterator<Item = (K, V)>,
9975 K: std::convert::Into<std::string::String>,
9976 V: std::convert::Into<std::string::String>,
9977 {
9978 use std::iter::Iterator;
9979 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9980 self
9981 }
9982}
9983
9984impl wkt::message::Message for Instance {
9985 fn typename() -> &'static str {
9986 "type.googleapis.com/google.bigtable.admin.v2.Instance"
9987 }
9988}
9989
9990/// Defines additional types related to [Instance].
9991pub mod instance {
9992 #[allow(unused_imports)]
9993 use super::*;
9994
9995 /// Possible states of an instance.
9996 ///
9997 /// # Working with unknown values
9998 ///
9999 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10000 /// additional enum variants at any time. Adding new variants is not considered
10001 /// a breaking change. Applications should write their code in anticipation of:
10002 ///
10003 /// - New values appearing in future releases of the client library, **and**
10004 /// - New values received dynamically, without application changes.
10005 ///
10006 /// Please consult the [Working with enums] section in the user guide for some
10007 /// guidelines.
10008 ///
10009 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10010 #[derive(Clone, Debug, PartialEq)]
10011 #[non_exhaustive]
10012 pub enum State {
10013 /// The state of the instance could not be determined.
10014 NotKnown,
10015 /// The instance has been successfully created and can serve requests
10016 /// to its tables.
10017 Ready,
10018 /// The instance is currently being created, and may be destroyed
10019 /// if the creation process encounters an error.
10020 Creating,
10021 /// If set, the enum was initialized with an unknown value.
10022 ///
10023 /// Applications can examine the value using [State::value] or
10024 /// [State::name].
10025 UnknownValue(state::UnknownValue),
10026 }
10027
10028 #[doc(hidden)]
10029 pub mod state {
10030 #[allow(unused_imports)]
10031 use super::*;
10032 #[derive(Clone, Debug, PartialEq)]
10033 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10034 }
10035
10036 impl State {
10037 /// Gets the enum value.
10038 ///
10039 /// Returns `None` if the enum contains an unknown value deserialized from
10040 /// the string representation of enums.
10041 pub fn value(&self) -> std::option::Option<i32> {
10042 match self {
10043 Self::NotKnown => std::option::Option::Some(0),
10044 Self::Ready => std::option::Option::Some(1),
10045 Self::Creating => std::option::Option::Some(2),
10046 Self::UnknownValue(u) => u.0.value(),
10047 }
10048 }
10049
10050 /// Gets the enum value as a string.
10051 ///
10052 /// Returns `None` if the enum contains an unknown value deserialized from
10053 /// the integer representation of enums.
10054 pub fn name(&self) -> std::option::Option<&str> {
10055 match self {
10056 Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
10057 Self::Ready => std::option::Option::Some("READY"),
10058 Self::Creating => std::option::Option::Some("CREATING"),
10059 Self::UnknownValue(u) => u.0.name(),
10060 }
10061 }
10062 }
10063
10064 impl std::default::Default for State {
10065 fn default() -> Self {
10066 use std::convert::From;
10067 Self::from(0)
10068 }
10069 }
10070
10071 impl std::fmt::Display for State {
10072 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10073 wkt::internal::display_enum(f, self.name(), self.value())
10074 }
10075 }
10076
10077 impl std::convert::From<i32> for State {
10078 fn from(value: i32) -> Self {
10079 match value {
10080 0 => Self::NotKnown,
10081 1 => Self::Ready,
10082 2 => Self::Creating,
10083 _ => Self::UnknownValue(state::UnknownValue(
10084 wkt::internal::UnknownEnumValue::Integer(value),
10085 )),
10086 }
10087 }
10088 }
10089
10090 impl std::convert::From<&str> for State {
10091 fn from(value: &str) -> Self {
10092 use std::string::ToString;
10093 match value {
10094 "STATE_NOT_KNOWN" => Self::NotKnown,
10095 "READY" => Self::Ready,
10096 "CREATING" => Self::Creating,
10097 _ => Self::UnknownValue(state::UnknownValue(
10098 wkt::internal::UnknownEnumValue::String(value.to_string()),
10099 )),
10100 }
10101 }
10102 }
10103
10104 impl serde::ser::Serialize for State {
10105 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10106 where
10107 S: serde::Serializer,
10108 {
10109 match self {
10110 Self::NotKnown => serializer.serialize_i32(0),
10111 Self::Ready => serializer.serialize_i32(1),
10112 Self::Creating => serializer.serialize_i32(2),
10113 Self::UnknownValue(u) => u.0.serialize(serializer),
10114 }
10115 }
10116 }
10117
10118 impl<'de> serde::de::Deserialize<'de> for State {
10119 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10120 where
10121 D: serde::Deserializer<'de>,
10122 {
10123 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10124 ".google.bigtable.admin.v2.Instance.State",
10125 ))
10126 }
10127 }
10128
10129 /// The type of the instance.
10130 ///
10131 /// # Working with unknown values
10132 ///
10133 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10134 /// additional enum variants at any time. Adding new variants is not considered
10135 /// a breaking change. Applications should write their code in anticipation of:
10136 ///
10137 /// - New values appearing in future releases of the client library, **and**
10138 /// - New values received dynamically, without application changes.
10139 ///
10140 /// Please consult the [Working with enums] section in the user guide for some
10141 /// guidelines.
10142 ///
10143 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10144 #[derive(Clone, Debug, PartialEq)]
10145 #[non_exhaustive]
10146 pub enum Type {
10147 /// The type of the instance is unspecified. If set when creating an
10148 /// instance, a `PRODUCTION` instance will be created. If set when updating
10149 /// an instance, the type will be left unchanged.
10150 Unspecified,
10151 /// An instance meant for production use. `serve_nodes` must be set
10152 /// on the cluster.
10153 Production,
10154 /// DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces
10155 /// a higher minimum node count than DEVELOPMENT.
10156 Development,
10157 /// If set, the enum was initialized with an unknown value.
10158 ///
10159 /// Applications can examine the value using [Type::value] or
10160 /// [Type::name].
10161 UnknownValue(r#type::UnknownValue),
10162 }
10163
10164 #[doc(hidden)]
10165 pub mod r#type {
10166 #[allow(unused_imports)]
10167 use super::*;
10168 #[derive(Clone, Debug, PartialEq)]
10169 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10170 }
10171
10172 impl Type {
10173 /// Gets the enum value.
10174 ///
10175 /// Returns `None` if the enum contains an unknown value deserialized from
10176 /// the string representation of enums.
10177 pub fn value(&self) -> std::option::Option<i32> {
10178 match self {
10179 Self::Unspecified => std::option::Option::Some(0),
10180 Self::Production => std::option::Option::Some(1),
10181 Self::Development => std::option::Option::Some(2),
10182 Self::UnknownValue(u) => u.0.value(),
10183 }
10184 }
10185
10186 /// Gets the enum value as a string.
10187 ///
10188 /// Returns `None` if the enum contains an unknown value deserialized from
10189 /// the integer representation of enums.
10190 pub fn name(&self) -> std::option::Option<&str> {
10191 match self {
10192 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
10193 Self::Production => std::option::Option::Some("PRODUCTION"),
10194 Self::Development => std::option::Option::Some("DEVELOPMENT"),
10195 Self::UnknownValue(u) => u.0.name(),
10196 }
10197 }
10198 }
10199
10200 impl std::default::Default for Type {
10201 fn default() -> Self {
10202 use std::convert::From;
10203 Self::from(0)
10204 }
10205 }
10206
10207 impl std::fmt::Display for Type {
10208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10209 wkt::internal::display_enum(f, self.name(), self.value())
10210 }
10211 }
10212
10213 impl std::convert::From<i32> for Type {
10214 fn from(value: i32) -> Self {
10215 match value {
10216 0 => Self::Unspecified,
10217 1 => Self::Production,
10218 2 => Self::Development,
10219 _ => Self::UnknownValue(r#type::UnknownValue(
10220 wkt::internal::UnknownEnumValue::Integer(value),
10221 )),
10222 }
10223 }
10224 }
10225
10226 impl std::convert::From<&str> for Type {
10227 fn from(value: &str) -> Self {
10228 use std::string::ToString;
10229 match value {
10230 "TYPE_UNSPECIFIED" => Self::Unspecified,
10231 "PRODUCTION" => Self::Production,
10232 "DEVELOPMENT" => Self::Development,
10233 _ => Self::UnknownValue(r#type::UnknownValue(
10234 wkt::internal::UnknownEnumValue::String(value.to_string()),
10235 )),
10236 }
10237 }
10238 }
10239
10240 impl serde::ser::Serialize for Type {
10241 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10242 where
10243 S: serde::Serializer,
10244 {
10245 match self {
10246 Self::Unspecified => serializer.serialize_i32(0),
10247 Self::Production => serializer.serialize_i32(1),
10248 Self::Development => serializer.serialize_i32(2),
10249 Self::UnknownValue(u) => u.0.serialize(serializer),
10250 }
10251 }
10252 }
10253
10254 impl<'de> serde::de::Deserialize<'de> for Type {
10255 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10256 where
10257 D: serde::Deserializer<'de>,
10258 {
10259 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10260 ".google.bigtable.admin.v2.Instance.Type",
10261 ))
10262 }
10263 }
10264
10265 /// Possible editions of an instance.
10266 ///
10267 /// An edition is a specific tier of Cloud Bigtable. Each edition is tailored
10268 /// to different customer needs. Higher tiers offer more features and better
10269 /// performance.
10270 ///
10271 /// # Working with unknown values
10272 ///
10273 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10274 /// additional enum variants at any time. Adding new variants is not considered
10275 /// a breaking change. Applications should write their code in anticipation of:
10276 ///
10277 /// - New values appearing in future releases of the client library, **and**
10278 /// - New values received dynamically, without application changes.
10279 ///
10280 /// Please consult the [Working with enums] section in the user guide for some
10281 /// guidelines.
10282 ///
10283 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10284 #[derive(Clone, Debug, PartialEq)]
10285 #[non_exhaustive]
10286 pub enum Edition {
10287 /// The edition is unspecified. This is treated as `ENTERPRISE`.
10288 Unspecified,
10289 /// The Enterprise edition. This is the default offering that is designed to
10290 /// meet the needs of most enterprise workloads.
10291 Enterprise,
10292 /// The Enterprise Plus edition. This is a premium tier that is designed for
10293 /// demanding, multi-tenant workloads requiring the highest levels of
10294 /// performance, scale, and global availability.
10295 ///
10296 /// The nodes in the Enterprise Plus tier come at a higher cost than the
10297 /// Enterprise tier. Any Enterprise Plus features must be disabled before
10298 /// downgrading to Enterprise.
10299 EnterprisePlus,
10300 /// If set, the enum was initialized with an unknown value.
10301 ///
10302 /// Applications can examine the value using [Edition::value] or
10303 /// [Edition::name].
10304 UnknownValue(edition::UnknownValue),
10305 }
10306
10307 #[doc(hidden)]
10308 pub mod edition {
10309 #[allow(unused_imports)]
10310 use super::*;
10311 #[derive(Clone, Debug, PartialEq)]
10312 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10313 }
10314
10315 impl Edition {
10316 /// Gets the enum value.
10317 ///
10318 /// Returns `None` if the enum contains an unknown value deserialized from
10319 /// the string representation of enums.
10320 pub fn value(&self) -> std::option::Option<i32> {
10321 match self {
10322 Self::Unspecified => std::option::Option::Some(0),
10323 Self::Enterprise => std::option::Option::Some(1),
10324 Self::EnterprisePlus => std::option::Option::Some(2),
10325 Self::UnknownValue(u) => u.0.value(),
10326 }
10327 }
10328
10329 /// Gets the enum value as a string.
10330 ///
10331 /// Returns `None` if the enum contains an unknown value deserialized from
10332 /// the integer representation of enums.
10333 pub fn name(&self) -> std::option::Option<&str> {
10334 match self {
10335 Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
10336 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
10337 Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
10338 Self::UnknownValue(u) => u.0.name(),
10339 }
10340 }
10341 }
10342
10343 impl std::default::Default for Edition {
10344 fn default() -> Self {
10345 use std::convert::From;
10346 Self::from(0)
10347 }
10348 }
10349
10350 impl std::fmt::Display for Edition {
10351 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10352 wkt::internal::display_enum(f, self.name(), self.value())
10353 }
10354 }
10355
10356 impl std::convert::From<i32> for Edition {
10357 fn from(value: i32) -> Self {
10358 match value {
10359 0 => Self::Unspecified,
10360 1 => Self::Enterprise,
10361 2 => Self::EnterprisePlus,
10362 _ => Self::UnknownValue(edition::UnknownValue(
10363 wkt::internal::UnknownEnumValue::Integer(value),
10364 )),
10365 }
10366 }
10367 }
10368
10369 impl std::convert::From<&str> for Edition {
10370 fn from(value: &str) -> Self {
10371 use std::string::ToString;
10372 match value {
10373 "EDITION_UNSPECIFIED" => Self::Unspecified,
10374 "ENTERPRISE" => Self::Enterprise,
10375 "ENTERPRISE_PLUS" => Self::EnterprisePlus,
10376 _ => Self::UnknownValue(edition::UnknownValue(
10377 wkt::internal::UnknownEnumValue::String(value.to_string()),
10378 )),
10379 }
10380 }
10381 }
10382
10383 impl serde::ser::Serialize for Edition {
10384 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10385 where
10386 S: serde::Serializer,
10387 {
10388 match self {
10389 Self::Unspecified => serializer.serialize_i32(0),
10390 Self::Enterprise => serializer.serialize_i32(1),
10391 Self::EnterprisePlus => serializer.serialize_i32(2),
10392 Self::UnknownValue(u) => u.0.serialize(serializer),
10393 }
10394 }
10395 }
10396
10397 impl<'de> serde::de::Deserialize<'de> for Edition {
10398 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10399 where
10400 D: serde::Deserializer<'de>,
10401 {
10402 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
10403 ".google.bigtable.admin.v2.Instance.Edition",
10404 ))
10405 }
10406 }
10407}
10408
10409/// The Autoscaling targets for a Cluster. These determine the recommended nodes.
10410#[derive(Clone, Default, PartialEq)]
10411#[non_exhaustive]
10412pub struct AutoscalingTargets {
10413 /// The cpu utilization that the Autoscaler should be trying to achieve.
10414 /// This number is on a scale from 0 (no utilization) to
10415 /// 100 (total utilization), and is limited between 10 and 80, otherwise it
10416 /// will return INVALID_ARGUMENT error.
10417 pub cpu_utilization_percent: i32,
10418
10419 /// The storage utilization that the Autoscaler should be trying to achieve.
10420 /// This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
10421 /// cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
10422 /// otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
10423 /// it will be treated as if it were set to the default value: 2560 for SSD,
10424 /// 8192 for HDD.
10425 pub storage_utilization_gib_per_node: i32,
10426
10427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10428}
10429
10430impl AutoscalingTargets {
10431 /// Creates a new default instance.
10432 pub fn new() -> Self {
10433 std::default::Default::default()
10434 }
10435
10436 /// Sets the value of [cpu_utilization_percent][crate::model::AutoscalingTargets::cpu_utilization_percent].
10437 ///
10438 /// # Example
10439 /// ```ignore,no_run
10440 /// # use google_cloud_bigtable_admin_v2::model::AutoscalingTargets;
10441 /// let x = AutoscalingTargets::new().set_cpu_utilization_percent(42);
10442 /// ```
10443 pub fn set_cpu_utilization_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10444 self.cpu_utilization_percent = v.into();
10445 self
10446 }
10447
10448 /// Sets the value of [storage_utilization_gib_per_node][crate::model::AutoscalingTargets::storage_utilization_gib_per_node].
10449 ///
10450 /// # Example
10451 /// ```ignore,no_run
10452 /// # use google_cloud_bigtable_admin_v2::model::AutoscalingTargets;
10453 /// let x = AutoscalingTargets::new().set_storage_utilization_gib_per_node(42);
10454 /// ```
10455 pub fn set_storage_utilization_gib_per_node<T: std::convert::Into<i32>>(
10456 mut self,
10457 v: T,
10458 ) -> Self {
10459 self.storage_utilization_gib_per_node = v.into();
10460 self
10461 }
10462}
10463
10464impl wkt::message::Message for AutoscalingTargets {
10465 fn typename() -> &'static str {
10466 "type.googleapis.com/google.bigtable.admin.v2.AutoscalingTargets"
10467 }
10468}
10469
10470/// Limits for the number of nodes a Cluster can autoscale up/down to.
10471#[derive(Clone, Default, PartialEq)]
10472#[non_exhaustive]
10473pub struct AutoscalingLimits {
10474 /// Required. Minimum number of nodes to scale down to.
10475 pub min_serve_nodes: i32,
10476
10477 /// Required. Maximum number of nodes to scale up to.
10478 pub max_serve_nodes: i32,
10479
10480 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10481}
10482
10483impl AutoscalingLimits {
10484 /// Creates a new default instance.
10485 pub fn new() -> Self {
10486 std::default::Default::default()
10487 }
10488
10489 /// Sets the value of [min_serve_nodes][crate::model::AutoscalingLimits::min_serve_nodes].
10490 ///
10491 /// # Example
10492 /// ```ignore,no_run
10493 /// # use google_cloud_bigtable_admin_v2::model::AutoscalingLimits;
10494 /// let x = AutoscalingLimits::new().set_min_serve_nodes(42);
10495 /// ```
10496 pub fn set_min_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10497 self.min_serve_nodes = v.into();
10498 self
10499 }
10500
10501 /// Sets the value of [max_serve_nodes][crate::model::AutoscalingLimits::max_serve_nodes].
10502 ///
10503 /// # Example
10504 /// ```ignore,no_run
10505 /// # use google_cloud_bigtable_admin_v2::model::AutoscalingLimits;
10506 /// let x = AutoscalingLimits::new().set_max_serve_nodes(42);
10507 /// ```
10508 pub fn set_max_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10509 self.max_serve_nodes = v.into();
10510 self
10511 }
10512}
10513
10514impl wkt::message::Message for AutoscalingLimits {
10515 fn typename() -> &'static str {
10516 "type.googleapis.com/google.bigtable.admin.v2.AutoscalingLimits"
10517 }
10518}
10519
10520/// A resizable group of nodes in a particular cloud location, capable
10521/// of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
10522/// [Instance][google.bigtable.admin.v2.Instance].
10523///
10524/// [google.bigtable.admin.v2.Instance]: crate::model::Instance
10525/// [google.bigtable.admin.v2.Table]: crate::model::Table
10526#[derive(Clone, Default, PartialEq)]
10527#[non_exhaustive]
10528pub struct Cluster {
10529 /// The unique name of the cluster. Values are of the form
10530 /// `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
10531 pub name: std::string::String,
10532
10533 /// Immutable. The location where this cluster's nodes and storage reside. For
10534 /// best performance, clients should be located as close as possible to this
10535 /// cluster. Currently only zones are supported, so values should be of the
10536 /// form `projects/{project}/locations/{zone}`.
10537 pub location: std::string::String,
10538
10539 /// Output only. The current state of the cluster.
10540 pub state: crate::model::cluster::State,
10541
10542 /// The number of nodes in the cluster. If no value is set,
10543 /// Cloud Bigtable automatically allocates nodes based on your data footprint
10544 /// and optimized for 50% storage utilization.
10545 pub serve_nodes: i32,
10546
10547 /// Immutable. The node scaling factor of this cluster.
10548 pub node_scaling_factor: crate::model::cluster::NodeScalingFactor,
10549
10550 /// Immutable. The type of storage used by this cluster to serve its
10551 /// parent instance's tables, unless explicitly overridden.
10552 pub default_storage_type: crate::model::StorageType,
10553
10554 /// Immutable. The encryption configuration for CMEK-protected clusters.
10555 pub encryption_config: std::option::Option<crate::model::cluster::EncryptionConfig>,
10556
10557 #[allow(missing_docs)]
10558 pub config: std::option::Option<crate::model::cluster::Config>,
10559
10560 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10561}
10562
10563impl Cluster {
10564 /// Creates a new default instance.
10565 pub fn new() -> Self {
10566 std::default::Default::default()
10567 }
10568
10569 /// Sets the value of [name][crate::model::Cluster::name].
10570 ///
10571 /// # Example
10572 /// ```ignore,no_run
10573 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10574 /// # let project_id = "project_id";
10575 /// # let instance_id = "instance_id";
10576 /// # let cluster_id = "cluster_id";
10577 /// let x = Cluster::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}"));
10578 /// ```
10579 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10580 self.name = v.into();
10581 self
10582 }
10583
10584 /// Sets the value of [location][crate::model::Cluster::location].
10585 ///
10586 /// # Example
10587 /// ```ignore,no_run
10588 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10589 /// let x = Cluster::new().set_location("example");
10590 /// ```
10591 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10592 self.location = v.into();
10593 self
10594 }
10595
10596 /// Sets the value of [state][crate::model::Cluster::state].
10597 ///
10598 /// # Example
10599 /// ```ignore,no_run
10600 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10601 /// use google_cloud_bigtable_admin_v2::model::cluster::State;
10602 /// let x0 = Cluster::new().set_state(State::Ready);
10603 /// let x1 = Cluster::new().set_state(State::Creating);
10604 /// let x2 = Cluster::new().set_state(State::Resizing);
10605 /// ```
10606 pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
10607 self.state = v.into();
10608 self
10609 }
10610
10611 /// Sets the value of [serve_nodes][crate::model::Cluster::serve_nodes].
10612 ///
10613 /// # Example
10614 /// ```ignore,no_run
10615 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10616 /// let x = Cluster::new().set_serve_nodes(42);
10617 /// ```
10618 pub fn set_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10619 self.serve_nodes = v.into();
10620 self
10621 }
10622
10623 /// Sets the value of [node_scaling_factor][crate::model::Cluster::node_scaling_factor].
10624 ///
10625 /// # Example
10626 /// ```ignore,no_run
10627 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10628 /// use google_cloud_bigtable_admin_v2::model::cluster::NodeScalingFactor;
10629 /// let x0 = Cluster::new().set_node_scaling_factor(NodeScalingFactor::NodeScalingFactor1X);
10630 /// let x1 = Cluster::new().set_node_scaling_factor(NodeScalingFactor::NodeScalingFactor2X);
10631 /// ```
10632 pub fn set_node_scaling_factor<
10633 T: std::convert::Into<crate::model::cluster::NodeScalingFactor>,
10634 >(
10635 mut self,
10636 v: T,
10637 ) -> Self {
10638 self.node_scaling_factor = v.into();
10639 self
10640 }
10641
10642 /// Sets the value of [default_storage_type][crate::model::Cluster::default_storage_type].
10643 ///
10644 /// # Example
10645 /// ```ignore,no_run
10646 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10647 /// use google_cloud_bigtable_admin_v2::model::StorageType;
10648 /// let x0 = Cluster::new().set_default_storage_type(StorageType::Ssd);
10649 /// let x1 = Cluster::new().set_default_storage_type(StorageType::Hdd);
10650 /// ```
10651 pub fn set_default_storage_type<T: std::convert::Into<crate::model::StorageType>>(
10652 mut self,
10653 v: T,
10654 ) -> Self {
10655 self.default_storage_type = v.into();
10656 self
10657 }
10658
10659 /// Sets the value of [encryption_config][crate::model::Cluster::encryption_config].
10660 ///
10661 /// # Example
10662 /// ```ignore,no_run
10663 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10664 /// use google_cloud_bigtable_admin_v2::model::cluster::EncryptionConfig;
10665 /// let x = Cluster::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
10666 /// ```
10667 pub fn set_encryption_config<T>(mut self, v: T) -> Self
10668 where
10669 T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
10670 {
10671 self.encryption_config = std::option::Option::Some(v.into());
10672 self
10673 }
10674
10675 /// Sets or clears the value of [encryption_config][crate::model::Cluster::encryption_config].
10676 ///
10677 /// # Example
10678 /// ```ignore,no_run
10679 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10680 /// use google_cloud_bigtable_admin_v2::model::cluster::EncryptionConfig;
10681 /// let x = Cluster::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
10682 /// let x = Cluster::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
10683 /// ```
10684 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
10685 where
10686 T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
10687 {
10688 self.encryption_config = v.map(|x| x.into());
10689 self
10690 }
10691
10692 /// Sets the value of [config][crate::model::Cluster::config].
10693 ///
10694 /// Note that all the setters affecting `config` are mutually
10695 /// exclusive.
10696 ///
10697 /// # Example
10698 /// ```ignore,no_run
10699 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10700 /// use google_cloud_bigtable_admin_v2::model::cluster::ClusterConfig;
10701 /// let x = Cluster::new().set_config(Some(
10702 /// google_cloud_bigtable_admin_v2::model::cluster::Config::ClusterConfig(ClusterConfig::default().into())));
10703 /// ```
10704 pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::cluster::Config>>>(
10705 mut self,
10706 v: T,
10707 ) -> Self {
10708 self.config = v.into();
10709 self
10710 }
10711
10712 /// The value of [config][crate::model::Cluster::config]
10713 /// if it holds a `ClusterConfig`, `None` if the field is not set or
10714 /// holds a different branch.
10715 pub fn cluster_config(
10716 &self,
10717 ) -> std::option::Option<&std::boxed::Box<crate::model::cluster::ClusterConfig>> {
10718 #[allow(unreachable_patterns)]
10719 self.config.as_ref().and_then(|v| match v {
10720 crate::model::cluster::Config::ClusterConfig(v) => std::option::Option::Some(v),
10721 _ => std::option::Option::None,
10722 })
10723 }
10724
10725 /// Sets the value of [config][crate::model::Cluster::config]
10726 /// to hold a `ClusterConfig`.
10727 ///
10728 /// Note that all the setters affecting `config` are
10729 /// mutually exclusive.
10730 ///
10731 /// # Example
10732 /// ```ignore,no_run
10733 /// # use google_cloud_bigtable_admin_v2::model::Cluster;
10734 /// use google_cloud_bigtable_admin_v2::model::cluster::ClusterConfig;
10735 /// let x = Cluster::new().set_cluster_config(ClusterConfig::default()/* use setters */);
10736 /// assert!(x.cluster_config().is_some());
10737 /// ```
10738 pub fn set_cluster_config<
10739 T: std::convert::Into<std::boxed::Box<crate::model::cluster::ClusterConfig>>,
10740 >(
10741 mut self,
10742 v: T,
10743 ) -> Self {
10744 self.config =
10745 std::option::Option::Some(crate::model::cluster::Config::ClusterConfig(v.into()));
10746 self
10747 }
10748}
10749
10750impl wkt::message::Message for Cluster {
10751 fn typename() -> &'static str {
10752 "type.googleapis.com/google.bigtable.admin.v2.Cluster"
10753 }
10754}
10755
10756/// Defines additional types related to [Cluster].
10757pub mod cluster {
10758 #[allow(unused_imports)]
10759 use super::*;
10760
10761 /// Autoscaling config for a cluster.
10762 #[derive(Clone, Default, PartialEq)]
10763 #[non_exhaustive]
10764 pub struct ClusterAutoscalingConfig {
10765 /// Required. Autoscaling limits for this cluster.
10766 pub autoscaling_limits: std::option::Option<crate::model::AutoscalingLimits>,
10767
10768 /// Required. Autoscaling targets for this cluster.
10769 pub autoscaling_targets: std::option::Option<crate::model::AutoscalingTargets>,
10770
10771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10772 }
10773
10774 impl ClusterAutoscalingConfig {
10775 /// Creates a new default instance.
10776 pub fn new() -> Self {
10777 std::default::Default::default()
10778 }
10779
10780 /// Sets the value of [autoscaling_limits][crate::model::cluster::ClusterAutoscalingConfig::autoscaling_limits].
10781 ///
10782 /// # Example
10783 /// ```ignore,no_run
10784 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
10785 /// use google_cloud_bigtable_admin_v2::model::AutoscalingLimits;
10786 /// let x = ClusterAutoscalingConfig::new().set_autoscaling_limits(AutoscalingLimits::default()/* use setters */);
10787 /// ```
10788 pub fn set_autoscaling_limits<T>(mut self, v: T) -> Self
10789 where
10790 T: std::convert::Into<crate::model::AutoscalingLimits>,
10791 {
10792 self.autoscaling_limits = std::option::Option::Some(v.into());
10793 self
10794 }
10795
10796 /// Sets or clears the value of [autoscaling_limits][crate::model::cluster::ClusterAutoscalingConfig::autoscaling_limits].
10797 ///
10798 /// # Example
10799 /// ```ignore,no_run
10800 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
10801 /// use google_cloud_bigtable_admin_v2::model::AutoscalingLimits;
10802 /// let x = ClusterAutoscalingConfig::new().set_or_clear_autoscaling_limits(Some(AutoscalingLimits::default()/* use setters */));
10803 /// let x = ClusterAutoscalingConfig::new().set_or_clear_autoscaling_limits(None::<AutoscalingLimits>);
10804 /// ```
10805 pub fn set_or_clear_autoscaling_limits<T>(mut self, v: std::option::Option<T>) -> Self
10806 where
10807 T: std::convert::Into<crate::model::AutoscalingLimits>,
10808 {
10809 self.autoscaling_limits = v.map(|x| x.into());
10810 self
10811 }
10812
10813 /// Sets the value of [autoscaling_targets][crate::model::cluster::ClusterAutoscalingConfig::autoscaling_targets].
10814 ///
10815 /// # Example
10816 /// ```ignore,no_run
10817 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
10818 /// use google_cloud_bigtable_admin_v2::model::AutoscalingTargets;
10819 /// let x = ClusterAutoscalingConfig::new().set_autoscaling_targets(AutoscalingTargets::default()/* use setters */);
10820 /// ```
10821 pub fn set_autoscaling_targets<T>(mut self, v: T) -> Self
10822 where
10823 T: std::convert::Into<crate::model::AutoscalingTargets>,
10824 {
10825 self.autoscaling_targets = std::option::Option::Some(v.into());
10826 self
10827 }
10828
10829 /// Sets or clears the value of [autoscaling_targets][crate::model::cluster::ClusterAutoscalingConfig::autoscaling_targets].
10830 ///
10831 /// # Example
10832 /// ```ignore,no_run
10833 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
10834 /// use google_cloud_bigtable_admin_v2::model::AutoscalingTargets;
10835 /// let x = ClusterAutoscalingConfig::new().set_or_clear_autoscaling_targets(Some(AutoscalingTargets::default()/* use setters */));
10836 /// let x = ClusterAutoscalingConfig::new().set_or_clear_autoscaling_targets(None::<AutoscalingTargets>);
10837 /// ```
10838 pub fn set_or_clear_autoscaling_targets<T>(mut self, v: std::option::Option<T>) -> Self
10839 where
10840 T: std::convert::Into<crate::model::AutoscalingTargets>,
10841 {
10842 self.autoscaling_targets = v.map(|x| x.into());
10843 self
10844 }
10845 }
10846
10847 impl wkt::message::Message for ClusterAutoscalingConfig {
10848 fn typename() -> &'static str {
10849 "type.googleapis.com/google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig"
10850 }
10851 }
10852
10853 /// Configuration for a cluster.
10854 #[derive(Clone, Default, PartialEq)]
10855 #[non_exhaustive]
10856 pub struct ClusterConfig {
10857 /// Autoscaling configuration for this cluster.
10858 pub cluster_autoscaling_config:
10859 std::option::Option<crate::model::cluster::ClusterAutoscalingConfig>,
10860
10861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10862 }
10863
10864 impl ClusterConfig {
10865 /// Creates a new default instance.
10866 pub fn new() -> Self {
10867 std::default::Default::default()
10868 }
10869
10870 /// Sets the value of [cluster_autoscaling_config][crate::model::cluster::ClusterConfig::cluster_autoscaling_config].
10871 ///
10872 /// # Example
10873 /// ```ignore,no_run
10874 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterConfig;
10875 /// use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
10876 /// let x = ClusterConfig::new().set_cluster_autoscaling_config(ClusterAutoscalingConfig::default()/* use setters */);
10877 /// ```
10878 pub fn set_cluster_autoscaling_config<T>(mut self, v: T) -> Self
10879 where
10880 T: std::convert::Into<crate::model::cluster::ClusterAutoscalingConfig>,
10881 {
10882 self.cluster_autoscaling_config = std::option::Option::Some(v.into());
10883 self
10884 }
10885
10886 /// Sets or clears the value of [cluster_autoscaling_config][crate::model::cluster::ClusterConfig::cluster_autoscaling_config].
10887 ///
10888 /// # Example
10889 /// ```ignore,no_run
10890 /// # use google_cloud_bigtable_admin_v2::model::cluster::ClusterConfig;
10891 /// use google_cloud_bigtable_admin_v2::model::cluster::ClusterAutoscalingConfig;
10892 /// let x = ClusterConfig::new().set_or_clear_cluster_autoscaling_config(Some(ClusterAutoscalingConfig::default()/* use setters */));
10893 /// let x = ClusterConfig::new().set_or_clear_cluster_autoscaling_config(None::<ClusterAutoscalingConfig>);
10894 /// ```
10895 pub fn set_or_clear_cluster_autoscaling_config<T>(
10896 mut self,
10897 v: std::option::Option<T>,
10898 ) -> Self
10899 where
10900 T: std::convert::Into<crate::model::cluster::ClusterAutoscalingConfig>,
10901 {
10902 self.cluster_autoscaling_config = v.map(|x| x.into());
10903 self
10904 }
10905 }
10906
10907 impl wkt::message::Message for ClusterConfig {
10908 fn typename() -> &'static str {
10909 "type.googleapis.com/google.bigtable.admin.v2.Cluster.ClusterConfig"
10910 }
10911 }
10912
10913 /// Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
10914 /// cluster.
10915 #[derive(Clone, Default, PartialEq)]
10916 #[non_exhaustive]
10917 pub struct EncryptionConfig {
10918 /// Describes the Cloud KMS encryption key that will be used to protect the
10919 /// destination Bigtable cluster. The requirements for this key are:
10920 ///
10921 /// 1. The Cloud Bigtable service account associated with the project that
10922 /// contains this cluster must be granted the
10923 /// `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
10924 /// 1. Only regional keys can be used and the region of the CMEK key must
10925 /// match the region of the cluster.
10926 /// Values are of the form
10927 /// `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
10928 pub kms_key_name: std::string::String,
10929
10930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10931 }
10932
10933 impl EncryptionConfig {
10934 /// Creates a new default instance.
10935 pub fn new() -> Self {
10936 std::default::Default::default()
10937 }
10938
10939 /// Sets the value of [kms_key_name][crate::model::cluster::EncryptionConfig::kms_key_name].
10940 ///
10941 /// # Example
10942 /// ```ignore,no_run
10943 /// # use google_cloud_bigtable_admin_v2::model::cluster::EncryptionConfig;
10944 /// let x = EncryptionConfig::new().set_kms_key_name("example");
10945 /// ```
10946 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
10947 mut self,
10948 v: T,
10949 ) -> Self {
10950 self.kms_key_name = v.into();
10951 self
10952 }
10953 }
10954
10955 impl wkt::message::Message for EncryptionConfig {
10956 fn typename() -> &'static str {
10957 "type.googleapis.com/google.bigtable.admin.v2.Cluster.EncryptionConfig"
10958 }
10959 }
10960
10961 /// Possible states of a cluster.
10962 ///
10963 /// # Working with unknown values
10964 ///
10965 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10966 /// additional enum variants at any time. Adding new variants is not considered
10967 /// a breaking change. Applications should write their code in anticipation of:
10968 ///
10969 /// - New values appearing in future releases of the client library, **and**
10970 /// - New values received dynamically, without application changes.
10971 ///
10972 /// Please consult the [Working with enums] section in the user guide for some
10973 /// guidelines.
10974 ///
10975 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10976 #[derive(Clone, Debug, PartialEq)]
10977 #[non_exhaustive]
10978 pub enum State {
10979 /// The state of the cluster could not be determined.
10980 NotKnown,
10981 /// The cluster has been successfully created and is ready to serve requests.
10982 Ready,
10983 /// The cluster is currently being created, and may be destroyed
10984 /// if the creation process encounters an error.
10985 /// A cluster may not be able to serve requests while being created.
10986 Creating,
10987 /// The cluster is currently being resized, and may revert to its previous
10988 /// node count if the process encounters an error.
10989 /// A cluster is still capable of serving requests while being resized,
10990 /// but may exhibit performance as if its number of allocated nodes is
10991 /// between the starting and requested states.
10992 Resizing,
10993 /// The cluster has no backing nodes. The data (tables) still
10994 /// exist, but no operations can be performed on the cluster.
10995 Disabled,
10996 /// If set, the enum was initialized with an unknown value.
10997 ///
10998 /// Applications can examine the value using [State::value] or
10999 /// [State::name].
11000 UnknownValue(state::UnknownValue),
11001 }
11002
11003 #[doc(hidden)]
11004 pub mod state {
11005 #[allow(unused_imports)]
11006 use super::*;
11007 #[derive(Clone, Debug, PartialEq)]
11008 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11009 }
11010
11011 impl State {
11012 /// Gets the enum value.
11013 ///
11014 /// Returns `None` if the enum contains an unknown value deserialized from
11015 /// the string representation of enums.
11016 pub fn value(&self) -> std::option::Option<i32> {
11017 match self {
11018 Self::NotKnown => std::option::Option::Some(0),
11019 Self::Ready => std::option::Option::Some(1),
11020 Self::Creating => std::option::Option::Some(2),
11021 Self::Resizing => std::option::Option::Some(3),
11022 Self::Disabled => std::option::Option::Some(4),
11023 Self::UnknownValue(u) => u.0.value(),
11024 }
11025 }
11026
11027 /// Gets the enum value as a string.
11028 ///
11029 /// Returns `None` if the enum contains an unknown value deserialized from
11030 /// the integer representation of enums.
11031 pub fn name(&self) -> std::option::Option<&str> {
11032 match self {
11033 Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
11034 Self::Ready => std::option::Option::Some("READY"),
11035 Self::Creating => std::option::Option::Some("CREATING"),
11036 Self::Resizing => std::option::Option::Some("RESIZING"),
11037 Self::Disabled => std::option::Option::Some("DISABLED"),
11038 Self::UnknownValue(u) => u.0.name(),
11039 }
11040 }
11041 }
11042
11043 impl std::default::Default for State {
11044 fn default() -> Self {
11045 use std::convert::From;
11046 Self::from(0)
11047 }
11048 }
11049
11050 impl std::fmt::Display for State {
11051 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11052 wkt::internal::display_enum(f, self.name(), self.value())
11053 }
11054 }
11055
11056 impl std::convert::From<i32> for State {
11057 fn from(value: i32) -> Self {
11058 match value {
11059 0 => Self::NotKnown,
11060 1 => Self::Ready,
11061 2 => Self::Creating,
11062 3 => Self::Resizing,
11063 4 => Self::Disabled,
11064 _ => Self::UnknownValue(state::UnknownValue(
11065 wkt::internal::UnknownEnumValue::Integer(value),
11066 )),
11067 }
11068 }
11069 }
11070
11071 impl std::convert::From<&str> for State {
11072 fn from(value: &str) -> Self {
11073 use std::string::ToString;
11074 match value {
11075 "STATE_NOT_KNOWN" => Self::NotKnown,
11076 "READY" => Self::Ready,
11077 "CREATING" => Self::Creating,
11078 "RESIZING" => Self::Resizing,
11079 "DISABLED" => Self::Disabled,
11080 _ => Self::UnknownValue(state::UnknownValue(
11081 wkt::internal::UnknownEnumValue::String(value.to_string()),
11082 )),
11083 }
11084 }
11085 }
11086
11087 impl serde::ser::Serialize for State {
11088 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11089 where
11090 S: serde::Serializer,
11091 {
11092 match self {
11093 Self::NotKnown => serializer.serialize_i32(0),
11094 Self::Ready => serializer.serialize_i32(1),
11095 Self::Creating => serializer.serialize_i32(2),
11096 Self::Resizing => serializer.serialize_i32(3),
11097 Self::Disabled => serializer.serialize_i32(4),
11098 Self::UnknownValue(u) => u.0.serialize(serializer),
11099 }
11100 }
11101 }
11102
11103 impl<'de> serde::de::Deserialize<'de> for State {
11104 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11105 where
11106 D: serde::Deserializer<'de>,
11107 {
11108 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11109 ".google.bigtable.admin.v2.Cluster.State",
11110 ))
11111 }
11112 }
11113
11114 /// Possible node scaling factors of the clusters. Node scaling delivers better
11115 /// latency and more throughput by removing node boundaries.
11116 ///
11117 /// # Working with unknown values
11118 ///
11119 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11120 /// additional enum variants at any time. Adding new variants is not considered
11121 /// a breaking change. Applications should write their code in anticipation of:
11122 ///
11123 /// - New values appearing in future releases of the client library, **and**
11124 /// - New values received dynamically, without application changes.
11125 ///
11126 /// Please consult the [Working with enums] section in the user guide for some
11127 /// guidelines.
11128 ///
11129 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11130 #[derive(Clone, Debug, PartialEq)]
11131 #[non_exhaustive]
11132 pub enum NodeScalingFactor {
11133 /// No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X.
11134 Unspecified,
11135 /// The cluster is running with a scaling factor of 1.
11136 NodeScalingFactor1X,
11137 /// The cluster is running with a scaling factor of 2.
11138 /// All node count values must be in increments of 2 with this scaling factor
11139 /// enabled, otherwise an INVALID_ARGUMENT error will be returned.
11140 NodeScalingFactor2X,
11141 /// If set, the enum was initialized with an unknown value.
11142 ///
11143 /// Applications can examine the value using [NodeScalingFactor::value] or
11144 /// [NodeScalingFactor::name].
11145 UnknownValue(node_scaling_factor::UnknownValue),
11146 }
11147
11148 #[doc(hidden)]
11149 pub mod node_scaling_factor {
11150 #[allow(unused_imports)]
11151 use super::*;
11152 #[derive(Clone, Debug, PartialEq)]
11153 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11154 }
11155
11156 impl NodeScalingFactor {
11157 /// Gets the enum value.
11158 ///
11159 /// Returns `None` if the enum contains an unknown value deserialized from
11160 /// the string representation of enums.
11161 pub fn value(&self) -> std::option::Option<i32> {
11162 match self {
11163 Self::Unspecified => std::option::Option::Some(0),
11164 Self::NodeScalingFactor1X => std::option::Option::Some(1),
11165 Self::NodeScalingFactor2X => std::option::Option::Some(2),
11166 Self::UnknownValue(u) => u.0.value(),
11167 }
11168 }
11169
11170 /// Gets the enum value as a string.
11171 ///
11172 /// Returns `None` if the enum contains an unknown value deserialized from
11173 /// the integer representation of enums.
11174 pub fn name(&self) -> std::option::Option<&str> {
11175 match self {
11176 Self::Unspecified => std::option::Option::Some("NODE_SCALING_FACTOR_UNSPECIFIED"),
11177 Self::NodeScalingFactor1X => std::option::Option::Some("NODE_SCALING_FACTOR_1X"),
11178 Self::NodeScalingFactor2X => std::option::Option::Some("NODE_SCALING_FACTOR_2X"),
11179 Self::UnknownValue(u) => u.0.name(),
11180 }
11181 }
11182 }
11183
11184 impl std::default::Default for NodeScalingFactor {
11185 fn default() -> Self {
11186 use std::convert::From;
11187 Self::from(0)
11188 }
11189 }
11190
11191 impl std::fmt::Display for NodeScalingFactor {
11192 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11193 wkt::internal::display_enum(f, self.name(), self.value())
11194 }
11195 }
11196
11197 impl std::convert::From<i32> for NodeScalingFactor {
11198 fn from(value: i32) -> Self {
11199 match value {
11200 0 => Self::Unspecified,
11201 1 => Self::NodeScalingFactor1X,
11202 2 => Self::NodeScalingFactor2X,
11203 _ => Self::UnknownValue(node_scaling_factor::UnknownValue(
11204 wkt::internal::UnknownEnumValue::Integer(value),
11205 )),
11206 }
11207 }
11208 }
11209
11210 impl std::convert::From<&str> for NodeScalingFactor {
11211 fn from(value: &str) -> Self {
11212 use std::string::ToString;
11213 match value {
11214 "NODE_SCALING_FACTOR_UNSPECIFIED" => Self::Unspecified,
11215 "NODE_SCALING_FACTOR_1X" => Self::NodeScalingFactor1X,
11216 "NODE_SCALING_FACTOR_2X" => Self::NodeScalingFactor2X,
11217 _ => Self::UnknownValue(node_scaling_factor::UnknownValue(
11218 wkt::internal::UnknownEnumValue::String(value.to_string()),
11219 )),
11220 }
11221 }
11222 }
11223
11224 impl serde::ser::Serialize for NodeScalingFactor {
11225 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11226 where
11227 S: serde::Serializer,
11228 {
11229 match self {
11230 Self::Unspecified => serializer.serialize_i32(0),
11231 Self::NodeScalingFactor1X => serializer.serialize_i32(1),
11232 Self::NodeScalingFactor2X => serializer.serialize_i32(2),
11233 Self::UnknownValue(u) => u.0.serialize(serializer),
11234 }
11235 }
11236 }
11237
11238 impl<'de> serde::de::Deserialize<'de> for NodeScalingFactor {
11239 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11240 where
11241 D: serde::Deserializer<'de>,
11242 {
11243 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeScalingFactor>::new(
11244 ".google.bigtable.admin.v2.Cluster.NodeScalingFactor",
11245 ))
11246 }
11247 }
11248
11249 #[allow(missing_docs)]
11250 #[derive(Clone, Debug, PartialEq)]
11251 #[non_exhaustive]
11252 pub enum Config {
11253 /// Configuration for this cluster.
11254 ClusterConfig(std::boxed::Box<crate::model::cluster::ClusterConfig>),
11255 }
11256}
11257
11258/// The memory layer of a cluster. A memory layer serves reads from
11259/// memory without hitting the backing persistent data store.
11260#[derive(Clone, Default, PartialEq)]
11261#[non_exhaustive]
11262pub struct MemoryLayer {
11263 /// Identifier. Name of the memory layer. This is always:
11264 /// "projects/{project}/instances/{instance}/clusters/{cluster}/memoryLayer".
11265 pub name: std::string::String,
11266
11267 /// The configuration of this memory layer. Set an empty `memory_config` to
11268 /// enable the memory layer. Unset this to disable the memory layer.
11269 pub memory_config: std::option::Option<crate::model::memory_layer::MemoryConfig>,
11270
11271 /// Optional. The etag for this memory layer.
11272 /// This may be sent on update requests to ensure that the client has an
11273 /// up-to-date value before proceeding. The server returns an ABORTED error on
11274 /// a mismatched etag.
11275 pub etag: std::string::String,
11276
11277 /// Output only. The current state of the memory layer.
11278 pub state: crate::model::memory_layer::State,
11279
11280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11281}
11282
11283impl MemoryLayer {
11284 /// Creates a new default instance.
11285 pub fn new() -> Self {
11286 std::default::Default::default()
11287 }
11288
11289 /// Sets the value of [name][crate::model::MemoryLayer::name].
11290 ///
11291 /// # Example
11292 /// ```ignore,no_run
11293 /// # use google_cloud_bigtable_admin_v2::model::MemoryLayer;
11294 /// # let project_id = "project_id";
11295 /// # let instance_id = "instance_id";
11296 /// # let cluster_id = "cluster_id";
11297 /// let x = MemoryLayer::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/memoryLayer"));
11298 /// ```
11299 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11300 self.name = v.into();
11301 self
11302 }
11303
11304 /// Sets the value of [memory_config][crate::model::MemoryLayer::memory_config].
11305 ///
11306 /// # Example
11307 /// ```ignore,no_run
11308 /// # use google_cloud_bigtable_admin_v2::model::MemoryLayer;
11309 /// use google_cloud_bigtable_admin_v2::model::memory_layer::MemoryConfig;
11310 /// let x = MemoryLayer::new().set_memory_config(MemoryConfig::default()/* use setters */);
11311 /// ```
11312 pub fn set_memory_config<T>(mut self, v: T) -> Self
11313 where
11314 T: std::convert::Into<crate::model::memory_layer::MemoryConfig>,
11315 {
11316 self.memory_config = std::option::Option::Some(v.into());
11317 self
11318 }
11319
11320 /// Sets or clears the value of [memory_config][crate::model::MemoryLayer::memory_config].
11321 ///
11322 /// # Example
11323 /// ```ignore,no_run
11324 /// # use google_cloud_bigtable_admin_v2::model::MemoryLayer;
11325 /// use google_cloud_bigtable_admin_v2::model::memory_layer::MemoryConfig;
11326 /// let x = MemoryLayer::new().set_or_clear_memory_config(Some(MemoryConfig::default()/* use setters */));
11327 /// let x = MemoryLayer::new().set_or_clear_memory_config(None::<MemoryConfig>);
11328 /// ```
11329 pub fn set_or_clear_memory_config<T>(mut self, v: std::option::Option<T>) -> Self
11330 where
11331 T: std::convert::Into<crate::model::memory_layer::MemoryConfig>,
11332 {
11333 self.memory_config = v.map(|x| x.into());
11334 self
11335 }
11336
11337 /// Sets the value of [etag][crate::model::MemoryLayer::etag].
11338 ///
11339 /// # Example
11340 /// ```ignore,no_run
11341 /// # use google_cloud_bigtable_admin_v2::model::MemoryLayer;
11342 /// let x = MemoryLayer::new().set_etag("example");
11343 /// ```
11344 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11345 self.etag = v.into();
11346 self
11347 }
11348
11349 /// Sets the value of [state][crate::model::MemoryLayer::state].
11350 ///
11351 /// # Example
11352 /// ```ignore,no_run
11353 /// # use google_cloud_bigtable_admin_v2::model::MemoryLayer;
11354 /// use google_cloud_bigtable_admin_v2::model::memory_layer::State;
11355 /// let x0 = MemoryLayer::new().set_state(State::Ready);
11356 /// let x1 = MemoryLayer::new().set_state(State::Enabling);
11357 /// let x2 = MemoryLayer::new().set_state(State::Resizing);
11358 /// ```
11359 pub fn set_state<T: std::convert::Into<crate::model::memory_layer::State>>(
11360 mut self,
11361 v: T,
11362 ) -> Self {
11363 self.state = v.into();
11364 self
11365 }
11366}
11367
11368impl wkt::message::Message for MemoryLayer {
11369 fn typename() -> &'static str {
11370 "type.googleapis.com/google.bigtable.admin.v2.MemoryLayer"
11371 }
11372}
11373
11374/// Defines additional types related to [MemoryLayer].
11375pub mod memory_layer {
11376 #[allow(unused_imports)]
11377 use super::*;
11378
11379 /// Configuration of a memory layer.
11380 #[derive(Clone, Default, PartialEq)]
11381 #[non_exhaustive]
11382 pub struct MemoryConfig {
11383 /// Output only. Reporting the current size of the memory layer in GiB.
11384 pub storage_size_gib: i32,
11385
11386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11387 }
11388
11389 impl MemoryConfig {
11390 /// Creates a new default instance.
11391 pub fn new() -> Self {
11392 std::default::Default::default()
11393 }
11394
11395 /// Sets the value of [storage_size_gib][crate::model::memory_layer::MemoryConfig::storage_size_gib].
11396 ///
11397 /// # Example
11398 /// ```ignore,no_run
11399 /// # use google_cloud_bigtable_admin_v2::model::memory_layer::MemoryConfig;
11400 /// let x = MemoryConfig::new().set_storage_size_gib(42);
11401 /// ```
11402 pub fn set_storage_size_gib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11403 self.storage_size_gib = v.into();
11404 self
11405 }
11406 }
11407
11408 impl wkt::message::Message for MemoryConfig {
11409 fn typename() -> &'static str {
11410 "type.googleapis.com/google.bigtable.admin.v2.MemoryLayer.MemoryConfig"
11411 }
11412 }
11413
11414 /// Possible states of a memory layer.
11415 ///
11416 /// # Working with unknown values
11417 ///
11418 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11419 /// additional enum variants at any time. Adding new variants is not considered
11420 /// a breaking change. Applications should write their code in anticipation of:
11421 ///
11422 /// - New values appearing in future releases of the client library, **and**
11423 /// - New values received dynamically, without application changes.
11424 ///
11425 /// Please consult the [Working with enums] section in the user guide for some
11426 /// guidelines.
11427 ///
11428 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11429 #[derive(Clone, Debug, PartialEq)]
11430 #[non_exhaustive]
11431 pub enum State {
11432 /// The state of the memory layer could not be determined.
11433 NotKnown,
11434 /// The memory layer has been successfully enabled and is ready to serve
11435 /// requests.
11436 Ready,
11437 /// The memory layer is currently being enabled, and may be disabled
11438 /// if the enablement process encounters an error. A cluster may not be able
11439 /// to serve requests from the memory layer while being enabled.
11440 Enabling,
11441 /// The memory layer is currently being resized, and may revert to its
11442 /// previous storage size if the process encounters an error. The memory
11443 /// layer is still capable of serving requests while being resized, but may
11444 /// exhibit performance as if its number of allocated nodes is between the
11445 /// starting and requested states.
11446 Resizing,
11447 /// The memory layer is disabled. The default state for a cluster without a
11448 /// memory layer.
11449 Disabled,
11450 /// If set, the enum was initialized with an unknown value.
11451 ///
11452 /// Applications can examine the value using [State::value] or
11453 /// [State::name].
11454 UnknownValue(state::UnknownValue),
11455 }
11456
11457 #[doc(hidden)]
11458 pub mod state {
11459 #[allow(unused_imports)]
11460 use super::*;
11461 #[derive(Clone, Debug, PartialEq)]
11462 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11463 }
11464
11465 impl State {
11466 /// Gets the enum value.
11467 ///
11468 /// Returns `None` if the enum contains an unknown value deserialized from
11469 /// the string representation of enums.
11470 pub fn value(&self) -> std::option::Option<i32> {
11471 match self {
11472 Self::NotKnown => std::option::Option::Some(0),
11473 Self::Ready => std::option::Option::Some(1),
11474 Self::Enabling => std::option::Option::Some(2),
11475 Self::Resizing => std::option::Option::Some(3),
11476 Self::Disabled => std::option::Option::Some(4),
11477 Self::UnknownValue(u) => u.0.value(),
11478 }
11479 }
11480
11481 /// Gets the enum value as a string.
11482 ///
11483 /// Returns `None` if the enum contains an unknown value deserialized from
11484 /// the integer representation of enums.
11485 pub fn name(&self) -> std::option::Option<&str> {
11486 match self {
11487 Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
11488 Self::Ready => std::option::Option::Some("READY"),
11489 Self::Enabling => std::option::Option::Some("ENABLING"),
11490 Self::Resizing => std::option::Option::Some("RESIZING"),
11491 Self::Disabled => std::option::Option::Some("DISABLED"),
11492 Self::UnknownValue(u) => u.0.name(),
11493 }
11494 }
11495 }
11496
11497 impl std::default::Default for State {
11498 fn default() -> Self {
11499 use std::convert::From;
11500 Self::from(0)
11501 }
11502 }
11503
11504 impl std::fmt::Display for State {
11505 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11506 wkt::internal::display_enum(f, self.name(), self.value())
11507 }
11508 }
11509
11510 impl std::convert::From<i32> for State {
11511 fn from(value: i32) -> Self {
11512 match value {
11513 0 => Self::NotKnown,
11514 1 => Self::Ready,
11515 2 => Self::Enabling,
11516 3 => Self::Resizing,
11517 4 => Self::Disabled,
11518 _ => Self::UnknownValue(state::UnknownValue(
11519 wkt::internal::UnknownEnumValue::Integer(value),
11520 )),
11521 }
11522 }
11523 }
11524
11525 impl std::convert::From<&str> for State {
11526 fn from(value: &str) -> Self {
11527 use std::string::ToString;
11528 match value {
11529 "STATE_NOT_KNOWN" => Self::NotKnown,
11530 "READY" => Self::Ready,
11531 "ENABLING" => Self::Enabling,
11532 "RESIZING" => Self::Resizing,
11533 "DISABLED" => Self::Disabled,
11534 _ => Self::UnknownValue(state::UnknownValue(
11535 wkt::internal::UnknownEnumValue::String(value.to_string()),
11536 )),
11537 }
11538 }
11539 }
11540
11541 impl serde::ser::Serialize for State {
11542 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11543 where
11544 S: serde::Serializer,
11545 {
11546 match self {
11547 Self::NotKnown => serializer.serialize_i32(0),
11548 Self::Ready => serializer.serialize_i32(1),
11549 Self::Enabling => serializer.serialize_i32(2),
11550 Self::Resizing => serializer.serialize_i32(3),
11551 Self::Disabled => serializer.serialize_i32(4),
11552 Self::UnknownValue(u) => u.0.serialize(serializer),
11553 }
11554 }
11555 }
11556
11557 impl<'de> serde::de::Deserialize<'de> for State {
11558 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11559 where
11560 D: serde::Deserializer<'de>,
11561 {
11562 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11563 ".google.bigtable.admin.v2.MemoryLayer.State",
11564 ))
11565 }
11566 }
11567}
11568
11569/// A configuration object describing how Cloud Bigtable should treat traffic
11570/// from a particular end user application.
11571#[derive(Clone, Default, PartialEq)]
11572#[non_exhaustive]
11573pub struct AppProfile {
11574 /// The unique name of the app profile. Values are of the form
11575 /// `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
11576 pub name: std::string::String,
11577
11578 /// Strongly validated etag for optimistic concurrency control. Preserve the
11579 /// value returned from `GetAppProfile` when calling `UpdateAppProfile` to
11580 /// fail the request if there has been a modification in the mean time. The
11581 /// `update_mask` of the request need not include `etag` for this protection
11582 /// to apply.
11583 /// See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
11584 /// [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
11585 /// details.
11586 pub etag: std::string::String,
11587
11588 /// Long form description of the use case for this AppProfile.
11589 pub description: std::string::String,
11590
11591 /// The routing policy for all read/write requests that use this app profile.
11592 /// A value must be explicitly set.
11593 pub routing_policy: std::option::Option<crate::model::app_profile::RoutingPolicy>,
11594
11595 /// Options for isolating this app profile's traffic from other use cases.
11596 pub isolation: std::option::Option<crate::model::app_profile::Isolation>,
11597
11598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11599}
11600
11601impl AppProfile {
11602 /// Creates a new default instance.
11603 pub fn new() -> Self {
11604 std::default::Default::default()
11605 }
11606
11607 /// Sets the value of [name][crate::model::AppProfile::name].
11608 ///
11609 /// # Example
11610 /// ```ignore,no_run
11611 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11612 /// # let project_id = "project_id";
11613 /// # let instance_id = "instance_id";
11614 /// # let app_profile_id = "app_profile_id";
11615 /// let x = AppProfile::new().set_name(format!("projects/{project_id}/instances/{instance_id}/appProfiles/{app_profile_id}"));
11616 /// ```
11617 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11618 self.name = v.into();
11619 self
11620 }
11621
11622 /// Sets the value of [etag][crate::model::AppProfile::etag].
11623 ///
11624 /// # Example
11625 /// ```ignore,no_run
11626 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11627 /// let x = AppProfile::new().set_etag("example");
11628 /// ```
11629 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11630 self.etag = v.into();
11631 self
11632 }
11633
11634 /// Sets the value of [description][crate::model::AppProfile::description].
11635 ///
11636 /// # Example
11637 /// ```ignore,no_run
11638 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11639 /// let x = AppProfile::new().set_description("example");
11640 /// ```
11641 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11642 self.description = v.into();
11643 self
11644 }
11645
11646 /// Sets the value of [routing_policy][crate::model::AppProfile::routing_policy].
11647 ///
11648 /// Note that all the setters affecting `routing_policy` are mutually
11649 /// exclusive.
11650 ///
11651 /// # Example
11652 /// ```ignore,no_run
11653 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11654 /// use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
11655 /// let x = AppProfile::new().set_routing_policy(Some(
11656 /// google_cloud_bigtable_admin_v2::model::app_profile::RoutingPolicy::MultiClusterRoutingUseAny(MultiClusterRoutingUseAny::default().into())));
11657 /// ```
11658 pub fn set_routing_policy<
11659 T: std::convert::Into<std::option::Option<crate::model::app_profile::RoutingPolicy>>,
11660 >(
11661 mut self,
11662 v: T,
11663 ) -> Self {
11664 self.routing_policy = v.into();
11665 self
11666 }
11667
11668 /// The value of [routing_policy][crate::model::AppProfile::routing_policy]
11669 /// if it holds a `MultiClusterRoutingUseAny`, `None` if the field is not set or
11670 /// holds a different branch.
11671 pub fn multi_cluster_routing_use_any(
11672 &self,
11673 ) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>>
11674 {
11675 #[allow(unreachable_patterns)]
11676 self.routing_policy.as_ref().and_then(|v| match v {
11677 crate::model::app_profile::RoutingPolicy::MultiClusterRoutingUseAny(v) => {
11678 std::option::Option::Some(v)
11679 }
11680 _ => std::option::Option::None,
11681 })
11682 }
11683
11684 /// Sets the value of [routing_policy][crate::model::AppProfile::routing_policy]
11685 /// to hold a `MultiClusterRoutingUseAny`.
11686 ///
11687 /// Note that all the setters affecting `routing_policy` are
11688 /// mutually exclusive.
11689 ///
11690 /// # Example
11691 /// ```ignore,no_run
11692 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11693 /// use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
11694 /// let x = AppProfile::new().set_multi_cluster_routing_use_any(MultiClusterRoutingUseAny::default()/* use setters */);
11695 /// assert!(x.multi_cluster_routing_use_any().is_some());
11696 /// assert!(x.single_cluster_routing().is_none());
11697 /// ```
11698 pub fn set_multi_cluster_routing_use_any<
11699 T: std::convert::Into<std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>>,
11700 >(
11701 mut self,
11702 v: T,
11703 ) -> Self {
11704 self.routing_policy = std::option::Option::Some(
11705 crate::model::app_profile::RoutingPolicy::MultiClusterRoutingUseAny(v.into()),
11706 );
11707 self
11708 }
11709
11710 /// The value of [routing_policy][crate::model::AppProfile::routing_policy]
11711 /// if it holds a `SingleClusterRouting`, `None` if the field is not set or
11712 /// holds a different branch.
11713 pub fn single_cluster_routing(
11714 &self,
11715 ) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::SingleClusterRouting>>
11716 {
11717 #[allow(unreachable_patterns)]
11718 self.routing_policy.as_ref().and_then(|v| match v {
11719 crate::model::app_profile::RoutingPolicy::SingleClusterRouting(v) => {
11720 std::option::Option::Some(v)
11721 }
11722 _ => std::option::Option::None,
11723 })
11724 }
11725
11726 /// Sets the value of [routing_policy][crate::model::AppProfile::routing_policy]
11727 /// to hold a `SingleClusterRouting`.
11728 ///
11729 /// Note that all the setters affecting `routing_policy` are
11730 /// mutually exclusive.
11731 ///
11732 /// # Example
11733 /// ```ignore,no_run
11734 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11735 /// use google_cloud_bigtable_admin_v2::model::app_profile::SingleClusterRouting;
11736 /// let x = AppProfile::new().set_single_cluster_routing(SingleClusterRouting::default()/* use setters */);
11737 /// assert!(x.single_cluster_routing().is_some());
11738 /// assert!(x.multi_cluster_routing_use_any().is_none());
11739 /// ```
11740 pub fn set_single_cluster_routing<
11741 T: std::convert::Into<std::boxed::Box<crate::model::app_profile::SingleClusterRouting>>,
11742 >(
11743 mut self,
11744 v: T,
11745 ) -> Self {
11746 self.routing_policy = std::option::Option::Some(
11747 crate::model::app_profile::RoutingPolicy::SingleClusterRouting(v.into()),
11748 );
11749 self
11750 }
11751
11752 /// Sets the value of [isolation][crate::model::AppProfile::isolation].
11753 ///
11754 /// Note that all the setters affecting `isolation` are mutually
11755 /// exclusive.
11756 ///
11757 /// # Example
11758 /// ```ignore,no_run
11759 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11760 /// use google_cloud_bigtable_admin_v2::model::app_profile::StandardIsolation;
11761 /// let x = AppProfile::new().set_isolation(Some(
11762 /// google_cloud_bigtable_admin_v2::model::app_profile::Isolation::StandardIsolation(StandardIsolation::default().into())));
11763 /// ```
11764 pub fn set_isolation<
11765 T: std::convert::Into<std::option::Option<crate::model::app_profile::Isolation>>,
11766 >(
11767 mut self,
11768 v: T,
11769 ) -> Self {
11770 self.isolation = v.into();
11771 self
11772 }
11773
11774 /// The value of [isolation][crate::model::AppProfile::isolation]
11775 /// if it holds a `Priority`, `None` if the field is not set or
11776 /// holds a different branch.
11777 #[deprecated]
11778 pub fn priority(&self) -> std::option::Option<&crate::model::app_profile::Priority> {
11779 #[allow(unreachable_patterns)]
11780 self.isolation.as_ref().and_then(|v| match v {
11781 crate::model::app_profile::Isolation::Priority(v) => std::option::Option::Some(v),
11782 _ => std::option::Option::None,
11783 })
11784 }
11785
11786 /// Sets the value of [isolation][crate::model::AppProfile::isolation]
11787 /// to hold a `Priority`.
11788 ///
11789 /// Note that all the setters affecting `isolation` are
11790 /// mutually exclusive.
11791 ///
11792 /// # Example
11793 /// ```ignore,no_run
11794 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11795 /// use google_cloud_bigtable_admin_v2::model::app_profile::Priority;
11796 /// let x0 = AppProfile::new().set_priority(Priority::Low);
11797 /// let x1 = AppProfile::new().set_priority(Priority::Medium);
11798 /// let x2 = AppProfile::new().set_priority(Priority::High);
11799 /// assert!(x0.priority().is_some());
11800 /// assert!(x0.standard_isolation().is_none());
11801 /// assert!(x0.data_boost_isolation_read_only().is_none());
11802 /// assert!(x1.priority().is_some());
11803 /// assert!(x1.standard_isolation().is_none());
11804 /// assert!(x1.data_boost_isolation_read_only().is_none());
11805 /// assert!(x2.priority().is_some());
11806 /// assert!(x2.standard_isolation().is_none());
11807 /// assert!(x2.data_boost_isolation_read_only().is_none());
11808 /// ```
11809 #[deprecated]
11810 pub fn set_priority<T: std::convert::Into<crate::model::app_profile::Priority>>(
11811 mut self,
11812 v: T,
11813 ) -> Self {
11814 self.isolation =
11815 std::option::Option::Some(crate::model::app_profile::Isolation::Priority(v.into()));
11816 self
11817 }
11818
11819 /// The value of [isolation][crate::model::AppProfile::isolation]
11820 /// if it holds a `StandardIsolation`, `None` if the field is not set or
11821 /// holds a different branch.
11822 pub fn standard_isolation(
11823 &self,
11824 ) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::StandardIsolation>> {
11825 #[allow(unreachable_patterns)]
11826 self.isolation.as_ref().and_then(|v| match v {
11827 crate::model::app_profile::Isolation::StandardIsolation(v) => {
11828 std::option::Option::Some(v)
11829 }
11830 _ => std::option::Option::None,
11831 })
11832 }
11833
11834 /// Sets the value of [isolation][crate::model::AppProfile::isolation]
11835 /// to hold a `StandardIsolation`.
11836 ///
11837 /// Note that all the setters affecting `isolation` are
11838 /// mutually exclusive.
11839 ///
11840 /// # Example
11841 /// ```ignore,no_run
11842 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11843 /// use google_cloud_bigtable_admin_v2::model::app_profile::StandardIsolation;
11844 /// let x = AppProfile::new().set_standard_isolation(StandardIsolation::default()/* use setters */);
11845 /// assert!(x.standard_isolation().is_some());
11846 /// assert!(x.priority().is_none());
11847 /// assert!(x.data_boost_isolation_read_only().is_none());
11848 /// ```
11849 pub fn set_standard_isolation<
11850 T: std::convert::Into<std::boxed::Box<crate::model::app_profile::StandardIsolation>>,
11851 >(
11852 mut self,
11853 v: T,
11854 ) -> Self {
11855 self.isolation = std::option::Option::Some(
11856 crate::model::app_profile::Isolation::StandardIsolation(v.into()),
11857 );
11858 self
11859 }
11860
11861 /// The value of [isolation][crate::model::AppProfile::isolation]
11862 /// if it holds a `DataBoostIsolationReadOnly`, `None` if the field is not set or
11863 /// holds a different branch.
11864 pub fn data_boost_isolation_read_only(
11865 &self,
11866 ) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>>
11867 {
11868 #[allow(unreachable_patterns)]
11869 self.isolation.as_ref().and_then(|v| match v {
11870 crate::model::app_profile::Isolation::DataBoostIsolationReadOnly(v) => {
11871 std::option::Option::Some(v)
11872 }
11873 _ => std::option::Option::None,
11874 })
11875 }
11876
11877 /// Sets the value of [isolation][crate::model::AppProfile::isolation]
11878 /// to hold a `DataBoostIsolationReadOnly`.
11879 ///
11880 /// Note that all the setters affecting `isolation` are
11881 /// mutually exclusive.
11882 ///
11883 /// # Example
11884 /// ```ignore,no_run
11885 /// # use google_cloud_bigtable_admin_v2::model::AppProfile;
11886 /// use google_cloud_bigtable_admin_v2::model::app_profile::DataBoostIsolationReadOnly;
11887 /// let x = AppProfile::new().set_data_boost_isolation_read_only(DataBoostIsolationReadOnly::default()/* use setters */);
11888 /// assert!(x.data_boost_isolation_read_only().is_some());
11889 /// assert!(x.priority().is_none());
11890 /// assert!(x.standard_isolation().is_none());
11891 /// ```
11892 pub fn set_data_boost_isolation_read_only<
11893 T: std::convert::Into<std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>>,
11894 >(
11895 mut self,
11896 v: T,
11897 ) -> Self {
11898 self.isolation = std::option::Option::Some(
11899 crate::model::app_profile::Isolation::DataBoostIsolationReadOnly(v.into()),
11900 );
11901 self
11902 }
11903}
11904
11905impl wkt::message::Message for AppProfile {
11906 fn typename() -> &'static str {
11907 "type.googleapis.com/google.bigtable.admin.v2.AppProfile"
11908 }
11909}
11910
11911/// Defines additional types related to [AppProfile].
11912pub mod app_profile {
11913 #[allow(unused_imports)]
11914 use super::*;
11915
11916 /// Read/write requests are routed to the nearest cluster in the instance, and
11917 /// will fail over to the nearest cluster that is available in the event of
11918 /// transient errors or delays. Clusters in a region are considered
11919 /// equidistant. Choosing this option sacrifices read-your-writes consistency
11920 /// to improve availability.
11921 #[derive(Clone, Default, PartialEq)]
11922 #[non_exhaustive]
11923 pub struct MultiClusterRoutingUseAny {
11924 /// The set of clusters to route to. The order is ignored; clusters will be
11925 /// tried in order of distance. If left empty, all clusters are eligible.
11926 pub cluster_ids: std::vec::Vec<std::string::String>,
11927
11928 /// Possible algorithms for routing affinity. If enabled, Bigtable will
11929 /// route between equidistant clusters in a deterministic order rather than
11930 /// choosing randomly.
11931 ///
11932 /// This mechanism gives read-your-writes consistency for *most* requests
11933 /// under *most* circumstances, without sacrificing availability. Consistency
11934 /// is *not* guaranteed, as requests might still fail over between clusters
11935 /// in the event of errors or latency.
11936 pub affinity:
11937 std::option::Option<crate::model::app_profile::multi_cluster_routing_use_any::Affinity>,
11938
11939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11940 }
11941
11942 impl MultiClusterRoutingUseAny {
11943 /// Creates a new default instance.
11944 pub fn new() -> Self {
11945 std::default::Default::default()
11946 }
11947
11948 /// Sets the value of [cluster_ids][crate::model::app_profile::MultiClusterRoutingUseAny::cluster_ids].
11949 ///
11950 /// # Example
11951 /// ```ignore,no_run
11952 /// # use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
11953 /// let x = MultiClusterRoutingUseAny::new().set_cluster_ids(["a", "b", "c"]);
11954 /// ```
11955 pub fn set_cluster_ids<T, V>(mut self, v: T) -> Self
11956 where
11957 T: std::iter::IntoIterator<Item = V>,
11958 V: std::convert::Into<std::string::String>,
11959 {
11960 use std::iter::Iterator;
11961 self.cluster_ids = v.into_iter().map(|i| i.into()).collect();
11962 self
11963 }
11964
11965 /// Sets the value of [affinity][crate::model::app_profile::MultiClusterRoutingUseAny::affinity].
11966 ///
11967 /// Note that all the setters affecting `affinity` are mutually
11968 /// exclusive.
11969 ///
11970 /// # Example
11971 /// ```ignore,no_run
11972 /// # use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
11973 /// use google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::RowAffinity;
11974 /// let x = MultiClusterRoutingUseAny::new().set_affinity(Some(
11975 /// google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(RowAffinity::default().into())));
11976 /// ```
11977 pub fn set_affinity<
11978 T: std::convert::Into<
11979 std::option::Option<
11980 crate::model::app_profile::multi_cluster_routing_use_any::Affinity,
11981 >,
11982 >,
11983 >(
11984 mut self,
11985 v: T,
11986 ) -> Self {
11987 self.affinity = v.into();
11988 self
11989 }
11990
11991 /// The value of [affinity][crate::model::app_profile::MultiClusterRoutingUseAny::affinity]
11992 /// if it holds a `RowAffinity`, `None` if the field is not set or
11993 /// holds a different branch.
11994 pub fn row_affinity(
11995 &self,
11996 ) -> std::option::Option<
11997 &std::boxed::Box<crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity>,
11998 > {
11999 #[allow(unreachable_patterns)]
12000 self.affinity.as_ref().and_then(|v| match v {
12001 crate::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(
12002 v,
12003 ) => std::option::Option::Some(v),
12004 _ => std::option::Option::None,
12005 })
12006 }
12007
12008 /// Sets the value of [affinity][crate::model::app_profile::MultiClusterRoutingUseAny::affinity]
12009 /// to hold a `RowAffinity`.
12010 ///
12011 /// Note that all the setters affecting `affinity` are
12012 /// mutually exclusive.
12013 ///
12014 /// # Example
12015 /// ```ignore,no_run
12016 /// # use google_cloud_bigtable_admin_v2::model::app_profile::MultiClusterRoutingUseAny;
12017 /// use google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::RowAffinity;
12018 /// let x = MultiClusterRoutingUseAny::new().set_row_affinity(RowAffinity::default()/* use setters */);
12019 /// assert!(x.row_affinity().is_some());
12020 /// ```
12021 pub fn set_row_affinity<
12022 T: std::convert::Into<
12023 std::boxed::Box<
12024 crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity,
12025 >,
12026 >,
12027 >(
12028 mut self,
12029 v: T,
12030 ) -> Self {
12031 self.affinity = std::option::Option::Some(
12032 crate::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(
12033 v.into(),
12034 ),
12035 );
12036 self
12037 }
12038 }
12039
12040 impl wkt::message::Message for MultiClusterRoutingUseAny {
12041 fn typename() -> &'static str {
12042 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny"
12043 }
12044 }
12045
12046 /// Defines additional types related to [MultiClusterRoutingUseAny].
12047 pub mod multi_cluster_routing_use_any {
12048 #[allow(unused_imports)]
12049 use super::*;
12050
12051 /// If enabled, Bigtable will route the request based on the row key of the
12052 /// request, rather than randomly. Instead, each row key will be assigned
12053 /// to a cluster, and will stick to that cluster. If clusters are added or
12054 /// removed, then this may affect which row keys stick to which clusters.
12055 /// To avoid this, users can use a cluster group to specify which clusters
12056 /// are to be used. In this case, new clusters that are not a part of the
12057 /// cluster group will not be routed to, and routing will be unaffected by
12058 /// the new cluster. Moreover, clusters specified in the cluster group cannot
12059 /// be deleted unless removed from the cluster group.
12060 #[derive(Clone, Default, PartialEq)]
12061 #[non_exhaustive]
12062 pub struct RowAffinity {
12063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12064 }
12065
12066 impl RowAffinity {
12067 /// Creates a new default instance.
12068 pub fn new() -> Self {
12069 std::default::Default::default()
12070 }
12071 }
12072
12073 impl wkt::message::Message for RowAffinity {
12074 fn typename() -> &'static str {
12075 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity"
12076 }
12077 }
12078
12079 /// Possible algorithms for routing affinity. If enabled, Bigtable will
12080 /// route between equidistant clusters in a deterministic order rather than
12081 /// choosing randomly.
12082 ///
12083 /// This mechanism gives read-your-writes consistency for *most* requests
12084 /// under *most* circumstances, without sacrificing availability. Consistency
12085 /// is *not* guaranteed, as requests might still fail over between clusters
12086 /// in the event of errors or latency.
12087 #[derive(Clone, Debug, PartialEq)]
12088 #[non_exhaustive]
12089 pub enum Affinity {
12090 /// Row affinity sticky routing based on the row key of the request.
12091 /// Requests that span multiple rows are routed non-deterministically.
12092 RowAffinity(
12093 std::boxed::Box<
12094 crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity,
12095 >,
12096 ),
12097 }
12098 }
12099
12100 /// Unconditionally routes all read/write requests to a specific cluster.
12101 /// This option preserves read-your-writes consistency but does not improve
12102 /// availability.
12103 #[derive(Clone, Default, PartialEq)]
12104 #[non_exhaustive]
12105 pub struct SingleClusterRouting {
12106 /// The cluster to which read/write requests should be routed.
12107 pub cluster_id: std::string::String,
12108
12109 /// Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
12110 /// allowed by this app profile. It is unsafe to send these requests to
12111 /// the same table/row/column in multiple clusters.
12112 pub allow_transactional_writes: bool,
12113
12114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12115 }
12116
12117 impl SingleClusterRouting {
12118 /// Creates a new default instance.
12119 pub fn new() -> Self {
12120 std::default::Default::default()
12121 }
12122
12123 /// Sets the value of [cluster_id][crate::model::app_profile::SingleClusterRouting::cluster_id].
12124 ///
12125 /// # Example
12126 /// ```ignore,no_run
12127 /// # use google_cloud_bigtable_admin_v2::model::app_profile::SingleClusterRouting;
12128 /// let x = SingleClusterRouting::new().set_cluster_id("example");
12129 /// ```
12130 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12131 self.cluster_id = v.into();
12132 self
12133 }
12134
12135 /// Sets the value of [allow_transactional_writes][crate::model::app_profile::SingleClusterRouting::allow_transactional_writes].
12136 ///
12137 /// # Example
12138 /// ```ignore,no_run
12139 /// # use google_cloud_bigtable_admin_v2::model::app_profile::SingleClusterRouting;
12140 /// let x = SingleClusterRouting::new().set_allow_transactional_writes(true);
12141 /// ```
12142 pub fn set_allow_transactional_writes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12143 self.allow_transactional_writes = v.into();
12144 self
12145 }
12146 }
12147
12148 impl wkt::message::Message for SingleClusterRouting {
12149 fn typename() -> &'static str {
12150 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.SingleClusterRouting"
12151 }
12152 }
12153
12154 /// Standard options for isolating this app profile's traffic from other use
12155 /// cases.
12156 #[derive(Clone, Default, PartialEq)]
12157 #[non_exhaustive]
12158 pub struct StandardIsolation {
12159 /// The priority of requests sent using this app profile.
12160 pub priority: crate::model::app_profile::Priority,
12161
12162 /// Optional. The memory config to use for requests sent using this app
12163 /// profile.
12164 pub memory_config:
12165 std::option::Option<crate::model::app_profile::standard_isolation::MemoryConfig>,
12166
12167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12168 }
12169
12170 impl StandardIsolation {
12171 /// Creates a new default instance.
12172 pub fn new() -> Self {
12173 std::default::Default::default()
12174 }
12175
12176 /// Sets the value of [priority][crate::model::app_profile::StandardIsolation::priority].
12177 ///
12178 /// # Example
12179 /// ```ignore,no_run
12180 /// # use google_cloud_bigtable_admin_v2::model::app_profile::StandardIsolation;
12181 /// use google_cloud_bigtable_admin_v2::model::app_profile::Priority;
12182 /// let x0 = StandardIsolation::new().set_priority(Priority::Low);
12183 /// let x1 = StandardIsolation::new().set_priority(Priority::Medium);
12184 /// let x2 = StandardIsolation::new().set_priority(Priority::High);
12185 /// ```
12186 pub fn set_priority<T: std::convert::Into<crate::model::app_profile::Priority>>(
12187 mut self,
12188 v: T,
12189 ) -> Self {
12190 self.priority = v.into();
12191 self
12192 }
12193
12194 /// Sets the value of [memory_config][crate::model::app_profile::StandardIsolation::memory_config].
12195 ///
12196 /// # Example
12197 /// ```ignore,no_run
12198 /// # use google_cloud_bigtable_admin_v2::model::app_profile::StandardIsolation;
12199 /// use google_cloud_bigtable_admin_v2::model::app_profile::standard_isolation::MemoryConfig;
12200 /// let x = StandardIsolation::new().set_memory_config(MemoryConfig::default()/* use setters */);
12201 /// ```
12202 pub fn set_memory_config<T>(mut self, v: T) -> Self
12203 where
12204 T: std::convert::Into<crate::model::app_profile::standard_isolation::MemoryConfig>,
12205 {
12206 self.memory_config = std::option::Option::Some(v.into());
12207 self
12208 }
12209
12210 /// Sets or clears the value of [memory_config][crate::model::app_profile::StandardIsolation::memory_config].
12211 ///
12212 /// # Example
12213 /// ```ignore,no_run
12214 /// # use google_cloud_bigtable_admin_v2::model::app_profile::StandardIsolation;
12215 /// use google_cloud_bigtable_admin_v2::model::app_profile::standard_isolation::MemoryConfig;
12216 /// let x = StandardIsolation::new().set_or_clear_memory_config(Some(MemoryConfig::default()/* use setters */));
12217 /// let x = StandardIsolation::new().set_or_clear_memory_config(None::<MemoryConfig>);
12218 /// ```
12219 pub fn set_or_clear_memory_config<T>(mut self, v: std::option::Option<T>) -> Self
12220 where
12221 T: std::convert::Into<crate::model::app_profile::standard_isolation::MemoryConfig>,
12222 {
12223 self.memory_config = v.map(|x| x.into());
12224 self
12225 }
12226 }
12227
12228 impl wkt::message::Message for StandardIsolation {
12229 fn typename() -> &'static str {
12230 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.StandardIsolation"
12231 }
12232 }
12233
12234 /// Defines additional types related to [StandardIsolation].
12235 pub mod standard_isolation {
12236 #[allow(unused_imports)]
12237 use super::*;
12238
12239 /// If set, eligible single-row requests (currently limited to ReadRows)
12240 /// using this app profile will be routed to the memory layer. All eligible
12241 /// writes populate the memory layer. MemoryConfig can only be set if the
12242 /// AppProfile uses single cluster routing and the configured cluster has a
12243 /// memory layer enabled.
12244 #[derive(Clone, Default, PartialEq)]
12245 #[non_exhaustive]
12246 pub struct MemoryConfig {
12247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12248 }
12249
12250 impl MemoryConfig {
12251 /// Creates a new default instance.
12252 pub fn new() -> Self {
12253 std::default::Default::default()
12254 }
12255 }
12256
12257 impl wkt::message::Message for MemoryConfig {
12258 fn typename() -> &'static str {
12259 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.StandardIsolation.MemoryConfig"
12260 }
12261 }
12262 }
12263
12264 /// Data Boost is a serverless compute capability that lets you run
12265 /// high-throughput read jobs and queries on your Bigtable data, without
12266 /// impacting the performance of the clusters that handle your application
12267 /// traffic. Data Boost supports read-only use cases with single-cluster
12268 /// routing.
12269 #[derive(Clone, Default, PartialEq)]
12270 #[non_exhaustive]
12271 pub struct DataBoostIsolationReadOnly {
12272 /// The Compute Billing Owner for this Data Boost App Profile.
12273 pub compute_billing_owner: std::option::Option<
12274 crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
12275 >,
12276
12277 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12278 }
12279
12280 impl DataBoostIsolationReadOnly {
12281 /// Creates a new default instance.
12282 pub fn new() -> Self {
12283 std::default::Default::default()
12284 }
12285
12286 /// Sets the value of [compute_billing_owner][crate::model::app_profile::DataBoostIsolationReadOnly::compute_billing_owner].
12287 ///
12288 /// # Example
12289 /// ```ignore,no_run
12290 /// # use google_cloud_bigtable_admin_v2::model::app_profile::DataBoostIsolationReadOnly;
12291 /// use google_cloud_bigtable_admin_v2::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner;
12292 /// let x0 = DataBoostIsolationReadOnly::new().set_compute_billing_owner(ComputeBillingOwner::HostPays);
12293 /// ```
12294 pub fn set_compute_billing_owner<T>(mut self, v: T) -> Self
12295 where
12296 T: std::convert::Into<
12297 crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
12298 >,
12299 {
12300 self.compute_billing_owner = std::option::Option::Some(v.into());
12301 self
12302 }
12303
12304 /// Sets or clears the value of [compute_billing_owner][crate::model::app_profile::DataBoostIsolationReadOnly::compute_billing_owner].
12305 ///
12306 /// # Example
12307 /// ```ignore,no_run
12308 /// # use google_cloud_bigtable_admin_v2::model::app_profile::DataBoostIsolationReadOnly;
12309 /// use google_cloud_bigtable_admin_v2::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner;
12310 /// let x0 = DataBoostIsolationReadOnly::new().set_or_clear_compute_billing_owner(Some(ComputeBillingOwner::HostPays));
12311 /// let x_none = DataBoostIsolationReadOnly::new().set_or_clear_compute_billing_owner(None::<ComputeBillingOwner>);
12312 /// ```
12313 pub fn set_or_clear_compute_billing_owner<T>(mut self, v: std::option::Option<T>) -> Self
12314 where
12315 T: std::convert::Into<
12316 crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
12317 >,
12318 {
12319 self.compute_billing_owner = v.map(|x| x.into());
12320 self
12321 }
12322 }
12323
12324 impl wkt::message::Message for DataBoostIsolationReadOnly {
12325 fn typename() -> &'static str {
12326 "type.googleapis.com/google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly"
12327 }
12328 }
12329
12330 /// Defines additional types related to [DataBoostIsolationReadOnly].
12331 pub mod data_boost_isolation_read_only {
12332 #[allow(unused_imports)]
12333 use super::*;
12334
12335 /// Compute Billing Owner specifies how usage should be accounted when using
12336 /// Data Boost. Compute Billing Owner also configures which Cloud Project is
12337 /// charged for relevant quota.
12338 ///
12339 /// # Working with unknown values
12340 ///
12341 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12342 /// additional enum variants at any time. Adding new variants is not considered
12343 /// a breaking change. Applications should write their code in anticipation of:
12344 ///
12345 /// - New values appearing in future releases of the client library, **and**
12346 /// - New values received dynamically, without application changes.
12347 ///
12348 /// Please consult the [Working with enums] section in the user guide for some
12349 /// guidelines.
12350 ///
12351 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12352 #[derive(Clone, Debug, PartialEq)]
12353 #[non_exhaustive]
12354 pub enum ComputeBillingOwner {
12355 /// Unspecified value.
12356 Unspecified,
12357 /// The host Cloud Project containing the targeted Bigtable Instance /
12358 /// Table pays for compute.
12359 HostPays,
12360 /// If set, the enum was initialized with an unknown value.
12361 ///
12362 /// Applications can examine the value using [ComputeBillingOwner::value] or
12363 /// [ComputeBillingOwner::name].
12364 UnknownValue(compute_billing_owner::UnknownValue),
12365 }
12366
12367 #[doc(hidden)]
12368 pub mod compute_billing_owner {
12369 #[allow(unused_imports)]
12370 use super::*;
12371 #[derive(Clone, Debug, PartialEq)]
12372 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12373 }
12374
12375 impl ComputeBillingOwner {
12376 /// Gets the enum value.
12377 ///
12378 /// Returns `None` if the enum contains an unknown value deserialized from
12379 /// the string representation of enums.
12380 pub fn value(&self) -> std::option::Option<i32> {
12381 match self {
12382 Self::Unspecified => std::option::Option::Some(0),
12383 Self::HostPays => std::option::Option::Some(1),
12384 Self::UnknownValue(u) => u.0.value(),
12385 }
12386 }
12387
12388 /// Gets the enum value as a string.
12389 ///
12390 /// Returns `None` if the enum contains an unknown value deserialized from
12391 /// the integer representation of enums.
12392 pub fn name(&self) -> std::option::Option<&str> {
12393 match self {
12394 Self::Unspecified => {
12395 std::option::Option::Some("COMPUTE_BILLING_OWNER_UNSPECIFIED")
12396 }
12397 Self::HostPays => std::option::Option::Some("HOST_PAYS"),
12398 Self::UnknownValue(u) => u.0.name(),
12399 }
12400 }
12401 }
12402
12403 impl std::default::Default for ComputeBillingOwner {
12404 fn default() -> Self {
12405 use std::convert::From;
12406 Self::from(0)
12407 }
12408 }
12409
12410 impl std::fmt::Display for ComputeBillingOwner {
12411 fn fmt(
12412 &self,
12413 f: &mut std::fmt::Formatter<'_>,
12414 ) -> std::result::Result<(), std::fmt::Error> {
12415 wkt::internal::display_enum(f, self.name(), self.value())
12416 }
12417 }
12418
12419 impl std::convert::From<i32> for ComputeBillingOwner {
12420 fn from(value: i32) -> Self {
12421 match value {
12422 0 => Self::Unspecified,
12423 1 => Self::HostPays,
12424 _ => Self::UnknownValue(compute_billing_owner::UnknownValue(
12425 wkt::internal::UnknownEnumValue::Integer(value),
12426 )),
12427 }
12428 }
12429 }
12430
12431 impl std::convert::From<&str> for ComputeBillingOwner {
12432 fn from(value: &str) -> Self {
12433 use std::string::ToString;
12434 match value {
12435 "COMPUTE_BILLING_OWNER_UNSPECIFIED" => Self::Unspecified,
12436 "HOST_PAYS" => Self::HostPays,
12437 _ => Self::UnknownValue(compute_billing_owner::UnknownValue(
12438 wkt::internal::UnknownEnumValue::String(value.to_string()),
12439 )),
12440 }
12441 }
12442 }
12443
12444 impl serde::ser::Serialize for ComputeBillingOwner {
12445 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12446 where
12447 S: serde::Serializer,
12448 {
12449 match self {
12450 Self::Unspecified => serializer.serialize_i32(0),
12451 Self::HostPays => serializer.serialize_i32(1),
12452 Self::UnknownValue(u) => u.0.serialize(serializer),
12453 }
12454 }
12455 }
12456
12457 impl<'de> serde::de::Deserialize<'de> for ComputeBillingOwner {
12458 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12459 where
12460 D: serde::Deserializer<'de>,
12461 {
12462 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeBillingOwner>::new(
12463 ".google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner"))
12464 }
12465 }
12466 }
12467
12468 /// Possible priorities for an app profile. Note that higher priority writes
12469 /// can sometimes queue behind lower priority writes to the same tablet, as
12470 /// writes must be strictly sequenced in the durability log.
12471 ///
12472 /// # Working with unknown values
12473 ///
12474 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12475 /// additional enum variants at any time. Adding new variants is not considered
12476 /// a breaking change. Applications should write their code in anticipation of:
12477 ///
12478 /// - New values appearing in future releases of the client library, **and**
12479 /// - New values received dynamically, without application changes.
12480 ///
12481 /// Please consult the [Working with enums] section in the user guide for some
12482 /// guidelines.
12483 ///
12484 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12485 #[derive(Clone, Debug, PartialEq)]
12486 #[non_exhaustive]
12487 pub enum Priority {
12488 /// Default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation.
12489 Unspecified,
12490 #[allow(missing_docs)]
12491 Low,
12492 #[allow(missing_docs)]
12493 Medium,
12494 #[allow(missing_docs)]
12495 High,
12496 /// If set, the enum was initialized with an unknown value.
12497 ///
12498 /// Applications can examine the value using [Priority::value] or
12499 /// [Priority::name].
12500 UnknownValue(priority::UnknownValue),
12501 }
12502
12503 #[doc(hidden)]
12504 pub mod priority {
12505 #[allow(unused_imports)]
12506 use super::*;
12507 #[derive(Clone, Debug, PartialEq)]
12508 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12509 }
12510
12511 impl Priority {
12512 /// Gets the enum value.
12513 ///
12514 /// Returns `None` if the enum contains an unknown value deserialized from
12515 /// the string representation of enums.
12516 pub fn value(&self) -> std::option::Option<i32> {
12517 match self {
12518 Self::Unspecified => std::option::Option::Some(0),
12519 Self::Low => std::option::Option::Some(1),
12520 Self::Medium => std::option::Option::Some(2),
12521 Self::High => std::option::Option::Some(3),
12522 Self::UnknownValue(u) => u.0.value(),
12523 }
12524 }
12525
12526 /// Gets the enum value as a string.
12527 ///
12528 /// Returns `None` if the enum contains an unknown value deserialized from
12529 /// the integer representation of enums.
12530 pub fn name(&self) -> std::option::Option<&str> {
12531 match self {
12532 Self::Unspecified => std::option::Option::Some("PRIORITY_UNSPECIFIED"),
12533 Self::Low => std::option::Option::Some("PRIORITY_LOW"),
12534 Self::Medium => std::option::Option::Some("PRIORITY_MEDIUM"),
12535 Self::High => std::option::Option::Some("PRIORITY_HIGH"),
12536 Self::UnknownValue(u) => u.0.name(),
12537 }
12538 }
12539 }
12540
12541 impl std::default::Default for Priority {
12542 fn default() -> Self {
12543 use std::convert::From;
12544 Self::from(0)
12545 }
12546 }
12547
12548 impl std::fmt::Display for Priority {
12549 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12550 wkt::internal::display_enum(f, self.name(), self.value())
12551 }
12552 }
12553
12554 impl std::convert::From<i32> for Priority {
12555 fn from(value: i32) -> Self {
12556 match value {
12557 0 => Self::Unspecified,
12558 1 => Self::Low,
12559 2 => Self::Medium,
12560 3 => Self::High,
12561 _ => Self::UnknownValue(priority::UnknownValue(
12562 wkt::internal::UnknownEnumValue::Integer(value),
12563 )),
12564 }
12565 }
12566 }
12567
12568 impl std::convert::From<&str> for Priority {
12569 fn from(value: &str) -> Self {
12570 use std::string::ToString;
12571 match value {
12572 "PRIORITY_UNSPECIFIED" => Self::Unspecified,
12573 "PRIORITY_LOW" => Self::Low,
12574 "PRIORITY_MEDIUM" => Self::Medium,
12575 "PRIORITY_HIGH" => Self::High,
12576 _ => Self::UnknownValue(priority::UnknownValue(
12577 wkt::internal::UnknownEnumValue::String(value.to_string()),
12578 )),
12579 }
12580 }
12581 }
12582
12583 impl serde::ser::Serialize for Priority {
12584 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12585 where
12586 S: serde::Serializer,
12587 {
12588 match self {
12589 Self::Unspecified => serializer.serialize_i32(0),
12590 Self::Low => serializer.serialize_i32(1),
12591 Self::Medium => serializer.serialize_i32(2),
12592 Self::High => serializer.serialize_i32(3),
12593 Self::UnknownValue(u) => u.0.serialize(serializer),
12594 }
12595 }
12596 }
12597
12598 impl<'de> serde::de::Deserialize<'de> for Priority {
12599 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12600 where
12601 D: serde::Deserializer<'de>,
12602 {
12603 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Priority>::new(
12604 ".google.bigtable.admin.v2.AppProfile.Priority",
12605 ))
12606 }
12607 }
12608
12609 /// The routing policy for all read/write requests that use this app profile.
12610 /// A value must be explicitly set.
12611 #[derive(Clone, Debug, PartialEq)]
12612 #[non_exhaustive]
12613 pub enum RoutingPolicy {
12614 /// Use a multi-cluster routing policy.
12615 MultiClusterRoutingUseAny(
12616 std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>,
12617 ),
12618 /// Use a single-cluster routing policy.
12619 SingleClusterRouting(std::boxed::Box<crate::model::app_profile::SingleClusterRouting>),
12620 }
12621
12622 /// Options for isolating this app profile's traffic from other use cases.
12623 #[derive(Clone, Debug, PartialEq)]
12624 #[non_exhaustive]
12625 pub enum Isolation {
12626 /// This field has been deprecated in favor of `standard_isolation.priority`.
12627 /// If you set this field, `standard_isolation.priority` will be set instead.
12628 ///
12629 /// The priority of requests sent using this app profile.
12630 #[deprecated]
12631 Priority(crate::model::app_profile::Priority),
12632 /// The standard options used for isolating this app profile's traffic from
12633 /// other use cases.
12634 StandardIsolation(std::boxed::Box<crate::model::app_profile::StandardIsolation>),
12635 /// Specifies that this app profile is intended for read-only usage via the
12636 /// Data Boost feature.
12637 DataBoostIsolationReadOnly(
12638 std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>,
12639 ),
12640 }
12641}
12642
12643/// A tablet is a defined by a start and end key and is explained in
12644/// <https://cloud.google.com/bigtable/docs/overview#architecture> and
12645/// <https://cloud.google.com/bigtable/docs/performance#optimization>.
12646/// A Hot tablet is a tablet that exhibits high average cpu usage during the time
12647/// interval from start time to end time.
12648#[derive(Clone, Default, PartialEq)]
12649#[non_exhaustive]
12650pub struct HotTablet {
12651 /// The unique name of the hot tablet. Values are of the form
12652 /// `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
12653 pub name: std::string::String,
12654
12655 /// Name of the table that contains the tablet. Values are of the form
12656 /// `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
12657 pub table_name: std::string::String,
12658
12659 /// Output only. The start time of the hot tablet.
12660 pub start_time: std::option::Option<wkt::Timestamp>,
12661
12662 /// Output only. The end time of the hot tablet.
12663 pub end_time: std::option::Option<wkt::Timestamp>,
12664
12665 /// Tablet Start Key (inclusive).
12666 pub start_key: std::string::String,
12667
12668 /// Tablet End Key (inclusive).
12669 pub end_key: std::string::String,
12670
12671 /// Output only. The average CPU usage spent by a node on this tablet over the
12672 /// start_time to end_time time range. The percentage is the amount of CPU used
12673 /// by the node to serve the tablet, from 0% (tablet was not interacted with)
12674 /// to 100% (the node spent all cycles serving the hot tablet).
12675 pub node_cpu_usage_percent: f32,
12676
12677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12678}
12679
12680impl HotTablet {
12681 /// Creates a new default instance.
12682 pub fn new() -> Self {
12683 std::default::Default::default()
12684 }
12685
12686 /// Sets the value of [name][crate::model::HotTablet::name].
12687 ///
12688 /// # Example
12689 /// ```ignore,no_run
12690 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12691 /// # let project_id = "project_id";
12692 /// # let instance_id = "instance_id";
12693 /// # let cluster_id = "cluster_id";
12694 /// # let hot_tablet_id = "hot_tablet_id";
12695 /// let x = HotTablet::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/hotTablets/{hot_tablet_id}"));
12696 /// ```
12697 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12698 self.name = v.into();
12699 self
12700 }
12701
12702 /// Sets the value of [table_name][crate::model::HotTablet::table_name].
12703 ///
12704 /// # Example
12705 /// ```ignore,no_run
12706 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12707 /// # let project_id = "project_id";
12708 /// # let instance_id = "instance_id";
12709 /// # let table_id = "table_id";
12710 /// let x = HotTablet::new().set_table_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
12711 /// ```
12712 pub fn set_table_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12713 self.table_name = v.into();
12714 self
12715 }
12716
12717 /// Sets the value of [start_time][crate::model::HotTablet::start_time].
12718 ///
12719 /// # Example
12720 /// ```ignore,no_run
12721 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12722 /// use wkt::Timestamp;
12723 /// let x = HotTablet::new().set_start_time(Timestamp::default()/* use setters */);
12724 /// ```
12725 pub fn set_start_time<T>(mut self, v: T) -> Self
12726 where
12727 T: std::convert::Into<wkt::Timestamp>,
12728 {
12729 self.start_time = std::option::Option::Some(v.into());
12730 self
12731 }
12732
12733 /// Sets or clears the value of [start_time][crate::model::HotTablet::start_time].
12734 ///
12735 /// # Example
12736 /// ```ignore,no_run
12737 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12738 /// use wkt::Timestamp;
12739 /// let x = HotTablet::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12740 /// let x = HotTablet::new().set_or_clear_start_time(None::<Timestamp>);
12741 /// ```
12742 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12743 where
12744 T: std::convert::Into<wkt::Timestamp>,
12745 {
12746 self.start_time = v.map(|x| x.into());
12747 self
12748 }
12749
12750 /// Sets the value of [end_time][crate::model::HotTablet::end_time].
12751 ///
12752 /// # Example
12753 /// ```ignore,no_run
12754 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12755 /// use wkt::Timestamp;
12756 /// let x = HotTablet::new().set_end_time(Timestamp::default()/* use setters */);
12757 /// ```
12758 pub fn set_end_time<T>(mut self, v: T) -> Self
12759 where
12760 T: std::convert::Into<wkt::Timestamp>,
12761 {
12762 self.end_time = std::option::Option::Some(v.into());
12763 self
12764 }
12765
12766 /// Sets or clears the value of [end_time][crate::model::HotTablet::end_time].
12767 ///
12768 /// # Example
12769 /// ```ignore,no_run
12770 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12771 /// use wkt::Timestamp;
12772 /// let x = HotTablet::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
12773 /// let x = HotTablet::new().set_or_clear_end_time(None::<Timestamp>);
12774 /// ```
12775 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12776 where
12777 T: std::convert::Into<wkt::Timestamp>,
12778 {
12779 self.end_time = v.map(|x| x.into());
12780 self
12781 }
12782
12783 /// Sets the value of [start_key][crate::model::HotTablet::start_key].
12784 ///
12785 /// # Example
12786 /// ```ignore,no_run
12787 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12788 /// let x = HotTablet::new().set_start_key("example");
12789 /// ```
12790 pub fn set_start_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12791 self.start_key = v.into();
12792 self
12793 }
12794
12795 /// Sets the value of [end_key][crate::model::HotTablet::end_key].
12796 ///
12797 /// # Example
12798 /// ```ignore,no_run
12799 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12800 /// let x = HotTablet::new().set_end_key("example");
12801 /// ```
12802 pub fn set_end_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12803 self.end_key = v.into();
12804 self
12805 }
12806
12807 /// Sets the value of [node_cpu_usage_percent][crate::model::HotTablet::node_cpu_usage_percent].
12808 ///
12809 /// # Example
12810 /// ```ignore,no_run
12811 /// # use google_cloud_bigtable_admin_v2::model::HotTablet;
12812 /// let x = HotTablet::new().set_node_cpu_usage_percent(42.0);
12813 /// ```
12814 pub fn set_node_cpu_usage_percent<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
12815 self.node_cpu_usage_percent = v.into();
12816 self
12817 }
12818}
12819
12820impl wkt::message::Message for HotTablet {
12821 fn typename() -> &'static str {
12822 "type.googleapis.com/google.bigtable.admin.v2.HotTablet"
12823 }
12824}
12825
12826/// A SQL logical view object that can be referenced in SQL queries.
12827#[derive(Clone, Default, PartialEq)]
12828#[non_exhaustive]
12829pub struct LogicalView {
12830 /// Identifier. The unique name of the logical view.
12831 /// Format:
12832 /// `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
12833 pub name: std::string::String,
12834
12835 /// Required. The logical view's select query.
12836 pub query: std::string::String,
12837
12838 /// Optional. The etag for this logical view.
12839 /// This may be sent on update requests to ensure that the client has an
12840 /// up-to-date value before proceeding. The server returns an ABORTED error on
12841 /// a mismatched etag.
12842 pub etag: std::string::String,
12843
12844 /// Optional. Set to true to make the LogicalView protected against deletion.
12845 pub deletion_protection: bool,
12846
12847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12848}
12849
12850impl LogicalView {
12851 /// Creates a new default instance.
12852 pub fn new() -> Self {
12853 std::default::Default::default()
12854 }
12855
12856 /// Sets the value of [name][crate::model::LogicalView::name].
12857 ///
12858 /// # Example
12859 /// ```ignore,no_run
12860 /// # use google_cloud_bigtable_admin_v2::model::LogicalView;
12861 /// # let project_id = "project_id";
12862 /// # let instance_id = "instance_id";
12863 /// # let logical_view_id = "logical_view_id";
12864 /// let x = LogicalView::new().set_name(format!("projects/{project_id}/instances/{instance_id}/logicalViews/{logical_view_id}"));
12865 /// ```
12866 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12867 self.name = v.into();
12868 self
12869 }
12870
12871 /// Sets the value of [query][crate::model::LogicalView::query].
12872 ///
12873 /// # Example
12874 /// ```ignore,no_run
12875 /// # use google_cloud_bigtable_admin_v2::model::LogicalView;
12876 /// let x = LogicalView::new().set_query("example");
12877 /// ```
12878 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12879 self.query = v.into();
12880 self
12881 }
12882
12883 /// Sets the value of [etag][crate::model::LogicalView::etag].
12884 ///
12885 /// # Example
12886 /// ```ignore,no_run
12887 /// # use google_cloud_bigtable_admin_v2::model::LogicalView;
12888 /// let x = LogicalView::new().set_etag("example");
12889 /// ```
12890 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12891 self.etag = v.into();
12892 self
12893 }
12894
12895 /// Sets the value of [deletion_protection][crate::model::LogicalView::deletion_protection].
12896 ///
12897 /// # Example
12898 /// ```ignore,no_run
12899 /// # use google_cloud_bigtable_admin_v2::model::LogicalView;
12900 /// let x = LogicalView::new().set_deletion_protection(true);
12901 /// ```
12902 pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12903 self.deletion_protection = v.into();
12904 self
12905 }
12906}
12907
12908impl wkt::message::Message for LogicalView {
12909 fn typename() -> &'static str {
12910 "type.googleapis.com/google.bigtable.admin.v2.LogicalView"
12911 }
12912}
12913
12914/// A materialized view object that can be referenced in SQL queries.
12915#[derive(Clone, Default, PartialEq)]
12916#[non_exhaustive]
12917pub struct MaterializedView {
12918 /// Identifier. The unique name of the materialized view.
12919 /// Format:
12920 /// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
12921 pub name: std::string::String,
12922
12923 /// Required. Immutable. The materialized view's select query.
12924 pub query: std::string::String,
12925
12926 /// Optional. The etag for this materialized view.
12927 /// This may be sent on update requests to ensure that the client has an
12928 /// up-to-date value before proceeding. The server returns an ABORTED error on
12929 /// a mismatched etag.
12930 pub etag: std::string::String,
12931
12932 /// Set to true to make the MaterializedView protected against deletion.
12933 pub deletion_protection: bool,
12934
12935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12936}
12937
12938impl MaterializedView {
12939 /// Creates a new default instance.
12940 pub fn new() -> Self {
12941 std::default::Default::default()
12942 }
12943
12944 /// Sets the value of [name][crate::model::MaterializedView::name].
12945 ///
12946 /// # Example
12947 /// ```ignore,no_run
12948 /// # use google_cloud_bigtable_admin_v2::model::MaterializedView;
12949 /// # let project_id = "project_id";
12950 /// # let instance_id = "instance_id";
12951 /// # let materialized_view_id = "materialized_view_id";
12952 /// let x = MaterializedView::new().set_name(format!("projects/{project_id}/instances/{instance_id}/materializedViews/{materialized_view_id}"));
12953 /// ```
12954 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12955 self.name = v.into();
12956 self
12957 }
12958
12959 /// Sets the value of [query][crate::model::MaterializedView::query].
12960 ///
12961 /// # Example
12962 /// ```ignore,no_run
12963 /// # use google_cloud_bigtable_admin_v2::model::MaterializedView;
12964 /// let x = MaterializedView::new().set_query("example");
12965 /// ```
12966 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12967 self.query = v.into();
12968 self
12969 }
12970
12971 /// Sets the value of [etag][crate::model::MaterializedView::etag].
12972 ///
12973 /// # Example
12974 /// ```ignore,no_run
12975 /// # use google_cloud_bigtable_admin_v2::model::MaterializedView;
12976 /// let x = MaterializedView::new().set_etag("example");
12977 /// ```
12978 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12979 self.etag = v.into();
12980 self
12981 }
12982
12983 /// Sets the value of [deletion_protection][crate::model::MaterializedView::deletion_protection].
12984 ///
12985 /// # Example
12986 /// ```ignore,no_run
12987 /// # use google_cloud_bigtable_admin_v2::model::MaterializedView;
12988 /// let x = MaterializedView::new().set_deletion_protection(true);
12989 /// ```
12990 pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12991 self.deletion_protection = v.into();
12992 self
12993 }
12994}
12995
12996impl wkt::message::Message for MaterializedView {
12997 fn typename() -> &'static str {
12998 "type.googleapis.com/google.bigtable.admin.v2.MaterializedView"
12999 }
13000}
13001
13002/// Information about a table restore.
13003#[derive(Clone, Default, PartialEq)]
13004#[non_exhaustive]
13005pub struct RestoreInfo {
13006 /// The type of the restore source.
13007 pub source_type: crate::model::RestoreSourceType,
13008
13009 /// Information about the source used to restore the table.
13010 pub source_info: std::option::Option<crate::model::restore_info::SourceInfo>,
13011
13012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13013}
13014
13015impl RestoreInfo {
13016 /// Creates a new default instance.
13017 pub fn new() -> Self {
13018 std::default::Default::default()
13019 }
13020
13021 /// Sets the value of [source_type][crate::model::RestoreInfo::source_type].
13022 ///
13023 /// # Example
13024 /// ```ignore,no_run
13025 /// # use google_cloud_bigtable_admin_v2::model::RestoreInfo;
13026 /// use google_cloud_bigtable_admin_v2::model::RestoreSourceType;
13027 /// let x0 = RestoreInfo::new().set_source_type(RestoreSourceType::Backup);
13028 /// ```
13029 pub fn set_source_type<T: std::convert::Into<crate::model::RestoreSourceType>>(
13030 mut self,
13031 v: T,
13032 ) -> Self {
13033 self.source_type = v.into();
13034 self
13035 }
13036
13037 /// Sets the value of [source_info][crate::model::RestoreInfo::source_info].
13038 ///
13039 /// Note that all the setters affecting `source_info` are mutually
13040 /// exclusive.
13041 ///
13042 /// # Example
13043 /// ```ignore,no_run
13044 /// # use google_cloud_bigtable_admin_v2::model::RestoreInfo;
13045 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
13046 /// let x = RestoreInfo::new().set_source_info(Some(
13047 /// google_cloud_bigtable_admin_v2::model::restore_info::SourceInfo::BackupInfo(BackupInfo::default().into())));
13048 /// ```
13049 pub fn set_source_info<
13050 T: std::convert::Into<std::option::Option<crate::model::restore_info::SourceInfo>>,
13051 >(
13052 mut self,
13053 v: T,
13054 ) -> Self {
13055 self.source_info = v.into();
13056 self
13057 }
13058
13059 /// The value of [source_info][crate::model::RestoreInfo::source_info]
13060 /// if it holds a `BackupInfo`, `None` if the field is not set or
13061 /// holds a different branch.
13062 pub fn backup_info(&self) -> std::option::Option<&std::boxed::Box<crate::model::BackupInfo>> {
13063 #[allow(unreachable_patterns)]
13064 self.source_info.as_ref().and_then(|v| match v {
13065 crate::model::restore_info::SourceInfo::BackupInfo(v) => std::option::Option::Some(v),
13066 _ => std::option::Option::None,
13067 })
13068 }
13069
13070 /// Sets the value of [source_info][crate::model::RestoreInfo::source_info]
13071 /// to hold a `BackupInfo`.
13072 ///
13073 /// Note that all the setters affecting `source_info` are
13074 /// mutually exclusive.
13075 ///
13076 /// # Example
13077 /// ```ignore,no_run
13078 /// # use google_cloud_bigtable_admin_v2::model::RestoreInfo;
13079 /// use google_cloud_bigtable_admin_v2::model::BackupInfo;
13080 /// let x = RestoreInfo::new().set_backup_info(BackupInfo::default()/* use setters */);
13081 /// assert!(x.backup_info().is_some());
13082 /// ```
13083 pub fn set_backup_info<T: std::convert::Into<std::boxed::Box<crate::model::BackupInfo>>>(
13084 mut self,
13085 v: T,
13086 ) -> Self {
13087 self.source_info =
13088 std::option::Option::Some(crate::model::restore_info::SourceInfo::BackupInfo(v.into()));
13089 self
13090 }
13091}
13092
13093impl wkt::message::Message for RestoreInfo {
13094 fn typename() -> &'static str {
13095 "type.googleapis.com/google.bigtable.admin.v2.RestoreInfo"
13096 }
13097}
13098
13099/// Defines additional types related to [RestoreInfo].
13100pub mod restore_info {
13101 #[allow(unused_imports)]
13102 use super::*;
13103
13104 /// Information about the source used to restore the table.
13105 #[derive(Clone, Debug, PartialEq)]
13106 #[non_exhaustive]
13107 pub enum SourceInfo {
13108 /// Information about the backup used to restore the table. The backup
13109 /// may no longer exist.
13110 BackupInfo(std::boxed::Box<crate::model::BackupInfo>),
13111 }
13112}
13113
13114/// Change stream configuration.
13115#[derive(Clone, Default, PartialEq)]
13116#[non_exhaustive]
13117pub struct ChangeStreamConfig {
13118 /// How long the change stream should be retained. Change stream data older
13119 /// than the retention period will not be returned when reading the change
13120 /// stream from the table.
13121 /// Values must be at least 1 day and at most 7 days, and will be truncated to
13122 /// microsecond granularity.
13123 pub retention_period: std::option::Option<wkt::Duration>,
13124
13125 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13126}
13127
13128impl ChangeStreamConfig {
13129 /// Creates a new default instance.
13130 pub fn new() -> Self {
13131 std::default::Default::default()
13132 }
13133
13134 /// Sets the value of [retention_period][crate::model::ChangeStreamConfig::retention_period].
13135 ///
13136 /// # Example
13137 /// ```ignore,no_run
13138 /// # use google_cloud_bigtable_admin_v2::model::ChangeStreamConfig;
13139 /// use wkt::Duration;
13140 /// let x = ChangeStreamConfig::new().set_retention_period(Duration::default()/* use setters */);
13141 /// ```
13142 pub fn set_retention_period<T>(mut self, v: T) -> Self
13143 where
13144 T: std::convert::Into<wkt::Duration>,
13145 {
13146 self.retention_period = std::option::Option::Some(v.into());
13147 self
13148 }
13149
13150 /// Sets or clears the value of [retention_period][crate::model::ChangeStreamConfig::retention_period].
13151 ///
13152 /// # Example
13153 /// ```ignore,no_run
13154 /// # use google_cloud_bigtable_admin_v2::model::ChangeStreamConfig;
13155 /// use wkt::Duration;
13156 /// let x = ChangeStreamConfig::new().set_or_clear_retention_period(Some(Duration::default()/* use setters */));
13157 /// let x = ChangeStreamConfig::new().set_or_clear_retention_period(None::<Duration>);
13158 /// ```
13159 pub fn set_or_clear_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
13160 where
13161 T: std::convert::Into<wkt::Duration>,
13162 {
13163 self.retention_period = v.map(|x| x.into());
13164 self
13165 }
13166}
13167
13168impl wkt::message::Message for ChangeStreamConfig {
13169 fn typename() -> &'static str {
13170 "type.googleapis.com/google.bigtable.admin.v2.ChangeStreamConfig"
13171 }
13172}
13173
13174/// A collection of user data indexed by row, column, and timestamp.
13175/// Each table is served using the resources of its parent cluster.
13176#[derive(Clone, Default, PartialEq)]
13177#[non_exhaustive]
13178pub struct Table {
13179 /// The unique name of the table. Values are of the form
13180 /// `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
13181 /// Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
13182 pub name: std::string::String,
13183
13184 /// Output only. Map from cluster ID to per-cluster table state.
13185 /// If it could not be determined whether or not the table has data in a
13186 /// particular cluster (for example, if its zone is unavailable), then
13187 /// there will be an entry for the cluster with UNKNOWN `replication_status`.
13188 /// Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
13189 pub cluster_states:
13190 std::collections::HashMap<std::string::String, crate::model::table::ClusterState>,
13191
13192 /// The column families configured for this table, mapped by column family ID.
13193 /// Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
13194 pub column_families: std::collections::HashMap<std::string::String, crate::model::ColumnFamily>,
13195
13196 /// Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
13197 /// in this table. Timestamps not matching the granularity will be rejected. If
13198 /// unspecified at creation time, the value will be set to `MILLIS`. Views:
13199 /// `SCHEMA_VIEW`, `FULL`.
13200 pub granularity: crate::model::table::TimestampGranularity,
13201
13202 /// Output only. If this table was restored from another data source (e.g. a
13203 /// backup), this field will be populated with information about the restore.
13204 pub restore_info: std::option::Option<crate::model::RestoreInfo>,
13205
13206 /// If specified, enable the change stream on this table.
13207 /// Otherwise, the change stream is disabled and the change stream is not
13208 /// retained.
13209 pub change_stream_config: std::option::Option<crate::model::ChangeStreamConfig>,
13210
13211 /// Set to true to make the table protected against data loss. i.e. deleting
13212 /// the following resources through Admin APIs are prohibited:
13213 ///
13214 /// * The table.
13215 /// * The column families in the table.
13216 /// * The instance containing the table.
13217 ///
13218 /// Note one can still delete the data stored in the table through Data APIs.
13219 pub deletion_protection: bool,
13220
13221 /// Output only. The effective automated backup policy applied to the table.
13222 /// This represents the policy actually in effect, which may be a
13223 /// system-default policy if the user has not explicitly configured one.
13224 /// Views: `SCHEMA_VIEW`, `FULL`.
13225 pub effective_automated_backup_policy:
13226 std::option::Option<crate::model::table::AutomatedBackupPolicy>,
13227
13228 /// Rules to specify what data is stored in each storage tier.
13229 /// Different tiers store data differently, providing different trade-offs
13230 /// between cost and performance. Different parts of a table can be stored
13231 /// separately on different tiers.
13232 /// If a config is specified, tiered storage is enabled for this table.
13233 /// Otherwise, tiered storage is disabled.
13234 /// Only SSD instances can configure tiered storage.
13235 pub tiered_storage_config: std::option::Option<crate::model::TieredStorageConfig>,
13236
13237 /// The row key schema for this table. The schema is used to decode the raw row
13238 /// key bytes into a structured format. The order of field declarations in this
13239 /// schema is important, as it reflects how the raw row key bytes are
13240 /// structured. Currently, this only affects how the key is read via a
13241 /// GoogleSQL query from the ExecuteQuery API.
13242 ///
13243 /// For a SQL query, the _key column is still read as raw bytes. But queries
13244 /// can reference the key fields by name, which will be decoded from _key using
13245 /// provided type and encoding. Queries that reference key fields will fail if
13246 /// they encounter an invalid row key.
13247 ///
13248 /// For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
13249 /// following schema:
13250 /// {
13251 /// fields {
13252 /// field_name: "id"
13253 /// type { string { encoding: utf8_bytes {} } }
13254 /// }
13255 /// fields {
13256 /// field_name: "date"
13257 /// type { string { encoding: utf8_bytes {} } }
13258 /// }
13259 /// fields {
13260 /// field_name: "product_code"
13261 /// type { int64 { encoding: big_endian_bytes {} } }
13262 /// }
13263 /// encoding { delimited_bytes { delimiter: "#" } }
13264 /// }
13265 ///
13266 /// The decoded key parts would be:
13267 /// id = "some_id", date = "2024-04-30", product_code = 1245427
13268 /// The query "SELECT _key, product_code FROM table" will return two columns:
13269 /// /------------------------------------------------------\
13270 /// | _key | product_code |
13271 /// | --------------------------------------|--------------|
13272 /// | "some_id#2024-04-30#\x00\x13\x00\xf3" | 1245427 |
13273 /// \------------------------------------------------------/
13274 ///
13275 /// The schema has the following invariants:
13276 /// (1) The decoded field values are order-preserved. For read, the field
13277 /// values will be decoded in sorted mode from the raw bytes.
13278 /// (2) Every field in the schema must specify a non-empty name.
13279 /// (3) Every field must specify a type with an associated encoding. The type
13280 /// is limited to scalar types only: Array, Map, Aggregate, and Struct are not
13281 /// allowed.
13282 /// (4) The field names must not collide with existing column family
13283 /// names and reserved keywords "_key" and "_timestamp".
13284 ///
13285 /// The following update operations are allowed for row_key_schema:
13286 ///
13287 /// - Update from an empty schema to a new schema.
13288 /// - Remove the existing schema. This operation requires setting the
13289 /// `ignore_warnings` flag to `true`, since it might be a backward
13290 /// incompatible change. Without the flag, the update request will fail with
13291 /// an INVALID_ARGUMENT error.
13292 /// Any other row key schema update operation (e.g. update existing schema
13293 /// columns names or types) is currently unsupported.
13294 pub row_key_schema: std::option::Option<crate::model::r#type::Struct>,
13295
13296 #[allow(missing_docs)]
13297 pub automated_backup_config: std::option::Option<crate::model::table::AutomatedBackupConfig>,
13298
13299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13300}
13301
13302impl Table {
13303 /// Creates a new default instance.
13304 pub fn new() -> Self {
13305 std::default::Default::default()
13306 }
13307
13308 /// Sets the value of [name][crate::model::Table::name].
13309 ///
13310 /// # Example
13311 /// ```ignore,no_run
13312 /// # use google_cloud_bigtable_admin_v2::model::Table;
13313 /// # let project_id = "project_id";
13314 /// # let instance_id = "instance_id";
13315 /// # let table_id = "table_id";
13316 /// let x = Table::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}"));
13317 /// ```
13318 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13319 self.name = v.into();
13320 self
13321 }
13322
13323 /// Sets the value of [cluster_states][crate::model::Table::cluster_states].
13324 ///
13325 /// # Example
13326 /// ```ignore,no_run
13327 /// # use google_cloud_bigtable_admin_v2::model::Table;
13328 /// use google_cloud_bigtable_admin_v2::model::table::ClusterState;
13329 /// let x = Table::new().set_cluster_states([
13330 /// ("key0", ClusterState::default()/* use setters */),
13331 /// ("key1", ClusterState::default()/* use (different) setters */),
13332 /// ]);
13333 /// ```
13334 pub fn set_cluster_states<T, K, V>(mut self, v: T) -> Self
13335 where
13336 T: std::iter::IntoIterator<Item = (K, V)>,
13337 K: std::convert::Into<std::string::String>,
13338 V: std::convert::Into<crate::model::table::ClusterState>,
13339 {
13340 use std::iter::Iterator;
13341 self.cluster_states = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13342 self
13343 }
13344
13345 /// Sets the value of [column_families][crate::model::Table::column_families].
13346 ///
13347 /// # Example
13348 /// ```ignore,no_run
13349 /// # use google_cloud_bigtable_admin_v2::model::Table;
13350 /// use google_cloud_bigtable_admin_v2::model::ColumnFamily;
13351 /// let x = Table::new().set_column_families([
13352 /// ("key0", ColumnFamily::default()/* use setters */),
13353 /// ("key1", ColumnFamily::default()/* use (different) setters */),
13354 /// ]);
13355 /// ```
13356 pub fn set_column_families<T, K, V>(mut self, v: T) -> Self
13357 where
13358 T: std::iter::IntoIterator<Item = (K, V)>,
13359 K: std::convert::Into<std::string::String>,
13360 V: std::convert::Into<crate::model::ColumnFamily>,
13361 {
13362 use std::iter::Iterator;
13363 self.column_families = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13364 self
13365 }
13366
13367 /// Sets the value of [granularity][crate::model::Table::granularity].
13368 ///
13369 /// # Example
13370 /// ```ignore,no_run
13371 /// # use google_cloud_bigtable_admin_v2::model::Table;
13372 /// use google_cloud_bigtable_admin_v2::model::table::TimestampGranularity;
13373 /// let x0 = Table::new().set_granularity(TimestampGranularity::Millis);
13374 /// let x1 = Table::new().set_granularity(TimestampGranularity::Micros);
13375 /// ```
13376 pub fn set_granularity<T: std::convert::Into<crate::model::table::TimestampGranularity>>(
13377 mut self,
13378 v: T,
13379 ) -> Self {
13380 self.granularity = v.into();
13381 self
13382 }
13383
13384 /// Sets the value of [restore_info][crate::model::Table::restore_info].
13385 ///
13386 /// # Example
13387 /// ```ignore,no_run
13388 /// # use google_cloud_bigtable_admin_v2::model::Table;
13389 /// use google_cloud_bigtable_admin_v2::model::RestoreInfo;
13390 /// let x = Table::new().set_restore_info(RestoreInfo::default()/* use setters */);
13391 /// ```
13392 pub fn set_restore_info<T>(mut self, v: T) -> Self
13393 where
13394 T: std::convert::Into<crate::model::RestoreInfo>,
13395 {
13396 self.restore_info = std::option::Option::Some(v.into());
13397 self
13398 }
13399
13400 /// Sets or clears the value of [restore_info][crate::model::Table::restore_info].
13401 ///
13402 /// # Example
13403 /// ```ignore,no_run
13404 /// # use google_cloud_bigtable_admin_v2::model::Table;
13405 /// use google_cloud_bigtable_admin_v2::model::RestoreInfo;
13406 /// let x = Table::new().set_or_clear_restore_info(Some(RestoreInfo::default()/* use setters */));
13407 /// let x = Table::new().set_or_clear_restore_info(None::<RestoreInfo>);
13408 /// ```
13409 pub fn set_or_clear_restore_info<T>(mut self, v: std::option::Option<T>) -> Self
13410 where
13411 T: std::convert::Into<crate::model::RestoreInfo>,
13412 {
13413 self.restore_info = v.map(|x| x.into());
13414 self
13415 }
13416
13417 /// Sets the value of [change_stream_config][crate::model::Table::change_stream_config].
13418 ///
13419 /// # Example
13420 /// ```ignore,no_run
13421 /// # use google_cloud_bigtable_admin_v2::model::Table;
13422 /// use google_cloud_bigtable_admin_v2::model::ChangeStreamConfig;
13423 /// let x = Table::new().set_change_stream_config(ChangeStreamConfig::default()/* use setters */);
13424 /// ```
13425 pub fn set_change_stream_config<T>(mut self, v: T) -> Self
13426 where
13427 T: std::convert::Into<crate::model::ChangeStreamConfig>,
13428 {
13429 self.change_stream_config = std::option::Option::Some(v.into());
13430 self
13431 }
13432
13433 /// Sets or clears the value of [change_stream_config][crate::model::Table::change_stream_config].
13434 ///
13435 /// # Example
13436 /// ```ignore,no_run
13437 /// # use google_cloud_bigtable_admin_v2::model::Table;
13438 /// use google_cloud_bigtable_admin_v2::model::ChangeStreamConfig;
13439 /// let x = Table::new().set_or_clear_change_stream_config(Some(ChangeStreamConfig::default()/* use setters */));
13440 /// let x = Table::new().set_or_clear_change_stream_config(None::<ChangeStreamConfig>);
13441 /// ```
13442 pub fn set_or_clear_change_stream_config<T>(mut self, v: std::option::Option<T>) -> Self
13443 where
13444 T: std::convert::Into<crate::model::ChangeStreamConfig>,
13445 {
13446 self.change_stream_config = v.map(|x| x.into());
13447 self
13448 }
13449
13450 /// Sets the value of [deletion_protection][crate::model::Table::deletion_protection].
13451 ///
13452 /// # Example
13453 /// ```ignore,no_run
13454 /// # use google_cloud_bigtable_admin_v2::model::Table;
13455 /// let x = Table::new().set_deletion_protection(true);
13456 /// ```
13457 pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13458 self.deletion_protection = v.into();
13459 self
13460 }
13461
13462 /// Sets the value of [effective_automated_backup_policy][crate::model::Table::effective_automated_backup_policy].
13463 ///
13464 /// # Example
13465 /// ```ignore,no_run
13466 /// # use google_cloud_bigtable_admin_v2::model::Table;
13467 /// use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13468 /// let x = Table::new().set_effective_automated_backup_policy(AutomatedBackupPolicy::default()/* use setters */);
13469 /// ```
13470 pub fn set_effective_automated_backup_policy<T>(mut self, v: T) -> Self
13471 where
13472 T: std::convert::Into<crate::model::table::AutomatedBackupPolicy>,
13473 {
13474 self.effective_automated_backup_policy = std::option::Option::Some(v.into());
13475 self
13476 }
13477
13478 /// Sets or clears the value of [effective_automated_backup_policy][crate::model::Table::effective_automated_backup_policy].
13479 ///
13480 /// # Example
13481 /// ```ignore,no_run
13482 /// # use google_cloud_bigtable_admin_v2::model::Table;
13483 /// use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13484 /// let x = Table::new().set_or_clear_effective_automated_backup_policy(Some(AutomatedBackupPolicy::default()/* use setters */));
13485 /// let x = Table::new().set_or_clear_effective_automated_backup_policy(None::<AutomatedBackupPolicy>);
13486 /// ```
13487 pub fn set_or_clear_effective_automated_backup_policy<T>(
13488 mut self,
13489 v: std::option::Option<T>,
13490 ) -> Self
13491 where
13492 T: std::convert::Into<crate::model::table::AutomatedBackupPolicy>,
13493 {
13494 self.effective_automated_backup_policy = v.map(|x| x.into());
13495 self
13496 }
13497
13498 /// Sets the value of [tiered_storage_config][crate::model::Table::tiered_storage_config].
13499 ///
13500 /// # Example
13501 /// ```ignore,no_run
13502 /// # use google_cloud_bigtable_admin_v2::model::Table;
13503 /// use google_cloud_bigtable_admin_v2::model::TieredStorageConfig;
13504 /// let x = Table::new().set_tiered_storage_config(TieredStorageConfig::default()/* use setters */);
13505 /// ```
13506 pub fn set_tiered_storage_config<T>(mut self, v: T) -> Self
13507 where
13508 T: std::convert::Into<crate::model::TieredStorageConfig>,
13509 {
13510 self.tiered_storage_config = std::option::Option::Some(v.into());
13511 self
13512 }
13513
13514 /// Sets or clears the value of [tiered_storage_config][crate::model::Table::tiered_storage_config].
13515 ///
13516 /// # Example
13517 /// ```ignore,no_run
13518 /// # use google_cloud_bigtable_admin_v2::model::Table;
13519 /// use google_cloud_bigtable_admin_v2::model::TieredStorageConfig;
13520 /// let x = Table::new().set_or_clear_tiered_storage_config(Some(TieredStorageConfig::default()/* use setters */));
13521 /// let x = Table::new().set_or_clear_tiered_storage_config(None::<TieredStorageConfig>);
13522 /// ```
13523 pub fn set_or_clear_tiered_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
13524 where
13525 T: std::convert::Into<crate::model::TieredStorageConfig>,
13526 {
13527 self.tiered_storage_config = v.map(|x| x.into());
13528 self
13529 }
13530
13531 /// Sets the value of [row_key_schema][crate::model::Table::row_key_schema].
13532 ///
13533 /// # Example
13534 /// ```ignore,no_run
13535 /// # use google_cloud_bigtable_admin_v2::model::Table;
13536 /// use google_cloud_bigtable_admin_v2::model::r#type::Struct;
13537 /// let x = Table::new().set_row_key_schema(Struct::default()/* use setters */);
13538 /// ```
13539 pub fn set_row_key_schema<T>(mut self, v: T) -> Self
13540 where
13541 T: std::convert::Into<crate::model::r#type::Struct>,
13542 {
13543 self.row_key_schema = std::option::Option::Some(v.into());
13544 self
13545 }
13546
13547 /// Sets or clears the value of [row_key_schema][crate::model::Table::row_key_schema].
13548 ///
13549 /// # Example
13550 /// ```ignore,no_run
13551 /// # use google_cloud_bigtable_admin_v2::model::Table;
13552 /// use google_cloud_bigtable_admin_v2::model::r#type::Struct;
13553 /// let x = Table::new().set_or_clear_row_key_schema(Some(Struct::default()/* use setters */));
13554 /// let x = Table::new().set_or_clear_row_key_schema(None::<Struct>);
13555 /// ```
13556 pub fn set_or_clear_row_key_schema<T>(mut self, v: std::option::Option<T>) -> Self
13557 where
13558 T: std::convert::Into<crate::model::r#type::Struct>,
13559 {
13560 self.row_key_schema = v.map(|x| x.into());
13561 self
13562 }
13563
13564 /// Sets the value of [automated_backup_config][crate::model::Table::automated_backup_config].
13565 ///
13566 /// Note that all the setters affecting `automated_backup_config` are mutually
13567 /// exclusive.
13568 ///
13569 /// # Example
13570 /// ```ignore,no_run
13571 /// # use google_cloud_bigtable_admin_v2::model::Table;
13572 /// use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13573 /// let x = Table::new().set_automated_backup_config(Some(
13574 /// google_cloud_bigtable_admin_v2::model::table::AutomatedBackupConfig::AutomatedBackupPolicy(AutomatedBackupPolicy::default().into())));
13575 /// ```
13576 pub fn set_automated_backup_config<
13577 T: std::convert::Into<std::option::Option<crate::model::table::AutomatedBackupConfig>>,
13578 >(
13579 mut self,
13580 v: T,
13581 ) -> Self {
13582 self.automated_backup_config = v.into();
13583 self
13584 }
13585
13586 /// The value of [automated_backup_config][crate::model::Table::automated_backup_config]
13587 /// if it holds a `AutomatedBackupPolicy`, `None` if the field is not set or
13588 /// holds a different branch.
13589 pub fn automated_backup_policy(
13590 &self,
13591 ) -> std::option::Option<&std::boxed::Box<crate::model::table::AutomatedBackupPolicy>> {
13592 #[allow(unreachable_patterns)]
13593 self.automated_backup_config.as_ref().and_then(|v| match v {
13594 crate::model::table::AutomatedBackupConfig::AutomatedBackupPolicy(v) => {
13595 std::option::Option::Some(v)
13596 }
13597 _ => std::option::Option::None,
13598 })
13599 }
13600
13601 /// Sets the value of [automated_backup_config][crate::model::Table::automated_backup_config]
13602 /// to hold a `AutomatedBackupPolicy`.
13603 ///
13604 /// Note that all the setters affecting `automated_backup_config` are
13605 /// mutually exclusive.
13606 ///
13607 /// # Example
13608 /// ```ignore,no_run
13609 /// # use google_cloud_bigtable_admin_v2::model::Table;
13610 /// use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13611 /// let x = Table::new().set_automated_backup_policy(AutomatedBackupPolicy::default()/* use setters */);
13612 /// assert!(x.automated_backup_policy().is_some());
13613 /// ```
13614 pub fn set_automated_backup_policy<
13615 T: std::convert::Into<std::boxed::Box<crate::model::table::AutomatedBackupPolicy>>,
13616 >(
13617 mut self,
13618 v: T,
13619 ) -> Self {
13620 self.automated_backup_config = std::option::Option::Some(
13621 crate::model::table::AutomatedBackupConfig::AutomatedBackupPolicy(v.into()),
13622 );
13623 self
13624 }
13625}
13626
13627impl wkt::message::Message for Table {
13628 fn typename() -> &'static str {
13629 "type.googleapis.com/google.bigtable.admin.v2.Table"
13630 }
13631}
13632
13633/// Defines additional types related to [Table].
13634pub mod table {
13635 #[allow(unused_imports)]
13636 use super::*;
13637
13638 /// The state of a table's data in a particular cluster.
13639 #[derive(Clone, Default, PartialEq)]
13640 #[non_exhaustive]
13641 pub struct ClusterState {
13642 /// Output only. The state of replication for the table in this cluster.
13643 pub replication_state: crate::model::table::cluster_state::ReplicationState,
13644
13645 /// Output only. The encryption information for the table in this cluster.
13646 /// If the encryption key protecting this resource is customer managed, then
13647 /// its version can be rotated in Cloud Key Management Service (Cloud KMS).
13648 /// The primary version of the key and its status will be reflected here when
13649 /// changes propagate from Cloud KMS.
13650 pub encryption_info: std::vec::Vec<crate::model::EncryptionInfo>,
13651
13652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13653 }
13654
13655 impl ClusterState {
13656 /// Creates a new default instance.
13657 pub fn new() -> Self {
13658 std::default::Default::default()
13659 }
13660
13661 /// Sets the value of [replication_state][crate::model::table::ClusterState::replication_state].
13662 ///
13663 /// # Example
13664 /// ```ignore,no_run
13665 /// # use google_cloud_bigtable_admin_v2::model::table::ClusterState;
13666 /// use google_cloud_bigtable_admin_v2::model::table::cluster_state::ReplicationState;
13667 /// let x0 = ClusterState::new().set_replication_state(ReplicationState::Initializing);
13668 /// let x1 = ClusterState::new().set_replication_state(ReplicationState::PlannedMaintenance);
13669 /// let x2 = ClusterState::new().set_replication_state(ReplicationState::UnplannedMaintenance);
13670 /// ```
13671 pub fn set_replication_state<
13672 T: std::convert::Into<crate::model::table::cluster_state::ReplicationState>,
13673 >(
13674 mut self,
13675 v: T,
13676 ) -> Self {
13677 self.replication_state = v.into();
13678 self
13679 }
13680
13681 /// Sets the value of [encryption_info][crate::model::table::ClusterState::encryption_info].
13682 ///
13683 /// # Example
13684 /// ```ignore,no_run
13685 /// # use google_cloud_bigtable_admin_v2::model::table::ClusterState;
13686 /// use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
13687 /// let x = ClusterState::new()
13688 /// .set_encryption_info([
13689 /// EncryptionInfo::default()/* use setters */,
13690 /// EncryptionInfo::default()/* use (different) setters */,
13691 /// ]);
13692 /// ```
13693 pub fn set_encryption_info<T, V>(mut self, v: T) -> Self
13694 where
13695 T: std::iter::IntoIterator<Item = V>,
13696 V: std::convert::Into<crate::model::EncryptionInfo>,
13697 {
13698 use std::iter::Iterator;
13699 self.encryption_info = v.into_iter().map(|i| i.into()).collect();
13700 self
13701 }
13702 }
13703
13704 impl wkt::message::Message for ClusterState {
13705 fn typename() -> &'static str {
13706 "type.googleapis.com/google.bigtable.admin.v2.Table.ClusterState"
13707 }
13708 }
13709
13710 /// Defines additional types related to [ClusterState].
13711 pub mod cluster_state {
13712 #[allow(unused_imports)]
13713 use super::*;
13714
13715 /// Table replication states.
13716 ///
13717 /// # Working with unknown values
13718 ///
13719 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13720 /// additional enum variants at any time. Adding new variants is not considered
13721 /// a breaking change. Applications should write their code in anticipation of:
13722 ///
13723 /// - New values appearing in future releases of the client library, **and**
13724 /// - New values received dynamically, without application changes.
13725 ///
13726 /// Please consult the [Working with enums] section in the user guide for some
13727 /// guidelines.
13728 ///
13729 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13730 #[derive(Clone, Debug, PartialEq)]
13731 #[non_exhaustive]
13732 pub enum ReplicationState {
13733 /// The replication state of the table is unknown in this cluster.
13734 StateNotKnown,
13735 /// The cluster was recently created, and the table must finish copying
13736 /// over pre-existing data from other clusters before it can begin
13737 /// receiving live replication updates and serving Data API requests.
13738 Initializing,
13739 /// The table is temporarily unable to serve Data API requests from this
13740 /// cluster due to planned internal maintenance.
13741 PlannedMaintenance,
13742 /// The table is temporarily unable to serve Data API requests from this
13743 /// cluster due to unplanned or emergency maintenance.
13744 UnplannedMaintenance,
13745 /// The table can serve Data API requests from this cluster. Depending on
13746 /// replication delay, reads may not immediately reflect the state of the
13747 /// table in other clusters.
13748 Ready,
13749 /// The table is fully created and ready for use after a restore, and is
13750 /// being optimized for performance. When optimizations are complete, the
13751 /// table will transition to `READY` state.
13752 ReadyOptimizing,
13753 /// If set, the enum was initialized with an unknown value.
13754 ///
13755 /// Applications can examine the value using [ReplicationState::value] or
13756 /// [ReplicationState::name].
13757 UnknownValue(replication_state::UnknownValue),
13758 }
13759
13760 #[doc(hidden)]
13761 pub mod replication_state {
13762 #[allow(unused_imports)]
13763 use super::*;
13764 #[derive(Clone, Debug, PartialEq)]
13765 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13766 }
13767
13768 impl ReplicationState {
13769 /// Gets the enum value.
13770 ///
13771 /// Returns `None` if the enum contains an unknown value deserialized from
13772 /// the string representation of enums.
13773 pub fn value(&self) -> std::option::Option<i32> {
13774 match self {
13775 Self::StateNotKnown => std::option::Option::Some(0),
13776 Self::Initializing => std::option::Option::Some(1),
13777 Self::PlannedMaintenance => std::option::Option::Some(2),
13778 Self::UnplannedMaintenance => std::option::Option::Some(3),
13779 Self::Ready => std::option::Option::Some(4),
13780 Self::ReadyOptimizing => std::option::Option::Some(5),
13781 Self::UnknownValue(u) => u.0.value(),
13782 }
13783 }
13784
13785 /// Gets the enum value as a string.
13786 ///
13787 /// Returns `None` if the enum contains an unknown value deserialized from
13788 /// the integer representation of enums.
13789 pub fn name(&self) -> std::option::Option<&str> {
13790 match self {
13791 Self::StateNotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
13792 Self::Initializing => std::option::Option::Some("INITIALIZING"),
13793 Self::PlannedMaintenance => std::option::Option::Some("PLANNED_MAINTENANCE"),
13794 Self::UnplannedMaintenance => {
13795 std::option::Option::Some("UNPLANNED_MAINTENANCE")
13796 }
13797 Self::Ready => std::option::Option::Some("READY"),
13798 Self::ReadyOptimizing => std::option::Option::Some("READY_OPTIMIZING"),
13799 Self::UnknownValue(u) => u.0.name(),
13800 }
13801 }
13802 }
13803
13804 impl std::default::Default for ReplicationState {
13805 fn default() -> Self {
13806 use std::convert::From;
13807 Self::from(0)
13808 }
13809 }
13810
13811 impl std::fmt::Display for ReplicationState {
13812 fn fmt(
13813 &self,
13814 f: &mut std::fmt::Formatter<'_>,
13815 ) -> std::result::Result<(), std::fmt::Error> {
13816 wkt::internal::display_enum(f, self.name(), self.value())
13817 }
13818 }
13819
13820 impl std::convert::From<i32> for ReplicationState {
13821 fn from(value: i32) -> Self {
13822 match value {
13823 0 => Self::StateNotKnown,
13824 1 => Self::Initializing,
13825 2 => Self::PlannedMaintenance,
13826 3 => Self::UnplannedMaintenance,
13827 4 => Self::Ready,
13828 5 => Self::ReadyOptimizing,
13829 _ => Self::UnknownValue(replication_state::UnknownValue(
13830 wkt::internal::UnknownEnumValue::Integer(value),
13831 )),
13832 }
13833 }
13834 }
13835
13836 impl std::convert::From<&str> for ReplicationState {
13837 fn from(value: &str) -> Self {
13838 use std::string::ToString;
13839 match value {
13840 "STATE_NOT_KNOWN" => Self::StateNotKnown,
13841 "INITIALIZING" => Self::Initializing,
13842 "PLANNED_MAINTENANCE" => Self::PlannedMaintenance,
13843 "UNPLANNED_MAINTENANCE" => Self::UnplannedMaintenance,
13844 "READY" => Self::Ready,
13845 "READY_OPTIMIZING" => Self::ReadyOptimizing,
13846 _ => Self::UnknownValue(replication_state::UnknownValue(
13847 wkt::internal::UnknownEnumValue::String(value.to_string()),
13848 )),
13849 }
13850 }
13851 }
13852
13853 impl serde::ser::Serialize for ReplicationState {
13854 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13855 where
13856 S: serde::Serializer,
13857 {
13858 match self {
13859 Self::StateNotKnown => serializer.serialize_i32(0),
13860 Self::Initializing => serializer.serialize_i32(1),
13861 Self::PlannedMaintenance => serializer.serialize_i32(2),
13862 Self::UnplannedMaintenance => serializer.serialize_i32(3),
13863 Self::Ready => serializer.serialize_i32(4),
13864 Self::ReadyOptimizing => serializer.serialize_i32(5),
13865 Self::UnknownValue(u) => u.0.serialize(serializer),
13866 }
13867 }
13868 }
13869
13870 impl<'de> serde::de::Deserialize<'de> for ReplicationState {
13871 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13872 where
13873 D: serde::Deserializer<'de>,
13874 {
13875 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationState>::new(
13876 ".google.bigtable.admin.v2.Table.ClusterState.ReplicationState",
13877 ))
13878 }
13879 }
13880 }
13881
13882 /// Defines an automated backup policy for a table
13883 #[derive(Clone, Default, PartialEq)]
13884 #[non_exhaustive]
13885 pub struct AutomatedBackupPolicy {
13886 /// Required. How long the automated backups should be retained. Values must
13887 /// be at least 3 days and at most 90 days.
13888 pub retention_period: std::option::Option<wkt::Duration>,
13889
13890 /// How frequently automated backups should occur. The only supported value
13891 /// at this time is 24 hours. An undefined frequency is treated as 24 hours.
13892 pub frequency: std::option::Option<wkt::Duration>,
13893
13894 /// Optional. A list of Cloud Bigtable zones where automated backups are
13895 /// allowed to be created. If empty, automated backups will be created in all
13896 /// zones of the instance. Locations are in the format
13897 /// `projects/{project}/locations/{zone}`.
13898 /// This field can only set for tables in Enterprise Plus instances.
13899 pub locations: std::vec::Vec<std::string::String>,
13900
13901 /// Optional. The amount of time that the automated backups remain hot.
13902 /// If specified, the backups created by this policy are `HOT` backups.
13903 /// If not specified, the backups are `STANDARD` backups.
13904 ///
13905 /// The value must be at least 24 hours and at most 10 days, and can't
13906 /// exceed the policy's `retention_period`.
13907 ///
13908 /// Only SSD instances support `HOT` automated backups.
13909 pub keep_hot_duration: std::option::Option<wkt::Duration>,
13910
13911 /// Optional. If `true`, automated backups are explicitly disabled on this
13912 /// table. This allows users to opt out of default enablement.
13913 pub disabled: bool,
13914
13915 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13916 }
13917
13918 impl AutomatedBackupPolicy {
13919 /// Creates a new default instance.
13920 pub fn new() -> Self {
13921 std::default::Default::default()
13922 }
13923
13924 /// Sets the value of [retention_period][crate::model::table::AutomatedBackupPolicy::retention_period].
13925 ///
13926 /// # Example
13927 /// ```ignore,no_run
13928 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13929 /// use wkt::Duration;
13930 /// let x = AutomatedBackupPolicy::new().set_retention_period(Duration::default()/* use setters */);
13931 /// ```
13932 pub fn set_retention_period<T>(mut self, v: T) -> Self
13933 where
13934 T: std::convert::Into<wkt::Duration>,
13935 {
13936 self.retention_period = std::option::Option::Some(v.into());
13937 self
13938 }
13939
13940 /// Sets or clears the value of [retention_period][crate::model::table::AutomatedBackupPolicy::retention_period].
13941 ///
13942 /// # Example
13943 /// ```ignore,no_run
13944 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13945 /// use wkt::Duration;
13946 /// let x = AutomatedBackupPolicy::new().set_or_clear_retention_period(Some(Duration::default()/* use setters */));
13947 /// let x = AutomatedBackupPolicy::new().set_or_clear_retention_period(None::<Duration>);
13948 /// ```
13949 pub fn set_or_clear_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
13950 where
13951 T: std::convert::Into<wkt::Duration>,
13952 {
13953 self.retention_period = v.map(|x| x.into());
13954 self
13955 }
13956
13957 /// Sets the value of [frequency][crate::model::table::AutomatedBackupPolicy::frequency].
13958 ///
13959 /// # Example
13960 /// ```ignore,no_run
13961 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13962 /// use wkt::Duration;
13963 /// let x = AutomatedBackupPolicy::new().set_frequency(Duration::default()/* use setters */);
13964 /// ```
13965 pub fn set_frequency<T>(mut self, v: T) -> Self
13966 where
13967 T: std::convert::Into<wkt::Duration>,
13968 {
13969 self.frequency = std::option::Option::Some(v.into());
13970 self
13971 }
13972
13973 /// Sets or clears the value of [frequency][crate::model::table::AutomatedBackupPolicy::frequency].
13974 ///
13975 /// # Example
13976 /// ```ignore,no_run
13977 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13978 /// use wkt::Duration;
13979 /// let x = AutomatedBackupPolicy::new().set_or_clear_frequency(Some(Duration::default()/* use setters */));
13980 /// let x = AutomatedBackupPolicy::new().set_or_clear_frequency(None::<Duration>);
13981 /// ```
13982 pub fn set_or_clear_frequency<T>(mut self, v: std::option::Option<T>) -> Self
13983 where
13984 T: std::convert::Into<wkt::Duration>,
13985 {
13986 self.frequency = v.map(|x| x.into());
13987 self
13988 }
13989
13990 /// Sets the value of [locations][crate::model::table::AutomatedBackupPolicy::locations].
13991 ///
13992 /// # Example
13993 /// ```ignore,no_run
13994 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
13995 /// let x = AutomatedBackupPolicy::new().set_locations(["a", "b", "c"]);
13996 /// ```
13997 pub fn set_locations<T, V>(mut self, v: T) -> Self
13998 where
13999 T: std::iter::IntoIterator<Item = V>,
14000 V: std::convert::Into<std::string::String>,
14001 {
14002 use std::iter::Iterator;
14003 self.locations = v.into_iter().map(|i| i.into()).collect();
14004 self
14005 }
14006
14007 /// Sets the value of [keep_hot_duration][crate::model::table::AutomatedBackupPolicy::keep_hot_duration].
14008 ///
14009 /// # Example
14010 /// ```ignore,no_run
14011 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
14012 /// use wkt::Duration;
14013 /// let x = AutomatedBackupPolicy::new().set_keep_hot_duration(Duration::default()/* use setters */);
14014 /// ```
14015 pub fn set_keep_hot_duration<T>(mut self, v: T) -> Self
14016 where
14017 T: std::convert::Into<wkt::Duration>,
14018 {
14019 self.keep_hot_duration = std::option::Option::Some(v.into());
14020 self
14021 }
14022
14023 /// Sets or clears the value of [keep_hot_duration][crate::model::table::AutomatedBackupPolicy::keep_hot_duration].
14024 ///
14025 /// # Example
14026 /// ```ignore,no_run
14027 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
14028 /// use wkt::Duration;
14029 /// let x = AutomatedBackupPolicy::new().set_or_clear_keep_hot_duration(Some(Duration::default()/* use setters */));
14030 /// let x = AutomatedBackupPolicy::new().set_or_clear_keep_hot_duration(None::<Duration>);
14031 /// ```
14032 pub fn set_or_clear_keep_hot_duration<T>(mut self, v: std::option::Option<T>) -> Self
14033 where
14034 T: std::convert::Into<wkt::Duration>,
14035 {
14036 self.keep_hot_duration = v.map(|x| x.into());
14037 self
14038 }
14039
14040 /// Sets the value of [disabled][crate::model::table::AutomatedBackupPolicy::disabled].
14041 ///
14042 /// # Example
14043 /// ```ignore,no_run
14044 /// # use google_cloud_bigtable_admin_v2::model::table::AutomatedBackupPolicy;
14045 /// let x = AutomatedBackupPolicy::new().set_disabled(true);
14046 /// ```
14047 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14048 self.disabled = v.into();
14049 self
14050 }
14051 }
14052
14053 impl wkt::message::Message for AutomatedBackupPolicy {
14054 fn typename() -> &'static str {
14055 "type.googleapis.com/google.bigtable.admin.v2.Table.AutomatedBackupPolicy"
14056 }
14057 }
14058
14059 /// Possible timestamp granularities to use when keeping multiple versions
14060 /// of data in a table.
14061 ///
14062 /// # Working with unknown values
14063 ///
14064 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14065 /// additional enum variants at any time. Adding new variants is not considered
14066 /// a breaking change. Applications should write their code in anticipation of:
14067 ///
14068 /// - New values appearing in future releases of the client library, **and**
14069 /// - New values received dynamically, without application changes.
14070 ///
14071 /// Please consult the [Working with enums] section in the user guide for some
14072 /// guidelines.
14073 ///
14074 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14075 #[derive(Clone, Debug, PartialEq)]
14076 #[non_exhaustive]
14077 pub enum TimestampGranularity {
14078 /// The user did not specify a granularity. Should not be returned.
14079 /// When specified during table creation, MILLIS will be used.
14080 Unspecified,
14081 /// The table keeps data versioned at a granularity of 1ms.
14082 Millis,
14083 /// The table keeps data versioned at a granularity of 1us.
14084 Micros,
14085 /// If set, the enum was initialized with an unknown value.
14086 ///
14087 /// Applications can examine the value using [TimestampGranularity::value] or
14088 /// [TimestampGranularity::name].
14089 UnknownValue(timestamp_granularity::UnknownValue),
14090 }
14091
14092 #[doc(hidden)]
14093 pub mod timestamp_granularity {
14094 #[allow(unused_imports)]
14095 use super::*;
14096 #[derive(Clone, Debug, PartialEq)]
14097 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14098 }
14099
14100 impl TimestampGranularity {
14101 /// Gets the enum value.
14102 ///
14103 /// Returns `None` if the enum contains an unknown value deserialized from
14104 /// the string representation of enums.
14105 pub fn value(&self) -> std::option::Option<i32> {
14106 match self {
14107 Self::Unspecified => std::option::Option::Some(0),
14108 Self::Millis => std::option::Option::Some(1),
14109 Self::Micros => std::option::Option::Some(2),
14110 Self::UnknownValue(u) => u.0.value(),
14111 }
14112 }
14113
14114 /// Gets the enum value as a string.
14115 ///
14116 /// Returns `None` if the enum contains an unknown value deserialized from
14117 /// the integer representation of enums.
14118 pub fn name(&self) -> std::option::Option<&str> {
14119 match self {
14120 Self::Unspecified => std::option::Option::Some("TIMESTAMP_GRANULARITY_UNSPECIFIED"),
14121 Self::Millis => std::option::Option::Some("MILLIS"),
14122 Self::Micros => std::option::Option::Some("MICROS"),
14123 Self::UnknownValue(u) => u.0.name(),
14124 }
14125 }
14126 }
14127
14128 impl std::default::Default for TimestampGranularity {
14129 fn default() -> Self {
14130 use std::convert::From;
14131 Self::from(0)
14132 }
14133 }
14134
14135 impl std::fmt::Display for TimestampGranularity {
14136 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14137 wkt::internal::display_enum(f, self.name(), self.value())
14138 }
14139 }
14140
14141 impl std::convert::From<i32> for TimestampGranularity {
14142 fn from(value: i32) -> Self {
14143 match value {
14144 0 => Self::Unspecified,
14145 1 => Self::Millis,
14146 2 => Self::Micros,
14147 _ => Self::UnknownValue(timestamp_granularity::UnknownValue(
14148 wkt::internal::UnknownEnumValue::Integer(value),
14149 )),
14150 }
14151 }
14152 }
14153
14154 impl std::convert::From<&str> for TimestampGranularity {
14155 fn from(value: &str) -> Self {
14156 use std::string::ToString;
14157 match value {
14158 "TIMESTAMP_GRANULARITY_UNSPECIFIED" => Self::Unspecified,
14159 "MILLIS" => Self::Millis,
14160 "MICROS" => Self::Micros,
14161 _ => Self::UnknownValue(timestamp_granularity::UnknownValue(
14162 wkt::internal::UnknownEnumValue::String(value.to_string()),
14163 )),
14164 }
14165 }
14166 }
14167
14168 impl serde::ser::Serialize for TimestampGranularity {
14169 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14170 where
14171 S: serde::Serializer,
14172 {
14173 match self {
14174 Self::Unspecified => serializer.serialize_i32(0),
14175 Self::Millis => serializer.serialize_i32(1),
14176 Self::Micros => serializer.serialize_i32(2),
14177 Self::UnknownValue(u) => u.0.serialize(serializer),
14178 }
14179 }
14180 }
14181
14182 impl<'de> serde::de::Deserialize<'de> for TimestampGranularity {
14183 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14184 where
14185 D: serde::Deserializer<'de>,
14186 {
14187 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TimestampGranularity>::new(
14188 ".google.bigtable.admin.v2.Table.TimestampGranularity",
14189 ))
14190 }
14191 }
14192
14193 /// Defines a view over a table's fields.
14194 ///
14195 /// # Working with unknown values
14196 ///
14197 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14198 /// additional enum variants at any time. Adding new variants is not considered
14199 /// a breaking change. Applications should write their code in anticipation of:
14200 ///
14201 /// - New values appearing in future releases of the client library, **and**
14202 /// - New values received dynamically, without application changes.
14203 ///
14204 /// Please consult the [Working with enums] section in the user guide for some
14205 /// guidelines.
14206 ///
14207 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14208 #[derive(Clone, Debug, PartialEq)]
14209 #[non_exhaustive]
14210 pub enum View {
14211 /// Uses the default view for each method as documented in its request.
14212 Unspecified,
14213 /// Only populates `name`.
14214 NameOnly,
14215 /// Only populates `name` and fields related to the table's schema.
14216 SchemaView,
14217 /// Only populates `name` and fields related to the table's replication
14218 /// state.
14219 ReplicationView,
14220 /// Only populates `name` and fields related to the table's encryption state.
14221 EncryptionView,
14222 /// Populates all fields.
14223 Full,
14224 /// If set, the enum was initialized with an unknown value.
14225 ///
14226 /// Applications can examine the value using [View::value] or
14227 /// [View::name].
14228 UnknownValue(view::UnknownValue),
14229 }
14230
14231 #[doc(hidden)]
14232 pub mod view {
14233 #[allow(unused_imports)]
14234 use super::*;
14235 #[derive(Clone, Debug, PartialEq)]
14236 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14237 }
14238
14239 impl View {
14240 /// Gets the enum value.
14241 ///
14242 /// Returns `None` if the enum contains an unknown value deserialized from
14243 /// the string representation of enums.
14244 pub fn value(&self) -> std::option::Option<i32> {
14245 match self {
14246 Self::Unspecified => std::option::Option::Some(0),
14247 Self::NameOnly => std::option::Option::Some(1),
14248 Self::SchemaView => std::option::Option::Some(2),
14249 Self::ReplicationView => std::option::Option::Some(3),
14250 Self::EncryptionView => std::option::Option::Some(5),
14251 Self::Full => std::option::Option::Some(4),
14252 Self::UnknownValue(u) => u.0.value(),
14253 }
14254 }
14255
14256 /// Gets the enum value as a string.
14257 ///
14258 /// Returns `None` if the enum contains an unknown value deserialized from
14259 /// the integer representation of enums.
14260 pub fn name(&self) -> std::option::Option<&str> {
14261 match self {
14262 Self::Unspecified => std::option::Option::Some("VIEW_UNSPECIFIED"),
14263 Self::NameOnly => std::option::Option::Some("NAME_ONLY"),
14264 Self::SchemaView => std::option::Option::Some("SCHEMA_VIEW"),
14265 Self::ReplicationView => std::option::Option::Some("REPLICATION_VIEW"),
14266 Self::EncryptionView => std::option::Option::Some("ENCRYPTION_VIEW"),
14267 Self::Full => std::option::Option::Some("FULL"),
14268 Self::UnknownValue(u) => u.0.name(),
14269 }
14270 }
14271 }
14272
14273 impl std::default::Default for View {
14274 fn default() -> Self {
14275 use std::convert::From;
14276 Self::from(0)
14277 }
14278 }
14279
14280 impl std::fmt::Display for View {
14281 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14282 wkt::internal::display_enum(f, self.name(), self.value())
14283 }
14284 }
14285
14286 impl std::convert::From<i32> for View {
14287 fn from(value: i32) -> Self {
14288 match value {
14289 0 => Self::Unspecified,
14290 1 => Self::NameOnly,
14291 2 => Self::SchemaView,
14292 3 => Self::ReplicationView,
14293 4 => Self::Full,
14294 5 => Self::EncryptionView,
14295 _ => Self::UnknownValue(view::UnknownValue(
14296 wkt::internal::UnknownEnumValue::Integer(value),
14297 )),
14298 }
14299 }
14300 }
14301
14302 impl std::convert::From<&str> for View {
14303 fn from(value: &str) -> Self {
14304 use std::string::ToString;
14305 match value {
14306 "VIEW_UNSPECIFIED" => Self::Unspecified,
14307 "NAME_ONLY" => Self::NameOnly,
14308 "SCHEMA_VIEW" => Self::SchemaView,
14309 "REPLICATION_VIEW" => Self::ReplicationView,
14310 "ENCRYPTION_VIEW" => Self::EncryptionView,
14311 "FULL" => Self::Full,
14312 _ => Self::UnknownValue(view::UnknownValue(
14313 wkt::internal::UnknownEnumValue::String(value.to_string()),
14314 )),
14315 }
14316 }
14317 }
14318
14319 impl serde::ser::Serialize for View {
14320 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14321 where
14322 S: serde::Serializer,
14323 {
14324 match self {
14325 Self::Unspecified => serializer.serialize_i32(0),
14326 Self::NameOnly => serializer.serialize_i32(1),
14327 Self::SchemaView => serializer.serialize_i32(2),
14328 Self::ReplicationView => serializer.serialize_i32(3),
14329 Self::EncryptionView => serializer.serialize_i32(5),
14330 Self::Full => serializer.serialize_i32(4),
14331 Self::UnknownValue(u) => u.0.serialize(serializer),
14332 }
14333 }
14334 }
14335
14336 impl<'de> serde::de::Deserialize<'de> for View {
14337 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14338 where
14339 D: serde::Deserializer<'de>,
14340 {
14341 deserializer.deserialize_any(wkt::internal::EnumVisitor::<View>::new(
14342 ".google.bigtable.admin.v2.Table.View",
14343 ))
14344 }
14345 }
14346
14347 #[allow(missing_docs)]
14348 #[derive(Clone, Debug, PartialEq)]
14349 #[non_exhaustive]
14350 pub enum AutomatedBackupConfig {
14351 /// If specified, automated backups are enabled for this table.
14352 /// Otherwise, automated backups are disabled.
14353 AutomatedBackupPolicy(std::boxed::Box<crate::model::table::AutomatedBackupPolicy>),
14354 }
14355}
14356
14357/// AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users
14358/// can configure access to each Authorized View independently from the table and
14359/// use the existing Data APIs to access the subset of data.
14360#[derive(Clone, Default, PartialEq)]
14361#[non_exhaustive]
14362pub struct AuthorizedView {
14363 /// Identifier. The name of this AuthorizedView.
14364 /// Values are of the form
14365 /// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
14366 pub name: std::string::String,
14367
14368 /// The etag for this AuthorizedView.
14369 /// If this is provided on update, it must match the server's etag. The server
14370 /// returns ABORTED error on a mismatched etag.
14371 pub etag: std::string::String,
14372
14373 /// Set to true to make the AuthorizedView protected against deletion.
14374 /// The parent Table and containing Instance cannot be deleted if an
14375 /// AuthorizedView has this bit set.
14376 pub deletion_protection: bool,
14377
14378 /// The type of this AuthorizedView.
14379 pub authorized_view: std::option::Option<crate::model::authorized_view::AuthorizedView>,
14380
14381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14382}
14383
14384impl AuthorizedView {
14385 /// Creates a new default instance.
14386 pub fn new() -> Self {
14387 std::default::Default::default()
14388 }
14389
14390 /// Sets the value of [name][crate::model::AuthorizedView::name].
14391 ///
14392 /// # Example
14393 /// ```ignore,no_run
14394 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
14395 /// # let project_id = "project_id";
14396 /// # let instance_id = "instance_id";
14397 /// # let table_id = "table_id";
14398 /// # let authorized_view_id = "authorized_view_id";
14399 /// let x = AuthorizedView::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/authorizedViews/{authorized_view_id}"));
14400 /// ```
14401 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14402 self.name = v.into();
14403 self
14404 }
14405
14406 /// Sets the value of [etag][crate::model::AuthorizedView::etag].
14407 ///
14408 /// # Example
14409 /// ```ignore,no_run
14410 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
14411 /// let x = AuthorizedView::new().set_etag("example");
14412 /// ```
14413 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14414 self.etag = v.into();
14415 self
14416 }
14417
14418 /// Sets the value of [deletion_protection][crate::model::AuthorizedView::deletion_protection].
14419 ///
14420 /// # Example
14421 /// ```ignore,no_run
14422 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
14423 /// let x = AuthorizedView::new().set_deletion_protection(true);
14424 /// ```
14425 pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14426 self.deletion_protection = v.into();
14427 self
14428 }
14429
14430 /// Sets the value of [authorized_view][crate::model::AuthorizedView::authorized_view].
14431 ///
14432 /// Note that all the setters affecting `authorized_view` are mutually
14433 /// exclusive.
14434 ///
14435 /// # Example
14436 /// ```ignore,no_run
14437 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
14438 /// use google_cloud_bigtable_admin_v2::model::authorized_view::SubsetView;
14439 /// let x = AuthorizedView::new().set_authorized_view(Some(
14440 /// google_cloud_bigtable_admin_v2::model::authorized_view::AuthorizedView::SubsetView(SubsetView::default().into())));
14441 /// ```
14442 pub fn set_authorized_view<
14443 T: std::convert::Into<std::option::Option<crate::model::authorized_view::AuthorizedView>>,
14444 >(
14445 mut self,
14446 v: T,
14447 ) -> Self {
14448 self.authorized_view = v.into();
14449 self
14450 }
14451
14452 /// The value of [authorized_view][crate::model::AuthorizedView::authorized_view]
14453 /// if it holds a `SubsetView`, `None` if the field is not set or
14454 /// holds a different branch.
14455 pub fn subset_view(
14456 &self,
14457 ) -> std::option::Option<&std::boxed::Box<crate::model::authorized_view::SubsetView>> {
14458 #[allow(unreachable_patterns)]
14459 self.authorized_view.as_ref().and_then(|v| match v {
14460 crate::model::authorized_view::AuthorizedView::SubsetView(v) => {
14461 std::option::Option::Some(v)
14462 }
14463 _ => std::option::Option::None,
14464 })
14465 }
14466
14467 /// Sets the value of [authorized_view][crate::model::AuthorizedView::authorized_view]
14468 /// to hold a `SubsetView`.
14469 ///
14470 /// Note that all the setters affecting `authorized_view` are
14471 /// mutually exclusive.
14472 ///
14473 /// # Example
14474 /// ```ignore,no_run
14475 /// # use google_cloud_bigtable_admin_v2::model::AuthorizedView;
14476 /// use google_cloud_bigtable_admin_v2::model::authorized_view::SubsetView;
14477 /// let x = AuthorizedView::new().set_subset_view(SubsetView::default()/* use setters */);
14478 /// assert!(x.subset_view().is_some());
14479 /// ```
14480 pub fn set_subset_view<
14481 T: std::convert::Into<std::boxed::Box<crate::model::authorized_view::SubsetView>>,
14482 >(
14483 mut self,
14484 v: T,
14485 ) -> Self {
14486 self.authorized_view = std::option::Option::Some(
14487 crate::model::authorized_view::AuthorizedView::SubsetView(v.into()),
14488 );
14489 self
14490 }
14491}
14492
14493impl wkt::message::Message for AuthorizedView {
14494 fn typename() -> &'static str {
14495 "type.googleapis.com/google.bigtable.admin.v2.AuthorizedView"
14496 }
14497}
14498
14499/// Defines additional types related to [AuthorizedView].
14500pub mod authorized_view {
14501 #[allow(unused_imports)]
14502 use super::*;
14503
14504 /// Subsets of a column family that are included in this AuthorizedView.
14505 #[derive(Clone, Default, PartialEq)]
14506 #[non_exhaustive]
14507 pub struct FamilySubsets {
14508 /// Individual exact column qualifiers to be included in the AuthorizedView.
14509 pub qualifiers: std::vec::Vec<::bytes::Bytes>,
14510
14511 /// Prefixes for qualifiers to be included in the AuthorizedView. Every
14512 /// qualifier starting with one of these prefixes is included in the
14513 /// AuthorizedView. To provide access to all qualifiers, include the empty
14514 /// string as a prefix
14515 /// ("").
14516 pub qualifier_prefixes: std::vec::Vec<::bytes::Bytes>,
14517
14518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14519 }
14520
14521 impl FamilySubsets {
14522 /// Creates a new default instance.
14523 pub fn new() -> Self {
14524 std::default::Default::default()
14525 }
14526
14527 /// Sets the value of [qualifiers][crate::model::authorized_view::FamilySubsets::qualifiers].
14528 ///
14529 /// # Example
14530 /// ```ignore,no_run
14531 /// # use google_cloud_bigtable_admin_v2::model::authorized_view::FamilySubsets;
14532 /// let b1 = bytes::Bytes::from_static(b"abc");
14533 /// let b2 = bytes::Bytes::from_static(b"xyz");
14534 /// let x = FamilySubsets::new().set_qualifiers([b1, b2]);
14535 /// ```
14536 pub fn set_qualifiers<T, V>(mut self, v: T) -> Self
14537 where
14538 T: std::iter::IntoIterator<Item = V>,
14539 V: std::convert::Into<::bytes::Bytes>,
14540 {
14541 use std::iter::Iterator;
14542 self.qualifiers = v.into_iter().map(|i| i.into()).collect();
14543 self
14544 }
14545
14546 /// Sets the value of [qualifier_prefixes][crate::model::authorized_view::FamilySubsets::qualifier_prefixes].
14547 ///
14548 /// # Example
14549 /// ```ignore,no_run
14550 /// # use google_cloud_bigtable_admin_v2::model::authorized_view::FamilySubsets;
14551 /// let b1 = bytes::Bytes::from_static(b"abc");
14552 /// let b2 = bytes::Bytes::from_static(b"xyz");
14553 /// let x = FamilySubsets::new().set_qualifier_prefixes([b1, b2]);
14554 /// ```
14555 pub fn set_qualifier_prefixes<T, V>(mut self, v: T) -> Self
14556 where
14557 T: std::iter::IntoIterator<Item = V>,
14558 V: std::convert::Into<::bytes::Bytes>,
14559 {
14560 use std::iter::Iterator;
14561 self.qualifier_prefixes = v.into_iter().map(|i| i.into()).collect();
14562 self
14563 }
14564 }
14565
14566 impl wkt::message::Message for FamilySubsets {
14567 fn typename() -> &'static str {
14568 "type.googleapis.com/google.bigtable.admin.v2.AuthorizedView.FamilySubsets"
14569 }
14570 }
14571
14572 /// Defines a simple AuthorizedView that is a subset of the underlying Table.
14573 #[derive(Clone, Default, PartialEq)]
14574 #[non_exhaustive]
14575 pub struct SubsetView {
14576 /// Row prefixes to be included in the AuthorizedView.
14577 /// To provide access to all rows, include the empty string as a prefix ("").
14578 pub row_prefixes: std::vec::Vec<::bytes::Bytes>,
14579
14580 /// Map from column family name to the columns in this family to be included
14581 /// in the AuthorizedView.
14582 pub family_subsets: std::collections::HashMap<
14583 std::string::String,
14584 crate::model::authorized_view::FamilySubsets,
14585 >,
14586
14587 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14588 }
14589
14590 impl SubsetView {
14591 /// Creates a new default instance.
14592 pub fn new() -> Self {
14593 std::default::Default::default()
14594 }
14595
14596 /// Sets the value of [row_prefixes][crate::model::authorized_view::SubsetView::row_prefixes].
14597 ///
14598 /// # Example
14599 /// ```ignore,no_run
14600 /// # use google_cloud_bigtable_admin_v2::model::authorized_view::SubsetView;
14601 /// let b1 = bytes::Bytes::from_static(b"abc");
14602 /// let b2 = bytes::Bytes::from_static(b"xyz");
14603 /// let x = SubsetView::new().set_row_prefixes([b1, b2]);
14604 /// ```
14605 pub fn set_row_prefixes<T, V>(mut self, v: T) -> Self
14606 where
14607 T: std::iter::IntoIterator<Item = V>,
14608 V: std::convert::Into<::bytes::Bytes>,
14609 {
14610 use std::iter::Iterator;
14611 self.row_prefixes = v.into_iter().map(|i| i.into()).collect();
14612 self
14613 }
14614
14615 /// Sets the value of [family_subsets][crate::model::authorized_view::SubsetView::family_subsets].
14616 ///
14617 /// # Example
14618 /// ```ignore,no_run
14619 /// # use google_cloud_bigtable_admin_v2::model::authorized_view::SubsetView;
14620 /// use google_cloud_bigtable_admin_v2::model::authorized_view::FamilySubsets;
14621 /// let x = SubsetView::new().set_family_subsets([
14622 /// ("key0", FamilySubsets::default()/* use setters */),
14623 /// ("key1", FamilySubsets::default()/* use (different) setters */),
14624 /// ]);
14625 /// ```
14626 pub fn set_family_subsets<T, K, V>(mut self, v: T) -> Self
14627 where
14628 T: std::iter::IntoIterator<Item = (K, V)>,
14629 K: std::convert::Into<std::string::String>,
14630 V: std::convert::Into<crate::model::authorized_view::FamilySubsets>,
14631 {
14632 use std::iter::Iterator;
14633 self.family_subsets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14634 self
14635 }
14636 }
14637
14638 impl wkt::message::Message for SubsetView {
14639 fn typename() -> &'static str {
14640 "type.googleapis.com/google.bigtable.admin.v2.AuthorizedView.SubsetView"
14641 }
14642 }
14643
14644 /// Defines a subset of an AuthorizedView's fields.
14645 ///
14646 /// # Working with unknown values
14647 ///
14648 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14649 /// additional enum variants at any time. Adding new variants is not considered
14650 /// a breaking change. Applications should write their code in anticipation of:
14651 ///
14652 /// - New values appearing in future releases of the client library, **and**
14653 /// - New values received dynamically, without application changes.
14654 ///
14655 /// Please consult the [Working with enums] section in the user guide for some
14656 /// guidelines.
14657 ///
14658 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14659 #[derive(Clone, Debug, PartialEq)]
14660 #[non_exhaustive]
14661 pub enum ResponseView {
14662 /// Uses the default view for each method as documented in the request.
14663 Unspecified,
14664 /// Only populates `name`.
14665 NameOnly,
14666 /// Only populates the AuthorizedView's basic metadata. This includes:
14667 /// name, deletion_protection, etag.
14668 Basic,
14669 /// Populates every fields.
14670 Full,
14671 /// If set, the enum was initialized with an unknown value.
14672 ///
14673 /// Applications can examine the value using [ResponseView::value] or
14674 /// [ResponseView::name].
14675 UnknownValue(response_view::UnknownValue),
14676 }
14677
14678 #[doc(hidden)]
14679 pub mod response_view {
14680 #[allow(unused_imports)]
14681 use super::*;
14682 #[derive(Clone, Debug, PartialEq)]
14683 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14684 }
14685
14686 impl ResponseView {
14687 /// Gets the enum value.
14688 ///
14689 /// Returns `None` if the enum contains an unknown value deserialized from
14690 /// the string representation of enums.
14691 pub fn value(&self) -> std::option::Option<i32> {
14692 match self {
14693 Self::Unspecified => std::option::Option::Some(0),
14694 Self::NameOnly => std::option::Option::Some(1),
14695 Self::Basic => std::option::Option::Some(2),
14696 Self::Full => std::option::Option::Some(3),
14697 Self::UnknownValue(u) => u.0.value(),
14698 }
14699 }
14700
14701 /// Gets the enum value as a string.
14702 ///
14703 /// Returns `None` if the enum contains an unknown value deserialized from
14704 /// the integer representation of enums.
14705 pub fn name(&self) -> std::option::Option<&str> {
14706 match self {
14707 Self::Unspecified => std::option::Option::Some("RESPONSE_VIEW_UNSPECIFIED"),
14708 Self::NameOnly => std::option::Option::Some("NAME_ONLY"),
14709 Self::Basic => std::option::Option::Some("BASIC"),
14710 Self::Full => std::option::Option::Some("FULL"),
14711 Self::UnknownValue(u) => u.0.name(),
14712 }
14713 }
14714 }
14715
14716 impl std::default::Default for ResponseView {
14717 fn default() -> Self {
14718 use std::convert::From;
14719 Self::from(0)
14720 }
14721 }
14722
14723 impl std::fmt::Display for ResponseView {
14724 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14725 wkt::internal::display_enum(f, self.name(), self.value())
14726 }
14727 }
14728
14729 impl std::convert::From<i32> for ResponseView {
14730 fn from(value: i32) -> Self {
14731 match value {
14732 0 => Self::Unspecified,
14733 1 => Self::NameOnly,
14734 2 => Self::Basic,
14735 3 => Self::Full,
14736 _ => Self::UnknownValue(response_view::UnknownValue(
14737 wkt::internal::UnknownEnumValue::Integer(value),
14738 )),
14739 }
14740 }
14741 }
14742
14743 impl std::convert::From<&str> for ResponseView {
14744 fn from(value: &str) -> Self {
14745 use std::string::ToString;
14746 match value {
14747 "RESPONSE_VIEW_UNSPECIFIED" => Self::Unspecified,
14748 "NAME_ONLY" => Self::NameOnly,
14749 "BASIC" => Self::Basic,
14750 "FULL" => Self::Full,
14751 _ => Self::UnknownValue(response_view::UnknownValue(
14752 wkt::internal::UnknownEnumValue::String(value.to_string()),
14753 )),
14754 }
14755 }
14756 }
14757
14758 impl serde::ser::Serialize for ResponseView {
14759 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14760 where
14761 S: serde::Serializer,
14762 {
14763 match self {
14764 Self::Unspecified => serializer.serialize_i32(0),
14765 Self::NameOnly => serializer.serialize_i32(1),
14766 Self::Basic => serializer.serialize_i32(2),
14767 Self::Full => serializer.serialize_i32(3),
14768 Self::UnknownValue(u) => u.0.serialize(serializer),
14769 }
14770 }
14771 }
14772
14773 impl<'de> serde::de::Deserialize<'de> for ResponseView {
14774 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14775 where
14776 D: serde::Deserializer<'de>,
14777 {
14778 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResponseView>::new(
14779 ".google.bigtable.admin.v2.AuthorizedView.ResponseView",
14780 ))
14781 }
14782 }
14783
14784 /// The type of this AuthorizedView.
14785 #[derive(Clone, Debug, PartialEq)]
14786 #[non_exhaustive]
14787 pub enum AuthorizedView {
14788 /// An AuthorizedView permitting access to an explicit subset of a Table.
14789 SubsetView(std::boxed::Box<crate::model::authorized_view::SubsetView>),
14790 }
14791}
14792
14793/// A set of columns within a table which share a common configuration.
14794#[derive(Clone, Default, PartialEq)]
14795#[non_exhaustive]
14796pub struct ColumnFamily {
14797 /// Garbage collection rule specified as a protobuf.
14798 /// Must serialize to at most 500 bytes.
14799 ///
14800 /// NOTE: Garbage collection executes opportunistically in the background, and
14801 /// so it's possible for reads to return a cell even if it matches the active
14802 /// GC expression for its family.
14803 pub gc_rule: std::option::Option<crate::model::GcRule>,
14804
14805 /// The type of data stored in each of this family's cell values, including its
14806 /// full encoding. If omitted, the family only serves raw untyped bytes.
14807 ///
14808 /// For now, only the `Aggregate` type is supported.
14809 ///
14810 /// `Aggregate` can only be set at family creation and is immutable afterwards.
14811 ///
14812 /// If `value_type` is `Aggregate`, written data must be compatible with:
14813 ///
14814 /// * `value_type.input_type` for `AddInput` mutations
14815 pub value_type: std::option::Option<crate::model::Type>,
14816
14817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14818}
14819
14820impl ColumnFamily {
14821 /// Creates a new default instance.
14822 pub fn new() -> Self {
14823 std::default::Default::default()
14824 }
14825
14826 /// Sets the value of [gc_rule][crate::model::ColumnFamily::gc_rule].
14827 ///
14828 /// # Example
14829 /// ```ignore,no_run
14830 /// # use google_cloud_bigtable_admin_v2::model::ColumnFamily;
14831 /// use google_cloud_bigtable_admin_v2::model::GcRule;
14832 /// let x = ColumnFamily::new().set_gc_rule(GcRule::default()/* use setters */);
14833 /// ```
14834 pub fn set_gc_rule<T>(mut self, v: T) -> Self
14835 where
14836 T: std::convert::Into<crate::model::GcRule>,
14837 {
14838 self.gc_rule = std::option::Option::Some(v.into());
14839 self
14840 }
14841
14842 /// Sets or clears the value of [gc_rule][crate::model::ColumnFamily::gc_rule].
14843 ///
14844 /// # Example
14845 /// ```ignore,no_run
14846 /// # use google_cloud_bigtable_admin_v2::model::ColumnFamily;
14847 /// use google_cloud_bigtable_admin_v2::model::GcRule;
14848 /// let x = ColumnFamily::new().set_or_clear_gc_rule(Some(GcRule::default()/* use setters */));
14849 /// let x = ColumnFamily::new().set_or_clear_gc_rule(None::<GcRule>);
14850 /// ```
14851 pub fn set_or_clear_gc_rule<T>(mut self, v: std::option::Option<T>) -> Self
14852 where
14853 T: std::convert::Into<crate::model::GcRule>,
14854 {
14855 self.gc_rule = v.map(|x| x.into());
14856 self
14857 }
14858
14859 /// Sets the value of [value_type][crate::model::ColumnFamily::value_type].
14860 ///
14861 /// # Example
14862 /// ```ignore,no_run
14863 /// # use google_cloud_bigtable_admin_v2::model::ColumnFamily;
14864 /// use google_cloud_bigtable_admin_v2::model::Type;
14865 /// let x = ColumnFamily::new().set_value_type(Type::default()/* use setters */);
14866 /// ```
14867 pub fn set_value_type<T>(mut self, v: T) -> Self
14868 where
14869 T: std::convert::Into<crate::model::Type>,
14870 {
14871 self.value_type = std::option::Option::Some(v.into());
14872 self
14873 }
14874
14875 /// Sets or clears the value of [value_type][crate::model::ColumnFamily::value_type].
14876 ///
14877 /// # Example
14878 /// ```ignore,no_run
14879 /// # use google_cloud_bigtable_admin_v2::model::ColumnFamily;
14880 /// use google_cloud_bigtable_admin_v2::model::Type;
14881 /// let x = ColumnFamily::new().set_or_clear_value_type(Some(Type::default()/* use setters */));
14882 /// let x = ColumnFamily::new().set_or_clear_value_type(None::<Type>);
14883 /// ```
14884 pub fn set_or_clear_value_type<T>(mut self, v: std::option::Option<T>) -> Self
14885 where
14886 T: std::convert::Into<crate::model::Type>,
14887 {
14888 self.value_type = v.map(|x| x.into());
14889 self
14890 }
14891}
14892
14893impl wkt::message::Message for ColumnFamily {
14894 fn typename() -> &'static str {
14895 "type.googleapis.com/google.bigtable.admin.v2.ColumnFamily"
14896 }
14897}
14898
14899/// Rule for determining which cells to delete during garbage collection.
14900#[derive(Clone, Default, PartialEq)]
14901#[non_exhaustive]
14902pub struct GcRule {
14903 /// Garbage collection rules.
14904 pub rule: std::option::Option<crate::model::gc_rule::Rule>,
14905
14906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14907}
14908
14909impl GcRule {
14910 /// Creates a new default instance.
14911 pub fn new() -> Self {
14912 std::default::Default::default()
14913 }
14914
14915 /// Sets the value of [rule][crate::model::GcRule::rule].
14916 ///
14917 /// Note that all the setters affecting `rule` are mutually
14918 /// exclusive.
14919 ///
14920 /// # Example
14921 /// ```ignore,no_run
14922 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
14923 /// use google_cloud_bigtable_admin_v2::model::gc_rule::Rule;
14924 /// let x = GcRule::new().set_rule(Some(Rule::MaxNumVersions(42)));
14925 /// ```
14926 pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::gc_rule::Rule>>>(
14927 mut self,
14928 v: T,
14929 ) -> Self {
14930 self.rule = v.into();
14931 self
14932 }
14933
14934 /// The value of [rule][crate::model::GcRule::rule]
14935 /// if it holds a `MaxNumVersions`, `None` if the field is not set or
14936 /// holds a different branch.
14937 pub fn max_num_versions(&self) -> std::option::Option<&i32> {
14938 #[allow(unreachable_patterns)]
14939 self.rule.as_ref().and_then(|v| match v {
14940 crate::model::gc_rule::Rule::MaxNumVersions(v) => std::option::Option::Some(v),
14941 _ => std::option::Option::None,
14942 })
14943 }
14944
14945 /// Sets the value of [rule][crate::model::GcRule::rule]
14946 /// to hold a `MaxNumVersions`.
14947 ///
14948 /// Note that all the setters affecting `rule` are
14949 /// mutually exclusive.
14950 ///
14951 /// # Example
14952 /// ```ignore,no_run
14953 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
14954 /// let x = GcRule::new().set_max_num_versions(42);
14955 /// assert!(x.max_num_versions().is_some());
14956 /// assert!(x.max_age().is_none());
14957 /// assert!(x.intersection().is_none());
14958 /// assert!(x.union().is_none());
14959 /// ```
14960 pub fn set_max_num_versions<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14961 self.rule =
14962 std::option::Option::Some(crate::model::gc_rule::Rule::MaxNumVersions(v.into()));
14963 self
14964 }
14965
14966 /// The value of [rule][crate::model::GcRule::rule]
14967 /// if it holds a `MaxAge`, `None` if the field is not set or
14968 /// holds a different branch.
14969 pub fn max_age(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
14970 #[allow(unreachable_patterns)]
14971 self.rule.as_ref().and_then(|v| match v {
14972 crate::model::gc_rule::Rule::MaxAge(v) => std::option::Option::Some(v),
14973 _ => std::option::Option::None,
14974 })
14975 }
14976
14977 /// Sets the value of [rule][crate::model::GcRule::rule]
14978 /// to hold a `MaxAge`.
14979 ///
14980 /// Note that all the setters affecting `rule` are
14981 /// mutually exclusive.
14982 ///
14983 /// # Example
14984 /// ```ignore,no_run
14985 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
14986 /// use wkt::Duration;
14987 /// let x = GcRule::new().set_max_age(Duration::default()/* use setters */);
14988 /// assert!(x.max_age().is_some());
14989 /// assert!(x.max_num_versions().is_none());
14990 /// assert!(x.intersection().is_none());
14991 /// assert!(x.union().is_none());
14992 /// ```
14993 pub fn set_max_age<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
14994 mut self,
14995 v: T,
14996 ) -> Self {
14997 self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::MaxAge(v.into()));
14998 self
14999 }
15000
15001 /// The value of [rule][crate::model::GcRule::rule]
15002 /// if it holds a `Intersection`, `None` if the field is not set or
15003 /// holds a different branch.
15004 pub fn intersection(
15005 &self,
15006 ) -> std::option::Option<&std::boxed::Box<crate::model::gc_rule::Intersection>> {
15007 #[allow(unreachable_patterns)]
15008 self.rule.as_ref().and_then(|v| match v {
15009 crate::model::gc_rule::Rule::Intersection(v) => std::option::Option::Some(v),
15010 _ => std::option::Option::None,
15011 })
15012 }
15013
15014 /// Sets the value of [rule][crate::model::GcRule::rule]
15015 /// to hold a `Intersection`.
15016 ///
15017 /// Note that all the setters affecting `rule` are
15018 /// mutually exclusive.
15019 ///
15020 /// # Example
15021 /// ```ignore,no_run
15022 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
15023 /// use google_cloud_bigtable_admin_v2::model::gc_rule::Intersection;
15024 /// let x = GcRule::new().set_intersection(Intersection::default()/* use setters */);
15025 /// assert!(x.intersection().is_some());
15026 /// assert!(x.max_num_versions().is_none());
15027 /// assert!(x.max_age().is_none());
15028 /// assert!(x.union().is_none());
15029 /// ```
15030 pub fn set_intersection<
15031 T: std::convert::Into<std::boxed::Box<crate::model::gc_rule::Intersection>>,
15032 >(
15033 mut self,
15034 v: T,
15035 ) -> Self {
15036 self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::Intersection(v.into()));
15037 self
15038 }
15039
15040 /// The value of [rule][crate::model::GcRule::rule]
15041 /// if it holds a `Union`, `None` if the field is not set or
15042 /// holds a different branch.
15043 pub fn union(&self) -> std::option::Option<&std::boxed::Box<crate::model::gc_rule::Union>> {
15044 #[allow(unreachable_patterns)]
15045 self.rule.as_ref().and_then(|v| match v {
15046 crate::model::gc_rule::Rule::Union(v) => std::option::Option::Some(v),
15047 _ => std::option::Option::None,
15048 })
15049 }
15050
15051 /// Sets the value of [rule][crate::model::GcRule::rule]
15052 /// to hold a `Union`.
15053 ///
15054 /// Note that all the setters affecting `rule` are
15055 /// mutually exclusive.
15056 ///
15057 /// # Example
15058 /// ```ignore,no_run
15059 /// # use google_cloud_bigtable_admin_v2::model::GcRule;
15060 /// use google_cloud_bigtable_admin_v2::model::gc_rule::Union;
15061 /// let x = GcRule::new().set_union(Union::default()/* use setters */);
15062 /// assert!(x.union().is_some());
15063 /// assert!(x.max_num_versions().is_none());
15064 /// assert!(x.max_age().is_none());
15065 /// assert!(x.intersection().is_none());
15066 /// ```
15067 pub fn set_union<T: std::convert::Into<std::boxed::Box<crate::model::gc_rule::Union>>>(
15068 mut self,
15069 v: T,
15070 ) -> Self {
15071 self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::Union(v.into()));
15072 self
15073 }
15074}
15075
15076impl wkt::message::Message for GcRule {
15077 fn typename() -> &'static str {
15078 "type.googleapis.com/google.bigtable.admin.v2.GcRule"
15079 }
15080}
15081
15082/// Defines additional types related to [GcRule].
15083pub mod gc_rule {
15084 #[allow(unused_imports)]
15085 use super::*;
15086
15087 /// A GcRule which deletes cells matching all of the given rules.
15088 #[derive(Clone, Default, PartialEq)]
15089 #[non_exhaustive]
15090 pub struct Intersection {
15091 /// Only delete cells which would be deleted by every element of `rules`.
15092 pub rules: std::vec::Vec<crate::model::GcRule>,
15093
15094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15095 }
15096
15097 impl Intersection {
15098 /// Creates a new default instance.
15099 pub fn new() -> Self {
15100 std::default::Default::default()
15101 }
15102
15103 /// Sets the value of [rules][crate::model::gc_rule::Intersection::rules].
15104 ///
15105 /// # Example
15106 /// ```ignore,no_run
15107 /// # use google_cloud_bigtable_admin_v2::model::gc_rule::Intersection;
15108 /// use google_cloud_bigtable_admin_v2::model::GcRule;
15109 /// let x = Intersection::new()
15110 /// .set_rules([
15111 /// GcRule::default()/* use setters */,
15112 /// GcRule::default()/* use (different) setters */,
15113 /// ]);
15114 /// ```
15115 pub fn set_rules<T, V>(mut self, v: T) -> Self
15116 where
15117 T: std::iter::IntoIterator<Item = V>,
15118 V: std::convert::Into<crate::model::GcRule>,
15119 {
15120 use std::iter::Iterator;
15121 self.rules = v.into_iter().map(|i| i.into()).collect();
15122 self
15123 }
15124 }
15125
15126 impl wkt::message::Message for Intersection {
15127 fn typename() -> &'static str {
15128 "type.googleapis.com/google.bigtable.admin.v2.GcRule.Intersection"
15129 }
15130 }
15131
15132 /// A GcRule which deletes cells matching any of the given rules.
15133 #[derive(Clone, Default, PartialEq)]
15134 #[non_exhaustive]
15135 pub struct Union {
15136 /// Delete cells which would be deleted by any element of `rules`.
15137 pub rules: std::vec::Vec<crate::model::GcRule>,
15138
15139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15140 }
15141
15142 impl Union {
15143 /// Creates a new default instance.
15144 pub fn new() -> Self {
15145 std::default::Default::default()
15146 }
15147
15148 /// Sets the value of [rules][crate::model::gc_rule::Union::rules].
15149 ///
15150 /// # Example
15151 /// ```ignore,no_run
15152 /// # use google_cloud_bigtable_admin_v2::model::gc_rule::Union;
15153 /// use google_cloud_bigtable_admin_v2::model::GcRule;
15154 /// let x = Union::new()
15155 /// .set_rules([
15156 /// GcRule::default()/* use setters */,
15157 /// GcRule::default()/* use (different) setters */,
15158 /// ]);
15159 /// ```
15160 pub fn set_rules<T, V>(mut self, v: T) -> Self
15161 where
15162 T: std::iter::IntoIterator<Item = V>,
15163 V: std::convert::Into<crate::model::GcRule>,
15164 {
15165 use std::iter::Iterator;
15166 self.rules = v.into_iter().map(|i| i.into()).collect();
15167 self
15168 }
15169 }
15170
15171 impl wkt::message::Message for Union {
15172 fn typename() -> &'static str {
15173 "type.googleapis.com/google.bigtable.admin.v2.GcRule.Union"
15174 }
15175 }
15176
15177 /// Garbage collection rules.
15178 #[derive(Clone, Debug, PartialEq)]
15179 #[non_exhaustive]
15180 pub enum Rule {
15181 /// Delete all cells in a column except the most recent N.
15182 MaxNumVersions(i32),
15183 /// Delete cells in a column older than the given age.
15184 /// Values must be at least one millisecond, and will be truncated to
15185 /// microsecond granularity.
15186 MaxAge(std::boxed::Box<wkt::Duration>),
15187 /// Delete cells that would be deleted by every nested rule.
15188 Intersection(std::boxed::Box<crate::model::gc_rule::Intersection>),
15189 /// Delete cells that would be deleted by any nested rule.
15190 Union(std::boxed::Box<crate::model::gc_rule::Union>),
15191 }
15192}
15193
15194/// Encryption information for a given resource.
15195/// If this resource is protected with customer managed encryption, the in-use
15196/// Cloud Key Management Service (Cloud KMS) key version is specified along with
15197/// its status.
15198#[derive(Clone, Default, PartialEq)]
15199#[non_exhaustive]
15200pub struct EncryptionInfo {
15201 /// Output only. The type of encryption used to protect this resource.
15202 pub encryption_type: crate::model::encryption_info::EncryptionType,
15203
15204 /// Output only. The status of encrypt/decrypt calls on underlying data for
15205 /// this resource. Regardless of status, the existing data is always encrypted
15206 /// at rest.
15207 pub encryption_status: std::option::Option<google_cloud_rpc::model::Status>,
15208
15209 /// Output only. The version of the Cloud KMS key specified in the parent
15210 /// cluster that is in use for the data underlying this table.
15211 pub kms_key_version: std::string::String,
15212
15213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15214}
15215
15216impl EncryptionInfo {
15217 /// Creates a new default instance.
15218 pub fn new() -> Self {
15219 std::default::Default::default()
15220 }
15221
15222 /// Sets the value of [encryption_type][crate::model::EncryptionInfo::encryption_type].
15223 ///
15224 /// # Example
15225 /// ```ignore,no_run
15226 /// # use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
15227 /// use google_cloud_bigtable_admin_v2::model::encryption_info::EncryptionType;
15228 /// let x0 = EncryptionInfo::new().set_encryption_type(EncryptionType::GoogleDefaultEncryption);
15229 /// let x1 = EncryptionInfo::new().set_encryption_type(EncryptionType::CustomerManagedEncryption);
15230 /// ```
15231 pub fn set_encryption_type<
15232 T: std::convert::Into<crate::model::encryption_info::EncryptionType>,
15233 >(
15234 mut self,
15235 v: T,
15236 ) -> Self {
15237 self.encryption_type = v.into();
15238 self
15239 }
15240
15241 /// Sets the value of [encryption_status][crate::model::EncryptionInfo::encryption_status].
15242 ///
15243 /// # Example
15244 /// ```ignore,no_run
15245 /// # use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
15246 /// use google_cloud_rpc::model::Status;
15247 /// let x = EncryptionInfo::new().set_encryption_status(Status::default()/* use setters */);
15248 /// ```
15249 pub fn set_encryption_status<T>(mut self, v: T) -> Self
15250 where
15251 T: std::convert::Into<google_cloud_rpc::model::Status>,
15252 {
15253 self.encryption_status = std::option::Option::Some(v.into());
15254 self
15255 }
15256
15257 /// Sets or clears the value of [encryption_status][crate::model::EncryptionInfo::encryption_status].
15258 ///
15259 /// # Example
15260 /// ```ignore,no_run
15261 /// # use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
15262 /// use google_cloud_rpc::model::Status;
15263 /// let x = EncryptionInfo::new().set_or_clear_encryption_status(Some(Status::default()/* use setters */));
15264 /// let x = EncryptionInfo::new().set_or_clear_encryption_status(None::<Status>);
15265 /// ```
15266 pub fn set_or_clear_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
15267 where
15268 T: std::convert::Into<google_cloud_rpc::model::Status>,
15269 {
15270 self.encryption_status = v.map(|x| x.into());
15271 self
15272 }
15273
15274 /// Sets the value of [kms_key_version][crate::model::EncryptionInfo::kms_key_version].
15275 ///
15276 /// # Example
15277 /// ```ignore,no_run
15278 /// # use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
15279 /// let x = EncryptionInfo::new().set_kms_key_version("example");
15280 /// ```
15281 pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15282 self.kms_key_version = v.into();
15283 self
15284 }
15285}
15286
15287impl wkt::message::Message for EncryptionInfo {
15288 fn typename() -> &'static str {
15289 "type.googleapis.com/google.bigtable.admin.v2.EncryptionInfo"
15290 }
15291}
15292
15293/// Defines additional types related to [EncryptionInfo].
15294pub mod encryption_info {
15295 #[allow(unused_imports)]
15296 use super::*;
15297
15298 /// Possible encryption types for a resource.
15299 ///
15300 /// # Working with unknown values
15301 ///
15302 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15303 /// additional enum variants at any time. Adding new variants is not considered
15304 /// a breaking change. Applications should write their code in anticipation of:
15305 ///
15306 /// - New values appearing in future releases of the client library, **and**
15307 /// - New values received dynamically, without application changes.
15308 ///
15309 /// Please consult the [Working with enums] section in the user guide for some
15310 /// guidelines.
15311 ///
15312 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15313 #[derive(Clone, Debug, PartialEq)]
15314 #[non_exhaustive]
15315 pub enum EncryptionType {
15316 /// Encryption type was not specified, though data at rest remains encrypted.
15317 Unspecified,
15318 /// The data backing this resource is encrypted at rest with a key that is
15319 /// fully managed by Google. No key version or status will be populated.
15320 /// This is the default state.
15321 GoogleDefaultEncryption,
15322 /// The data backing this resource is encrypted at rest with a key that is
15323 /// managed by the customer.
15324 /// The in-use version of the key and its status are populated for
15325 /// CMEK-protected tables.
15326 /// CMEK-protected backups are pinned to the key version that was in use at
15327 /// the time the backup was taken. This key version is populated but its
15328 /// status is not tracked and is reported as `UNKNOWN`.
15329 CustomerManagedEncryption,
15330 /// If set, the enum was initialized with an unknown value.
15331 ///
15332 /// Applications can examine the value using [EncryptionType::value] or
15333 /// [EncryptionType::name].
15334 UnknownValue(encryption_type::UnknownValue),
15335 }
15336
15337 #[doc(hidden)]
15338 pub mod encryption_type {
15339 #[allow(unused_imports)]
15340 use super::*;
15341 #[derive(Clone, Debug, PartialEq)]
15342 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15343 }
15344
15345 impl EncryptionType {
15346 /// Gets the enum value.
15347 ///
15348 /// Returns `None` if the enum contains an unknown value deserialized from
15349 /// the string representation of enums.
15350 pub fn value(&self) -> std::option::Option<i32> {
15351 match self {
15352 Self::Unspecified => std::option::Option::Some(0),
15353 Self::GoogleDefaultEncryption => std::option::Option::Some(1),
15354 Self::CustomerManagedEncryption => std::option::Option::Some(2),
15355 Self::UnknownValue(u) => u.0.value(),
15356 }
15357 }
15358
15359 /// Gets the enum value as a string.
15360 ///
15361 /// Returns `None` if the enum contains an unknown value deserialized from
15362 /// the integer representation of enums.
15363 pub fn name(&self) -> std::option::Option<&str> {
15364 match self {
15365 Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
15366 Self::GoogleDefaultEncryption => {
15367 std::option::Option::Some("GOOGLE_DEFAULT_ENCRYPTION")
15368 }
15369 Self::CustomerManagedEncryption => {
15370 std::option::Option::Some("CUSTOMER_MANAGED_ENCRYPTION")
15371 }
15372 Self::UnknownValue(u) => u.0.name(),
15373 }
15374 }
15375 }
15376
15377 impl std::default::Default for EncryptionType {
15378 fn default() -> Self {
15379 use std::convert::From;
15380 Self::from(0)
15381 }
15382 }
15383
15384 impl std::fmt::Display for EncryptionType {
15385 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15386 wkt::internal::display_enum(f, self.name(), self.value())
15387 }
15388 }
15389
15390 impl std::convert::From<i32> for EncryptionType {
15391 fn from(value: i32) -> Self {
15392 match value {
15393 0 => Self::Unspecified,
15394 1 => Self::GoogleDefaultEncryption,
15395 2 => Self::CustomerManagedEncryption,
15396 _ => Self::UnknownValue(encryption_type::UnknownValue(
15397 wkt::internal::UnknownEnumValue::Integer(value),
15398 )),
15399 }
15400 }
15401 }
15402
15403 impl std::convert::From<&str> for EncryptionType {
15404 fn from(value: &str) -> Self {
15405 use std::string::ToString;
15406 match value {
15407 "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
15408 "GOOGLE_DEFAULT_ENCRYPTION" => Self::GoogleDefaultEncryption,
15409 "CUSTOMER_MANAGED_ENCRYPTION" => Self::CustomerManagedEncryption,
15410 _ => Self::UnknownValue(encryption_type::UnknownValue(
15411 wkt::internal::UnknownEnumValue::String(value.to_string()),
15412 )),
15413 }
15414 }
15415 }
15416
15417 impl serde::ser::Serialize for EncryptionType {
15418 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15419 where
15420 S: serde::Serializer,
15421 {
15422 match self {
15423 Self::Unspecified => serializer.serialize_i32(0),
15424 Self::GoogleDefaultEncryption => serializer.serialize_i32(1),
15425 Self::CustomerManagedEncryption => serializer.serialize_i32(2),
15426 Self::UnknownValue(u) => u.0.serialize(serializer),
15427 }
15428 }
15429 }
15430
15431 impl<'de> serde::de::Deserialize<'de> for EncryptionType {
15432 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15433 where
15434 D: serde::Deserializer<'de>,
15435 {
15436 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
15437 ".google.bigtable.admin.v2.EncryptionInfo.EncryptionType",
15438 ))
15439 }
15440 }
15441}
15442
15443/// A snapshot of a table at a particular time. A snapshot can be used as a
15444/// checkpoint for data restoration or a data source for a new table.
15445///
15446/// Note: This is a private alpha release of Cloud Bigtable snapshots. This
15447/// feature is not currently available to most Cloud Bigtable customers. This
15448/// feature might be changed in backward-incompatible ways and is not recommended
15449/// for production use. It is not subject to any SLA or deprecation policy.
15450#[derive(Clone, Default, PartialEq)]
15451#[non_exhaustive]
15452pub struct Snapshot {
15453 /// The unique name of the snapshot.
15454 /// Values are of the form
15455 /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
15456 pub name: std::string::String,
15457
15458 /// Output only. The source table at the time the snapshot was taken.
15459 pub source_table: std::option::Option<crate::model::Table>,
15460
15461 /// Output only. The size of the data in the source table at the time the
15462 /// snapshot was taken. In some cases, this value may be computed
15463 /// asynchronously via a background process and a placeholder of 0 will be used
15464 /// in the meantime.
15465 pub data_size_bytes: i64,
15466
15467 /// Output only. The time when the snapshot is created.
15468 pub create_time: std::option::Option<wkt::Timestamp>,
15469
15470 /// The time when the snapshot will be deleted. The maximum amount of time a
15471 /// snapshot can stay active is 365 days. If 'ttl' is not specified,
15472 /// the default maximum of 365 days will be used.
15473 pub delete_time: std::option::Option<wkt::Timestamp>,
15474
15475 /// Output only. The current state of the snapshot.
15476 pub state: crate::model::snapshot::State,
15477
15478 /// Description of the snapshot.
15479 pub description: std::string::String,
15480
15481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15482}
15483
15484impl Snapshot {
15485 /// Creates a new default instance.
15486 pub fn new() -> Self {
15487 std::default::Default::default()
15488 }
15489
15490 /// Sets the value of [name][crate::model::Snapshot::name].
15491 ///
15492 /// # Example
15493 /// ```ignore,no_run
15494 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15495 /// # let project_id = "project_id";
15496 /// # let instance_id = "instance_id";
15497 /// # let cluster_id = "cluster_id";
15498 /// # let snapshot_id = "snapshot_id";
15499 /// let x = Snapshot::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/snapshots/{snapshot_id}"));
15500 /// ```
15501 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15502 self.name = v.into();
15503 self
15504 }
15505
15506 /// Sets the value of [source_table][crate::model::Snapshot::source_table].
15507 ///
15508 /// # Example
15509 /// ```ignore,no_run
15510 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15511 /// use google_cloud_bigtable_admin_v2::model::Table;
15512 /// let x = Snapshot::new().set_source_table(Table::default()/* use setters */);
15513 /// ```
15514 pub fn set_source_table<T>(mut self, v: T) -> Self
15515 where
15516 T: std::convert::Into<crate::model::Table>,
15517 {
15518 self.source_table = std::option::Option::Some(v.into());
15519 self
15520 }
15521
15522 /// Sets or clears the value of [source_table][crate::model::Snapshot::source_table].
15523 ///
15524 /// # Example
15525 /// ```ignore,no_run
15526 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15527 /// use google_cloud_bigtable_admin_v2::model::Table;
15528 /// let x = Snapshot::new().set_or_clear_source_table(Some(Table::default()/* use setters */));
15529 /// let x = Snapshot::new().set_or_clear_source_table(None::<Table>);
15530 /// ```
15531 pub fn set_or_clear_source_table<T>(mut self, v: std::option::Option<T>) -> Self
15532 where
15533 T: std::convert::Into<crate::model::Table>,
15534 {
15535 self.source_table = v.map(|x| x.into());
15536 self
15537 }
15538
15539 /// Sets the value of [data_size_bytes][crate::model::Snapshot::data_size_bytes].
15540 ///
15541 /// # Example
15542 /// ```ignore,no_run
15543 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15544 /// let x = Snapshot::new().set_data_size_bytes(42);
15545 /// ```
15546 pub fn set_data_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15547 self.data_size_bytes = v.into();
15548 self
15549 }
15550
15551 /// Sets the value of [create_time][crate::model::Snapshot::create_time].
15552 ///
15553 /// # Example
15554 /// ```ignore,no_run
15555 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15556 /// use wkt::Timestamp;
15557 /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
15558 /// ```
15559 pub fn set_create_time<T>(mut self, v: T) -> Self
15560 where
15561 T: std::convert::Into<wkt::Timestamp>,
15562 {
15563 self.create_time = std::option::Option::Some(v.into());
15564 self
15565 }
15566
15567 /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
15568 ///
15569 /// # Example
15570 /// ```ignore,no_run
15571 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15572 /// use wkt::Timestamp;
15573 /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15574 /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
15575 /// ```
15576 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15577 where
15578 T: std::convert::Into<wkt::Timestamp>,
15579 {
15580 self.create_time = v.map(|x| x.into());
15581 self
15582 }
15583
15584 /// Sets the value of [delete_time][crate::model::Snapshot::delete_time].
15585 ///
15586 /// # Example
15587 /// ```ignore,no_run
15588 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15589 /// use wkt::Timestamp;
15590 /// let x = Snapshot::new().set_delete_time(Timestamp::default()/* use setters */);
15591 /// ```
15592 pub fn set_delete_time<T>(mut self, v: T) -> Self
15593 where
15594 T: std::convert::Into<wkt::Timestamp>,
15595 {
15596 self.delete_time = std::option::Option::Some(v.into());
15597 self
15598 }
15599
15600 /// Sets or clears the value of [delete_time][crate::model::Snapshot::delete_time].
15601 ///
15602 /// # Example
15603 /// ```ignore,no_run
15604 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15605 /// use wkt::Timestamp;
15606 /// let x = Snapshot::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
15607 /// let x = Snapshot::new().set_or_clear_delete_time(None::<Timestamp>);
15608 /// ```
15609 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
15610 where
15611 T: std::convert::Into<wkt::Timestamp>,
15612 {
15613 self.delete_time = v.map(|x| x.into());
15614 self
15615 }
15616
15617 /// Sets the value of [state][crate::model::Snapshot::state].
15618 ///
15619 /// # Example
15620 /// ```ignore,no_run
15621 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15622 /// use google_cloud_bigtable_admin_v2::model::snapshot::State;
15623 /// let x0 = Snapshot::new().set_state(State::Ready);
15624 /// let x1 = Snapshot::new().set_state(State::Creating);
15625 /// ```
15626 pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
15627 self.state = v.into();
15628 self
15629 }
15630
15631 /// Sets the value of [description][crate::model::Snapshot::description].
15632 ///
15633 /// # Example
15634 /// ```ignore,no_run
15635 /// # use google_cloud_bigtable_admin_v2::model::Snapshot;
15636 /// let x = Snapshot::new().set_description("example");
15637 /// ```
15638 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15639 self.description = v.into();
15640 self
15641 }
15642}
15643
15644impl wkt::message::Message for Snapshot {
15645 fn typename() -> &'static str {
15646 "type.googleapis.com/google.bigtable.admin.v2.Snapshot"
15647 }
15648}
15649
15650/// Defines additional types related to [Snapshot].
15651pub mod snapshot {
15652 #[allow(unused_imports)]
15653 use super::*;
15654
15655 /// Possible states of a snapshot.
15656 ///
15657 /// # Working with unknown values
15658 ///
15659 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15660 /// additional enum variants at any time. Adding new variants is not considered
15661 /// a breaking change. Applications should write their code in anticipation of:
15662 ///
15663 /// - New values appearing in future releases of the client library, **and**
15664 /// - New values received dynamically, without application changes.
15665 ///
15666 /// Please consult the [Working with enums] section in the user guide for some
15667 /// guidelines.
15668 ///
15669 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15670 #[derive(Clone, Debug, PartialEq)]
15671 #[non_exhaustive]
15672 pub enum State {
15673 /// The state of the snapshot could not be determined.
15674 NotKnown,
15675 /// The snapshot has been successfully created and can serve all requests.
15676 Ready,
15677 /// The snapshot is currently being created, and may be destroyed if the
15678 /// creation process encounters an error. A snapshot may not be restored to a
15679 /// table while it is being created.
15680 Creating,
15681 /// If set, the enum was initialized with an unknown value.
15682 ///
15683 /// Applications can examine the value using [State::value] or
15684 /// [State::name].
15685 UnknownValue(state::UnknownValue),
15686 }
15687
15688 #[doc(hidden)]
15689 pub mod state {
15690 #[allow(unused_imports)]
15691 use super::*;
15692 #[derive(Clone, Debug, PartialEq)]
15693 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15694 }
15695
15696 impl State {
15697 /// Gets the enum value.
15698 ///
15699 /// Returns `None` if the enum contains an unknown value deserialized from
15700 /// the string representation of enums.
15701 pub fn value(&self) -> std::option::Option<i32> {
15702 match self {
15703 Self::NotKnown => std::option::Option::Some(0),
15704 Self::Ready => std::option::Option::Some(1),
15705 Self::Creating => std::option::Option::Some(2),
15706 Self::UnknownValue(u) => u.0.value(),
15707 }
15708 }
15709
15710 /// Gets the enum value as a string.
15711 ///
15712 /// Returns `None` if the enum contains an unknown value deserialized from
15713 /// the integer representation of enums.
15714 pub fn name(&self) -> std::option::Option<&str> {
15715 match self {
15716 Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
15717 Self::Ready => std::option::Option::Some("READY"),
15718 Self::Creating => std::option::Option::Some("CREATING"),
15719 Self::UnknownValue(u) => u.0.name(),
15720 }
15721 }
15722 }
15723
15724 impl std::default::Default for State {
15725 fn default() -> Self {
15726 use std::convert::From;
15727 Self::from(0)
15728 }
15729 }
15730
15731 impl std::fmt::Display for State {
15732 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15733 wkt::internal::display_enum(f, self.name(), self.value())
15734 }
15735 }
15736
15737 impl std::convert::From<i32> for State {
15738 fn from(value: i32) -> Self {
15739 match value {
15740 0 => Self::NotKnown,
15741 1 => Self::Ready,
15742 2 => Self::Creating,
15743 _ => Self::UnknownValue(state::UnknownValue(
15744 wkt::internal::UnknownEnumValue::Integer(value),
15745 )),
15746 }
15747 }
15748 }
15749
15750 impl std::convert::From<&str> for State {
15751 fn from(value: &str) -> Self {
15752 use std::string::ToString;
15753 match value {
15754 "STATE_NOT_KNOWN" => Self::NotKnown,
15755 "READY" => Self::Ready,
15756 "CREATING" => Self::Creating,
15757 _ => Self::UnknownValue(state::UnknownValue(
15758 wkt::internal::UnknownEnumValue::String(value.to_string()),
15759 )),
15760 }
15761 }
15762 }
15763
15764 impl serde::ser::Serialize for State {
15765 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15766 where
15767 S: serde::Serializer,
15768 {
15769 match self {
15770 Self::NotKnown => serializer.serialize_i32(0),
15771 Self::Ready => serializer.serialize_i32(1),
15772 Self::Creating => serializer.serialize_i32(2),
15773 Self::UnknownValue(u) => u.0.serialize(serializer),
15774 }
15775 }
15776 }
15777
15778 impl<'de> serde::de::Deserialize<'de> for State {
15779 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15780 where
15781 D: serde::Deserializer<'de>,
15782 {
15783 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15784 ".google.bigtable.admin.v2.Snapshot.State",
15785 ))
15786 }
15787 }
15788}
15789
15790/// A backup of a Cloud Bigtable table.
15791#[derive(Clone, Default, PartialEq)]
15792#[non_exhaustive]
15793pub struct Backup {
15794 /// A globally unique identifier for the backup which cannot be
15795 /// changed. Values are of the form
15796 /// `projects/{project}/instances/{instance}/clusters/{cluster}/
15797 /// backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
15798 /// The final segment of the name must be between 1 and 50 characters
15799 /// in length.
15800 ///
15801 /// The backup is stored in the cluster identified by the prefix of the backup
15802 /// name of the form
15803 /// `projects/{project}/instances/{instance}/clusters/{cluster}`.
15804 pub name: std::string::String,
15805
15806 /// Required. Immutable. Name of the table from which this backup was created.
15807 /// This needs to be in the same instance as the backup. Values are of the form
15808 /// `projects/{project}/instances/{instance}/tables/{source_table}`.
15809 pub source_table: std::string::String,
15810
15811 /// Output only. Name of the backup from which this backup was copied. If a
15812 /// backup is not created by copying a backup, this field will be empty. Values
15813 /// are of the form:
15814 /// projects/\<project\>/instances/\<instance\>/clusters/\<cluster\>/backups/\<backup\>
15815 pub source_backup: std::string::String,
15816
15817 /// Required. The expiration time of the backup.
15818 /// When creating a backup or updating its `expire_time`, the value must be
15819 /// greater than the backup creation time by:
15820 ///
15821 /// - At least 6 hours
15822 /// - At most 90 days
15823 ///
15824 /// Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
15825 pub expire_time: std::option::Option<wkt::Timestamp>,
15826
15827 /// Output only. `start_time` is the time that the backup was started
15828 /// (i.e. approximately the time the
15829 /// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
15830 /// request is received). The row data in this backup will be no older than
15831 /// this timestamp.
15832 ///
15833 /// [google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]: crate::client::BigtableTableAdmin::create_backup
15834 pub start_time: std::option::Option<wkt::Timestamp>,
15835
15836 /// Output only. `end_time` is the time that the backup was finished. The row
15837 /// data in the backup will be no newer than this timestamp.
15838 pub end_time: std::option::Option<wkt::Timestamp>,
15839
15840 /// Output only. Size of the backup in bytes.
15841 pub size_bytes: i64,
15842
15843 /// Output only. The current state of the backup.
15844 pub state: crate::model::backup::State,
15845
15846 /// Output only. The encryption information for the backup.
15847 pub encryption_info: std::option::Option<crate::model::EncryptionInfo>,
15848
15849 /// Indicates the backup type of the backup.
15850 pub backup_type: crate::model::backup::BackupType,
15851
15852 /// The time at which the hot backup will be converted to a standard backup.
15853 /// Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
15854 /// hot backup to a standard backup. This value must be greater than the backup
15855 /// creation time by:
15856 ///
15857 /// - At least 24 hours
15858 ///
15859 /// This field only applies for hot backups. When creating or updating a
15860 /// standard backup, attempting to set this field will fail the request.
15861 pub hot_to_standard_time: std::option::Option<wkt::Timestamp>,
15862
15863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15864}
15865
15866impl Backup {
15867 /// Creates a new default instance.
15868 pub fn new() -> Self {
15869 std::default::Default::default()
15870 }
15871
15872 /// Sets the value of [name][crate::model::Backup::name].
15873 ///
15874 /// # Example
15875 /// ```ignore,no_run
15876 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15877 /// # let project_id = "project_id";
15878 /// # let instance_id = "instance_id";
15879 /// # let cluster_id = "cluster_id";
15880 /// # let backup_id = "backup_id";
15881 /// let x = Backup::new().set_name(format!("projects/{project_id}/instances/{instance_id}/clusters/{cluster_id}/backups/{backup_id}"));
15882 /// ```
15883 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15884 self.name = v.into();
15885 self
15886 }
15887
15888 /// Sets the value of [source_table][crate::model::Backup::source_table].
15889 ///
15890 /// # Example
15891 /// ```ignore,no_run
15892 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15893 /// let x = Backup::new().set_source_table("example");
15894 /// ```
15895 pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15896 self.source_table = v.into();
15897 self
15898 }
15899
15900 /// Sets the value of [source_backup][crate::model::Backup::source_backup].
15901 ///
15902 /// # Example
15903 /// ```ignore,no_run
15904 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15905 /// let x = Backup::new().set_source_backup("example");
15906 /// ```
15907 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15908 self.source_backup = v.into();
15909 self
15910 }
15911
15912 /// Sets the value of [expire_time][crate::model::Backup::expire_time].
15913 ///
15914 /// # Example
15915 /// ```ignore,no_run
15916 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15917 /// use wkt::Timestamp;
15918 /// let x = Backup::new().set_expire_time(Timestamp::default()/* use setters */);
15919 /// ```
15920 pub fn set_expire_time<T>(mut self, v: T) -> Self
15921 where
15922 T: std::convert::Into<wkt::Timestamp>,
15923 {
15924 self.expire_time = std::option::Option::Some(v.into());
15925 self
15926 }
15927
15928 /// Sets or clears the value of [expire_time][crate::model::Backup::expire_time].
15929 ///
15930 /// # Example
15931 /// ```ignore,no_run
15932 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15933 /// use wkt::Timestamp;
15934 /// let x = Backup::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
15935 /// let x = Backup::new().set_or_clear_expire_time(None::<Timestamp>);
15936 /// ```
15937 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
15938 where
15939 T: std::convert::Into<wkt::Timestamp>,
15940 {
15941 self.expire_time = v.map(|x| x.into());
15942 self
15943 }
15944
15945 /// Sets the value of [start_time][crate::model::Backup::start_time].
15946 ///
15947 /// # Example
15948 /// ```ignore,no_run
15949 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15950 /// use wkt::Timestamp;
15951 /// let x = Backup::new().set_start_time(Timestamp::default()/* use setters */);
15952 /// ```
15953 pub fn set_start_time<T>(mut self, v: T) -> Self
15954 where
15955 T: std::convert::Into<wkt::Timestamp>,
15956 {
15957 self.start_time = std::option::Option::Some(v.into());
15958 self
15959 }
15960
15961 /// Sets or clears the value of [start_time][crate::model::Backup::start_time].
15962 ///
15963 /// # Example
15964 /// ```ignore,no_run
15965 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15966 /// use wkt::Timestamp;
15967 /// let x = Backup::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
15968 /// let x = Backup::new().set_or_clear_start_time(None::<Timestamp>);
15969 /// ```
15970 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15971 where
15972 T: std::convert::Into<wkt::Timestamp>,
15973 {
15974 self.start_time = v.map(|x| x.into());
15975 self
15976 }
15977
15978 /// Sets the value of [end_time][crate::model::Backup::end_time].
15979 ///
15980 /// # Example
15981 /// ```ignore,no_run
15982 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15983 /// use wkt::Timestamp;
15984 /// let x = Backup::new().set_end_time(Timestamp::default()/* use setters */);
15985 /// ```
15986 pub fn set_end_time<T>(mut self, v: T) -> Self
15987 where
15988 T: std::convert::Into<wkt::Timestamp>,
15989 {
15990 self.end_time = std::option::Option::Some(v.into());
15991 self
15992 }
15993
15994 /// Sets or clears the value of [end_time][crate::model::Backup::end_time].
15995 ///
15996 /// # Example
15997 /// ```ignore,no_run
15998 /// # use google_cloud_bigtable_admin_v2::model::Backup;
15999 /// use wkt::Timestamp;
16000 /// let x = Backup::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
16001 /// let x = Backup::new().set_or_clear_end_time(None::<Timestamp>);
16002 /// ```
16003 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16004 where
16005 T: std::convert::Into<wkt::Timestamp>,
16006 {
16007 self.end_time = v.map(|x| x.into());
16008 self
16009 }
16010
16011 /// Sets the value of [size_bytes][crate::model::Backup::size_bytes].
16012 ///
16013 /// # Example
16014 /// ```ignore,no_run
16015 /// # use google_cloud_bigtable_admin_v2::model::Backup;
16016 /// let x = Backup::new().set_size_bytes(42);
16017 /// ```
16018 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16019 self.size_bytes = v.into();
16020 self
16021 }
16022
16023 /// Sets the value of [state][crate::model::Backup::state].
16024 ///
16025 /// # Example
16026 /// ```ignore,no_run
16027 /// # use google_cloud_bigtable_admin_v2::model::Backup;
16028 /// use google_cloud_bigtable_admin_v2::model::backup::State;
16029 /// let x0 = Backup::new().set_state(State::Creating);
16030 /// let x1 = Backup::new().set_state(State::Ready);
16031 /// ```
16032 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
16033 self.state = v.into();
16034 self
16035 }
16036
16037 /// Sets the value of [encryption_info][crate::model::Backup::encryption_info].
16038 ///
16039 /// # Example
16040 /// ```ignore,no_run
16041 /// # use google_cloud_bigtable_admin_v2::model::Backup;
16042 /// use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
16043 /// let x = Backup::new().set_encryption_info(EncryptionInfo::default()/* use setters */);
16044 /// ```
16045 pub fn set_encryption_info<T>(mut self, v: T) -> Self
16046 where
16047 T: std::convert::Into<crate::model::EncryptionInfo>,
16048 {
16049 self.encryption_info = std::option::Option::Some(v.into());
16050 self
16051 }
16052
16053 /// Sets or clears the value of [encryption_info][crate::model::Backup::encryption_info].
16054 ///
16055 /// # Example
16056 /// ```ignore,no_run
16057 /// # use google_cloud_bigtable_admin_v2::model::Backup;
16058 /// use google_cloud_bigtable_admin_v2::model::EncryptionInfo;
16059 /// let x = Backup::new().set_or_clear_encryption_info(Some(EncryptionInfo::default()/* use setters */));
16060 /// let x = Backup::new().set_or_clear_encryption_info(None::<EncryptionInfo>);
16061 /// ```
16062 pub fn set_or_clear_encryption_info<T>(mut self, v: std::option::Option<T>) -> Self
16063 where
16064 T: std::convert::Into<crate::model::EncryptionInfo>,
16065 {
16066 self.encryption_info = v.map(|x| x.into());
16067 self
16068 }
16069
16070 /// Sets the value of [backup_type][crate::model::Backup::backup_type].
16071 ///
16072 /// # Example
16073 /// ```ignore,no_run
16074 /// # use google_cloud_bigtable_admin_v2::model::Backup;
16075 /// use google_cloud_bigtable_admin_v2::model::backup::BackupType;
16076 /// let x0 = Backup::new().set_backup_type(BackupType::Standard);
16077 /// let x1 = Backup::new().set_backup_type(BackupType::Hot);
16078 /// ```
16079 pub fn set_backup_type<T: std::convert::Into<crate::model::backup::BackupType>>(
16080 mut self,
16081 v: T,
16082 ) -> Self {
16083 self.backup_type = v.into();
16084 self
16085 }
16086
16087 /// Sets the value of [hot_to_standard_time][crate::model::Backup::hot_to_standard_time].
16088 ///
16089 /// # Example
16090 /// ```ignore,no_run
16091 /// # use google_cloud_bigtable_admin_v2::model::Backup;
16092 /// use wkt::Timestamp;
16093 /// let x = Backup::new().set_hot_to_standard_time(Timestamp::default()/* use setters */);
16094 /// ```
16095 pub fn set_hot_to_standard_time<T>(mut self, v: T) -> Self
16096 where
16097 T: std::convert::Into<wkt::Timestamp>,
16098 {
16099 self.hot_to_standard_time = std::option::Option::Some(v.into());
16100 self
16101 }
16102
16103 /// Sets or clears the value of [hot_to_standard_time][crate::model::Backup::hot_to_standard_time].
16104 ///
16105 /// # Example
16106 /// ```ignore,no_run
16107 /// # use google_cloud_bigtable_admin_v2::model::Backup;
16108 /// use wkt::Timestamp;
16109 /// let x = Backup::new().set_or_clear_hot_to_standard_time(Some(Timestamp::default()/* use setters */));
16110 /// let x = Backup::new().set_or_clear_hot_to_standard_time(None::<Timestamp>);
16111 /// ```
16112 pub fn set_or_clear_hot_to_standard_time<T>(mut self, v: std::option::Option<T>) -> Self
16113 where
16114 T: std::convert::Into<wkt::Timestamp>,
16115 {
16116 self.hot_to_standard_time = v.map(|x| x.into());
16117 self
16118 }
16119}
16120
16121impl wkt::message::Message for Backup {
16122 fn typename() -> &'static str {
16123 "type.googleapis.com/google.bigtable.admin.v2.Backup"
16124 }
16125}
16126
16127/// Defines additional types related to [Backup].
16128pub mod backup {
16129 #[allow(unused_imports)]
16130 use super::*;
16131
16132 /// Indicates the current state of the backup.
16133 ///
16134 /// # Working with unknown values
16135 ///
16136 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16137 /// additional enum variants at any time. Adding new variants is not considered
16138 /// a breaking change. Applications should write their code in anticipation of:
16139 ///
16140 /// - New values appearing in future releases of the client library, **and**
16141 /// - New values received dynamically, without application changes.
16142 ///
16143 /// Please consult the [Working with enums] section in the user guide for some
16144 /// guidelines.
16145 ///
16146 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16147 #[derive(Clone, Debug, PartialEq)]
16148 #[non_exhaustive]
16149 pub enum State {
16150 /// Not specified.
16151 Unspecified,
16152 /// The pending backup is still being created. Operations on the
16153 /// backup may fail with `FAILED_PRECONDITION` in this state.
16154 Creating,
16155 /// The backup is complete and ready for use.
16156 Ready,
16157 /// If set, the enum was initialized with an unknown value.
16158 ///
16159 /// Applications can examine the value using [State::value] or
16160 /// [State::name].
16161 UnknownValue(state::UnknownValue),
16162 }
16163
16164 #[doc(hidden)]
16165 pub mod state {
16166 #[allow(unused_imports)]
16167 use super::*;
16168 #[derive(Clone, Debug, PartialEq)]
16169 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16170 }
16171
16172 impl State {
16173 /// Gets the enum value.
16174 ///
16175 /// Returns `None` if the enum contains an unknown value deserialized from
16176 /// the string representation of enums.
16177 pub fn value(&self) -> std::option::Option<i32> {
16178 match self {
16179 Self::Unspecified => std::option::Option::Some(0),
16180 Self::Creating => std::option::Option::Some(1),
16181 Self::Ready => std::option::Option::Some(2),
16182 Self::UnknownValue(u) => u.0.value(),
16183 }
16184 }
16185
16186 /// Gets the enum value as a string.
16187 ///
16188 /// Returns `None` if the enum contains an unknown value deserialized from
16189 /// the integer representation of enums.
16190 pub fn name(&self) -> std::option::Option<&str> {
16191 match self {
16192 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16193 Self::Creating => std::option::Option::Some("CREATING"),
16194 Self::Ready => std::option::Option::Some("READY"),
16195 Self::UnknownValue(u) => u.0.name(),
16196 }
16197 }
16198 }
16199
16200 impl std::default::Default for State {
16201 fn default() -> Self {
16202 use std::convert::From;
16203 Self::from(0)
16204 }
16205 }
16206
16207 impl std::fmt::Display for State {
16208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16209 wkt::internal::display_enum(f, self.name(), self.value())
16210 }
16211 }
16212
16213 impl std::convert::From<i32> for State {
16214 fn from(value: i32) -> Self {
16215 match value {
16216 0 => Self::Unspecified,
16217 1 => Self::Creating,
16218 2 => Self::Ready,
16219 _ => Self::UnknownValue(state::UnknownValue(
16220 wkt::internal::UnknownEnumValue::Integer(value),
16221 )),
16222 }
16223 }
16224 }
16225
16226 impl std::convert::From<&str> for State {
16227 fn from(value: &str) -> Self {
16228 use std::string::ToString;
16229 match value {
16230 "STATE_UNSPECIFIED" => Self::Unspecified,
16231 "CREATING" => Self::Creating,
16232 "READY" => Self::Ready,
16233 _ => Self::UnknownValue(state::UnknownValue(
16234 wkt::internal::UnknownEnumValue::String(value.to_string()),
16235 )),
16236 }
16237 }
16238 }
16239
16240 impl serde::ser::Serialize for State {
16241 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16242 where
16243 S: serde::Serializer,
16244 {
16245 match self {
16246 Self::Unspecified => serializer.serialize_i32(0),
16247 Self::Creating => serializer.serialize_i32(1),
16248 Self::Ready => serializer.serialize_i32(2),
16249 Self::UnknownValue(u) => u.0.serialize(serializer),
16250 }
16251 }
16252 }
16253
16254 impl<'de> serde::de::Deserialize<'de> for State {
16255 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16256 where
16257 D: serde::Deserializer<'de>,
16258 {
16259 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16260 ".google.bigtable.admin.v2.Backup.State",
16261 ))
16262 }
16263 }
16264
16265 /// The type of the backup.
16266 ///
16267 /// # Working with unknown values
16268 ///
16269 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16270 /// additional enum variants at any time. Adding new variants is not considered
16271 /// a breaking change. Applications should write their code in anticipation of:
16272 ///
16273 /// - New values appearing in future releases of the client library, **and**
16274 /// - New values received dynamically, without application changes.
16275 ///
16276 /// Please consult the [Working with enums] section in the user guide for some
16277 /// guidelines.
16278 ///
16279 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16280 #[derive(Clone, Debug, PartialEq)]
16281 #[non_exhaustive]
16282 pub enum BackupType {
16283 /// Not specified.
16284 Unspecified,
16285 /// The default type for Cloud Bigtable managed backups. Supported for
16286 /// backups created in both HDD and SSD instances. Requires optimization when
16287 /// restored to a table in an SSD instance.
16288 Standard,
16289 /// A backup type with faster restore to SSD performance. Only supported for
16290 /// backups created in SSD instances. A new SSD table restored from a hot
16291 /// backup reaches production performance more quickly than a standard
16292 /// backup.
16293 Hot,
16294 /// If set, the enum was initialized with an unknown value.
16295 ///
16296 /// Applications can examine the value using [BackupType::value] or
16297 /// [BackupType::name].
16298 UnknownValue(backup_type::UnknownValue),
16299 }
16300
16301 #[doc(hidden)]
16302 pub mod backup_type {
16303 #[allow(unused_imports)]
16304 use super::*;
16305 #[derive(Clone, Debug, PartialEq)]
16306 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16307 }
16308
16309 impl BackupType {
16310 /// Gets the enum value.
16311 ///
16312 /// Returns `None` if the enum contains an unknown value deserialized from
16313 /// the string representation of enums.
16314 pub fn value(&self) -> std::option::Option<i32> {
16315 match self {
16316 Self::Unspecified => std::option::Option::Some(0),
16317 Self::Standard => std::option::Option::Some(1),
16318 Self::Hot => std::option::Option::Some(2),
16319 Self::UnknownValue(u) => u.0.value(),
16320 }
16321 }
16322
16323 /// Gets the enum value as a string.
16324 ///
16325 /// Returns `None` if the enum contains an unknown value deserialized from
16326 /// the integer representation of enums.
16327 pub fn name(&self) -> std::option::Option<&str> {
16328 match self {
16329 Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
16330 Self::Standard => std::option::Option::Some("STANDARD"),
16331 Self::Hot => std::option::Option::Some("HOT"),
16332 Self::UnknownValue(u) => u.0.name(),
16333 }
16334 }
16335 }
16336
16337 impl std::default::Default for BackupType {
16338 fn default() -> Self {
16339 use std::convert::From;
16340 Self::from(0)
16341 }
16342 }
16343
16344 impl std::fmt::Display for BackupType {
16345 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16346 wkt::internal::display_enum(f, self.name(), self.value())
16347 }
16348 }
16349
16350 impl std::convert::From<i32> for BackupType {
16351 fn from(value: i32) -> Self {
16352 match value {
16353 0 => Self::Unspecified,
16354 1 => Self::Standard,
16355 2 => Self::Hot,
16356 _ => Self::UnknownValue(backup_type::UnknownValue(
16357 wkt::internal::UnknownEnumValue::Integer(value),
16358 )),
16359 }
16360 }
16361 }
16362
16363 impl std::convert::From<&str> for BackupType {
16364 fn from(value: &str) -> Self {
16365 use std::string::ToString;
16366 match value {
16367 "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
16368 "STANDARD" => Self::Standard,
16369 "HOT" => Self::Hot,
16370 _ => Self::UnknownValue(backup_type::UnknownValue(
16371 wkt::internal::UnknownEnumValue::String(value.to_string()),
16372 )),
16373 }
16374 }
16375 }
16376
16377 impl serde::ser::Serialize for BackupType {
16378 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16379 where
16380 S: serde::Serializer,
16381 {
16382 match self {
16383 Self::Unspecified => serializer.serialize_i32(0),
16384 Self::Standard => serializer.serialize_i32(1),
16385 Self::Hot => serializer.serialize_i32(2),
16386 Self::UnknownValue(u) => u.0.serialize(serializer),
16387 }
16388 }
16389 }
16390
16391 impl<'de> serde::de::Deserialize<'de> for BackupType {
16392 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16393 where
16394 D: serde::Deserializer<'de>,
16395 {
16396 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
16397 ".google.bigtable.admin.v2.Backup.BackupType",
16398 ))
16399 }
16400 }
16401}
16402
16403/// Information about a backup.
16404#[derive(Clone, Default, PartialEq)]
16405#[non_exhaustive]
16406pub struct BackupInfo {
16407 /// Output only. Name of the backup.
16408 pub backup: std::string::String,
16409
16410 /// Output only. The time that the backup was started. Row data in the backup
16411 /// will be no older than this timestamp.
16412 pub start_time: std::option::Option<wkt::Timestamp>,
16413
16414 /// Output only. This time that the backup was finished. Row data in the
16415 /// backup will be no newer than this timestamp.
16416 pub end_time: std::option::Option<wkt::Timestamp>,
16417
16418 /// Output only. Name of the table the backup was created from.
16419 pub source_table: std::string::String,
16420
16421 /// Output only. Name of the backup from which this backup was copied. If a
16422 /// backup is not created by copying a backup, this field will be empty. Values
16423 /// are of the form:
16424 /// projects/\<project\>/instances/\<instance\>/clusters/\<cluster\>/backups/\<backup\>
16425 pub source_backup: std::string::String,
16426
16427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16428}
16429
16430impl BackupInfo {
16431 /// Creates a new default instance.
16432 pub fn new() -> Self {
16433 std::default::Default::default()
16434 }
16435
16436 /// Sets the value of [backup][crate::model::BackupInfo::backup].
16437 ///
16438 /// # Example
16439 /// ```ignore,no_run
16440 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
16441 /// let x = BackupInfo::new().set_backup("example");
16442 /// ```
16443 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16444 self.backup = v.into();
16445 self
16446 }
16447
16448 /// Sets the value of [start_time][crate::model::BackupInfo::start_time].
16449 ///
16450 /// # Example
16451 /// ```ignore,no_run
16452 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
16453 /// use wkt::Timestamp;
16454 /// let x = BackupInfo::new().set_start_time(Timestamp::default()/* use setters */);
16455 /// ```
16456 pub fn set_start_time<T>(mut self, v: T) -> Self
16457 where
16458 T: std::convert::Into<wkt::Timestamp>,
16459 {
16460 self.start_time = std::option::Option::Some(v.into());
16461 self
16462 }
16463
16464 /// Sets or clears the value of [start_time][crate::model::BackupInfo::start_time].
16465 ///
16466 /// # Example
16467 /// ```ignore,no_run
16468 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
16469 /// use wkt::Timestamp;
16470 /// let x = BackupInfo::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
16471 /// let x = BackupInfo::new().set_or_clear_start_time(None::<Timestamp>);
16472 /// ```
16473 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
16474 where
16475 T: std::convert::Into<wkt::Timestamp>,
16476 {
16477 self.start_time = v.map(|x| x.into());
16478 self
16479 }
16480
16481 /// Sets the value of [end_time][crate::model::BackupInfo::end_time].
16482 ///
16483 /// # Example
16484 /// ```ignore,no_run
16485 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
16486 /// use wkt::Timestamp;
16487 /// let x = BackupInfo::new().set_end_time(Timestamp::default()/* use setters */);
16488 /// ```
16489 pub fn set_end_time<T>(mut self, v: T) -> Self
16490 where
16491 T: std::convert::Into<wkt::Timestamp>,
16492 {
16493 self.end_time = std::option::Option::Some(v.into());
16494 self
16495 }
16496
16497 /// Sets or clears the value of [end_time][crate::model::BackupInfo::end_time].
16498 ///
16499 /// # Example
16500 /// ```ignore,no_run
16501 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
16502 /// use wkt::Timestamp;
16503 /// let x = BackupInfo::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
16504 /// let x = BackupInfo::new().set_or_clear_end_time(None::<Timestamp>);
16505 /// ```
16506 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16507 where
16508 T: std::convert::Into<wkt::Timestamp>,
16509 {
16510 self.end_time = v.map(|x| x.into());
16511 self
16512 }
16513
16514 /// Sets the value of [source_table][crate::model::BackupInfo::source_table].
16515 ///
16516 /// # Example
16517 /// ```ignore,no_run
16518 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
16519 /// let x = BackupInfo::new().set_source_table("example");
16520 /// ```
16521 pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16522 self.source_table = v.into();
16523 self
16524 }
16525
16526 /// Sets the value of [source_backup][crate::model::BackupInfo::source_backup].
16527 ///
16528 /// # Example
16529 /// ```ignore,no_run
16530 /// # use google_cloud_bigtable_admin_v2::model::BackupInfo;
16531 /// let x = BackupInfo::new().set_source_backup("example");
16532 /// ```
16533 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16534 self.source_backup = v.into();
16535 self
16536 }
16537}
16538
16539impl wkt::message::Message for BackupInfo {
16540 fn typename() -> &'static str {
16541 "type.googleapis.com/google.bigtable.admin.v2.BackupInfo"
16542 }
16543}
16544
16545/// Config for tiered storage.
16546/// A valid config must have a valid TieredStorageRule. Otherwise the whole
16547/// TieredStorageConfig must be unset.
16548/// By default all data is stored in the SSD tier (only SSD instances can
16549/// configure tiered storage).
16550#[derive(Clone, Default, PartialEq)]
16551#[non_exhaustive]
16552pub struct TieredStorageConfig {
16553 /// Rule to specify what data is stored in the infrequent access(IA) tier.
16554 /// The IA tier allows storing more data per node with reduced performance.
16555 pub infrequent_access: std::option::Option<crate::model::TieredStorageRule>,
16556
16557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16558}
16559
16560impl TieredStorageConfig {
16561 /// Creates a new default instance.
16562 pub fn new() -> Self {
16563 std::default::Default::default()
16564 }
16565
16566 /// Sets the value of [infrequent_access][crate::model::TieredStorageConfig::infrequent_access].
16567 ///
16568 /// # Example
16569 /// ```ignore,no_run
16570 /// # use google_cloud_bigtable_admin_v2::model::TieredStorageConfig;
16571 /// use google_cloud_bigtable_admin_v2::model::TieredStorageRule;
16572 /// let x = TieredStorageConfig::new().set_infrequent_access(TieredStorageRule::default()/* use setters */);
16573 /// ```
16574 pub fn set_infrequent_access<T>(mut self, v: T) -> Self
16575 where
16576 T: std::convert::Into<crate::model::TieredStorageRule>,
16577 {
16578 self.infrequent_access = std::option::Option::Some(v.into());
16579 self
16580 }
16581
16582 /// Sets or clears the value of [infrequent_access][crate::model::TieredStorageConfig::infrequent_access].
16583 ///
16584 /// # Example
16585 /// ```ignore,no_run
16586 /// # use google_cloud_bigtable_admin_v2::model::TieredStorageConfig;
16587 /// use google_cloud_bigtable_admin_v2::model::TieredStorageRule;
16588 /// let x = TieredStorageConfig::new().set_or_clear_infrequent_access(Some(TieredStorageRule::default()/* use setters */));
16589 /// let x = TieredStorageConfig::new().set_or_clear_infrequent_access(None::<TieredStorageRule>);
16590 /// ```
16591 pub fn set_or_clear_infrequent_access<T>(mut self, v: std::option::Option<T>) -> Self
16592 where
16593 T: std::convert::Into<crate::model::TieredStorageRule>,
16594 {
16595 self.infrequent_access = v.map(|x| x.into());
16596 self
16597 }
16598}
16599
16600impl wkt::message::Message for TieredStorageConfig {
16601 fn typename() -> &'static str {
16602 "type.googleapis.com/google.bigtable.admin.v2.TieredStorageConfig"
16603 }
16604}
16605
16606/// Rule to specify what data is stored in a storage tier.
16607#[derive(Clone, Default, PartialEq)]
16608#[non_exhaustive]
16609pub struct TieredStorageRule {
16610 /// Rules to specify what data is stored in this tier.
16611 pub rule: std::option::Option<crate::model::tiered_storage_rule::Rule>,
16612
16613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16614}
16615
16616impl TieredStorageRule {
16617 /// Creates a new default instance.
16618 pub fn new() -> Self {
16619 std::default::Default::default()
16620 }
16621
16622 /// Sets the value of [rule][crate::model::TieredStorageRule::rule].
16623 ///
16624 /// Note that all the setters affecting `rule` are mutually
16625 /// exclusive.
16626 ///
16627 /// # Example
16628 /// ```ignore,no_run
16629 /// # use google_cloud_bigtable_admin_v2::model::TieredStorageRule;
16630 /// use wkt::Duration;
16631 /// let x = TieredStorageRule::new().set_rule(Some(
16632 /// google_cloud_bigtable_admin_v2::model::tiered_storage_rule::Rule::IncludeIfOlderThan(Duration::default().into())));
16633 /// ```
16634 pub fn set_rule<
16635 T: std::convert::Into<std::option::Option<crate::model::tiered_storage_rule::Rule>>,
16636 >(
16637 mut self,
16638 v: T,
16639 ) -> Self {
16640 self.rule = v.into();
16641 self
16642 }
16643
16644 /// The value of [rule][crate::model::TieredStorageRule::rule]
16645 /// if it holds a `IncludeIfOlderThan`, `None` if the field is not set or
16646 /// holds a different branch.
16647 pub fn include_if_older_than(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
16648 #[allow(unreachable_patterns)]
16649 self.rule.as_ref().and_then(|v| match v {
16650 crate::model::tiered_storage_rule::Rule::IncludeIfOlderThan(v) => {
16651 std::option::Option::Some(v)
16652 }
16653 _ => std::option::Option::None,
16654 })
16655 }
16656
16657 /// Sets the value of [rule][crate::model::TieredStorageRule::rule]
16658 /// to hold a `IncludeIfOlderThan`.
16659 ///
16660 /// Note that all the setters affecting `rule` are
16661 /// mutually exclusive.
16662 ///
16663 /// # Example
16664 /// ```ignore,no_run
16665 /// # use google_cloud_bigtable_admin_v2::model::TieredStorageRule;
16666 /// use wkt::Duration;
16667 /// let x = TieredStorageRule::new().set_include_if_older_than(Duration::default()/* use setters */);
16668 /// assert!(x.include_if_older_than().is_some());
16669 /// ```
16670 pub fn set_include_if_older_than<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
16671 mut self,
16672 v: T,
16673 ) -> Self {
16674 self.rule = std::option::Option::Some(
16675 crate::model::tiered_storage_rule::Rule::IncludeIfOlderThan(v.into()),
16676 );
16677 self
16678 }
16679}
16680
16681impl wkt::message::Message for TieredStorageRule {
16682 fn typename() -> &'static str {
16683 "type.googleapis.com/google.bigtable.admin.v2.TieredStorageRule"
16684 }
16685}
16686
16687/// Defines additional types related to [TieredStorageRule].
16688pub mod tiered_storage_rule {
16689 #[allow(unused_imports)]
16690 use super::*;
16691
16692 /// Rules to specify what data is stored in this tier.
16693 #[derive(Clone, Debug, PartialEq)]
16694 #[non_exhaustive]
16695 pub enum Rule {
16696 /// Include cells older than the given age.
16697 /// For the infrequent access tier, this value must be at least 30 days.
16698 IncludeIfOlderThan(std::boxed::Box<wkt::Duration>),
16699 }
16700}
16701
16702/// Represents a collection of protobuf schemas.
16703#[derive(Clone, Default, PartialEq)]
16704#[non_exhaustive]
16705pub struct ProtoSchema {
16706 /// Required. Contains a protobuf-serialized
16707 /// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto),
16708 /// which could include multiple proto files.
16709 /// To generate it, [install](https://grpc.io/docs/protoc-installation/) and
16710 /// run `protoc` with
16711 /// `--include_imports` and `--descriptor_set_out`. For example, to generate
16712 /// for moon/shot/app.proto, run
16713 ///
16714 /// ```norust
16715 /// $protoc --proto_path=/app_path --proto_path=/lib_path \
16716 /// --include_imports \
16717 /// --descriptor_set_out=descriptors.pb \
16718 /// moon/shot/app.proto
16719 /// ```
16720 ///
16721 /// For more details, see protobuffer [self
16722 /// description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
16723 pub proto_descriptors: ::bytes::Bytes,
16724
16725 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16726}
16727
16728impl ProtoSchema {
16729 /// Creates a new default instance.
16730 pub fn new() -> Self {
16731 std::default::Default::default()
16732 }
16733
16734 /// Sets the value of [proto_descriptors][crate::model::ProtoSchema::proto_descriptors].
16735 ///
16736 /// # Example
16737 /// ```ignore,no_run
16738 /// # use google_cloud_bigtable_admin_v2::model::ProtoSchema;
16739 /// let x = ProtoSchema::new().set_proto_descriptors(bytes::Bytes::from_static(b"example"));
16740 /// ```
16741 pub fn set_proto_descriptors<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
16742 self.proto_descriptors = v.into();
16743 self
16744 }
16745}
16746
16747impl wkt::message::Message for ProtoSchema {
16748 fn typename() -> &'static str {
16749 "type.googleapis.com/google.bigtable.admin.v2.ProtoSchema"
16750 }
16751}
16752
16753/// Represents a collection of Avro schemas.
16754#[derive(Clone, Default, PartialEq)]
16755#[non_exhaustive]
16756pub struct AvroSchema {
16757 /// Required. The Avro schemas in JSON format.
16758 /// Each element must be the content of a valid, self-contained Avro schema
16759 /// file (.avsc), as described in <https://avro.apache.org/docs/1.8.1/spec.html>.
16760 /// Use repeated elements to include multiple Avro schema files in a single
16761 /// bundle.
16762 pub json_schemas: std::vec::Vec<std::string::String>,
16763
16764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16765}
16766
16767impl AvroSchema {
16768 /// Creates a new default instance.
16769 pub fn new() -> Self {
16770 std::default::Default::default()
16771 }
16772
16773 /// Sets the value of [json_schemas][crate::model::AvroSchema::json_schemas].
16774 ///
16775 /// # Example
16776 /// ```ignore,no_run
16777 /// # use google_cloud_bigtable_admin_v2::model::AvroSchema;
16778 /// let x = AvroSchema::new().set_json_schemas(["a", "b", "c"]);
16779 /// ```
16780 pub fn set_json_schemas<T, V>(mut self, v: T) -> Self
16781 where
16782 T: std::iter::IntoIterator<Item = V>,
16783 V: std::convert::Into<std::string::String>,
16784 {
16785 use std::iter::Iterator;
16786 self.json_schemas = v.into_iter().map(|i| i.into()).collect();
16787 self
16788 }
16789}
16790
16791impl wkt::message::Message for AvroSchema {
16792 fn typename() -> &'static str {
16793 "type.googleapis.com/google.bigtable.admin.v2.AvroSchema"
16794 }
16795}
16796
16797/// A named collection of related schemas.
16798#[derive(Clone, Default, PartialEq)]
16799#[non_exhaustive]
16800pub struct SchemaBundle {
16801 /// Identifier. The unique name identifying this schema bundle.
16802 /// Values are of the form
16803 /// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
16804 pub name: std::string::String,
16805
16806 /// Optional. The etag for this schema bundle.
16807 /// This may be sent on update and delete requests to ensure the
16808 /// client has an up-to-date value before proceeding. The server
16809 /// returns an ABORTED error on a mismatched etag.
16810 pub etag: std::string::String,
16811
16812 /// The type of this schema bundle. The oneof case cannot change after
16813 /// creation.
16814 pub r#type: std::option::Option<crate::model::schema_bundle::Type>,
16815
16816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16817}
16818
16819impl SchemaBundle {
16820 /// Creates a new default instance.
16821 pub fn new() -> Self {
16822 std::default::Default::default()
16823 }
16824
16825 /// Sets the value of [name][crate::model::SchemaBundle::name].
16826 ///
16827 /// # Example
16828 /// ```ignore,no_run
16829 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
16830 /// # let project_id = "project_id";
16831 /// # let instance_id = "instance_id";
16832 /// # let table_id = "table_id";
16833 /// # let schema_bundle_id = "schema_bundle_id";
16834 /// let x = SchemaBundle::new().set_name(format!("projects/{project_id}/instances/{instance_id}/tables/{table_id}/schemaBundles/{schema_bundle_id}"));
16835 /// ```
16836 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16837 self.name = v.into();
16838 self
16839 }
16840
16841 /// Sets the value of [etag][crate::model::SchemaBundle::etag].
16842 ///
16843 /// # Example
16844 /// ```ignore,no_run
16845 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
16846 /// let x = SchemaBundle::new().set_etag("example");
16847 /// ```
16848 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16849 self.etag = v.into();
16850 self
16851 }
16852
16853 /// Sets the value of [r#type][crate::model::SchemaBundle::type].
16854 ///
16855 /// Note that all the setters affecting `r#type` are mutually
16856 /// exclusive.
16857 ///
16858 /// # Example
16859 /// ```ignore,no_run
16860 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
16861 /// use google_cloud_bigtable_admin_v2::model::ProtoSchema;
16862 /// let x = SchemaBundle::new().set_type(Some(
16863 /// google_cloud_bigtable_admin_v2::model::schema_bundle::Type::ProtoSchema(ProtoSchema::default().into())));
16864 /// ```
16865 pub fn set_type<
16866 T: std::convert::Into<std::option::Option<crate::model::schema_bundle::Type>>,
16867 >(
16868 mut self,
16869 v: T,
16870 ) -> Self {
16871 self.r#type = v.into();
16872 self
16873 }
16874
16875 /// The value of [r#type][crate::model::SchemaBundle::r#type]
16876 /// if it holds a `ProtoSchema`, `None` if the field is not set or
16877 /// holds a different branch.
16878 pub fn proto_schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::ProtoSchema>> {
16879 #[allow(unreachable_patterns)]
16880 self.r#type.as_ref().and_then(|v| match v {
16881 crate::model::schema_bundle::Type::ProtoSchema(v) => std::option::Option::Some(v),
16882 _ => std::option::Option::None,
16883 })
16884 }
16885
16886 /// Sets the value of [r#type][crate::model::SchemaBundle::r#type]
16887 /// to hold a `ProtoSchema`.
16888 ///
16889 /// Note that all the setters affecting `r#type` are
16890 /// mutually exclusive.
16891 ///
16892 /// # Example
16893 /// ```ignore,no_run
16894 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
16895 /// use google_cloud_bigtable_admin_v2::model::ProtoSchema;
16896 /// let x = SchemaBundle::new().set_proto_schema(ProtoSchema::default()/* use setters */);
16897 /// assert!(x.proto_schema().is_some());
16898 /// assert!(x.avro_schema().is_none());
16899 /// ```
16900 pub fn set_proto_schema<T: std::convert::Into<std::boxed::Box<crate::model::ProtoSchema>>>(
16901 mut self,
16902 v: T,
16903 ) -> Self {
16904 self.r#type =
16905 std::option::Option::Some(crate::model::schema_bundle::Type::ProtoSchema(v.into()));
16906 self
16907 }
16908
16909 /// The value of [r#type][crate::model::SchemaBundle::r#type]
16910 /// if it holds a `AvroSchema`, `None` if the field is not set or
16911 /// holds a different branch.
16912 pub fn avro_schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::AvroSchema>> {
16913 #[allow(unreachable_patterns)]
16914 self.r#type.as_ref().and_then(|v| match v {
16915 crate::model::schema_bundle::Type::AvroSchema(v) => std::option::Option::Some(v),
16916 _ => std::option::Option::None,
16917 })
16918 }
16919
16920 /// Sets the value of [r#type][crate::model::SchemaBundle::r#type]
16921 /// to hold a `AvroSchema`.
16922 ///
16923 /// Note that all the setters affecting `r#type` are
16924 /// mutually exclusive.
16925 ///
16926 /// # Example
16927 /// ```ignore,no_run
16928 /// # use google_cloud_bigtable_admin_v2::model::SchemaBundle;
16929 /// use google_cloud_bigtable_admin_v2::model::AvroSchema;
16930 /// let x = SchemaBundle::new().set_avro_schema(AvroSchema::default()/* use setters */);
16931 /// assert!(x.avro_schema().is_some());
16932 /// assert!(x.proto_schema().is_none());
16933 /// ```
16934 pub fn set_avro_schema<T: std::convert::Into<std::boxed::Box<crate::model::AvroSchema>>>(
16935 mut self,
16936 v: T,
16937 ) -> Self {
16938 self.r#type =
16939 std::option::Option::Some(crate::model::schema_bundle::Type::AvroSchema(v.into()));
16940 self
16941 }
16942}
16943
16944impl wkt::message::Message for SchemaBundle {
16945 fn typename() -> &'static str {
16946 "type.googleapis.com/google.bigtable.admin.v2.SchemaBundle"
16947 }
16948}
16949
16950/// Defines additional types related to [SchemaBundle].
16951pub mod schema_bundle {
16952 #[allow(unused_imports)]
16953 use super::*;
16954
16955 /// The type of this schema bundle. The oneof case cannot change after
16956 /// creation.
16957 #[derive(Clone, Debug, PartialEq)]
16958 #[non_exhaustive]
16959 pub enum Type {
16960 /// Schema for Protobufs.
16961 ProtoSchema(std::boxed::Box<crate::model::ProtoSchema>),
16962 /// Optional. Schema for Avros.
16963 AvroSchema(std::boxed::Box<crate::model::AvroSchema>),
16964 }
16965}
16966
16967/// `Type` represents the type of data that is written to, read from, or stored
16968/// in Bigtable. It is heavily based on the GoogleSQL standard to help maintain
16969/// familiarity and consistency across products and features.
16970///
16971/// For compatibility with Bigtable's existing untyped APIs, each `Type` includes
16972/// an `Encoding` which describes how to convert to or from the underlying data.
16973///
16974/// Each encoding can operate in one of two modes:
16975///
16976/// - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)`
16977/// if and only if `X <= Y`. This is useful anywhere sort order is important,
16978/// for example when encoding keys.
16979/// - Distinct: In this mode, Bigtable guarantees that if `X != Y` then
16980/// `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For
16981/// example, both "{'foo': '1', 'bar': '2'}" and "{'bar': '2', 'foo': '1'}"
16982/// are valid encodings of the same JSON value.
16983///
16984/// The API clearly documents which mode is used wherever an encoding can be
16985/// configured. Each encoding also documents which values are supported in which
16986/// modes. For example, when encoding INT64 as a numeric STRING, negative numbers
16987/// cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but
16988/// `STRING("-00001") > STRING("00001")`.
16989#[derive(Clone, Default, PartialEq)]
16990#[non_exhaustive]
16991pub struct Type {
16992 /// The kind of type that this represents.
16993 pub kind: std::option::Option<crate::model::r#type::Kind>,
16994
16995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16996}
16997
16998impl Type {
16999 /// Creates a new default instance.
17000 pub fn new() -> Self {
17001 std::default::Default::default()
17002 }
17003
17004 /// Sets the value of [kind][crate::model::Type::kind].
17005 ///
17006 /// Note that all the setters affecting `kind` are mutually
17007 /// exclusive.
17008 ///
17009 /// # Example
17010 /// ```ignore,no_run
17011 /// # use google_cloud_bigtable_admin_v2::model::Type;
17012 /// use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
17013 /// let x = Type::new().set_kind(Some(
17014 /// google_cloud_bigtable_admin_v2::model::r#type::Kind::BytesType(Bytes::default().into())));
17015 /// ```
17016 pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::r#type::Kind>>>(
17017 mut self,
17018 v: T,
17019 ) -> Self {
17020 self.kind = v.into();
17021 self
17022 }
17023
17024 /// The value of [kind][crate::model::Type::kind]
17025 /// if it holds a `BytesType`, `None` if the field is not set or
17026 /// holds a different branch.
17027 pub fn bytes_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Bytes>> {
17028 #[allow(unreachable_patterns)]
17029 self.kind.as_ref().and_then(|v| match v {
17030 crate::model::r#type::Kind::BytesType(v) => std::option::Option::Some(v),
17031 _ => std::option::Option::None,
17032 })
17033 }
17034
17035 /// Sets the value of [kind][crate::model::Type::kind]
17036 /// to hold a `BytesType`.
17037 ///
17038 /// Note that all the setters affecting `kind` are
17039 /// mutually exclusive.
17040 ///
17041 /// # Example
17042 /// ```ignore,no_run
17043 /// # use google_cloud_bigtable_admin_v2::model::Type;
17044 /// use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
17045 /// let x = Type::new().set_bytes_type(Bytes::default()/* use setters */);
17046 /// assert!(x.bytes_type().is_some());
17047 /// assert!(x.string_type().is_none());
17048 /// assert!(x.int64_type().is_none());
17049 /// assert!(x.float32_type().is_none());
17050 /// assert!(x.float64_type().is_none());
17051 /// assert!(x.bool_type().is_none());
17052 /// assert!(x.timestamp_type().is_none());
17053 /// assert!(x.date_type().is_none());
17054 /// assert!(x.aggregate_type().is_none());
17055 /// assert!(x.struct_type().is_none());
17056 /// assert!(x.array_type().is_none());
17057 /// assert!(x.map_type().is_none());
17058 /// assert!(x.proto_type().is_none());
17059 /// assert!(x.enum_type().is_none());
17060 /// ```
17061 pub fn set_bytes_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Bytes>>>(
17062 mut self,
17063 v: T,
17064 ) -> Self {
17065 self.kind = std::option::Option::Some(crate::model::r#type::Kind::BytesType(v.into()));
17066 self
17067 }
17068
17069 /// The value of [kind][crate::model::Type::kind]
17070 /// if it holds a `StringType`, `None` if the field is not set or
17071 /// holds a different branch.
17072 pub fn string_type(
17073 &self,
17074 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::String>> {
17075 #[allow(unreachable_patterns)]
17076 self.kind.as_ref().and_then(|v| match v {
17077 crate::model::r#type::Kind::StringType(v) => std::option::Option::Some(v),
17078 _ => std::option::Option::None,
17079 })
17080 }
17081
17082 /// Sets the value of [kind][crate::model::Type::kind]
17083 /// to hold a `StringType`.
17084 ///
17085 /// Note that all the setters affecting `kind` are
17086 /// mutually exclusive.
17087 ///
17088 /// # Example
17089 /// ```ignore,no_run
17090 /// # use google_cloud_bigtable_admin_v2::model::Type;
17091 /// use google_cloud_bigtable_admin_v2::model::r#type::String;
17092 /// let x = Type::new().set_string_type(String::default()/* use setters */);
17093 /// assert!(x.string_type().is_some());
17094 /// assert!(x.bytes_type().is_none());
17095 /// assert!(x.int64_type().is_none());
17096 /// assert!(x.float32_type().is_none());
17097 /// assert!(x.float64_type().is_none());
17098 /// assert!(x.bool_type().is_none());
17099 /// assert!(x.timestamp_type().is_none());
17100 /// assert!(x.date_type().is_none());
17101 /// assert!(x.aggregate_type().is_none());
17102 /// assert!(x.struct_type().is_none());
17103 /// assert!(x.array_type().is_none());
17104 /// assert!(x.map_type().is_none());
17105 /// assert!(x.proto_type().is_none());
17106 /// assert!(x.enum_type().is_none());
17107 /// ```
17108 pub fn set_string_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::String>>>(
17109 mut self,
17110 v: T,
17111 ) -> Self {
17112 self.kind = std::option::Option::Some(crate::model::r#type::Kind::StringType(v.into()));
17113 self
17114 }
17115
17116 /// The value of [kind][crate::model::Type::kind]
17117 /// if it holds a `Int64Type`, `None` if the field is not set or
17118 /// holds a different branch.
17119 pub fn int64_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Int64>> {
17120 #[allow(unreachable_patterns)]
17121 self.kind.as_ref().and_then(|v| match v {
17122 crate::model::r#type::Kind::Int64Type(v) => std::option::Option::Some(v),
17123 _ => std::option::Option::None,
17124 })
17125 }
17126
17127 /// Sets the value of [kind][crate::model::Type::kind]
17128 /// to hold a `Int64Type`.
17129 ///
17130 /// Note that all the setters affecting `kind` are
17131 /// mutually exclusive.
17132 ///
17133 /// # Example
17134 /// ```ignore,no_run
17135 /// # use google_cloud_bigtable_admin_v2::model::Type;
17136 /// use google_cloud_bigtable_admin_v2::model::r#type::Int64;
17137 /// let x = Type::new().set_int64_type(Int64::default()/* use setters */);
17138 /// assert!(x.int64_type().is_some());
17139 /// assert!(x.bytes_type().is_none());
17140 /// assert!(x.string_type().is_none());
17141 /// assert!(x.float32_type().is_none());
17142 /// assert!(x.float64_type().is_none());
17143 /// assert!(x.bool_type().is_none());
17144 /// assert!(x.timestamp_type().is_none());
17145 /// assert!(x.date_type().is_none());
17146 /// assert!(x.aggregate_type().is_none());
17147 /// assert!(x.struct_type().is_none());
17148 /// assert!(x.array_type().is_none());
17149 /// assert!(x.map_type().is_none());
17150 /// assert!(x.proto_type().is_none());
17151 /// assert!(x.enum_type().is_none());
17152 /// ```
17153 pub fn set_int64_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Int64>>>(
17154 mut self,
17155 v: T,
17156 ) -> Self {
17157 self.kind = std::option::Option::Some(crate::model::r#type::Kind::Int64Type(v.into()));
17158 self
17159 }
17160
17161 /// The value of [kind][crate::model::Type::kind]
17162 /// if it holds a `Float32Type`, `None` if the field is not set or
17163 /// holds a different branch.
17164 pub fn float32_type(
17165 &self,
17166 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Float32>> {
17167 #[allow(unreachable_patterns)]
17168 self.kind.as_ref().and_then(|v| match v {
17169 crate::model::r#type::Kind::Float32Type(v) => std::option::Option::Some(v),
17170 _ => std::option::Option::None,
17171 })
17172 }
17173
17174 /// Sets the value of [kind][crate::model::Type::kind]
17175 /// to hold a `Float32Type`.
17176 ///
17177 /// Note that all the setters affecting `kind` are
17178 /// mutually exclusive.
17179 ///
17180 /// # Example
17181 /// ```ignore,no_run
17182 /// # use google_cloud_bigtable_admin_v2::model::Type;
17183 /// use google_cloud_bigtable_admin_v2::model::r#type::Float32;
17184 /// let x = Type::new().set_float32_type(Float32::default()/* use setters */);
17185 /// assert!(x.float32_type().is_some());
17186 /// assert!(x.bytes_type().is_none());
17187 /// assert!(x.string_type().is_none());
17188 /// assert!(x.int64_type().is_none());
17189 /// assert!(x.float64_type().is_none());
17190 /// assert!(x.bool_type().is_none());
17191 /// assert!(x.timestamp_type().is_none());
17192 /// assert!(x.date_type().is_none());
17193 /// assert!(x.aggregate_type().is_none());
17194 /// assert!(x.struct_type().is_none());
17195 /// assert!(x.array_type().is_none());
17196 /// assert!(x.map_type().is_none());
17197 /// assert!(x.proto_type().is_none());
17198 /// assert!(x.enum_type().is_none());
17199 /// ```
17200 pub fn set_float32_type<
17201 T: std::convert::Into<std::boxed::Box<crate::model::r#type::Float32>>,
17202 >(
17203 mut self,
17204 v: T,
17205 ) -> Self {
17206 self.kind = std::option::Option::Some(crate::model::r#type::Kind::Float32Type(v.into()));
17207 self
17208 }
17209
17210 /// The value of [kind][crate::model::Type::kind]
17211 /// if it holds a `Float64Type`, `None` if the field is not set or
17212 /// holds a different branch.
17213 pub fn float64_type(
17214 &self,
17215 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Float64>> {
17216 #[allow(unreachable_patterns)]
17217 self.kind.as_ref().and_then(|v| match v {
17218 crate::model::r#type::Kind::Float64Type(v) => std::option::Option::Some(v),
17219 _ => std::option::Option::None,
17220 })
17221 }
17222
17223 /// Sets the value of [kind][crate::model::Type::kind]
17224 /// to hold a `Float64Type`.
17225 ///
17226 /// Note that all the setters affecting `kind` are
17227 /// mutually exclusive.
17228 ///
17229 /// # Example
17230 /// ```ignore,no_run
17231 /// # use google_cloud_bigtable_admin_v2::model::Type;
17232 /// use google_cloud_bigtable_admin_v2::model::r#type::Float64;
17233 /// let x = Type::new().set_float64_type(Float64::default()/* use setters */);
17234 /// assert!(x.float64_type().is_some());
17235 /// assert!(x.bytes_type().is_none());
17236 /// assert!(x.string_type().is_none());
17237 /// assert!(x.int64_type().is_none());
17238 /// assert!(x.float32_type().is_none());
17239 /// assert!(x.bool_type().is_none());
17240 /// assert!(x.timestamp_type().is_none());
17241 /// assert!(x.date_type().is_none());
17242 /// assert!(x.aggregate_type().is_none());
17243 /// assert!(x.struct_type().is_none());
17244 /// assert!(x.array_type().is_none());
17245 /// assert!(x.map_type().is_none());
17246 /// assert!(x.proto_type().is_none());
17247 /// assert!(x.enum_type().is_none());
17248 /// ```
17249 pub fn set_float64_type<
17250 T: std::convert::Into<std::boxed::Box<crate::model::r#type::Float64>>,
17251 >(
17252 mut self,
17253 v: T,
17254 ) -> Self {
17255 self.kind = std::option::Option::Some(crate::model::r#type::Kind::Float64Type(v.into()));
17256 self
17257 }
17258
17259 /// The value of [kind][crate::model::Type::kind]
17260 /// if it holds a `BoolType`, `None` if the field is not set or
17261 /// holds a different branch.
17262 pub fn bool_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Bool>> {
17263 #[allow(unreachable_patterns)]
17264 self.kind.as_ref().and_then(|v| match v {
17265 crate::model::r#type::Kind::BoolType(v) => std::option::Option::Some(v),
17266 _ => std::option::Option::None,
17267 })
17268 }
17269
17270 /// Sets the value of [kind][crate::model::Type::kind]
17271 /// to hold a `BoolType`.
17272 ///
17273 /// Note that all the setters affecting `kind` are
17274 /// mutually exclusive.
17275 ///
17276 /// # Example
17277 /// ```ignore,no_run
17278 /// # use google_cloud_bigtable_admin_v2::model::Type;
17279 /// use google_cloud_bigtable_admin_v2::model::r#type::Bool;
17280 /// let x = Type::new().set_bool_type(Bool::default()/* use setters */);
17281 /// assert!(x.bool_type().is_some());
17282 /// assert!(x.bytes_type().is_none());
17283 /// assert!(x.string_type().is_none());
17284 /// assert!(x.int64_type().is_none());
17285 /// assert!(x.float32_type().is_none());
17286 /// assert!(x.float64_type().is_none());
17287 /// assert!(x.timestamp_type().is_none());
17288 /// assert!(x.date_type().is_none());
17289 /// assert!(x.aggregate_type().is_none());
17290 /// assert!(x.struct_type().is_none());
17291 /// assert!(x.array_type().is_none());
17292 /// assert!(x.map_type().is_none());
17293 /// assert!(x.proto_type().is_none());
17294 /// assert!(x.enum_type().is_none());
17295 /// ```
17296 pub fn set_bool_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Bool>>>(
17297 mut self,
17298 v: T,
17299 ) -> Self {
17300 self.kind = std::option::Option::Some(crate::model::r#type::Kind::BoolType(v.into()));
17301 self
17302 }
17303
17304 /// The value of [kind][crate::model::Type::kind]
17305 /// if it holds a `TimestampType`, `None` if the field is not set or
17306 /// holds a different branch.
17307 pub fn timestamp_type(
17308 &self,
17309 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Timestamp>> {
17310 #[allow(unreachable_patterns)]
17311 self.kind.as_ref().and_then(|v| match v {
17312 crate::model::r#type::Kind::TimestampType(v) => std::option::Option::Some(v),
17313 _ => std::option::Option::None,
17314 })
17315 }
17316
17317 /// Sets the value of [kind][crate::model::Type::kind]
17318 /// to hold a `TimestampType`.
17319 ///
17320 /// Note that all the setters affecting `kind` are
17321 /// mutually exclusive.
17322 ///
17323 /// # Example
17324 /// ```ignore,no_run
17325 /// # use google_cloud_bigtable_admin_v2::model::Type;
17326 /// use google_cloud_bigtable_admin_v2::model::r#type::Timestamp;
17327 /// let x = Type::new().set_timestamp_type(Timestamp::default()/* use setters */);
17328 /// assert!(x.timestamp_type().is_some());
17329 /// assert!(x.bytes_type().is_none());
17330 /// assert!(x.string_type().is_none());
17331 /// assert!(x.int64_type().is_none());
17332 /// assert!(x.float32_type().is_none());
17333 /// assert!(x.float64_type().is_none());
17334 /// assert!(x.bool_type().is_none());
17335 /// assert!(x.date_type().is_none());
17336 /// assert!(x.aggregate_type().is_none());
17337 /// assert!(x.struct_type().is_none());
17338 /// assert!(x.array_type().is_none());
17339 /// assert!(x.map_type().is_none());
17340 /// assert!(x.proto_type().is_none());
17341 /// assert!(x.enum_type().is_none());
17342 /// ```
17343 pub fn set_timestamp_type<
17344 T: std::convert::Into<std::boxed::Box<crate::model::r#type::Timestamp>>,
17345 >(
17346 mut self,
17347 v: T,
17348 ) -> Self {
17349 self.kind = std::option::Option::Some(crate::model::r#type::Kind::TimestampType(v.into()));
17350 self
17351 }
17352
17353 /// The value of [kind][crate::model::Type::kind]
17354 /// if it holds a `DateType`, `None` if the field is not set or
17355 /// holds a different branch.
17356 pub fn date_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Date>> {
17357 #[allow(unreachable_patterns)]
17358 self.kind.as_ref().and_then(|v| match v {
17359 crate::model::r#type::Kind::DateType(v) => std::option::Option::Some(v),
17360 _ => std::option::Option::None,
17361 })
17362 }
17363
17364 /// Sets the value of [kind][crate::model::Type::kind]
17365 /// to hold a `DateType`.
17366 ///
17367 /// Note that all the setters affecting `kind` are
17368 /// mutually exclusive.
17369 ///
17370 /// # Example
17371 /// ```ignore,no_run
17372 /// # use google_cloud_bigtable_admin_v2::model::Type;
17373 /// use google_cloud_bigtable_admin_v2::model::r#type::Date;
17374 /// let x = Type::new().set_date_type(Date::default()/* use setters */);
17375 /// assert!(x.date_type().is_some());
17376 /// assert!(x.bytes_type().is_none());
17377 /// assert!(x.string_type().is_none());
17378 /// assert!(x.int64_type().is_none());
17379 /// assert!(x.float32_type().is_none());
17380 /// assert!(x.float64_type().is_none());
17381 /// assert!(x.bool_type().is_none());
17382 /// assert!(x.timestamp_type().is_none());
17383 /// assert!(x.aggregate_type().is_none());
17384 /// assert!(x.struct_type().is_none());
17385 /// assert!(x.array_type().is_none());
17386 /// assert!(x.map_type().is_none());
17387 /// assert!(x.proto_type().is_none());
17388 /// assert!(x.enum_type().is_none());
17389 /// ```
17390 pub fn set_date_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Date>>>(
17391 mut self,
17392 v: T,
17393 ) -> Self {
17394 self.kind = std::option::Option::Some(crate::model::r#type::Kind::DateType(v.into()));
17395 self
17396 }
17397
17398 /// The value of [kind][crate::model::Type::kind]
17399 /// if it holds a `AggregateType`, `None` if the field is not set or
17400 /// holds a different branch.
17401 pub fn aggregate_type(
17402 &self,
17403 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Aggregate>> {
17404 #[allow(unreachable_patterns)]
17405 self.kind.as_ref().and_then(|v| match v {
17406 crate::model::r#type::Kind::AggregateType(v) => std::option::Option::Some(v),
17407 _ => std::option::Option::None,
17408 })
17409 }
17410
17411 /// Sets the value of [kind][crate::model::Type::kind]
17412 /// to hold a `AggregateType`.
17413 ///
17414 /// Note that all the setters affecting `kind` are
17415 /// mutually exclusive.
17416 ///
17417 /// # Example
17418 /// ```ignore,no_run
17419 /// # use google_cloud_bigtable_admin_v2::model::Type;
17420 /// use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
17421 /// let x = Type::new().set_aggregate_type(Aggregate::default()/* use setters */);
17422 /// assert!(x.aggregate_type().is_some());
17423 /// assert!(x.bytes_type().is_none());
17424 /// assert!(x.string_type().is_none());
17425 /// assert!(x.int64_type().is_none());
17426 /// assert!(x.float32_type().is_none());
17427 /// assert!(x.float64_type().is_none());
17428 /// assert!(x.bool_type().is_none());
17429 /// assert!(x.timestamp_type().is_none());
17430 /// assert!(x.date_type().is_none());
17431 /// assert!(x.struct_type().is_none());
17432 /// assert!(x.array_type().is_none());
17433 /// assert!(x.map_type().is_none());
17434 /// assert!(x.proto_type().is_none());
17435 /// assert!(x.enum_type().is_none());
17436 /// ```
17437 pub fn set_aggregate_type<
17438 T: std::convert::Into<std::boxed::Box<crate::model::r#type::Aggregate>>,
17439 >(
17440 mut self,
17441 v: T,
17442 ) -> Self {
17443 self.kind = std::option::Option::Some(crate::model::r#type::Kind::AggregateType(v.into()));
17444 self
17445 }
17446
17447 /// The value of [kind][crate::model::Type::kind]
17448 /// if it holds a `StructType`, `None` if the field is not set or
17449 /// holds a different branch.
17450 pub fn struct_type(
17451 &self,
17452 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Struct>> {
17453 #[allow(unreachable_patterns)]
17454 self.kind.as_ref().and_then(|v| match v {
17455 crate::model::r#type::Kind::StructType(v) => std::option::Option::Some(v),
17456 _ => std::option::Option::None,
17457 })
17458 }
17459
17460 /// Sets the value of [kind][crate::model::Type::kind]
17461 /// to hold a `StructType`.
17462 ///
17463 /// Note that all the setters affecting `kind` are
17464 /// mutually exclusive.
17465 ///
17466 /// # Example
17467 /// ```ignore,no_run
17468 /// # use google_cloud_bigtable_admin_v2::model::Type;
17469 /// use google_cloud_bigtable_admin_v2::model::r#type::Struct;
17470 /// let x = Type::new().set_struct_type(Struct::default()/* use setters */);
17471 /// assert!(x.struct_type().is_some());
17472 /// assert!(x.bytes_type().is_none());
17473 /// assert!(x.string_type().is_none());
17474 /// assert!(x.int64_type().is_none());
17475 /// assert!(x.float32_type().is_none());
17476 /// assert!(x.float64_type().is_none());
17477 /// assert!(x.bool_type().is_none());
17478 /// assert!(x.timestamp_type().is_none());
17479 /// assert!(x.date_type().is_none());
17480 /// assert!(x.aggregate_type().is_none());
17481 /// assert!(x.array_type().is_none());
17482 /// assert!(x.map_type().is_none());
17483 /// assert!(x.proto_type().is_none());
17484 /// assert!(x.enum_type().is_none());
17485 /// ```
17486 pub fn set_struct_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Struct>>>(
17487 mut self,
17488 v: T,
17489 ) -> Self {
17490 self.kind = std::option::Option::Some(crate::model::r#type::Kind::StructType(v.into()));
17491 self
17492 }
17493
17494 /// The value of [kind][crate::model::Type::kind]
17495 /// if it holds a `ArrayType`, `None` if the field is not set or
17496 /// holds a different branch.
17497 pub fn array_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Array>> {
17498 #[allow(unreachable_patterns)]
17499 self.kind.as_ref().and_then(|v| match v {
17500 crate::model::r#type::Kind::ArrayType(v) => std::option::Option::Some(v),
17501 _ => std::option::Option::None,
17502 })
17503 }
17504
17505 /// Sets the value of [kind][crate::model::Type::kind]
17506 /// to hold a `ArrayType`.
17507 ///
17508 /// Note that all the setters affecting `kind` are
17509 /// mutually exclusive.
17510 ///
17511 /// # Example
17512 /// ```ignore,no_run
17513 /// # use google_cloud_bigtable_admin_v2::model::Type;
17514 /// use google_cloud_bigtable_admin_v2::model::r#type::Array;
17515 /// let x = Type::new().set_array_type(Array::default()/* use setters */);
17516 /// assert!(x.array_type().is_some());
17517 /// assert!(x.bytes_type().is_none());
17518 /// assert!(x.string_type().is_none());
17519 /// assert!(x.int64_type().is_none());
17520 /// assert!(x.float32_type().is_none());
17521 /// assert!(x.float64_type().is_none());
17522 /// assert!(x.bool_type().is_none());
17523 /// assert!(x.timestamp_type().is_none());
17524 /// assert!(x.date_type().is_none());
17525 /// assert!(x.aggregate_type().is_none());
17526 /// assert!(x.struct_type().is_none());
17527 /// assert!(x.map_type().is_none());
17528 /// assert!(x.proto_type().is_none());
17529 /// assert!(x.enum_type().is_none());
17530 /// ```
17531 pub fn set_array_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Array>>>(
17532 mut self,
17533 v: T,
17534 ) -> Self {
17535 self.kind = std::option::Option::Some(crate::model::r#type::Kind::ArrayType(v.into()));
17536 self
17537 }
17538
17539 /// The value of [kind][crate::model::Type::kind]
17540 /// if it holds a `MapType`, `None` if the field is not set or
17541 /// holds a different branch.
17542 pub fn map_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Map>> {
17543 #[allow(unreachable_patterns)]
17544 self.kind.as_ref().and_then(|v| match v {
17545 crate::model::r#type::Kind::MapType(v) => std::option::Option::Some(v),
17546 _ => std::option::Option::None,
17547 })
17548 }
17549
17550 /// Sets the value of [kind][crate::model::Type::kind]
17551 /// to hold a `MapType`.
17552 ///
17553 /// Note that all the setters affecting `kind` are
17554 /// mutually exclusive.
17555 ///
17556 /// # Example
17557 /// ```ignore,no_run
17558 /// # use google_cloud_bigtable_admin_v2::model::Type;
17559 /// use google_cloud_bigtable_admin_v2::model::r#type::Map;
17560 /// let x = Type::new().set_map_type(Map::default()/* use setters */);
17561 /// assert!(x.map_type().is_some());
17562 /// assert!(x.bytes_type().is_none());
17563 /// assert!(x.string_type().is_none());
17564 /// assert!(x.int64_type().is_none());
17565 /// assert!(x.float32_type().is_none());
17566 /// assert!(x.float64_type().is_none());
17567 /// assert!(x.bool_type().is_none());
17568 /// assert!(x.timestamp_type().is_none());
17569 /// assert!(x.date_type().is_none());
17570 /// assert!(x.aggregate_type().is_none());
17571 /// assert!(x.struct_type().is_none());
17572 /// assert!(x.array_type().is_none());
17573 /// assert!(x.proto_type().is_none());
17574 /// assert!(x.enum_type().is_none());
17575 /// ```
17576 pub fn set_map_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Map>>>(
17577 mut self,
17578 v: T,
17579 ) -> Self {
17580 self.kind = std::option::Option::Some(crate::model::r#type::Kind::MapType(v.into()));
17581 self
17582 }
17583
17584 /// The value of [kind][crate::model::Type::kind]
17585 /// if it holds a `ProtoType`, `None` if the field is not set or
17586 /// holds a different branch.
17587 pub fn proto_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Proto>> {
17588 #[allow(unreachable_patterns)]
17589 self.kind.as_ref().and_then(|v| match v {
17590 crate::model::r#type::Kind::ProtoType(v) => std::option::Option::Some(v),
17591 _ => std::option::Option::None,
17592 })
17593 }
17594
17595 /// Sets the value of [kind][crate::model::Type::kind]
17596 /// to hold a `ProtoType`.
17597 ///
17598 /// Note that all the setters affecting `kind` are
17599 /// mutually exclusive.
17600 ///
17601 /// # Example
17602 /// ```ignore,no_run
17603 /// # use google_cloud_bigtable_admin_v2::model::Type;
17604 /// use google_cloud_bigtable_admin_v2::model::r#type::Proto;
17605 /// let x = Type::new().set_proto_type(Proto::default()/* use setters */);
17606 /// assert!(x.proto_type().is_some());
17607 /// assert!(x.bytes_type().is_none());
17608 /// assert!(x.string_type().is_none());
17609 /// assert!(x.int64_type().is_none());
17610 /// assert!(x.float32_type().is_none());
17611 /// assert!(x.float64_type().is_none());
17612 /// assert!(x.bool_type().is_none());
17613 /// assert!(x.timestamp_type().is_none());
17614 /// assert!(x.date_type().is_none());
17615 /// assert!(x.aggregate_type().is_none());
17616 /// assert!(x.struct_type().is_none());
17617 /// assert!(x.array_type().is_none());
17618 /// assert!(x.map_type().is_none());
17619 /// assert!(x.enum_type().is_none());
17620 /// ```
17621 pub fn set_proto_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Proto>>>(
17622 mut self,
17623 v: T,
17624 ) -> Self {
17625 self.kind = std::option::Option::Some(crate::model::r#type::Kind::ProtoType(v.into()));
17626 self
17627 }
17628
17629 /// The value of [kind][crate::model::Type::kind]
17630 /// if it holds a `EnumType`, `None` if the field is not set or
17631 /// holds a different branch.
17632 pub fn enum_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Enum>> {
17633 #[allow(unreachable_patterns)]
17634 self.kind.as_ref().and_then(|v| match v {
17635 crate::model::r#type::Kind::EnumType(v) => std::option::Option::Some(v),
17636 _ => std::option::Option::None,
17637 })
17638 }
17639
17640 /// Sets the value of [kind][crate::model::Type::kind]
17641 /// to hold a `EnumType`.
17642 ///
17643 /// Note that all the setters affecting `kind` are
17644 /// mutually exclusive.
17645 ///
17646 /// # Example
17647 /// ```ignore,no_run
17648 /// # use google_cloud_bigtable_admin_v2::model::Type;
17649 /// use google_cloud_bigtable_admin_v2::model::r#type::Enum;
17650 /// let x = Type::new().set_enum_type(Enum::default()/* use setters */);
17651 /// assert!(x.enum_type().is_some());
17652 /// assert!(x.bytes_type().is_none());
17653 /// assert!(x.string_type().is_none());
17654 /// assert!(x.int64_type().is_none());
17655 /// assert!(x.float32_type().is_none());
17656 /// assert!(x.float64_type().is_none());
17657 /// assert!(x.bool_type().is_none());
17658 /// assert!(x.timestamp_type().is_none());
17659 /// assert!(x.date_type().is_none());
17660 /// assert!(x.aggregate_type().is_none());
17661 /// assert!(x.struct_type().is_none());
17662 /// assert!(x.array_type().is_none());
17663 /// assert!(x.map_type().is_none());
17664 /// assert!(x.proto_type().is_none());
17665 /// ```
17666 pub fn set_enum_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Enum>>>(
17667 mut self,
17668 v: T,
17669 ) -> Self {
17670 self.kind = std::option::Option::Some(crate::model::r#type::Kind::EnumType(v.into()));
17671 self
17672 }
17673}
17674
17675impl wkt::message::Message for Type {
17676 fn typename() -> &'static str {
17677 "type.googleapis.com/google.bigtable.admin.v2.Type"
17678 }
17679}
17680
17681/// Defines additional types related to [Type].
17682pub mod r#type {
17683 #[allow(unused_imports)]
17684 use super::*;
17685
17686 /// Bytes
17687 /// Values of type `Bytes` are stored in `Value.bytes_value`.
17688 #[derive(Clone, Default, PartialEq)]
17689 #[non_exhaustive]
17690 pub struct Bytes {
17691 /// The encoding to use when converting to or from lower level types.
17692 pub encoding: std::option::Option<crate::model::r#type::bytes::Encoding>,
17693
17694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17695 }
17696
17697 impl Bytes {
17698 /// Creates a new default instance.
17699 pub fn new() -> Self {
17700 std::default::Default::default()
17701 }
17702
17703 /// Sets the value of [encoding][crate::model::r#type::Bytes::encoding].
17704 ///
17705 /// # Example
17706 /// ```ignore,no_run
17707 /// # use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
17708 /// use google_cloud_bigtable_admin_v2::model::r#type::bytes::Encoding;
17709 /// let x = Bytes::new().set_encoding(Encoding::default()/* use setters */);
17710 /// ```
17711 pub fn set_encoding<T>(mut self, v: T) -> Self
17712 where
17713 T: std::convert::Into<crate::model::r#type::bytes::Encoding>,
17714 {
17715 self.encoding = std::option::Option::Some(v.into());
17716 self
17717 }
17718
17719 /// Sets or clears the value of [encoding][crate::model::r#type::Bytes::encoding].
17720 ///
17721 /// # Example
17722 /// ```ignore,no_run
17723 /// # use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
17724 /// use google_cloud_bigtable_admin_v2::model::r#type::bytes::Encoding;
17725 /// let x = Bytes::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
17726 /// let x = Bytes::new().set_or_clear_encoding(None::<Encoding>);
17727 /// ```
17728 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
17729 where
17730 T: std::convert::Into<crate::model::r#type::bytes::Encoding>,
17731 {
17732 self.encoding = v.map(|x| x.into());
17733 self
17734 }
17735 }
17736
17737 impl wkt::message::Message for Bytes {
17738 fn typename() -> &'static str {
17739 "type.googleapis.com/google.bigtable.admin.v2.Type.Bytes"
17740 }
17741 }
17742
17743 /// Defines additional types related to [Bytes].
17744 pub mod bytes {
17745 #[allow(unused_imports)]
17746 use super::*;
17747
17748 /// Rules used to convert to or from lower level types.
17749 #[derive(Clone, Default, PartialEq)]
17750 #[non_exhaustive]
17751 pub struct Encoding {
17752 /// Which encoding to use.
17753 pub encoding: std::option::Option<crate::model::r#type::bytes::encoding::Encoding>,
17754
17755 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17756 }
17757
17758 impl Encoding {
17759 /// Creates a new default instance.
17760 pub fn new() -> Self {
17761 std::default::Default::default()
17762 }
17763
17764 /// Sets the value of [encoding][crate::model::r#type::bytes::Encoding::encoding].
17765 ///
17766 /// Note that all the setters affecting `encoding` are mutually
17767 /// exclusive.
17768 ///
17769 /// # Example
17770 /// ```ignore,no_run
17771 /// # use google_cloud_bigtable_admin_v2::model::r#type::bytes::Encoding;
17772 /// use google_cloud_bigtable_admin_v2::model::r#type::bytes::encoding::Raw;
17773 /// let x = Encoding::new().set_encoding(Some(
17774 /// google_cloud_bigtable_admin_v2::model::r#type::bytes::encoding::Encoding::Raw(Raw::default().into())));
17775 /// ```
17776 pub fn set_encoding<
17777 T: std::convert::Into<
17778 std::option::Option<crate::model::r#type::bytes::encoding::Encoding>,
17779 >,
17780 >(
17781 mut self,
17782 v: T,
17783 ) -> Self {
17784 self.encoding = v.into();
17785 self
17786 }
17787
17788 /// The value of [encoding][crate::model::r#type::bytes::Encoding::encoding]
17789 /// if it holds a `Raw`, `None` if the field is not set or
17790 /// holds a different branch.
17791 pub fn raw(
17792 &self,
17793 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>>
17794 {
17795 #[allow(unreachable_patterns)]
17796 self.encoding.as_ref().and_then(|v| match v {
17797 crate::model::r#type::bytes::encoding::Encoding::Raw(v) => {
17798 std::option::Option::Some(v)
17799 }
17800 _ => std::option::Option::None,
17801 })
17802 }
17803
17804 /// Sets the value of [encoding][crate::model::r#type::bytes::Encoding::encoding]
17805 /// to hold a `Raw`.
17806 ///
17807 /// Note that all the setters affecting `encoding` are
17808 /// mutually exclusive.
17809 ///
17810 /// # Example
17811 /// ```ignore,no_run
17812 /// # use google_cloud_bigtable_admin_v2::model::r#type::bytes::Encoding;
17813 /// use google_cloud_bigtable_admin_v2::model::r#type::bytes::encoding::Raw;
17814 /// let x = Encoding::new().set_raw(Raw::default()/* use setters */);
17815 /// assert!(x.raw().is_some());
17816 /// ```
17817 pub fn set_raw<
17818 T: std::convert::Into<std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>>,
17819 >(
17820 mut self,
17821 v: T,
17822 ) -> Self {
17823 self.encoding = std::option::Option::Some(
17824 crate::model::r#type::bytes::encoding::Encoding::Raw(v.into()),
17825 );
17826 self
17827 }
17828 }
17829
17830 impl wkt::message::Message for Encoding {
17831 fn typename() -> &'static str {
17832 "type.googleapis.com/google.bigtable.admin.v2.Type.Bytes.Encoding"
17833 }
17834 }
17835
17836 /// Defines additional types related to [Encoding].
17837 pub mod encoding {
17838 #[allow(unused_imports)]
17839 use super::*;
17840
17841 /// Leaves the value as-is.
17842 ///
17843 /// Sorted mode: all values are supported.
17844 ///
17845 /// Distinct mode: all values are supported.
17846 #[derive(Clone, Default, PartialEq)]
17847 #[non_exhaustive]
17848 pub struct Raw {
17849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17850 }
17851
17852 impl Raw {
17853 /// Creates a new default instance.
17854 pub fn new() -> Self {
17855 std::default::Default::default()
17856 }
17857 }
17858
17859 impl wkt::message::Message for Raw {
17860 fn typename() -> &'static str {
17861 "type.googleapis.com/google.bigtable.admin.v2.Type.Bytes.Encoding.Raw"
17862 }
17863 }
17864
17865 /// Which encoding to use.
17866 #[derive(Clone, Debug, PartialEq)]
17867 #[non_exhaustive]
17868 pub enum Encoding {
17869 /// Use `Raw` encoding.
17870 Raw(std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>),
17871 }
17872 }
17873 }
17874
17875 /// String
17876 /// Values of type `String` are stored in `Value.string_value`.
17877 #[derive(Clone, Default, PartialEq)]
17878 #[non_exhaustive]
17879 pub struct String {
17880 /// The encoding to use when converting to or from lower level types.
17881 pub encoding: std::option::Option<crate::model::r#type::string::Encoding>,
17882
17883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17884 }
17885
17886 impl String {
17887 /// Creates a new default instance.
17888 pub fn new() -> Self {
17889 std::default::Default::default()
17890 }
17891
17892 /// Sets the value of [encoding][crate::model::r#type::String::encoding].
17893 ///
17894 /// # Example
17895 /// ```ignore,no_run
17896 /// # use google_cloud_bigtable_admin_v2::model::r#type::String;
17897 /// use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
17898 /// let x = String::new().set_encoding(Encoding::default()/* use setters */);
17899 /// ```
17900 pub fn set_encoding<T>(mut self, v: T) -> Self
17901 where
17902 T: std::convert::Into<crate::model::r#type::string::Encoding>,
17903 {
17904 self.encoding = std::option::Option::Some(v.into());
17905 self
17906 }
17907
17908 /// Sets or clears the value of [encoding][crate::model::r#type::String::encoding].
17909 ///
17910 /// # Example
17911 /// ```ignore,no_run
17912 /// # use google_cloud_bigtable_admin_v2::model::r#type::String;
17913 /// use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
17914 /// let x = String::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
17915 /// let x = String::new().set_or_clear_encoding(None::<Encoding>);
17916 /// ```
17917 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
17918 where
17919 T: std::convert::Into<crate::model::r#type::string::Encoding>,
17920 {
17921 self.encoding = v.map(|x| x.into());
17922 self
17923 }
17924 }
17925
17926 impl wkt::message::Message for String {
17927 fn typename() -> &'static str {
17928 "type.googleapis.com/google.bigtable.admin.v2.Type.String"
17929 }
17930 }
17931
17932 /// Defines additional types related to [String].
17933 pub mod string {
17934 #[allow(unused_imports)]
17935 use super::*;
17936
17937 /// Rules used to convert to or from lower level types.
17938 #[derive(Clone, Default, PartialEq)]
17939 #[non_exhaustive]
17940 pub struct Encoding {
17941 /// Which encoding to use.
17942 pub encoding: std::option::Option<crate::model::r#type::string::encoding::Encoding>,
17943
17944 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17945 }
17946
17947 impl Encoding {
17948 /// Creates a new default instance.
17949 pub fn new() -> Self {
17950 std::default::Default::default()
17951 }
17952
17953 /// Sets the value of [encoding][crate::model::r#type::string::Encoding::encoding].
17954 ///
17955 /// Note that all the setters affecting `encoding` are mutually
17956 /// exclusive.
17957 ///
17958 /// # Example
17959 /// ```ignore,no_run
17960 /// # use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
17961 /// use google_cloud_bigtable_admin_v2::model::r#type::string::encoding::Utf8Bytes;
17962 /// let x = Encoding::new().set_encoding(Some(
17963 /// google_cloud_bigtable_admin_v2::model::r#type::string::encoding::Encoding::Utf8Bytes(Utf8Bytes::default().into())));
17964 /// ```
17965 pub fn set_encoding<
17966 T: std::convert::Into<
17967 std::option::Option<crate::model::r#type::string::encoding::Encoding>,
17968 >,
17969 >(
17970 mut self,
17971 v: T,
17972 ) -> Self {
17973 self.encoding = v.into();
17974 self
17975 }
17976
17977 /// The value of [encoding][crate::model::r#type::string::Encoding::encoding]
17978 /// if it holds a `Utf8Raw`, `None` if the field is not set or
17979 /// holds a different branch.
17980 #[deprecated]
17981 pub fn utf8_raw(
17982 &self,
17983 ) -> std::option::Option<
17984 &std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>,
17985 > {
17986 #[allow(unreachable_patterns)]
17987 self.encoding.as_ref().and_then(|v| match v {
17988 crate::model::r#type::string::encoding::Encoding::Utf8Raw(v) => {
17989 std::option::Option::Some(v)
17990 }
17991 _ => std::option::Option::None,
17992 })
17993 }
17994
17995 /// Sets the value of [encoding][crate::model::r#type::string::Encoding::encoding]
17996 /// to hold a `Utf8Raw`.
17997 ///
17998 /// Note that all the setters affecting `encoding` are
17999 /// mutually exclusive.
18000 ///
18001 /// # Example
18002 /// ```ignore,no_run
18003 /// # use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
18004 /// use google_cloud_bigtable_admin_v2::model::r#type::string::encoding::Utf8Raw;
18005 /// let x = Encoding::new().set_utf8_raw(Utf8Raw::default()/* use setters */);
18006 /// assert!(x.utf8_raw().is_some());
18007 /// assert!(x.utf8_bytes().is_none());
18008 /// ```
18009 #[deprecated]
18010 pub fn set_utf8_raw<
18011 T: std::convert::Into<
18012 std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>,
18013 >,
18014 >(
18015 mut self,
18016 v: T,
18017 ) -> Self {
18018 self.encoding = std::option::Option::Some(
18019 crate::model::r#type::string::encoding::Encoding::Utf8Raw(v.into()),
18020 );
18021 self
18022 }
18023
18024 /// The value of [encoding][crate::model::r#type::string::Encoding::encoding]
18025 /// if it holds a `Utf8Bytes`, `None` if the field is not set or
18026 /// holds a different branch.
18027 pub fn utf8_bytes(
18028 &self,
18029 ) -> std::option::Option<
18030 &std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>,
18031 > {
18032 #[allow(unreachable_patterns)]
18033 self.encoding.as_ref().and_then(|v| match v {
18034 crate::model::r#type::string::encoding::Encoding::Utf8Bytes(v) => {
18035 std::option::Option::Some(v)
18036 }
18037 _ => std::option::Option::None,
18038 })
18039 }
18040
18041 /// Sets the value of [encoding][crate::model::r#type::string::Encoding::encoding]
18042 /// to hold a `Utf8Bytes`.
18043 ///
18044 /// Note that all the setters affecting `encoding` are
18045 /// mutually exclusive.
18046 ///
18047 /// # Example
18048 /// ```ignore,no_run
18049 /// # use google_cloud_bigtable_admin_v2::model::r#type::string::Encoding;
18050 /// use google_cloud_bigtable_admin_v2::model::r#type::string::encoding::Utf8Bytes;
18051 /// let x = Encoding::new().set_utf8_bytes(Utf8Bytes::default()/* use setters */);
18052 /// assert!(x.utf8_bytes().is_some());
18053 /// assert!(x.utf8_raw().is_none());
18054 /// ```
18055 pub fn set_utf8_bytes<
18056 T: std::convert::Into<
18057 std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>,
18058 >,
18059 >(
18060 mut self,
18061 v: T,
18062 ) -> Self {
18063 self.encoding = std::option::Option::Some(
18064 crate::model::r#type::string::encoding::Encoding::Utf8Bytes(v.into()),
18065 );
18066 self
18067 }
18068 }
18069
18070 impl wkt::message::Message for Encoding {
18071 fn typename() -> &'static str {
18072 "type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding"
18073 }
18074 }
18075
18076 /// Defines additional types related to [Encoding].
18077 pub mod encoding {
18078 #[allow(unused_imports)]
18079 use super::*;
18080
18081 /// Deprecated: prefer the equivalent `Utf8Bytes`.
18082 #[derive(Clone, Default, PartialEq)]
18083 #[non_exhaustive]
18084 #[deprecated]
18085 pub struct Utf8Raw {
18086 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18087 }
18088
18089 impl Utf8Raw {
18090 /// Creates a new default instance.
18091 pub fn new() -> Self {
18092 std::default::Default::default()
18093 }
18094 }
18095
18096 impl wkt::message::Message for Utf8Raw {
18097 fn typename() -> &'static str {
18098 "type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw"
18099 }
18100 }
18101
18102 /// UTF-8 encoding.
18103 ///
18104 /// Sorted mode:
18105 ///
18106 /// - All values are supported.
18107 /// - Code point order is preserved.
18108 ///
18109 /// Distinct mode: all values are supported.
18110 ///
18111 /// Compatible with:
18112 ///
18113 /// - BigQuery `TEXT` encoding
18114 /// - HBase `Bytes.toBytes`
18115 /// - Java `String#getBytes(StandardCharsets.UTF_8)`
18116 #[derive(Clone, Default, PartialEq)]
18117 #[non_exhaustive]
18118 pub struct Utf8Bytes {
18119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18120 }
18121
18122 impl Utf8Bytes {
18123 /// Creates a new default instance.
18124 pub fn new() -> Self {
18125 std::default::Default::default()
18126 }
18127 }
18128
18129 impl wkt::message::Message for Utf8Bytes {
18130 fn typename() -> &'static str {
18131 "type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes"
18132 }
18133 }
18134
18135 /// Which encoding to use.
18136 #[derive(Clone, Debug, PartialEq)]
18137 #[non_exhaustive]
18138 pub enum Encoding {
18139 /// Deprecated: if set, converts to an empty `utf8_bytes`.
18140 #[deprecated]
18141 Utf8Raw(std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>),
18142 /// Use `Utf8Bytes` encoding.
18143 Utf8Bytes(std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>),
18144 }
18145 }
18146 }
18147
18148 /// Int64
18149 /// Values of type `Int64` are stored in `Value.int_value`.
18150 #[derive(Clone, Default, PartialEq)]
18151 #[non_exhaustive]
18152 pub struct Int64 {
18153 /// The encoding to use when converting to or from lower level types.
18154 pub encoding: std::option::Option<crate::model::r#type::int_64::Encoding>,
18155
18156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18157 }
18158
18159 impl Int64 {
18160 /// Creates a new default instance.
18161 pub fn new() -> Self {
18162 std::default::Default::default()
18163 }
18164
18165 /// Sets the value of [encoding][crate::model::r#type::Int64::encoding].
18166 ///
18167 /// # Example
18168 /// ```ignore,no_run
18169 /// # use google_cloud_bigtable_admin_v2::model::r#type::Int64;
18170 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
18171 /// let x = Int64::new().set_encoding(Encoding::default()/* use setters */);
18172 /// ```
18173 pub fn set_encoding<T>(mut self, v: T) -> Self
18174 where
18175 T: std::convert::Into<crate::model::r#type::int_64::Encoding>,
18176 {
18177 self.encoding = std::option::Option::Some(v.into());
18178 self
18179 }
18180
18181 /// Sets or clears the value of [encoding][crate::model::r#type::Int64::encoding].
18182 ///
18183 /// # Example
18184 /// ```ignore,no_run
18185 /// # use google_cloud_bigtable_admin_v2::model::r#type::Int64;
18186 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
18187 /// let x = Int64::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
18188 /// let x = Int64::new().set_or_clear_encoding(None::<Encoding>);
18189 /// ```
18190 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
18191 where
18192 T: std::convert::Into<crate::model::r#type::int_64::Encoding>,
18193 {
18194 self.encoding = v.map(|x| x.into());
18195 self
18196 }
18197 }
18198
18199 impl wkt::message::Message for Int64 {
18200 fn typename() -> &'static str {
18201 "type.googleapis.com/google.bigtable.admin.v2.Type.Int64"
18202 }
18203 }
18204
18205 /// Defines additional types related to [Int64].
18206 pub mod int_64 {
18207 #[allow(unused_imports)]
18208 use super::*;
18209
18210 /// Rules used to convert to or from lower level types.
18211 #[derive(Clone, Default, PartialEq)]
18212 #[non_exhaustive]
18213 pub struct Encoding {
18214 /// Which encoding to use.
18215 pub encoding: std::option::Option<crate::model::r#type::int_64::encoding::Encoding>,
18216
18217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18218 }
18219
18220 impl Encoding {
18221 /// Creates a new default instance.
18222 pub fn new() -> Self {
18223 std::default::Default::default()
18224 }
18225
18226 /// Sets the value of [encoding][crate::model::r#type::int_64::Encoding::encoding].
18227 ///
18228 /// Note that all the setters affecting `encoding` are mutually
18229 /// exclusive.
18230 ///
18231 /// # Example
18232 /// ```ignore,no_run
18233 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
18234 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::BigEndianBytes;
18235 /// let x = Encoding::new().set_encoding(Some(
18236 /// google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::Encoding::BigEndianBytes(BigEndianBytes::default().into())));
18237 /// ```
18238 pub fn set_encoding<
18239 T: std::convert::Into<
18240 std::option::Option<crate::model::r#type::int_64::encoding::Encoding>,
18241 >,
18242 >(
18243 mut self,
18244 v: T,
18245 ) -> Self {
18246 self.encoding = v.into();
18247 self
18248 }
18249
18250 /// The value of [encoding][crate::model::r#type::int_64::Encoding::encoding]
18251 /// if it holds a `BigEndianBytes`, `None` if the field is not set or
18252 /// holds a different branch.
18253 pub fn big_endian_bytes(
18254 &self,
18255 ) -> std::option::Option<
18256 &std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
18257 > {
18258 #[allow(unreachable_patterns)]
18259 self.encoding.as_ref().and_then(|v| match v {
18260 crate::model::r#type::int_64::encoding::Encoding::BigEndianBytes(v) => {
18261 std::option::Option::Some(v)
18262 }
18263 _ => std::option::Option::None,
18264 })
18265 }
18266
18267 /// Sets the value of [encoding][crate::model::r#type::int_64::Encoding::encoding]
18268 /// to hold a `BigEndianBytes`.
18269 ///
18270 /// Note that all the setters affecting `encoding` are
18271 /// mutually exclusive.
18272 ///
18273 /// # Example
18274 /// ```ignore,no_run
18275 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
18276 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::BigEndianBytes;
18277 /// let x = Encoding::new().set_big_endian_bytes(BigEndianBytes::default()/* use setters */);
18278 /// assert!(x.big_endian_bytes().is_some());
18279 /// assert!(x.ordered_code_bytes().is_none());
18280 /// ```
18281 pub fn set_big_endian_bytes<
18282 T: std::convert::Into<
18283 std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
18284 >,
18285 >(
18286 mut self,
18287 v: T,
18288 ) -> Self {
18289 self.encoding = std::option::Option::Some(
18290 crate::model::r#type::int_64::encoding::Encoding::BigEndianBytes(v.into()),
18291 );
18292 self
18293 }
18294
18295 /// The value of [encoding][crate::model::r#type::int_64::Encoding::encoding]
18296 /// if it holds a `OrderedCodeBytes`, `None` if the field is not set or
18297 /// holds a different branch.
18298 pub fn ordered_code_bytes(
18299 &self,
18300 ) -> std::option::Option<
18301 &std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
18302 > {
18303 #[allow(unreachable_patterns)]
18304 self.encoding.as_ref().and_then(|v| match v {
18305 crate::model::r#type::int_64::encoding::Encoding::OrderedCodeBytes(v) => {
18306 std::option::Option::Some(v)
18307 }
18308 _ => std::option::Option::None,
18309 })
18310 }
18311
18312 /// Sets the value of [encoding][crate::model::r#type::int_64::Encoding::encoding]
18313 /// to hold a `OrderedCodeBytes`.
18314 ///
18315 /// Note that all the setters affecting `encoding` are
18316 /// mutually exclusive.
18317 ///
18318 /// # Example
18319 /// ```ignore,no_run
18320 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding;
18321 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::OrderedCodeBytes;
18322 /// let x = Encoding::new().set_ordered_code_bytes(OrderedCodeBytes::default()/* use setters */);
18323 /// assert!(x.ordered_code_bytes().is_some());
18324 /// assert!(x.big_endian_bytes().is_none());
18325 /// ```
18326 pub fn set_ordered_code_bytes<
18327 T: std::convert::Into<
18328 std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
18329 >,
18330 >(
18331 mut self,
18332 v: T,
18333 ) -> Self {
18334 self.encoding = std::option::Option::Some(
18335 crate::model::r#type::int_64::encoding::Encoding::OrderedCodeBytes(v.into()),
18336 );
18337 self
18338 }
18339 }
18340
18341 impl wkt::message::Message for Encoding {
18342 fn typename() -> &'static str {
18343 "type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding"
18344 }
18345 }
18346
18347 /// Defines additional types related to [Encoding].
18348 pub mod encoding {
18349 #[allow(unused_imports)]
18350 use super::*;
18351
18352 /// Encodes the value as an 8-byte big-endian two's complement value.
18353 ///
18354 /// Sorted mode: non-negative values are supported.
18355 ///
18356 /// Distinct mode: all values are supported.
18357 ///
18358 /// Compatible with:
18359 ///
18360 /// - BigQuery `BINARY` encoding
18361 /// - HBase `Bytes.toBytes`
18362 /// - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN`
18363 #[derive(Clone, Default, PartialEq)]
18364 #[non_exhaustive]
18365 pub struct BigEndianBytes {
18366 /// Deprecated: ignored if set.
18367 #[deprecated]
18368 pub bytes_type: std::option::Option<crate::model::r#type::Bytes>,
18369
18370 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18371 }
18372
18373 impl BigEndianBytes {
18374 /// Creates a new default instance.
18375 pub fn new() -> Self {
18376 std::default::Default::default()
18377 }
18378
18379 /// Sets the value of [bytes_type][crate::model::r#type::int_64::encoding::BigEndianBytes::bytes_type].
18380 ///
18381 /// # Example
18382 /// ```ignore,no_run
18383 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::BigEndianBytes;
18384 /// use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
18385 /// let x = BigEndianBytes::new().set_bytes_type(Bytes::default()/* use setters */);
18386 /// ```
18387 #[deprecated]
18388 pub fn set_bytes_type<T>(mut self, v: T) -> Self
18389 where
18390 T: std::convert::Into<crate::model::r#type::Bytes>,
18391 {
18392 self.bytes_type = std::option::Option::Some(v.into());
18393 self
18394 }
18395
18396 /// Sets or clears the value of [bytes_type][crate::model::r#type::int_64::encoding::BigEndianBytes::bytes_type].
18397 ///
18398 /// # Example
18399 /// ```ignore,no_run
18400 /// # use google_cloud_bigtable_admin_v2::model::r#type::int_64::encoding::BigEndianBytes;
18401 /// use google_cloud_bigtable_admin_v2::model::r#type::Bytes;
18402 /// let x = BigEndianBytes::new().set_or_clear_bytes_type(Some(Bytes::default()/* use setters */));
18403 /// let x = BigEndianBytes::new().set_or_clear_bytes_type(None::<Bytes>);
18404 /// ```
18405 #[deprecated]
18406 pub fn set_or_clear_bytes_type<T>(mut self, v: std::option::Option<T>) -> Self
18407 where
18408 T: std::convert::Into<crate::model::r#type::Bytes>,
18409 {
18410 self.bytes_type = v.map(|x| x.into());
18411 self
18412 }
18413 }
18414
18415 impl wkt::message::Message for BigEndianBytes {
18416 fn typename() -> &'static str {
18417 "type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes"
18418 }
18419 }
18420
18421 /// Encodes the value in a variable length binary format of up to 10 bytes.
18422 /// Values that are closer to zero use fewer bytes.
18423 ///
18424 /// Sorted mode: all values are supported.
18425 ///
18426 /// Distinct mode: all values are supported.
18427 #[derive(Clone, Default, PartialEq)]
18428 #[non_exhaustive]
18429 pub struct OrderedCodeBytes {
18430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18431 }
18432
18433 impl OrderedCodeBytes {
18434 /// Creates a new default instance.
18435 pub fn new() -> Self {
18436 std::default::Default::default()
18437 }
18438 }
18439
18440 impl wkt::message::Message for OrderedCodeBytes {
18441 fn typename() -> &'static str {
18442 "type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes"
18443 }
18444 }
18445
18446 /// Which encoding to use.
18447 #[derive(Clone, Debug, PartialEq)]
18448 #[non_exhaustive]
18449 pub enum Encoding {
18450 /// Use `BigEndianBytes` encoding.
18451 BigEndianBytes(
18452 std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
18453 ),
18454 /// Use `OrderedCodeBytes` encoding.
18455 OrderedCodeBytes(
18456 std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
18457 ),
18458 }
18459 }
18460 }
18461
18462 /// bool
18463 /// Values of type `Bool` are stored in `Value.bool_value`.
18464 #[derive(Clone, Default, PartialEq)]
18465 #[non_exhaustive]
18466 pub struct Bool {
18467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18468 }
18469
18470 impl Bool {
18471 /// Creates a new default instance.
18472 pub fn new() -> Self {
18473 std::default::Default::default()
18474 }
18475 }
18476
18477 impl wkt::message::Message for Bool {
18478 fn typename() -> &'static str {
18479 "type.googleapis.com/google.bigtable.admin.v2.Type.Bool"
18480 }
18481 }
18482
18483 /// Float32
18484 /// Values of type `Float32` are stored in `Value.float_value`.
18485 #[derive(Clone, Default, PartialEq)]
18486 #[non_exhaustive]
18487 pub struct Float32 {
18488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18489 }
18490
18491 impl Float32 {
18492 /// Creates a new default instance.
18493 pub fn new() -> Self {
18494 std::default::Default::default()
18495 }
18496 }
18497
18498 impl wkt::message::Message for Float32 {
18499 fn typename() -> &'static str {
18500 "type.googleapis.com/google.bigtable.admin.v2.Type.Float32"
18501 }
18502 }
18503
18504 /// Float64
18505 /// Values of type `Float64` are stored in `Value.float_value`.
18506 #[derive(Clone, Default, PartialEq)]
18507 #[non_exhaustive]
18508 pub struct Float64 {
18509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18510 }
18511
18512 impl Float64 {
18513 /// Creates a new default instance.
18514 pub fn new() -> Self {
18515 std::default::Default::default()
18516 }
18517 }
18518
18519 impl wkt::message::Message for Float64 {
18520 fn typename() -> &'static str {
18521 "type.googleapis.com/google.bigtable.admin.v2.Type.Float64"
18522 }
18523 }
18524
18525 /// Timestamp
18526 /// Values of type `Timestamp` are stored in `Value.timestamp_value`.
18527 #[derive(Clone, Default, PartialEq)]
18528 #[non_exhaustive]
18529 pub struct Timestamp {
18530 /// The encoding to use when converting to or from lower level types.
18531 pub encoding: std::option::Option<crate::model::r#type::timestamp::Encoding>,
18532
18533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18534 }
18535
18536 impl Timestamp {
18537 /// Creates a new default instance.
18538 pub fn new() -> Self {
18539 std::default::Default::default()
18540 }
18541
18542 /// Sets the value of [encoding][crate::model::r#type::Timestamp::encoding].
18543 ///
18544 /// # Example
18545 /// ```ignore,no_run
18546 /// # use google_cloud_bigtable_admin_v2::model::r#type::Timestamp;
18547 /// use google_cloud_bigtable_admin_v2::model::r#type::timestamp::Encoding;
18548 /// let x = Timestamp::new().set_encoding(Encoding::default()/* use setters */);
18549 /// ```
18550 pub fn set_encoding<T>(mut self, v: T) -> Self
18551 where
18552 T: std::convert::Into<crate::model::r#type::timestamp::Encoding>,
18553 {
18554 self.encoding = std::option::Option::Some(v.into());
18555 self
18556 }
18557
18558 /// Sets or clears the value of [encoding][crate::model::r#type::Timestamp::encoding].
18559 ///
18560 /// # Example
18561 /// ```ignore,no_run
18562 /// # use google_cloud_bigtable_admin_v2::model::r#type::Timestamp;
18563 /// use google_cloud_bigtable_admin_v2::model::r#type::timestamp::Encoding;
18564 /// let x = Timestamp::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
18565 /// let x = Timestamp::new().set_or_clear_encoding(None::<Encoding>);
18566 /// ```
18567 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
18568 where
18569 T: std::convert::Into<crate::model::r#type::timestamp::Encoding>,
18570 {
18571 self.encoding = v.map(|x| x.into());
18572 self
18573 }
18574 }
18575
18576 impl wkt::message::Message for Timestamp {
18577 fn typename() -> &'static str {
18578 "type.googleapis.com/google.bigtable.admin.v2.Type.Timestamp"
18579 }
18580 }
18581
18582 /// Defines additional types related to [Timestamp].
18583 pub mod timestamp {
18584 #[allow(unused_imports)]
18585 use super::*;
18586
18587 /// Rules used to convert to or from lower level types.
18588 #[derive(Clone, Default, PartialEq)]
18589 #[non_exhaustive]
18590 pub struct Encoding {
18591 /// Which encoding to use.
18592 pub encoding: std::option::Option<crate::model::r#type::timestamp::encoding::Encoding>,
18593
18594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18595 }
18596
18597 impl Encoding {
18598 /// Creates a new default instance.
18599 pub fn new() -> Self {
18600 std::default::Default::default()
18601 }
18602
18603 /// Sets the value of [encoding][crate::model::r#type::timestamp::Encoding::encoding].
18604 ///
18605 /// Note that all the setters affecting `encoding` are mutually
18606 /// exclusive.
18607 ///
18608 /// # Example
18609 /// ```ignore,no_run
18610 /// # use google_cloud_bigtable_admin_v2::model::r#type::timestamp::Encoding;
18611 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding as UnixMicrosInt64;
18612 /// let x = Encoding::new().set_encoding(Some(
18613 /// google_cloud_bigtable_admin_v2::model::r#type::timestamp::encoding::Encoding::UnixMicrosInt64(UnixMicrosInt64::default().into())));
18614 /// ```
18615 pub fn set_encoding<
18616 T: std::convert::Into<
18617 std::option::Option<crate::model::r#type::timestamp::encoding::Encoding>,
18618 >,
18619 >(
18620 mut self,
18621 v: T,
18622 ) -> Self {
18623 self.encoding = v.into();
18624 self
18625 }
18626
18627 /// The value of [encoding][crate::model::r#type::timestamp::Encoding::encoding]
18628 /// if it holds a `UnixMicrosInt64`, `None` if the field is not set or
18629 /// holds a different branch.
18630 pub fn unix_micros_int64(
18631 &self,
18632 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::int_64::Encoding>>
18633 {
18634 #[allow(unreachable_patterns)]
18635 self.encoding.as_ref().and_then(|v| match v {
18636 crate::model::r#type::timestamp::encoding::Encoding::UnixMicrosInt64(v) => {
18637 std::option::Option::Some(v)
18638 }
18639 _ => std::option::Option::None,
18640 })
18641 }
18642
18643 /// Sets the value of [encoding][crate::model::r#type::timestamp::Encoding::encoding]
18644 /// to hold a `UnixMicrosInt64`.
18645 ///
18646 /// Note that all the setters affecting `encoding` are
18647 /// mutually exclusive.
18648 ///
18649 /// # Example
18650 /// ```ignore,no_run
18651 /// # use google_cloud_bigtable_admin_v2::model::r#type::timestamp::Encoding;
18652 /// use google_cloud_bigtable_admin_v2::model::r#type::int_64::Encoding as UnixMicrosInt64;
18653 /// let x = Encoding::new().set_unix_micros_int64(UnixMicrosInt64::default()/* use setters */);
18654 /// assert!(x.unix_micros_int64().is_some());
18655 /// ```
18656 pub fn set_unix_micros_int64<
18657 T: std::convert::Into<std::boxed::Box<crate::model::r#type::int_64::Encoding>>,
18658 >(
18659 mut self,
18660 v: T,
18661 ) -> Self {
18662 self.encoding = std::option::Option::Some(
18663 crate::model::r#type::timestamp::encoding::Encoding::UnixMicrosInt64(v.into()),
18664 );
18665 self
18666 }
18667 }
18668
18669 impl wkt::message::Message for Encoding {
18670 fn typename() -> &'static str {
18671 "type.googleapis.com/google.bigtable.admin.v2.Type.Timestamp.Encoding"
18672 }
18673 }
18674
18675 /// Defines additional types related to [Encoding].
18676 pub mod encoding {
18677 #[allow(unused_imports)]
18678 use super::*;
18679
18680 /// Which encoding to use.
18681 #[derive(Clone, Debug, PartialEq)]
18682 #[non_exhaustive]
18683 pub enum Encoding {
18684 /// Encodes the number of microseconds since the Unix epoch using the
18685 /// given `Int64` encoding. Values must be microsecond-aligned.
18686 ///
18687 /// Compatible with:
18688 ///
18689 /// - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
18690 UnixMicrosInt64(std::boxed::Box<crate::model::r#type::int_64::Encoding>),
18691 }
18692 }
18693 }
18694
18695 /// Date
18696 /// Values of type `Date` are stored in `Value.date_value`.
18697 #[derive(Clone, Default, PartialEq)]
18698 #[non_exhaustive]
18699 pub struct Date {
18700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18701 }
18702
18703 impl Date {
18704 /// Creates a new default instance.
18705 pub fn new() -> Self {
18706 std::default::Default::default()
18707 }
18708 }
18709
18710 impl wkt::message::Message for Date {
18711 fn typename() -> &'static str {
18712 "type.googleapis.com/google.bigtable.admin.v2.Type.Date"
18713 }
18714 }
18715
18716 /// A structured data value, consisting of fields which map to dynamically
18717 /// typed values.
18718 /// Values of type `Struct` are stored in `Value.array_value` where entries are
18719 /// in the same order and number as `field_types`.
18720 #[derive(Clone, Default, PartialEq)]
18721 #[non_exhaustive]
18722 pub struct Struct {
18723 /// The names and types of the fields in this struct.
18724 pub fields: std::vec::Vec<crate::model::r#type::r#struct::Field>,
18725
18726 /// The encoding to use when converting to or from lower level types.
18727 pub encoding: std::option::Option<crate::model::r#type::r#struct::Encoding>,
18728
18729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18730 }
18731
18732 impl Struct {
18733 /// Creates a new default instance.
18734 pub fn new() -> Self {
18735 std::default::Default::default()
18736 }
18737
18738 /// Sets the value of [fields][crate::model::r#type::Struct::fields].
18739 ///
18740 /// # Example
18741 /// ```ignore,no_run
18742 /// # use google_cloud_bigtable_admin_v2::model::r#type::Struct;
18743 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Field;
18744 /// let x = Struct::new()
18745 /// .set_fields([
18746 /// Field::default()/* use setters */,
18747 /// Field::default()/* use (different) setters */,
18748 /// ]);
18749 /// ```
18750 pub fn set_fields<T, V>(mut self, v: T) -> Self
18751 where
18752 T: std::iter::IntoIterator<Item = V>,
18753 V: std::convert::Into<crate::model::r#type::r#struct::Field>,
18754 {
18755 use std::iter::Iterator;
18756 self.fields = v.into_iter().map(|i| i.into()).collect();
18757 self
18758 }
18759
18760 /// Sets the value of [encoding][crate::model::r#type::Struct::encoding].
18761 ///
18762 /// # Example
18763 /// ```ignore,no_run
18764 /// # use google_cloud_bigtable_admin_v2::model::r#type::Struct;
18765 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
18766 /// let x = Struct::new().set_encoding(Encoding::default()/* use setters */);
18767 /// ```
18768 pub fn set_encoding<T>(mut self, v: T) -> Self
18769 where
18770 T: std::convert::Into<crate::model::r#type::r#struct::Encoding>,
18771 {
18772 self.encoding = std::option::Option::Some(v.into());
18773 self
18774 }
18775
18776 /// Sets or clears the value of [encoding][crate::model::r#type::Struct::encoding].
18777 ///
18778 /// # Example
18779 /// ```ignore,no_run
18780 /// # use google_cloud_bigtable_admin_v2::model::r#type::Struct;
18781 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
18782 /// let x = Struct::new().set_or_clear_encoding(Some(Encoding::default()/* use setters */));
18783 /// let x = Struct::new().set_or_clear_encoding(None::<Encoding>);
18784 /// ```
18785 pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
18786 where
18787 T: std::convert::Into<crate::model::r#type::r#struct::Encoding>,
18788 {
18789 self.encoding = v.map(|x| x.into());
18790 self
18791 }
18792 }
18793
18794 impl wkt::message::Message for Struct {
18795 fn typename() -> &'static str {
18796 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct"
18797 }
18798 }
18799
18800 /// Defines additional types related to [Struct].
18801 pub mod r#struct {
18802 #[allow(unused_imports)]
18803 use super::*;
18804
18805 /// A struct field and its type.
18806 #[derive(Clone, Default, PartialEq)]
18807 #[non_exhaustive]
18808 pub struct Field {
18809 /// The field name (optional). Fields without a `field_name` are considered
18810 /// anonymous and cannot be referenced by name.
18811 pub field_name: std::string::String,
18812
18813 /// The type of values in this field.
18814 pub r#type: std::option::Option<std::boxed::Box<crate::model::Type>>,
18815
18816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18817 }
18818
18819 impl Field {
18820 /// Creates a new default instance.
18821 pub fn new() -> Self {
18822 std::default::Default::default()
18823 }
18824
18825 /// Sets the value of [field_name][crate::model::r#type::r#struct::Field::field_name].
18826 ///
18827 /// # Example
18828 /// ```ignore,no_run
18829 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Field;
18830 /// let x = Field::new().set_field_name("example");
18831 /// ```
18832 pub fn set_field_name<T: std::convert::Into<std::string::String>>(
18833 mut self,
18834 v: T,
18835 ) -> Self {
18836 self.field_name = v.into();
18837 self
18838 }
18839
18840 /// Sets the value of [r#type][crate::model::r#type::r#struct::Field::type].
18841 ///
18842 /// # Example
18843 /// ```ignore,no_run
18844 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Field;
18845 /// use google_cloud_bigtable_admin_v2::model::Type;
18846 /// let x = Field::new().set_type(Type::default()/* use setters */);
18847 /// ```
18848 pub fn set_type<T>(mut self, v: T) -> Self
18849 where
18850 T: std::convert::Into<crate::model::Type>,
18851 {
18852 self.r#type = std::option::Option::Some(std::boxed::Box::new(v.into()));
18853 self
18854 }
18855
18856 /// Sets or clears the value of [r#type][crate::model::r#type::r#struct::Field::type].
18857 ///
18858 /// # Example
18859 /// ```ignore,no_run
18860 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Field;
18861 /// use google_cloud_bigtable_admin_v2::model::Type;
18862 /// let x = Field::new().set_or_clear_type(Some(Type::default()/* use setters */));
18863 /// let x = Field::new().set_or_clear_type(None::<Type>);
18864 /// ```
18865 pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
18866 where
18867 T: std::convert::Into<crate::model::Type>,
18868 {
18869 self.r#type = v.map(|x| std::boxed::Box::new(x.into()));
18870 self
18871 }
18872 }
18873
18874 impl wkt::message::Message for Field {
18875 fn typename() -> &'static str {
18876 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Field"
18877 }
18878 }
18879
18880 /// Rules used to convert to or from lower level types.
18881 #[derive(Clone, Default, PartialEq)]
18882 #[non_exhaustive]
18883 pub struct Encoding {
18884 /// Which encoding to use.
18885 pub encoding: std::option::Option<crate::model::r#type::r#struct::encoding::Encoding>,
18886
18887 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18888 }
18889
18890 impl Encoding {
18891 /// Creates a new default instance.
18892 pub fn new() -> Self {
18893 std::default::Default::default()
18894 }
18895
18896 /// Sets the value of [encoding][crate::model::r#type::r#struct::Encoding::encoding].
18897 ///
18898 /// Note that all the setters affecting `encoding` are mutually
18899 /// exclusive.
18900 ///
18901 /// # Example
18902 /// ```ignore,no_run
18903 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
18904 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::Singleton;
18905 /// let x = Encoding::new().set_encoding(Some(
18906 /// google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::Encoding::Singleton(Singleton::default().into())));
18907 /// ```
18908 pub fn set_encoding<
18909 T: std::convert::Into<
18910 std::option::Option<crate::model::r#type::r#struct::encoding::Encoding>,
18911 >,
18912 >(
18913 mut self,
18914 v: T,
18915 ) -> Self {
18916 self.encoding = v.into();
18917 self
18918 }
18919
18920 /// The value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
18921 /// if it holds a `Singleton`, `None` if the field is not set or
18922 /// holds a different branch.
18923 pub fn singleton(
18924 &self,
18925 ) -> std::option::Option<
18926 &std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>,
18927 > {
18928 #[allow(unreachable_patterns)]
18929 self.encoding.as_ref().and_then(|v| match v {
18930 crate::model::r#type::r#struct::encoding::Encoding::Singleton(v) => {
18931 std::option::Option::Some(v)
18932 }
18933 _ => std::option::Option::None,
18934 })
18935 }
18936
18937 /// Sets the value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
18938 /// to hold a `Singleton`.
18939 ///
18940 /// Note that all the setters affecting `encoding` are
18941 /// mutually exclusive.
18942 ///
18943 /// # Example
18944 /// ```ignore,no_run
18945 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
18946 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::Singleton;
18947 /// let x = Encoding::new().set_singleton(Singleton::default()/* use setters */);
18948 /// assert!(x.singleton().is_some());
18949 /// assert!(x.delimited_bytes().is_none());
18950 /// assert!(x.ordered_code_bytes().is_none());
18951 /// ```
18952 pub fn set_singleton<
18953 T: std::convert::Into<
18954 std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>,
18955 >,
18956 >(
18957 mut self,
18958 v: T,
18959 ) -> Self {
18960 self.encoding = std::option::Option::Some(
18961 crate::model::r#type::r#struct::encoding::Encoding::Singleton(v.into()),
18962 );
18963 self
18964 }
18965
18966 /// The value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
18967 /// if it holds a `DelimitedBytes`, `None` if the field is not set or
18968 /// holds a different branch.
18969 pub fn delimited_bytes(
18970 &self,
18971 ) -> std::option::Option<
18972 &std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
18973 > {
18974 #[allow(unreachable_patterns)]
18975 self.encoding.as_ref().and_then(|v| match v {
18976 crate::model::r#type::r#struct::encoding::Encoding::DelimitedBytes(v) => {
18977 std::option::Option::Some(v)
18978 }
18979 _ => std::option::Option::None,
18980 })
18981 }
18982
18983 /// Sets the value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
18984 /// to hold a `DelimitedBytes`.
18985 ///
18986 /// Note that all the setters affecting `encoding` are
18987 /// mutually exclusive.
18988 ///
18989 /// # Example
18990 /// ```ignore,no_run
18991 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
18992 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::DelimitedBytes;
18993 /// let x = Encoding::new().set_delimited_bytes(DelimitedBytes::default()/* use setters */);
18994 /// assert!(x.delimited_bytes().is_some());
18995 /// assert!(x.singleton().is_none());
18996 /// assert!(x.ordered_code_bytes().is_none());
18997 /// ```
18998 pub fn set_delimited_bytes<
18999 T: std::convert::Into<
19000 std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
19001 >,
19002 >(
19003 mut self,
19004 v: T,
19005 ) -> Self {
19006 self.encoding = std::option::Option::Some(
19007 crate::model::r#type::r#struct::encoding::Encoding::DelimitedBytes(v.into()),
19008 );
19009 self
19010 }
19011
19012 /// The value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
19013 /// if it holds a `OrderedCodeBytes`, `None` if the field is not set or
19014 /// holds a different branch.
19015 pub fn ordered_code_bytes(
19016 &self,
19017 ) -> std::option::Option<
19018 &std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
19019 > {
19020 #[allow(unreachable_patterns)]
19021 self.encoding.as_ref().and_then(|v| match v {
19022 crate::model::r#type::r#struct::encoding::Encoding::OrderedCodeBytes(v) => {
19023 std::option::Option::Some(v)
19024 }
19025 _ => std::option::Option::None,
19026 })
19027 }
19028
19029 /// Sets the value of [encoding][crate::model::r#type::r#struct::Encoding::encoding]
19030 /// to hold a `OrderedCodeBytes`.
19031 ///
19032 /// Note that all the setters affecting `encoding` are
19033 /// mutually exclusive.
19034 ///
19035 /// # Example
19036 /// ```ignore,no_run
19037 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::Encoding;
19038 /// use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::OrderedCodeBytes;
19039 /// let x = Encoding::new().set_ordered_code_bytes(OrderedCodeBytes::default()/* use setters */);
19040 /// assert!(x.ordered_code_bytes().is_some());
19041 /// assert!(x.singleton().is_none());
19042 /// assert!(x.delimited_bytes().is_none());
19043 /// ```
19044 pub fn set_ordered_code_bytes<
19045 T: std::convert::Into<
19046 std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
19047 >,
19048 >(
19049 mut self,
19050 v: T,
19051 ) -> Self {
19052 self.encoding = std::option::Option::Some(
19053 crate::model::r#type::r#struct::encoding::Encoding::OrderedCodeBytes(v.into()),
19054 );
19055 self
19056 }
19057 }
19058
19059 impl wkt::message::Message for Encoding {
19060 fn typename() -> &'static str {
19061 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding"
19062 }
19063 }
19064
19065 /// Defines additional types related to [Encoding].
19066 pub mod encoding {
19067 #[allow(unused_imports)]
19068 use super::*;
19069
19070 /// Uses the encoding of `fields[0].type` as-is.
19071 /// Only valid if `fields.size == 1`.
19072 #[derive(Clone, Default, PartialEq)]
19073 #[non_exhaustive]
19074 pub struct Singleton {
19075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19076 }
19077
19078 impl Singleton {
19079 /// Creates a new default instance.
19080 pub fn new() -> Self {
19081 std::default::Default::default()
19082 }
19083 }
19084
19085 impl wkt::message::Message for Singleton {
19086 fn typename() -> &'static str {
19087 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.Singleton"
19088 }
19089 }
19090
19091 /// Fields are encoded independently and concatenated with a configurable
19092 /// `delimiter` in between.
19093 ///
19094 /// A struct with no fields defined is encoded as a single `delimiter`.
19095 ///
19096 /// Sorted mode:
19097 ///
19098 /// - Fields are encoded in sorted mode.
19099 /// - Encoded field values must not contain any bytes <= `delimiter[0]`
19100 /// - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
19101 /// `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
19102 ///
19103 /// Distinct mode:
19104 ///
19105 /// - Fields are encoded in distinct mode.
19106 /// - Encoded field values must not contain `delimiter[0]`.
19107 #[derive(Clone, Default, PartialEq)]
19108 #[non_exhaustive]
19109 pub struct DelimitedBytes {
19110 /// Byte sequence used to delimit concatenated fields. The delimiter must
19111 /// contain at least 1 character and at most 50 characters.
19112 pub delimiter: ::bytes::Bytes,
19113
19114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19115 }
19116
19117 impl DelimitedBytes {
19118 /// Creates a new default instance.
19119 pub fn new() -> Self {
19120 std::default::Default::default()
19121 }
19122
19123 /// Sets the value of [delimiter][crate::model::r#type::r#struct::encoding::DelimitedBytes::delimiter].
19124 ///
19125 /// # Example
19126 /// ```ignore,no_run
19127 /// # use google_cloud_bigtable_admin_v2::model::r#type::r#struct::encoding::DelimitedBytes;
19128 /// let x = DelimitedBytes::new().set_delimiter(bytes::Bytes::from_static(b"example"));
19129 /// ```
19130 pub fn set_delimiter<T: std::convert::Into<::bytes::Bytes>>(
19131 mut self,
19132 v: T,
19133 ) -> Self {
19134 self.delimiter = v.into();
19135 self
19136 }
19137 }
19138
19139 impl wkt::message::Message for DelimitedBytes {
19140 fn typename() -> &'static str {
19141 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes"
19142 }
19143 }
19144
19145 /// Fields are encoded independently and concatenated with the fixed byte
19146 /// pair {0x00, 0x01} in between.
19147 ///
19148 /// Any null (0x00) byte in an encoded field is replaced by the fixed byte
19149 /// pair {0x00, 0xFF}.
19150 ///
19151 /// Fields that encode to the empty string "" have special handling:
19152 ///
19153 /// - If *every* field encodes to "", or if the STRUCT has no fields
19154 /// defined, then the STRUCT is encoded as the fixed byte pair
19155 /// {0x00, 0x00}.
19156 /// - Otherwise, the STRUCT only encodes until the last non-empty field,
19157 /// omitting any trailing empty fields. Any empty fields that aren't
19158 /// omitted are replaced with the fixed byte pair {0x00, 0x00}.
19159 ///
19160 /// Examples:
19161 ///
19162 /// - STRUCT() -> "\00\00"
19163 /// - STRUCT("") -> "\00\00"
19164 /// - STRUCT("", "") -> "\00\00"
19165 /// - STRUCT("", "B") -> "\00\00" + "\00\01" + "B"
19166 /// - STRUCT("A", "") -> "A"
19167 /// - STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B"
19168 /// - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
19169 ///
19170 /// Since null bytes are always escaped, this encoding can cause size
19171 /// blowup for encodings like `Int64.BigEndianBytes` that are likely to
19172 /// produce many such bytes.
19173 ///
19174 /// Sorted mode:
19175 ///
19176 /// - Fields are encoded in sorted mode.
19177 /// - All values supported by the field encodings are allowed
19178 /// - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
19179 /// `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
19180 ///
19181 /// Distinct mode:
19182 ///
19183 /// - Fields are encoded in distinct mode.
19184 /// - All values supported by the field encodings are allowed.
19185 #[derive(Clone, Default, PartialEq)]
19186 #[non_exhaustive]
19187 pub struct OrderedCodeBytes {
19188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19189 }
19190
19191 impl OrderedCodeBytes {
19192 /// Creates a new default instance.
19193 pub fn new() -> Self {
19194 std::default::Default::default()
19195 }
19196 }
19197
19198 impl wkt::message::Message for OrderedCodeBytes {
19199 fn typename() -> &'static str {
19200 "type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes"
19201 }
19202 }
19203
19204 /// Which encoding to use.
19205 #[derive(Clone, Debug, PartialEq)]
19206 #[non_exhaustive]
19207 pub enum Encoding {
19208 /// Use `Singleton` encoding.
19209 Singleton(std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>),
19210 /// Use `DelimitedBytes` encoding.
19211 DelimitedBytes(
19212 std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
19213 ),
19214 /// User `OrderedCodeBytes` encoding.
19215 OrderedCodeBytes(
19216 std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
19217 ),
19218 }
19219 }
19220 }
19221
19222 /// A protobuf message type.
19223 /// Values of type `Proto` are stored in `Value.bytes_value`.
19224 #[derive(Clone, Default, PartialEq)]
19225 #[non_exhaustive]
19226 pub struct Proto {
19227 /// The ID of the schema bundle that this proto is defined in.
19228 pub schema_bundle_id: std::string::String,
19229
19230 /// The fully qualified name of the protobuf message, including package. In
19231 /// the format of "foo.bar.Message".
19232 pub message_name: std::string::String,
19233
19234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19235 }
19236
19237 impl Proto {
19238 /// Creates a new default instance.
19239 pub fn new() -> Self {
19240 std::default::Default::default()
19241 }
19242
19243 /// Sets the value of [schema_bundle_id][crate::model::r#type::Proto::schema_bundle_id].
19244 ///
19245 /// # Example
19246 /// ```ignore,no_run
19247 /// # use google_cloud_bigtable_admin_v2::model::r#type::Proto;
19248 /// let x = Proto::new().set_schema_bundle_id("example");
19249 /// ```
19250 pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
19251 mut self,
19252 v: T,
19253 ) -> Self {
19254 self.schema_bundle_id = v.into();
19255 self
19256 }
19257
19258 /// Sets the value of [message_name][crate::model::r#type::Proto::message_name].
19259 ///
19260 /// # Example
19261 /// ```ignore,no_run
19262 /// # use google_cloud_bigtable_admin_v2::model::r#type::Proto;
19263 /// let x = Proto::new().set_message_name("example");
19264 /// ```
19265 pub fn set_message_name<T: std::convert::Into<std::string::String>>(
19266 mut self,
19267 v: T,
19268 ) -> Self {
19269 self.message_name = v.into();
19270 self
19271 }
19272 }
19273
19274 impl wkt::message::Message for Proto {
19275 fn typename() -> &'static str {
19276 "type.googleapis.com/google.bigtable.admin.v2.Type.Proto"
19277 }
19278 }
19279
19280 /// A protobuf enum type.
19281 /// Values of type `Enum` are stored in `Value.int_value`.
19282 #[derive(Clone, Default, PartialEq)]
19283 #[non_exhaustive]
19284 pub struct Enum {
19285 /// The ID of the schema bundle that this enum is defined in.
19286 pub schema_bundle_id: std::string::String,
19287
19288 /// The fully qualified name of the protobuf enum message, including package.
19289 /// In the format of "foo.bar.EnumMessage".
19290 pub enum_name: std::string::String,
19291
19292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19293 }
19294
19295 impl Enum {
19296 /// Creates a new default instance.
19297 pub fn new() -> Self {
19298 std::default::Default::default()
19299 }
19300
19301 /// Sets the value of [schema_bundle_id][crate::model::r#type::Enum::schema_bundle_id].
19302 ///
19303 /// # Example
19304 /// ```ignore,no_run
19305 /// # use google_cloud_bigtable_admin_v2::model::r#type::Enum;
19306 /// let x = Enum::new().set_schema_bundle_id("example");
19307 /// ```
19308 pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
19309 mut self,
19310 v: T,
19311 ) -> Self {
19312 self.schema_bundle_id = v.into();
19313 self
19314 }
19315
19316 /// Sets the value of [enum_name][crate::model::r#type::Enum::enum_name].
19317 ///
19318 /// # Example
19319 /// ```ignore,no_run
19320 /// # use google_cloud_bigtable_admin_v2::model::r#type::Enum;
19321 /// let x = Enum::new().set_enum_name("example");
19322 /// ```
19323 pub fn set_enum_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19324 self.enum_name = v.into();
19325 self
19326 }
19327 }
19328
19329 impl wkt::message::Message for Enum {
19330 fn typename() -> &'static str {
19331 "type.googleapis.com/google.bigtable.admin.v2.Type.Enum"
19332 }
19333 }
19334
19335 /// An ordered list of elements of a given type.
19336 /// Values of type `Array` are stored in `Value.array_value`.
19337 #[derive(Clone, Default, PartialEq)]
19338 #[non_exhaustive]
19339 pub struct Array {
19340 /// The type of the elements in the array. This must not be `Array`.
19341 pub element_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
19342
19343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19344 }
19345
19346 impl Array {
19347 /// Creates a new default instance.
19348 pub fn new() -> Self {
19349 std::default::Default::default()
19350 }
19351
19352 /// Sets the value of [element_type][crate::model::r#type::Array::element_type].
19353 ///
19354 /// # Example
19355 /// ```ignore,no_run
19356 /// # use google_cloud_bigtable_admin_v2::model::r#type::Array;
19357 /// use google_cloud_bigtable_admin_v2::model::Type;
19358 /// let x = Array::new().set_element_type(Type::default()/* use setters */);
19359 /// ```
19360 pub fn set_element_type<T>(mut self, v: T) -> Self
19361 where
19362 T: std::convert::Into<crate::model::Type>,
19363 {
19364 self.element_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
19365 self
19366 }
19367
19368 /// Sets or clears the value of [element_type][crate::model::r#type::Array::element_type].
19369 ///
19370 /// # Example
19371 /// ```ignore,no_run
19372 /// # use google_cloud_bigtable_admin_v2::model::r#type::Array;
19373 /// use google_cloud_bigtable_admin_v2::model::Type;
19374 /// let x = Array::new().set_or_clear_element_type(Some(Type::default()/* use setters */));
19375 /// let x = Array::new().set_or_clear_element_type(None::<Type>);
19376 /// ```
19377 pub fn set_or_clear_element_type<T>(mut self, v: std::option::Option<T>) -> Self
19378 where
19379 T: std::convert::Into<crate::model::Type>,
19380 {
19381 self.element_type = v.map(|x| std::boxed::Box::new(x.into()));
19382 self
19383 }
19384 }
19385
19386 impl wkt::message::Message for Array {
19387 fn typename() -> &'static str {
19388 "type.googleapis.com/google.bigtable.admin.v2.Type.Array"
19389 }
19390 }
19391
19392 /// A mapping of keys to values of a given type.
19393 /// Values of type `Map` are stored in a `Value.array_value` where each entry
19394 /// is another `Value.array_value` with two elements (the key and the value,
19395 /// in that order).
19396 /// Normally encoded Map values won't have repeated keys, however, clients are
19397 /// expected to handle the case in which they do. If the same key appears
19398 /// multiple times, the _last_ value takes precedence.
19399 #[derive(Clone, Default, PartialEq)]
19400 #[non_exhaustive]
19401 pub struct Map {
19402 /// The type of a map key.
19403 /// Only `Bytes`, `String`, and `Int64` are allowed as key types.
19404 pub key_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
19405
19406 /// The type of the values in a map.
19407 pub value_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
19408
19409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19410 }
19411
19412 impl Map {
19413 /// Creates a new default instance.
19414 pub fn new() -> Self {
19415 std::default::Default::default()
19416 }
19417
19418 /// Sets the value of [key_type][crate::model::r#type::Map::key_type].
19419 ///
19420 /// # Example
19421 /// ```ignore,no_run
19422 /// # use google_cloud_bigtable_admin_v2::model::r#type::Map;
19423 /// use google_cloud_bigtable_admin_v2::model::Type;
19424 /// let x = Map::new().set_key_type(Type::default()/* use setters */);
19425 /// ```
19426 pub fn set_key_type<T>(mut self, v: T) -> Self
19427 where
19428 T: std::convert::Into<crate::model::Type>,
19429 {
19430 self.key_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
19431 self
19432 }
19433
19434 /// Sets or clears the value of [key_type][crate::model::r#type::Map::key_type].
19435 ///
19436 /// # Example
19437 /// ```ignore,no_run
19438 /// # use google_cloud_bigtable_admin_v2::model::r#type::Map;
19439 /// use google_cloud_bigtable_admin_v2::model::Type;
19440 /// let x = Map::new().set_or_clear_key_type(Some(Type::default()/* use setters */));
19441 /// let x = Map::new().set_or_clear_key_type(None::<Type>);
19442 /// ```
19443 pub fn set_or_clear_key_type<T>(mut self, v: std::option::Option<T>) -> Self
19444 where
19445 T: std::convert::Into<crate::model::Type>,
19446 {
19447 self.key_type = v.map(|x| std::boxed::Box::new(x.into()));
19448 self
19449 }
19450
19451 /// Sets the value of [value_type][crate::model::r#type::Map::value_type].
19452 ///
19453 /// # Example
19454 /// ```ignore,no_run
19455 /// # use google_cloud_bigtable_admin_v2::model::r#type::Map;
19456 /// use google_cloud_bigtable_admin_v2::model::Type;
19457 /// let x = Map::new().set_value_type(Type::default()/* use setters */);
19458 /// ```
19459 pub fn set_value_type<T>(mut self, v: T) -> Self
19460 where
19461 T: std::convert::Into<crate::model::Type>,
19462 {
19463 self.value_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
19464 self
19465 }
19466
19467 /// Sets or clears the value of [value_type][crate::model::r#type::Map::value_type].
19468 ///
19469 /// # Example
19470 /// ```ignore,no_run
19471 /// # use google_cloud_bigtable_admin_v2::model::r#type::Map;
19472 /// use google_cloud_bigtable_admin_v2::model::Type;
19473 /// let x = Map::new().set_or_clear_value_type(Some(Type::default()/* use setters */));
19474 /// let x = Map::new().set_or_clear_value_type(None::<Type>);
19475 /// ```
19476 pub fn set_or_clear_value_type<T>(mut self, v: std::option::Option<T>) -> Self
19477 where
19478 T: std::convert::Into<crate::model::Type>,
19479 {
19480 self.value_type = v.map(|x| std::boxed::Box::new(x.into()));
19481 self
19482 }
19483 }
19484
19485 impl wkt::message::Message for Map {
19486 fn typename() -> &'static str {
19487 "type.googleapis.com/google.bigtable.admin.v2.Type.Map"
19488 }
19489 }
19490
19491 /// A value that combines incremental updates into a summarized value.
19492 ///
19493 /// Data is never directly written or read using type `Aggregate`. Writes will
19494 /// provide either the `input_type` or `state_type`, and reads will always
19495 /// return the `state_type` .
19496 #[derive(Clone, Default, PartialEq)]
19497 #[non_exhaustive]
19498 pub struct Aggregate {
19499 /// Type of the inputs that are accumulated by this `Aggregate`, which must
19500 /// specify a full encoding.
19501 /// Use `AddInput` mutations to accumulate new inputs.
19502 pub input_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
19503
19504 /// Output only. Type that holds the internal accumulator state for the
19505 /// `Aggregate`. This is a function of the `input_type` and `aggregator`
19506 /// chosen, and will always specify a full encoding.
19507 pub state_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
19508
19509 /// Which aggregator function to use. The configured types must match.
19510 pub aggregator: std::option::Option<crate::model::r#type::aggregate::Aggregator>,
19511
19512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19513 }
19514
19515 impl Aggregate {
19516 /// Creates a new default instance.
19517 pub fn new() -> Self {
19518 std::default::Default::default()
19519 }
19520
19521 /// Sets the value of [input_type][crate::model::r#type::Aggregate::input_type].
19522 ///
19523 /// # Example
19524 /// ```ignore,no_run
19525 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19526 /// use google_cloud_bigtable_admin_v2::model::Type;
19527 /// let x = Aggregate::new().set_input_type(Type::default()/* use setters */);
19528 /// ```
19529 pub fn set_input_type<T>(mut self, v: T) -> Self
19530 where
19531 T: std::convert::Into<crate::model::Type>,
19532 {
19533 self.input_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
19534 self
19535 }
19536
19537 /// Sets or clears the value of [input_type][crate::model::r#type::Aggregate::input_type].
19538 ///
19539 /// # Example
19540 /// ```ignore,no_run
19541 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19542 /// use google_cloud_bigtable_admin_v2::model::Type;
19543 /// let x = Aggregate::new().set_or_clear_input_type(Some(Type::default()/* use setters */));
19544 /// let x = Aggregate::new().set_or_clear_input_type(None::<Type>);
19545 /// ```
19546 pub fn set_or_clear_input_type<T>(mut self, v: std::option::Option<T>) -> Self
19547 where
19548 T: std::convert::Into<crate::model::Type>,
19549 {
19550 self.input_type = v.map(|x| std::boxed::Box::new(x.into()));
19551 self
19552 }
19553
19554 /// Sets the value of [state_type][crate::model::r#type::Aggregate::state_type].
19555 ///
19556 /// # Example
19557 /// ```ignore,no_run
19558 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19559 /// use google_cloud_bigtable_admin_v2::model::Type;
19560 /// let x = Aggregate::new().set_state_type(Type::default()/* use setters */);
19561 /// ```
19562 pub fn set_state_type<T>(mut self, v: T) -> Self
19563 where
19564 T: std::convert::Into<crate::model::Type>,
19565 {
19566 self.state_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
19567 self
19568 }
19569
19570 /// Sets or clears the value of [state_type][crate::model::r#type::Aggregate::state_type].
19571 ///
19572 /// # Example
19573 /// ```ignore,no_run
19574 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19575 /// use google_cloud_bigtable_admin_v2::model::Type;
19576 /// let x = Aggregate::new().set_or_clear_state_type(Some(Type::default()/* use setters */));
19577 /// let x = Aggregate::new().set_or_clear_state_type(None::<Type>);
19578 /// ```
19579 pub fn set_or_clear_state_type<T>(mut self, v: std::option::Option<T>) -> Self
19580 where
19581 T: std::convert::Into<crate::model::Type>,
19582 {
19583 self.state_type = v.map(|x| std::boxed::Box::new(x.into()));
19584 self
19585 }
19586
19587 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator].
19588 ///
19589 /// Note that all the setters affecting `aggregator` are mutually
19590 /// exclusive.
19591 ///
19592 /// # Example
19593 /// ```ignore,no_run
19594 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19595 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::Sum;
19596 /// let x = Aggregate::new().set_aggregator(Some(
19597 /// google_cloud_bigtable_admin_v2::model::r#type::aggregate::Aggregator::Sum(Sum::default().into())));
19598 /// ```
19599 pub fn set_aggregator<
19600 T: std::convert::Into<std::option::Option<crate::model::r#type::aggregate::Aggregator>>,
19601 >(
19602 mut self,
19603 v: T,
19604 ) -> Self {
19605 self.aggregator = v.into();
19606 self
19607 }
19608
19609 /// The value of [aggregator][crate::model::r#type::Aggregate::aggregator]
19610 /// if it holds a `Sum`, `None` if the field is not set or
19611 /// holds a different branch.
19612 pub fn sum(
19613 &self,
19614 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Sum>> {
19615 #[allow(unreachable_patterns)]
19616 self.aggregator.as_ref().and_then(|v| match v {
19617 crate::model::r#type::aggregate::Aggregator::Sum(v) => std::option::Option::Some(v),
19618 _ => std::option::Option::None,
19619 })
19620 }
19621
19622 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator]
19623 /// to hold a `Sum`.
19624 ///
19625 /// Note that all the setters affecting `aggregator` are
19626 /// mutually exclusive.
19627 ///
19628 /// # Example
19629 /// ```ignore,no_run
19630 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19631 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::Sum;
19632 /// let x = Aggregate::new().set_sum(Sum::default()/* use setters */);
19633 /// assert!(x.sum().is_some());
19634 /// assert!(x.hllpp_unique_count().is_none());
19635 /// assert!(x.max().is_none());
19636 /// assert!(x.min().is_none());
19637 /// ```
19638 pub fn set_sum<
19639 T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Sum>>,
19640 >(
19641 mut self,
19642 v: T,
19643 ) -> Self {
19644 self.aggregator = std::option::Option::Some(
19645 crate::model::r#type::aggregate::Aggregator::Sum(v.into()),
19646 );
19647 self
19648 }
19649
19650 /// The value of [aggregator][crate::model::r#type::Aggregate::aggregator]
19651 /// if it holds a `HllppUniqueCount`, `None` if the field is not set or
19652 /// holds a different branch.
19653 pub fn hllpp_unique_count(
19654 &self,
19655 ) -> std::option::Option<
19656 &std::boxed::Box<crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount>,
19657 > {
19658 #[allow(unreachable_patterns)]
19659 self.aggregator.as_ref().and_then(|v| match v {
19660 crate::model::r#type::aggregate::Aggregator::HllppUniqueCount(v) => {
19661 std::option::Option::Some(v)
19662 }
19663 _ => std::option::Option::None,
19664 })
19665 }
19666
19667 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator]
19668 /// to hold a `HllppUniqueCount`.
19669 ///
19670 /// Note that all the setters affecting `aggregator` are
19671 /// mutually exclusive.
19672 ///
19673 /// # Example
19674 /// ```ignore,no_run
19675 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19676 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount;
19677 /// let x = Aggregate::new().set_hllpp_unique_count(HyperLogLogPlusPlusUniqueCount::default()/* use setters */);
19678 /// assert!(x.hllpp_unique_count().is_some());
19679 /// assert!(x.sum().is_none());
19680 /// assert!(x.max().is_none());
19681 /// assert!(x.min().is_none());
19682 /// ```
19683 pub fn set_hllpp_unique_count<
19684 T: std::convert::Into<
19685 std::boxed::Box<
19686 crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount,
19687 >,
19688 >,
19689 >(
19690 mut self,
19691 v: T,
19692 ) -> Self {
19693 self.aggregator = std::option::Option::Some(
19694 crate::model::r#type::aggregate::Aggregator::HllppUniqueCount(v.into()),
19695 );
19696 self
19697 }
19698
19699 /// The value of [aggregator][crate::model::r#type::Aggregate::aggregator]
19700 /// if it holds a `Max`, `None` if the field is not set or
19701 /// holds a different branch.
19702 pub fn max(
19703 &self,
19704 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Max>> {
19705 #[allow(unreachable_patterns)]
19706 self.aggregator.as_ref().and_then(|v| match v {
19707 crate::model::r#type::aggregate::Aggregator::Max(v) => std::option::Option::Some(v),
19708 _ => std::option::Option::None,
19709 })
19710 }
19711
19712 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator]
19713 /// to hold a `Max`.
19714 ///
19715 /// Note that all the setters affecting `aggregator` are
19716 /// mutually exclusive.
19717 ///
19718 /// # Example
19719 /// ```ignore,no_run
19720 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19721 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::Max;
19722 /// let x = Aggregate::new().set_max(Max::default()/* use setters */);
19723 /// assert!(x.max().is_some());
19724 /// assert!(x.sum().is_none());
19725 /// assert!(x.hllpp_unique_count().is_none());
19726 /// assert!(x.min().is_none());
19727 /// ```
19728 pub fn set_max<
19729 T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Max>>,
19730 >(
19731 mut self,
19732 v: T,
19733 ) -> Self {
19734 self.aggregator = std::option::Option::Some(
19735 crate::model::r#type::aggregate::Aggregator::Max(v.into()),
19736 );
19737 self
19738 }
19739
19740 /// The value of [aggregator][crate::model::r#type::Aggregate::aggregator]
19741 /// if it holds a `Min`, `None` if the field is not set or
19742 /// holds a different branch.
19743 pub fn min(
19744 &self,
19745 ) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Min>> {
19746 #[allow(unreachable_patterns)]
19747 self.aggregator.as_ref().and_then(|v| match v {
19748 crate::model::r#type::aggregate::Aggregator::Min(v) => std::option::Option::Some(v),
19749 _ => std::option::Option::None,
19750 })
19751 }
19752
19753 /// Sets the value of [aggregator][crate::model::r#type::Aggregate::aggregator]
19754 /// to hold a `Min`.
19755 ///
19756 /// Note that all the setters affecting `aggregator` are
19757 /// mutually exclusive.
19758 ///
19759 /// # Example
19760 /// ```ignore,no_run
19761 /// # use google_cloud_bigtable_admin_v2::model::r#type::Aggregate;
19762 /// use google_cloud_bigtable_admin_v2::model::r#type::aggregate::Min;
19763 /// let x = Aggregate::new().set_min(Min::default()/* use setters */);
19764 /// assert!(x.min().is_some());
19765 /// assert!(x.sum().is_none());
19766 /// assert!(x.hllpp_unique_count().is_none());
19767 /// assert!(x.max().is_none());
19768 /// ```
19769 pub fn set_min<
19770 T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Min>>,
19771 >(
19772 mut self,
19773 v: T,
19774 ) -> Self {
19775 self.aggregator = std::option::Option::Some(
19776 crate::model::r#type::aggregate::Aggregator::Min(v.into()),
19777 );
19778 self
19779 }
19780 }
19781
19782 impl wkt::message::Message for Aggregate {
19783 fn typename() -> &'static str {
19784 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate"
19785 }
19786 }
19787
19788 /// Defines additional types related to [Aggregate].
19789 pub mod aggregate {
19790 #[allow(unused_imports)]
19791 use super::*;
19792
19793 /// Computes the sum of the input values.
19794 /// Allowed input: `Int64`
19795 /// State: same as input
19796 #[derive(Clone, Default, PartialEq)]
19797 #[non_exhaustive]
19798 pub struct Sum {
19799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19800 }
19801
19802 impl Sum {
19803 /// Creates a new default instance.
19804 pub fn new() -> Self {
19805 std::default::Default::default()
19806 }
19807 }
19808
19809 impl wkt::message::Message for Sum {
19810 fn typename() -> &'static str {
19811 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Sum"
19812 }
19813 }
19814
19815 /// Computes the max of the input values.
19816 /// Allowed input: `Int64`
19817 /// State: same as input
19818 #[derive(Clone, Default, PartialEq)]
19819 #[non_exhaustive]
19820 pub struct Max {
19821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19822 }
19823
19824 impl Max {
19825 /// Creates a new default instance.
19826 pub fn new() -> Self {
19827 std::default::Default::default()
19828 }
19829 }
19830
19831 impl wkt::message::Message for Max {
19832 fn typename() -> &'static str {
19833 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Max"
19834 }
19835 }
19836
19837 /// Computes the min of the input values.
19838 /// Allowed input: `Int64`
19839 /// State: same as input
19840 #[derive(Clone, Default, PartialEq)]
19841 #[non_exhaustive]
19842 pub struct Min {
19843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19844 }
19845
19846 impl Min {
19847 /// Creates a new default instance.
19848 pub fn new() -> Self {
19849 std::default::Default::default()
19850 }
19851 }
19852
19853 impl wkt::message::Message for Min {
19854 fn typename() -> &'static str {
19855 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Min"
19856 }
19857 }
19858
19859 /// Computes an approximate unique count over the input values. When using
19860 /// raw data as input, be careful to use a consistent encoding. Otherwise
19861 /// the same value encoded differently could count more than once, or two
19862 /// distinct values could count as identical.
19863 /// Input: Any, or omit for Raw
19864 /// State: TBD
19865 /// Special state conversions: `Int64` (the unique count estimate)
19866 #[derive(Clone, Default, PartialEq)]
19867 #[non_exhaustive]
19868 pub struct HyperLogLogPlusPlusUniqueCount {
19869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19870 }
19871
19872 impl HyperLogLogPlusPlusUniqueCount {
19873 /// Creates a new default instance.
19874 pub fn new() -> Self {
19875 std::default::Default::default()
19876 }
19877 }
19878
19879 impl wkt::message::Message for HyperLogLogPlusPlusUniqueCount {
19880 fn typename() -> &'static str {
19881 "type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount"
19882 }
19883 }
19884
19885 /// Which aggregator function to use. The configured types must match.
19886 #[derive(Clone, Debug, PartialEq)]
19887 #[non_exhaustive]
19888 pub enum Aggregator {
19889 /// Sum aggregator.
19890 Sum(std::boxed::Box<crate::model::r#type::aggregate::Sum>),
19891 /// HyperLogLogPlusPlusUniqueCount aggregator.
19892 HllppUniqueCount(
19893 std::boxed::Box<crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount>,
19894 ),
19895 /// Max aggregator.
19896 Max(std::boxed::Box<crate::model::r#type::aggregate::Max>),
19897 /// Min aggregator.
19898 Min(std::boxed::Box<crate::model::r#type::aggregate::Min>),
19899 }
19900 }
19901
19902 /// The kind of type that this represents.
19903 #[derive(Clone, Debug, PartialEq)]
19904 #[non_exhaustive]
19905 pub enum Kind {
19906 /// Bytes
19907 BytesType(std::boxed::Box<crate::model::r#type::Bytes>),
19908 /// String
19909 StringType(std::boxed::Box<crate::model::r#type::String>),
19910 /// Int64
19911 Int64Type(std::boxed::Box<crate::model::r#type::Int64>),
19912 /// Float32
19913 Float32Type(std::boxed::Box<crate::model::r#type::Float32>),
19914 /// Float64
19915 Float64Type(std::boxed::Box<crate::model::r#type::Float64>),
19916 /// Bool
19917 BoolType(std::boxed::Box<crate::model::r#type::Bool>),
19918 /// Timestamp
19919 TimestampType(std::boxed::Box<crate::model::r#type::Timestamp>),
19920 /// Date
19921 DateType(std::boxed::Box<crate::model::r#type::Date>),
19922 /// Aggregate
19923 AggregateType(std::boxed::Box<crate::model::r#type::Aggregate>),
19924 /// Struct
19925 StructType(std::boxed::Box<crate::model::r#type::Struct>),
19926 /// Array
19927 ArrayType(std::boxed::Box<crate::model::r#type::Array>),
19928 /// Map
19929 MapType(std::boxed::Box<crate::model::r#type::Map>),
19930 /// Proto
19931 ProtoType(std::boxed::Box<crate::model::r#type::Proto>),
19932 /// Enum
19933 EnumType(std::boxed::Box<crate::model::r#type::Enum>),
19934 }
19935}
19936
19937/// Storage media types for persisting Bigtable data.
19938///
19939/// # Working with unknown values
19940///
19941/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19942/// additional enum variants at any time. Adding new variants is not considered
19943/// a breaking change. Applications should write their code in anticipation of:
19944///
19945/// - New values appearing in future releases of the client library, **and**
19946/// - New values received dynamically, without application changes.
19947///
19948/// Please consult the [Working with enums] section in the user guide for some
19949/// guidelines.
19950///
19951/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19952#[derive(Clone, Debug, PartialEq)]
19953#[non_exhaustive]
19954pub enum StorageType {
19955 /// The user did not specify a storage type.
19956 Unspecified,
19957 /// Flash (SSD) storage should be used.
19958 Ssd,
19959 /// Magnetic drive (HDD) storage should be used.
19960 Hdd,
19961 /// If set, the enum was initialized with an unknown value.
19962 ///
19963 /// Applications can examine the value using [StorageType::value] or
19964 /// [StorageType::name].
19965 UnknownValue(storage_type::UnknownValue),
19966}
19967
19968#[doc(hidden)]
19969pub mod storage_type {
19970 #[allow(unused_imports)]
19971 use super::*;
19972 #[derive(Clone, Debug, PartialEq)]
19973 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19974}
19975
19976impl StorageType {
19977 /// Gets the enum value.
19978 ///
19979 /// Returns `None` if the enum contains an unknown value deserialized from
19980 /// the string representation of enums.
19981 pub fn value(&self) -> std::option::Option<i32> {
19982 match self {
19983 Self::Unspecified => std::option::Option::Some(0),
19984 Self::Ssd => std::option::Option::Some(1),
19985 Self::Hdd => std::option::Option::Some(2),
19986 Self::UnknownValue(u) => u.0.value(),
19987 }
19988 }
19989
19990 /// Gets the enum value as a string.
19991 ///
19992 /// Returns `None` if the enum contains an unknown value deserialized from
19993 /// the integer representation of enums.
19994 pub fn name(&self) -> std::option::Option<&str> {
19995 match self {
19996 Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
19997 Self::Ssd => std::option::Option::Some("SSD"),
19998 Self::Hdd => std::option::Option::Some("HDD"),
19999 Self::UnknownValue(u) => u.0.name(),
20000 }
20001 }
20002}
20003
20004impl std::default::Default for StorageType {
20005 fn default() -> Self {
20006 use std::convert::From;
20007 Self::from(0)
20008 }
20009}
20010
20011impl std::fmt::Display for StorageType {
20012 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20013 wkt::internal::display_enum(f, self.name(), self.value())
20014 }
20015}
20016
20017impl std::convert::From<i32> for StorageType {
20018 fn from(value: i32) -> Self {
20019 match value {
20020 0 => Self::Unspecified,
20021 1 => Self::Ssd,
20022 2 => Self::Hdd,
20023 _ => Self::UnknownValue(storage_type::UnknownValue(
20024 wkt::internal::UnknownEnumValue::Integer(value),
20025 )),
20026 }
20027 }
20028}
20029
20030impl std::convert::From<&str> for StorageType {
20031 fn from(value: &str) -> Self {
20032 use std::string::ToString;
20033 match value {
20034 "STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
20035 "SSD" => Self::Ssd,
20036 "HDD" => Self::Hdd,
20037 _ => Self::UnknownValue(storage_type::UnknownValue(
20038 wkt::internal::UnknownEnumValue::String(value.to_string()),
20039 )),
20040 }
20041 }
20042}
20043
20044impl serde::ser::Serialize for StorageType {
20045 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20046 where
20047 S: serde::Serializer,
20048 {
20049 match self {
20050 Self::Unspecified => serializer.serialize_i32(0),
20051 Self::Ssd => serializer.serialize_i32(1),
20052 Self::Hdd => serializer.serialize_i32(2),
20053 Self::UnknownValue(u) => u.0.serialize(serializer),
20054 }
20055 }
20056}
20057
20058impl<'de> serde::de::Deserialize<'de> for StorageType {
20059 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20060 where
20061 D: serde::Deserializer<'de>,
20062 {
20063 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
20064 ".google.bigtable.admin.v2.StorageType",
20065 ))
20066 }
20067}
20068
20069/// Indicates the type of the restore source.
20070///
20071/// # Working with unknown values
20072///
20073/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20074/// additional enum variants at any time. Adding new variants is not considered
20075/// a breaking change. Applications should write their code in anticipation of:
20076///
20077/// - New values appearing in future releases of the client library, **and**
20078/// - New values received dynamically, without application changes.
20079///
20080/// Please consult the [Working with enums] section in the user guide for some
20081/// guidelines.
20082///
20083/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20084#[derive(Clone, Debug, PartialEq)]
20085#[non_exhaustive]
20086pub enum RestoreSourceType {
20087 /// No restore associated.
20088 Unspecified,
20089 /// A backup was used as the source of the restore.
20090 Backup,
20091 /// If set, the enum was initialized with an unknown value.
20092 ///
20093 /// Applications can examine the value using [RestoreSourceType::value] or
20094 /// [RestoreSourceType::name].
20095 UnknownValue(restore_source_type::UnknownValue),
20096}
20097
20098#[doc(hidden)]
20099pub mod restore_source_type {
20100 #[allow(unused_imports)]
20101 use super::*;
20102 #[derive(Clone, Debug, PartialEq)]
20103 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20104}
20105
20106impl RestoreSourceType {
20107 /// Gets the enum value.
20108 ///
20109 /// Returns `None` if the enum contains an unknown value deserialized from
20110 /// the string representation of enums.
20111 pub fn value(&self) -> std::option::Option<i32> {
20112 match self {
20113 Self::Unspecified => std::option::Option::Some(0),
20114 Self::Backup => std::option::Option::Some(1),
20115 Self::UnknownValue(u) => u.0.value(),
20116 }
20117 }
20118
20119 /// Gets the enum value as a string.
20120 ///
20121 /// Returns `None` if the enum contains an unknown value deserialized from
20122 /// the integer representation of enums.
20123 pub fn name(&self) -> std::option::Option<&str> {
20124 match self {
20125 Self::Unspecified => std::option::Option::Some("RESTORE_SOURCE_TYPE_UNSPECIFIED"),
20126 Self::Backup => std::option::Option::Some("BACKUP"),
20127 Self::UnknownValue(u) => u.0.name(),
20128 }
20129 }
20130}
20131
20132impl std::default::Default for RestoreSourceType {
20133 fn default() -> Self {
20134 use std::convert::From;
20135 Self::from(0)
20136 }
20137}
20138
20139impl std::fmt::Display for RestoreSourceType {
20140 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20141 wkt::internal::display_enum(f, self.name(), self.value())
20142 }
20143}
20144
20145impl std::convert::From<i32> for RestoreSourceType {
20146 fn from(value: i32) -> Self {
20147 match value {
20148 0 => Self::Unspecified,
20149 1 => Self::Backup,
20150 _ => Self::UnknownValue(restore_source_type::UnknownValue(
20151 wkt::internal::UnknownEnumValue::Integer(value),
20152 )),
20153 }
20154 }
20155}
20156
20157impl std::convert::From<&str> for RestoreSourceType {
20158 fn from(value: &str) -> Self {
20159 use std::string::ToString;
20160 match value {
20161 "RESTORE_SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
20162 "BACKUP" => Self::Backup,
20163 _ => Self::UnknownValue(restore_source_type::UnknownValue(
20164 wkt::internal::UnknownEnumValue::String(value.to_string()),
20165 )),
20166 }
20167 }
20168}
20169
20170impl serde::ser::Serialize for RestoreSourceType {
20171 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20172 where
20173 S: serde::Serializer,
20174 {
20175 match self {
20176 Self::Unspecified => serializer.serialize_i32(0),
20177 Self::Backup => serializer.serialize_i32(1),
20178 Self::UnknownValue(u) => u.0.serialize(serializer),
20179 }
20180 }
20181}
20182
20183impl<'de> serde::de::Deserialize<'de> for RestoreSourceType {
20184 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20185 where
20186 D: serde::Deserializer<'de>,
20187 {
20188 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestoreSourceType>::new(
20189 ".google.bigtable.admin.v2.RestoreSourceType",
20190 ))
20191 }
20192}