#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInstanceRequest {
pub parent: std::string::String,
pub instance_id: std::string::String,
pub instance: std::option::Option<crate::model::Instance>,
pub clusters: std::collections::HashMap<std::string::String, crate::model::Cluster>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateInstanceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance_id = v.into();
self
}
pub fn set_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = v.map(|x| x.into());
self
}
pub fn set_clusters<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::Cluster>,
{
use std::iter::Iterator;
self.clusters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for CreateInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInstanceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetInstanceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListInstancesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListInstancesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListInstancesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesResponse {
pub instances: std::vec::Vec<crate::model::Instance>,
pub failed_locations: std::vec::Vec<std::string::String>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListInstancesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instances<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Instance>,
{
use std::iter::Iterator;
self.instances = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.failed_locations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListInstancesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListInstancesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PartialUpdateInstanceRequest {
pub instance: std::option::Option<crate::model::Instance>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PartialUpdateInstanceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PartialUpdateInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.PartialUpdateInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInstanceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteInstanceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateClusterRequest {
pub parent: std::string::String,
pub cluster_id: std::string::String,
pub cluster: std::option::Option<crate::model::Cluster>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_id = v.into();
self
}
pub fn set_cluster<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.cluster = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.cluster = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetClusterRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListClustersRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListClustersRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListClustersRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListClustersRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListClustersResponse {
pub clusters: std::vec::Vec<crate::model::Cluster>,
pub failed_locations: std::vec::Vec<std::string::String>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListClustersResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_clusters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Cluster>,
{
use std::iter::Iterator;
self.clusters = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.failed_locations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListClustersResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListClustersResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteClusterRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInstanceMetadata {
pub original_request: std::option::Option<crate::model::CreateInstanceRequest>,
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateInstanceMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CreateInstanceRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CreateInstanceRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateInstanceMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateInstanceMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateInstanceMetadata {
pub original_request: std::option::Option<crate::model::PartialUpdateInstanceRequest>,
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateInstanceMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PartialUpdateInstanceRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PartialUpdateInstanceRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateInstanceMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateInstanceMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateClusterMetadata {
pub original_request: std::option::Option<crate::model::CreateClusterRequest>,
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub tables: std::collections::HashMap<
std::string::String,
crate::model::create_cluster_metadata::TableProgress,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateClusterMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CreateClusterRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CreateClusterRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
pub fn set_tables<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::create_cluster_metadata::TableProgress>,
{
use std::iter::Iterator;
self.tables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for CreateClusterMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateClusterMetadata"
}
}
pub mod create_cluster_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TableProgress {
pub estimated_size_bytes: i64,
pub estimated_copied_bytes: i64,
pub state: crate::model::create_cluster_metadata::table_progress::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TableProgress {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_estimated_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.estimated_size_bytes = v.into();
self
}
pub fn set_estimated_copied_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.estimated_copied_bytes = v.into();
self
}
pub fn set_state<
T: std::convert::Into<crate::model::create_cluster_metadata::table_progress::State>,
>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for TableProgress {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateClusterMetadata.TableProgress"
}
}
pub mod table_progress {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Copying,
Completed,
Cancelled,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Copying => std::option::Option::Some(2),
Self::Completed => std::option::Option::Some(3),
Self::Cancelled => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Copying => std::option::Option::Some("COPYING"),
Self::Completed => std::option::Option::Some("COMPLETED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Copying,
3 => Self::Completed,
4 => Self::Cancelled,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"COPYING" => Self::Copying,
"COMPLETED" => Self::Completed,
"CANCELLED" => Self::Cancelled,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Copying => serializer.serialize_i32(2),
Self::Completed => serializer.serialize_i32(3),
Self::Cancelled => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateClusterMetadata {
pub original_request: std::option::Option<crate::model::Cluster>,
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateClusterMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateClusterMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateClusterMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PartialUpdateClusterMetadata {
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub original_request: std::option::Option<crate::model::PartialUpdateClusterRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PartialUpdateClusterMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PartialUpdateClusterRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PartialUpdateClusterRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PartialUpdateClusterMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.PartialUpdateClusterMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PartialUpdateClusterRequest {
pub cluster: std::option::Option<crate::model::Cluster>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PartialUpdateClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.cluster = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.cluster = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PartialUpdateClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.PartialUpdateClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAppProfileRequest {
pub parent: std::string::String,
pub app_profile_id: std::string::String,
pub app_profile: std::option::Option<crate::model::AppProfile>,
pub ignore_warnings: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAppProfileRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_app_profile_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.app_profile_id = v.into();
self
}
pub fn set_app_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AppProfile>,
{
self.app_profile = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AppProfile>,
{
self.app_profile = v.map(|x| x.into());
self
}
pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_warnings = v.into();
self
}
}
impl wkt::message::Message for CreateAppProfileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateAppProfileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAppProfileRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAppProfileRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAppProfileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetAppProfileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAppProfilesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAppProfilesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListAppProfilesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListAppProfilesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAppProfilesResponse {
pub app_profiles: std::vec::Vec<crate::model::AppProfile>,
pub next_page_token: std::string::String,
pub failed_locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAppProfilesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_app_profiles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AppProfile>,
{
use std::iter::Iterator;
self.app_profiles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_failed_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.failed_locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListAppProfilesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListAppProfilesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAppProfilesResponse {
type PageItem = crate::model::AppProfile;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.app_profiles
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAppProfileRequest {
pub app_profile: std::option::Option<crate::model::AppProfile>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub ignore_warnings: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAppProfileRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_app_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AppProfile>,
{
self.app_profile = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AppProfile>,
{
self.app_profile = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_warnings = v.into();
self
}
}
impl wkt::message::Message for UpdateAppProfileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateAppProfileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAppProfileRequest {
pub name: std::string::String,
pub ignore_warnings: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAppProfileRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_warnings = v.into();
self
}
}
impl wkt::message::Message for DeleteAppProfileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteAppProfileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAppProfileMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAppProfileMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpdateAppProfileMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateAppProfileMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHotTabletsRequest {
pub parent: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListHotTabletsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListHotTabletsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListHotTabletsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHotTabletsResponse {
pub hot_tablets: std::vec::Vec<crate::model::HotTablet>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListHotTabletsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hot_tablets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::HotTablet>,
{
use std::iter::Iterator;
self.hot_tablets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListHotTabletsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListHotTabletsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListHotTabletsResponse {
type PageItem = crate::model::HotTablet;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.hot_tablets
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateLogicalViewRequest {
pub parent: std::string::String,
pub logical_view_id: std::string::String,
pub logical_view: std::option::Option<crate::model::LogicalView>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateLogicalViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_logical_view_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.logical_view_id = v.into();
self
}
pub fn set_logical_view<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogicalView>,
{
self.logical_view = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogicalView>,
{
self.logical_view = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateLogicalViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateLogicalViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateLogicalViewMetadata {
pub original_request: std::option::Option<crate::model::CreateLogicalViewRequest>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateLogicalViewMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CreateLogicalViewRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CreateLogicalViewRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateLogicalViewMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateLogicalViewMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetLogicalViewRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetLogicalViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetLogicalViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetLogicalViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLogicalViewsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLogicalViewsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListLogicalViewsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListLogicalViewsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLogicalViewsResponse {
pub logical_views: std::vec::Vec<crate::model::LogicalView>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLogicalViewsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_logical_views<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogicalView>,
{
use std::iter::Iterator;
self.logical_views = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListLogicalViewsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListLogicalViewsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListLogicalViewsResponse {
type PageItem = crate::model::LogicalView;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.logical_views
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateLogicalViewRequest {
pub logical_view: std::option::Option<crate::model::LogicalView>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateLogicalViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_logical_view<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogicalView>,
{
self.logical_view = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogicalView>,
{
self.logical_view = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateLogicalViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateLogicalViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateLogicalViewMetadata {
pub original_request: std::option::Option<crate::model::UpdateLogicalViewRequest>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateLogicalViewMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UpdateLogicalViewRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UpdateLogicalViewRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateLogicalViewMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateLogicalViewMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteLogicalViewRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteLogicalViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteLogicalViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteLogicalViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMaterializedViewRequest {
pub parent: std::string::String,
pub materialized_view_id: std::string::String,
pub materialized_view: std::option::Option<crate::model::MaterializedView>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMaterializedViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_materialized_view_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.materialized_view_id = v.into();
self
}
pub fn set_materialized_view<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MaterializedView>,
{
self.materialized_view = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MaterializedView>,
{
self.materialized_view = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateMaterializedViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateMaterializedViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMaterializedViewMetadata {
pub original_request: std::option::Option<crate::model::CreateMaterializedViewRequest>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMaterializedViewMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CreateMaterializedViewRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CreateMaterializedViewRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateMaterializedViewMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateMaterializedViewMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMaterializedViewRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMaterializedViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetMaterializedViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetMaterializedViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMaterializedViewsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMaterializedViewsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListMaterializedViewsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListMaterializedViewsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMaterializedViewsResponse {
pub materialized_views: std::vec::Vec<crate::model::MaterializedView>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMaterializedViewsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_materialized_views<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MaterializedView>,
{
use std::iter::Iterator;
self.materialized_views = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListMaterializedViewsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListMaterializedViewsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMaterializedViewsResponse {
type PageItem = crate::model::MaterializedView;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.materialized_views
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMaterializedViewRequest {
pub materialized_view: std::option::Option<crate::model::MaterializedView>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMaterializedViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_materialized_view<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MaterializedView>,
{
self.materialized_view = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MaterializedView>,
{
self.materialized_view = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateMaterializedViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateMaterializedViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMaterializedViewMetadata {
pub original_request: std::option::Option<crate::model::UpdateMaterializedViewRequest>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMaterializedViewMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UpdateMaterializedViewRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UpdateMaterializedViewRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateMaterializedViewMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateMaterializedViewMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMaterializedViewRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMaterializedViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteMaterializedViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteMaterializedViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreTableRequest {
pub parent: std::string::String,
pub table_id: std::string::String,
pub source: std::option::Option<crate::model::restore_table_request::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.table_id = v.into();
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::restore_table_request::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn backup(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::restore_table_request::Source::Backup(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = std::option::Option::Some(
crate::model::restore_table_request::Source::Backup(v.into()),
);
self
}
}
impl wkt::message::Message for RestoreTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.RestoreTableRequest"
}
}
pub mod restore_table_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
Backup(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreTableMetadata {
pub name: std::string::String,
pub source_type: crate::model::RestoreSourceType,
pub optimize_table_operation_name: std::string::String,
pub progress: std::option::Option<crate::model::OperationProgress>,
pub source_info: std::option::Option<crate::model::restore_table_metadata::SourceInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreTableMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_source_type<T: std::convert::Into<crate::model::RestoreSourceType>>(
mut self,
v: T,
) -> Self {
self.source_type = v.into();
self
}
pub fn set_optimize_table_operation_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.optimize_table_operation_name = v.into();
self
}
pub fn set_progress<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationProgress>,
{
self.progress = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationProgress>,
{
self.progress = v.map(|x| x.into());
self
}
pub fn set_source_info<
T: std::convert::Into<std::option::Option<crate::model::restore_table_metadata::SourceInfo>>,
>(
mut self,
v: T,
) -> Self {
self.source_info = v.into();
self
}
pub fn backup_info(&self) -> std::option::Option<&std::boxed::Box<crate::model::BackupInfo>> {
#[allow(unreachable_patterns)]
self.source_info.as_ref().and_then(|v| match v {
crate::model::restore_table_metadata::SourceInfo::BackupInfo(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_backup_info<T: std::convert::Into<std::boxed::Box<crate::model::BackupInfo>>>(
mut self,
v: T,
) -> Self {
self.source_info = std::option::Option::Some(
crate::model::restore_table_metadata::SourceInfo::BackupInfo(v.into()),
);
self
}
}
impl wkt::message::Message for RestoreTableMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.RestoreTableMetadata"
}
}
pub mod restore_table_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceInfo {
BackupInfo(std::boxed::Box<crate::model::BackupInfo>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OptimizeRestoredTableMetadata {
pub name: std::string::String,
pub progress: std::option::Option<crate::model::OperationProgress>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OptimizeRestoredTableMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_progress<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationProgress>,
{
self.progress = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationProgress>,
{
self.progress = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for OptimizeRestoredTableMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.OptimizeRestoredTableMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTableRequest {
pub parent: std::string::String,
pub table_id: std::string::String,
pub table: std::option::Option<crate::model::Table>,
pub initial_splits: std::vec::Vec<crate::model::create_table_request::Split>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.table_id = v.into();
self
}
pub fn set_table<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Table>,
{
self.table = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Table>,
{
self.table = v.map(|x| x.into());
self
}
pub fn set_initial_splits<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::create_table_request::Split>,
{
use std::iter::Iterator;
self.initial_splits = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CreateTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateTableRequest"
}
}
pub mod create_table_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Split {
pub key: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Split {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
}
impl wkt::message::Message for Split {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateTableRequest.Split"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTableFromSnapshotRequest {
pub parent: std::string::String,
pub table_id: std::string::String,
pub source_snapshot: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTableFromSnapshotRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.table_id = v.into();
self
}
pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_snapshot = v.into();
self
}
}
impl wkt::message::Message for CreateTableFromSnapshotRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateTableFromSnapshotRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DropRowRangeRequest {
pub name: std::string::String,
pub target: std::option::Option<crate::model::drop_row_range_request::Target>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DropRowRangeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_target<
T: std::convert::Into<std::option::Option<crate::model::drop_row_range_request::Target>>,
>(
mut self,
v: T,
) -> Self {
self.target = v.into();
self
}
pub fn row_key_prefix(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.target.as_ref().and_then(|v| match v {
crate::model::drop_row_range_request::Target::RowKeyPrefix(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_row_key_prefix<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.target = std::option::Option::Some(
crate::model::drop_row_range_request::Target::RowKeyPrefix(v.into()),
);
self
}
pub fn delete_all_data_from_table(&self) -> std::option::Option<&bool> {
#[allow(unreachable_patterns)]
self.target.as_ref().and_then(|v| match v {
crate::model::drop_row_range_request::Target::DeleteAllDataFromTable(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_delete_all_data_from_table<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.target = std::option::Option::Some(
crate::model::drop_row_range_request::Target::DeleteAllDataFromTable(v.into()),
);
self
}
}
impl wkt::message::Message for DropRowRangeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DropRowRangeRequest"
}
}
pub mod drop_row_range_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Target {
RowKeyPrefix(::bytes::Bytes),
DeleteAllDataFromTable(bool),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTablesRequest {
pub parent: std::string::String,
pub view: crate::model::table::View,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTablesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::table::View>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListTablesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListTablesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTablesResponse {
pub tables: std::vec::Vec<crate::model::Table>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTablesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Table>,
{
use std::iter::Iterator;
self.tables = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListTablesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListTablesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTablesResponse {
type PageItem = crate::model::Table;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.tables
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetTableRequest {
pub name: std::string::String,
pub view: crate::model::table::View,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::table::View>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTableRequest {
pub table: std::option::Option<crate::model::Table>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub ignore_warnings: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_table<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Table>,
{
self.table = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Table>,
{
self.table = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_warnings = v.into();
self
}
}
impl wkt::message::Message for UpdateTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTableMetadata {
pub name: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTableMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateTableMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateTableMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTableRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteTableRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for UndeleteTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UndeleteTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteTableMetadata {
pub name: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteTableMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UndeleteTableMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UndeleteTableMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ModifyColumnFamiliesRequest {
pub name: std::string::String,
pub modifications: std::vec::Vec<crate::model::modify_column_families_request::Modification>,
pub ignore_warnings: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ModifyColumnFamiliesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_modifications<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::modify_column_families_request::Modification>,
{
use std::iter::Iterator;
self.modifications = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_warnings = v.into();
self
}
}
impl wkt::message::Message for ModifyColumnFamiliesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ModifyColumnFamiliesRequest"
}
}
pub mod modify_column_families_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Modification {
pub id: std::string::String,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub r#mod:
std::option::Option<crate::model::modify_column_families_request::modification::Mod>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Modification {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_mod<
T: std::convert::Into<
std::option::Option<
crate::model::modify_column_families_request::modification::Mod,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.r#mod = v.into();
self
}
pub fn create(&self) -> std::option::Option<&std::boxed::Box<crate::model::ColumnFamily>> {
#[allow(unreachable_patterns)]
self.r#mod.as_ref().and_then(|v| match v {
crate::model::modify_column_families_request::modification::Mod::Create(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create<T: std::convert::Into<std::boxed::Box<crate::model::ColumnFamily>>>(
mut self,
v: T,
) -> Self {
self.r#mod = std::option::Option::Some(
crate::model::modify_column_families_request::modification::Mod::Create(v.into()),
);
self
}
pub fn update(&self) -> std::option::Option<&std::boxed::Box<crate::model::ColumnFamily>> {
#[allow(unreachable_patterns)]
self.r#mod.as_ref().and_then(|v| match v {
crate::model::modify_column_families_request::modification::Mod::Update(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_update<T: std::convert::Into<std::boxed::Box<crate::model::ColumnFamily>>>(
mut self,
v: T,
) -> Self {
self.r#mod = std::option::Option::Some(
crate::model::modify_column_families_request::modification::Mod::Update(v.into()),
);
self
}
pub fn drop(&self) -> std::option::Option<&bool> {
#[allow(unreachable_patterns)]
self.r#mod.as_ref().and_then(|v| match v {
crate::model::modify_column_families_request::modification::Mod::Drop(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.r#mod = std::option::Option::Some(
crate::model::modify_column_families_request::modification::Mod::Drop(v.into()),
);
self
}
}
impl wkt::message::Message for Modification {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification"
}
}
pub mod modification {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mod {
Create(std::boxed::Box<crate::model::ColumnFamily>),
Update(std::boxed::Box<crate::model::ColumnFamily>),
Drop(bool),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateConsistencyTokenRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateConsistencyTokenRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GenerateConsistencyTokenRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GenerateConsistencyTokenRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateConsistencyTokenResponse {
pub consistency_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateConsistencyTokenResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_consistency_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.consistency_token = v.into();
self
}
}
impl wkt::message::Message for GenerateConsistencyTokenResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GenerateConsistencyTokenResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CheckConsistencyRequest {
pub name: std::string::String,
pub consistency_token: std::string::String,
pub mode: std::option::Option<crate::model::check_consistency_request::Mode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CheckConsistencyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_consistency_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.consistency_token = v.into();
self
}
pub fn set_mode<
T: std::convert::Into<std::option::Option<crate::model::check_consistency_request::Mode>>,
>(
mut self,
v: T,
) -> Self {
self.mode = v.into();
self
}
pub fn standard_read_remote_writes(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::StandardReadRemoteWrites>> {
#[allow(unreachable_patterns)]
self.mode.as_ref().and_then(|v| match v {
crate::model::check_consistency_request::Mode::StandardReadRemoteWrites(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_standard_read_remote_writes<
T: std::convert::Into<std::boxed::Box<crate::model::StandardReadRemoteWrites>>,
>(
mut self,
v: T,
) -> Self {
self.mode = std::option::Option::Some(
crate::model::check_consistency_request::Mode::StandardReadRemoteWrites(v.into()),
);
self
}
pub fn data_boost_read_local_writes(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataBoostReadLocalWrites>> {
#[allow(unreachable_patterns)]
self.mode.as_ref().and_then(|v| match v {
crate::model::check_consistency_request::Mode::DataBoostReadLocalWrites(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_data_boost_read_local_writes<
T: std::convert::Into<std::boxed::Box<crate::model::DataBoostReadLocalWrites>>,
>(
mut self,
v: T,
) -> Self {
self.mode = std::option::Option::Some(
crate::model::check_consistency_request::Mode::DataBoostReadLocalWrites(v.into()),
);
self
}
}
impl wkt::message::Message for CheckConsistencyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CheckConsistencyRequest"
}
}
pub mod check_consistency_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mode {
StandardReadRemoteWrites(std::boxed::Box<crate::model::StandardReadRemoteWrites>),
DataBoostReadLocalWrites(std::boxed::Box<crate::model::DataBoostReadLocalWrites>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StandardReadRemoteWrites {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StandardReadRemoteWrites {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for StandardReadRemoteWrites {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.StandardReadRemoteWrites"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataBoostReadLocalWrites {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataBoostReadLocalWrites {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DataBoostReadLocalWrites {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DataBoostReadLocalWrites"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CheckConsistencyResponse {
pub consistent: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CheckConsistencyResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_consistent<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.consistent = v.into();
self
}
}
impl wkt::message::Message for CheckConsistencyResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CheckConsistencyResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SnapshotTableRequest {
pub name: std::string::String,
pub cluster: std::string::String,
pub snapshot_id: std::string::String,
pub ttl: std::option::Option<wkt::Duration>,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SnapshotTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster = v.into();
self
}
pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.snapshot_id = v.into();
self
}
pub fn set_ttl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.ttl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.ttl = v.map(|x| x.into());
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for SnapshotTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.SnapshotTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSnapshotRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSnapshotRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSnapshotRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetSnapshotRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSnapshotsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSnapshotsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListSnapshotsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListSnapshotsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSnapshotsResponse {
pub snapshots: std::vec::Vec<crate::model::Snapshot>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSnapshotsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_snapshots<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Snapshot>,
{
use std::iter::Iterator;
self.snapshots = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSnapshotsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListSnapshotsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
type PageItem = crate::model::Snapshot;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.snapshots
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSnapshotRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSnapshotRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteSnapshotRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteSnapshotRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SnapshotTableMetadata {
pub original_request: std::option::Option<crate::model::SnapshotTableRequest>,
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SnapshotTableMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SnapshotTableRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SnapshotTableRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SnapshotTableMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.SnapshotTableMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTableFromSnapshotMetadata {
pub original_request: std::option::Option<crate::model::CreateTableFromSnapshotRequest>,
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTableFromSnapshotMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CreateTableFromSnapshotRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CreateTableFromSnapshotRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateTableFromSnapshotMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateTableFromSnapshotMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBackupRequest {
pub parent: std::string::String,
pub backup_id: std::string::String,
pub backup: std::option::Option<crate::model::Backup>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_id = v.into();
self
}
pub fn set_backup<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBackupMetadata {
pub name: std::string::String,
pub source_table: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBackupMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_table = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateBackupMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateBackupMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBackupRequest {
pub backup: std::option::Option<crate::model::Backup>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBackupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBackupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsRequest {
pub parent: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListBackupsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListBackupsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsResponse {
pub backups: std::vec::Vec<crate::model::Backup>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Backup>,
{
use std::iter::Iterator;
self.backups = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListBackupsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListBackupsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
type PageItem = crate::model::Backup;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.backups
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CopyBackupRequest {
pub parent: std::string::String,
pub backup_id: std::string::String,
pub source_backup: std::string::String,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CopyBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_id = v.into();
self
}
pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_backup = v.into();
self
}
pub fn set_expire_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CopyBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CopyBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CopyBackupMetadata {
pub name: std::string::String,
pub source_backup_info: std::option::Option<crate::model::BackupInfo>,
pub progress: std::option::Option<crate::model::OperationProgress>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CopyBackupMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_source_backup_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupInfo>,
{
self.source_backup_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_backup_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupInfo>,
{
self.source_backup_info = v.map(|x| x.into());
self
}
pub fn set_progress<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationProgress>,
{
self.progress = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationProgress>,
{
self.progress = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CopyBackupMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CopyBackupMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAuthorizedViewRequest {
pub parent: std::string::String,
pub authorized_view_id: std::string::String,
pub authorized_view: std::option::Option<crate::model::AuthorizedView>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAuthorizedViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_authorized_view_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.authorized_view_id = v.into();
self
}
pub fn set_authorized_view<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AuthorizedView>,
{
self.authorized_view = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AuthorizedView>,
{
self.authorized_view = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateAuthorizedViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateAuthorizedViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAuthorizedViewMetadata {
pub original_request: std::option::Option<crate::model::CreateAuthorizedViewRequest>,
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAuthorizedViewMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CreateAuthorizedViewRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CreateAuthorizedViewRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateAuthorizedViewMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateAuthorizedViewMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAuthorizedViewsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub view: crate::model::authorized_view::ResponseView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAuthorizedViewsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::authorized_view::ResponseView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListAuthorizedViewsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListAuthorizedViewsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAuthorizedViewsResponse {
pub authorized_views: std::vec::Vec<crate::model::AuthorizedView>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAuthorizedViewsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_authorized_views<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuthorizedView>,
{
use std::iter::Iterator;
self.authorized_views = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListAuthorizedViewsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListAuthorizedViewsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizedViewsResponse {
type PageItem = crate::model::AuthorizedView;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.authorized_views
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAuthorizedViewRequest {
pub name: std::string::String,
pub view: crate::model::authorized_view::ResponseView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAuthorizedViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::authorized_view::ResponseView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetAuthorizedViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetAuthorizedViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAuthorizedViewRequest {
pub authorized_view: std::option::Option<crate::model::AuthorizedView>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub ignore_warnings: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAuthorizedViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_authorized_view<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AuthorizedView>,
{
self.authorized_view = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AuthorizedView>,
{
self.authorized_view = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_warnings = v.into();
self
}
}
impl wkt::message::Message for UpdateAuthorizedViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateAuthorizedViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAuthorizedViewMetadata {
pub original_request: std::option::Option<crate::model::UpdateAuthorizedViewRequest>,
pub request_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAuthorizedViewMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_original_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UpdateAuthorizedViewRequest>,
{
self.original_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UpdateAuthorizedViewRequest>,
{
self.original_request = v.map(|x| x.into());
self
}
pub fn set_request_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.request_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateAuthorizedViewMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateAuthorizedViewMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAuthorizedViewRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAuthorizedViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteAuthorizedViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteAuthorizedViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSchemaBundleRequest {
pub parent: std::string::String,
pub schema_bundle_id: std::string::String,
pub schema_bundle: std::option::Option<crate::model::SchemaBundle>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSchemaBundleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.schema_bundle_id = v.into();
self
}
pub fn set_schema_bundle<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SchemaBundle>,
{
self.schema_bundle = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SchemaBundle>,
{
self.schema_bundle = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateSchemaBundleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateSchemaBundleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSchemaBundleMetadata {
pub name: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSchemaBundleMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateSchemaBundleMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.CreateSchemaBundleMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSchemaBundleRequest {
pub schema_bundle: std::option::Option<crate::model::SchemaBundle>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub ignore_warnings: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSchemaBundleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_schema_bundle<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SchemaBundle>,
{
self.schema_bundle = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SchemaBundle>,
{
self.schema_bundle = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_ignore_warnings<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ignore_warnings = v.into();
self
}
}
impl wkt::message::Message for UpdateSchemaBundleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateSchemaBundleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSchemaBundleMetadata {
pub name: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSchemaBundleMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSchemaBundleMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.UpdateSchemaBundleMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSchemaBundleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSchemaBundleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSchemaBundleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GetSchemaBundleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSchemaBundlesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSchemaBundlesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListSchemaBundlesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListSchemaBundlesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSchemaBundlesResponse {
pub schema_bundles: std::vec::Vec<crate::model::SchemaBundle>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSchemaBundlesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_schema_bundles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SchemaBundle>,
{
use std::iter::Iterator;
self.schema_bundles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSchemaBundlesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ListSchemaBundlesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSchemaBundlesResponse {
type PageItem = crate::model::SchemaBundle;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.schema_bundles
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSchemaBundleRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSchemaBundleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteSchemaBundleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.DeleteSchemaBundleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationProgress {
pub progress_percent: i32,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationProgress {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.progress_percent = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for OperationProgress {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.OperationProgress"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Instance {
pub name: std::string::String,
pub display_name: std::string::String,
pub state: crate::model::instance::State,
pub r#type: crate::model::instance::Type,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub satisfies_pzs: std::option::Option<bool>,
pub satisfies_pzi: std::option::Option<bool>,
pub tags: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Instance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::instance::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.satisfies_pzs = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.satisfies_pzs = v.map(|x| x.into());
self
}
pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.satisfies_pzi = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.satisfies_pzi = v.map(|x| x.into());
self
}
pub fn set_tags<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for Instance {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Instance"
}
}
pub mod instance {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
NotKnown,
Ready,
Creating,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::NotKnown => std::option::Option::Some(0),
Self::Ready => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
Self::Ready => std::option::Option::Some("READY"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::NotKnown,
1 => Self::Ready,
2 => Self::Creating,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_NOT_KNOWN" => Self::NotKnown,
"READY" => Self::Ready,
"CREATING" => Self::Creating,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::NotKnown => serializer.serialize_i32(0),
Self::Ready => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.bigtable.admin.v2.Instance.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Production,
Development,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Production => std::option::Option::Some(1),
Self::Development => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Production => std::option::Option::Some("PRODUCTION"),
Self::Development => std::option::Option::Some("DEVELOPMENT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Production,
2 => Self::Development,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"PRODUCTION" => Self::Production,
"DEVELOPMENT" => Self::Development,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Production => serializer.serialize_i32(1),
Self::Development => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.bigtable.admin.v2.Instance.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutoscalingTargets {
pub cpu_utilization_percent: i32,
pub storage_utilization_gib_per_node: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutoscalingTargets {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cpu_utilization_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_utilization_percent = v.into();
self
}
pub fn set_storage_utilization_gib_per_node<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.storage_utilization_gib_per_node = v.into();
self
}
}
impl wkt::message::Message for AutoscalingTargets {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AutoscalingTargets"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutoscalingLimits {
pub min_serve_nodes: i32,
pub max_serve_nodes: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutoscalingLimits {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.min_serve_nodes = v.into();
self
}
pub fn set_max_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_serve_nodes = v.into();
self
}
}
impl wkt::message::Message for AutoscalingLimits {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AutoscalingLimits"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Cluster {
pub name: std::string::String,
pub location: std::string::String,
pub state: crate::model::cluster::State,
pub serve_nodes: i32,
pub node_scaling_factor: crate::model::cluster::NodeScalingFactor,
pub default_storage_type: crate::model::StorageType,
pub encryption_config: std::option::Option<crate::model::cluster::EncryptionConfig>,
pub config: std::option::Option<crate::model::cluster::Config>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Cluster {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_serve_nodes<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.serve_nodes = v.into();
self
}
pub fn set_node_scaling_factor<
T: std::convert::Into<crate::model::cluster::NodeScalingFactor>,
>(
mut self,
v: T,
) -> Self {
self.node_scaling_factor = v.into();
self
}
pub fn set_default_storage_type<T: std::convert::Into<crate::model::StorageType>>(
mut self,
v: T,
) -> Self {
self.default_storage_type = v.into();
self
}
pub fn set_encryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
{
self.encryption_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
{
self.encryption_config = v.map(|x| x.into());
self
}
pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::cluster::Config>>>(
mut self,
v: T,
) -> Self {
self.config = v.into();
self
}
pub fn cluster_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::cluster::ClusterConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::cluster::Config::ClusterConfig(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_cluster_config<
T: std::convert::Into<std::boxed::Box<crate::model::cluster::ClusterConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config =
std::option::Option::Some(crate::model::cluster::Config::ClusterConfig(v.into()));
self
}
}
impl wkt::message::Message for Cluster {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Cluster"
}
}
pub mod cluster {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterAutoscalingConfig {
pub autoscaling_limits: std::option::Option<crate::model::AutoscalingLimits>,
pub autoscaling_targets: std::option::Option<crate::model::AutoscalingTargets>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterAutoscalingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_autoscaling_limits<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutoscalingLimits>,
{
self.autoscaling_limits = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_autoscaling_limits<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutoscalingLimits>,
{
self.autoscaling_limits = v.map(|x| x.into());
self
}
pub fn set_autoscaling_targets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutoscalingTargets>,
{
self.autoscaling_targets = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_autoscaling_targets<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutoscalingTargets>,
{
self.autoscaling_targets = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ClusterAutoscalingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterConfig {
pub cluster_autoscaling_config:
std::option::Option<crate::model::cluster::ClusterAutoscalingConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster_autoscaling_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::cluster::ClusterAutoscalingConfig>,
{
self.cluster_autoscaling_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cluster_autoscaling_config<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::cluster::ClusterAutoscalingConfig>,
{
self.cluster_autoscaling_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ClusterConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Cluster.ClusterConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionConfig {
pub kms_key_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.kms_key_name = v.into();
self
}
}
impl wkt::message::Message for EncryptionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Cluster.EncryptionConfig"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
NotKnown,
Ready,
Creating,
Resizing,
Disabled,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::NotKnown => std::option::Option::Some(0),
Self::Ready => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::Resizing => std::option::Option::Some(3),
Self::Disabled => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
Self::Ready => std::option::Option::Some("READY"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Resizing => std::option::Option::Some("RESIZING"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::NotKnown,
1 => Self::Ready,
2 => Self::Creating,
3 => Self::Resizing,
4 => Self::Disabled,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_NOT_KNOWN" => Self::NotKnown,
"READY" => Self::Ready,
"CREATING" => Self::Creating,
"RESIZING" => Self::Resizing,
"DISABLED" => Self::Disabled,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::NotKnown => serializer.serialize_i32(0),
Self::Ready => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::Resizing => serializer.serialize_i32(3),
Self::Disabled => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.bigtable.admin.v2.Cluster.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NodeScalingFactor {
Unspecified,
NodeScalingFactor1X,
NodeScalingFactor2X,
UnknownValue(node_scaling_factor::UnknownValue),
}
#[doc(hidden)]
pub mod node_scaling_factor {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NodeScalingFactor {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NodeScalingFactor1X => std::option::Option::Some(1),
Self::NodeScalingFactor2X => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("NODE_SCALING_FACTOR_UNSPECIFIED"),
Self::NodeScalingFactor1X => std::option::Option::Some("NODE_SCALING_FACTOR_1X"),
Self::NodeScalingFactor2X => std::option::Option::Some("NODE_SCALING_FACTOR_2X"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NodeScalingFactor {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NodeScalingFactor {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for NodeScalingFactor {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NodeScalingFactor1X,
2 => Self::NodeScalingFactor2X,
_ => Self::UnknownValue(node_scaling_factor::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NodeScalingFactor {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"NODE_SCALING_FACTOR_UNSPECIFIED" => Self::Unspecified,
"NODE_SCALING_FACTOR_1X" => Self::NodeScalingFactor1X,
"NODE_SCALING_FACTOR_2X" => Self::NodeScalingFactor2X,
_ => Self::UnknownValue(node_scaling_factor::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NodeScalingFactor {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NodeScalingFactor1X => serializer.serialize_i32(1),
Self::NodeScalingFactor2X => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NodeScalingFactor {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeScalingFactor>::new(
".google.bigtable.admin.v2.Cluster.NodeScalingFactor",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Config {
ClusterConfig(std::boxed::Box<crate::model::cluster::ClusterConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AppProfile {
pub name: std::string::String,
pub etag: std::string::String,
pub description: std::string::String,
pub routing_policy: std::option::Option<crate::model::app_profile::RoutingPolicy>,
pub isolation: std::option::Option<crate::model::app_profile::Isolation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AppProfile {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_routing_policy<
T: std::convert::Into<std::option::Option<crate::model::app_profile::RoutingPolicy>>,
>(
mut self,
v: T,
) -> Self {
self.routing_policy = v.into();
self
}
pub fn multi_cluster_routing_use_any(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>>
{
#[allow(unreachable_patterns)]
self.routing_policy.as_ref().and_then(|v| match v {
crate::model::app_profile::RoutingPolicy::MultiClusterRoutingUseAny(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_multi_cluster_routing_use_any<
T: std::convert::Into<std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>>,
>(
mut self,
v: T,
) -> Self {
self.routing_policy = std::option::Option::Some(
crate::model::app_profile::RoutingPolicy::MultiClusterRoutingUseAny(v.into()),
);
self
}
pub fn single_cluster_routing(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::SingleClusterRouting>>
{
#[allow(unreachable_patterns)]
self.routing_policy.as_ref().and_then(|v| match v {
crate::model::app_profile::RoutingPolicy::SingleClusterRouting(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_single_cluster_routing<
T: std::convert::Into<std::boxed::Box<crate::model::app_profile::SingleClusterRouting>>,
>(
mut self,
v: T,
) -> Self {
self.routing_policy = std::option::Option::Some(
crate::model::app_profile::RoutingPolicy::SingleClusterRouting(v.into()),
);
self
}
pub fn set_isolation<
T: std::convert::Into<std::option::Option<crate::model::app_profile::Isolation>>,
>(
mut self,
v: T,
) -> Self {
self.isolation = v.into();
self
}
#[deprecated]
pub fn priority(&self) -> std::option::Option<&crate::model::app_profile::Priority> {
#[allow(unreachable_patterns)]
self.isolation.as_ref().and_then(|v| match v {
crate::model::app_profile::Isolation::Priority(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
#[deprecated]
pub fn set_priority<T: std::convert::Into<crate::model::app_profile::Priority>>(
mut self,
v: T,
) -> Self {
self.isolation =
std::option::Option::Some(crate::model::app_profile::Isolation::Priority(v.into()));
self
}
pub fn standard_isolation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::StandardIsolation>> {
#[allow(unreachable_patterns)]
self.isolation.as_ref().and_then(|v| match v {
crate::model::app_profile::Isolation::StandardIsolation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_standard_isolation<
T: std::convert::Into<std::boxed::Box<crate::model::app_profile::StandardIsolation>>,
>(
mut self,
v: T,
) -> Self {
self.isolation = std::option::Option::Some(
crate::model::app_profile::Isolation::StandardIsolation(v.into()),
);
self
}
pub fn data_boost_isolation_read_only(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>>
{
#[allow(unreachable_patterns)]
self.isolation.as_ref().and_then(|v| match v {
crate::model::app_profile::Isolation::DataBoostIsolationReadOnly(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_data_boost_isolation_read_only<
T: std::convert::Into<std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>>,
>(
mut self,
v: T,
) -> Self {
self.isolation = std::option::Option::Some(
crate::model::app_profile::Isolation::DataBoostIsolationReadOnly(v.into()),
);
self
}
}
impl wkt::message::Message for AppProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AppProfile"
}
}
pub mod app_profile {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MultiClusterRoutingUseAny {
pub cluster_ids: std::vec::Vec<std::string::String>,
pub affinity:
std::option::Option<crate::model::app_profile::multi_cluster_routing_use_any::Affinity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MultiClusterRoutingUseAny {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.cluster_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_affinity<
T: std::convert::Into<
std::option::Option<
crate::model::app_profile::multi_cluster_routing_use_any::Affinity,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.affinity = v.into();
self
}
pub fn row_affinity(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity>,
> {
#[allow(unreachable_patterns)]
self.affinity.as_ref().and_then(|v| match v {
crate::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_row_affinity<
T: std::convert::Into<
std::boxed::Box<
crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.affinity = std::option::Option::Some(
crate::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(
v.into(),
),
);
self
}
}
impl wkt::message::Message for MultiClusterRoutingUseAny {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny"
}
}
pub mod multi_cluster_routing_use_any {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RowAffinity {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RowAffinity {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for RowAffinity {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Affinity {
RowAffinity(
std::boxed::Box<
crate::model::app_profile::multi_cluster_routing_use_any::RowAffinity,
>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SingleClusterRouting {
pub cluster_id: std::string::String,
pub allow_transactional_writes: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SingleClusterRouting {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_id = v.into();
self
}
pub fn set_allow_transactional_writes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_transactional_writes = v.into();
self
}
}
impl wkt::message::Message for SingleClusterRouting {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AppProfile.SingleClusterRouting"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StandardIsolation {
pub priority: crate::model::app_profile::Priority,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StandardIsolation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_priority<T: std::convert::Into<crate::model::app_profile::Priority>>(
mut self,
v: T,
) -> Self {
self.priority = v.into();
self
}
}
impl wkt::message::Message for StandardIsolation {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AppProfile.StandardIsolation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataBoostIsolationReadOnly {
pub compute_billing_owner: std::option::Option<
crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataBoostIsolationReadOnly {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_compute_billing_owner<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
>,
{
self.compute_billing_owner = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_compute_billing_owner<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::app_profile::data_boost_isolation_read_only::ComputeBillingOwner,
>,
{
self.compute_billing_owner = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataBoostIsolationReadOnly {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly"
}
}
pub mod data_boost_isolation_read_only {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ComputeBillingOwner {
Unspecified,
HostPays,
UnknownValue(compute_billing_owner::UnknownValue),
}
#[doc(hidden)]
pub mod compute_billing_owner {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ComputeBillingOwner {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::HostPays => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("COMPUTE_BILLING_OWNER_UNSPECIFIED")
}
Self::HostPays => std::option::Option::Some("HOST_PAYS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ComputeBillingOwner {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ComputeBillingOwner {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ComputeBillingOwner {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::HostPays,
_ => Self::UnknownValue(compute_billing_owner::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ComputeBillingOwner {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPUTE_BILLING_OWNER_UNSPECIFIED" => Self::Unspecified,
"HOST_PAYS" => Self::HostPays,
_ => Self::UnknownValue(compute_billing_owner::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ComputeBillingOwner {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::HostPays => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ComputeBillingOwner {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeBillingOwner>::new(
".google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner"))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Priority {
Unspecified,
Low,
Medium,
High,
UnknownValue(priority::UnknownValue),
}
#[doc(hidden)]
pub mod priority {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Priority {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Low => std::option::Option::Some(1),
Self::Medium => std::option::Option::Some(2),
Self::High => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PRIORITY_UNSPECIFIED"),
Self::Low => std::option::Option::Some("PRIORITY_LOW"),
Self::Medium => std::option::Option::Some("PRIORITY_MEDIUM"),
Self::High => std::option::Option::Some("PRIORITY_HIGH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Priority {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Priority {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Priority {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Low,
2 => Self::Medium,
3 => Self::High,
_ => Self::UnknownValue(priority::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Priority {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PRIORITY_UNSPECIFIED" => Self::Unspecified,
"PRIORITY_LOW" => Self::Low,
"PRIORITY_MEDIUM" => Self::Medium,
"PRIORITY_HIGH" => Self::High,
_ => Self::UnknownValue(priority::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Priority {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Low => serializer.serialize_i32(1),
Self::Medium => serializer.serialize_i32(2),
Self::High => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Priority {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Priority>::new(
".google.bigtable.admin.v2.AppProfile.Priority",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RoutingPolicy {
MultiClusterRoutingUseAny(
std::boxed::Box<crate::model::app_profile::MultiClusterRoutingUseAny>,
),
SingleClusterRouting(std::boxed::Box<crate::model::app_profile::SingleClusterRouting>),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Isolation {
#[deprecated]
Priority(crate::model::app_profile::Priority),
StandardIsolation(std::boxed::Box<crate::model::app_profile::StandardIsolation>),
DataBoostIsolationReadOnly(
std::boxed::Box<crate::model::app_profile::DataBoostIsolationReadOnly>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HotTablet {
pub name: std::string::String,
pub table_name: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub start_key: std::string::String,
pub end_key: std::string::String,
pub node_cpu_usage_percent: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HotTablet {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_table_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.table_name = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_start_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.start_key = v.into();
self
}
pub fn set_end_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.end_key = v.into();
self
}
pub fn set_node_cpu_usage_percent<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.node_cpu_usage_percent = v.into();
self
}
}
impl wkt::message::Message for HotTablet {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.HotTablet"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogicalView {
pub name: std::string::String,
pub query: std::string::String,
pub etag: std::string::String,
pub deletion_protection: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogicalView {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.deletion_protection = v.into();
self
}
}
impl wkt::message::Message for LogicalView {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.LogicalView"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MaterializedView {
pub name: std::string::String,
pub query: std::string::String,
pub etag: std::string::String,
pub deletion_protection: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MaterializedView {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.deletion_protection = v.into();
self
}
}
impl wkt::message::Message for MaterializedView {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.MaterializedView"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreInfo {
pub source_type: crate::model::RestoreSourceType,
pub source_info: std::option::Option<crate::model::restore_info::SourceInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_type<T: std::convert::Into<crate::model::RestoreSourceType>>(
mut self,
v: T,
) -> Self {
self.source_type = v.into();
self
}
pub fn set_source_info<
T: std::convert::Into<std::option::Option<crate::model::restore_info::SourceInfo>>,
>(
mut self,
v: T,
) -> Self {
self.source_info = v.into();
self
}
pub fn backup_info(&self) -> std::option::Option<&std::boxed::Box<crate::model::BackupInfo>> {
#[allow(unreachable_patterns)]
self.source_info.as_ref().and_then(|v| match v {
crate::model::restore_info::SourceInfo::BackupInfo(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_backup_info<T: std::convert::Into<std::boxed::Box<crate::model::BackupInfo>>>(
mut self,
v: T,
) -> Self {
self.source_info =
std::option::Option::Some(crate::model::restore_info::SourceInfo::BackupInfo(v.into()));
self
}
}
impl wkt::message::Message for RestoreInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.RestoreInfo"
}
}
pub mod restore_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceInfo {
BackupInfo(std::boxed::Box<crate::model::BackupInfo>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChangeStreamConfig {
pub retention_period: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChangeStreamConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_retention_period<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention_period = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention_period = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ChangeStreamConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ChangeStreamConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Table {
pub name: std::string::String,
pub cluster_states:
std::collections::HashMap<std::string::String, crate::model::table::ClusterState>,
pub column_families: std::collections::HashMap<std::string::String, crate::model::ColumnFamily>,
pub granularity: crate::model::table::TimestampGranularity,
pub restore_info: std::option::Option<crate::model::RestoreInfo>,
pub change_stream_config: std::option::Option<crate::model::ChangeStreamConfig>,
pub deletion_protection: bool,
pub tiered_storage_config: std::option::Option<crate::model::TieredStorageConfig>,
pub row_key_schema: std::option::Option<crate::model::r#type::Struct>,
pub automated_backup_config: std::option::Option<crate::model::table::AutomatedBackupConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Table {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_cluster_states<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::table::ClusterState>,
{
use std::iter::Iterator;
self.cluster_states = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_column_families<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::ColumnFamily>,
{
use std::iter::Iterator;
self.column_families = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_granularity<T: std::convert::Into<crate::model::table::TimestampGranularity>>(
mut self,
v: T,
) -> Self {
self.granularity = v.into();
self
}
pub fn set_restore_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RestoreInfo>,
{
self.restore_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_restore_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RestoreInfo>,
{
self.restore_info = v.map(|x| x.into());
self
}
pub fn set_change_stream_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ChangeStreamConfig>,
{
self.change_stream_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_change_stream_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ChangeStreamConfig>,
{
self.change_stream_config = v.map(|x| x.into());
self
}
pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.deletion_protection = v.into();
self
}
pub fn set_tiered_storage_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TieredStorageConfig>,
{
self.tiered_storage_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tiered_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TieredStorageConfig>,
{
self.tiered_storage_config = v.map(|x| x.into());
self
}
pub fn set_row_key_schema<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::r#type::Struct>,
{
self.row_key_schema = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_row_key_schema<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::r#type::Struct>,
{
self.row_key_schema = v.map(|x| x.into());
self
}
pub fn set_automated_backup_config<
T: std::convert::Into<std::option::Option<crate::model::table::AutomatedBackupConfig>>,
>(
mut self,
v: T,
) -> Self {
self.automated_backup_config = v.into();
self
}
pub fn automated_backup_policy(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::table::AutomatedBackupPolicy>> {
#[allow(unreachable_patterns)]
self.automated_backup_config.as_ref().and_then(|v| match v {
crate::model::table::AutomatedBackupConfig::AutomatedBackupPolicy(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_automated_backup_policy<
T: std::convert::Into<std::boxed::Box<crate::model::table::AutomatedBackupPolicy>>,
>(
mut self,
v: T,
) -> Self {
self.automated_backup_config = std::option::Option::Some(
crate::model::table::AutomatedBackupConfig::AutomatedBackupPolicy(v.into()),
);
self
}
}
impl wkt::message::Message for Table {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Table"
}
}
pub mod table {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterState {
pub replication_state: crate::model::table::cluster_state::ReplicationState,
pub encryption_info: std::vec::Vec<crate::model::EncryptionInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterState {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_replication_state<
T: std::convert::Into<crate::model::table::cluster_state::ReplicationState>,
>(
mut self,
v: T,
) -> Self {
self.replication_state = v.into();
self
}
pub fn set_encryption_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EncryptionInfo>,
{
use std::iter::Iterator;
self.encryption_info = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ClusterState {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Table.ClusterState"
}
}
pub mod cluster_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ReplicationState {
StateNotKnown,
Initializing,
PlannedMaintenance,
UnplannedMaintenance,
Ready,
ReadyOptimizing,
UnknownValue(replication_state::UnknownValue),
}
#[doc(hidden)]
pub mod replication_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ReplicationState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::StateNotKnown => std::option::Option::Some(0),
Self::Initializing => std::option::Option::Some(1),
Self::PlannedMaintenance => std::option::Option::Some(2),
Self::UnplannedMaintenance => std::option::Option::Some(3),
Self::Ready => std::option::Option::Some(4),
Self::ReadyOptimizing => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::StateNotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
Self::Initializing => std::option::Option::Some("INITIALIZING"),
Self::PlannedMaintenance => std::option::Option::Some("PLANNED_MAINTENANCE"),
Self::UnplannedMaintenance => {
std::option::Option::Some("UNPLANNED_MAINTENANCE")
}
Self::Ready => std::option::Option::Some("READY"),
Self::ReadyOptimizing => std::option::Option::Some("READY_OPTIMIZING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ReplicationState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ReplicationState {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ReplicationState {
fn from(value: i32) -> Self {
match value {
0 => Self::StateNotKnown,
1 => Self::Initializing,
2 => Self::PlannedMaintenance,
3 => Self::UnplannedMaintenance,
4 => Self::Ready,
5 => Self::ReadyOptimizing,
_ => Self::UnknownValue(replication_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ReplicationState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_NOT_KNOWN" => Self::StateNotKnown,
"INITIALIZING" => Self::Initializing,
"PLANNED_MAINTENANCE" => Self::PlannedMaintenance,
"UNPLANNED_MAINTENANCE" => Self::UnplannedMaintenance,
"READY" => Self::Ready,
"READY_OPTIMIZING" => Self::ReadyOptimizing,
_ => Self::UnknownValue(replication_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ReplicationState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::StateNotKnown => serializer.serialize_i32(0),
Self::Initializing => serializer.serialize_i32(1),
Self::PlannedMaintenance => serializer.serialize_i32(2),
Self::UnplannedMaintenance => serializer.serialize_i32(3),
Self::Ready => serializer.serialize_i32(4),
Self::ReadyOptimizing => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ReplicationState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationState>::new(
".google.bigtable.admin.v2.Table.ClusterState.ReplicationState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomatedBackupPolicy {
pub retention_period: std::option::Option<wkt::Duration>,
pub frequency: std::option::Option<wkt::Duration>,
pub locations: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomatedBackupPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_retention_period<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention_period = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention_period = v.map(|x| x.into());
self
}
pub fn set_frequency<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.frequency = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_frequency<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.frequency = v.map(|x| x.into());
self
}
pub fn set_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.locations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AutomatedBackupPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Table.AutomatedBackupPolicy"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TimestampGranularity {
Unspecified,
Millis,
UnknownValue(timestamp_granularity::UnknownValue),
}
#[doc(hidden)]
pub mod timestamp_granularity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TimestampGranularity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Millis => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TIMESTAMP_GRANULARITY_UNSPECIFIED"),
Self::Millis => std::option::Option::Some("MILLIS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TimestampGranularity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TimestampGranularity {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TimestampGranularity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Millis,
_ => Self::UnknownValue(timestamp_granularity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TimestampGranularity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TIMESTAMP_GRANULARITY_UNSPECIFIED" => Self::Unspecified,
"MILLIS" => Self::Millis,
_ => Self::UnknownValue(timestamp_granularity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TimestampGranularity {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Millis => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TimestampGranularity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TimestampGranularity>::new(
".google.bigtable.admin.v2.Table.TimestampGranularity",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum View {
Unspecified,
NameOnly,
SchemaView,
ReplicationView,
EncryptionView,
Full,
UnknownValue(view::UnknownValue),
}
#[doc(hidden)]
pub mod view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl View {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NameOnly => std::option::Option::Some(1),
Self::SchemaView => std::option::Option::Some(2),
Self::ReplicationView => std::option::Option::Some(3),
Self::EncryptionView => std::option::Option::Some(5),
Self::Full => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("VIEW_UNSPECIFIED"),
Self::NameOnly => std::option::Option::Some("NAME_ONLY"),
Self::SchemaView => std::option::Option::Some("SCHEMA_VIEW"),
Self::ReplicationView => std::option::Option::Some("REPLICATION_VIEW"),
Self::EncryptionView => std::option::Option::Some("ENCRYPTION_VIEW"),
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for View {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for View {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for View {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NameOnly,
2 => Self::SchemaView,
3 => Self::ReplicationView,
4 => Self::Full,
5 => Self::EncryptionView,
_ => Self::UnknownValue(view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for View {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VIEW_UNSPECIFIED" => Self::Unspecified,
"NAME_ONLY" => Self::NameOnly,
"SCHEMA_VIEW" => Self::SchemaView,
"REPLICATION_VIEW" => Self::ReplicationView,
"ENCRYPTION_VIEW" => Self::EncryptionView,
"FULL" => Self::Full,
_ => Self::UnknownValue(view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for View {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NameOnly => serializer.serialize_i32(1),
Self::SchemaView => serializer.serialize_i32(2),
Self::ReplicationView => serializer.serialize_i32(3),
Self::EncryptionView => serializer.serialize_i32(5),
Self::Full => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for View {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<View>::new(
".google.bigtable.admin.v2.Table.View",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AutomatedBackupConfig {
AutomatedBackupPolicy(std::boxed::Box<crate::model::table::AutomatedBackupPolicy>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuthorizedView {
pub name: std::string::String,
pub etag: std::string::String,
pub deletion_protection: bool,
pub authorized_view: std::option::Option<crate::model::authorized_view::AuthorizedView>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuthorizedView {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_deletion_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.deletion_protection = v.into();
self
}
pub fn set_authorized_view<
T: std::convert::Into<std::option::Option<crate::model::authorized_view::AuthorizedView>>,
>(
mut self,
v: T,
) -> Self {
self.authorized_view = v.into();
self
}
pub fn subset_view(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::authorized_view::SubsetView>> {
#[allow(unreachable_patterns)]
self.authorized_view.as_ref().and_then(|v| match v {
crate::model::authorized_view::AuthorizedView::SubsetView(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_subset_view<
T: std::convert::Into<std::boxed::Box<crate::model::authorized_view::SubsetView>>,
>(
mut self,
v: T,
) -> Self {
self.authorized_view = std::option::Option::Some(
crate::model::authorized_view::AuthorizedView::SubsetView(v.into()),
);
self
}
}
impl wkt::message::Message for AuthorizedView {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AuthorizedView"
}
}
pub mod authorized_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FamilySubsets {
pub qualifiers: std::vec::Vec<::bytes::Bytes>,
pub qualifier_prefixes: std::vec::Vec<::bytes::Bytes>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FamilySubsets {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_qualifiers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<::bytes::Bytes>,
{
use std::iter::Iterator;
self.qualifiers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_qualifier_prefixes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<::bytes::Bytes>,
{
use std::iter::Iterator;
self.qualifier_prefixes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FamilySubsets {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AuthorizedView.FamilySubsets"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubsetView {
pub row_prefixes: std::vec::Vec<::bytes::Bytes>,
pub family_subsets: std::collections::HashMap<
std::string::String,
crate::model::authorized_view::FamilySubsets,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubsetView {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_row_prefixes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<::bytes::Bytes>,
{
use std::iter::Iterator;
self.row_prefixes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_family_subsets<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::authorized_view::FamilySubsets>,
{
use std::iter::Iterator;
self.family_subsets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for SubsetView {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.AuthorizedView.SubsetView"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResponseView {
Unspecified,
NameOnly,
Basic,
Full,
UnknownValue(response_view::UnknownValue),
}
#[doc(hidden)]
pub mod response_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ResponseView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NameOnly => std::option::Option::Some(1),
Self::Basic => std::option::Option::Some(2),
Self::Full => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RESPONSE_VIEW_UNSPECIFIED"),
Self::NameOnly => std::option::Option::Some("NAME_ONLY"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ResponseView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ResponseView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ResponseView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NameOnly,
2 => Self::Basic,
3 => Self::Full,
_ => Self::UnknownValue(response_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ResponseView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESPONSE_VIEW_UNSPECIFIED" => Self::Unspecified,
"NAME_ONLY" => Self::NameOnly,
"BASIC" => Self::Basic,
"FULL" => Self::Full,
_ => Self::UnknownValue(response_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ResponseView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NameOnly => serializer.serialize_i32(1),
Self::Basic => serializer.serialize_i32(2),
Self::Full => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ResponseView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResponseView>::new(
".google.bigtable.admin.v2.AuthorizedView.ResponseView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthorizedView {
SubsetView(std::boxed::Box<crate::model::authorized_view::SubsetView>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ColumnFamily {
pub gc_rule: std::option::Option<crate::model::GcRule>,
pub value_type: std::option::Option<crate::model::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ColumnFamily {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_gc_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GcRule>,
{
self.gc_rule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gc_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GcRule>,
{
self.gc_rule = v.map(|x| x.into());
self
}
pub fn set_value_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.value_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_value_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.value_type = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ColumnFamily {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ColumnFamily"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GcRule {
pub rule: std::option::Option<crate::model::gc_rule::Rule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GcRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::gc_rule::Rule>>>(
mut self,
v: T,
) -> Self {
self.rule = v.into();
self
}
pub fn max_num_versions(&self) -> std::option::Option<&i32> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::gc_rule::Rule::MaxNumVersions(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_max_num_versions<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.rule =
std::option::Option::Some(crate::model::gc_rule::Rule::MaxNumVersions(v.into()));
self
}
pub fn max_age(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::gc_rule::Rule::MaxAge(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_max_age<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::MaxAge(v.into()));
self
}
pub fn intersection(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::gc_rule::Intersection>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::gc_rule::Rule::Intersection(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_intersection<
T: std::convert::Into<std::boxed::Box<crate::model::gc_rule::Intersection>>,
>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::Intersection(v.into()));
self
}
pub fn union(&self) -> std::option::Option<&std::boxed::Box<crate::model::gc_rule::Union>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::gc_rule::Rule::Union(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_union<T: std::convert::Into<std::boxed::Box<crate::model::gc_rule::Union>>>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(crate::model::gc_rule::Rule::Union(v.into()));
self
}
}
impl wkt::message::Message for GcRule {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GcRule"
}
}
pub mod gc_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Intersection {
pub rules: std::vec::Vec<crate::model::GcRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Intersection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GcRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Intersection {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GcRule.Intersection"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Union {
pub rules: std::vec::Vec<crate::model::GcRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Union {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GcRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Union {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.GcRule.Union"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Rule {
MaxNumVersions(i32),
MaxAge(std::boxed::Box<wkt::Duration>),
Intersection(std::boxed::Box<crate::model::gc_rule::Intersection>),
Union(std::boxed::Box<crate::model::gc_rule::Union>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionInfo {
pub encryption_type: crate::model::encryption_info::EncryptionType,
pub encryption_status: std::option::Option<google_cloud_rpc::model::Status>,
pub kms_key_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptionInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encryption_type<
T: std::convert::Into<crate::model::encryption_info::EncryptionType>,
>(
mut self,
v: T,
) -> Self {
self.encryption_type = v.into();
self
}
pub fn set_encryption_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.encryption_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.encryption_status = v.map(|x| x.into());
self
}
pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key_version = v.into();
self
}
}
impl wkt::message::Message for EncryptionInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.EncryptionInfo"
}
}
pub mod encryption_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EncryptionType {
Unspecified,
GoogleDefaultEncryption,
CustomerManagedEncryption,
UnknownValue(encryption_type::UnknownValue),
}
#[doc(hidden)]
pub mod encryption_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EncryptionType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GoogleDefaultEncryption => std::option::Option::Some(1),
Self::CustomerManagedEncryption => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
Self::GoogleDefaultEncryption => {
std::option::Option::Some("GOOGLE_DEFAULT_ENCRYPTION")
}
Self::CustomerManagedEncryption => {
std::option::Option::Some("CUSTOMER_MANAGED_ENCRYPTION")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EncryptionType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EncryptionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EncryptionType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GoogleDefaultEncryption,
2 => Self::CustomerManagedEncryption,
_ => Self::UnknownValue(encryption_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EncryptionType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
"GOOGLE_DEFAULT_ENCRYPTION" => Self::GoogleDefaultEncryption,
"CUSTOMER_MANAGED_ENCRYPTION" => Self::CustomerManagedEncryption,
_ => Self::UnknownValue(encryption_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EncryptionType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::GoogleDefaultEncryption => serializer.serialize_i32(1),
Self::CustomerManagedEncryption => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EncryptionType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
".google.bigtable.admin.v2.EncryptionInfo.EncryptionType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Snapshot {
pub name: std::string::String,
pub source_table: std::option::Option<crate::model::Table>,
pub data_size_bytes: i64,
pub create_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::snapshot::State,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Snapshot {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_source_table<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Table>,
{
self.source_table = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_table<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Table>,
{
self.source_table = v.map(|x| x.into());
self
}
pub fn set_data_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.data_size_bytes = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for Snapshot {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Snapshot"
}
}
pub mod snapshot {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
NotKnown,
Ready,
Creating,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::NotKnown => std::option::Option::Some(0),
Self::Ready => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::NotKnown => std::option::Option::Some("STATE_NOT_KNOWN"),
Self::Ready => std::option::Option::Some("READY"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::NotKnown,
1 => Self::Ready,
2 => Self::Creating,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_NOT_KNOWN" => Self::NotKnown,
"READY" => Self::Ready,
"CREATING" => Self::Creating,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::NotKnown => serializer.serialize_i32(0),
Self::Ready => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.bigtable.admin.v2.Snapshot.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Backup {
pub name: std::string::String,
pub source_table: std::string::String,
pub source_backup: std::string::String,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub size_bytes: i64,
pub state: crate::model::backup::State,
pub encryption_info: std::option::Option<crate::model::EncryptionInfo>,
pub backup_type: crate::model::backup::BackupType,
pub hot_to_standard_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Backup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_table = v.into();
self
}
pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_backup = v.into();
self
}
pub fn set_expire_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size_bytes = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_encryption_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EncryptionInfo>,
{
self.encryption_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EncryptionInfo>,
{
self.encryption_info = v.map(|x| x.into());
self
}
pub fn set_backup_type<T: std::convert::Into<crate::model::backup::BackupType>>(
mut self,
v: T,
) -> Self {
self.backup_type = v.into();
self
}
pub fn set_hot_to_standard_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.hot_to_standard_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hot_to_standard_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.hot_to_standard_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Backup {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Backup"
}
}
pub mod backup {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Ready,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Creating => std::option::Option::Some(1),
Self::Ready => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Ready => std::option::Option::Some("READY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Creating,
2 => Self::Ready,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"CREATING" => Self::Creating,
"READY" => Self::Ready,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Creating => serializer.serialize_i32(1),
Self::Ready => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.bigtable.admin.v2.Backup.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BackupType {
Unspecified,
Standard,
Hot,
UnknownValue(backup_type::UnknownValue),
}
#[doc(hidden)]
pub mod backup_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BackupType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Standard => std::option::Option::Some(1),
Self::Hot => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("STANDARD"),
Self::Hot => std::option::Option::Some("HOT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BackupType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BackupType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for BackupType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::Hot,
_ => Self::UnknownValue(backup_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BackupType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
"STANDARD" => Self::Standard,
"HOT" => Self::Hot,
_ => Self::UnknownValue(backup_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BackupType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Standard => serializer.serialize_i32(1),
Self::Hot => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BackupType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
".google.bigtable.admin.v2.Backup.BackupType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupInfo {
pub backup: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub source_table: std::string::String,
pub source_backup: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_source_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_table = v.into();
self
}
pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_backup = v.into();
self
}
}
impl wkt::message::Message for BackupInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.BackupInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TieredStorageConfig {
pub infrequent_access: std::option::Option<crate::model::TieredStorageRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TieredStorageConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_infrequent_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TieredStorageRule>,
{
self.infrequent_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_infrequent_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TieredStorageRule>,
{
self.infrequent_access = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TieredStorageConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.TieredStorageConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TieredStorageRule {
pub rule: std::option::Option<crate::model::tiered_storage_rule::Rule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TieredStorageRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rule<
T: std::convert::Into<std::option::Option<crate::model::tiered_storage_rule::Rule>>,
>(
mut self,
v: T,
) -> Self {
self.rule = v.into();
self
}
pub fn include_if_older_than(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::tiered_storage_rule::Rule::IncludeIfOlderThan(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_include_if_older_than<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(
crate::model::tiered_storage_rule::Rule::IncludeIfOlderThan(v.into()),
);
self
}
}
impl wkt::message::Message for TieredStorageRule {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.TieredStorageRule"
}
}
pub mod tiered_storage_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Rule {
IncludeIfOlderThan(std::boxed::Box<wkt::Duration>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProtoSchema {
pub proto_descriptors: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProtoSchema {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_proto_descriptors<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.proto_descriptors = v.into();
self
}
}
impl wkt::message::Message for ProtoSchema {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.ProtoSchema"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SchemaBundle {
pub name: std::string::String,
pub etag: std::string::String,
pub r#type: std::option::Option<crate::model::schema_bundle::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SchemaBundle {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_type<
T: std::convert::Into<std::option::Option<crate::model::schema_bundle::Type>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn proto_schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::ProtoSchema>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::schema_bundle::Type::ProtoSchema(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_proto_schema<T: std::convert::Into<std::boxed::Box<crate::model::ProtoSchema>>>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::schema_bundle::Type::ProtoSchema(v.into()));
self
}
}
impl wkt::message::Message for SchemaBundle {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.SchemaBundle"
}
}
pub mod schema_bundle {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
ProtoSchema(std::boxed::Box<crate::model::ProtoSchema>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Type {
pub kind: std::option::Option<crate::model::r#type::Kind>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Type {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::r#type::Kind>>>(
mut self,
v: T,
) -> Self {
self.kind = v.into();
self
}
pub fn bytes_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Bytes>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::BytesType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_bytes_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Bytes>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::BytesType(v.into()));
self
}
pub fn string_type(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::String>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::StringType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_string_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::String>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::StringType(v.into()));
self
}
pub fn int64_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Int64>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::Int64Type(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_int64_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Int64>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::Int64Type(v.into()));
self
}
pub fn float32_type(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Float32>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::Float32Type(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_float32_type<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::Float32>>,
>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::Float32Type(v.into()));
self
}
pub fn float64_type(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Float64>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::Float64Type(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_float64_type<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::Float64>>,
>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::Float64Type(v.into()));
self
}
pub fn bool_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Bool>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::BoolType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_bool_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Bool>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::BoolType(v.into()));
self
}
pub fn timestamp_type(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Timestamp>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::TimestampType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_timestamp_type<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::Timestamp>>,
>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::TimestampType(v.into()));
self
}
pub fn date_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Date>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::DateType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_date_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Date>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::DateType(v.into()));
self
}
pub fn aggregate_type(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Aggregate>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::AggregateType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_aggregate_type<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::Aggregate>>,
>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::AggregateType(v.into()));
self
}
pub fn struct_type(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Struct>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::StructType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_struct_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Struct>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::StructType(v.into()));
self
}
pub fn array_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Array>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::ArrayType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_array_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Array>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::ArrayType(v.into()));
self
}
pub fn map_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Map>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::MapType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_map_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Map>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::MapType(v.into()));
self
}
pub fn proto_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Proto>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::ProtoType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_proto_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Proto>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::ProtoType(v.into()));
self
}
pub fn enum_type(&self) -> std::option::Option<&std::boxed::Box<crate::model::r#type::Enum>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::r#type::Kind::EnumType(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_enum_type<T: std::convert::Into<std::boxed::Box<crate::model::r#type::Enum>>>(
mut self,
v: T,
) -> Self {
self.kind = std::option::Option::Some(crate::model::r#type::Kind::EnumType(v.into()));
self
}
}
impl wkt::message::Message for Type {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type"
}
}
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Bytes {
pub encoding: std::option::Option<crate::model::r#type::bytes::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Bytes {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::r#type::bytes::Encoding>,
{
self.encoding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::r#type::bytes::Encoding>,
{
self.encoding = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Bytes {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Bytes"
}
}
pub mod bytes {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Encoding {
pub encoding: std::option::Option<crate::model::r#type::bytes::encoding::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Encoding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<
T: std::convert::Into<
std::option::Option<crate::model::r#type::bytes::encoding::Encoding>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
pub fn raw(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>>
{
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::bytes::encoding::Encoding::Raw(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_raw<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::bytes::encoding::Encoding::Raw(v.into()),
);
self
}
}
impl wkt::message::Message for Encoding {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Bytes.Encoding"
}
}
pub mod encoding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Raw {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Raw {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Raw {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Bytes.Encoding.Raw"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Encoding {
Raw(std::boxed::Box<crate::model::r#type::bytes::encoding::Raw>),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct String {
pub encoding: std::option::Option<crate::model::r#type::string::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl String {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::r#type::string::Encoding>,
{
self.encoding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::r#type::string::Encoding>,
{
self.encoding = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for String {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.String"
}
}
pub mod string {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Encoding {
pub encoding: std::option::Option<crate::model::r#type::string::encoding::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Encoding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<
T: std::convert::Into<
std::option::Option<crate::model::r#type::string::encoding::Encoding>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
#[deprecated]
pub fn utf8_raw(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>,
> {
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::string::encoding::Encoding::Utf8Raw(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
#[deprecated]
pub fn set_utf8_raw<
T: std::convert::Into<
std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::string::encoding::Encoding::Utf8Raw(v.into()),
);
self
}
pub fn utf8_bytes(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>,
> {
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::string::encoding::Encoding::Utf8Bytes(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_utf8_bytes<
T: std::convert::Into<
std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::string::encoding::Encoding::Utf8Bytes(v.into()),
);
self
}
}
impl wkt::message::Message for Encoding {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding"
}
}
pub mod encoding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct Utf8Raw {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Utf8Raw {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Utf8Raw {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Utf8Bytes {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Utf8Bytes {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Utf8Bytes {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Encoding {
#[deprecated]
Utf8Raw(std::boxed::Box<crate::model::r#type::string::encoding::Utf8Raw>),
Utf8Bytes(std::boxed::Box<crate::model::r#type::string::encoding::Utf8Bytes>),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Int64 {
pub encoding: std::option::Option<crate::model::r#type::int_64::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Int64 {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::r#type::int_64::Encoding>,
{
self.encoding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::r#type::int_64::Encoding>,
{
self.encoding = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Int64 {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Int64"
}
}
pub mod int_64 {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Encoding {
pub encoding: std::option::Option<crate::model::r#type::int_64::encoding::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Encoding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<
T: std::convert::Into<
std::option::Option<crate::model::r#type::int_64::encoding::Encoding>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
pub fn big_endian_bytes(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
> {
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::int_64::encoding::Encoding::BigEndianBytes(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_big_endian_bytes<
T: std::convert::Into<
std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::int_64::encoding::Encoding::BigEndianBytes(v.into()),
);
self
}
pub fn ordered_code_bytes(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
> {
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::int_64::encoding::Encoding::OrderedCodeBytes(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_ordered_code_bytes<
T: std::convert::Into<
std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::int_64::encoding::Encoding::OrderedCodeBytes(v.into()),
);
self
}
}
impl wkt::message::Message for Encoding {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding"
}
}
pub mod encoding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigEndianBytes {
#[deprecated]
pub bytes_type: std::option::Option<crate::model::r#type::Bytes>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigEndianBytes {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_bytes_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::r#type::Bytes>,
{
self.bytes_type = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_bytes_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::r#type::Bytes>,
{
self.bytes_type = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BigEndianBytes {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OrderedCodeBytes {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OrderedCodeBytes {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for OrderedCodeBytes {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Encoding {
BigEndianBytes(
std::boxed::Box<crate::model::r#type::int_64::encoding::BigEndianBytes>,
),
OrderedCodeBytes(
std::boxed::Box<crate::model::r#type::int_64::encoding::OrderedCodeBytes>,
),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Bool {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Bool {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Bool {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Bool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Float32 {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Float32 {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Float32 {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Float32"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Float64 {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Float64 {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Float64 {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Float64"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Timestamp {
pub encoding: std::option::Option<crate::model::r#type::timestamp::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Timestamp {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::r#type::timestamp::Encoding>,
{
self.encoding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::r#type::timestamp::Encoding>,
{
self.encoding = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Timestamp {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Timestamp"
}
}
pub mod timestamp {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Encoding {
pub encoding: std::option::Option<crate::model::r#type::timestamp::encoding::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Encoding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<
T: std::convert::Into<
std::option::Option<crate::model::r#type::timestamp::encoding::Encoding>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
pub fn unix_micros_int64(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::int_64::Encoding>>
{
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::timestamp::encoding::Encoding::UnixMicrosInt64(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_unix_micros_int64<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::int_64::Encoding>>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::timestamp::encoding::Encoding::UnixMicrosInt64(v.into()),
);
self
}
}
impl wkt::message::Message for Encoding {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Timestamp.Encoding"
}
}
pub mod encoding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Encoding {
UnixMicrosInt64(std::boxed::Box<crate::model::r#type::int_64::Encoding>),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Date {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Date {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Date {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Date"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Struct {
pub fields: std::vec::Vec<crate::model::r#type::r#struct::Field>,
pub encoding: std::option::Option<crate::model::r#type::r#struct::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Struct {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::r#type::r#struct::Field>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_encoding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::r#type::r#struct::Encoding>,
{
self.encoding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encoding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::r#type::r#struct::Encoding>,
{
self.encoding = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Struct {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Struct"
}
}
pub mod r#struct {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Field {
pub field_name: std::string::String,
pub r#type: std::option::Option<std::boxed::Box<crate::model::Type>>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Field {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.field_name = v.into();
self
}
pub fn set_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.r#type = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.r#type = v.map(|x| std::boxed::Box::new(x.into()));
self
}
}
impl wkt::message::Message for Field {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Field"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Encoding {
pub encoding: std::option::Option<crate::model::r#type::r#struct::encoding::Encoding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Encoding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_encoding<
T: std::convert::Into<
std::option::Option<crate::model::r#type::r#struct::encoding::Encoding>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = v.into();
self
}
pub fn singleton(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>,
> {
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::r#struct::encoding::Encoding::Singleton(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_singleton<
T: std::convert::Into<
std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::r#struct::encoding::Encoding::Singleton(v.into()),
);
self
}
pub fn delimited_bytes(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
> {
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::r#struct::encoding::Encoding::DelimitedBytes(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_delimited_bytes<
T: std::convert::Into<
std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::r#struct::encoding::Encoding::DelimitedBytes(v.into()),
);
self
}
pub fn ordered_code_bytes(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
> {
#[allow(unreachable_patterns)]
self.encoding.as_ref().and_then(|v| match v {
crate::model::r#type::r#struct::encoding::Encoding::OrderedCodeBytes(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_ordered_code_bytes<
T: std::convert::Into<
std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
>,
>(
mut self,
v: T,
) -> Self {
self.encoding = std::option::Option::Some(
crate::model::r#type::r#struct::encoding::Encoding::OrderedCodeBytes(v.into()),
);
self
}
}
impl wkt::message::Message for Encoding {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding"
}
}
pub mod encoding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Singleton {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Singleton {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Singleton {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.Singleton"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DelimitedBytes {
pub delimiter: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DelimitedBytes {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_delimiter<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.delimiter = v.into();
self
}
}
impl wkt::message::Message for DelimitedBytes {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OrderedCodeBytes {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OrderedCodeBytes {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for OrderedCodeBytes {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Encoding {
Singleton(std::boxed::Box<crate::model::r#type::r#struct::encoding::Singleton>),
DelimitedBytes(
std::boxed::Box<crate::model::r#type::r#struct::encoding::DelimitedBytes>,
),
OrderedCodeBytes(
std::boxed::Box<crate::model::r#type::r#struct::encoding::OrderedCodeBytes>,
),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Proto {
pub schema_bundle_id: std::string::String,
pub message_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Proto {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.schema_bundle_id = v.into();
self
}
pub fn set_message_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.message_name = v.into();
self
}
}
impl wkt::message::Message for Proto {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Proto"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Enum {
pub schema_bundle_id: std::string::String,
pub enum_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Enum {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_schema_bundle_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.schema_bundle_id = v.into();
self
}
pub fn set_enum_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.enum_name = v.into();
self
}
}
impl wkt::message::Message for Enum {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Enum"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Array {
pub element_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Array {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_element_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.element_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_element_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.element_type = v.map(|x| std::boxed::Box::new(x.into()));
self
}
}
impl wkt::message::Message for Array {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Array"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Map {
pub key_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
pub value_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Map {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.key_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_key_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.key_type = v.map(|x| std::boxed::Box::new(x.into()));
self
}
pub fn set_value_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.value_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_value_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.value_type = v.map(|x| std::boxed::Box::new(x.into()));
self
}
}
impl wkt::message::Message for Map {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Map"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Aggregate {
pub input_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
pub state_type: std::option::Option<std::boxed::Box<crate::model::Type>>,
pub aggregator: std::option::Option<crate::model::r#type::aggregate::Aggregator>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Aggregate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_input_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.input_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_input_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.input_type = v.map(|x| std::boxed::Box::new(x.into()));
self
}
pub fn set_state_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.state_type = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_state_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Type>,
{
self.state_type = v.map(|x| std::boxed::Box::new(x.into()));
self
}
pub fn set_aggregator<
T: std::convert::Into<std::option::Option<crate::model::r#type::aggregate::Aggregator>>,
>(
mut self,
v: T,
) -> Self {
self.aggregator = v.into();
self
}
pub fn sum(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Sum>> {
#[allow(unreachable_patterns)]
self.aggregator.as_ref().and_then(|v| match v {
crate::model::r#type::aggregate::Aggregator::Sum(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_sum<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Sum>>,
>(
mut self,
v: T,
) -> Self {
self.aggregator = std::option::Option::Some(
crate::model::r#type::aggregate::Aggregator::Sum(v.into()),
);
self
}
pub fn hllpp_unique_count(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount>,
> {
#[allow(unreachable_patterns)]
self.aggregator.as_ref().and_then(|v| match v {
crate::model::r#type::aggregate::Aggregator::HllppUniqueCount(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_hllpp_unique_count<
T: std::convert::Into<
std::boxed::Box<
crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.aggregator = std::option::Option::Some(
crate::model::r#type::aggregate::Aggregator::HllppUniqueCount(v.into()),
);
self
}
pub fn max(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Max>> {
#[allow(unreachable_patterns)]
self.aggregator.as_ref().and_then(|v| match v {
crate::model::r#type::aggregate::Aggregator::Max(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_max<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Max>>,
>(
mut self,
v: T,
) -> Self {
self.aggregator = std::option::Option::Some(
crate::model::r#type::aggregate::Aggregator::Max(v.into()),
);
self
}
pub fn min(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::r#type::aggregate::Min>> {
#[allow(unreachable_patterns)]
self.aggregator.as_ref().and_then(|v| match v {
crate::model::r#type::aggregate::Aggregator::Min(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_min<
T: std::convert::Into<std::boxed::Box<crate::model::r#type::aggregate::Min>>,
>(
mut self,
v: T,
) -> Self {
self.aggregator = std::option::Option::Some(
crate::model::r#type::aggregate::Aggregator::Min(v.into()),
);
self
}
}
impl wkt::message::Message for Aggregate {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate"
}
}
pub mod aggregate {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Sum {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Sum {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Sum {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Sum"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Max {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Max {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Max {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Max"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Min {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Min {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Min {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.Min"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HyperLogLogPlusPlusUniqueCount {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HyperLogLogPlusPlusUniqueCount {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for HyperLogLogPlusPlusUniqueCount {
fn typename() -> &'static str {
"type.googleapis.com/google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Aggregator {
Sum(std::boxed::Box<crate::model::r#type::aggregate::Sum>),
HllppUniqueCount(
std::boxed::Box<crate::model::r#type::aggregate::HyperLogLogPlusPlusUniqueCount>,
),
Max(std::boxed::Box<crate::model::r#type::aggregate::Max>),
Min(std::boxed::Box<crate::model::r#type::aggregate::Min>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Kind {
BytesType(std::boxed::Box<crate::model::r#type::Bytes>),
StringType(std::boxed::Box<crate::model::r#type::String>),
Int64Type(std::boxed::Box<crate::model::r#type::Int64>),
Float32Type(std::boxed::Box<crate::model::r#type::Float32>),
Float64Type(std::boxed::Box<crate::model::r#type::Float64>),
BoolType(std::boxed::Box<crate::model::r#type::Bool>),
TimestampType(std::boxed::Box<crate::model::r#type::Timestamp>),
DateType(std::boxed::Box<crate::model::r#type::Date>),
AggregateType(std::boxed::Box<crate::model::r#type::Aggregate>),
StructType(std::boxed::Box<crate::model::r#type::Struct>),
ArrayType(std::boxed::Box<crate::model::r#type::Array>),
MapType(std::boxed::Box<crate::model::r#type::Map>),
ProtoType(std::boxed::Box<crate::model::r#type::Proto>),
EnumType(std::boxed::Box<crate::model::r#type::Enum>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StorageType {
Unspecified,
Ssd,
Hdd,
UnknownValue(storage_type::UnknownValue),
}
#[doc(hidden)]
pub mod storage_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl StorageType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ssd => std::option::Option::Some(1),
Self::Hdd => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
Self::Ssd => std::option::Option::Some("SSD"),
Self::Hdd => std::option::Option::Some("HDD"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for StorageType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for StorageType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for StorageType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ssd,
2 => Self::Hdd,
_ => Self::UnknownValue(storage_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for StorageType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
"SSD" => Self::Ssd,
"HDD" => Self::Hdd,
_ => Self::UnknownValue(storage_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for StorageType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Ssd => serializer.serialize_i32(1),
Self::Hdd => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for StorageType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
".google.bigtable.admin.v2.StorageType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RestoreSourceType {
Unspecified,
Backup,
UnknownValue(restore_source_type::UnknownValue),
}
#[doc(hidden)]
pub mod restore_source_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RestoreSourceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Backup => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RESTORE_SOURCE_TYPE_UNSPECIFIED"),
Self::Backup => std::option::Option::Some("BACKUP"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RestoreSourceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RestoreSourceType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RestoreSourceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Backup,
_ => Self::UnknownValue(restore_source_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RestoreSourceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESTORE_SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
"BACKUP" => Self::Backup,
_ => Self::UnknownValue(restore_source_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RestoreSourceType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Backup => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RestoreSourceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestoreSourceType>::new(
".google.bigtable.admin.v2.RestoreSourceType",
))
}
}