#![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_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
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 ListActiveDirectoriesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListActiveDirectoriesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListActiveDirectoriesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListActiveDirectoriesResponse {
pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListActiveDirectoriesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_active_directories<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ActiveDirectory>,
{
use std::iter::Iterator;
self.active_directories = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListActiveDirectoriesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListActiveDirectoriesResponse {
type PageItem = crate::model::ActiveDirectory;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.active_directories
}
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 GetActiveDirectoryRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetActiveDirectoryRequest {
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 GetActiveDirectoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateActiveDirectoryRequest {
pub parent: std::string::String,
pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
pub active_directory_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateActiveDirectoryRequest {
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_active_directory<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ActiveDirectory>,
{
self.active_directory = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ActiveDirectory>,
{
self.active_directory = v.map(|x| x.into());
self
}
pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.active_directory_id = v.into();
self
}
}
impl wkt::message::Message for CreateActiveDirectoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateActiveDirectoryRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateActiveDirectoryRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_active_directory<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ActiveDirectory>,
{
self.active_directory = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ActiveDirectory>,
{
self.active_directory = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateActiveDirectoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteActiveDirectoryRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteActiveDirectoryRequest {
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 DeleteActiveDirectoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ActiveDirectory {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::active_directory::State,
pub domain: std::string::String,
pub site: std::string::String,
pub dns: std::string::String,
pub net_bios_prefix: std::string::String,
pub organizational_unit: std::string::String,
pub aes_encryption: bool,
pub username: std::string::String,
pub password: std::string::String,
pub backup_operators: std::vec::Vec<std::string::String>,
pub administrators: std::vec::Vec<std::string::String>,
pub security_operators: std::vec::Vec<std::string::String>,
pub kdc_hostname: std::string::String,
pub kdc_ip: std::string::String,
pub nfs_users_with_ldap: bool,
pub description: std::string::String,
pub ldap_signing: bool,
pub encrypt_dc_connections: bool,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub state_details: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ActiveDirectory {
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_state<T: std::convert::Into<crate::model::active_directory::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.domain = v.into();
self
}
pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.site = v.into();
self
}
pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dns = v.into();
self
}
pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.net_bios_prefix = v.into();
self
}
pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.organizational_unit = v.into();
self
}
pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.aes_encryption = v.into();
self
}
pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.username = v.into();
self
}
pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.password = v.into();
self
}
pub fn set_backup_operators<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.backup_operators = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_administrators<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.administrators = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_security_operators<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.security_operators = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kdc_hostname = v.into();
self
}
pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kdc_ip = v.into();
self
}
pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.nfs_users_with_ldap = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ldap_signing = v.into();
self
}
pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.encrypt_dc_connections = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_details = v.into();
self
}
}
impl wkt::message::Message for ActiveDirectory {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
}
}
pub mod active_directory {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Ready,
Updating,
InUse,
Deleting,
Error,
Diagnosing,
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::Updating => std::option::Option::Some(3),
Self::InUse => std::option::Option::Some(4),
Self::Deleting => std::option::Option::Some(5),
Self::Error => std::option::Option::Some(6),
Self::Diagnosing => 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("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Ready => std::option::Option::Some("READY"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::InUse => std::option::Option::Some("IN_USE"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
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::Updating,
4 => Self::InUse,
5 => Self::Deleting,
6 => Self::Error,
7 => Self::Diagnosing,
_ => 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,
"UPDATING" => Self::Updating,
"IN_USE" => Self::InUse,
"DELETING" => Self::Deleting,
"ERROR" => Self::Error,
"DIAGNOSING" => Self::Diagnosing,
_ => 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::Updating => serializer.serialize_i32(3),
Self::InUse => serializer.serialize_i32(4),
Self::Deleting => serializer.serialize_i32(5),
Self::Error => serializer.serialize_i32(6),
Self::Diagnosing => serializer.serialize_i32(7),
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.cloud.netapp.v1.ActiveDirectory.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Backup {
pub name: std::string::String,
pub state: crate::model::backup::State,
pub description: std::string::String,
pub volume_usage_bytes: i64,
pub backup_type: crate::model::backup::Type,
pub source_volume: std::string::String,
pub source_snapshot: std::option::Option<std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub chain_storage_bytes: i64,
pub satisfies_pzs: bool,
pub satisfies_pzi: bool,
pub volume_region: std::string::String,
pub backup_region: std::string::String,
pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Backup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.volume_usage_bytes = v.into();
self
}
pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
mut self,
v: T,
) -> Self {
self.backup_type = v.into();
self
}
pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_volume = v.into();
self
}
pub fn set_source_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.source_snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.source_snapshot = v.map(|x| x.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_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.chain_storage_bytes = v.into();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = v.into();
self
}
pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzi = v.into();
self
}
pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.volume_region = v.into();
self
}
pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_region = v.into();
self
}
pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.enforced_retention_end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.enforced_retention_end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Backup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.Backup"
}
}
pub mod backup {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Uploading,
Ready,
Deleting,
Error,
Updating,
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::Uploading => std::option::Option::Some(2),
Self::Ready => std::option::Option::Some(3),
Self::Deleting => std::option::Option::Some(4),
Self::Error => std::option::Option::Some(5),
Self::Updating => std::option::Option::Some(6),
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::Uploading => std::option::Option::Some("UPLOADING"),
Self::Ready => std::option::Option::Some("READY"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Updating => std::option::Option::Some("UPDATING"),
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::Uploading,
3 => Self::Ready,
4 => Self::Deleting,
5 => Self::Error,
6 => Self::Updating,
_ => 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,
"UPLOADING" => Self::Uploading,
"READY" => Self::Ready,
"DELETING" => Self::Deleting,
"ERROR" => Self::Error,
"UPDATING" => Self::Updating,
_ => 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::Uploading => serializer.serialize_i32(2),
Self::Ready => serializer.serialize_i32(3),
Self::Deleting => serializer.serialize_i32(4),
Self::Error => serializer.serialize_i32(5),
Self::Updating => serializer.serialize_i32(6),
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.cloud.netapp.v1.Backup.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Manual,
Scheduled,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Manual => std::option::Option::Some(1),
Self::Scheduled => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Manual => std::option::Option::Some("MANUAL"),
Self::Scheduled => std::option::Option::Some("SCHEDULED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Manual,
2 => Self::Scheduled,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"MANUAL" => Self::Manual,
"SCHEDULED" => Self::Scheduled,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Manual => serializer.serialize_i32(1),
Self::Scheduled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.netapp.v1.Backup.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: 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_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = 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.cloud.netapp.v1.ListBackupsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsResponse {
pub backups: std::vec::Vec<crate::model::Backup>,
pub next_page_token: std::string::String,
pub 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_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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.cloud.netapp.v1.ListBackupsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
type PageItem = crate::model::Backup;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.backups
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct 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.cloud.netapp.v1.GetBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBackupRequest {
pub parent: std::string::String,
pub backup_id: std::string::String,
pub backup: std::option::Option<crate::model::Backup>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_id = v.into();
self
}
pub fn set_backup<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
}
}
#[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.cloud.netapp.v1.DeleteBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBackupRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub backup: std::option::Option<crate::model::Backup>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateBackupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_backup<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Backup>,
{
self.backup = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateBackupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupPolicy {
pub name: std::string::String,
pub daily_backup_limit: std::option::Option<i32>,
pub weekly_backup_limit: std::option::Option<i32>,
pub monthly_backup_limit: std::option::Option<i32>,
pub description: std::option::Option<std::string::String>,
pub enabled: std::option::Option<bool>,
pub assigned_volume_count: std::option::Option<i32>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub state: crate::model::backup_policy::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupPolicy {
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_daily_backup_limit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.daily_backup_limit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.daily_backup_limit = v.map(|x| x.into());
self
}
pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.weekly_backup_limit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.weekly_backup_limit = v.map(|x| x.into());
self
}
pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.monthly_backup_limit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.monthly_backup_limit = v.map(|x| x.into());
self
}
pub fn set_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = v.map(|x| x.into());
self
}
pub fn set_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = v.map(|x| x.into());
self
}
pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.assigned_volume_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.assigned_volume_count = v.map(|x| x.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_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for BackupPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
}
}
pub mod backup_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Ready,
Deleting,
Error,
Updating,
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::Deleting => std::option::Option::Some(3),
Self::Error => std::option::Option::Some(4),
Self::Updating => std::option::Option::Some(5),
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::Deleting => std::option::Option::Some("DELETING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Updating => std::option::Option::Some("UPDATING"),
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::Deleting,
4 => Self::Error,
5 => Self::Updating,
_ => 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,
"DELETING" => Self::Deleting,
"ERROR" => Self::Error,
"UPDATING" => Self::Updating,
_ => 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::Deleting => serializer.serialize_i32(3),
Self::Error => serializer.serialize_i32(4),
Self::Updating => serializer.serialize_i32(5),
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.cloud.netapp.v1.BackupPolicy.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBackupPolicyRequest {
pub parent: std::string::String,
pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
pub backup_policy_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBackupPolicyRequest {
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_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupPolicy>,
{
self.backup_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupPolicy>,
{
self.backup_policy = v.map(|x| x.into());
self
}
pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.backup_policy_id = v.into();
self
}
}
impl wkt::message::Message for CreateBackupPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBackupPolicyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetBackupPolicyRequest {
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 GetBackupPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupPoliciesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupPoliciesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListBackupPoliciesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupPoliciesResponse {
pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupPoliciesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BackupPolicy>,
{
use std::iter::Iterator;
self.backup_policies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListBackupPoliciesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
type PageItem = crate::model::BackupPolicy;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.backup_policies
}
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 UpdateBackupPolicyRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateBackupPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_backup_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupPolicy>,
{
self.backup_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupPolicy>,
{
self.backup_policy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateBackupPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBackupPolicyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteBackupPolicyRequest {
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 DeleteBackupPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupVault {
pub name: std::string::String,
pub state: crate::model::backup_vault::State,
pub create_time: std::option::Option<wkt::Timestamp>,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
pub source_region: std::string::String,
pub backup_region: std::string::String,
pub source_backup_vault: std::string::String,
pub destination_backup_vault: std::string::String,
pub backup_retention_policy:
std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
pub kms_config: std::string::String,
pub encryption_state: crate::model::backup_vault::EncryptionState,
pub backups_crypto_key_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupVault {
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_state<T: std::convert::Into<crate::model::backup_vault::State>>(
mut self,
v: T,
) -> Self {
self.state = 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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_backup_vault_type<
T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
>(
mut self,
v: T,
) -> Self {
self.backup_vault_type = v.into();
self
}
pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_region = v.into();
self
}
pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_region = v.into();
self
}
pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_backup_vault = v.into();
self
}
pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_backup_vault = v.into();
self
}
pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
{
self.backup_retention_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
{
self.backup_retention_policy = v.map(|x| x.into());
self
}
pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_config = v.into();
self
}
pub fn set_encryption_state<
T: std::convert::Into<crate::model::backup_vault::EncryptionState>,
>(
mut self,
v: T,
) -> Self {
self.encryption_state = v.into();
self
}
pub fn set_backups_crypto_key_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.backups_crypto_key_version = v.into();
self
}
}
impl wkt::message::Message for BackupVault {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.BackupVault"
}
}
pub mod backup_vault {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupRetentionPolicy {
pub backup_minimum_enforced_retention_days: i32,
pub daily_backup_immutable: bool,
pub weekly_backup_immutable: bool,
pub monthly_backup_immutable: bool,
pub manual_backup_immutable: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupRetentionPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.backup_minimum_enforced_retention_days = v.into();
self
}
pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.daily_backup_immutable = v.into();
self
}
pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.weekly_backup_immutable = v.into();
self
}
pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.monthly_backup_immutable = v.into();
self
}
pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.manual_backup_immutable = v.into();
self
}
}
impl wkt::message::Message for BackupRetentionPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Ready,
Deleting,
Error,
Updating,
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::Deleting => std::option::Option::Some(3),
Self::Error => std::option::Option::Some(4),
Self::Updating => std::option::Option::Some(5),
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::Deleting => std::option::Option::Some("DELETING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Updating => std::option::Option::Some("UPDATING"),
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::Deleting,
4 => Self::Error,
5 => Self::Updating,
_ => 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,
"DELETING" => Self::Deleting,
"ERROR" => Self::Error,
"UPDATING" => Self::Updating,
_ => 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::Deleting => serializer.serialize_i32(3),
Self::Error => serializer.serialize_i32(4),
Self::Updating => serializer.serialize_i32(5),
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.cloud.netapp.v1.BackupVault.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BackupVaultType {
Unspecified,
InRegion,
CrossRegion,
UnknownValue(backup_vault_type::UnknownValue),
}
#[doc(hidden)]
pub mod backup_vault_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BackupVaultType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::InRegion => std::option::Option::Some(1),
Self::CrossRegion => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
Self::InRegion => std::option::Option::Some("IN_REGION"),
Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BackupVaultType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BackupVaultType {
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 BackupVaultType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::InRegion,
2 => Self::CrossRegion,
_ => Self::UnknownValue(backup_vault_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BackupVaultType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
"IN_REGION" => Self::InRegion,
"CROSS_REGION" => Self::CrossRegion,
_ => Self::UnknownValue(backup_vault_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BackupVaultType {
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::InRegion => serializer.serialize_i32(1),
Self::CrossRegion => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
".google.cloud.netapp.v1.BackupVault.BackupVaultType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EncryptionState {
Unspecified,
Pending,
Completed,
InProgress,
Failed,
UnknownValue(encryption_state::UnknownValue),
}
#[doc(hidden)]
pub mod encryption_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EncryptionState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Completed => std::option::Option::Some(2),
Self::InProgress => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("ENCRYPTION_STATE_PENDING"),
Self::Completed => std::option::Option::Some("ENCRYPTION_STATE_COMPLETED"),
Self::InProgress => std::option::Option::Some("ENCRYPTION_STATE_IN_PROGRESS"),
Self::Failed => std::option::Option::Some("ENCRYPTION_STATE_FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EncryptionState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EncryptionState {
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 EncryptionState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Completed,
3 => Self::InProgress,
4 => Self::Failed,
_ => Self::UnknownValue(encryption_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EncryptionState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
"ENCRYPTION_STATE_PENDING" => Self::Pending,
"ENCRYPTION_STATE_COMPLETED" => Self::Completed,
"ENCRYPTION_STATE_IN_PROGRESS" => Self::InProgress,
"ENCRYPTION_STATE_FAILED" => Self::Failed,
_ => Self::UnknownValue(encryption_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EncryptionState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Completed => serializer.serialize_i32(2),
Self::InProgress => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EncryptionState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
".google.cloud.netapp.v1.BackupVault.EncryptionState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBackupVaultRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetBackupVaultRequest {
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 GetBackupVaultRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupVaultsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupVaultsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = 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 ListBackupVaultsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupVaultsResponse {
pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBackupVaultsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BackupVault>,
{
use std::iter::Iterator;
self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListBackupVaultsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
type PageItem = crate::model::BackupVault;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.backup_vaults
}
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 CreateBackupVaultRequest {
pub parent: std::string::String,
pub backup_vault_id: std::string::String,
pub backup_vault: std::option::Option<crate::model::BackupVault>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBackupVaultRequest {
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_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_vault_id = v.into();
self
}
pub fn set_backup_vault<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupVault>,
{
self.backup_vault = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupVault>,
{
self.backup_vault = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateBackupVaultRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBackupVaultRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteBackupVaultRequest {
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 DeleteBackupVaultRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBackupVaultRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub backup_vault: std::option::Option<crate::model::BackupVault>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateBackupVaultRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_backup_vault<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupVault>,
{
self.backup_vault = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupVault>,
{
self.backup_vault = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateBackupVaultRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub target: std::string::String,
pub verb: std::string::String,
pub status_message: std::string::String,
pub requested_cancellation: bool,
pub api_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_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_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocationMetadata {
pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
pub has_vcp: bool,
pub has_ontap_proxy: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LocationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceLevel>,
{
use std::iter::Iterator;
self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FlexPerformance>,
{
use std::iter::Iterator;
self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.has_vcp = v.into();
self
}
pub fn set_has_ontap_proxy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.has_ontap_proxy = v.into();
self
}
}
impl wkt::message::Message for LocationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserCommands {
pub commands: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserCommands {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_commands<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.commands = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UserCommands {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UserCommands"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHostGroupsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListHostGroupsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListHostGroupsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHostGroupsResponse {
pub host_groups: std::vec::Vec<crate::model::HostGroup>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListHostGroupsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_host_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::HostGroup>,
{
use std::iter::Iterator;
self.host_groups = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListHostGroupsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListHostGroupsResponse {
type PageItem = crate::model::HostGroup;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.host_groups
}
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 GetHostGroupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetHostGroupRequest {
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 GetHostGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetHostGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateHostGroupRequest {
pub parent: std::string::String,
pub host_group: std::option::Option<crate::model::HostGroup>,
pub host_group_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateHostGroupRequest {
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_host_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::HostGroup>,
{
self.host_group = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::HostGroup>,
{
self.host_group = v.map(|x| x.into());
self
}
pub fn set_host_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.host_group_id = v.into();
self
}
}
impl wkt::message::Message for CreateHostGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateHostGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateHostGroupRequest {
pub host_group: std::option::Option<crate::model::HostGroup>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateHostGroupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_host_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::HostGroup>,
{
self.host_group = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::HostGroup>,
{
self.host_group = 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 UpdateHostGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateHostGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteHostGroupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteHostGroupRequest {
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 DeleteHostGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteHostGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HostGroup {
pub name: std::string::String,
pub r#type: crate::model::host_group::Type,
pub state: crate::model::host_group::State,
pub create_time: std::option::Option<wkt::Timestamp>,
pub hosts: std::vec::Vec<std::string::String>,
pub os_type: crate::model::OsType,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HostGroup {
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_type<T: std::convert::Into<crate::model::host_group::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::host_group::State>>(
mut self,
v: T,
) -> Self {
self.state = 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_hosts<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.hosts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
self.os_type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for HostGroup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.HostGroup"
}
}
pub mod host_group {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
IscsiInitiator,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::IscsiInitiator => 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("TYPE_UNSPECIFIED"),
Self::IscsiInitiator => std::option::Option::Some("ISCSI_INITIATOR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::IscsiInitiator,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"ISCSI_INITIATOR" => Self::IscsiInitiator,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::IscsiInitiator => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.netapp.v1.HostGroup.Type",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Ready,
Updating,
Deleting,
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::Creating => std::option::Option::Some(1),
Self::Ready => std::option::Option::Some(2),
Self::Updating => std::option::Option::Some(3),
Self::Deleting => std::option::Option::Some(4),
Self::Disabled => std::option::Option::Some(5),
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::Updating => std::option::Option::Some("UPDATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
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::Creating,
2 => Self::Ready,
3 => Self::Updating,
4 => Self::Deleting,
5 => 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,
"CREATING" => Self::Creating,
"READY" => Self::Ready,
"UPDATING" => Self::Updating,
"DELETING" => Self::Deleting,
"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::Creating => serializer.serialize_i32(1),
Self::Ready => serializer.serialize_i32(2),
Self::Updating => serializer.serialize_i32(3),
Self::Deleting => serializer.serialize_i32(4),
Self::Disabled => serializer.serialize_i32(5),
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.cloud.netapp.v1.HostGroup.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetKmsConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetKmsConfigRequest {
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 GetKmsConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListKmsConfigsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListKmsConfigsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = 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 ListKmsConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListKmsConfigsResponse {
pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListKmsConfigsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::KmsConfig>,
{
use std::iter::Iterator;
self.kms_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListKmsConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
type PageItem = crate::model::KmsConfig;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.kms_configs
}
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 CreateKmsConfigRequest {
pub parent: std::string::String,
pub kms_config_id: std::string::String,
pub kms_config: std::option::Option<crate::model::KmsConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateKmsConfigRequest {
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_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_config_id = v.into();
self
}
pub fn set_kms_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KmsConfig>,
{
self.kms_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KmsConfig>,
{
self.kms_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateKmsConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateKmsConfigRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub kms_config: std::option::Option<crate::model::KmsConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateKmsConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_kms_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KmsConfig>,
{
self.kms_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KmsConfig>,
{
self.kms_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateKmsConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteKmsConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteKmsConfigRequest {
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 DeleteKmsConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptVolumesRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptVolumesRequest {
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 EncryptVolumesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyKmsConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyKmsConfigRequest {
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 VerifyKmsConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyKmsConfigResponse {
pub healthy: bool,
pub health_error: std::string::String,
pub instructions: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyKmsConfigResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.healthy = v.into();
self
}
pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.health_error = v.into();
self
}
pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instructions = v.into();
self
}
}
impl wkt::message::Message for VerifyKmsConfigResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KmsConfig {
pub name: std::string::String,
pub crypto_key_name: std::string::String,
pub state: crate::model::kms_config::State,
pub state_details: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub instructions: std::string::String,
pub service_account: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KmsConfig {
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_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.crypto_key_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_details = 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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instructions = v.into();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
}
impl wkt::message::Message for KmsConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
}
}
pub mod kms_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Ready,
Creating,
Deleting,
Updating,
InUse,
Error,
KeyCheckPending,
KeyNotReachable,
Disabling,
Disabled,
Migrating,
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::Ready => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Updating => std::option::Option::Some(4),
Self::InUse => std::option::Option::Some(5),
Self::Error => std::option::Option::Some(6),
Self::KeyCheckPending => std::option::Option::Some(7),
Self::KeyNotReachable => std::option::Option::Some(8),
Self::Disabling => std::option::Option::Some(9),
Self::Disabled => std::option::Option::Some(10),
Self::Migrating => std::option::Option::Some(11),
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::Ready => std::option::Option::Some("READY"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::InUse => std::option::Option::Some("IN_USE"),
Self::Error => std::option::Option::Some("ERROR"),
Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
Self::Disabling => std::option::Option::Some("DISABLING"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Migrating => std::option::Option::Some("MIGRATING"),
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::Ready,
2 => Self::Creating,
3 => Self::Deleting,
4 => Self::Updating,
5 => Self::InUse,
6 => Self::Error,
7 => Self::KeyCheckPending,
8 => Self::KeyNotReachable,
9 => Self::Disabling,
10 => Self::Disabled,
11 => Self::Migrating,
_ => 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,
"READY" => Self::Ready,
"CREATING" => Self::Creating,
"DELETING" => Self::Deleting,
"UPDATING" => Self::Updating,
"IN_USE" => Self::InUse,
"ERROR" => Self::Error,
"KEY_CHECK_PENDING" => Self::KeyCheckPending,
"KEY_NOT_REACHABLE" => Self::KeyNotReachable,
"DISABLING" => Self::Disabling,
"DISABLED" => Self::Disabled,
"MIGRATING" => Self::Migrating,
_ => 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::Ready => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Updating => serializer.serialize_i32(4),
Self::InUse => serializer.serialize_i32(5),
Self::Error => serializer.serialize_i32(6),
Self::KeyCheckPending => serializer.serialize_i32(7),
Self::KeyNotReachable => serializer.serialize_i32(8),
Self::Disabling => serializer.serialize_i32(9),
Self::Disabled => serializer.serialize_i32(10),
Self::Migrating => serializer.serialize_i32(11),
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.cloud.netapp.v1.KmsConfig.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteOntapPostRequest {
pub body: std::option::Option<wkt::Struct>,
pub ontap_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteOntapPostRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = v.map(|x| x.into());
self
}
pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ontap_path = v.into();
self
}
}
impl wkt::message::Message for ExecuteOntapPostRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteOntapPostResponse {
pub body: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteOntapPostResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExecuteOntapPostResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteOntapGetRequest {
pub ontap_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteOntapGetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ontap_path = v.into();
self
}
}
impl wkt::message::Message for ExecuteOntapGetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteOntapGetResponse {
pub body: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteOntapGetResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExecuteOntapGetResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteOntapDeleteRequest {
pub ontap_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteOntapDeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ontap_path = v.into();
self
}
}
impl wkt::message::Message for ExecuteOntapDeleteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteOntapDeleteResponse {
pub body: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteOntapDeleteResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExecuteOntapDeleteResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteOntapPatchRequest {
pub body: std::option::Option<wkt::Struct>,
pub ontap_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteOntapPatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = v.map(|x| x.into());
self
}
pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ontap_path = v.into();
self
}
}
impl wkt::message::Message for ExecuteOntapPatchRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecuteOntapPatchResponse {
pub body: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecuteOntapPatchResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExecuteOntapPatchResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListQuotaRulesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListQuotaRulesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListQuotaRulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListQuotaRulesResponse {
pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListQuotaRulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::QuotaRule>,
{
use std::iter::Iterator;
self.quota_rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListQuotaRulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
type PageItem = crate::model::QuotaRule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.quota_rules
}
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 GetQuotaRuleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetQuotaRuleRequest {
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 GetQuotaRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateQuotaRuleRequest {
pub parent: std::string::String,
pub quota_rule: std::option::Option<crate::model::QuotaRule>,
pub quota_rule_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateQuotaRuleRequest {
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_quota_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::QuotaRule>,
{
self.quota_rule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::QuotaRule>,
{
self.quota_rule = v.map(|x| x.into());
self
}
pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.quota_rule_id = v.into();
self
}
}
impl wkt::message::Message for CreateQuotaRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateQuotaRuleRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub quota_rule: std::option::Option<crate::model::QuotaRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateQuotaRuleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_quota_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::QuotaRule>,
{
self.quota_rule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::QuotaRule>,
{
self.quota_rule = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateQuotaRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteQuotaRuleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteQuotaRuleRequest {
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 DeleteQuotaRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QuotaRule {
pub name: std::string::String,
pub target: std::string::String,
pub r#type: crate::model::quota_rule::Type,
pub disk_limit_mib: i32,
pub state: crate::model::quota_rule::State,
pub state_details: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QuotaRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.disk_limit_mib = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_details = 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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for QuotaRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
}
}
pub mod quota_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
IndividualUserQuota,
IndividualGroupQuota,
DefaultUserQuota,
DefaultGroupQuota,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::IndividualUserQuota => std::option::Option::Some(1),
Self::IndividualGroupQuota => std::option::Option::Some(2),
Self::DefaultUserQuota => std::option::Option::Some(3),
Self::DefaultGroupQuota => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::IndividualUserQuota,
2 => Self::IndividualGroupQuota,
3 => Self::DefaultUserQuota,
4 => Self::DefaultGroupQuota,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
"INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
"DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
"DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::IndividualUserQuota => serializer.serialize_i32(1),
Self::IndividualGroupQuota => serializer.serialize_i32(2),
Self::DefaultUserQuota => serializer.serialize_i32(3),
Self::DefaultGroupQuota => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.netapp.v1.QuotaRule.Type",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Updating,
Deleting,
Ready,
Error,
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::Updating => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Ready => std::option::Option::Some(4),
Self::Error => std::option::Option::Some(5),
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::Updating => std::option::Option::Some("UPDATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Ready => std::option::Option::Some("READY"),
Self::Error => std::option::Option::Some("ERROR"),
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::Updating,
3 => Self::Deleting,
4 => Self::Ready,
5 => Self::Error,
_ => 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,
"UPDATING" => Self::Updating,
"DELETING" => Self::Deleting,
"READY" => Self::Ready,
"ERROR" => Self::Error,
_ => 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::Updating => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Ready => serializer.serialize_i32(4),
Self::Error => serializer.serialize_i32(5),
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.cloud.netapp.v1.QuotaRule.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferStats {
pub transfer_bytes: std::option::Option<i64>,
pub total_transfer_duration: std::option::Option<wkt::Duration>,
pub last_transfer_bytes: std::option::Option<i64>,
pub last_transfer_duration: std::option::Option<wkt::Duration>,
pub lag_duration: std::option::Option<wkt::Duration>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
pub last_transfer_error: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferStats {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.transfer_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.transfer_bytes = v.map(|x| x.into());
self
}
pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.total_transfer_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.total_transfer_duration = v.map(|x| x.into());
self
}
pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.last_transfer_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.last_transfer_bytes = v.map(|x| x.into());
self
}
pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.last_transfer_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.last_transfer_duration = v.map(|x| x.into());
self
}
pub fn set_lag_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.lag_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.lag_duration = 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_last_transfer_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_transfer_end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_transfer_end_time = v.map(|x| x.into());
self
}
pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.last_transfer_error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.last_transfer_error = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TransferStats {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.TransferStats"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Replication {
pub name: std::string::String,
pub state: crate::model::replication::State,
pub state_details: std::string::String,
pub role: crate::model::replication::ReplicationRole,
pub replication_schedule: crate::model::replication::ReplicationSchedule,
pub mirror_state: crate::model::replication::MirrorState,
pub healthy: std::option::Option<bool>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub destination_volume: std::string::String,
pub transfer_stats: std::option::Option<crate::model::TransferStats>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::option::Option<std::string::String>,
pub destination_volume_parameters:
std::option::Option<crate::model::DestinationVolumeParameters>,
pub source_volume: std::string::String,
pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
pub cluster_location: std::string::String,
pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Replication {
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_state<T: std::convert::Into<crate::model::replication::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_details = v.into();
self
}
pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
mut self,
v: T,
) -> Self {
self.role = v.into();
self
}
pub fn set_replication_schedule<
T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
>(
mut self,
v: T,
) -> Self {
self.replication_schedule = v.into();
self
}
pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
mut self,
v: T,
) -> Self {
self.mirror_state = v.into();
self
}
pub fn set_healthy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.healthy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.healthy = v.map(|x| x.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_destination_volume<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_volume = v.into();
self
}
pub fn set_transfer_stats<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransferStats>,
{
self.transfer_stats = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransferStats>,
{
self.transfer_stats = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = v.map(|x| x.into());
self
}
pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DestinationVolumeParameters>,
{
self.destination_volume_parameters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination_volume_parameters<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::DestinationVolumeParameters>,
{
self.destination_volume_parameters = v.map(|x| x.into());
self
}
pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_volume = v.into();
self
}
pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::HybridPeeringDetails>,
{
self.hybrid_peering_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::HybridPeeringDetails>,
{
self.hybrid_peering_details = v.map(|x| x.into());
self
}
pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cluster_location = v.into();
self
}
pub fn set_hybrid_replication_type<
T: std::convert::Into<crate::model::replication::HybridReplicationType>,
>(
mut self,
v: T,
) -> Self {
self.hybrid_replication_type = v.into();
self
}
pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UserCommands>,
{
self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hybrid_replication_user_commands<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::UserCommands>,
{
self.hybrid_replication_user_commands = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Replication {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.Replication"
}
}
pub mod replication {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Ready,
Updating,
Deleting,
Error,
PendingClusterPeering,
PendingSvmPeering,
PendingRemoteResync,
ExternallyManagedReplication,
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::Updating => std::option::Option::Some(3),
Self::Deleting => std::option::Option::Some(5),
Self::Error => std::option::Option::Some(6),
Self::PendingClusterPeering => std::option::Option::Some(8),
Self::PendingSvmPeering => std::option::Option::Some(9),
Self::PendingRemoteResync => std::option::Option::Some(10),
Self::ExternallyManagedReplication => std::option::Option::Some(11),
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::Updating => std::option::Option::Some("UPDATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
Self::ExternallyManagedReplication => {
std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
}
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::Updating,
5 => Self::Deleting,
6 => Self::Error,
8 => Self::PendingClusterPeering,
9 => Self::PendingSvmPeering,
10 => Self::PendingRemoteResync,
11 => Self::ExternallyManagedReplication,
_ => 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,
"UPDATING" => Self::Updating,
"DELETING" => Self::Deleting,
"ERROR" => Self::Error,
"PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
"PENDING_SVM_PEERING" => Self::PendingSvmPeering,
"PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
"EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
_ => 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::Updating => serializer.serialize_i32(3),
Self::Deleting => serializer.serialize_i32(5),
Self::Error => serializer.serialize_i32(6),
Self::PendingClusterPeering => serializer.serialize_i32(8),
Self::PendingSvmPeering => serializer.serialize_i32(9),
Self::PendingRemoteResync => serializer.serialize_i32(10),
Self::ExternallyManagedReplication => serializer.serialize_i32(11),
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.cloud.netapp.v1.Replication.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ReplicationRole {
Unspecified,
Source,
Destination,
UnknownValue(replication_role::UnknownValue),
}
#[doc(hidden)]
pub mod replication_role {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ReplicationRole {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Source => std::option::Option::Some(1),
Self::Destination => 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("REPLICATION_ROLE_UNSPECIFIED"),
Self::Source => std::option::Option::Some("SOURCE"),
Self::Destination => std::option::Option::Some("DESTINATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ReplicationRole {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ReplicationRole {
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 ReplicationRole {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Source,
2 => Self::Destination,
_ => Self::UnknownValue(replication_role::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ReplicationRole {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
"SOURCE" => Self::Source,
"DESTINATION" => Self::Destination,
_ => Self::UnknownValue(replication_role::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ReplicationRole {
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::Source => serializer.serialize_i32(1),
Self::Destination => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
".google.cloud.netapp.v1.Replication.ReplicationRole",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ReplicationSchedule {
Unspecified,
Every10Minutes,
Hourly,
Daily,
UnknownValue(replication_schedule::UnknownValue),
}
#[doc(hidden)]
pub mod replication_schedule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ReplicationSchedule {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Every10Minutes => std::option::Option::Some(1),
Self::Hourly => std::option::Option::Some(2),
Self::Daily => 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("REPLICATION_SCHEDULE_UNSPECIFIED"),
Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
Self::Hourly => std::option::Option::Some("HOURLY"),
Self::Daily => std::option::Option::Some("DAILY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ReplicationSchedule {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ReplicationSchedule {
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 ReplicationSchedule {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Every10Minutes,
2 => Self::Hourly,
3 => Self::Daily,
_ => Self::UnknownValue(replication_schedule::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ReplicationSchedule {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
"EVERY_10_MINUTES" => Self::Every10Minutes,
"HOURLY" => Self::Hourly,
"DAILY" => Self::Daily,
_ => Self::UnknownValue(replication_schedule::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ReplicationSchedule {
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::Every10Minutes => serializer.serialize_i32(1),
Self::Hourly => serializer.serialize_i32(2),
Self::Daily => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
".google.cloud.netapp.v1.Replication.ReplicationSchedule",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MirrorState {
Unspecified,
Preparing,
Mirrored,
Stopped,
Transferring,
BaselineTransferring,
Aborted,
ExternallyManaged,
PendingPeering,
UnknownValue(mirror_state::UnknownValue),
}
#[doc(hidden)]
pub mod mirror_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MirrorState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Preparing => std::option::Option::Some(1),
Self::Mirrored => std::option::Option::Some(2),
Self::Stopped => std::option::Option::Some(3),
Self::Transferring => std::option::Option::Some(4),
Self::BaselineTransferring => std::option::Option::Some(5),
Self::Aborted => std::option::Option::Some(6),
Self::ExternallyManaged => std::option::Option::Some(7),
Self::PendingPeering => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
Self::Preparing => std::option::Option::Some("PREPARING"),
Self::Mirrored => std::option::Option::Some("MIRRORED"),
Self::Stopped => std::option::Option::Some("STOPPED"),
Self::Transferring => std::option::Option::Some("TRANSFERRING"),
Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
Self::Aborted => std::option::Option::Some("ABORTED"),
Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MirrorState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MirrorState {
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 MirrorState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Preparing,
2 => Self::Mirrored,
3 => Self::Stopped,
4 => Self::Transferring,
5 => Self::BaselineTransferring,
6 => Self::Aborted,
7 => Self::ExternallyManaged,
8 => Self::PendingPeering,
_ => Self::UnknownValue(mirror_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MirrorState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
"PREPARING" => Self::Preparing,
"MIRRORED" => Self::Mirrored,
"STOPPED" => Self::Stopped,
"TRANSFERRING" => Self::Transferring,
"BASELINE_TRANSFERRING" => Self::BaselineTransferring,
"ABORTED" => Self::Aborted,
"EXTERNALLY_MANAGED" => Self::ExternallyManaged,
"PENDING_PEERING" => Self::PendingPeering,
_ => Self::UnknownValue(mirror_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MirrorState {
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::Preparing => serializer.serialize_i32(1),
Self::Mirrored => serializer.serialize_i32(2),
Self::Stopped => serializer.serialize_i32(3),
Self::Transferring => serializer.serialize_i32(4),
Self::BaselineTransferring => serializer.serialize_i32(5),
Self::Aborted => serializer.serialize_i32(6),
Self::ExternallyManaged => serializer.serialize_i32(7),
Self::PendingPeering => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MirrorState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
".google.cloud.netapp.v1.Replication.MirrorState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HybridReplicationType {
Unspecified,
Migration,
ContinuousReplication,
OnpremReplication,
ReverseOnpremReplication,
UnknownValue(hybrid_replication_type::UnknownValue),
}
#[doc(hidden)]
pub mod hybrid_replication_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl HybridReplicationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Migration => std::option::Option::Some(1),
Self::ContinuousReplication => std::option::Option::Some(2),
Self::OnpremReplication => std::option::Option::Some(3),
Self::ReverseOnpremReplication => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
}
Self::Migration => std::option::Option::Some("MIGRATION"),
Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
Self::ReverseOnpremReplication => {
std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for HybridReplicationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for HybridReplicationType {
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 HybridReplicationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Migration,
2 => Self::ContinuousReplication,
3 => Self::OnpremReplication,
4 => Self::ReverseOnpremReplication,
_ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for HybridReplicationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"MIGRATION" => Self::Migration,
"CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
"ONPREM_REPLICATION" => Self::OnpremReplication,
"REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
_ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for HybridReplicationType {
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::Migration => serializer.serialize_i32(1),
Self::ContinuousReplication => serializer.serialize_i32(2),
Self::OnpremReplication => serializer.serialize_i32(3),
Self::ReverseOnpremReplication => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
".google.cloud.netapp.v1.Replication.HybridReplicationType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HybridPeeringDetails {
pub subnet_ip: std::string::String,
pub command: std::string::String,
pub command_expiry_time: std::option::Option<wkt::Timestamp>,
pub passphrase: std::string::String,
pub peer_volume_name: std::string::String,
pub peer_cluster_name: std::string::String,
pub peer_svm_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HybridPeeringDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnet_ip = v.into();
self
}
pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.command = v.into();
self
}
pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.command_expiry_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.command_expiry_time = v.map(|x| x.into());
self
}
pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.passphrase = v.into();
self
}
pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_volume_name = v.into();
self
}
pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_cluster_name = v.into();
self
}
pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.peer_svm_name = v.into();
self
}
}
impl wkt::message::Message for HybridPeeringDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReplicationsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReplicationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = 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 ListReplicationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReplicationsResponse {
pub replications: std::vec::Vec<crate::model::Replication>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReplicationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_replications<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Replication>,
{
use std::iter::Iterator;
self.replications = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListReplicationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationsResponse {
type PageItem = crate::model::Replication;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.replications
}
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 GetReplicationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetReplicationRequest {
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 GetReplicationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DestinationVolumeParameters {
pub storage_pool: std::string::String,
pub volume_id: std::string::String,
pub share_name: std::string::String,
pub description: std::option::Option<std::string::String>,
pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DestinationVolumeParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.storage_pool = v.into();
self
}
pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.volume_id = v.into();
self
}
pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.share_name = v.into();
self
}
pub fn set_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = v.map(|x| x.into());
self
}
pub fn set_tiering_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TieringPolicy>,
{
self.tiering_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TieringPolicy>,
{
self.tiering_policy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DestinationVolumeParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateReplicationRequest {
pub parent: std::string::String,
pub replication: std::option::Option<crate::model::Replication>,
pub replication_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateReplicationRequest {
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_replication<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Replication>,
{
self.replication = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Replication>,
{
self.replication = v.map(|x| x.into());
self
}
pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.replication_id = v.into();
self
}
}
impl wkt::message::Message for CreateReplicationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteReplicationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteReplicationRequest {
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 DeleteReplicationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateReplicationRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub replication: std::option::Option<crate::model::Replication>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateReplicationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_replication<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Replication>,
{
self.replication = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Replication>,
{
self.replication = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateReplicationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StopReplicationRequest {
pub name: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StopReplicationRequest {
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_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for StopReplicationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResumeReplicationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResumeReplicationRequest {
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 ResumeReplicationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReverseReplicationDirectionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReverseReplicationDirectionRequest {
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 ReverseReplicationDirectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EstablishPeeringRequest {
pub name: std::string::String,
pub peer_cluster_name: std::string::String,
pub peer_svm_name: std::string::String,
pub peer_ip_addresses: std::vec::Vec<std::string::String>,
pub peer_volume_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EstablishPeeringRequest {
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_peer_cluster_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_cluster_name = v.into();
self
}
pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.peer_svm_name = v.into();
self
}
pub fn set_peer_ip_addresses<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.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_volume_name = v.into();
self
}
}
impl wkt::message::Message for EstablishPeeringRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SyncReplicationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SyncReplicationRequest {
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 SyncReplicationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSnapshotsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSnapshotsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListSnapshotsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSnapshotsResponse {
pub snapshots: std::vec::Vec<crate::model::Snapshot>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSnapshotsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_snapshots<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Snapshot>,
{
use std::iter::Iterator;
self.snapshots = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
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 ListSnapshotsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
type PageItem = crate::model::Snapshot;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.snapshots
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSnapshotRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSnapshotRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSnapshotRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSnapshotRequest {
pub parent: std::string::String,
pub snapshot: std::option::Option<crate::model::Snapshot>,
pub snapshot_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSnapshotRequest {
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_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Snapshot>,
{
self.snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Snapshot>,
{
self.snapshot = v.map(|x| x.into());
self
}
pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.snapshot_id = v.into();
self
}
}
impl wkt::message::Message for CreateSnapshotRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSnapshotRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSnapshotRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteSnapshotRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSnapshotRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub snapshot: std::option::Option<crate::model::Snapshot>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSnapshotRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Snapshot>,
{
self.snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Snapshot>,
{
self.snapshot = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSnapshotRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Snapshot {
pub name: std::string::String,
pub state: crate::model::snapshot::State,
pub state_details: std::string::String,
pub description: std::string::String,
pub used_bytes: f64,
pub create_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Snapshot {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_details = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.used_bytes = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for Snapshot {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.Snapshot"
}
}
pub mod snapshot {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Ready,
Creating,
Deleting,
Updating,
Disabled,
Error,
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::Ready => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Updating => std::option::Option::Some(4),
Self::Disabled => std::option::Option::Some(5),
Self::Error => std::option::Option::Some(6),
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::Ready => std::option::Option::Some("READY"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Error => std::option::Option::Some("ERROR"),
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::Ready,
2 => Self::Creating,
3 => Self::Deleting,
4 => Self::Updating,
5 => Self::Disabled,
6 => Self::Error,
_ => 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,
"READY" => Self::Ready,
"CREATING" => Self::Creating,
"DELETING" => Self::Deleting,
"UPDATING" => Self::Updating,
"DISABLED" => Self::Disabled,
"ERROR" => Self::Error,
_ => 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::Ready => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Updating => serializer.serialize_i32(4),
Self::Disabled => serializer.serialize_i32(5),
Self::Error => serializer.serialize_i32(6),
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.cloud.netapp.v1.Snapshot.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetStoragePoolRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetStoragePoolRequest {
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 GetStoragePoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListStoragePoolsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListStoragePoolsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = 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 ListStoragePoolsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListStoragePoolsResponse {
pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListStoragePoolsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::StoragePool>,
{
use std::iter::Iterator;
self.storage_pools = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListStoragePoolsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
type PageItem = crate::model::StoragePool;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.storage_pools
}
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 CreateStoragePoolRequest {
pub parent: std::string::String,
pub storage_pool_id: std::string::String,
pub storage_pool: std::option::Option<crate::model::StoragePool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateStoragePoolRequest {
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_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.storage_pool_id = v.into();
self
}
pub fn set_storage_pool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::StoragePool>,
{
self.storage_pool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::StoragePool>,
{
self.storage_pool = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateStoragePoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateStoragePoolRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub storage_pool: std::option::Option<crate::model::StoragePool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateStoragePoolRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_storage_pool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::StoragePool>,
{
self.storage_pool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::StoragePool>,
{
self.storage_pool = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateStoragePoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteStoragePoolRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteStoragePoolRequest {
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 DeleteStoragePoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SwitchActiveReplicaZoneRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SwitchActiveReplicaZoneRequest {
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 SwitchActiveReplicaZoneRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StoragePool {
pub name: std::string::String,
pub service_level: crate::model::ServiceLevel,
pub capacity_gib: i64,
pub volume_capacity_gib: i64,
pub volume_count: i32,
pub state: crate::model::storage_pool::State,
pub state_details: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub network: std::string::String,
pub active_directory: std::string::String,
pub kms_config: std::string::String,
pub ldap_enabled: bool,
pub psa_range: std::string::String,
pub encryption_type: crate::model::EncryptionType,
#[deprecated]
pub global_access_allowed: std::option::Option<bool>,
pub allow_auto_tiering: bool,
pub replica_zone: std::string::String,
pub zone: std::string::String,
pub satisfies_pzs: bool,
pub satisfies_pzi: bool,
pub custom_performance_enabled: bool,
pub total_throughput_mibps: i64,
pub total_iops: i64,
pub hot_tier_size_gib: i64,
pub enable_hot_tier_auto_resize: std::option::Option<bool>,
pub qos_type: crate::model::QosType,
pub available_throughput_mibps: f64,
pub cold_tier_size_used_gib: i64,
pub hot_tier_size_used_gib: i64,
pub r#type: std::option::Option<crate::model::StoragePoolType>,
pub mode: std::option::Option<crate::model::Mode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StoragePool {
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_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
mut self,
v: T,
) -> Self {
self.service_level = v.into();
self
}
pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.capacity_gib = v.into();
self
}
pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.volume_capacity_gib = v.into();
self
}
pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.volume_count = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_details = 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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.active_directory = v.into();
self
}
pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_config = v.into();
self
}
pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ldap_enabled = v.into();
self
}
pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.psa_range = v.into();
self
}
pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
mut self,
v: T,
) -> Self {
self.encryption_type = v.into();
self
}
#[deprecated]
pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.global_access_allowed = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.global_access_allowed = v.map(|x| x.into());
self
}
pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_auto_tiering = v.into();
self
}
pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.replica_zone = v.into();
self
}
pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone = v.into();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = v.into();
self
}
pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzi = v.into();
self
}
pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.custom_performance_enabled = v.into();
self
}
pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_throughput_mibps = v.into();
self
}
pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_iops = v.into();
self
}
pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.hot_tier_size_gib = v.into();
self
}
pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_hot_tier_auto_resize = v.map(|x| x.into());
self
}
pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
self.qos_type = v.into();
self
}
pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.available_throughput_mibps = v.into();
self
}
pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.cold_tier_size_used_gib = v.into();
self
}
pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.hot_tier_size_used_gib = v.into();
self
}
pub fn set_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::StoragePoolType>,
{
self.r#type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::StoragePoolType>,
{
self.r#type = v.map(|x| x.into());
self
}
pub fn set_mode<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Mode>,
{
self.mode = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Mode>,
{
self.mode = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for StoragePool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.StoragePool"
}
}
pub mod storage_pool {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Ready,
Creating,
Deleting,
Updating,
Restoring,
Disabled,
Error,
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::Ready => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Updating => std::option::Option::Some(4),
Self::Restoring => std::option::Option::Some(5),
Self::Disabled => std::option::Option::Some(6),
Self::Error => 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("STATE_UNSPECIFIED"),
Self::Ready => std::option::Option::Some("READY"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Restoring => std::option::Option::Some("RESTORING"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Error => std::option::Option::Some("ERROR"),
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::Ready,
2 => Self::Creating,
3 => Self::Deleting,
4 => Self::Updating,
5 => Self::Restoring,
6 => Self::Disabled,
7 => Self::Error,
_ => 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,
"READY" => Self::Ready,
"CREATING" => Self::Creating,
"DELETING" => Self::Deleting,
"UPDATING" => Self::Updating,
"RESTORING" => Self::Restoring,
"DISABLED" => Self::Disabled,
"ERROR" => Self::Error,
_ => 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::Ready => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Updating => serializer.serialize_i32(4),
Self::Restoring => serializer.serialize_i32(5),
Self::Disabled => serializer.serialize_i32(6),
Self::Error => serializer.serialize_i32(7),
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.cloud.netapp.v1.StoragePool.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValidateDirectoryServiceRequest {
pub name: std::string::String,
pub directory_service_type: crate::model::DirectoryServiceType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ValidateDirectoryServiceRequest {
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_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
mut self,
v: T,
) -> Self {
self.directory_service_type = v.into();
self
}
}
impl wkt::message::Message for ValidateDirectoryServiceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListVolumesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListVolumesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListVolumesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListVolumesResponse {
pub volumes: std::vec::Vec<crate::model::Volume>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListVolumesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_volumes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Volume>,
{
use std::iter::Iterator;
self.volumes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_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 ListVolumesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListVolumesResponse {
type PageItem = crate::model::Volume;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.volumes
}
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 GetVolumeRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetVolumeRequest {
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 GetVolumeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateVolumeRequest {
pub parent: std::string::String,
pub volume_id: std::string::String,
pub volume: std::option::Option<crate::model::Volume>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateVolumeRequest {
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_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.volume_id = v.into();
self
}
pub fn set_volume<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Volume>,
{
self.volume = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Volume>,
{
self.volume = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateVolumeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateVolumeRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub volume: std::option::Option<crate::model::Volume>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateVolumeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_volume<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Volume>,
{
self.volume = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Volume>,
{
self.volume = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateVolumeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteVolumeRequest {
pub name: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteVolumeRequest {
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_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteVolumeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RevertVolumeRequest {
pub name: std::string::String,
pub snapshot_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RevertVolumeRequest {
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_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.snapshot_id = v.into();
self
}
}
impl wkt::message::Message for RevertVolumeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Volume {
pub name: std::string::String,
pub state: crate::model::volume::State,
pub state_details: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub share_name: std::string::String,
pub psa_range: std::string::String,
pub storage_pool: std::string::String,
pub network: std::string::String,
pub service_level: crate::model::ServiceLevel,
pub capacity_gib: i64,
pub export_policy: std::option::Option<crate::model::ExportPolicy>,
pub protocols: std::vec::Vec<crate::model::Protocols>,
pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
pub mount_options: std::vec::Vec<crate::model::MountOption>,
pub unix_permissions: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
pub snap_reserve: f64,
pub snapshot_directory: bool,
pub used_gib: i64,
pub security_style: crate::model::SecurityStyle,
pub kerberos_enabled: bool,
pub ldap_enabled: bool,
pub active_directory: std::string::String,
pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
pub kms_config: std::string::String,
pub encryption_type: crate::model::EncryptionType,
pub has_replication: bool,
pub backup_config: std::option::Option<crate::model::BackupConfig>,
pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
pub large_capacity: bool,
pub multiple_endpoints: bool,
pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
pub replica_zone: std::string::String,
pub zone: std::string::String,
pub cold_tier_size_gib: i64,
pub hybrid_replication_parameters:
std::option::Option<crate::model::HybridReplicationParameters>,
pub throughput_mibps: f64,
pub cache_parameters: std::option::Option<crate::model::CacheParameters>,
pub hot_tier_size_used_gib: i64,
pub block_devices: std::vec::Vec<crate::model::BlockDevice>,
pub clone_details: std::option::Option<crate::model::volume::CloneDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Volume {
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_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_details = 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_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.share_name = v.into();
self
}
pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.psa_range = v.into();
self
}
pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.storage_pool = v.into();
self
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
mut self,
v: T,
) -> Self {
self.service_level = v.into();
self
}
pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.capacity_gib = v.into();
self
}
pub fn set_export_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExportPolicy>,
{
self.export_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExportPolicy>,
{
self.export_policy = v.map(|x| x.into());
self
}
pub fn set_protocols<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Protocols>,
{
use std::iter::Iterator;
self.protocols = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SMBSettings>,
{
use std::iter::Iterator;
self.smb_settings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_mount_options<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MountOption>,
{
use std::iter::Iterator;
self.mount_options = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.unix_permissions = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SnapshotPolicy>,
{
self.snapshot_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SnapshotPolicy>,
{
self.snapshot_policy = v.map(|x| x.into());
self
}
pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.snap_reserve = v.into();
self
}
pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.snapshot_directory = v.into();
self
}
pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.used_gib = v.into();
self
}
pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
mut self,
v: T,
) -> Self {
self.security_style = v.into();
self
}
pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.kerberos_enabled = v.into();
self
}
pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ldap_enabled = v.into();
self
}
pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.active_directory = v.into();
self
}
pub fn set_restore_parameters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RestoreParameters>,
{
self.restore_parameters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RestoreParameters>,
{
self.restore_parameters = v.map(|x| x.into());
self
}
pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_config = v.into();
self
}
pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
mut self,
v: T,
) -> Self {
self.encryption_type = v.into();
self
}
pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.has_replication = v.into();
self
}
pub fn set_backup_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupConfig>,
{
self.backup_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupConfig>,
{
self.backup_config = v.map(|x| x.into());
self
}
pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RestrictedAction>,
{
use std::iter::Iterator;
self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.large_capacity = v.into();
self
}
pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.multiple_endpoints = v.into();
self
}
pub fn set_tiering_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TieringPolicy>,
{
self.tiering_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TieringPolicy>,
{
self.tiering_policy = v.map(|x| x.into());
self
}
pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.replica_zone = v.into();
self
}
pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone = v.into();
self
}
pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.cold_tier_size_gib = v.into();
self
}
pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::HybridReplicationParameters>,
{
self.hybrid_replication_parameters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hybrid_replication_parameters<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::HybridReplicationParameters>,
{
self.hybrid_replication_parameters = v.map(|x| x.into());
self
}
pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.throughput_mibps = v.into();
self
}
pub fn set_cache_parameters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CacheParameters>,
{
self.cache_parameters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cache_parameters<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CacheParameters>,
{
self.cache_parameters = v.map(|x| x.into());
self
}
pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.hot_tier_size_used_gib = v.into();
self
}
pub fn set_block_devices<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BlockDevice>,
{
use std::iter::Iterator;
self.block_devices = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_clone_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::volume::CloneDetails>,
{
self.clone_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_clone_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::volume::CloneDetails>,
{
self.clone_details = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Volume {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.Volume"
}
}
pub mod volume {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloneDetails {
pub source_snapshot: std::string::String,
pub source_volume: std::string::String,
pub shared_space_gib: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloneDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_snapshot = v.into();
self
}
pub fn set_source_volume<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_volume = v.into();
self
}
pub fn set_shared_space_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.shared_space_gib = v.into();
self
}
}
impl wkt::message::Message for CloneDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.Volume.CloneDetails"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Ready,
Creating,
Deleting,
Updating,
Restoring,
Disabled,
Error,
Preparing,
ReadOnly,
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::Ready => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Updating => std::option::Option::Some(4),
Self::Restoring => std::option::Option::Some(5),
Self::Disabled => std::option::Option::Some(6),
Self::Error => std::option::Option::Some(7),
Self::Preparing => std::option::Option::Some(8),
Self::ReadOnly => std::option::Option::Some(9),
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::Ready => std::option::Option::Some("READY"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Restoring => std::option::Option::Some("RESTORING"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Preparing => std::option::Option::Some("PREPARING"),
Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
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::Ready,
2 => Self::Creating,
3 => Self::Deleting,
4 => Self::Updating,
5 => Self::Restoring,
6 => Self::Disabled,
7 => Self::Error,
8 => Self::Preparing,
9 => Self::ReadOnly,
_ => 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,
"READY" => Self::Ready,
"CREATING" => Self::Creating,
"DELETING" => Self::Deleting,
"UPDATING" => Self::Updating,
"RESTORING" => Self::Restoring,
"DISABLED" => Self::Disabled,
"ERROR" => Self::Error,
"PREPARING" => Self::Preparing,
"READ_ONLY" => Self::ReadOnly,
_ => 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::Ready => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Updating => serializer.serialize_i32(4),
Self::Restoring => serializer.serialize_i32(5),
Self::Disabled => serializer.serialize_i32(6),
Self::Error => serializer.serialize_i32(7),
Self::Preparing => serializer.serialize_i32(8),
Self::ReadOnly => serializer.serialize_i32(9),
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.cloud.netapp.v1.Volume.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportPolicy {
pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ExportPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SimpleExportPolicyRule {
pub allowed_clients: std::option::Option<std::string::String>,
pub has_root_access: std::option::Option<std::string::String>,
pub access_type: std::option::Option<crate::model::AccessType>,
pub nfsv3: std::option::Option<bool>,
pub nfsv4: std::option::Option<bool>,
pub kerberos_5_read_only: std::option::Option<bool>,
pub kerberos_5_read_write: std::option::Option<bool>,
pub kerberos_5i_read_only: std::option::Option<bool>,
pub kerberos_5i_read_write: std::option::Option<bool>,
pub kerberos_5p_read_only: std::option::Option<bool>,
pub kerberos_5p_read_write: std::option::Option<bool>,
pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
pub anon_uid: std::option::Option<i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SimpleExportPolicyRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allowed_clients<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.allowed_clients = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.allowed_clients = v.map(|x| x.into());
self
}
pub fn set_has_root_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.has_root_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.has_root_access = v.map(|x| x.into());
self
}
pub fn set_access_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AccessType>,
{
self.access_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AccessType>,
{
self.access_type = v.map(|x| x.into());
self
}
pub fn set_nfsv3<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.nfsv3 = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.nfsv3 = v.map(|x| x.into());
self
}
pub fn set_nfsv4<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.nfsv4 = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.nfsv4 = v.map(|x| x.into());
self
}
pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5_read_only = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5_read_only = v.map(|x| x.into());
self
}
pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5_read_write = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5_read_write = v.map(|x| x.into());
self
}
pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5i_read_only = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5i_read_only = v.map(|x| x.into());
self
}
pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5i_read_write = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5i_read_write = v.map(|x| x.into());
self
}
pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5p_read_only = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5p_read_only = v.map(|x| x.into());
self
}
pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5p_read_write = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.kerberos_5p_read_write = v.map(|x| x.into());
self
}
pub fn set_squash_mode<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
{
self.squash_mode = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
{
self.squash_mode = v.map(|x| x.into());
self
}
pub fn set_anon_uid<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.anon_uid = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.anon_uid = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SimpleExportPolicyRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
}
}
pub mod simple_export_policy_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SquashMode {
Unspecified,
NoRootSquash,
RootSquash,
AllSquash,
UnknownValue(squash_mode::UnknownValue),
}
#[doc(hidden)]
pub mod squash_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SquashMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NoRootSquash => std::option::Option::Some(1),
Self::RootSquash => std::option::Option::Some(2),
Self::AllSquash => 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("SQUASH_MODE_UNSPECIFIED"),
Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SquashMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SquashMode {
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 SquashMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NoRootSquash,
2 => Self::RootSquash,
3 => Self::AllSquash,
_ => Self::UnknownValue(squash_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SquashMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
"NO_ROOT_SQUASH" => Self::NoRootSquash,
"ROOT_SQUASH" => Self::RootSquash,
"ALL_SQUASH" => Self::AllSquash,
_ => Self::UnknownValue(squash_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SquashMode {
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::NoRootSquash => serializer.serialize_i32(1),
Self::RootSquash => serializer.serialize_i32(2),
Self::AllSquash => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SquashMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SnapshotPolicy {
pub enabled: std::option::Option<bool>,
pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SnapshotPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enabled = v.map(|x| x.into());
self
}
pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::HourlySchedule>,
{
self.hourly_schedule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::HourlySchedule>,
{
self.hourly_schedule = v.map(|x| x.into());
self
}
pub fn set_daily_schedule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DailySchedule>,
{
self.daily_schedule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DailySchedule>,
{
self.daily_schedule = v.map(|x| x.into());
self
}
pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WeeklySchedule>,
{
self.weekly_schedule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WeeklySchedule>,
{
self.weekly_schedule = v.map(|x| x.into());
self
}
pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MonthlySchedule>,
{
self.monthly_schedule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MonthlySchedule>,
{
self.monthly_schedule = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SnapshotPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HourlySchedule {
pub snapshots_to_keep: std::option::Option<f64>,
pub minute: std::option::Option<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HourlySchedule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.snapshots_to_keep = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.snapshots_to_keep = v.map(|x| x.into());
self
}
pub fn set_minute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.minute = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.minute = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for HourlySchedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DailySchedule {
pub snapshots_to_keep: std::option::Option<f64>,
pub minute: std::option::Option<f64>,
pub hour: std::option::Option<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DailySchedule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.snapshots_to_keep = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.snapshots_to_keep = v.map(|x| x.into());
self
}
pub fn set_minute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.minute = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.minute = v.map(|x| x.into());
self
}
pub fn set_hour<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.hour = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.hour = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DailySchedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WeeklySchedule {
pub snapshots_to_keep: std::option::Option<f64>,
pub minute: std::option::Option<f64>,
pub hour: std::option::Option<f64>,
pub day: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WeeklySchedule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.snapshots_to_keep = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.snapshots_to_keep = v.map(|x| x.into());
self
}
pub fn set_minute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.minute = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.minute = v.map(|x| x.into());
self
}
pub fn set_hour<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.hour = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.hour = v.map(|x| x.into());
self
}
pub fn set_day<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.day = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.day = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for WeeklySchedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MonthlySchedule {
pub snapshots_to_keep: std::option::Option<f64>,
pub minute: std::option::Option<f64>,
pub hour: std::option::Option<f64>,
pub days_of_month: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MonthlySchedule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.snapshots_to_keep = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.snapshots_to_keep = v.map(|x| x.into());
self
}
pub fn set_minute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.minute = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.minute = v.map(|x| x.into());
self
}
pub fn set_hour<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.hour = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.hour = v.map(|x| x.into());
self
}
pub fn set_days_of_month<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.days_of_month = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.days_of_month = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MonthlySchedule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MountOption {
pub export: std::string::String,
pub export_full: std::string::String,
pub protocol: crate::model::Protocols,
pub instructions: std::string::String,
pub ip_address: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MountOption {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.export = v.into();
self
}
pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.export_full = v.into();
self
}
pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
self.protocol = v.into();
self
}
pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instructions = v.into();
self
}
pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip_address = v.into();
self
}
}
impl wkt::message::Message for MountOption {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.MountOption"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreParameters {
pub source: std::option::Option<crate::model::restore_parameters::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::restore_parameters::Source::SourceSnapshot(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = std::option::Option::Some(
crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
);
self
}
pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::restore_parameters::Source::SourceBackup(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = std::option::Option::Some(
crate::model::restore_parameters::Source::SourceBackup(v.into()),
);
self
}
}
impl wkt::message::Message for RestoreParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
}
}
pub mod restore_parameters {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
SourceSnapshot(std::string::String),
SourceBackup(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupConfig {
pub backup_policies: std::vec::Vec<std::string::String>,
pub backup_vault: std::string::String,
pub scheduled_backup_enabled: std::option::Option<bool>,
pub backup_chain_bytes: std::option::Option<i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_policies<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.backup_policies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_vault = v.into();
self
}
pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.scheduled_backup_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.scheduled_backup_enabled = v.map(|x| x.into());
self
}
pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.backup_chain_bytes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.backup_chain_bytes = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BackupConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TieringPolicy {
pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
pub cooling_threshold_days: std::option::Option<i32>,
pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TieringPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tier_action<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::tiering_policy::TierAction>,
{
self.tier_action = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::tiering_policy::TierAction>,
{
self.tier_action = v.map(|x| x.into());
self
}
pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.cooling_threshold_days = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.cooling_threshold_days = v.map(|x| x.into());
self
}
pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TieringPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
}
}
pub mod tiering_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TierAction {
Unspecified,
Enabled,
Paused,
UnknownValue(tier_action::UnknownValue),
}
#[doc(hidden)]
pub mod tier_action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TierAction {
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::Paused => 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("TIER_ACTION_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Paused => std::option::Option::Some("PAUSED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TierAction {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TierAction {
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 TierAction {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Paused,
_ => Self::UnknownValue(tier_action::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TierAction {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"PAUSED" => Self::Paused,
_ => Self::UnknownValue(tier_action::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TierAction {
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::Paused => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TierAction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
".google.cloud.netapp.v1.TieringPolicy.TierAction",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HybridReplicationParameters {
pub replication: std::string::String,
pub peer_volume_name: std::string::String,
pub peer_cluster_name: std::string::String,
pub peer_svm_name: std::string::String,
pub peer_ip_addresses: std::vec::Vec<std::string::String>,
pub cluster_location: std::string::String,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub replication_schedule: crate::model::HybridReplicationSchedule,
pub hybrid_replication_type:
crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
pub large_volume_constituent_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HybridReplicationParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.replication = v.into();
self
}
pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_volume_name = v.into();
self
}
pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_cluster_name = v.into();
self
}
pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.peer_svm_name = v.into();
self
}
pub fn set_peer_ip_addresses<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.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cluster_location = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_replication_schedule<
T: std::convert::Into<crate::model::HybridReplicationSchedule>,
>(
mut self,
v: T,
) -> Self {
self.replication_schedule = v.into();
self
}
pub fn set_hybrid_replication_type<
T: std::convert::Into<
crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
>,
>(
mut self,
v: T,
) -> Self {
self.hybrid_replication_type = v.into();
self
}
pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.large_volume_constituent_count = v.into();
self
}
}
impl wkt::message::Message for HybridReplicationParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
}
}
pub mod hybrid_replication_parameters {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VolumeHybridReplicationType {
Unspecified,
Migration,
ContinuousReplication,
OnpremReplication,
ReverseOnpremReplication,
UnknownValue(volume_hybrid_replication_type::UnknownValue),
}
#[doc(hidden)]
pub mod volume_hybrid_replication_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VolumeHybridReplicationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Migration => std::option::Option::Some(1),
Self::ContinuousReplication => std::option::Option::Some(2),
Self::OnpremReplication => std::option::Option::Some(3),
Self::ReverseOnpremReplication => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
}
Self::Migration => std::option::Option::Some("MIGRATION"),
Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
Self::ReverseOnpremReplication => {
std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VolumeHybridReplicationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VolumeHybridReplicationType {
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 VolumeHybridReplicationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Migration,
2 => Self::ContinuousReplication,
3 => Self::OnpremReplication,
4 => Self::ReverseOnpremReplication,
_ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VolumeHybridReplicationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"MIGRATION" => Self::Migration,
"CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
"ONPREM_REPLICATION" => Self::OnpremReplication,
"REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
_ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VolumeHybridReplicationType {
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::Migration => serializer.serialize_i32(1),
Self::ContinuousReplication => serializer.serialize_i32(2),
Self::OnpremReplication => serializer.serialize_i32(3),
Self::ReverseOnpremReplication => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CacheParameters {
pub peer_volume_name: std::string::String,
pub peer_cluster_name: std::string::String,
pub peer_svm_name: std::string::String,
pub peer_ip_addresses: std::vec::Vec<std::string::String>,
pub enable_global_file_lock: std::option::Option<bool>,
pub cache_config: std::option::Option<crate::model::CacheConfig>,
pub cache_state: crate::model::cache_parameters::CacheState,
pub command: std::string::String,
pub peering_command_expiry_time: std::option::Option<wkt::Timestamp>,
pub passphrase: std::string::String,
pub state_details: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CacheParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_volume_name = v.into();
self
}
pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_cluster_name = v.into();
self
}
pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.peer_svm_name = v.into();
self
}
pub fn set_peer_ip_addresses<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.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_enable_global_file_lock<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_global_file_lock = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_global_file_lock<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_global_file_lock = v.map(|x| x.into());
self
}
pub fn set_cache_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CacheConfig>,
{
self.cache_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CacheConfig>,
{
self.cache_config = v.map(|x| x.into());
self
}
pub fn set_cache_state<T: std::convert::Into<crate::model::cache_parameters::CacheState>>(
mut self,
v: T,
) -> Self {
self.cache_state = v.into();
self
}
pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.command = v.into();
self
}
pub fn set_peering_command_expiry_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.peering_command_expiry_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_peering_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.peering_command_expiry_time = v.map(|x| x.into());
self
}
pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.passphrase = v.into();
self
}
pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_details = v.into();
self
}
}
impl wkt::message::Message for CacheParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CacheParameters"
}
}
pub mod cache_parameters {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CacheState {
Unspecified,
PendingClusterPeering,
PendingSvmPeering,
Peered,
Error,
UnknownValue(cache_state::UnknownValue),
}
#[doc(hidden)]
pub mod cache_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CacheState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PendingClusterPeering => std::option::Option::Some(1),
Self::PendingSvmPeering => std::option::Option::Some(2),
Self::Peered => std::option::Option::Some(3),
Self::Error => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CACHE_STATE_UNSPECIFIED"),
Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
Self::Peered => std::option::Option::Some("PEERED"),
Self::Error => std::option::Option::Some("ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CacheState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CacheState {
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 CacheState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PendingClusterPeering,
2 => Self::PendingSvmPeering,
3 => Self::Peered,
4 => Self::Error,
_ => Self::UnknownValue(cache_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CacheState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CACHE_STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
"PENDING_SVM_PEERING" => Self::PendingSvmPeering,
"PEERED" => Self::Peered,
"ERROR" => Self::Error,
_ => Self::UnknownValue(cache_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CacheState {
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::PendingClusterPeering => serializer.serialize_i32(1),
Self::PendingSvmPeering => serializer.serialize_i32(2),
Self::Peered => serializer.serialize_i32(3),
Self::Error => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CacheState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CacheState>::new(
".google.cloud.netapp.v1.CacheParameters.CacheState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CacheConfig {
pub cache_pre_populate: std::option::Option<crate::model::CachePrePopulate>,
pub writeback_enabled: std::option::Option<bool>,
pub cifs_change_notify_enabled: std::option::Option<bool>,
pub cache_pre_populate_state: crate::model::cache_config::CachePrePopulateState,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CacheConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cache_pre_populate<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CachePrePopulate>,
{
self.cache_pre_populate = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cache_pre_populate<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CachePrePopulate>,
{
self.cache_pre_populate = v.map(|x| x.into());
self
}
pub fn set_writeback_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.writeback_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_writeback_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.writeback_enabled = v.map(|x| x.into());
self
}
pub fn set_cifs_change_notify_enabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.cifs_change_notify_enabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cifs_change_notify_enabled<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.cifs_change_notify_enabled = v.map(|x| x.into());
self
}
pub fn set_cache_pre_populate_state<
T: std::convert::Into<crate::model::cache_config::CachePrePopulateState>,
>(
mut self,
v: T,
) -> Self {
self.cache_pre_populate_state = v.into();
self
}
}
impl wkt::message::Message for CacheConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CacheConfig"
}
}
pub mod cache_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CachePrePopulateState {
Unspecified,
NotNeeded,
InProgress,
Complete,
Error,
UnknownValue(cache_pre_populate_state::UnknownValue),
}
#[doc(hidden)]
pub mod cache_pre_populate_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CachePrePopulateState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NotNeeded => std::option::Option::Some(1),
Self::InProgress => std::option::Option::Some(2),
Self::Complete => std::option::Option::Some(3),
Self::Error => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("CACHE_PRE_POPULATE_STATE_UNSPECIFIED")
}
Self::NotNeeded => std::option::Option::Some("NOT_NEEDED"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::Complete => std::option::Option::Some("COMPLETE"),
Self::Error => std::option::Option::Some("ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CachePrePopulateState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CachePrePopulateState {
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 CachePrePopulateState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NotNeeded,
2 => Self::InProgress,
3 => Self::Complete,
4 => Self::Error,
_ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CachePrePopulateState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CACHE_PRE_POPULATE_STATE_UNSPECIFIED" => Self::Unspecified,
"NOT_NEEDED" => Self::NotNeeded,
"IN_PROGRESS" => Self::InProgress,
"COMPLETE" => Self::Complete,
"ERROR" => Self::Error,
_ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CachePrePopulateState {
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::NotNeeded => serializer.serialize_i32(1),
Self::InProgress => serializer.serialize_i32(2),
Self::Complete => serializer.serialize_i32(3),
Self::Error => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CachePrePopulateState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CachePrePopulateState>::new(
".google.cloud.netapp.v1.CacheConfig.CachePrePopulateState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CachePrePopulate {
pub path_list: std::vec::Vec<std::string::String>,
pub exclude_path_list: std::vec::Vec<std::string::String>,
pub recursion: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CachePrePopulate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_path_list<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.path_list = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_exclude_path_list<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.exclude_path_list = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_recursion<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.recursion = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_recursion<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.recursion = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CachePrePopulate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.CachePrePopulate"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BlockDevice {
pub name: std::option::Option<std::string::String>,
pub host_groups: std::vec::Vec<std::string::String>,
pub identifier: std::string::String,
pub size_gib: std::option::Option<i64>,
pub os_type: crate::model::OsType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BlockDevice {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = v.map(|x| x.into());
self
}
pub fn set_host_groups<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.host_groups = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_identifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.identifier = v.into();
self
}
pub fn set_size_gib<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.size_gib = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_size_gib<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.size_gib = v.map(|x| x.into());
self
}
pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
self.os_type = v.into();
self
}
}
impl wkt::message::Message for BlockDevice {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.BlockDevice"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreBackupFilesRequest {
pub name: std::string::String,
pub backup: std::string::String,
pub file_list: std::vec::Vec<std::string::String>,
pub restore_destination_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreBackupFilesRequest {
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_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup = v.into();
self
}
pub fn set_file_list<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.file_list = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_restore_destination_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.restore_destination_path = v.into();
self
}
}
impl wkt::message::Message for RestoreBackupFilesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreBackupFilesResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RestoreBackupFilesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for RestoreBackupFilesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EstablishVolumePeeringRequest {
pub name: std::string::String,
pub peer_cluster_name: std::string::String,
pub peer_svm_name: std::string::String,
pub peer_ip_addresses: std::vec::Vec<std::string::String>,
pub peer_volume_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EstablishVolumePeeringRequest {
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_peer_cluster_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_cluster_name = v.into();
self
}
pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.peer_svm_name = v.into();
self
}
pub fn set_peer_ip_addresses<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.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.peer_volume_name = v.into();
self
}
}
impl wkt::message::Message for EstablishVolumePeeringRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.netapp.v1.EstablishVolumePeeringRequest"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ServiceLevel {
Unspecified,
Premium,
Extreme,
Standard,
Flex,
UnknownValue(service_level::UnknownValue),
}
#[doc(hidden)]
pub mod service_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ServiceLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Premium => std::option::Option::Some(1),
Self::Extreme => std::option::Option::Some(2),
Self::Standard => std::option::Option::Some(3),
Self::Flex => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
Self::Premium => std::option::Option::Some("PREMIUM"),
Self::Extreme => std::option::Option::Some("EXTREME"),
Self::Standard => std::option::Option::Some("STANDARD"),
Self::Flex => std::option::Option::Some("FLEX"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ServiceLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ServiceLevel {
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 ServiceLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Premium,
2 => Self::Extreme,
3 => Self::Standard,
4 => Self::Flex,
_ => Self::UnknownValue(service_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ServiceLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
"PREMIUM" => Self::Premium,
"EXTREME" => Self::Extreme,
"STANDARD" => Self::Standard,
"FLEX" => Self::Flex,
_ => Self::UnknownValue(service_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ServiceLevel {
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::Premium => serializer.serialize_i32(1),
Self::Extreme => serializer.serialize_i32(2),
Self::Standard => serializer.serialize_i32(3),
Self::Flex => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
".google.cloud.netapp.v1.ServiceLevel",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FlexPerformance {
Unspecified,
Default,
Custom,
UnknownValue(flex_performance::UnknownValue),
}
#[doc(hidden)]
pub mod flex_performance {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FlexPerformance {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Default => std::option::Option::Some(1),
Self::Custom => 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("FLEX_PERFORMANCE_UNSPECIFIED"),
Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FlexPerformance {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FlexPerformance {
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 FlexPerformance {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Default,
2 => Self::Custom,
_ => Self::UnknownValue(flex_performance::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FlexPerformance {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
"FLEX_PERFORMANCE_DEFAULT" => Self::Default,
"FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
_ => Self::UnknownValue(flex_performance::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FlexPerformance {
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::Default => serializer.serialize_i32(1),
Self::Custom => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
".google.cloud.netapp.v1.FlexPerformance",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EncryptionType {
Unspecified,
ServiceManaged,
CloudKms,
UnknownValue(encryption_type::UnknownValue),
}
#[doc(hidden)]
pub mod encryption_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EncryptionType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ServiceManaged => std::option::Option::Some(1),
Self::CloudKms => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EncryptionType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EncryptionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EncryptionType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ServiceManaged,
2 => Self::CloudKms,
_ => Self::UnknownValue(encryption_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EncryptionType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
"SERVICE_MANAGED" => Self::ServiceManaged,
"CLOUD_KMS" => Self::CloudKms,
_ => Self::UnknownValue(encryption_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EncryptionType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ServiceManaged => serializer.serialize_i32(1),
Self::CloudKms => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EncryptionType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
".google.cloud.netapp.v1.EncryptionType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DirectoryServiceType {
Unspecified,
ActiveDirectory,
UnknownValue(directory_service_type::UnknownValue),
}
#[doc(hidden)]
pub mod directory_service_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DirectoryServiceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ActiveDirectory => 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("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DirectoryServiceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DirectoryServiceType {
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 DirectoryServiceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ActiveDirectory,
_ => Self::UnknownValue(directory_service_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DirectoryServiceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE_DIRECTORY" => Self::ActiveDirectory,
_ => Self::UnknownValue(directory_service_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DirectoryServiceType {
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::ActiveDirectory => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
".google.cloud.netapp.v1.DirectoryServiceType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StoragePoolType {
Unspecified,
File,
Unified,
UnknownValue(storage_pool_type::UnknownValue),
}
#[doc(hidden)]
pub mod storage_pool_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl StoragePoolType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::File => std::option::Option::Some(1),
Self::Unified => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STORAGE_POOL_TYPE_UNSPECIFIED"),
Self::File => std::option::Option::Some("FILE"),
Self::Unified => std::option::Option::Some("UNIFIED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for StoragePoolType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for StoragePoolType {
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 StoragePoolType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::File,
2 => Self::Unified,
_ => Self::UnknownValue(storage_pool_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for StoragePoolType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STORAGE_POOL_TYPE_UNSPECIFIED" => Self::Unspecified,
"FILE" => Self::File,
"UNIFIED" => Self::Unified,
_ => Self::UnknownValue(storage_pool_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for StoragePoolType {
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::File => serializer.serialize_i32(1),
Self::Unified => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for StoragePoolType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoragePoolType>::new(
".google.cloud.netapp.v1.StoragePoolType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HybridReplicationSchedule {
Unspecified,
Every10Minutes,
Hourly,
Daily,
UnknownValue(hybrid_replication_schedule::UnknownValue),
}
#[doc(hidden)]
pub mod hybrid_replication_schedule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl HybridReplicationSchedule {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Every10Minutes => std::option::Option::Some(1),
Self::Hourly => std::option::Option::Some(2),
Self::Daily => 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("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
}
Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
Self::Hourly => std::option::Option::Some("HOURLY"),
Self::Daily => std::option::Option::Some("DAILY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for HybridReplicationSchedule {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for HybridReplicationSchedule {
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 HybridReplicationSchedule {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Every10Minutes,
2 => Self::Hourly,
3 => Self::Daily,
_ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for HybridReplicationSchedule {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
"EVERY_10_MINUTES" => Self::Every10Minutes,
"HOURLY" => Self::Hourly,
"DAILY" => Self::Daily,
_ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for HybridReplicationSchedule {
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::Every10Minutes => serializer.serialize_i32(1),
Self::Hourly => serializer.serialize_i32(2),
Self::Daily => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
".google.cloud.netapp.v1.HybridReplicationSchedule",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum QosType {
Unspecified,
Auto,
Manual,
UnknownValue(qos_type::UnknownValue),
}
#[doc(hidden)]
pub mod qos_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl QosType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Auto => std::option::Option::Some(1),
Self::Manual => 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("QOS_TYPE_UNSPECIFIED"),
Self::Auto => std::option::Option::Some("AUTO"),
Self::Manual => std::option::Option::Some("MANUAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for QosType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for QosType {
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 QosType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Auto,
2 => Self::Manual,
_ => Self::UnknownValue(qos_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for QosType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
"AUTO" => Self::Auto,
"MANUAL" => Self::Manual,
_ => Self::UnknownValue(qos_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for QosType {
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::Auto => serializer.serialize_i32(1),
Self::Manual => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for QosType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
".google.cloud.netapp.v1.QosType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OsType {
Unspecified,
Linux,
Windows,
Esxi,
UnknownValue(os_type::UnknownValue),
}
#[doc(hidden)]
pub mod os_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OsType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Linux => std::option::Option::Some(1),
Self::Windows => std::option::Option::Some(2),
Self::Esxi => 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("OS_TYPE_UNSPECIFIED"),
Self::Linux => std::option::Option::Some("LINUX"),
Self::Windows => std::option::Option::Some("WINDOWS"),
Self::Esxi => std::option::Option::Some("ESXI"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OsType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OsType {
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 OsType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Linux,
2 => Self::Windows,
3 => Self::Esxi,
_ => Self::UnknownValue(os_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OsType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OS_TYPE_UNSPECIFIED" => Self::Unspecified,
"LINUX" => Self::Linux,
"WINDOWS" => Self::Windows,
"ESXI" => Self::Esxi,
_ => Self::UnknownValue(os_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OsType {
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::Linux => serializer.serialize_i32(1),
Self::Windows => serializer.serialize_i32(2),
Self::Esxi => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OsType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsType>::new(
".google.cloud.netapp.v1.OsType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mode {
Unspecified,
Default,
Ontap,
UnknownValue(mode::UnknownValue),
}
#[doc(hidden)]
pub mod mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Mode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Default => std::option::Option::Some(1),
Self::Ontap => 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("MODE_UNSPECIFIED"),
Self::Default => std::option::Option::Some("DEFAULT"),
Self::Ontap => std::option::Option::Some("ONTAP"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Mode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Mode {
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 Mode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Default,
2 => Self::Ontap,
_ => Self::UnknownValue(mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Mode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MODE_UNSPECIFIED" => Self::Unspecified,
"DEFAULT" => Self::Default,
"ONTAP" => Self::Ontap,
_ => Self::UnknownValue(mode::UnknownValue(wkt::internal::UnknownEnumValue::String(
value.to_string(),
))),
}
}
}
impl serde::ser::Serialize for Mode {
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::Default => serializer.serialize_i32(1),
Self::Ontap => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Mode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
".google.cloud.netapp.v1.Mode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Protocols {
Unspecified,
Nfsv3,
Nfsv4,
Smb,
Iscsi,
UnknownValue(protocols::UnknownValue),
}
#[doc(hidden)]
pub mod protocols {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Protocols {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Nfsv3 => std::option::Option::Some(1),
Self::Nfsv4 => std::option::Option::Some(2),
Self::Smb => std::option::Option::Some(3),
Self::Iscsi => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
Self::Nfsv3 => std::option::Option::Some("NFSV3"),
Self::Nfsv4 => std::option::Option::Some("NFSV4"),
Self::Smb => std::option::Option::Some("SMB"),
Self::Iscsi => std::option::Option::Some("ISCSI"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Protocols {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Protocols {
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 Protocols {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Nfsv3,
2 => Self::Nfsv4,
3 => Self::Smb,
4 => Self::Iscsi,
_ => Self::UnknownValue(protocols::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Protocols {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
"NFSV3" => Self::Nfsv3,
"NFSV4" => Self::Nfsv4,
"SMB" => Self::Smb,
"ISCSI" => Self::Iscsi,
_ => Self::UnknownValue(protocols::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Protocols {
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::Nfsv3 => serializer.serialize_i32(1),
Self::Nfsv4 => serializer.serialize_i32(2),
Self::Smb => serializer.serialize_i32(3),
Self::Iscsi => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Protocols {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
".google.cloud.netapp.v1.Protocols",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AccessType {
Unspecified,
ReadOnly,
ReadWrite,
ReadNone,
UnknownValue(access_type::UnknownValue),
}
#[doc(hidden)]
pub mod access_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AccessType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ReadOnly => std::option::Option::Some(1),
Self::ReadWrite => std::option::Option::Some(2),
Self::ReadNone => 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("ACCESS_TYPE_UNSPECIFIED"),
Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
Self::ReadNone => std::option::Option::Some("READ_NONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AccessType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AccessType {
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 AccessType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ReadOnly,
2 => Self::ReadWrite,
3 => Self::ReadNone,
_ => Self::UnknownValue(access_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AccessType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
"READ_ONLY" => Self::ReadOnly,
"READ_WRITE" => Self::ReadWrite,
"READ_NONE" => Self::ReadNone,
_ => Self::UnknownValue(access_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AccessType {
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::ReadOnly => serializer.serialize_i32(1),
Self::ReadWrite => serializer.serialize_i32(2),
Self::ReadNone => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AccessType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
".google.cloud.netapp.v1.AccessType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SMBSettings {
Unspecified,
EncryptData,
Browsable,
ChangeNotify,
NonBrowsable,
Oplocks,
ShowSnapshot,
ShowPreviousVersions,
AccessBasedEnumeration,
ContinuouslyAvailable,
UnknownValue(smb_settings::UnknownValue),
}
#[doc(hidden)]
pub mod smb_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SMBSettings {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::EncryptData => std::option::Option::Some(1),
Self::Browsable => std::option::Option::Some(2),
Self::ChangeNotify => std::option::Option::Some(3),
Self::NonBrowsable => std::option::Option::Some(4),
Self::Oplocks => std::option::Option::Some(5),
Self::ShowSnapshot => std::option::Option::Some(6),
Self::ShowPreviousVersions => std::option::Option::Some(7),
Self::AccessBasedEnumeration => std::option::Option::Some(8),
Self::ContinuouslyAvailable => std::option::Option::Some(9),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
Self::Browsable => std::option::Option::Some("BROWSABLE"),
Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
Self::Oplocks => std::option::Option::Some("OPLOCKS"),
Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SMBSettings {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SMBSettings {
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 SMBSettings {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::EncryptData,
2 => Self::Browsable,
3 => Self::ChangeNotify,
4 => Self::NonBrowsable,
5 => Self::Oplocks,
6 => Self::ShowSnapshot,
7 => Self::ShowPreviousVersions,
8 => Self::AccessBasedEnumeration,
9 => Self::ContinuouslyAvailable,
_ => Self::UnknownValue(smb_settings::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SMBSettings {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
"ENCRYPT_DATA" => Self::EncryptData,
"BROWSABLE" => Self::Browsable,
"CHANGE_NOTIFY" => Self::ChangeNotify,
"NON_BROWSABLE" => Self::NonBrowsable,
"OPLOCKS" => Self::Oplocks,
"SHOW_SNAPSHOT" => Self::ShowSnapshot,
"SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
"ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
"CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
_ => Self::UnknownValue(smb_settings::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SMBSettings {
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::EncryptData => serializer.serialize_i32(1),
Self::Browsable => serializer.serialize_i32(2),
Self::ChangeNotify => serializer.serialize_i32(3),
Self::NonBrowsable => serializer.serialize_i32(4),
Self::Oplocks => serializer.serialize_i32(5),
Self::ShowSnapshot => serializer.serialize_i32(6),
Self::ShowPreviousVersions => serializer.serialize_i32(7),
Self::AccessBasedEnumeration => serializer.serialize_i32(8),
Self::ContinuouslyAvailable => serializer.serialize_i32(9),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SMBSettings {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
".google.cloud.netapp.v1.SMBSettings",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SecurityStyle {
Unspecified,
Ntfs,
Unix,
UnknownValue(security_style::UnknownValue),
}
#[doc(hidden)]
pub mod security_style {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SecurityStyle {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ntfs => std::option::Option::Some(1),
Self::Unix => 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("SECURITY_STYLE_UNSPECIFIED"),
Self::Ntfs => std::option::Option::Some("NTFS"),
Self::Unix => std::option::Option::Some("UNIX"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SecurityStyle {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SecurityStyle {
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 SecurityStyle {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ntfs,
2 => Self::Unix,
_ => Self::UnknownValue(security_style::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SecurityStyle {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
"NTFS" => Self::Ntfs,
"UNIX" => Self::Unix,
_ => Self::UnknownValue(security_style::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SecurityStyle {
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::Ntfs => serializer.serialize_i32(1),
Self::Unix => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
".google.cloud.netapp.v1.SecurityStyle",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RestrictedAction {
Unspecified,
Delete,
UnknownValue(restricted_action::UnknownValue),
}
#[doc(hidden)]
pub mod restricted_action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RestrictedAction {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Delete => 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("RESTRICTED_ACTION_UNSPECIFIED"),
Self::Delete => std::option::Option::Some("DELETE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RestrictedAction {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RestrictedAction {
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 RestrictedAction {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Delete,
_ => Self::UnknownValue(restricted_action::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RestrictedAction {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
"DELETE" => Self::Delete,
_ => Self::UnknownValue(restricted_action::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RestrictedAction {
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::Delete => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
".google.cloud.netapp.v1.RestrictedAction",
))
}
}