#![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 google_cloud_rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Instance {
pub name: std::string::String,
pub description: std::string::String,
pub state: crate::model::instance::State,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub capacity_gib: i64,
#[deprecated]
pub daos_version: std::string::String,
pub access_points: std::vec::Vec<std::string::String>,
pub network: std::string::String,
pub reserved_ip_range: std::string::String,
pub effective_reserved_ip_range: std::string::String,
pub file_stripe_level: crate::model::FileStripeLevel,
pub directory_stripe_level: crate::model::DirectoryStripeLevel,
pub deployment_type: crate::model::DeploymentType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Instance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_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_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.capacity_gib = v.into();
self
}
#[deprecated]
pub fn set_daos_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.daos_version = v.into();
self
}
pub fn set_access_points<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.access_points = v.into_iter().map(|i| i.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_reserved_ip_range<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.reserved_ip_range = v.into();
self
}
pub fn set_effective_reserved_ip_range<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.effective_reserved_ip_range = v.into();
self
}
pub fn set_file_stripe_level<T: std::convert::Into<crate::model::FileStripeLevel>>(
mut self,
v: T,
) -> Self {
self.file_stripe_level = v.into();
self
}
pub fn set_directory_stripe_level<T: std::convert::Into<crate::model::DirectoryStripeLevel>>(
mut self,
v: T,
) -> Self {
self.directory_stripe_level = v.into();
self
}
pub fn set_deployment_type<T: std::convert::Into<crate::model::DeploymentType>>(
mut self,
v: T,
) -> Self {
self.deployment_type = v.into();
self
}
}
impl wkt::message::Message for Instance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.Instance"
}
}
pub mod instance {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Active,
Deleting,
Failed,
Upgrading,
Repairing,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Creating => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::Upgrading => std::option::Option::Some(5),
Self::Repairing => 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::Active => std::option::Option::Some("ACTIVE"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Upgrading => std::option::Option::Some("UPGRADING"),
Self::Repairing => std::option::Option::Some("REPAIRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Creating,
2 => Self::Active,
3 => Self::Deleting,
4 => Self::Failed,
5 => Self::Upgrading,
6 => Self::Repairing,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"CREATING" => Self::Creating,
"ACTIVE" => Self::Active,
"DELETING" => Self::Deleting,
"FAILED" => Self::Failed,
"UPGRADING" => Self::Upgrading,
"REPAIRING" => Self::Repairing,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Creating => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::Upgrading => serializer.serialize_i32(5),
Self::Repairing => 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.parallelstore.v1.Instance.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferMetadataOptions {
pub uid: crate::model::transfer_metadata_options::Uid,
pub gid: crate::model::transfer_metadata_options::Gid,
pub mode: crate::model::transfer_metadata_options::Mode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferMetadataOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uid<T: std::convert::Into<crate::model::transfer_metadata_options::Uid>>(
mut self,
v: T,
) -> Self {
self.uid = v.into();
self
}
pub fn set_gid<T: std::convert::Into<crate::model::transfer_metadata_options::Gid>>(
mut self,
v: T,
) -> Self {
self.gid = v.into();
self
}
pub fn set_mode<T: std::convert::Into<crate::model::transfer_metadata_options::Mode>>(
mut self,
v: T,
) -> Self {
self.mode = v.into();
self
}
}
impl wkt::message::Message for TransferMetadataOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.TransferMetadataOptions"
}
}
pub mod transfer_metadata_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Uid {
Unspecified,
Skip,
NumberPreserve,
UnknownValue(uid::UnknownValue),
}
#[doc(hidden)]
pub mod uid {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Uid {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Skip => std::option::Option::Some(1),
Self::NumberPreserve => 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("UID_UNSPECIFIED"),
Self::Skip => std::option::Option::Some("UID_SKIP"),
Self::NumberPreserve => std::option::Option::Some("UID_NUMBER_PRESERVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Uid {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Uid {
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 Uid {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Skip,
2 => Self::NumberPreserve,
_ => Self::UnknownValue(uid::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Uid {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UID_UNSPECIFIED" => Self::Unspecified,
"UID_SKIP" => Self::Skip,
"UID_NUMBER_PRESERVE" => Self::NumberPreserve,
_ => Self::UnknownValue(uid::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Uid {
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::Skip => serializer.serialize_i32(1),
Self::NumberPreserve => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Uid {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Uid>::new(
".google.cloud.parallelstore.v1.TransferMetadataOptions.Uid",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Gid {
Unspecified,
Skip,
NumberPreserve,
UnknownValue(gid::UnknownValue),
}
#[doc(hidden)]
pub mod gid {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Gid {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Skip => std::option::Option::Some(1),
Self::NumberPreserve => 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("GID_UNSPECIFIED"),
Self::Skip => std::option::Option::Some("GID_SKIP"),
Self::NumberPreserve => std::option::Option::Some("GID_NUMBER_PRESERVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Gid {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Gid {
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 Gid {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Skip,
2 => Self::NumberPreserve,
_ => Self::UnknownValue(gid::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Gid {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"GID_UNSPECIFIED" => Self::Unspecified,
"GID_SKIP" => Self::Skip,
"GID_NUMBER_PRESERVE" => Self::NumberPreserve,
_ => Self::UnknownValue(gid::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Gid {
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::Skip => serializer.serialize_i32(1),
Self::NumberPreserve => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Gid {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Gid>::new(
".google.cloud.parallelstore.v1.TransferMetadataOptions.Gid",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mode {
Unspecified,
Skip,
Preserve,
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::Skip => std::option::Option::Some(1),
Self::Preserve => 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::Skip => std::option::Option::Some("MODE_SKIP"),
Self::Preserve => std::option::Option::Some("MODE_PRESERVE"),
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::Skip,
2 => Self::Preserve,
_ => 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,
"MODE_SKIP" => Self::Skip,
"MODE_PRESERVE" => Self::Preserve,
_ => 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::Skip => serializer.serialize_i32(1),
Self::Preserve => 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.parallelstore.v1.TransferMetadataOptions.Mode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesRequest {
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 ListInstancesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_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 ListInstancesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesResponse {
pub instances: std::vec::Vec<crate::model::Instance>,
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 ListInstancesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instances<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Instance>,
{
use std::iter::Iterator;
self.instances = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_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 ListInstancesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
type PageItem = crate::model::Instance;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.instances
}
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 GetInstanceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetInstanceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.GetInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInstanceRequest {
pub parent: std::string::String,
pub instance_id: std::string::String,
pub instance: std::option::Option<crate::model::Instance>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateInstanceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance_id = v.into();
self
}
pub fn set_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.CreateInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateInstanceRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub instance: std::option::Option<crate::model::Instance>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateInstanceRequest {
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_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.UpdateInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInstanceRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteInstanceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeleteInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.DeleteInstanceRequest"
}
}
#[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.parallelstore.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceGcsBucket {
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceGcsBucket {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for SourceGcsBucket {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.SourceGcsBucket"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DestinationGcsBucket {
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DestinationGcsBucket {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for DestinationGcsBucket {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.DestinationGcsBucket"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceParallelstore {
pub path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceParallelstore {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
}
impl wkt::message::Message for SourceParallelstore {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.SourceParallelstore"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DestinationParallelstore {
pub path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DestinationParallelstore {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
}
impl wkt::message::Message for DestinationParallelstore {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.DestinationParallelstore"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportDataRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub service_account: std::string::String,
pub metadata_options: std::option::Option<crate::model::TransferMetadataOptions>,
pub source: std::option::Option<crate::model::import_data_request::Source>,
pub destination: std::option::Option<crate::model::import_data_request::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportDataRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = 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
}
pub fn set_metadata_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransferMetadataOptions>,
{
self.metadata_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransferMetadataOptions>,
{
self.metadata_options = v.map(|x| x.into());
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::import_data_request::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn source_gcs_bucket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::import_data_request::Source::SourceGcsBucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_gcs_bucket<
T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::import_data_request::Source::SourceGcsBucket(v.into()),
);
self
}
pub fn set_destination<
T: std::convert::Into<std::option::Option<crate::model::import_data_request::Destination>>,
>(
mut self,
v: T,
) -> Self {
self.destination = v.into();
self
}
pub fn destination_parallelstore(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::import_data_request::Destination::DestinationParallelstore(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_destination_parallelstore<
T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::import_data_request::Destination::DestinationParallelstore(v.into()),
);
self
}
}
impl wkt::message::Message for ImportDataRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.ImportDataRequest"
}
}
pub mod import_data_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Destination {
DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportDataRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub service_account: std::string::String,
pub metadata_options: std::option::Option<crate::model::TransferMetadataOptions>,
pub source: std::option::Option<crate::model::export_data_request::Source>,
pub destination: std::option::Option<crate::model::export_data_request::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportDataRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = 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
}
pub fn set_metadata_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransferMetadataOptions>,
{
self.metadata_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransferMetadataOptions>,
{
self.metadata_options = v.map(|x| x.into());
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::export_data_request::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn source_parallelstore(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::export_data_request::Source::SourceParallelstore(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_parallelstore<
T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::export_data_request::Source::SourceParallelstore(v.into()),
);
self
}
pub fn set_destination<
T: std::convert::Into<std::option::Option<crate::model::export_data_request::Destination>>,
>(
mut self,
v: T,
) -> Self {
self.destination = v.into();
self
}
pub fn destination_gcs_bucket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::export_data_request::Destination::DestinationGcsBucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_destination_gcs_bucket<
T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::export_data_request::Destination::DestinationGcsBucket(v.into()),
);
self
}
}
impl wkt::message::Message for ExportDataRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.ExportDataRequest"
}
}
pub mod export_data_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Destination {
DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportDataResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportDataResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ImportDataResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.ImportDataResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferErrorLogEntry {
pub uri: std::string::String,
pub error_details: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferErrorLogEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_error_details<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.error_details = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TransferErrorLogEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorLogEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferErrorSummary {
pub error_code: google_cloud_rpc::model::Code,
pub error_count: i64,
pub error_log_entries: std::vec::Vec<crate::model::TransferErrorLogEntry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferErrorSummary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_error_code<T: std::convert::Into<google_cloud_rpc::model::Code>>(
mut self,
v: T,
) -> Self {
self.error_code = v.into();
self
}
pub fn set_error_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.error_count = v.into();
self
}
pub fn set_error_log_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferErrorLogEntry>,
{
use std::iter::Iterator;
self.error_log_entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TransferErrorSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorSummary"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportDataMetadata {
pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
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 ImportDataMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operation_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransferOperationMetadata>,
{
self.operation_metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransferOperationMetadata>,
{
self.operation_metadata = 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_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 ImportDataMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.ImportDataMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportDataResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportDataResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ExportDataResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.ExportDataResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportDataMetadata {
pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
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 ExportDataMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operation_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransferOperationMetadata>,
{
self.operation_metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransferOperationMetadata>,
{
self.operation_metadata = 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_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 ExportDataMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.ExportDataMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferOperationMetadata {
pub counters: std::option::Option<crate::model::TransferCounters>,
pub transfer_type: crate::model::TransferType,
pub error_summary: std::vec::Vec<crate::model::TransferErrorSummary>,
pub source: std::option::Option<crate::model::transfer_operation_metadata::Source>,
pub destination: std::option::Option<crate::model::transfer_operation_metadata::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferOperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_counters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransferCounters>,
{
self.counters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_counters<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransferCounters>,
{
self.counters = v.map(|x| x.into());
self
}
pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
mut self,
v: T,
) -> Self {
self.transfer_type = v.into();
self
}
pub fn set_error_summary<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransferErrorSummary>,
{
use std::iter::Iterator;
self.error_summary = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::transfer_operation_metadata::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn source_parallelstore(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::transfer_operation_metadata::Source::SourceParallelstore(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_parallelstore<
T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::transfer_operation_metadata::Source::SourceParallelstore(v.into()),
);
self
}
pub fn source_gcs_bucket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_source_gcs_bucket<
T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v.into()),
);
self
}
pub fn set_destination<
T: std::convert::Into<
std::option::Option<crate::model::transfer_operation_metadata::Destination>,
>,
>(
mut self,
v: T,
) -> Self {
self.destination = v.into();
self
}
pub fn destination_gcs_bucket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_destination_gcs_bucket<
T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v.into()),
);
self
}
pub fn destination_parallelstore(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_destination_parallelstore<
T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(
v.into(),
),
);
self
}
}
impl wkt::message::Message for TransferOperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.TransferOperationMetadata"
}
}
pub mod transfer_operation_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Destination {
DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransferCounters {
pub objects_found: i64,
pub bytes_found: i64,
pub objects_skipped: i64,
pub bytes_skipped: i64,
pub objects_copied: i64,
pub bytes_copied: i64,
pub objects_failed: i64,
pub bytes_failed: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransferCounters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_objects_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.objects_found = v.into();
self
}
pub fn set_bytes_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.bytes_found = v.into();
self
}
pub fn set_objects_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.objects_skipped = v.into();
self
}
pub fn set_bytes_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.bytes_skipped = v.into();
self
}
pub fn set_objects_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.objects_copied = v.into();
self
}
pub fn set_bytes_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.bytes_copied = v.into();
self
}
pub fn set_objects_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.objects_failed = v.into();
self
}
pub fn set_bytes_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.bytes_failed = v.into();
self
}
}
impl wkt::message::Message for TransferCounters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.parallelstore.v1.TransferCounters"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TransferType {
Unspecified,
Import,
Export,
UnknownValue(transfer_type::UnknownValue),
}
#[doc(hidden)]
pub mod transfer_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TransferType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Import => std::option::Option::Some(1),
Self::Export => 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("TRANSFER_TYPE_UNSPECIFIED"),
Self::Import => std::option::Option::Some("IMPORT"),
Self::Export => std::option::Option::Some("EXPORT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TransferType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TransferType {
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 TransferType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Import,
2 => Self::Export,
_ => Self::UnknownValue(transfer_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TransferType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRANSFER_TYPE_UNSPECIFIED" => Self::Unspecified,
"IMPORT" => Self::Import,
"EXPORT" => Self::Export,
_ => Self::UnknownValue(transfer_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TransferType {
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::Import => serializer.serialize_i32(1),
Self::Export => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TransferType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferType>::new(
".google.cloud.parallelstore.v1.TransferType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FileStripeLevel {
Unspecified,
Min,
Balanced,
Max,
UnknownValue(file_stripe_level::UnknownValue),
}
#[doc(hidden)]
pub mod file_stripe_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FileStripeLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Min => std::option::Option::Some(1),
Self::Balanced => std::option::Option::Some(2),
Self::Max => 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("FILE_STRIPE_LEVEL_UNSPECIFIED"),
Self::Min => std::option::Option::Some("FILE_STRIPE_LEVEL_MIN"),
Self::Balanced => std::option::Option::Some("FILE_STRIPE_LEVEL_BALANCED"),
Self::Max => std::option::Option::Some("FILE_STRIPE_LEVEL_MAX"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FileStripeLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FileStripeLevel {
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 FileStripeLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Min,
2 => Self::Balanced,
3 => Self::Max,
_ => Self::UnknownValue(file_stripe_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FileStripeLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FILE_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
"FILE_STRIPE_LEVEL_MIN" => Self::Min,
"FILE_STRIPE_LEVEL_BALANCED" => Self::Balanced,
"FILE_STRIPE_LEVEL_MAX" => Self::Max,
_ => Self::UnknownValue(file_stripe_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FileStripeLevel {
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::Min => serializer.serialize_i32(1),
Self::Balanced => serializer.serialize_i32(2),
Self::Max => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FileStripeLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileStripeLevel>::new(
".google.cloud.parallelstore.v1.FileStripeLevel",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DirectoryStripeLevel {
Unspecified,
Min,
Balanced,
Max,
UnknownValue(directory_stripe_level::UnknownValue),
}
#[doc(hidden)]
pub mod directory_stripe_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DirectoryStripeLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Min => std::option::Option::Some(1),
Self::Balanced => std::option::Option::Some(2),
Self::Max => 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("DIRECTORY_STRIPE_LEVEL_UNSPECIFIED"),
Self::Min => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MIN"),
Self::Balanced => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_BALANCED"),
Self::Max => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MAX"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DirectoryStripeLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DirectoryStripeLevel {
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 DirectoryStripeLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Min,
2 => Self::Balanced,
3 => Self::Max,
_ => Self::UnknownValue(directory_stripe_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DirectoryStripeLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DIRECTORY_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
"DIRECTORY_STRIPE_LEVEL_MIN" => Self::Min,
"DIRECTORY_STRIPE_LEVEL_BALANCED" => Self::Balanced,
"DIRECTORY_STRIPE_LEVEL_MAX" => Self::Max,
_ => Self::UnknownValue(directory_stripe_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DirectoryStripeLevel {
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::Min => serializer.serialize_i32(1),
Self::Balanced => serializer.serialize_i32(2),
Self::Max => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DirectoryStripeLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryStripeLevel>::new(
".google.cloud.parallelstore.v1.DirectoryStripeLevel",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DeploymentType {
Unspecified,
Scratch,
Persistent,
UnknownValue(deployment_type::UnknownValue),
}
#[doc(hidden)]
pub mod deployment_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DeploymentType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Scratch => std::option::Option::Some(1),
Self::Persistent => 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("DEPLOYMENT_TYPE_UNSPECIFIED"),
Self::Scratch => std::option::Option::Some("SCRATCH"),
Self::Persistent => std::option::Option::Some("PERSISTENT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DeploymentType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DeploymentType {
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 DeploymentType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Scratch,
2 => Self::Persistent,
_ => Self::UnknownValue(deployment_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DeploymentType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DEPLOYMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
"SCRATCH" => Self::Scratch,
"PERSISTENT" => Self::Persistent,
_ => Self::UnknownValue(deployment_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DeploymentType {
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::Scratch => serializer.serialize_i32(1),
Self::Persistent => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DeploymentType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentType>::new(
".google.cloud.parallelstore.v1.DeploymentType",
))
}
}