#![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_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_type;
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 Backup {
pub name: std::string::String,
pub database: std::string::String,
pub database_uid: std::string::String,
pub snapshot_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub stats: std::option::Option<crate::model::backup::Stats>,
pub state: crate::model::backup::State,
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_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_database_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database_uid = v.into();
self
}
pub fn set_snapshot_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = v.map(|x| x.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_stats<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::backup::Stats>,
{
self.stats = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_stats<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::backup::Stats>,
{
self.stats = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for Backup {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Backup"
}
}
pub mod backup {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Stats {
pub size_bytes: i64,
pub document_count: i64,
pub index_count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Stats {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size_bytes = v.into();
self
}
pub fn set_document_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.document_count = v.into();
self
}
pub fn set_index_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.index_count = v.into();
self
}
}
impl wkt::message::Message for Stats {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Backup.Stats"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Ready,
NotAvailable,
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::NotAvailable => 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("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Ready => std::option::Option::Some("READY"),
Self::NotAvailable => std::option::Option::Some("NOT_AVAILABLE"),
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,
3 => Self::NotAvailable,
_ => 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,
"NOT_AVAILABLE" => Self::NotAvailable,
_ => 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::NotAvailable => serializer.serialize_i32(3),
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.firestore.admin.v1.Backup.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Database {
pub name: std::string::String,
pub uid: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub location_id: std::string::String,
pub r#type: crate::model::database::DatabaseType,
pub concurrency_mode: crate::model::database::ConcurrencyMode,
pub version_retention_period: std::option::Option<wkt::Duration>,
pub earliest_version_time: std::option::Option<wkt::Timestamp>,
pub point_in_time_recovery_enablement: crate::model::database::PointInTimeRecoveryEnablement,
pub app_engine_integration_mode: crate::model::database::AppEngineIntegrationMode,
pub key_prefix: std::string::String,
pub delete_protection_state: crate::model::database::DeleteProtectionState,
pub cmek_config: std::option::Option<crate::model::database::CmekConfig>,
pub previous_id: std::string::String,
pub source_info: std::option::Option<crate::model::database::SourceInfo>,
pub tags: std::collections::HashMap<std::string::String, std::string::String>,
pub free_tier: std::option::Option<bool>,
pub etag: std::string::String,
pub database_edition: crate::model::database::DatabaseEdition,
pub realtime_updates_mode: crate::model::RealtimeUpdatesMode,
pub firestore_data_access_mode: crate::model::database::DataAccessMode,
pub mongodb_compatible_data_access_mode: crate::model::database::DataAccessMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Database {
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_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = 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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_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_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location_id = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::database::DatabaseType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_concurrency_mode<T: std::convert::Into<crate::model::database::ConcurrencyMode>>(
mut self,
v: T,
) -> Self {
self.concurrency_mode = v.into();
self
}
pub fn set_version_retention_period<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.version_retention_period = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_version_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.version_retention_period = v.map(|x| x.into());
self
}
pub fn set_earliest_version_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.earliest_version_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_earliest_version_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.earliest_version_time = v.map(|x| x.into());
self
}
pub fn set_point_in_time_recovery_enablement<
T: std::convert::Into<crate::model::database::PointInTimeRecoveryEnablement>,
>(
mut self,
v: T,
) -> Self {
self.point_in_time_recovery_enablement = v.into();
self
}
pub fn set_app_engine_integration_mode<
T: std::convert::Into<crate::model::database::AppEngineIntegrationMode>,
>(
mut self,
v: T,
) -> Self {
self.app_engine_integration_mode = v.into();
self
}
pub fn set_key_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_prefix = v.into();
self
}
pub fn set_delete_protection_state<
T: std::convert::Into<crate::model::database::DeleteProtectionState>,
>(
mut self,
v: T,
) -> Self {
self.delete_protection_state = v.into();
self
}
pub fn set_cmek_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database::CmekConfig>,
{
self.cmek_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cmek_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::database::CmekConfig>,
{
self.cmek_config = v.map(|x| x.into());
self
}
pub fn set_previous_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.previous_id = v.into();
self
}
pub fn set_source_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database::SourceInfo>,
{
self.source_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::database::SourceInfo>,
{
self.source_info = 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
}
pub fn set_free_tier<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.free_tier = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_free_tier<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.free_tier = v.map(|x| x.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_database_edition<T: std::convert::Into<crate::model::database::DatabaseEdition>>(
mut self,
v: T,
) -> Self {
self.database_edition = v.into();
self
}
pub fn set_realtime_updates_mode<T: std::convert::Into<crate::model::RealtimeUpdatesMode>>(
mut self,
v: T,
) -> Self {
self.realtime_updates_mode = v.into();
self
}
pub fn set_firestore_data_access_mode<
T: std::convert::Into<crate::model::database::DataAccessMode>,
>(
mut self,
v: T,
) -> Self {
self.firestore_data_access_mode = v.into();
self
}
pub fn set_mongodb_compatible_data_access_mode<
T: std::convert::Into<crate::model::database::DataAccessMode>,
>(
mut self,
v: T,
) -> Self {
self.mongodb_compatible_data_access_mode = v.into();
self
}
}
impl wkt::message::Message for Database {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Database"
}
}
pub mod database {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CmekConfig {
pub kms_key_name: std::string::String,
pub active_key_version: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CmekConfig {
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
}
pub fn set_active_key_version<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.active_key_version = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CmekConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Database.CmekConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceInfo {
pub operation: std::string::String,
pub source: std::option::Option<crate::model::database::source_info::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation = v.into();
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::database::source_info::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn backup(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::database::source_info::BackupSource>>
{
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::database::source_info::Source::Backup(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_backup<
T: std::convert::Into<std::boxed::Box<crate::model::database::source_info::BackupSource>>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::database::source_info::Source::Backup(v.into()),
);
self
}
}
impl wkt::message::Message for SourceInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Database.SourceInfo"
}
}
pub mod source_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupSource {
pub backup: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupSource {
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
}
}
impl wkt::message::Message for BackupSource {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Database.SourceInfo.BackupSource"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
Backup(std::boxed::Box<crate::model::database::source_info::BackupSource>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionConfig {
pub encryption_type:
std::option::Option<crate::model::database::encryption_config::EncryptionType>,
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_encryption_type<
T: std::convert::Into<
std::option::Option<crate::model::database::encryption_config::EncryptionType>,
>,
>(
mut self,
v: T,
) -> Self {
self.encryption_type = v.into();
self
}
pub fn google_default_encryption(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
>,
> {
#[allow(unreachable_patterns)]
self.encryption_type.as_ref().and_then(|v| match v {
crate::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_google_default_encryption<
T: std::convert::Into<
std::boxed::Box<
crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.encryption_type = std::option::Option::Some(
crate::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(
v.into(),
),
);
self
}
pub fn use_source_encryption(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::database::encryption_config::SourceEncryptionOptions>,
> {
#[allow(unreachable_patterns)]
self.encryption_type.as_ref().and_then(|v| match v {
crate::model::database::encryption_config::EncryptionType::UseSourceEncryption(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_use_source_encryption<
T: std::convert::Into<
std::boxed::Box<
crate::model::database::encryption_config::SourceEncryptionOptions,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.encryption_type = std::option::Option::Some(
crate::model::database::encryption_config::EncryptionType::UseSourceEncryption(
v.into(),
),
);
self
}
pub fn customer_managed_encryption(
&self,
) -> std::option::Option<
&std::boxed::Box<
crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
>,
> {
#[allow(unreachable_patterns)]
self.encryption_type.as_ref().and_then(|v| match v {
crate::model::database::encryption_config::EncryptionType::CustomerManagedEncryption(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_customer_managed_encryption<
T: std::convert::Into<
std::boxed::Box<
crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.encryption_type = std::option::Option::Some(
crate::model::database::encryption_config::EncryptionType::CustomerManagedEncryption(
v.into()
)
);
self
}
}
impl wkt::message::Message for EncryptionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig"
}
}
pub mod encryption_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleDefaultEncryptionOptions {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleDefaultEncryptionOptions {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for GoogleDefaultEncryptionOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.GoogleDefaultEncryptionOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceEncryptionOptions {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceEncryptionOptions {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for SourceEncryptionOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.SourceEncryptionOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomerManagedEncryptionOptions {
pub kms_key_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomerManagedEncryptionOptions {
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 CustomerManagedEncryptionOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.CustomerManagedEncryptionOptions"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EncryptionType {
GoogleDefaultEncryption(
std::boxed::Box<
crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
>,
),
UseSourceEncryption(
std::boxed::Box<crate::model::database::encryption_config::SourceEncryptionOptions>,
),
CustomerManagedEncryption(
std::boxed::Box<
crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
>,
),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DatabaseType {
Unspecified,
FirestoreNative,
DatastoreMode,
UnknownValue(database_type::UnknownValue),
}
#[doc(hidden)]
pub mod database_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DatabaseType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::FirestoreNative => std::option::Option::Some(1),
Self::DatastoreMode => 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("DATABASE_TYPE_UNSPECIFIED"),
Self::FirestoreNative => std::option::Option::Some("FIRESTORE_NATIVE"),
Self::DatastoreMode => std::option::Option::Some("DATASTORE_MODE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DatabaseType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DatabaseType {
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 DatabaseType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::FirestoreNative,
2 => Self::DatastoreMode,
_ => Self::UnknownValue(database_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DatabaseType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
"FIRESTORE_NATIVE" => Self::FirestoreNative,
"DATASTORE_MODE" => Self::DatastoreMode,
_ => Self::UnknownValue(database_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DatabaseType {
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::FirestoreNative => serializer.serialize_i32(1),
Self::DatastoreMode => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DatabaseType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
".google.firestore.admin.v1.Database.DatabaseType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConcurrencyMode {
Unspecified,
Optimistic,
Pessimistic,
OptimisticWithEntityGroups,
UnknownValue(concurrency_mode::UnknownValue),
}
#[doc(hidden)]
pub mod concurrency_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ConcurrencyMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Optimistic => std::option::Option::Some(1),
Self::Pessimistic => std::option::Option::Some(2),
Self::OptimisticWithEntityGroups => 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("CONCURRENCY_MODE_UNSPECIFIED"),
Self::Optimistic => std::option::Option::Some("OPTIMISTIC"),
Self::Pessimistic => std::option::Option::Some("PESSIMISTIC"),
Self::OptimisticWithEntityGroups => {
std::option::Option::Some("OPTIMISTIC_WITH_ENTITY_GROUPS")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ConcurrencyMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ConcurrencyMode {
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 ConcurrencyMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Optimistic,
2 => Self::Pessimistic,
3 => Self::OptimisticWithEntityGroups,
_ => Self::UnknownValue(concurrency_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ConcurrencyMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CONCURRENCY_MODE_UNSPECIFIED" => Self::Unspecified,
"OPTIMISTIC" => Self::Optimistic,
"PESSIMISTIC" => Self::Pessimistic,
"OPTIMISTIC_WITH_ENTITY_GROUPS" => Self::OptimisticWithEntityGroups,
_ => Self::UnknownValue(concurrency_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ConcurrencyMode {
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::Optimistic => serializer.serialize_i32(1),
Self::Pessimistic => serializer.serialize_i32(2),
Self::OptimisticWithEntityGroups => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ConcurrencyMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConcurrencyMode>::new(
".google.firestore.admin.v1.Database.ConcurrencyMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PointInTimeRecoveryEnablement {
Unspecified,
PointInTimeRecoveryEnabled,
PointInTimeRecoveryDisabled,
UnknownValue(point_in_time_recovery_enablement::UnknownValue),
}
#[doc(hidden)]
pub mod point_in_time_recovery_enablement {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PointInTimeRecoveryEnablement {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PointInTimeRecoveryEnabled => std::option::Option::Some(1),
Self::PointInTimeRecoveryDisabled => 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("POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED")
}
Self::PointInTimeRecoveryEnabled => {
std::option::Option::Some("POINT_IN_TIME_RECOVERY_ENABLED")
}
Self::PointInTimeRecoveryDisabled => {
std::option::Option::Some("POINT_IN_TIME_RECOVERY_DISABLED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PointInTimeRecoveryEnablement {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PointInTimeRecoveryEnablement {
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 PointInTimeRecoveryEnablement {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PointInTimeRecoveryEnabled,
2 => Self::PointInTimeRecoveryDisabled,
_ => Self::UnknownValue(point_in_time_recovery_enablement::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PointInTimeRecoveryEnablement {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED" => Self::Unspecified,
"POINT_IN_TIME_RECOVERY_ENABLED" => Self::PointInTimeRecoveryEnabled,
"POINT_IN_TIME_RECOVERY_DISABLED" => Self::PointInTimeRecoveryDisabled,
_ => Self::UnknownValue(point_in_time_recovery_enablement::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PointInTimeRecoveryEnablement {
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::PointInTimeRecoveryEnabled => serializer.serialize_i32(1),
Self::PointInTimeRecoveryDisabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PointInTimeRecoveryEnablement {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<PointInTimeRecoveryEnablement>::new(
".google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AppEngineIntegrationMode {
Unspecified,
Enabled,
Disabled,
UnknownValue(app_engine_integration_mode::UnknownValue),
}
#[doc(hidden)]
pub mod app_engine_integration_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AppEngineIntegrationMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => 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("APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED")
}
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AppEngineIntegrationMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AppEngineIntegrationMode {
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 AppEngineIntegrationMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
_ => Self::UnknownValue(app_engine_integration_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AppEngineIntegrationMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
_ => Self::UnknownValue(app_engine_integration_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AppEngineIntegrationMode {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AppEngineIntegrationMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<AppEngineIntegrationMode>::new(
".google.firestore.admin.v1.Database.AppEngineIntegrationMode",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DeleteProtectionState {
Unspecified,
DeleteProtectionDisabled,
DeleteProtectionEnabled,
UnknownValue(delete_protection_state::UnknownValue),
}
#[doc(hidden)]
pub mod delete_protection_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DeleteProtectionState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DeleteProtectionDisabled => std::option::Option::Some(1),
Self::DeleteProtectionEnabled => 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("DELETE_PROTECTION_STATE_UNSPECIFIED")
}
Self::DeleteProtectionDisabled => {
std::option::Option::Some("DELETE_PROTECTION_DISABLED")
}
Self::DeleteProtectionEnabled => {
std::option::Option::Some("DELETE_PROTECTION_ENABLED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DeleteProtectionState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DeleteProtectionState {
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 DeleteProtectionState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DeleteProtectionDisabled,
2 => Self::DeleteProtectionEnabled,
_ => Self::UnknownValue(delete_protection_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DeleteProtectionState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DELETE_PROTECTION_STATE_UNSPECIFIED" => Self::Unspecified,
"DELETE_PROTECTION_DISABLED" => Self::DeleteProtectionDisabled,
"DELETE_PROTECTION_ENABLED" => Self::DeleteProtectionEnabled,
_ => Self::UnknownValue(delete_protection_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DeleteProtectionState {
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::DeleteProtectionDisabled => serializer.serialize_i32(1),
Self::DeleteProtectionEnabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DeleteProtectionState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeleteProtectionState>::new(
".google.firestore.admin.v1.Database.DeleteProtectionState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DatabaseEdition {
Unspecified,
Standard,
Enterprise,
UnknownValue(database_edition::UnknownValue),
}
#[doc(hidden)]
pub mod database_edition {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DatabaseEdition {
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::Enterprise => 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("DATABASE_EDITION_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("STANDARD"),
Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DatabaseEdition {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DatabaseEdition {
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 DatabaseEdition {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::Enterprise,
_ => Self::UnknownValue(database_edition::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DatabaseEdition {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATABASE_EDITION_UNSPECIFIED" => Self::Unspecified,
"STANDARD" => Self::Standard,
"ENTERPRISE" => Self::Enterprise,
_ => Self::UnknownValue(database_edition::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DatabaseEdition {
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::Enterprise => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DatabaseEdition {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEdition>::new(
".google.firestore.admin.v1.Database.DatabaseEdition",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataAccessMode {
Unspecified,
Enabled,
Disabled,
UnknownValue(data_access_mode::UnknownValue),
}
#[doc(hidden)]
pub mod data_access_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataAccessMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => 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("DATA_ACCESS_MODE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("DATA_ACCESS_MODE_ENABLED"),
Self::Disabled => std::option::Option::Some("DATA_ACCESS_MODE_DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataAccessMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataAccessMode {
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 DataAccessMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
_ => Self::UnknownValue(data_access_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataAccessMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_ACCESS_MODE_UNSPECIFIED" => Self::Unspecified,
"DATA_ACCESS_MODE_ENABLED" => Self::Enabled,
"DATA_ACCESS_MODE_DISABLED" => Self::Disabled,
_ => Self::UnknownValue(data_access_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataAccessMode {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataAccessMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataAccessMode>::new(
".google.firestore.admin.v1.Database.DataAccessMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Field {
pub name: std::string::String,
pub index_config: std::option::Option<crate::model::field::IndexConfig>,
pub ttl_config: std::option::Option<crate::model::field::TtlConfig>,
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_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_index_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::field::IndexConfig>,
{
self.index_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_index_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::field::IndexConfig>,
{
self.index_config = v.map(|x| x.into());
self
}
pub fn set_ttl_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::field::TtlConfig>,
{
self.ttl_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ttl_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::field::TtlConfig>,
{
self.ttl_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Field {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Field"
}
}
pub mod field {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IndexConfig {
pub indexes: std::vec::Vec<crate::model::Index>,
pub uses_ancestor_config: bool,
pub ancestor_field: std::string::String,
pub reverting: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IndexConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_indexes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Index>,
{
use std::iter::Iterator;
self.indexes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_uses_ancestor_config<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.uses_ancestor_config = v.into();
self
}
pub fn set_ancestor_field<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.ancestor_field = v.into();
self
}
pub fn set_reverting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reverting = v.into();
self
}
}
impl wkt::message::Message for IndexConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Field.IndexConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TtlConfig {
pub state: crate::model::field::ttl_config::State,
pub expiration_offset: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TtlConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::field::ttl_config::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_expiration_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.expiration_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expiration_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.expiration_offset = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TtlConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Field.TtlConfig"
}
}
pub mod ttl_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Active,
NeedsRepair,
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::Active => std::option::Option::Some(2),
Self::NeedsRepair => 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("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
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::Active,
3 => Self::NeedsRepair,
_ => 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,
"ACTIVE" => Self::Active,
"NEEDS_REPAIR" => Self::NeedsRepair,
_ => 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::Active => serializer.serialize_i32(2),
Self::NeedsRepair => serializer.serialize_i32(3),
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.firestore.admin.v1.Field.TtlConfig.State",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDatabasesRequest {
pub parent: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDatabasesRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListDatabasesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListDatabasesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDatabaseRequest {
pub parent: std::string::String,
pub database: std::option::Option<crate::model::Database>,
pub database_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDatabaseRequest {
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_database<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.database = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.database = v.map(|x| x.into());
self
}
pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database_id = v.into();
self
}
}
impl wkt::message::Message for CreateDatabaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.CreateDatabaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDatabaseMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDatabaseMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateDatabaseMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.CreateDatabaseMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDatabasesResponse {
pub databases: std::vec::Vec<crate::model::Database>,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDatabasesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_databases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Database>,
{
use std::iter::Iterator;
self.databases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDatabasesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListDatabasesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDatabaseRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDatabaseRequest {
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 GetDatabaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.GetDatabaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDatabaseRequest {
pub database: std::option::Option<crate::model::Database>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDatabaseRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.database = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.database = 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 UpdateDatabaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDatabaseMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDatabaseMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpdateDatabaseMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDatabaseRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDatabaseRequest {
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 DeleteDatabaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDatabaseMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDatabaseMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteDatabaseMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateUserCredsRequest {
pub parent: std::string::String,
pub user_creds: std::option::Option<crate::model::UserCreds>,
pub user_creds_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateUserCredsRequest {
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_user_creds<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UserCreds>,
{
self.user_creds = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_user_creds<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UserCreds>,
{
self.user_creds = v.map(|x| x.into());
self
}
pub fn set_user_creds_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user_creds_id = v.into();
self
}
}
impl wkt::message::Message for CreateUserCredsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.CreateUserCredsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetUserCredsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetUserCredsRequest {
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 GetUserCredsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.GetUserCredsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListUserCredsRequest {
pub parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListUserCredsRequest {
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
}
}
impl wkt::message::Message for ListUserCredsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListUserCredsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListUserCredsResponse {
pub user_creds: std::vec::Vec<crate::model::UserCreds>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListUserCredsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_user_creds<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::UserCreds>,
{
use std::iter::Iterator;
self.user_creds = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListUserCredsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListUserCredsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnableUserCredsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnableUserCredsRequest {
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 EnableUserCredsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.EnableUserCredsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisableUserCredsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisableUserCredsRequest {
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 DisableUserCredsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.DisableUserCredsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResetUserPasswordRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResetUserPasswordRequest {
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 ResetUserPasswordRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ResetUserPasswordRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteUserCredsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteUserCredsRequest {
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 DeleteUserCredsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.DeleteUserCredsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBackupScheduleRequest {
pub parent: std::string::String,
pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBackupScheduleRequest {
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_schedule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupSchedule>,
{
self.backup_schedule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupSchedule>,
{
self.backup_schedule = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateBackupScheduleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.CreateBackupScheduleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBackupScheduleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetBackupScheduleRequest {
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 GetBackupScheduleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.GetBackupScheduleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBackupScheduleRequest {
pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateBackupScheduleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_schedule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupSchedule>,
{
self.backup_schedule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupSchedule>,
{
self.backup_schedule = 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 UpdateBackupScheduleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.UpdateBackupScheduleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupSchedulesRequest {
pub parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupSchedulesRequest {
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
}
}
impl wkt::message::Message for ListBackupSchedulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupSchedulesResponse {
pub backup_schedules: std::vec::Vec<crate::model::BackupSchedule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupSchedulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_schedules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BackupSchedule>,
{
use std::iter::Iterator;
self.backup_schedules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListBackupSchedulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBackupScheduleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteBackupScheduleRequest {
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 DeleteBackupScheduleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.DeleteBackupScheduleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateIndexRequest {
pub parent: std::string::String,
pub index: std::option::Option<crate::model::Index>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateIndexRequest {
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_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Index>,
{
self.index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Index>,
{
self.index = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateIndexRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.CreateIndexRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIndexesRequest {
pub parent: std::string::String,
pub filter: 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 ListIndexesRequest {
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_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 ListIndexesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListIndexesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIndexesResponse {
pub indexes: std::vec::Vec<crate::model::Index>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListIndexesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_indexes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Index>,
{
use std::iter::Iterator;
self.indexes = 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 ListIndexesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListIndexesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListIndexesResponse {
type PageItem = crate::model::Index;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.indexes
}
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 GetIndexRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetIndexRequest {
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 GetIndexRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.GetIndexRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteIndexRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteIndexRequest {
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 DeleteIndexRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.DeleteIndexRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateFieldRequest {
pub field: std::option::Option<crate::model::Field>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateFieldRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Field>,
{
self.field = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_field<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Field>,
{
self.field = 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 UpdateFieldRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.UpdateFieldRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetFieldRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetFieldRequest {
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 GetFieldRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.GetFieldRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFieldsRequest {
pub parent: std::string::String,
pub filter: 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 ListFieldsRequest {
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_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 ListFieldsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListFieldsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFieldsResponse {
pub fields: std::vec::Vec<crate::model::Field>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFieldsResponse {
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::Field>,
{
use std::iter::Iterator;
self.fields = 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 ListFieldsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListFieldsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListFieldsResponse {
type PageItem = crate::model::Field;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.fields
}
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 ExportDocumentsRequest {
pub name: std::string::String,
pub collection_ids: std::vec::Vec<std::string::String>,
pub output_uri_prefix: std::string::String,
pub namespace_ids: std::vec::Vec<std::string::String>,
pub snapshot_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportDocumentsRequest {
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_collection_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.collection_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.output_uri_prefix = v.into();
self
}
pub fn set_namespace_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.namespace_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_snapshot_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExportDocumentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ExportDocumentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportDocumentsRequest {
pub name: std::string::String,
pub collection_ids: std::vec::Vec<std::string::String>,
pub input_uri_prefix: std::string::String,
pub namespace_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportDocumentsRequest {
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_collection_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.collection_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.input_uri_prefix = v.into();
self
}
pub fn set_namespace_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.namespace_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ImportDocumentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ImportDocumentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkDeleteDocumentsRequest {
pub name: std::string::String,
pub collection_ids: std::vec::Vec<std::string::String>,
pub namespace_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkDeleteDocumentsRequest {
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_collection_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.collection_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_namespace_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.namespace_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkDeleteDocumentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkDeleteDocumentsResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkDeleteDocumentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for BulkDeleteDocumentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsResponse"
}
}
#[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.firestore.admin.v1.GetBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsRequest {
pub parent: std::string::String,
pub filter: 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
}
}
impl wkt::message::Message for ListBackupsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListBackupsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsResponse {
pub backups: std::vec::Vec<crate::model::Backup>,
pub unreachable: std::vec::Vec<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_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListBackupsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ListBackupsResponse"
}
}
#[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.firestore.admin.v1.DeleteBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreDatabaseRequest {
pub parent: std::string::String,
pub database_id: std::string::String,
pub backup: std::string::String,
pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
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 RestoreDatabaseRequest {
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_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database_id = v.into();
self
}
pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup = v.into();
self
}
pub fn set_encryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database::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::database::EncryptionConfig>,
{
self.encryption_config = 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 RestoreDatabaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloneDatabaseRequest {
pub parent: std::string::String,
pub database_id: std::string::String,
pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
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 CloneDatabaseRequest {
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_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database_id = v.into();
self
}
pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PitrSnapshot>,
{
self.pitr_snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PitrSnapshot>,
{
self.pitr_snapshot = v.map(|x| x.into());
self
}
pub fn set_encryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::database::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::database::EncryptionConfig>,
{
self.encryption_config = 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 CloneDatabaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.CloneDatabaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Index {
pub name: std::string::String,
pub query_scope: crate::model::index::QueryScope,
pub api_scope: crate::model::index::ApiScope,
pub fields: std::vec::Vec<crate::model::index::IndexField>,
pub state: crate::model::index::State,
pub density: crate::model::index::Density,
pub multikey: bool,
pub shard_count: i32,
pub unique: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Index {
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_scope<T: std::convert::Into<crate::model::index::QueryScope>>(
mut self,
v: T,
) -> Self {
self.query_scope = v.into();
self
}
pub fn set_api_scope<T: std::convert::Into<crate::model::index::ApiScope>>(
mut self,
v: T,
) -> Self {
self.api_scope = v.into();
self
}
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::index::IndexField>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_density<T: std::convert::Into<crate::model::index::Density>>(
mut self,
v: T,
) -> Self {
self.density = v.into();
self
}
pub fn set_multikey<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.multikey = v.into();
self
}
pub fn set_shard_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.shard_count = v.into();
self
}
pub fn set_unique<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unique = v.into();
self
}
}
impl wkt::message::Message for Index {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Index"
}
}
pub mod index {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IndexField {
pub field_path: std::string::String,
pub value_mode: std::option::Option<crate::model::index::index_field::ValueMode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IndexField {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field_path = v.into();
self
}
pub fn set_value_mode<
T: std::convert::Into<std::option::Option<crate::model::index::index_field::ValueMode>>,
>(
mut self,
v: T,
) -> Self {
self.value_mode = v.into();
self
}
pub fn order(&self) -> std::option::Option<&crate::model::index::index_field::Order> {
#[allow(unreachable_patterns)]
self.value_mode.as_ref().and_then(|v| match v {
crate::model::index::index_field::ValueMode::Order(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_order<T: std::convert::Into<crate::model::index::index_field::Order>>(
mut self,
v: T,
) -> Self {
self.value_mode = std::option::Option::Some(
crate::model::index::index_field::ValueMode::Order(v.into()),
);
self
}
pub fn array_config(
&self,
) -> std::option::Option<&crate::model::index::index_field::ArrayConfig> {
#[allow(unreachable_patterns)]
self.value_mode.as_ref().and_then(|v| match v {
crate::model::index::index_field::ValueMode::ArrayConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_array_config<
T: std::convert::Into<crate::model::index::index_field::ArrayConfig>,
>(
mut self,
v: T,
) -> Self {
self.value_mode = std::option::Option::Some(
crate::model::index::index_field::ValueMode::ArrayConfig(v.into()),
);
self
}
pub fn vector_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::index::index_field::VectorConfig>>
{
#[allow(unreachable_patterns)]
self.value_mode.as_ref().and_then(|v| match v {
crate::model::index::index_field::ValueMode::VectorConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vector_config<
T: std::convert::Into<std::boxed::Box<crate::model::index::index_field::VectorConfig>>,
>(
mut self,
v: T,
) -> Self {
self.value_mode = std::option::Option::Some(
crate::model::index::index_field::ValueMode::VectorConfig(v.into()),
);
self
}
}
impl wkt::message::Message for IndexField {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Index.IndexField"
}
}
pub mod index_field {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VectorConfig {
pub dimension: i32,
pub r#type: std::option::Option<crate::model::index::index_field::vector_config::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VectorConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dimension<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.dimension = v.into();
self
}
pub fn set_type<
T: std::convert::Into<
std::option::Option<crate::model::index::index_field::vector_config::Type>,
>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn flat(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::index::index_field::vector_config::Type::Flat(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_flat<
T: std::convert::Into<
std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::index::index_field::vector_config::Type::Flat(v.into()),
);
self
}
}
impl wkt::message::Message for VectorConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig"
}
}
pub mod vector_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FlatIndex {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FlatIndex {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for FlatIndex {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Flat(std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Order {
Unspecified,
Ascending,
Descending,
UnknownValue(order::UnknownValue),
}
#[doc(hidden)]
pub mod order {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Order {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ascending => std::option::Option::Some(1),
Self::Descending => 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("ORDER_UNSPECIFIED"),
Self::Ascending => std::option::Option::Some("ASCENDING"),
Self::Descending => std::option::Option::Some("DESCENDING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Order {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Order {
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 Order {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ascending,
2 => Self::Descending,
_ => Self::UnknownValue(order::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Order {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ORDER_UNSPECIFIED" => Self::Unspecified,
"ASCENDING" => Self::Ascending,
"DESCENDING" => Self::Descending,
_ => Self::UnknownValue(order::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Order {
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::Ascending => serializer.serialize_i32(1),
Self::Descending => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Order {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Order>::new(
".google.firestore.admin.v1.Index.IndexField.Order",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ArrayConfig {
Unspecified,
Contains,
UnknownValue(array_config::UnknownValue),
}
#[doc(hidden)]
pub mod array_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ArrayConfig {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Contains => 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("ARRAY_CONFIG_UNSPECIFIED"),
Self::Contains => std::option::Option::Some("CONTAINS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ArrayConfig {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ArrayConfig {
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 ArrayConfig {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Contains,
_ => Self::UnknownValue(array_config::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ArrayConfig {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ARRAY_CONFIG_UNSPECIFIED" => Self::Unspecified,
"CONTAINS" => Self::Contains,
_ => Self::UnknownValue(array_config::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ArrayConfig {
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::Contains => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ArrayConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ArrayConfig>::new(
".google.firestore.admin.v1.Index.IndexField.ArrayConfig",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ValueMode {
Order(crate::model::index::index_field::Order),
ArrayConfig(crate::model::index::index_field::ArrayConfig),
VectorConfig(std::boxed::Box<crate::model::index::index_field::VectorConfig>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum QueryScope {
Unspecified,
Collection,
CollectionGroup,
CollectionRecursive,
UnknownValue(query_scope::UnknownValue),
}
#[doc(hidden)]
pub mod query_scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl QueryScope {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Collection => std::option::Option::Some(1),
Self::CollectionGroup => std::option::Option::Some(2),
Self::CollectionRecursive => 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("QUERY_SCOPE_UNSPECIFIED"),
Self::Collection => std::option::Option::Some("COLLECTION"),
Self::CollectionGroup => std::option::Option::Some("COLLECTION_GROUP"),
Self::CollectionRecursive => std::option::Option::Some("COLLECTION_RECURSIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for QueryScope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for QueryScope {
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 QueryScope {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Collection,
2 => Self::CollectionGroup,
3 => Self::CollectionRecursive,
_ => Self::UnknownValue(query_scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for QueryScope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"QUERY_SCOPE_UNSPECIFIED" => Self::Unspecified,
"COLLECTION" => Self::Collection,
"COLLECTION_GROUP" => Self::CollectionGroup,
"COLLECTION_RECURSIVE" => Self::CollectionRecursive,
_ => Self::UnknownValue(query_scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for QueryScope {
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::Collection => serializer.serialize_i32(1),
Self::CollectionGroup => serializer.serialize_i32(2),
Self::CollectionRecursive => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for QueryScope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryScope>::new(
".google.firestore.admin.v1.Index.QueryScope",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ApiScope {
AnyApi,
DatastoreModeApi,
MongodbCompatibleApi,
UnknownValue(api_scope::UnknownValue),
}
#[doc(hidden)]
pub mod api_scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ApiScope {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::AnyApi => std::option::Option::Some(0),
Self::DatastoreModeApi => std::option::Option::Some(1),
Self::MongodbCompatibleApi => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::AnyApi => std::option::Option::Some("ANY_API"),
Self::DatastoreModeApi => std::option::Option::Some("DATASTORE_MODE_API"),
Self::MongodbCompatibleApi => std::option::Option::Some("MONGODB_COMPATIBLE_API"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ApiScope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ApiScope {
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 ApiScope {
fn from(value: i32) -> Self {
match value {
0 => Self::AnyApi,
1 => Self::DatastoreModeApi,
2 => Self::MongodbCompatibleApi,
_ => Self::UnknownValue(api_scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ApiScope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ANY_API" => Self::AnyApi,
"DATASTORE_MODE_API" => Self::DatastoreModeApi,
"MONGODB_COMPATIBLE_API" => Self::MongodbCompatibleApi,
_ => Self::UnknownValue(api_scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ApiScope {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::AnyApi => serializer.serialize_i32(0),
Self::DatastoreModeApi => serializer.serialize_i32(1),
Self::MongodbCompatibleApi => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ApiScope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApiScope>::new(
".google.firestore.admin.v1.Index.ApiScope",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Ready,
NeedsRepair,
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::NeedsRepair => 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("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Ready => std::option::Option::Some("READY"),
Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
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,
3 => Self::NeedsRepair,
_ => 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,
"NEEDS_REPAIR" => Self::NeedsRepair,
_ => 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::NeedsRepair => serializer.serialize_i32(3),
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.firestore.admin.v1.Index.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Density {
Unspecified,
SparseAll,
SparseAny,
Dense,
UnknownValue(density::UnknownValue),
}
#[doc(hidden)]
pub mod density {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Density {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SparseAll => std::option::Option::Some(1),
Self::SparseAny => std::option::Option::Some(2),
Self::Dense => 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("DENSITY_UNSPECIFIED"),
Self::SparseAll => std::option::Option::Some("SPARSE_ALL"),
Self::SparseAny => std::option::Option::Some("SPARSE_ANY"),
Self::Dense => std::option::Option::Some("DENSE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Density {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Density {
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 Density {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SparseAll,
2 => Self::SparseAny,
3 => Self::Dense,
_ => Self::UnknownValue(density::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Density {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DENSITY_UNSPECIFIED" => Self::Unspecified,
"SPARSE_ALL" => Self::SparseAll,
"SPARSE_ANY" => Self::SparseAny,
"DENSE" => Self::Dense,
_ => Self::UnknownValue(density::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Density {
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::SparseAll => serializer.serialize_i32(1),
Self::SparseAny => serializer.serialize_i32(2),
Self::Dense => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Density {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Density>::new(
".google.firestore.admin.v1.Index.Density",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocationMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LocationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for LocationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.LocationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IndexOperationMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub index: std::string::String,
pub state: crate::model::OperationState,
pub progress_documents: std::option::Option<crate::model::Progress>,
pub progress_bytes: std::option::Option<crate::model::Progress>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IndexOperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_index<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.index = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_progress_documents<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = v.map(|x| x.into());
self
}
pub fn set_progress_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for IndexOperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.IndexOperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FieldOperationMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub field: std::string::String,
pub index_config_deltas:
std::vec::Vec<crate::model::field_operation_metadata::IndexConfigDelta>,
pub state: crate::model::OperationState,
pub progress_documents: std::option::Option<crate::model::Progress>,
pub progress_bytes: std::option::Option<crate::model::Progress>,
pub ttl_config_delta:
std::option::Option<crate::model::field_operation_metadata::TtlConfigDelta>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FieldOperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
pub fn set_index_config_deltas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::field_operation_metadata::IndexConfigDelta>,
{
use std::iter::Iterator;
self.index_config_deltas = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_progress_documents<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = v.map(|x| x.into());
self
}
pub fn set_progress_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = v.map(|x| x.into());
self
}
pub fn set_ttl_config_delta<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
{
self.ttl_config_delta = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ttl_config_delta<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
{
self.ttl_config_delta = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FieldOperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata"
}
}
pub mod field_operation_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IndexConfigDelta {
pub change_type: crate::model::field_operation_metadata::index_config_delta::ChangeType,
pub index: std::option::Option<crate::model::Index>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IndexConfigDelta {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_change_type<
T: std::convert::Into<
crate::model::field_operation_metadata::index_config_delta::ChangeType,
>,
>(
mut self,
v: T,
) -> Self {
self.change_type = v.into();
self
}
pub fn set_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Index>,
{
self.index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Index>,
{
self.index = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for IndexConfigDelta {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta"
}
}
pub mod index_config_delta {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChangeType {
Unspecified,
Add,
Remove,
UnknownValue(change_type::UnknownValue),
}
#[doc(hidden)]
pub mod change_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ChangeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Add => std::option::Option::Some(1),
Self::Remove => 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("CHANGE_TYPE_UNSPECIFIED"),
Self::Add => std::option::Option::Some("ADD"),
Self::Remove => std::option::Option::Some("REMOVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ChangeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ChangeType {
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 ChangeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Add,
2 => Self::Remove,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ChangeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
"ADD" => Self::Add,
"REMOVE" => Self::Remove,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ChangeType {
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::Add => serializer.serialize_i32(1),
Self::Remove => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ChangeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
".google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TtlConfigDelta {
pub change_type: crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
pub expiration_offset: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TtlConfigDelta {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_change_type<
T: std::convert::Into<
crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
>,
>(
mut self,
v: T,
) -> Self {
self.change_type = v.into();
self
}
pub fn set_expiration_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.expiration_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expiration_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.expiration_offset = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TtlConfigDelta {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta"
}
}
pub mod ttl_config_delta {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ChangeType {
Unspecified,
Add,
Remove,
UnknownValue(change_type::UnknownValue),
}
#[doc(hidden)]
pub mod change_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ChangeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Add => std::option::Option::Some(1),
Self::Remove => 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("CHANGE_TYPE_UNSPECIFIED"),
Self::Add => std::option::Option::Some("ADD"),
Self::Remove => std::option::Option::Some("REMOVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ChangeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ChangeType {
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 ChangeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Add,
2 => Self::Remove,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ChangeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
"ADD" => Self::Add,
"REMOVE" => Self::Remove,
_ => Self::UnknownValue(change_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ChangeType {
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::Add => serializer.serialize_i32(1),
Self::Remove => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ChangeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
".google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportDocumentsMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub operation_state: crate::model::OperationState,
pub progress_documents: std::option::Option<crate::model::Progress>,
pub progress_bytes: std::option::Option<crate::model::Progress>,
pub collection_ids: std::vec::Vec<std::string::String>,
pub output_uri_prefix: std::string::String,
pub namespace_ids: std::vec::Vec<std::string::String>,
pub snapshot_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportDocumentsMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_operation_state<T: std::convert::Into<crate::model::OperationState>>(
mut self,
v: T,
) -> Self {
self.operation_state = v.into();
self
}
pub fn set_progress_documents<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = v.map(|x| x.into());
self
}
pub fn set_progress_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = v.map(|x| x.into());
self
}
pub fn set_collection_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.collection_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.output_uri_prefix = v.into();
self
}
pub fn set_namespace_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.namespace_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_snapshot_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExportDocumentsMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ExportDocumentsMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportDocumentsMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub operation_state: crate::model::OperationState,
pub progress_documents: std::option::Option<crate::model::Progress>,
pub progress_bytes: std::option::Option<crate::model::Progress>,
pub collection_ids: std::vec::Vec<std::string::String>,
pub input_uri_prefix: std::string::String,
pub namespace_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportDocumentsMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_operation_state<T: std::convert::Into<crate::model::OperationState>>(
mut self,
v: T,
) -> Self {
self.operation_state = v.into();
self
}
pub fn set_progress_documents<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = v.map(|x| x.into());
self
}
pub fn set_progress_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = v.map(|x| x.into());
self
}
pub fn set_collection_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.collection_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.input_uri_prefix = v.into();
self
}
pub fn set_namespace_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.namespace_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ImportDocumentsMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ImportDocumentsMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkDeleteDocumentsMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub operation_state: crate::model::OperationState,
pub progress_documents: std::option::Option<crate::model::Progress>,
pub progress_bytes: std::option::Option<crate::model::Progress>,
pub collection_ids: std::vec::Vec<std::string::String>,
pub namespace_ids: std::vec::Vec<std::string::String>,
pub snapshot_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkDeleteDocumentsMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_operation_state<T: std::convert::Into<crate::model::OperationState>>(
mut self,
v: T,
) -> Self {
self.operation_state = v.into();
self
}
pub fn set_progress_documents<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_documents = v.map(|x| x.into());
self
}
pub fn set_progress_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_bytes = v.map(|x| x.into());
self
}
pub fn set_collection_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.collection_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_namespace_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.namespace_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_snapshot_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BulkDeleteDocumentsMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportDocumentsResponse {
pub output_uri_prefix: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportDocumentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.output_uri_prefix = v.into();
self
}
}
impl wkt::message::Message for ExportDocumentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.ExportDocumentsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreDatabaseMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub operation_state: crate::model::OperationState,
pub database: std::string::String,
pub backup: std::string::String,
pub progress_percentage: std::option::Option<crate::model::Progress>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreDatabaseMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_operation_state<T: std::convert::Into<crate::model::OperationState>>(
mut self,
v: T,
) -> Self {
self.operation_state = v.into();
self
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup = v.into();
self
}
pub fn set_progress_percentage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_percentage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_percentage = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RestoreDatabaseMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloneDatabaseMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub operation_state: crate::model::OperationState,
pub database: std::string::String,
pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
pub progress_percentage: std::option::Option<crate::model::Progress>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloneDatabaseMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_operation_state<T: std::convert::Into<crate::model::OperationState>>(
mut self,
v: T,
) -> Self {
self.operation_state = v.into();
self
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PitrSnapshot>,
{
self.pitr_snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PitrSnapshot>,
{
self.pitr_snapshot = v.map(|x| x.into());
self
}
pub fn set_progress_percentage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_percentage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Progress>,
{
self.progress_percentage = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CloneDatabaseMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.CloneDatabaseMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Progress {
pub estimated_work: i64,
pub completed_work: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Progress {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_estimated_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.estimated_work = v.into();
self
}
pub fn set_completed_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.completed_work = v.into();
self
}
}
impl wkt::message::Message for Progress {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.Progress"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupSchedule {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub retention: std::option::Option<wkt::Duration>,
pub recurrence: std::option::Option<crate::model::backup_schedule::Recurrence>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupSchedule {
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_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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_retention<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.retention = v.map(|x| x.into());
self
}
pub fn set_recurrence<
T: std::convert::Into<std::option::Option<crate::model::backup_schedule::Recurrence>>,
>(
mut self,
v: T,
) -> Self {
self.recurrence = v.into();
self
}
pub fn daily_recurrence(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DailyRecurrence>> {
#[allow(unreachable_patterns)]
self.recurrence.as_ref().and_then(|v| match v {
crate::model::backup_schedule::Recurrence::DailyRecurrence(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_daily_recurrence<
T: std::convert::Into<std::boxed::Box<crate::model::DailyRecurrence>>,
>(
mut self,
v: T,
) -> Self {
self.recurrence = std::option::Option::Some(
crate::model::backup_schedule::Recurrence::DailyRecurrence(v.into()),
);
self
}
pub fn weekly_recurrence(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::WeeklyRecurrence>> {
#[allow(unreachable_patterns)]
self.recurrence.as_ref().and_then(|v| match v {
crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_weekly_recurrence<
T: std::convert::Into<std::boxed::Box<crate::model::WeeklyRecurrence>>,
>(
mut self,
v: T,
) -> Self {
self.recurrence = std::option::Option::Some(
crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v.into()),
);
self
}
}
impl wkt::message::Message for BackupSchedule {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.BackupSchedule"
}
}
pub mod backup_schedule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Recurrence {
DailyRecurrence(std::boxed::Box<crate::model::DailyRecurrence>),
WeeklyRecurrence(std::boxed::Box<crate::model::WeeklyRecurrence>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DailyRecurrence {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DailyRecurrence {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DailyRecurrence {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.DailyRecurrence"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WeeklyRecurrence {
pub day: google_cloud_type::model::DayOfWeek,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WeeklyRecurrence {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_day<T: std::convert::Into<google_cloud_type::model::DayOfWeek>>(
mut self,
v: T,
) -> Self {
self.day = v.into();
self
}
}
impl wkt::message::Message for WeeklyRecurrence {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.WeeklyRecurrence"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PitrSnapshot {
pub database: std::string::String,
pub database_uid: ::bytes::Bytes,
pub snapshot_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PitrSnapshot {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.database = v.into();
self
}
pub fn set_database_uid<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.database_uid = v.into();
self
}
pub fn set_snapshot_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PitrSnapshot {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.PitrSnapshot"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserCreds {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::user_creds::State,
pub secure_password: std::string::String,
pub user_creds_identity: std::option::Option<crate::model::user_creds::UserCredsIdentity>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserCreds {
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_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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::user_creds::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_secure_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.secure_password = v.into();
self
}
pub fn set_user_creds_identity<
T: std::convert::Into<std::option::Option<crate::model::user_creds::UserCredsIdentity>>,
>(
mut self,
v: T,
) -> Self {
self.user_creds_identity = v.into();
self
}
pub fn resource_identity(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::user_creds::ResourceIdentity>> {
#[allow(unreachable_patterns)]
self.user_creds_identity.as_ref().and_then(|v| match v {
crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_resource_identity<
T: std::convert::Into<std::boxed::Box<crate::model::user_creds::ResourceIdentity>>,
>(
mut self,
v: T,
) -> Self {
self.user_creds_identity = std::option::Option::Some(
crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v.into()),
);
self
}
}
impl wkt::message::Message for UserCreds {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.UserCreds"
}
}
pub mod user_creds {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceIdentity {
pub principal: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceIdentity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.principal = v.into();
self
}
}
impl wkt::message::Message for ResourceIdentity {
fn typename() -> &'static str {
"type.googleapis.com/google.firestore.admin.v1.UserCreds.ResourceIdentity"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Enabled,
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::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => 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::Enabled => std::option::Option::Some("ENABLED"),
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::Unspecified,
1 => Self::Enabled,
2 => 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_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"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::Unspecified => serializer.serialize_i32(0),
Self::Enabled => serializer.serialize_i32(1),
Self::Disabled => 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.firestore.admin.v1.UserCreds.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum UserCredsIdentity {
ResourceIdentity(std::boxed::Box<crate::model::user_creds::ResourceIdentity>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OperationState {
Unspecified,
Initializing,
Processing,
Cancelling,
Finalizing,
Successful,
Failed,
Cancelled,
UnknownValue(operation_state::UnknownValue),
}
#[doc(hidden)]
pub mod operation_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OperationState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Initializing => std::option::Option::Some(1),
Self::Processing => std::option::Option::Some(2),
Self::Cancelling => std::option::Option::Some(3),
Self::Finalizing => std::option::Option::Some(4),
Self::Successful => std::option::Option::Some(5),
Self::Failed => std::option::Option::Some(6),
Self::Cancelled => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OPERATION_STATE_UNSPECIFIED"),
Self::Initializing => std::option::Option::Some("INITIALIZING"),
Self::Processing => std::option::Option::Some("PROCESSING"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Finalizing => std::option::Option::Some("FINALIZING"),
Self::Successful => std::option::Option::Some("SUCCESSFUL"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OperationState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OperationState {
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 OperationState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Initializing,
2 => Self::Processing,
3 => Self::Cancelling,
4 => Self::Finalizing,
5 => Self::Successful,
6 => Self::Failed,
7 => Self::Cancelled,
_ => Self::UnknownValue(operation_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OperationState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OPERATION_STATE_UNSPECIFIED" => Self::Unspecified,
"INITIALIZING" => Self::Initializing,
"PROCESSING" => Self::Processing,
"CANCELLING" => Self::Cancelling,
"FINALIZING" => Self::Finalizing,
"SUCCESSFUL" => Self::Successful,
"FAILED" => Self::Failed,
"CANCELLED" => Self::Cancelled,
_ => Self::UnknownValue(operation_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OperationState {
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::Initializing => serializer.serialize_i32(1),
Self::Processing => serializer.serialize_i32(2),
Self::Cancelling => serializer.serialize_i32(3),
Self::Finalizing => serializer.serialize_i32(4),
Self::Successful => serializer.serialize_i32(5),
Self::Failed => serializer.serialize_i32(6),
Self::Cancelled => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OperationState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationState>::new(
".google.firestore.admin.v1.OperationState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RealtimeUpdatesMode {
Unspecified,
Enabled,
Disabled,
UnknownValue(realtime_updates_mode::UnknownValue),
}
#[doc(hidden)]
pub mod realtime_updates_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RealtimeUpdatesMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => 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("REALTIME_UPDATES_MODE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("REALTIME_UPDATES_MODE_ENABLED"),
Self::Disabled => std::option::Option::Some("REALTIME_UPDATES_MODE_DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RealtimeUpdatesMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RealtimeUpdatesMode {
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 RealtimeUpdatesMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
_ => Self::UnknownValue(realtime_updates_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RealtimeUpdatesMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REALTIME_UPDATES_MODE_UNSPECIFIED" => Self::Unspecified,
"REALTIME_UPDATES_MODE_ENABLED" => Self::Enabled,
"REALTIME_UPDATES_MODE_DISABLED" => Self::Disabled,
_ => Self::UnknownValue(realtime_updates_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RealtimeUpdatesMode {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RealtimeUpdatesMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RealtimeUpdatesMode>::new(
".google.firestore.admin.v1.RealtimeUpdatesMode",
))
}
}