#![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 ReplicationCycle {
pub name: std::string::String,
pub cycle_number: i32,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub total_pause_duration: std::option::Option<wkt::Duration>,
#[deprecated]
pub progress_percent: i32,
pub steps: std::vec::Vec<crate::model::CycleStep>,
pub state: crate::model::replication_cycle::State,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub warnings: std::vec::Vec<crate::model::MigrationWarning>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReplicationCycle {
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_cycle_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cycle_number = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_total_pause_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.total_pause_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_total_pause_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.total_pause_duration = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.progress_percent = v.into();
self
}
pub fn set_steps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CycleStep>,
{
use std::iter::Iterator;
self.steps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_state<T: std::convert::Into<crate::model::replication_cycle::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MigrationWarning>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ReplicationCycle {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ReplicationCycle"
}
}
pub mod replication_cycle {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Running,
Paused,
Failed,
Succeeded,
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::Running => std::option::Option::Some(1),
Self::Paused => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::Succeeded => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Paused => std::option::Option::Some("PAUSED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
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::Running,
2 => Self::Paused,
3 => Self::Failed,
4 => Self::Succeeded,
_ => 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,
"RUNNING" => Self::Running,
"PAUSED" => Self::Paused,
"FAILED" => Self::Failed,
"SUCCEEDED" => Self::Succeeded,
_ => 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::Running => serializer.serialize_i32(1),
Self::Paused => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::Succeeded => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.vmmigration.v1.ReplicationCycle.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CycleStep {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub step: std::option::Option<crate::model::cycle_step::Step>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CycleStep {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_step<T: std::convert::Into<std::option::Option<crate::model::cycle_step::Step>>>(
mut self,
v: T,
) -> Self {
self.step = v.into();
self
}
pub fn initializing_replication(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::InitializingReplicationStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::cycle_step::Step::InitializingReplication(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_initializing_replication<
T: std::convert::Into<std::boxed::Box<crate::model::InitializingReplicationStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::cycle_step::Step::InitializingReplication(v.into()),
);
self
}
pub fn replicating(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ReplicatingStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::cycle_step::Step::Replicating(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_replicating<
T: std::convert::Into<std::boxed::Box<crate::model::ReplicatingStep>>,
>(
mut self,
v: T,
) -> Self {
self.step =
std::option::Option::Some(crate::model::cycle_step::Step::Replicating(v.into()));
self
}
pub fn post_processing(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PostProcessingStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::cycle_step::Step::PostProcessing(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_post_processing<
T: std::convert::Into<std::boxed::Box<crate::model::PostProcessingStep>>,
>(
mut self,
v: T,
) -> Self {
self.step =
std::option::Option::Some(crate::model::cycle_step::Step::PostProcessing(v.into()));
self
}
}
impl wkt::message::Message for CycleStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CycleStep"
}
}
pub mod cycle_step {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Step {
InitializingReplication(std::boxed::Box<crate::model::InitializingReplicationStep>),
Replicating(std::boxed::Box<crate::model::ReplicatingStep>),
PostProcessing(std::boxed::Box<crate::model::PostProcessingStep>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InitializingReplicationStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InitializingReplicationStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for InitializingReplicationStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.InitializingReplicationStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReplicatingStep {
pub total_bytes: i64,
pub replicated_bytes: i64,
pub last_two_minutes_average_bytes_per_second: i64,
pub last_thirty_minutes_average_bytes_per_second: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReplicatingStep {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_total_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_bytes = v.into();
self
}
pub fn set_replicated_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.replicated_bytes = v.into();
self
}
pub fn set_last_two_minutes_average_bytes_per_second<T: std::convert::Into<i64>>(
mut self,
v: T,
) -> Self {
self.last_two_minutes_average_bytes_per_second = v.into();
self
}
pub fn set_last_thirty_minutes_average_bytes_per_second<T: std::convert::Into<i64>>(
mut self,
v: T,
) -> Self {
self.last_thirty_minutes_average_bytes_per_second = v.into();
self
}
}
impl wkt::message::Message for ReplicatingStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ReplicatingStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostProcessingStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostProcessingStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for PostProcessingStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.PostProcessingStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReplicationSync {
pub last_sync_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReplicationSync {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_last_sync_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_sync_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_sync_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_sync_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ReplicationSync {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ReplicationSync"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MigratingVm {
pub name: std::string::String,
pub source_vm_id: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub policy: std::option::Option<crate::model::SchedulePolicy>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub last_sync: std::option::Option<crate::model::ReplicationSync>,
pub state: crate::model::migrating_vm::State,
pub state_time: std::option::Option<wkt::Timestamp>,
pub current_sync_info: std::option::Option<crate::model::ReplicationCycle>,
pub last_replication_cycle: std::option::Option<crate::model::ReplicationCycle>,
pub group: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub recent_clone_jobs: std::vec::Vec<crate::model::CloneJob>,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub recent_cutover_jobs: std::vec::Vec<crate::model::CutoverJob>,
pub cutover_forecast: std::option::Option<crate::model::CutoverForecast>,
pub expiration: std::option::Option<crate::model::migrating_vm::Expiration>,
pub target_vm_defaults: std::option::Option<crate::model::migrating_vm::TargetVmDefaults>,
pub source_vm_details: std::option::Option<crate::model::migrating_vm::SourceVmDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MigratingVm {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_source_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_vm_id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SchedulePolicy>,
{
self.policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SchedulePolicy>,
{
self.policy = 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_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_sync<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReplicationSync>,
{
self.last_sync = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_sync<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReplicationSync>,
{
self.last_sync = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::migrating_vm::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = v.map(|x| x.into());
self
}
pub fn set_current_sync_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReplicationCycle>,
{
self.current_sync_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_current_sync_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReplicationCycle>,
{
self.current_sync_info = v.map(|x| x.into());
self
}
pub fn set_last_replication_cycle<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReplicationCycle>,
{
self.last_replication_cycle = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_replication_cycle<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReplicationCycle>,
{
self.last_replication_cycle = v.map(|x| x.into());
self
}
pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group = 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_recent_clone_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloneJob>,
{
use std::iter::Iterator;
self.recent_clone_jobs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_recent_cutover_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CutoverJob>,
{
use std::iter::Iterator;
self.recent_cutover_jobs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cutover_forecast<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CutoverForecast>,
{
self.cutover_forecast = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cutover_forecast<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CutoverForecast>,
{
self.cutover_forecast = v.map(|x| x.into());
self
}
pub fn set_expiration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::migrating_vm::Expiration>,
{
self.expiration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expiration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::migrating_vm::Expiration>,
{
self.expiration = v.map(|x| x.into());
self
}
pub fn set_target_vm_defaults<
T: std::convert::Into<std::option::Option<crate::model::migrating_vm::TargetVmDefaults>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_defaults = v.into();
self
}
pub fn compute_engine_target_defaults(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineTargetDefaults>> {
#[allow(unreachable_patterns)]
self.target_vm_defaults.as_ref().and_then(|v| match v {
crate::model::migrating_vm::TargetVmDefaults::ComputeEngineTargetDefaults(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_compute_engine_target_defaults<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineTargetDefaults>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_defaults = std::option::Option::Some(
crate::model::migrating_vm::TargetVmDefaults::ComputeEngineTargetDefaults(v.into()),
);
self
}
pub fn compute_engine_disks_target_defaults(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineDisksTargetDefaults>> {
#[allow(unreachable_patterns)]
self.target_vm_defaults.as_ref().and_then(|v| match v {
crate::model::migrating_vm::TargetVmDefaults::ComputeEngineDisksTargetDefaults(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_compute_engine_disks_target_defaults<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineDisksTargetDefaults>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_defaults = std::option::Option::Some(
crate::model::migrating_vm::TargetVmDefaults::ComputeEngineDisksTargetDefaults(
v.into(),
),
);
self
}
pub fn set_source_vm_details<
T: std::convert::Into<std::option::Option<crate::model::migrating_vm::SourceVmDetails>>,
>(
mut self,
v: T,
) -> Self {
self.source_vm_details = v.into();
self
}
pub fn vmware_source_vm_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VmwareSourceVmDetails>> {
#[allow(unreachable_patterns)]
self.source_vm_details.as_ref().and_then(|v| match v {
crate::model::migrating_vm::SourceVmDetails::VmwareSourceVmDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vmware_source_vm_details<
T: std::convert::Into<std::boxed::Box<crate::model::VmwareSourceVmDetails>>,
>(
mut self,
v: T,
) -> Self {
self.source_vm_details = std::option::Option::Some(
crate::model::migrating_vm::SourceVmDetails::VmwareSourceVmDetails(v.into()),
);
self
}
pub fn aws_source_vm_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AwsSourceVmDetails>> {
#[allow(unreachable_patterns)]
self.source_vm_details.as_ref().and_then(|v| match v {
crate::model::migrating_vm::SourceVmDetails::AwsSourceVmDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_aws_source_vm_details<
T: std::convert::Into<std::boxed::Box<crate::model::AwsSourceVmDetails>>,
>(
mut self,
v: T,
) -> Self {
self.source_vm_details = std::option::Option::Some(
crate::model::migrating_vm::SourceVmDetails::AwsSourceVmDetails(v.into()),
);
self
}
pub fn azure_source_vm_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AzureSourceVmDetails>> {
#[allow(unreachable_patterns)]
self.source_vm_details.as_ref().and_then(|v| match v {
crate::model::migrating_vm::SourceVmDetails::AzureSourceVmDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_azure_source_vm_details<
T: std::convert::Into<std::boxed::Box<crate::model::AzureSourceVmDetails>>,
>(
mut self,
v: T,
) -> Self {
self.source_vm_details = std::option::Option::Some(
crate::model::migrating_vm::SourceVmDetails::AzureSourceVmDetails(v.into()),
);
self
}
}
impl wkt::message::Message for MigratingVm {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.MigratingVm"
}
}
pub mod migrating_vm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Expiration {
pub expire_time: std::option::Option<wkt::Timestamp>,
pub extension_count: i32,
pub extendable: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Expiration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_expire_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = v.map(|x| x.into());
self
}
pub fn set_extension_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.extension_count = v.into();
self
}
pub fn set_extendable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.extendable = v.into();
self
}
}
impl wkt::message::Message for Expiration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.MigratingVm.Expiration"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Ready,
FirstSync,
Active,
CuttingOver,
Cutover,
FinalSync,
Paused,
Finalizing,
Finalized,
Error,
Expired,
FinalizedExpired,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Ready => std::option::Option::Some(2),
Self::FirstSync => std::option::Option::Some(3),
Self::Active => std::option::Option::Some(4),
Self::CuttingOver => std::option::Option::Some(7),
Self::Cutover => std::option::Option::Some(8),
Self::FinalSync => std::option::Option::Some(9),
Self::Paused => std::option::Option::Some(10),
Self::Finalizing => std::option::Option::Some(11),
Self::Finalized => std::option::Option::Some(12),
Self::Error => std::option::Option::Some(13),
Self::Expired => std::option::Option::Some(14),
Self::FinalizedExpired => std::option::Option::Some(17),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Ready => std::option::Option::Some("READY"),
Self::FirstSync => std::option::Option::Some("FIRST_SYNC"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::CuttingOver => std::option::Option::Some("CUTTING_OVER"),
Self::Cutover => std::option::Option::Some("CUTOVER"),
Self::FinalSync => std::option::Option::Some("FINAL_SYNC"),
Self::Paused => std::option::Option::Some("PAUSED"),
Self::Finalizing => std::option::Option::Some("FINALIZING"),
Self::Finalized => std::option::Option::Some("FINALIZED"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Expired => std::option::Option::Some("EXPIRED"),
Self::FinalizedExpired => std::option::Option::Some("FINALIZED_EXPIRED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Ready,
3 => Self::FirstSync,
4 => Self::Active,
7 => Self::CuttingOver,
8 => Self::Cutover,
9 => Self::FinalSync,
10 => Self::Paused,
11 => Self::Finalizing,
12 => Self::Finalized,
13 => Self::Error,
14 => Self::Expired,
17 => Self::FinalizedExpired,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"READY" => Self::Ready,
"FIRST_SYNC" => Self::FirstSync,
"ACTIVE" => Self::Active,
"CUTTING_OVER" => Self::CuttingOver,
"CUTOVER" => Self::Cutover,
"FINAL_SYNC" => Self::FinalSync,
"PAUSED" => Self::Paused,
"FINALIZING" => Self::Finalizing,
"FINALIZED" => Self::Finalized,
"ERROR" => Self::Error,
"EXPIRED" => Self::Expired,
"FINALIZED_EXPIRED" => Self::FinalizedExpired,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Ready => serializer.serialize_i32(2),
Self::FirstSync => serializer.serialize_i32(3),
Self::Active => serializer.serialize_i32(4),
Self::CuttingOver => serializer.serialize_i32(7),
Self::Cutover => serializer.serialize_i32(8),
Self::FinalSync => serializer.serialize_i32(9),
Self::Paused => serializer.serialize_i32(10),
Self::Finalizing => serializer.serialize_i32(11),
Self::Finalized => serializer.serialize_i32(12),
Self::Error => serializer.serialize_i32(13),
Self::Expired => serializer.serialize_i32(14),
Self::FinalizedExpired => serializer.serialize_i32(17),
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.vmmigration.v1.MigratingVm.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TargetVmDefaults {
ComputeEngineTargetDefaults(std::boxed::Box<crate::model::ComputeEngineTargetDefaults>),
ComputeEngineDisksTargetDefaults(
std::boxed::Box<crate::model::ComputeEngineDisksTargetDefaults>,
),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceVmDetails {
VmwareSourceVmDetails(std::boxed::Box<crate::model::VmwareSourceVmDetails>),
AwsSourceVmDetails(std::boxed::Box<crate::model::AwsSourceVmDetails>),
AzureSourceVmDetails(std::boxed::Box<crate::model::AzureSourceVmDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CutoverForecast {
pub estimated_cutover_job_duration: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CutoverForecast {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_estimated_cutover_job_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.estimated_cutover_job_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_estimated_cutover_job_duration<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.estimated_cutover_job_duration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CutoverForecast {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CutoverForecast"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloneJob {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub name: std::string::String,
pub state: crate::model::clone_job::State,
pub state_time: std::option::Option<wkt::Timestamp>,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub steps: std::vec::Vec<crate::model::CloneStep>,
pub target_vm_details: std::option::Option<crate::model::clone_job::TargetVmDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloneJob {
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_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::clone_job::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = v.map(|x| x.into());
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_steps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloneStep>,
{
use std::iter::Iterator;
self.steps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_target_vm_details<
T: std::convert::Into<std::option::Option<crate::model::clone_job::TargetVmDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_details = v.into();
self
}
pub fn compute_engine_target_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineTargetDetails>> {
#[allow(unreachable_patterns)]
self.target_vm_details.as_ref().and_then(|v| match v {
crate::model::clone_job::TargetVmDetails::ComputeEngineTargetDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_compute_engine_target_details<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_details = std::option::Option::Some(
crate::model::clone_job::TargetVmDetails::ComputeEngineTargetDetails(v.into()),
);
self
}
pub fn compute_engine_disks_target_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>> {
#[allow(unreachable_patterns)]
self.target_vm_details.as_ref().and_then(|v| match v {
crate::model::clone_job::TargetVmDetails::ComputeEngineDisksTargetDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_compute_engine_disks_target_details<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_details = std::option::Option::Some(
crate::model::clone_job::TargetVmDetails::ComputeEngineDisksTargetDetails(v.into()),
);
self
}
}
impl wkt::message::Message for CloneJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CloneJob"
}
}
pub mod clone_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Active,
Failed,
Succeeded,
Cancelled,
Cancelling,
AdaptingOs,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::Succeeded => std::option::Option::Some(4),
Self::Cancelled => std::option::Option::Some(5),
Self::Cancelling => std::option::Option::Some(6),
Self::AdaptingOs => 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::Pending => std::option::Option::Some("PENDING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::AdaptingOs => std::option::Option::Some("ADAPTING_OS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Active,
3 => Self::Failed,
4 => Self::Succeeded,
5 => Self::Cancelled,
6 => Self::Cancelling,
7 => Self::AdaptingOs,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"ACTIVE" => Self::Active,
"FAILED" => Self::Failed,
"SUCCEEDED" => Self::Succeeded,
"CANCELLED" => Self::Cancelled,
"CANCELLING" => Self::Cancelling,
"ADAPTING_OS" => Self::AdaptingOs,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::Succeeded => serializer.serialize_i32(4),
Self::Cancelled => serializer.serialize_i32(5),
Self::Cancelling => serializer.serialize_i32(6),
Self::AdaptingOs => 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.vmmigration.v1.CloneJob.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TargetVmDetails {
ComputeEngineTargetDetails(std::boxed::Box<crate::model::ComputeEngineTargetDetails>),
ComputeEngineDisksTargetDetails(
std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloneStep {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub step: std::option::Option<crate::model::clone_step::Step>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloneStep {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_step<T: std::convert::Into<std::option::Option<crate::model::clone_step::Step>>>(
mut self,
v: T,
) -> Self {
self.step = v.into();
self
}
pub fn adapting_os(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AdaptingOSStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::clone_step::Step::AdaptingOs(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_adapting_os<T: std::convert::Into<std::boxed::Box<crate::model::AdaptingOSStep>>>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(crate::model::clone_step::Step::AdaptingOs(v.into()));
self
}
pub fn preparing_vm_disks(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PreparingVMDisksStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::clone_step::Step::PreparingVmDisks(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_preparing_vm_disks<
T: std::convert::Into<std::boxed::Box<crate::model::PreparingVMDisksStep>>,
>(
mut self,
v: T,
) -> Self {
self.step =
std::option::Option::Some(crate::model::clone_step::Step::PreparingVmDisks(v.into()));
self
}
pub fn instantiating_migrated_vm(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::InstantiatingMigratedVMStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::clone_step::Step::InstantiatingMigratedVm(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_instantiating_migrated_vm<
T: std::convert::Into<std::boxed::Box<crate::model::InstantiatingMigratedVMStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::clone_step::Step::InstantiatingMigratedVm(v.into()),
);
self
}
}
impl wkt::message::Message for CloneStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CloneStep"
}
}
pub mod clone_step {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Step {
AdaptingOs(std::boxed::Box<crate::model::AdaptingOSStep>),
PreparingVmDisks(std::boxed::Box<crate::model::PreparingVMDisksStep>),
InstantiatingMigratedVm(std::boxed::Box<crate::model::InstantiatingMigratedVMStep>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdaptingOSStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdaptingOSStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for AdaptingOSStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AdaptingOSStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PreparingVMDisksStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PreparingVMDisksStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for PreparingVMDisksStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.PreparingVMDisksStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstantiatingMigratedVMStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstantiatingMigratedVMStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for InstantiatingMigratedVMStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.InstantiatingMigratedVMStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CutoverJob {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub name: std::string::String,
pub state: crate::model::cutover_job::State,
pub state_time: std::option::Option<wkt::Timestamp>,
pub progress_percent: i32,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub state_message: std::string::String,
pub steps: std::vec::Vec<crate::model::CutoverStep>,
pub target_vm_details: std::option::Option<crate::model::cutover_job::TargetVmDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CutoverJob {
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_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::cutover_job::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = v.map(|x| x.into());
self
}
pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.progress_percent = v.into();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_message = v.into();
self
}
pub fn set_steps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CutoverStep>,
{
use std::iter::Iterator;
self.steps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_target_vm_details<
T: std::convert::Into<std::option::Option<crate::model::cutover_job::TargetVmDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_details = v.into();
self
}
pub fn compute_engine_target_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineTargetDetails>> {
#[allow(unreachable_patterns)]
self.target_vm_details.as_ref().and_then(|v| match v {
crate::model::cutover_job::TargetVmDetails::ComputeEngineTargetDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_compute_engine_target_details<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_details = std::option::Option::Some(
crate::model::cutover_job::TargetVmDetails::ComputeEngineTargetDetails(v.into()),
);
self
}
pub fn compute_engine_disks_target_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>> {
#[allow(unreachable_patterns)]
self.target_vm_details.as_ref().and_then(|v| match v {
crate::model::cutover_job::TargetVmDetails::ComputeEngineDisksTargetDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_compute_engine_disks_target_details<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_vm_details = std::option::Option::Some(
crate::model::cutover_job::TargetVmDetails::ComputeEngineDisksTargetDetails(v.into()),
);
self
}
}
impl wkt::message::Message for CutoverJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CutoverJob"
}
}
pub mod cutover_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Failed,
Succeeded,
Cancelled,
Cancelling,
Active,
AdaptingOs,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Succeeded => std::option::Option::Some(3),
Self::Cancelled => std::option::Option::Some(4),
Self::Cancelling => std::option::Option::Some(5),
Self::Active => std::option::Option::Some(6),
Self::AdaptingOs => 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::Pending => std::option::Option::Some("PENDING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::AdaptingOs => std::option::Option::Some("ADAPTING_OS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Failed,
3 => Self::Succeeded,
4 => Self::Cancelled,
5 => Self::Cancelling,
6 => Self::Active,
7 => Self::AdaptingOs,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"FAILED" => Self::Failed,
"SUCCEEDED" => Self::Succeeded,
"CANCELLED" => Self::Cancelled,
"CANCELLING" => Self::Cancelling,
"ACTIVE" => Self::Active,
"ADAPTING_OS" => Self::AdaptingOs,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Succeeded => serializer.serialize_i32(3),
Self::Cancelled => serializer.serialize_i32(4),
Self::Cancelling => serializer.serialize_i32(5),
Self::Active => serializer.serialize_i32(6),
Self::AdaptingOs => 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.vmmigration.v1.CutoverJob.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TargetVmDetails {
ComputeEngineTargetDetails(std::boxed::Box<crate::model::ComputeEngineTargetDetails>),
ComputeEngineDisksTargetDetails(
std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CutoverStep {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub step: std::option::Option<crate::model::cutover_step::Step>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CutoverStep {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_step<
T: std::convert::Into<std::option::Option<crate::model::cutover_step::Step>>,
>(
mut self,
v: T,
) -> Self {
self.step = v.into();
self
}
pub fn previous_replication_cycle(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ReplicationCycle>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::cutover_step::Step::PreviousReplicationCycle(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_previous_replication_cycle<
T: std::convert::Into<std::boxed::Box<crate::model::ReplicationCycle>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::cutover_step::Step::PreviousReplicationCycle(v.into()),
);
self
}
pub fn shutting_down_source_vm(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ShuttingDownSourceVMStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::cutover_step::Step::ShuttingDownSourceVm(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_shutting_down_source_vm<
T: std::convert::Into<std::boxed::Box<crate::model::ShuttingDownSourceVMStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::cutover_step::Step::ShuttingDownSourceVm(v.into()),
);
self
}
pub fn final_sync(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ReplicationCycle>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::cutover_step::Step::FinalSync(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_final_sync<
T: std::convert::Into<std::boxed::Box<crate::model::ReplicationCycle>>,
>(
mut self,
v: T,
) -> Self {
self.step =
std::option::Option::Some(crate::model::cutover_step::Step::FinalSync(v.into()));
self
}
pub fn preparing_vm_disks(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PreparingVMDisksStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::cutover_step::Step::PreparingVmDisks(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_preparing_vm_disks<
T: std::convert::Into<std::boxed::Box<crate::model::PreparingVMDisksStep>>,
>(
mut self,
v: T,
) -> Self {
self.step =
std::option::Option::Some(crate::model::cutover_step::Step::PreparingVmDisks(v.into()));
self
}
pub fn instantiating_migrated_vm(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::InstantiatingMigratedVMStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::cutover_step::Step::InstantiatingMigratedVm(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_instantiating_migrated_vm<
T: std::convert::Into<std::boxed::Box<crate::model::InstantiatingMigratedVMStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::cutover_step::Step::InstantiatingMigratedVm(v.into()),
);
self
}
}
impl wkt::message::Message for CutoverStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CutoverStep"
}
}
pub mod cutover_step {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Step {
PreviousReplicationCycle(std::boxed::Box<crate::model::ReplicationCycle>),
ShuttingDownSourceVm(std::boxed::Box<crate::model::ShuttingDownSourceVMStep>),
FinalSync(std::boxed::Box<crate::model::ReplicationCycle>),
PreparingVmDisks(std::boxed::Box<crate::model::PreparingVMDisksStep>),
InstantiatingMigratedVm(std::boxed::Box<crate::model::InstantiatingMigratedVMStep>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ShuttingDownSourceVMStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ShuttingDownSourceVMStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ShuttingDownSourceVMStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ShuttingDownSourceVMStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCloneJobRequest {
pub parent: std::string::String,
pub clone_job_id: std::string::String,
pub clone_job: std::option::Option<crate::model::CloneJob>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCloneJobRequest {
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_clone_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.clone_job_id = v.into();
self
}
pub fn set_clone_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloneJob>,
{
self.clone_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_clone_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloneJob>,
{
self.clone_job = 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 CreateCloneJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateCloneJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelCloneJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelCloneJobRequest {
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 CancelCloneJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CancelCloneJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelCloneJobResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelCloneJobResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CancelCloneJobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CancelCloneJobResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCloneJobsRequest {
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 ListCloneJobsRequest {
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 ListCloneJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListCloneJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCloneJobsResponse {
pub clone_jobs: std::vec::Vec<crate::model::CloneJob>,
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 ListCloneJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_clone_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloneJob>,
{
use std::iter::Iterator;
self.clone_jobs = 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 ListCloneJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListCloneJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCloneJobsResponse {
type PageItem = crate::model::CloneJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.clone_jobs
}
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 GetCloneJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCloneJobRequest {
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 GetCloneJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetCloneJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Source {
pub name: std::string::String,
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 description: std::string::String,
pub encryption: std::option::Option<crate::model::Encryption>,
pub source_details: std::option::Option<crate::model::source::SourceDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Source {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_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_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_source_details<
T: std::convert::Into<std::option::Option<crate::model::source::SourceDetails>>,
>(
mut self,
v: T,
) -> Self {
self.source_details = v.into();
self
}
pub fn vmware(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VmwareSourceDetails>> {
#[allow(unreachable_patterns)]
self.source_details.as_ref().and_then(|v| match v {
crate::model::source::SourceDetails::Vmware(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_vmware<T: std::convert::Into<std::boxed::Box<crate::model::VmwareSourceDetails>>>(
mut self,
v: T,
) -> Self {
self.source_details =
std::option::Option::Some(crate::model::source::SourceDetails::Vmware(v.into()));
self
}
pub fn aws(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsSourceDetails>> {
#[allow(unreachable_patterns)]
self.source_details.as_ref().and_then(|v| match v {
crate::model::source::SourceDetails::Aws(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_aws<T: std::convert::Into<std::boxed::Box<crate::model::AwsSourceDetails>>>(
mut self,
v: T,
) -> Self {
self.source_details =
std::option::Option::Some(crate::model::source::SourceDetails::Aws(v.into()));
self
}
pub fn azure(&self) -> std::option::Option<&std::boxed::Box<crate::model::AzureSourceDetails>> {
#[allow(unreachable_patterns)]
self.source_details.as_ref().and_then(|v| match v {
crate::model::source::SourceDetails::Azure(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_azure<T: std::convert::Into<std::boxed::Box<crate::model::AzureSourceDetails>>>(
mut self,
v: T,
) -> Self {
self.source_details =
std::option::Option::Some(crate::model::source::SourceDetails::Azure(v.into()));
self
}
}
impl wkt::message::Message for Source {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.Source"
}
}
pub mod source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceDetails {
Vmware(std::boxed::Box<crate::model::VmwareSourceDetails>),
Aws(std::boxed::Box<crate::model::AwsSourceDetails>),
Azure(std::boxed::Box<crate::model::AzureSourceDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Encryption {
pub kms_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Encryption {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key = v.into();
self
}
}
impl wkt::message::Message for Encryption {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.Encryption"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareSourceDetails {
pub username: std::string::String,
pub password: std::string::String,
pub vcenter_ip: std::string::String,
pub thumbprint: std::string::String,
pub resolved_vcenter_host: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareSourceDetails {
pub fn new() -> Self {
std::default::Default::default()
}
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_vcenter_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vcenter_ip = v.into();
self
}
pub fn set_thumbprint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.thumbprint = v.into();
self
}
pub fn set_resolved_vcenter_host<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resolved_vcenter_host = v.into();
self
}
}
impl wkt::message::Message for VmwareSourceDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmwareSourceDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsSourceDetails {
pub aws_region: std::string::String,
pub state: crate::model::aws_source_details::State,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub inventory_tag_list: std::vec::Vec<crate::model::aws_source_details::Tag>,
pub inventory_security_group_names: std::vec::Vec<std::string::String>,
pub migration_resources_user_tags:
std::collections::HashMap<std::string::String, std::string::String>,
pub public_ip: std::string::String,
pub credentials_type: std::option::Option<crate::model::aws_source_details::CredentialsType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsSourceDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_aws_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.aws_region = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::aws_source_details::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_inventory_tag_list<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::aws_source_details::Tag>,
{
use std::iter::Iterator;
self.inventory_tag_list = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_inventory_security_group_names<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.inventory_security_group_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_migration_resources_user_tags<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.migration_resources_user_tags =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_public_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.public_ip = v.into();
self
}
pub fn set_credentials_type<
T: std::convert::Into<std::option::Option<crate::model::aws_source_details::CredentialsType>>,
>(
mut self,
v: T,
) -> Self {
self.credentials_type = v.into();
self
}
pub fn access_key_creds(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::aws_source_details::AccessKeyCredentials>>
{
#[allow(unreachable_patterns)]
self.credentials_type.as_ref().and_then(|v| match v {
crate::model::aws_source_details::CredentialsType::AccessKeyCreds(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_access_key_creds<
T: std::convert::Into<std::boxed::Box<crate::model::aws_source_details::AccessKeyCredentials>>,
>(
mut self,
v: T,
) -> Self {
self.credentials_type = std::option::Option::Some(
crate::model::aws_source_details::CredentialsType::AccessKeyCreds(v.into()),
);
self
}
}
impl wkt::message::Message for AwsSourceDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceDetails"
}
}
pub mod aws_source_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessKeyCredentials {
pub access_key_id: std::string::String,
pub secret_access_key: std::string::String,
pub session_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessKeyCredentials {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_access_key_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.access_key_id = v.into();
self
}
pub fn set_secret_access_key<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.secret_access_key = v.into();
self
}
pub fn set_session_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.session_token = v.into();
self
}
}
impl wkt::message::Message for AccessKeyCredentials {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceDetails.AccessKeyCredentials"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Tag {
pub key: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Tag {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for Tag {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceDetails.Tag"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Failed,
Active,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Active => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Failed,
3 => Self::Active,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"FAILED" => Self::Failed,
"ACTIVE" => Self::Active,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Active => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.vmmigration.v1.AwsSourceDetails.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CredentialsType {
AccessKeyCreds(std::boxed::Box<crate::model::aws_source_details::AccessKeyCredentials>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureSourceDetails {
pub subscription_id: std::string::String,
pub azure_location: std::string::String,
pub state: crate::model::azure_source_details::State,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub migration_resources_user_tags:
std::collections::HashMap<std::string::String, std::string::String>,
pub resource_group_id: std::string::String,
pub credentials_type: std::option::Option<crate::model::azure_source_details::CredentialsType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureSourceDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subscription_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subscription_id = v.into();
self
}
pub fn set_azure_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.azure_location = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::azure_source_details::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_migration_resources_user_tags<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.migration_resources_user_tags =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_resource_group_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_group_id = v.into();
self
}
pub fn set_credentials_type<
T: std::convert::Into<
std::option::Option<crate::model::azure_source_details::CredentialsType>,
>,
>(
mut self,
v: T,
) -> Self {
self.credentials_type = v.into();
self
}
pub fn client_secret_creds(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::azure_source_details::ClientSecretCredentials>,
> {
#[allow(unreachable_patterns)]
self.credentials_type.as_ref().and_then(|v| match v {
crate::model::azure_source_details::CredentialsType::ClientSecretCreds(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_client_secret_creds<
T: std::convert::Into<
std::boxed::Box<crate::model::azure_source_details::ClientSecretCredentials>,
>,
>(
mut self,
v: T,
) -> Self {
self.credentials_type = std::option::Option::Some(
crate::model::azure_source_details::CredentialsType::ClientSecretCreds(v.into()),
);
self
}
}
impl wkt::message::Message for AzureSourceDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureSourceDetails"
}
}
pub mod azure_source_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClientSecretCredentials {
pub tenant_id: std::string::String,
pub client_id: std::string::String,
pub client_secret: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClientSecretCredentials {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tenant_id = v.into();
self
}
pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_id = v.into();
self
}
pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.client_secret = v.into();
self
}
}
impl wkt::message::Message for ClientSecretCredentials {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureSourceDetails.ClientSecretCredentials"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Failed,
Active,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Active => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Failed,
3 => Self::Active,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"FAILED" => Self::Failed,
"ACTIVE" => Self::Active,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Active => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.vmmigration.v1.AzureSourceDetails.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CredentialsType {
ClientSecretCreds(
std::boxed::Box<crate::model::azure_source_details::ClientSecretCredentials>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatacenterConnector {
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub name: std::string::String,
pub registration_id: std::string::String,
pub service_account: std::string::String,
pub version: std::string::String,
pub bucket: std::string::String,
pub state: crate::model::datacenter_connector::State,
pub state_time: std::option::Option<wkt::Timestamp>,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub appliance_infrastructure_version: std::string::String,
pub appliance_software_version: std::string::String,
pub available_versions: std::option::Option<crate::model::AvailableUpdates>,
pub upgrade_status: std::option::Option<crate::model::UpgradeStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DatacenterConnector {
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_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_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_registration_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.registration_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_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::datacenter_connector::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = v.map(|x| x.into());
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_appliance_infrastructure_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.appliance_infrastructure_version = v.into();
self
}
pub fn set_appliance_software_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.appliance_software_version = v.into();
self
}
pub fn set_available_versions<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AvailableUpdates>,
{
self.available_versions = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_available_versions<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AvailableUpdates>,
{
self.available_versions = v.map(|x| x.into());
self
}
pub fn set_upgrade_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UpgradeStatus>,
{
self.upgrade_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_upgrade_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UpgradeStatus>,
{
self.upgrade_status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DatacenterConnector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DatacenterConnector"
}
}
pub mod datacenter_connector {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Offline,
Failed,
Active,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Offline => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::Active => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Offline => std::option::Option::Some("OFFLINE"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Offline,
3 => Self::Failed,
4 => Self::Active,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"OFFLINE" => Self::Offline,
"FAILED" => Self::Failed,
"ACTIVE" => Self::Active,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Offline => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::Active => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.vmmigration.v1.DatacenterConnector.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpgradeStatus {
pub version: std::string::String,
pub state: crate::model::upgrade_status::State,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub previous_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpgradeStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::upgrade_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_previous_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.previous_version = v.into();
self
}
}
impl wkt::message::Message for UpgradeStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UpgradeStatus"
}
}
pub mod upgrade_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Running,
Failed,
Succeeded,
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::Running => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Succeeded => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
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::Running,
2 => Self::Failed,
3 => Self::Succeeded,
_ => 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,
"RUNNING" => Self::Running,
"FAILED" => Self::Failed,
"SUCCEEDED" => Self::Succeeded,
_ => 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::Running => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Succeeded => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.vmmigration.v1.UpgradeStatus.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AvailableUpdates {
pub new_deployable_appliance: std::option::Option<crate::model::ApplianceVersion>,
pub in_place_update: std::option::Option<crate::model::ApplianceVersion>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AvailableUpdates {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_new_deployable_appliance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ApplianceVersion>,
{
self.new_deployable_appliance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_new_deployable_appliance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ApplianceVersion>,
{
self.new_deployable_appliance = v.map(|x| x.into());
self
}
pub fn set_in_place_update<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ApplianceVersion>,
{
self.in_place_update = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_in_place_update<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ApplianceVersion>,
{
self.in_place_update = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AvailableUpdates {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AvailableUpdates"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApplianceVersion {
pub version: std::string::String,
pub uri: std::string::String,
pub critical: bool,
pub release_notes_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApplianceVersion {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_critical<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.critical = v.into();
self
}
pub fn set_release_notes_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.release_notes_uri = v.into();
self
}
}
impl wkt::message::Message for ApplianceVersion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ApplianceVersion"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSourcesRequest {
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 ListSourcesRequest {
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 ListSourcesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListSourcesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSourcesResponse {
pub sources: std::vec::Vec<crate::model::Source>,
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 ListSourcesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Source>,
{
use std::iter::Iterator;
self.sources = 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 ListSourcesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListSourcesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSourcesResponse {
type PageItem = crate::model::Source;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.sources
}
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 GetSourceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSourceRequest {
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 GetSourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSourceRequest {
pub parent: std::string::String,
pub source_id: std::string::String,
pub source: std::option::Option<crate::model::Source>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSourceRequest {
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_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_id = v.into();
self
}
pub fn set_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Source>,
{
self.source = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Source>,
{
self.source = 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 CreateSourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSourceRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub source: std::option::Option<crate::model::Source>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSourceRequest {
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_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Source>,
{
self.source = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Source>,
{
self.source = 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 UpdateSourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UpdateSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSourceRequest {
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 DeleteSourceRequest {
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 DeleteSourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DeleteSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchInventoryRequest {
pub source: std::string::String,
pub force_refresh: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchInventoryRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
pub fn set_force_refresh<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force_refresh = v.into();
self
}
}
impl wkt::message::Message for FetchInventoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.FetchInventoryRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareVmDetails {
pub vm_id: std::string::String,
pub datacenter_id: std::string::String,
pub datacenter_description: std::string::String,
pub uuid: std::string::String,
pub display_name: std::string::String,
pub power_state: crate::model::vmware_vm_details::PowerState,
pub cpu_count: i32,
pub memory_mb: i32,
pub disk_count: i32,
pub committed_storage_mb: i64,
pub guest_description: std::string::String,
pub boot_option: crate::model::vmware_vm_details::BootOption,
pub architecture: crate::model::vmware_vm_details::VmArchitecture,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareVmDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_id = v.into();
self
}
pub fn set_datacenter_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.datacenter_id = v.into();
self
}
pub fn set_datacenter_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.datacenter_description = v.into();
self
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_power_state<T: std::convert::Into<crate::model::vmware_vm_details::PowerState>>(
mut self,
v: T,
) -> Self {
self.power_state = v.into();
self
}
pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_count = v.into();
self
}
pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.memory_mb = v.into();
self
}
pub fn set_disk_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.disk_count = v.into();
self
}
pub fn set_committed_storage_mb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.committed_storage_mb = v.into();
self
}
pub fn set_guest_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.guest_description = v.into();
self
}
pub fn set_boot_option<T: std::convert::Into<crate::model::vmware_vm_details::BootOption>>(
mut self,
v: T,
) -> Self {
self.boot_option = v.into();
self
}
pub fn set_architecture<
T: std::convert::Into<crate::model::vmware_vm_details::VmArchitecture>,
>(
mut self,
v: T,
) -> Self {
self.architecture = v.into();
self
}
}
impl wkt::message::Message for VmwareVmDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmwareVmDetails"
}
}
pub mod vmware_vm_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PowerState {
Unspecified,
On,
Off,
Suspended,
UnknownValue(power_state::UnknownValue),
}
#[doc(hidden)]
pub mod power_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PowerState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::On => std::option::Option::Some(1),
Self::Off => std::option::Option::Some(2),
Self::Suspended => 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("POWER_STATE_UNSPECIFIED"),
Self::On => std::option::Option::Some("ON"),
Self::Off => std::option::Option::Some("OFF"),
Self::Suspended => std::option::Option::Some("SUSPENDED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PowerState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PowerState {
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 PowerState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::On,
2 => Self::Off,
3 => Self::Suspended,
_ => Self::UnknownValue(power_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PowerState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POWER_STATE_UNSPECIFIED" => Self::Unspecified,
"ON" => Self::On,
"OFF" => Self::Off,
"SUSPENDED" => Self::Suspended,
_ => Self::UnknownValue(power_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PowerState {
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::On => serializer.serialize_i32(1),
Self::Off => serializer.serialize_i32(2),
Self::Suspended => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PowerState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PowerState>::new(
".google.cloud.vmmigration.v1.VmwareVmDetails.PowerState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BootOption {
Unspecified,
Efi,
Bios,
UnknownValue(boot_option::UnknownValue),
}
#[doc(hidden)]
pub mod boot_option {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BootOption {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Efi => std::option::Option::Some(1),
Self::Bios => 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("BOOT_OPTION_UNSPECIFIED"),
Self::Efi => std::option::Option::Some("EFI"),
Self::Bios => std::option::Option::Some("BIOS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BootOption {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BootOption {
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 BootOption {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Efi,
2 => Self::Bios,
_ => Self::UnknownValue(boot_option::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BootOption {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BOOT_OPTION_UNSPECIFIED" => Self::Unspecified,
"EFI" => Self::Efi,
"BIOS" => Self::Bios,
_ => Self::UnknownValue(boot_option::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BootOption {
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::Efi => serializer.serialize_i32(1),
Self::Bios => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BootOption {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BootOption>::new(
".google.cloud.vmmigration.v1.VmwareVmDetails.BootOption",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmArchitecture {
Unspecified,
X86Family,
Arm64,
UnknownValue(vm_architecture::UnknownValue),
}
#[doc(hidden)]
pub mod vm_architecture {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VmArchitecture {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::X86Family => std::option::Option::Some(1),
Self::Arm64 => 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("VM_ARCHITECTURE_UNSPECIFIED"),
Self::X86Family => std::option::Option::Some("VM_ARCHITECTURE_X86_FAMILY"),
Self::Arm64 => std::option::Option::Some("VM_ARCHITECTURE_ARM64"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VmArchitecture {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VmArchitecture {
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 VmArchitecture {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::X86Family,
2 => Self::Arm64,
_ => Self::UnknownValue(vm_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VmArchitecture {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VM_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
"VM_ARCHITECTURE_X86_FAMILY" => Self::X86Family,
"VM_ARCHITECTURE_ARM64" => Self::Arm64,
_ => Self::UnknownValue(vm_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VmArchitecture {
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::X86Family => serializer.serialize_i32(1),
Self::Arm64 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VmArchitecture {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmArchitecture>::new(
".google.cloud.vmmigration.v1.VmwareVmDetails.VmArchitecture",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsVmDetails {
pub vm_id: std::string::String,
pub display_name: std::string::String,
pub source_id: std::string::String,
pub source_description: std::string::String,
pub power_state: crate::model::aws_vm_details::PowerState,
pub cpu_count: i32,
pub memory_mb: i32,
pub disk_count: i32,
pub committed_storage_mb: i64,
pub os_description: std::string::String,
pub boot_option: crate::model::aws_vm_details::BootOption,
pub instance_type: std::string::String,
pub vpc_id: std::string::String,
pub security_groups: std::vec::Vec<crate::model::AwsSecurityGroup>,
pub tags: std::collections::HashMap<std::string::String, std::string::String>,
pub zone: std::string::String,
pub virtualization_type: crate::model::aws_vm_details::VmVirtualizationType,
pub architecture: crate::model::aws_vm_details::VmArchitecture,
pub vcpu_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsVmDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_id = v.into();
self
}
pub fn set_source_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_description = v.into();
self
}
pub fn set_power_state<T: std::convert::Into<crate::model::aws_vm_details::PowerState>>(
mut self,
v: T,
) -> Self {
self.power_state = v.into();
self
}
pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_count = v.into();
self
}
pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.memory_mb = v.into();
self
}
pub fn set_disk_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.disk_count = v.into();
self
}
pub fn set_committed_storage_mb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.committed_storage_mb = v.into();
self
}
pub fn set_os_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.os_description = v.into();
self
}
pub fn set_boot_option<T: std::convert::Into<crate::model::aws_vm_details::BootOption>>(
mut self,
v: T,
) -> Self {
self.boot_option = v.into();
self
}
pub fn set_instance_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance_type = v.into();
self
}
pub fn set_vpc_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_id = v.into();
self
}
pub fn set_security_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AwsSecurityGroup>,
{
use std::iter::Iterator;
self.security_groups = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_tags<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone = v.into();
self
}
pub fn set_virtualization_type<
T: std::convert::Into<crate::model::aws_vm_details::VmVirtualizationType>,
>(
mut self,
v: T,
) -> Self {
self.virtualization_type = v.into();
self
}
pub fn set_architecture<T: std::convert::Into<crate::model::aws_vm_details::VmArchitecture>>(
mut self,
v: T,
) -> Self {
self.architecture = v.into();
self
}
pub fn set_vcpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.vcpu_count = v.into();
self
}
}
impl wkt::message::Message for AwsVmDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsVmDetails"
}
}
pub mod aws_vm_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PowerState {
Unspecified,
On,
Off,
Suspended,
Pending,
UnknownValue(power_state::UnknownValue),
}
#[doc(hidden)]
pub mod power_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PowerState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::On => std::option::Option::Some(1),
Self::Off => std::option::Option::Some(2),
Self::Suspended => std::option::Option::Some(3),
Self::Pending => 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("POWER_STATE_UNSPECIFIED"),
Self::On => std::option::Option::Some("ON"),
Self::Off => std::option::Option::Some("OFF"),
Self::Suspended => std::option::Option::Some("SUSPENDED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PowerState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PowerState {
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 PowerState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::On,
2 => Self::Off,
3 => Self::Suspended,
4 => Self::Pending,
_ => Self::UnknownValue(power_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PowerState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POWER_STATE_UNSPECIFIED" => Self::Unspecified,
"ON" => Self::On,
"OFF" => Self::Off,
"SUSPENDED" => Self::Suspended,
"PENDING" => Self::Pending,
_ => Self::UnknownValue(power_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PowerState {
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::On => serializer.serialize_i32(1),
Self::Off => serializer.serialize_i32(2),
Self::Suspended => serializer.serialize_i32(3),
Self::Pending => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PowerState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PowerState>::new(
".google.cloud.vmmigration.v1.AwsVmDetails.PowerState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BootOption {
Unspecified,
Efi,
Bios,
UnknownValue(boot_option::UnknownValue),
}
#[doc(hidden)]
pub mod boot_option {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BootOption {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Efi => std::option::Option::Some(1),
Self::Bios => 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("BOOT_OPTION_UNSPECIFIED"),
Self::Efi => std::option::Option::Some("EFI"),
Self::Bios => std::option::Option::Some("BIOS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BootOption {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BootOption {
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 BootOption {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Efi,
2 => Self::Bios,
_ => Self::UnknownValue(boot_option::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BootOption {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BOOT_OPTION_UNSPECIFIED" => Self::Unspecified,
"EFI" => Self::Efi,
"BIOS" => Self::Bios,
_ => Self::UnknownValue(boot_option::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BootOption {
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::Efi => serializer.serialize_i32(1),
Self::Bios => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BootOption {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BootOption>::new(
".google.cloud.vmmigration.v1.AwsVmDetails.BootOption",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmVirtualizationType {
Unspecified,
Hvm,
Paravirtual,
UnknownValue(vm_virtualization_type::UnknownValue),
}
#[doc(hidden)]
pub mod vm_virtualization_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VmVirtualizationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Hvm => std::option::Option::Some(1),
Self::Paravirtual => 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("VM_VIRTUALIZATION_TYPE_UNSPECIFIED")
}
Self::Hvm => std::option::Option::Some("HVM"),
Self::Paravirtual => std::option::Option::Some("PARAVIRTUAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VmVirtualizationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VmVirtualizationType {
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 VmVirtualizationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Hvm,
2 => Self::Paravirtual,
_ => Self::UnknownValue(vm_virtualization_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VmVirtualizationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VM_VIRTUALIZATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"HVM" => Self::Hvm,
"PARAVIRTUAL" => Self::Paravirtual,
_ => Self::UnknownValue(vm_virtualization_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VmVirtualizationType {
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::Hvm => serializer.serialize_i32(1),
Self::Paravirtual => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VmVirtualizationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmVirtualizationType>::new(
".google.cloud.vmmigration.v1.AwsVmDetails.VmVirtualizationType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmArchitecture {
Unspecified,
I386,
X8664,
Arm64,
X8664Mac,
UnknownValue(vm_architecture::UnknownValue),
}
#[doc(hidden)]
pub mod vm_architecture {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VmArchitecture {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::I386 => std::option::Option::Some(1),
Self::X8664 => std::option::Option::Some(2),
Self::Arm64 => std::option::Option::Some(3),
Self::X8664Mac => 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("VM_ARCHITECTURE_UNSPECIFIED"),
Self::I386 => std::option::Option::Some("I386"),
Self::X8664 => std::option::Option::Some("X86_64"),
Self::Arm64 => std::option::Option::Some("ARM64"),
Self::X8664Mac => std::option::Option::Some("X86_64_MAC"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VmArchitecture {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VmArchitecture {
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 VmArchitecture {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::I386,
2 => Self::X8664,
3 => Self::Arm64,
4 => Self::X8664Mac,
_ => Self::UnknownValue(vm_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VmArchitecture {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VM_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
"I386" => Self::I386,
"X86_64" => Self::X8664,
"ARM64" => Self::Arm64,
"X86_64_MAC" => Self::X8664Mac,
_ => Self::UnknownValue(vm_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VmArchitecture {
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::I386 => serializer.serialize_i32(1),
Self::X8664 => serializer.serialize_i32(2),
Self::Arm64 => serializer.serialize_i32(3),
Self::X8664Mac => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VmArchitecture {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmArchitecture>::new(
".google.cloud.vmmigration.v1.AwsVmDetails.VmArchitecture",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsSecurityGroup {
pub id: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsSecurityGroup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for AwsSecurityGroup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsSecurityGroup"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureVmDetails {
pub vm_id: std::string::String,
pub power_state: crate::model::azure_vm_details::PowerState,
pub vm_size: std::string::String,
pub cpu_count: i32,
pub memory_mb: i32,
pub disk_count: i32,
pub committed_storage_mb: i64,
pub os_disk: std::option::Option<crate::model::azure_vm_details::OSDisk>,
pub disks: std::vec::Vec<crate::model::azure_vm_details::Disk>,
pub os_description: std::option::Option<crate::model::azure_vm_details::OSDescription>,
pub boot_option: crate::model::azure_vm_details::BootOption,
pub tags: std::collections::HashMap<std::string::String, std::string::String>,
pub computer_name: std::string::String,
pub architecture: crate::model::azure_vm_details::VmArchitecture,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureVmDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_id = v.into();
self
}
pub fn set_power_state<T: std::convert::Into<crate::model::azure_vm_details::PowerState>>(
mut self,
v: T,
) -> Self {
self.power_state = v.into();
self
}
pub fn set_vm_size<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_size = v.into();
self
}
pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_count = v.into();
self
}
pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.memory_mb = v.into();
self
}
pub fn set_disk_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.disk_count = v.into();
self
}
pub fn set_committed_storage_mb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.committed_storage_mb = v.into();
self
}
pub fn set_os_disk<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::azure_vm_details::OSDisk>,
{
self.os_disk = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_os_disk<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::azure_vm_details::OSDisk>,
{
self.os_disk = v.map(|x| x.into());
self
}
pub fn set_disks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::azure_vm_details::Disk>,
{
use std::iter::Iterator;
self.disks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_os_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::azure_vm_details::OSDescription>,
{
self.os_description = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_os_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::azure_vm_details::OSDescription>,
{
self.os_description = v.map(|x| x.into());
self
}
pub fn set_boot_option<T: std::convert::Into<crate::model::azure_vm_details::BootOption>>(
mut self,
v: T,
) -> Self {
self.boot_option = v.into();
self
}
pub fn set_tags<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_computer_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.computer_name = v.into();
self
}
pub fn set_architecture<
T: std::convert::Into<crate::model::azure_vm_details::VmArchitecture>,
>(
mut self,
v: T,
) -> Self {
self.architecture = v.into();
self
}
}
impl wkt::message::Message for AzureVmDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureVmDetails"
}
}
pub mod azure_vm_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OSDisk {
pub r#type: std::string::String,
pub name: std::string::String,
pub size_gb: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OSDisk {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.size_gb = v.into();
self
}
}
impl wkt::message::Message for OSDisk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureVmDetails.OSDisk"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Disk {
pub name: std::string::String,
pub size_gb: i32,
pub lun: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Disk {
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_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.size_gb = v.into();
self
}
pub fn set_lun<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.lun = v.into();
self
}
}
impl wkt::message::Message for Disk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureVmDetails.Disk"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OSDescription {
pub r#type: std::string::String,
pub publisher: std::string::String,
pub offer: std::string::String,
pub plan: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OSDescription {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_publisher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.publisher = v.into();
self
}
pub fn set_offer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.offer = v.into();
self
}
pub fn set_plan<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.plan = v.into();
self
}
}
impl wkt::message::Message for OSDescription {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureVmDetails.OSDescription"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PowerState {
Unspecified,
Starting,
Running,
Stopping,
Stopped,
Deallocating,
Deallocated,
Unknown,
UnknownValue(power_state::UnknownValue),
}
#[doc(hidden)]
pub mod power_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PowerState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Starting => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Stopping => std::option::Option::Some(3),
Self::Stopped => std::option::Option::Some(4),
Self::Deallocating => std::option::Option::Some(5),
Self::Deallocated => std::option::Option::Some(6),
Self::Unknown => 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("POWER_STATE_UNSPECIFIED"),
Self::Starting => std::option::Option::Some("STARTING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Stopping => std::option::Option::Some("STOPPING"),
Self::Stopped => std::option::Option::Some("STOPPED"),
Self::Deallocating => std::option::Option::Some("DEALLOCATING"),
Self::Deallocated => std::option::Option::Some("DEALLOCATED"),
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PowerState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PowerState {
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 PowerState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Starting,
2 => Self::Running,
3 => Self::Stopping,
4 => Self::Stopped,
5 => Self::Deallocating,
6 => Self::Deallocated,
7 => Self::Unknown,
_ => Self::UnknownValue(power_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PowerState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POWER_STATE_UNSPECIFIED" => Self::Unspecified,
"STARTING" => Self::Starting,
"RUNNING" => Self::Running,
"STOPPING" => Self::Stopping,
"STOPPED" => Self::Stopped,
"DEALLOCATING" => Self::Deallocating,
"DEALLOCATED" => Self::Deallocated,
"UNKNOWN" => Self::Unknown,
_ => Self::UnknownValue(power_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PowerState {
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::Starting => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Stopping => serializer.serialize_i32(3),
Self::Stopped => serializer.serialize_i32(4),
Self::Deallocating => serializer.serialize_i32(5),
Self::Deallocated => serializer.serialize_i32(6),
Self::Unknown => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PowerState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PowerState>::new(
".google.cloud.vmmigration.v1.AzureVmDetails.PowerState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BootOption {
Unspecified,
Efi,
Bios,
UnknownValue(boot_option::UnknownValue),
}
#[doc(hidden)]
pub mod boot_option {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BootOption {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Efi => std::option::Option::Some(1),
Self::Bios => 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("BOOT_OPTION_UNSPECIFIED"),
Self::Efi => std::option::Option::Some("EFI"),
Self::Bios => std::option::Option::Some("BIOS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BootOption {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BootOption {
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 BootOption {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Efi,
2 => Self::Bios,
_ => Self::UnknownValue(boot_option::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BootOption {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BOOT_OPTION_UNSPECIFIED" => Self::Unspecified,
"EFI" => Self::Efi,
"BIOS" => Self::Bios,
_ => Self::UnknownValue(boot_option::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BootOption {
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::Efi => serializer.serialize_i32(1),
Self::Bios => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BootOption {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BootOption>::new(
".google.cloud.vmmigration.v1.AzureVmDetails.BootOption",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmArchitecture {
Unspecified,
X86Family,
Arm64,
UnknownValue(vm_architecture::UnknownValue),
}
#[doc(hidden)]
pub mod vm_architecture {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VmArchitecture {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::X86Family => std::option::Option::Some(1),
Self::Arm64 => 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("VM_ARCHITECTURE_UNSPECIFIED"),
Self::X86Family => std::option::Option::Some("VM_ARCHITECTURE_X86_FAMILY"),
Self::Arm64 => std::option::Option::Some("VM_ARCHITECTURE_ARM64"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VmArchitecture {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VmArchitecture {
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 VmArchitecture {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::X86Family,
2 => Self::Arm64,
_ => Self::UnknownValue(vm_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VmArchitecture {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VM_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
"VM_ARCHITECTURE_X86_FAMILY" => Self::X86Family,
"VM_ARCHITECTURE_ARM64" => Self::Arm64,
_ => Self::UnknownValue(vm_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VmArchitecture {
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::X86Family => serializer.serialize_i32(1),
Self::Arm64 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VmArchitecture {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmArchitecture>::new(
".google.cloud.vmmigration.v1.AzureVmDetails.VmArchitecture",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareVmsDetails {
pub details: std::vec::Vec<crate::model::VmwareVmDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareVmsDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VmwareVmDetails>,
{
use std::iter::Iterator;
self.details = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VmwareVmsDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmwareVmsDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsVmsDetails {
pub details: std::vec::Vec<crate::model::AwsVmDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsVmsDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AwsVmDetails>,
{
use std::iter::Iterator;
self.details = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AwsVmsDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsVmsDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureVmsDetails {
pub details: std::vec::Vec<crate::model::AzureVmDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureVmsDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AzureVmDetails>,
{
use std::iter::Iterator;
self.details = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AzureVmsDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureVmsDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchInventoryResponse {
pub update_time: std::option::Option<wkt::Timestamp>,
pub source_vms: std::option::Option<crate::model::fetch_inventory_response::SourceVms>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchInventoryResponse {
pub fn new() -> Self {
std::default::Default::default()
}
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_source_vms<
T: std::convert::Into<std::option::Option<crate::model::fetch_inventory_response::SourceVms>>,
>(
mut self,
v: T,
) -> Self {
self.source_vms = v.into();
self
}
pub fn vmware_vms(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VmwareVmsDetails>> {
#[allow(unreachable_patterns)]
self.source_vms.as_ref().and_then(|v| match v {
crate::model::fetch_inventory_response::SourceVms::VmwareVms(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vmware_vms<
T: std::convert::Into<std::boxed::Box<crate::model::VmwareVmsDetails>>,
>(
mut self,
v: T,
) -> Self {
self.source_vms = std::option::Option::Some(
crate::model::fetch_inventory_response::SourceVms::VmwareVms(v.into()),
);
self
}
pub fn aws_vms(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsVmsDetails>> {
#[allow(unreachable_patterns)]
self.source_vms.as_ref().and_then(|v| match v {
crate::model::fetch_inventory_response::SourceVms::AwsVms(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_aws_vms<T: std::convert::Into<std::boxed::Box<crate::model::AwsVmsDetails>>>(
mut self,
v: T,
) -> Self {
self.source_vms = std::option::Option::Some(
crate::model::fetch_inventory_response::SourceVms::AwsVms(v.into()),
);
self
}
pub fn azure_vms(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AzureVmsDetails>> {
#[allow(unreachable_patterns)]
self.source_vms.as_ref().and_then(|v| match v {
crate::model::fetch_inventory_response::SourceVms::AzureVms(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_azure_vms<T: std::convert::Into<std::boxed::Box<crate::model::AzureVmsDetails>>>(
mut self,
v: T,
) -> Self {
self.source_vms = std::option::Option::Some(
crate::model::fetch_inventory_response::SourceVms::AzureVms(v.into()),
);
self
}
}
impl wkt::message::Message for FetchInventoryResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.FetchInventoryResponse"
}
}
pub mod fetch_inventory_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceVms {
VmwareVms(std::boxed::Box<crate::model::VmwareVmsDetails>),
AwsVms(std::boxed::Box<crate::model::AwsVmsDetails>),
AzureVms(std::boxed::Box<crate::model::AzureVmsDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchStorageInventoryRequest {
pub source: std::string::String,
pub r#type: crate::model::fetch_storage_inventory_request::StorageType,
pub force_refresh: bool,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchStorageInventoryRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
pub fn set_type<
T: std::convert::Into<crate::model::fetch_storage_inventory_request::StorageType>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_force_refresh<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force_refresh = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for FetchStorageInventoryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.FetchStorageInventoryRequest"
}
}
pub mod fetch_storage_inventory_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StorageType {
Unspecified,
Disks,
Snapshots,
UnknownValue(storage_type::UnknownValue),
}
#[doc(hidden)]
pub mod storage_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl StorageType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Disks => std::option::Option::Some(1),
Self::Snapshots => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
Self::Disks => std::option::Option::Some("DISKS"),
Self::Snapshots => std::option::Option::Some("SNAPSHOTS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for StorageType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for StorageType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for StorageType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Disks,
2 => Self::Snapshots,
_ => Self::UnknownValue(storage_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for StorageType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
"DISKS" => Self::Disks,
"SNAPSHOTS" => Self::Snapshots,
_ => Self::UnknownValue(storage_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for StorageType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Disks => serializer.serialize_i32(1),
Self::Snapshots => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for StorageType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
".google.cloud.vmmigration.v1.FetchStorageInventoryRequest.StorageType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchStorageInventoryResponse {
pub resources: std::vec::Vec<crate::model::SourceStorageResource>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchStorageInventoryResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SourceStorageResource>,
{
use std::iter::Iterator;
self.resources = v.into_iter().map(|i| i.into()).collect();
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_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for FetchStorageInventoryResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.FetchStorageInventoryResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for FetchStorageInventoryResponse {
type PageItem = crate::model::SourceStorageResource;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.resources
}
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 SourceStorageResource {
pub storage_resource:
std::option::Option<crate::model::source_storage_resource::StorageResource>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceStorageResource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_storage_resource<
T: std::convert::Into<
std::option::Option<crate::model::source_storage_resource::StorageResource>,
>,
>(
mut self,
v: T,
) -> Self {
self.storage_resource = v.into();
self
}
pub fn aws_disk_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AwsSourceDiskDetails>> {
#[allow(unreachable_patterns)]
self.storage_resource.as_ref().and_then(|v| match v {
crate::model::source_storage_resource::StorageResource::AwsDiskDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_aws_disk_details<
T: std::convert::Into<std::boxed::Box<crate::model::AwsSourceDiskDetails>>,
>(
mut self,
v: T,
) -> Self {
self.storage_resource = std::option::Option::Some(
crate::model::source_storage_resource::StorageResource::AwsDiskDetails(v.into()),
);
self
}
}
impl wkt::message::Message for SourceStorageResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.SourceStorageResource"
}
}
pub mod source_storage_resource {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StorageResource {
AwsDiskDetails(std::boxed::Box<crate::model::AwsSourceDiskDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UtilizationReport {
pub name: std::string::String,
pub display_name: std::string::String,
pub state: crate::model::utilization_report::State,
pub state_time: std::option::Option<wkt::Timestamp>,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub time_frame: crate::model::utilization_report::TimeFrame,
pub frame_end_time: std::option::Option<wkt::Timestamp>,
pub vm_count: i32,
pub vms: std::vec::Vec<crate::model::VmUtilizationInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UtilizationReport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::utilization_report::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = v.map(|x| x.into());
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = 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_time_frame<T: std::convert::Into<crate::model::utilization_report::TimeFrame>>(
mut self,
v: T,
) -> Self {
self.time_frame = v.into();
self
}
pub fn set_frame_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.frame_end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_frame_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.frame_end_time = v.map(|x| x.into());
self
}
pub fn set_vm_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.vm_count = v.into();
self
}
pub fn set_vms<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VmUtilizationInfo>,
{
use std::iter::Iterator;
self.vms = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UtilizationReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UtilizationReport"
}
}
pub mod utilization_report {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Succeeded,
Failed,
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::Succeeded => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
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::Succeeded,
3 => Self::Failed,
_ => 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,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
_ => 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::Succeeded => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.vmmigration.v1.UtilizationReport.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TimeFrame {
Unspecified,
Week,
Month,
Year,
UnknownValue(time_frame::UnknownValue),
}
#[doc(hidden)]
pub mod time_frame {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TimeFrame {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Week => std::option::Option::Some(1),
Self::Month => std::option::Option::Some(2),
Self::Year => 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("TIME_FRAME_UNSPECIFIED"),
Self::Week => std::option::Option::Some("WEEK"),
Self::Month => std::option::Option::Some("MONTH"),
Self::Year => std::option::Option::Some("YEAR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TimeFrame {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TimeFrame {
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 TimeFrame {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Week,
2 => Self::Month,
3 => Self::Year,
_ => Self::UnknownValue(time_frame::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TimeFrame {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TIME_FRAME_UNSPECIFIED" => Self::Unspecified,
"WEEK" => Self::Week,
"MONTH" => Self::Month,
"YEAR" => Self::Year,
_ => Self::UnknownValue(time_frame::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TimeFrame {
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::Week => serializer.serialize_i32(1),
Self::Month => serializer.serialize_i32(2),
Self::Year => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TimeFrame {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TimeFrame>::new(
".google.cloud.vmmigration.v1.UtilizationReport.TimeFrame",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmUtilizationInfo {
pub vm_id: std::string::String,
pub utilization: std::option::Option<crate::model::VmUtilizationMetrics>,
pub vm_details: std::option::Option<crate::model::vm_utilization_info::VmDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmUtilizationInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_id = v.into();
self
}
pub fn set_utilization<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VmUtilizationMetrics>,
{
self.utilization = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_utilization<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VmUtilizationMetrics>,
{
self.utilization = v.map(|x| x.into());
self
}
pub fn set_vm_details<
T: std::convert::Into<std::option::Option<crate::model::vm_utilization_info::VmDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vm_details = v.into();
self
}
pub fn vmware_vm_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VmwareVmDetails>> {
#[allow(unreachable_patterns)]
self.vm_details.as_ref().and_then(|v| match v {
crate::model::vm_utilization_info::VmDetails::VmwareVmDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vmware_vm_details<
T: std::convert::Into<std::boxed::Box<crate::model::VmwareVmDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vm_details = std::option::Option::Some(
crate::model::vm_utilization_info::VmDetails::VmwareVmDetails(v.into()),
);
self
}
}
impl wkt::message::Message for VmUtilizationInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmUtilizationInfo"
}
}
pub mod vm_utilization_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmDetails {
VmwareVmDetails(std::boxed::Box<crate::model::VmwareVmDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmUtilizationMetrics {
pub cpu_max_percent: i32,
pub cpu_average_percent: i32,
pub memory_max_percent: i32,
pub memory_average_percent: i32,
pub disk_io_rate_max_kbps: i64,
pub disk_io_rate_average_kbps: i64,
pub network_throughput_max_kbps: i64,
pub network_throughput_average_kbps: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmUtilizationMetrics {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cpu_max_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_max_percent = v.into();
self
}
pub fn set_cpu_average_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_average_percent = v.into();
self
}
pub fn set_memory_max_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.memory_max_percent = v.into();
self
}
pub fn set_memory_average_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.memory_average_percent = v.into();
self
}
pub fn set_disk_io_rate_max_kbps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.disk_io_rate_max_kbps = v.into();
self
}
pub fn set_disk_io_rate_average_kbps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.disk_io_rate_average_kbps = v.into();
self
}
pub fn set_network_throughput_max_kbps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.network_throughput_max_kbps = v.into();
self
}
pub fn set_network_throughput_average_kbps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.network_throughput_average_kbps = v.into();
self
}
}
impl wkt::message::Message for VmUtilizationMetrics {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmUtilizationMetrics"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListUtilizationReportsRequest {
pub parent: std::string::String,
pub view: crate::model::UtilizationReportView,
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 ListUtilizationReportsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::UtilizationReportView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
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 ListUtilizationReportsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListUtilizationReportsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListUtilizationReportsResponse {
pub utilization_reports: std::vec::Vec<crate::model::UtilizationReport>,
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 ListUtilizationReportsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_utilization_reports<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::UtilizationReport>,
{
use std::iter::Iterator;
self.utilization_reports = 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 ListUtilizationReportsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListUtilizationReportsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListUtilizationReportsResponse {
type PageItem = crate::model::UtilizationReport;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.utilization_reports
}
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 GetUtilizationReportRequest {
pub name: std::string::String,
pub view: crate::model::UtilizationReportView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetUtilizationReportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::UtilizationReportView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetUtilizationReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetUtilizationReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateUtilizationReportRequest {
pub parent: std::string::String,
pub utilization_report: std::option::Option<crate::model::UtilizationReport>,
pub utilization_report_id: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateUtilizationReportRequest {
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_utilization_report<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UtilizationReport>,
{
self.utilization_report = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_utilization_report<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UtilizationReport>,
{
self.utilization_report = v.map(|x| x.into());
self
}
pub fn set_utilization_report_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.utilization_report_id = 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 CreateUtilizationReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateUtilizationReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteUtilizationReportRequest {
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 DeleteUtilizationReportRequest {
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 DeleteUtilizationReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DeleteUtilizationReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDatacenterConnectorsResponse {
pub datacenter_connectors: std::vec::Vec<crate::model::DatacenterConnector>,
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 ListDatacenterConnectorsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_datacenter_connectors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DatacenterConnector>,
{
use std::iter::Iterator;
self.datacenter_connectors = 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 ListDatacenterConnectorsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDatacenterConnectorsResponse {
type PageItem = crate::model::DatacenterConnector;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.datacenter_connectors
}
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 GetDatacenterConnectorRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDatacenterConnectorRequest {
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 GetDatacenterConnectorRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetDatacenterConnectorRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDatacenterConnectorRequest {
pub parent: std::string::String,
pub datacenter_connector_id: std::string::String,
pub datacenter_connector: std::option::Option<crate::model::DatacenterConnector>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDatacenterConnectorRequest {
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_datacenter_connector_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.datacenter_connector_id = v.into();
self
}
pub fn set_datacenter_connector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DatacenterConnector>,
{
self.datacenter_connector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_datacenter_connector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DatacenterConnector>,
{
self.datacenter_connector = 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 CreateDatacenterConnectorRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDatacenterConnectorRequest {
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 DeleteDatacenterConnectorRequest {
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 DeleteDatacenterConnectorRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpgradeApplianceRequest {
pub datacenter_connector: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpgradeApplianceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_datacenter_connector<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.datacenter_connector = 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 UpgradeApplianceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UpgradeApplianceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpgradeApplianceResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpgradeApplianceResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpgradeApplianceResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UpgradeApplianceResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDatacenterConnectorsRequest {
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 ListDatacenterConnectorsRequest {
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 ListDatacenterConnectorsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEngineTargetDefaults {
pub vm_name: std::string::String,
pub target_project: std::string::String,
pub zone: std::string::String,
pub machine_type_series: std::string::String,
pub machine_type: std::string::String,
pub network_tags: std::vec::Vec<std::string::String>,
pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
pub service_account: std::string::String,
pub disk_type: crate::model::ComputeEngineDiskType,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub license_type: crate::model::ComputeEngineLicenseType,
pub applied_license: std::option::Option<crate::model::AppliedLicense>,
pub compute_scheduling: std::option::Option<crate::model::ComputeScheduling>,
pub secure_boot: bool,
pub enable_vtpm: bool,
pub enable_integrity_monitoring: bool,
pub boot_option: crate::model::ComputeEngineBootOption,
pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
pub additional_licenses: std::vec::Vec<std::string::String>,
pub hostname: std::string::String,
pub encryption: std::option::Option<crate::model::Encryption>,
pub boot_conversion: crate::model::BootConversion,
pub adaptation_modifiers: std::vec::Vec<crate::model::AdaptationModifier>,
pub disk_replica_zones: std::vec::Vec<std::string::String>,
pub storage_pool: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEngineTargetDefaults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_name = v.into();
self
}
pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_project = 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_machine_type_series<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.machine_type_series = v.into();
self
}
pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_type = v.into();
self
}
pub fn set_network_tags<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.network_tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NetworkInterface>,
{
use std::iter::Iterator;
self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
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_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
mut self,
v: T,
) -> Self {
self.disk_type = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_license_type<T: std::convert::Into<crate::model::ComputeEngineLicenseType>>(
mut self,
v: T,
) -> Self {
self.license_type = v.into();
self
}
pub fn set_applied_license<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AppliedLicense>,
{
self.applied_license = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_applied_license<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AppliedLicense>,
{
self.applied_license = v.map(|x| x.into());
self
}
pub fn set_compute_scheduling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ComputeScheduling>,
{
self.compute_scheduling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_compute_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ComputeScheduling>,
{
self.compute_scheduling = v.map(|x| x.into());
self
}
pub fn set_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.secure_boot = v.into();
self
}
pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_vtpm = v.into();
self
}
pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_integrity_monitoring = v.into();
self
}
pub fn set_boot_option<T: std::convert::Into<crate::model::ComputeEngineBootOption>>(
mut self,
v: T,
) -> Self {
self.boot_option = v.into();
self
}
pub fn set_metadata<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.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_additional_licenses<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.additional_licenses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.hostname = v.into();
self
}
pub fn set_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_boot_conversion<T: std::convert::Into<crate::model::BootConversion>>(
mut self,
v: T,
) -> Self {
self.boot_conversion = v.into();
self
}
pub fn set_adaptation_modifiers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AdaptationModifier>,
{
use std::iter::Iterator;
self.adaptation_modifiers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_disk_replica_zones<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.disk_replica_zones = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.storage_pool = v.into();
self
}
}
impl wkt::message::Message for ComputeEngineTargetDefaults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineTargetDefaults"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdaptationModifier {
pub modifier: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdaptationModifier {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.modifier = v.into();
self
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for AdaptationModifier {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AdaptationModifier"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEngineTargetDetails {
pub vm_name: std::string::String,
pub project: std::string::String,
pub zone: std::string::String,
pub machine_type_series: std::string::String,
pub machine_type: std::string::String,
pub network_tags: std::vec::Vec<std::string::String>,
pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
pub service_account: std::string::String,
pub disk_type: crate::model::ComputeEngineDiskType,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub license_type: crate::model::ComputeEngineLicenseType,
pub applied_license: std::option::Option<crate::model::AppliedLicense>,
pub compute_scheduling: std::option::Option<crate::model::ComputeScheduling>,
pub secure_boot: bool,
pub enable_vtpm: bool,
pub enable_integrity_monitoring: bool,
pub boot_option: crate::model::ComputeEngineBootOption,
pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
pub additional_licenses: std::vec::Vec<std::string::String>,
pub hostname: std::string::String,
pub encryption: std::option::Option<crate::model::Encryption>,
pub boot_conversion: crate::model::BootConversion,
pub adaptation_modifiers: std::vec::Vec<crate::model::AdaptationModifier>,
pub disk_replica_zones: std::vec::Vec<std::string::String>,
pub storage_pool: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEngineTargetDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_name = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = 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_machine_type_series<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.machine_type_series = v.into();
self
}
pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_type = v.into();
self
}
pub fn set_network_tags<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.network_tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NetworkInterface>,
{
use std::iter::Iterator;
self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
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_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
mut self,
v: T,
) -> Self {
self.disk_type = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_license_type<T: std::convert::Into<crate::model::ComputeEngineLicenseType>>(
mut self,
v: T,
) -> Self {
self.license_type = v.into();
self
}
pub fn set_applied_license<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AppliedLicense>,
{
self.applied_license = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_applied_license<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AppliedLicense>,
{
self.applied_license = v.map(|x| x.into());
self
}
pub fn set_compute_scheduling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ComputeScheduling>,
{
self.compute_scheduling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_compute_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ComputeScheduling>,
{
self.compute_scheduling = v.map(|x| x.into());
self
}
pub fn set_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.secure_boot = v.into();
self
}
pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_vtpm = v.into();
self
}
pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_integrity_monitoring = v.into();
self
}
pub fn set_boot_option<T: std::convert::Into<crate::model::ComputeEngineBootOption>>(
mut self,
v: T,
) -> Self {
self.boot_option = v.into();
self
}
pub fn set_metadata<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.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_additional_licenses<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.additional_licenses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.hostname = v.into();
self
}
pub fn set_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_boot_conversion<T: std::convert::Into<crate::model::BootConversion>>(
mut self,
v: T,
) -> Self {
self.boot_conversion = v.into();
self
}
pub fn set_adaptation_modifiers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AdaptationModifier>,
{
use std::iter::Iterator;
self.adaptation_modifiers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_disk_replica_zones<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.disk_replica_zones = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.storage_pool = v.into();
self
}
}
impl wkt::message::Message for ComputeEngineTargetDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineTargetDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkInterface {
pub network: std::string::String,
pub subnetwork: std::string::String,
pub internal_ip: std::string::String,
pub external_ip: std::string::String,
pub network_tier: crate::model::ComputeEngineNetworkTier,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkInterface {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnetwork = v.into();
self
}
pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.internal_ip = v.into();
self
}
pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.external_ip = v.into();
self
}
pub fn set_network_tier<T: std::convert::Into<crate::model::ComputeEngineNetworkTier>>(
mut self,
v: T,
) -> Self {
self.network_tier = v.into();
self
}
}
impl wkt::message::Message for NetworkInterface {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.NetworkInterface"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AppliedLicense {
pub r#type: crate::model::applied_license::Type,
pub os_license: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AppliedLicense {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::applied_license::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_os_license<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.os_license = v.into();
self
}
}
impl wkt::message::Message for AppliedLicense {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AppliedLicense"
}
}
pub mod applied_license {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
None,
Payg,
Byol,
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::None => std::option::Option::Some(1),
Self::Payg => std::option::Option::Some(2),
Self::Byol => 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("TYPE_UNSPECIFIED"),
Self::None => std::option::Option::Some("NONE"),
Self::Payg => std::option::Option::Some("PAYG"),
Self::Byol => std::option::Option::Some("BYOL"),
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::None,
2 => Self::Payg,
3 => Self::Byol,
_ => 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,
"NONE" => Self::None,
"PAYG" => Self::Payg,
"BYOL" => Self::Byol,
_ => 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::None => serializer.serialize_i32(1),
Self::Payg => serializer.serialize_i32(2),
Self::Byol => serializer.serialize_i32(3),
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.vmmigration.v1.AppliedLicense.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SchedulingNodeAffinity {
pub key: std::string::String,
pub operator: crate::model::scheduling_node_affinity::Operator,
pub values: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SchedulingNodeAffinity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_operator<T: std::convert::Into<crate::model::scheduling_node_affinity::Operator>>(
mut self,
v: T,
) -> Self {
self.operator = v.into();
self
}
pub fn set_values<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.values = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SchedulingNodeAffinity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.SchedulingNodeAffinity"
}
}
pub mod scheduling_node_affinity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Operator {
Unspecified,
In,
NotIn,
UnknownValue(operator::UnknownValue),
}
#[doc(hidden)]
pub mod operator {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Operator {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::In => std::option::Option::Some(1),
Self::NotIn => 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("OPERATOR_UNSPECIFIED"),
Self::In => std::option::Option::Some("IN"),
Self::NotIn => std::option::Option::Some("NOT_IN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Operator {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Operator {
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 Operator {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::In,
2 => Self::NotIn,
_ => Self::UnknownValue(operator::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Operator {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OPERATOR_UNSPECIFIED" => Self::Unspecified,
"IN" => Self::In,
"NOT_IN" => Self::NotIn,
_ => Self::UnknownValue(operator::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Operator {
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::In => serializer.serialize_i32(1),
Self::NotIn => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Operator {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operator>::new(
".google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeScheduling {
pub on_host_maintenance: crate::model::compute_scheduling::OnHostMaintenance,
pub restart_type: crate::model::compute_scheduling::RestartType,
pub node_affinities: std::vec::Vec<crate::model::SchedulingNodeAffinity>,
pub min_node_cpus: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeScheduling {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_on_host_maintenance<
T: std::convert::Into<crate::model::compute_scheduling::OnHostMaintenance>,
>(
mut self,
v: T,
) -> Self {
self.on_host_maintenance = v.into();
self
}
pub fn set_restart_type<
T: std::convert::Into<crate::model::compute_scheduling::RestartType>,
>(
mut self,
v: T,
) -> Self {
self.restart_type = v.into();
self
}
pub fn set_node_affinities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SchedulingNodeAffinity>,
{
use std::iter::Iterator;
self.node_affinities = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_min_node_cpus<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.min_node_cpus = v.into();
self
}
}
impl wkt::message::Message for ComputeScheduling {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ComputeScheduling"
}
}
pub mod compute_scheduling {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OnHostMaintenance {
Unspecified,
Terminate,
Migrate,
UnknownValue(on_host_maintenance::UnknownValue),
}
#[doc(hidden)]
pub mod on_host_maintenance {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OnHostMaintenance {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Terminate => std::option::Option::Some(1),
Self::Migrate => 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("ON_HOST_MAINTENANCE_UNSPECIFIED"),
Self::Terminate => std::option::Option::Some("TERMINATE"),
Self::Migrate => std::option::Option::Some("MIGRATE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OnHostMaintenance {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OnHostMaintenance {
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 OnHostMaintenance {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Terminate,
2 => Self::Migrate,
_ => Self::UnknownValue(on_host_maintenance::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OnHostMaintenance {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ON_HOST_MAINTENANCE_UNSPECIFIED" => Self::Unspecified,
"TERMINATE" => Self::Terminate,
"MIGRATE" => Self::Migrate,
_ => Self::UnknownValue(on_host_maintenance::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OnHostMaintenance {
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::Terminate => serializer.serialize_i32(1),
Self::Migrate => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OnHostMaintenance {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OnHostMaintenance>::new(
".google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RestartType {
Unspecified,
AutomaticRestart,
NoAutomaticRestart,
UnknownValue(restart_type::UnknownValue),
}
#[doc(hidden)]
pub mod restart_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RestartType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AutomaticRestart => std::option::Option::Some(1),
Self::NoAutomaticRestart => 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("RESTART_TYPE_UNSPECIFIED"),
Self::AutomaticRestart => std::option::Option::Some("AUTOMATIC_RESTART"),
Self::NoAutomaticRestart => std::option::Option::Some("NO_AUTOMATIC_RESTART"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RestartType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RestartType {
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 RestartType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::AutomaticRestart,
2 => Self::NoAutomaticRestart,
_ => Self::UnknownValue(restart_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RestartType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESTART_TYPE_UNSPECIFIED" => Self::Unspecified,
"AUTOMATIC_RESTART" => Self::AutomaticRestart,
"NO_AUTOMATIC_RESTART" => Self::NoAutomaticRestart,
_ => Self::UnknownValue(restart_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RestartType {
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::AutomaticRestart => serializer.serialize_i32(1),
Self::NoAutomaticRestart => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RestartType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestartType>::new(
".google.cloud.vmmigration.v1.ComputeScheduling.RestartType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEngineDisksTargetDefaults {
pub target_project: std::string::String,
pub disks: std::vec::Vec<crate::model::PersistentDiskDefaults>,
pub location: std::option::Option<crate::model::compute_engine_disks_target_defaults::Location>,
pub vm_target:
std::option::Option<crate::model::compute_engine_disks_target_defaults::VmTarget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEngineDisksTargetDefaults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_project = v.into();
self
}
pub fn set_disks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PersistentDiskDefaults>,
{
use std::iter::Iterator;
self.disks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_location<
T: std::convert::Into<
std::option::Option<crate::model::compute_engine_disks_target_defaults::Location>,
>,
>(
mut self,
v: T,
) -> Self {
self.location = v.into();
self
}
pub fn zone(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.location.as_ref().and_then(|v| match v {
crate::model::compute_engine_disks_target_defaults::Location::Zone(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = std::option::Option::Some(
crate::model::compute_engine_disks_target_defaults::Location::Zone(v.into()),
);
self
}
pub fn set_vm_target<
T: std::convert::Into<
std::option::Option<crate::model::compute_engine_disks_target_defaults::VmTarget>,
>,
>(
mut self,
v: T,
) -> Self {
self.vm_target = v.into();
self
}
pub fn disks_target_defaults(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DisksMigrationDisksTargetDefaults>>
{
#[allow(unreachable_patterns)]
self.vm_target.as_ref().and_then(|v| match v {
crate::model::compute_engine_disks_target_defaults::VmTarget::DisksTargetDefaults(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_disks_target_defaults<
T: std::convert::Into<std::boxed::Box<crate::model::DisksMigrationDisksTargetDefaults>>,
>(
mut self,
v: T,
) -> Self {
self.vm_target = std::option::Option::Some(
crate::model::compute_engine_disks_target_defaults::VmTarget::DisksTargetDefaults(
v.into(),
),
);
self
}
pub fn vm_target_defaults(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DisksMigrationVmTargetDefaults>> {
#[allow(unreachable_patterns)]
self.vm_target.as_ref().and_then(|v| match v {
crate::model::compute_engine_disks_target_defaults::VmTarget::VmTargetDefaults(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vm_target_defaults<
T: std::convert::Into<std::boxed::Box<crate::model::DisksMigrationVmTargetDefaults>>,
>(
mut self,
v: T,
) -> Self {
self.vm_target = std::option::Option::Some(
crate::model::compute_engine_disks_target_defaults::VmTarget::VmTargetDefaults(
v.into(),
),
);
self
}
}
impl wkt::message::Message for ComputeEngineDisksTargetDefaults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineDisksTargetDefaults"
}
}
pub mod compute_engine_disks_target_defaults {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Location {
Zone(std::string::String),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmTarget {
DisksTargetDefaults(std::boxed::Box<crate::model::DisksMigrationDisksTargetDefaults>),
VmTargetDefaults(std::boxed::Box<crate::model::DisksMigrationVmTargetDefaults>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PersistentDiskDefaults {
pub source_disk_number: i32,
pub disk_name: std::string::String,
pub disk_type: crate::model::ComputeEngineDiskType,
pub additional_labels: std::collections::HashMap<std::string::String, std::string::String>,
pub encryption: std::option::Option<crate::model::Encryption>,
pub vm_attachment_details: std::option::Option<crate::model::VmAttachmentDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PersistentDiskDefaults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.source_disk_number = v.into();
self
}
pub fn set_disk_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.disk_name = v.into();
self
}
pub fn set_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
mut self,
v: T,
) -> Self {
self.disk_type = v.into();
self
}
pub fn set_additional_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.additional_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_vm_attachment_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VmAttachmentDetails>,
{
self.vm_attachment_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vm_attachment_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VmAttachmentDetails>,
{
self.vm_attachment_details = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PersistentDiskDefaults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.PersistentDiskDefaults"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmAttachmentDetails {
pub device_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmAttachmentDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_device_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.device_name = v.into();
self
}
}
impl wkt::message::Message for VmAttachmentDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmAttachmentDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisksMigrationDisksTargetDefaults {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisksMigrationDisksTargetDefaults {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DisksMigrationDisksTargetDefaults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DisksMigrationDisksTargetDefaults"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisksMigrationVmTargetDefaults {
pub vm_name: std::string::String,
pub machine_type_series: std::string::String,
pub machine_type: std::string::String,
pub network_tags: std::vec::Vec<std::string::String>,
pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
pub service_account: std::string::String,
pub compute_scheduling: std::option::Option<crate::model::ComputeScheduling>,
pub secure_boot: bool,
pub enable_vtpm: bool,
pub enable_integrity_monitoring: bool,
pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
pub additional_licenses: std::vec::Vec<std::string::String>,
pub hostname: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub boot_disk_defaults: std::option::Option<crate::model::BootDiskDefaults>,
pub encryption: std::option::Option<crate::model::Encryption>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisksMigrationVmTargetDefaults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_name = v.into();
self
}
pub fn set_machine_type_series<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.machine_type_series = v.into();
self
}
pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_type = v.into();
self
}
pub fn set_network_tags<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.network_tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NetworkInterface>,
{
use std::iter::Iterator;
self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
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_compute_scheduling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ComputeScheduling>,
{
self.compute_scheduling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_compute_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ComputeScheduling>,
{
self.compute_scheduling = v.map(|x| x.into());
self
}
pub fn set_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.secure_boot = v.into();
self
}
pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_vtpm = v.into();
self
}
pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_integrity_monitoring = v.into();
self
}
pub fn set_metadata<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.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_additional_licenses<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.additional_licenses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.hostname = 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_boot_disk_defaults<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BootDiskDefaults>,
{
self.boot_disk_defaults = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_boot_disk_defaults<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BootDiskDefaults>,
{
self.boot_disk_defaults = v.map(|x| x.into());
self
}
pub fn set_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DisksMigrationVmTargetDefaults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BootDiskDefaults {
pub disk_name: std::string::String,
pub disk_type: crate::model::ComputeEngineDiskType,
pub device_name: std::string::String,
pub encryption: std::option::Option<crate::model::Encryption>,
pub source: std::option::Option<crate::model::boot_disk_defaults::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BootDiskDefaults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disk_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.disk_name = v.into();
self
}
pub fn set_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
mut self,
v: T,
) -> Self {
self.disk_type = v.into();
self
}
pub fn set_device_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.device_name = v.into();
self
}
pub fn set_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::boot_disk_defaults::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn image(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::boot_disk_defaults::DiskImageDefaults>>
{
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::boot_disk_defaults::Source::Image(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_image<
T: std::convert::Into<std::boxed::Box<crate::model::boot_disk_defaults::DiskImageDefaults>>,
>(
mut self,
v: T,
) -> Self {
self.source =
std::option::Option::Some(crate::model::boot_disk_defaults::Source::Image(v.into()));
self
}
}
impl wkt::message::Message for BootDiskDefaults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.BootDiskDefaults"
}
}
pub mod boot_disk_defaults {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskImageDefaults {
pub source_image: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskImageDefaults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_image<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_image = v.into();
self
}
}
impl wkt::message::Message for DiskImageDefaults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.BootDiskDefaults.DiskImageDefaults"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
Image(std::boxed::Box<crate::model::boot_disk_defaults::DiskImageDefaults>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEngineDisksTargetDetails {
pub disks: std::vec::Vec<crate::model::PersistentDisk>,
pub vm_target: std::option::Option<crate::model::compute_engine_disks_target_details::VmTarget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEngineDisksTargetDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PersistentDisk>,
{
use std::iter::Iterator;
self.disks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_vm_target<
T: std::convert::Into<
std::option::Option<crate::model::compute_engine_disks_target_details::VmTarget>,
>,
>(
mut self,
v: T,
) -> Self {
self.vm_target = v.into();
self
}
pub fn disks_target_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DisksMigrationDisksTargetDetails>> {
#[allow(unreachable_patterns)]
self.vm_target.as_ref().and_then(|v| match v {
crate::model::compute_engine_disks_target_details::VmTarget::DisksTargetDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_disks_target_details<
T: std::convert::Into<std::boxed::Box<crate::model::DisksMigrationDisksTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vm_target = std::option::Option::Some(
crate::model::compute_engine_disks_target_details::VmTarget::DisksTargetDetails(
v.into(),
),
);
self
}
pub fn vm_target_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DisksMigrationVmTargetDetails>> {
#[allow(unreachable_patterns)]
self.vm_target.as_ref().and_then(|v| match v {
crate::model::compute_engine_disks_target_details::VmTarget::VmTargetDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vm_target_details<
T: std::convert::Into<std::boxed::Box<crate::model::DisksMigrationVmTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vm_target = std::option::Option::Some(
crate::model::compute_engine_disks_target_details::VmTarget::VmTargetDetails(v.into()),
);
self
}
}
impl wkt::message::Message for ComputeEngineDisksTargetDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetails"
}
}
pub mod compute_engine_disks_target_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmTarget {
DisksTargetDetails(std::boxed::Box<crate::model::DisksMigrationDisksTargetDetails>),
VmTargetDetails(std::boxed::Box<crate::model::DisksMigrationVmTargetDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PersistentDisk {
pub source_disk_number: i32,
pub disk_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PersistentDisk {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.source_disk_number = v.into();
self
}
pub fn set_disk_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.disk_uri = v.into();
self
}
}
impl wkt::message::Message for PersistentDisk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.PersistentDisk"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisksMigrationDisksTargetDetails {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisksMigrationDisksTargetDetails {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DisksMigrationDisksTargetDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DisksMigrationDisksTargetDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisksMigrationVmTargetDetails {
pub vm_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisksMigrationVmTargetDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vm_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_uri = v.into();
self
}
}
impl wkt::message::Message for DisksMigrationVmTargetDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DisksMigrationVmTargetDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SchedulePolicy {
pub idle_duration: std::option::Option<wkt::Duration>,
pub skip_os_adaptation: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SchedulePolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_idle_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.idle_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_idle_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.idle_duration = v.map(|x| x.into());
self
}
pub fn set_skip_os_adaptation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.skip_os_adaptation = v.into();
self
}
}
impl wkt::message::Message for SchedulePolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.SchedulePolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMigratingVmRequest {
pub parent: std::string::String,
pub migrating_vm_id: std::string::String,
pub migrating_vm: std::option::Option<crate::model::MigratingVm>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMigratingVmRequest {
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_migrating_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migrating_vm_id = v.into();
self
}
pub fn set_migrating_vm<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MigratingVm>,
{
self.migrating_vm = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_migrating_vm<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MigratingVm>,
{
self.migrating_vm = 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 CreateMigratingVmRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateMigratingVmRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMigratingVmsRequest {
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 view: crate::model::MigratingVmView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMigratingVmsRequest {
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
}
pub fn set_view<T: std::convert::Into<crate::model::MigratingVmView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListMigratingVmsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListMigratingVmsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMigratingVmsResponse {
pub migrating_vms: std::vec::Vec<crate::model::MigratingVm>,
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 ListMigratingVmsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migrating_vms<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MigratingVm>,
{
use std::iter::Iterator;
self.migrating_vms = 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 ListMigratingVmsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListMigratingVmsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMigratingVmsResponse {
type PageItem = crate::model::MigratingVm;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.migrating_vms
}
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 GetMigratingVmRequest {
pub name: std::string::String,
pub view: crate::model::MigratingVmView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMigratingVmRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::MigratingVmView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetMigratingVmRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetMigratingVmRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMigratingVmRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub migrating_vm: std::option::Option<crate::model::MigratingVm>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMigratingVmRequest {
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_migrating_vm<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MigratingVm>,
{
self.migrating_vm = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_migrating_vm<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MigratingVm>,
{
self.migrating_vm = 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 UpdateMigratingVmRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UpdateMigratingVmRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMigratingVmRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMigratingVmRequest {
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 DeleteMigratingVmRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DeleteMigratingVmRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartMigrationRequest {
pub migrating_vm: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StartMigrationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migrating_vm = v.into();
self
}
}
impl wkt::message::Message for StartMigrationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.StartMigrationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartMigrationResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StartMigrationResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for StartMigrationResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.StartMigrationResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PauseMigrationRequest {
pub migrating_vm: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PauseMigrationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migrating_vm = v.into();
self
}
}
impl wkt::message::Message for PauseMigrationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.PauseMigrationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PauseMigrationResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PauseMigrationResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for PauseMigrationResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.PauseMigrationResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResumeMigrationRequest {
pub migrating_vm: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResumeMigrationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migrating_vm = v.into();
self
}
}
impl wkt::message::Message for ResumeMigrationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ResumeMigrationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResumeMigrationResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResumeMigrationResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ResumeMigrationResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ResumeMigrationResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FinalizeMigrationRequest {
pub migrating_vm: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FinalizeMigrationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migrating_vm = v.into();
self
}
}
impl wkt::message::Message for FinalizeMigrationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.FinalizeMigrationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExtendMigrationRequest {
pub migrating_vm: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExtendMigrationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migrating_vm = v.into();
self
}
}
impl wkt::message::Message for ExtendMigrationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ExtendMigrationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExtendMigrationResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExtendMigrationResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ExtendMigrationResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ExtendMigrationResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FinalizeMigrationResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FinalizeMigrationResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for FinalizeMigrationResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.FinalizeMigrationResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetProject {
pub name: std::string::String,
pub project: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetProject {
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_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = 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_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
}
}
impl wkt::message::Message for TargetProject {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.TargetProject"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetTargetProjectRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTargetProjectRequest {
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 GetTargetProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetTargetProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTargetProjectsRequest {
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 ListTargetProjectsRequest {
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 ListTargetProjectsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListTargetProjectsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTargetProjectsResponse {
pub target_projects: std::vec::Vec<crate::model::TargetProject>,
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 ListTargetProjectsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_projects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TargetProject>,
{
use std::iter::Iterator;
self.target_projects = 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 ListTargetProjectsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListTargetProjectsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTargetProjectsResponse {
type PageItem = crate::model::TargetProject;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.target_projects
}
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 CreateTargetProjectRequest {
pub parent: std::string::String,
pub target_project_id: std::string::String,
pub target_project: std::option::Option<crate::model::TargetProject>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTargetProjectRequest {
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_target_project_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.target_project_id = v.into();
self
}
pub fn set_target_project<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TargetProject>,
{
self.target_project = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target_project<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TargetProject>,
{
self.target_project = 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 CreateTargetProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateTargetProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTargetProjectRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub target_project: std::option::Option<crate::model::TargetProject>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTargetProjectRequest {
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_target_project<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TargetProject>,
{
self.target_project = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target_project<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TargetProject>,
{
self.target_project = 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 UpdateTargetProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UpdateTargetProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTargetProjectRequest {
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 DeleteTargetProjectRequest {
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 DeleteTargetProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DeleteTargetProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Group {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub description: std::string::String,
pub display_name: std::string::String,
pub migration_target_type: crate::model::group::MigrationTargetType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Group {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_migration_target_type<
T: std::convert::Into<crate::model::group::MigrationTargetType>,
>(
mut self,
v: T,
) -> Self {
self.migration_target_type = v.into();
self
}
}
impl wkt::message::Message for Group {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.Group"
}
}
pub mod group {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MigrationTargetType {
Unspecified,
Gce,
Disks,
UnknownValue(migration_target_type::UnknownValue),
}
#[doc(hidden)]
pub mod migration_target_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MigrationTargetType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Gce => std::option::Option::Some(1),
Self::Disks => 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("MIGRATION_TARGET_TYPE_UNSPECIFIED"),
Self::Gce => std::option::Option::Some("MIGRATION_TARGET_TYPE_GCE"),
Self::Disks => std::option::Option::Some("MIGRATION_TARGET_TYPE_DISKS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MigrationTargetType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MigrationTargetType {
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 MigrationTargetType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Gce,
2 => Self::Disks,
_ => Self::UnknownValue(migration_target_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MigrationTargetType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MIGRATION_TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
"MIGRATION_TARGET_TYPE_GCE" => Self::Gce,
"MIGRATION_TARGET_TYPE_DISKS" => Self::Disks,
_ => Self::UnknownValue(migration_target_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MigrationTargetType {
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::Gce => serializer.serialize_i32(1),
Self::Disks => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MigrationTargetType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationTargetType>::new(
".google.cloud.vmmigration.v1.Group.MigrationTargetType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGroupsRequest {
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 ListGroupsRequest {
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 ListGroupsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListGroupsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGroupsResponse {
pub groups: std::vec::Vec<crate::model::Group>,
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 ListGroupsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Group>,
{
use std::iter::Iterator;
self.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 ListGroupsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListGroupsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListGroupsResponse {
type PageItem = crate::model::Group;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.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 GetGroupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetGroupRequest {
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 GetGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateGroupRequest {
pub parent: std::string::String,
pub group_id: std::string::String,
pub group: std::option::Option<crate::model::Group>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateGroupRequest {
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_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group_id = v.into();
self
}
pub fn set_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Group>,
{
self.group = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Group>,
{
self.group = 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 CreateGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateGroupRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub group: std::option::Option<crate::model::Group>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateGroupRequest {
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_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Group>,
{
self.group = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Group>,
{
self.group = 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 UpdateGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UpdateGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteGroupRequest {
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 DeleteGroupRequest {
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 DeleteGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DeleteGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AddGroupMigrationRequest {
pub group: std::string::String,
pub migrating_vm: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AddGroupMigrationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group = v.into();
self
}
pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migrating_vm = v.into();
self
}
}
impl wkt::message::Message for AddGroupMigrationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AddGroupMigrationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AddGroupMigrationResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AddGroupMigrationResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for AddGroupMigrationResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AddGroupMigrationResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoveGroupMigrationRequest {
pub group: std::string::String,
pub migrating_vm: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RemoveGroupMigrationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group = v.into();
self
}
pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.migrating_vm = v.into();
self
}
}
impl wkt::message::Message for RemoveGroupMigrationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.RemoveGroupMigrationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoveGroupMigrationResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RemoveGroupMigrationResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for RemoveGroupMigrationResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.RemoveGroupMigrationResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCutoverJobRequest {
pub parent: std::string::String,
pub cutover_job_id: std::string::String,
pub cutover_job: std::option::Option<crate::model::CutoverJob>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCutoverJobRequest {
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_cutover_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cutover_job_id = v.into();
self
}
pub fn set_cutover_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CutoverJob>,
{
self.cutover_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cutover_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CutoverJob>,
{
self.cutover_job = 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 CreateCutoverJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateCutoverJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelCutoverJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelCutoverJobRequest {
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 CancelCutoverJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CancelCutoverJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelCutoverJobResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelCutoverJobResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CancelCutoverJobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CancelCutoverJobResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCutoverJobsRequest {
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 ListCutoverJobsRequest {
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 ListCutoverJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListCutoverJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCutoverJobsResponse {
pub cutover_jobs: std::vec::Vec<crate::model::CutoverJob>,
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 ListCutoverJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cutover_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CutoverJob>,
{
use std::iter::Iterator;
self.cutover_jobs = 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 ListCutoverJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListCutoverJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCutoverJobsResponse {
type PageItem = crate::model::CutoverJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.cutover_jobs
}
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 GetCutoverJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCutoverJobRequest {
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 GetCutoverJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetCutoverJobRequest"
}
}
#[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.vmmigration.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MigrationError {
pub code: crate::model::migration_error::ErrorCode,
pub error_message: std::option::Option<google_cloud_rpc::model::LocalizedMessage>,
pub action_item: std::option::Option<google_cloud_rpc::model::LocalizedMessage>,
pub help_links: std::vec::Vec<google_cloud_rpc::model::help::Link>,
pub error_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MigrationError {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_code<T: std::convert::Into<crate::model::migration_error::ErrorCode>>(
mut self,
v: T,
) -> Self {
self.code = v.into();
self
}
pub fn set_error_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
{
self.error_message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
{
self.error_message = v.map(|x| x.into());
self
}
pub fn set_action_item<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
{
self.action_item = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_action_item<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
{
self.action_item = v.map(|x| x.into());
self
}
pub fn set_help_links<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_rpc::model::help::Link>,
{
use std::iter::Iterator;
self.help_links = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_error_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.error_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.error_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MigrationError {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.MigrationError"
}
}
pub mod migration_error {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ErrorCode {
Unspecified,
UnknownError,
SourceValidationError,
SourceReplicationError,
TargetReplicationError,
OsAdaptationError,
CloneError,
CutoverError,
UtilizationReportError,
ApplianceUpgradeError,
ImageImportError,
DiskMigrationError,
UnknownValue(error_code::UnknownValue),
}
#[doc(hidden)]
pub mod error_code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ErrorCode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::UnknownError => std::option::Option::Some(1),
Self::SourceValidationError => std::option::Option::Some(2),
Self::SourceReplicationError => std::option::Option::Some(3),
Self::TargetReplicationError => std::option::Option::Some(4),
Self::OsAdaptationError => std::option::Option::Some(5),
Self::CloneError => std::option::Option::Some(6),
Self::CutoverError => std::option::Option::Some(7),
Self::UtilizationReportError => std::option::Option::Some(8),
Self::ApplianceUpgradeError => std::option::Option::Some(9),
Self::ImageImportError => std::option::Option::Some(10),
Self::DiskMigrationError => 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("ERROR_CODE_UNSPECIFIED"),
Self::UnknownError => std::option::Option::Some("UNKNOWN_ERROR"),
Self::SourceValidationError => std::option::Option::Some("SOURCE_VALIDATION_ERROR"),
Self::SourceReplicationError => {
std::option::Option::Some("SOURCE_REPLICATION_ERROR")
}
Self::TargetReplicationError => {
std::option::Option::Some("TARGET_REPLICATION_ERROR")
}
Self::OsAdaptationError => std::option::Option::Some("OS_ADAPTATION_ERROR"),
Self::CloneError => std::option::Option::Some("CLONE_ERROR"),
Self::CutoverError => std::option::Option::Some("CUTOVER_ERROR"),
Self::UtilizationReportError => {
std::option::Option::Some("UTILIZATION_REPORT_ERROR")
}
Self::ApplianceUpgradeError => std::option::Option::Some("APPLIANCE_UPGRADE_ERROR"),
Self::ImageImportError => std::option::Option::Some("IMAGE_IMPORT_ERROR"),
Self::DiskMigrationError => std::option::Option::Some("DISK_MIGRATION_ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ErrorCode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ErrorCode {
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 ErrorCode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::UnknownError,
2 => Self::SourceValidationError,
3 => Self::SourceReplicationError,
4 => Self::TargetReplicationError,
5 => Self::OsAdaptationError,
6 => Self::CloneError,
7 => Self::CutoverError,
8 => Self::UtilizationReportError,
9 => Self::ApplianceUpgradeError,
10 => Self::ImageImportError,
11 => Self::DiskMigrationError,
_ => Self::UnknownValue(error_code::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ErrorCode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
"UNKNOWN_ERROR" => Self::UnknownError,
"SOURCE_VALIDATION_ERROR" => Self::SourceValidationError,
"SOURCE_REPLICATION_ERROR" => Self::SourceReplicationError,
"TARGET_REPLICATION_ERROR" => Self::TargetReplicationError,
"OS_ADAPTATION_ERROR" => Self::OsAdaptationError,
"CLONE_ERROR" => Self::CloneError,
"CUTOVER_ERROR" => Self::CutoverError,
"UTILIZATION_REPORT_ERROR" => Self::UtilizationReportError,
"APPLIANCE_UPGRADE_ERROR" => Self::ApplianceUpgradeError,
"IMAGE_IMPORT_ERROR" => Self::ImageImportError,
"DISK_MIGRATION_ERROR" => Self::DiskMigrationError,
_ => Self::UnknownValue(error_code::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ErrorCode {
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::UnknownError => serializer.serialize_i32(1),
Self::SourceValidationError => serializer.serialize_i32(2),
Self::SourceReplicationError => serializer.serialize_i32(3),
Self::TargetReplicationError => serializer.serialize_i32(4),
Self::OsAdaptationError => serializer.serialize_i32(5),
Self::CloneError => serializer.serialize_i32(6),
Self::CutoverError => serializer.serialize_i32(7),
Self::UtilizationReportError => serializer.serialize_i32(8),
Self::ApplianceUpgradeError => serializer.serialize_i32(9),
Self::ImageImportError => serializer.serialize_i32(10),
Self::DiskMigrationError => serializer.serialize_i32(11),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ErrorCode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
".google.cloud.vmmigration.v1.MigrationError.ErrorCode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MigrationWarning {
pub code: crate::model::migration_warning::WarningCode,
pub warning_message: std::option::Option<google_cloud_rpc::model::LocalizedMessage>,
pub action_item: std::option::Option<google_cloud_rpc::model::LocalizedMessage>,
pub help_links: std::vec::Vec<google_cloud_rpc::model::help::Link>,
pub warning_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MigrationWarning {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_code<T: std::convert::Into<crate::model::migration_warning::WarningCode>>(
mut self,
v: T,
) -> Self {
self.code = v.into();
self
}
pub fn set_warning_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
{
self.warning_message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_warning_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
{
self.warning_message = v.map(|x| x.into());
self
}
pub fn set_action_item<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
{
self.action_item = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_action_item<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
{
self.action_item = v.map(|x| x.into());
self
}
pub fn set_help_links<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_rpc::model::help::Link>,
{
use std::iter::Iterator;
self.help_links = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_warning_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.warning_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_warning_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.warning_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MigrationWarning {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.MigrationWarning"
}
}
pub mod migration_warning {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum WarningCode {
Unspecified,
AdaptationWarning,
UnknownValue(warning_code::UnknownValue),
}
#[doc(hidden)]
pub mod warning_code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl WarningCode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AdaptationWarning => 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("WARNING_CODE_UNSPECIFIED"),
Self::AdaptationWarning => std::option::Option::Some("ADAPTATION_WARNING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for WarningCode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for WarningCode {
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 WarningCode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::AdaptationWarning,
_ => Self::UnknownValue(warning_code::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for WarningCode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
"ADAPTATION_WARNING" => Self::AdaptationWarning,
_ => Self::UnknownValue(warning_code::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for WarningCode {
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::AdaptationWarning => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for WarningCode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<WarningCode>::new(
".google.cloud.vmmigration.v1.MigrationWarning.WarningCode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareSourceVmDetails {
pub firmware: crate::model::vmware_source_vm_details::Firmware,
pub committed_storage_bytes: i64,
pub disks: std::vec::Vec<crate::model::vmware_source_vm_details::VmwareDiskDetails>,
pub vm_capabilities_info: std::option::Option<crate::model::VmCapabilities>,
pub architecture: crate::model::VmArchitecture,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareSourceVmDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_firmware<T: std::convert::Into<crate::model::vmware_source_vm_details::Firmware>>(
mut self,
v: T,
) -> Self {
self.firmware = v.into();
self
}
pub fn set_committed_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.committed_storage_bytes = v.into();
self
}
pub fn set_disks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::vmware_source_vm_details::VmwareDiskDetails>,
{
use std::iter::Iterator;
self.disks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_vm_capabilities_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VmCapabilities>,
{
self.vm_capabilities_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vm_capabilities_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VmCapabilities>,
{
self.vm_capabilities_info = v.map(|x| x.into());
self
}
pub fn set_architecture<T: std::convert::Into<crate::model::VmArchitecture>>(
mut self,
v: T,
) -> Self {
self.architecture = v.into();
self
}
}
impl wkt::message::Message for VmwareSourceVmDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmwareSourceVmDetails"
}
}
pub mod vmware_source_vm_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareDiskDetails {
pub disk_number: i32,
pub size_gb: i64,
pub label: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareDiskDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.disk_number = v.into();
self
}
pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size_gb = v.into();
self
}
pub fn set_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.label = v.into();
self
}
}
impl wkt::message::Message for VmwareDiskDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmwareSourceVmDetails.VmwareDiskDetails"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Firmware {
Unspecified,
Efi,
Bios,
UnknownValue(firmware::UnknownValue),
}
#[doc(hidden)]
pub mod firmware {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Firmware {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Efi => std::option::Option::Some(1),
Self::Bios => 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("FIRMWARE_UNSPECIFIED"),
Self::Efi => std::option::Option::Some("EFI"),
Self::Bios => std::option::Option::Some("BIOS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Firmware {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Firmware {
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 Firmware {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Efi,
2 => Self::Bios,
_ => Self::UnknownValue(firmware::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Firmware {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FIRMWARE_UNSPECIFIED" => Self::Unspecified,
"EFI" => Self::Efi,
"BIOS" => Self::Bios,
_ => Self::UnknownValue(firmware::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Firmware {
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::Efi => serializer.serialize_i32(1),
Self::Bios => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Firmware {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Firmware>::new(
".google.cloud.vmmigration.v1.VmwareSourceVmDetails.Firmware",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsSourceVmDetails {
pub firmware: crate::model::aws_source_vm_details::Firmware,
pub committed_storage_bytes: i64,
pub disks: std::vec::Vec<crate::model::aws_source_vm_details::AwsDiskDetails>,
pub vm_capabilities_info: std::option::Option<crate::model::VmCapabilities>,
pub architecture: crate::model::VmArchitecture,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsSourceVmDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_firmware<T: std::convert::Into<crate::model::aws_source_vm_details::Firmware>>(
mut self,
v: T,
) -> Self {
self.firmware = v.into();
self
}
pub fn set_committed_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.committed_storage_bytes = v.into();
self
}
pub fn set_disks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::aws_source_vm_details::AwsDiskDetails>,
{
use std::iter::Iterator;
self.disks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_vm_capabilities_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VmCapabilities>,
{
self.vm_capabilities_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vm_capabilities_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VmCapabilities>,
{
self.vm_capabilities_info = v.map(|x| x.into());
self
}
pub fn set_architecture<T: std::convert::Into<crate::model::VmArchitecture>>(
mut self,
v: T,
) -> Self {
self.architecture = v.into();
self
}
}
impl wkt::message::Message for AwsSourceVmDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceVmDetails"
}
}
pub mod aws_source_vm_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsDiskDetails {
pub disk_number: i32,
pub volume_id: std::string::String,
pub size_gb: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsDiskDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.disk_number = 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_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size_gb = v.into();
self
}
}
impl wkt::message::Message for AwsDiskDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceVmDetails.AwsDiskDetails"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Firmware {
Unspecified,
Efi,
Bios,
UnknownValue(firmware::UnknownValue),
}
#[doc(hidden)]
pub mod firmware {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Firmware {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Efi => std::option::Option::Some(1),
Self::Bios => 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("FIRMWARE_UNSPECIFIED"),
Self::Efi => std::option::Option::Some("EFI"),
Self::Bios => std::option::Option::Some("BIOS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Firmware {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Firmware {
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 Firmware {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Efi,
2 => Self::Bios,
_ => Self::UnknownValue(firmware::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Firmware {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FIRMWARE_UNSPECIFIED" => Self::Unspecified,
"EFI" => Self::Efi,
"BIOS" => Self::Bios,
_ => Self::UnknownValue(firmware::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Firmware {
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::Efi => serializer.serialize_i32(1),
Self::Bios => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Firmware {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Firmware>::new(
".google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureSourceVmDetails {
pub firmware: crate::model::azure_source_vm_details::Firmware,
pub committed_storage_bytes: i64,
pub disks: std::vec::Vec<crate::model::azure_source_vm_details::AzureDiskDetails>,
pub vm_capabilities_info: std::option::Option<crate::model::VmCapabilities>,
pub architecture: crate::model::VmArchitecture,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureSourceVmDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_firmware<T: std::convert::Into<crate::model::azure_source_vm_details::Firmware>>(
mut self,
v: T,
) -> Self {
self.firmware = v.into();
self
}
pub fn set_committed_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.committed_storage_bytes = v.into();
self
}
pub fn set_disks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::azure_source_vm_details::AzureDiskDetails>,
{
use std::iter::Iterator;
self.disks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_vm_capabilities_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VmCapabilities>,
{
self.vm_capabilities_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vm_capabilities_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VmCapabilities>,
{
self.vm_capabilities_info = v.map(|x| x.into());
self
}
pub fn set_architecture<T: std::convert::Into<crate::model::VmArchitecture>>(
mut self,
v: T,
) -> Self {
self.architecture = v.into();
self
}
}
impl wkt::message::Message for AzureSourceVmDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureSourceVmDetails"
}
}
pub mod azure_source_vm_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureDiskDetails {
pub disk_number: i32,
pub disk_id: std::string::String,
pub size_gb: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureDiskDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.disk_number = v.into();
self
}
pub fn set_disk_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.disk_id = v.into();
self
}
pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size_gb = v.into();
self
}
}
impl wkt::message::Message for AzureDiskDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AzureSourceVmDetails.AzureDiskDetails"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Firmware {
Unspecified,
Efi,
Bios,
UnknownValue(firmware::UnknownValue),
}
#[doc(hidden)]
pub mod firmware {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Firmware {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Efi => std::option::Option::Some(1),
Self::Bios => 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("FIRMWARE_UNSPECIFIED"),
Self::Efi => std::option::Option::Some("EFI"),
Self::Bios => std::option::Option::Some("BIOS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Firmware {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Firmware {
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 Firmware {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Efi,
2 => Self::Bios,
_ => Self::UnknownValue(firmware::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Firmware {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FIRMWARE_UNSPECIFIED" => Self::Unspecified,
"EFI" => Self::Efi,
"BIOS" => Self::Bios,
_ => Self::UnknownValue(firmware::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Firmware {
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::Efi => serializer.serialize_i32(1),
Self::Bios => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Firmware {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Firmware>::new(
".google.cloud.vmmigration.v1.AzureSourceVmDetails.Firmware",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReplicationCyclesRequest {
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 ListReplicationCyclesRequest {
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 ListReplicationCyclesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListReplicationCyclesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReplicationCyclesResponse {
pub replication_cycles: std::vec::Vec<crate::model::ReplicationCycle>,
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 ListReplicationCyclesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_replication_cycles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ReplicationCycle>,
{
use std::iter::Iterator;
self.replication_cycles = 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 ListReplicationCyclesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListReplicationCyclesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationCyclesResponse {
type PageItem = crate::model::ReplicationCycle;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.replication_cycles
}
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 GetReplicationCycleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetReplicationCycleRequest {
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 GetReplicationCycleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetReplicationCycleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmCapabilities {
pub os_capabilities: std::vec::Vec<crate::model::OsCapability>,
pub last_os_capabilities_update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmCapabilities {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_os_capabilities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::OsCapability>,
{
use std::iter::Iterator;
self.os_capabilities = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_last_os_capabilities_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_os_capabilities_update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_os_capabilities_update_time<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_os_capabilities_update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for VmCapabilities {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.VmCapabilities"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImageImport {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub recent_image_import_jobs: std::vec::Vec<crate::model::ImageImportJob>,
pub encryption: std::option::Option<crate::model::Encryption>,
pub source: std::option::Option<crate::model::image_import::Source>,
pub target_defaults: std::option::Option<crate::model::image_import::TargetDefaults>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImageImport {
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_recent_image_import_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImageImportJob>,
{
use std::iter::Iterator;
self.recent_image_import_jobs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::image_import::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn cloud_storage_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::image_import::Source::CloudStorageUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_cloud_storage_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::image_import::Source::CloudStorageUri(v.into()),
);
self
}
pub fn set_target_defaults<
T: std::convert::Into<std::option::Option<crate::model::image_import::TargetDefaults>>,
>(
mut self,
v: T,
) -> Self {
self.target_defaults = v.into();
self
}
pub fn disk_image_target_defaults(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DiskImageTargetDetails>> {
#[allow(unreachable_patterns)]
self.target_defaults.as_ref().and_then(|v| match v {
crate::model::image_import::TargetDefaults::DiskImageTargetDefaults(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_disk_image_target_defaults<
T: std::convert::Into<std::boxed::Box<crate::model::DiskImageTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_defaults = std::option::Option::Some(
crate::model::image_import::TargetDefaults::DiskImageTargetDefaults(v.into()),
);
self
}
pub fn machine_image_target_defaults(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MachineImageTargetDetails>> {
#[allow(unreachable_patterns)]
self.target_defaults.as_ref().and_then(|v| match v {
crate::model::image_import::TargetDefaults::MachineImageTargetDefaults(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_machine_image_target_defaults<
T: std::convert::Into<std::boxed::Box<crate::model::MachineImageTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_defaults = std::option::Option::Some(
crate::model::image_import::TargetDefaults::MachineImageTargetDefaults(v.into()),
);
self
}
}
impl wkt::message::Message for ImageImport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ImageImport"
}
}
pub mod image_import {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
CloudStorageUri(std::string::String),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TargetDefaults {
DiskImageTargetDefaults(std::boxed::Box<crate::model::DiskImageTargetDetails>),
MachineImageTargetDefaults(std::boxed::Box<crate::model::MachineImageTargetDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImageImportJob {
pub name: std::string::String,
pub created_resources: std::vec::Vec<std::string::String>,
pub state: crate::model::image_import_job::State,
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
pub warnings: std::vec::Vec<crate::model::MigrationWarning>,
pub steps: std::vec::Vec<crate::model::ImageImportStep>,
pub source: std::option::Option<crate::model::image_import_job::Source>,
pub target_details: std::option::Option<crate::model::image_import_job::TargetDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImageImportJob {
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_created_resources<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.created_resources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_state<T: std::convert::Into<crate::model::image_import_job::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_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_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_rpc::model::Status>,
{
use std::iter::Iterator;
self.errors = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MigrationWarning>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_steps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImageImportStep>,
{
use std::iter::Iterator;
self.steps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::image_import_job::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn cloud_storage_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::image_import_job::Source::CloudStorageUri(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_cloud_storage_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::image_import_job::Source::CloudStorageUri(v.into()),
);
self
}
pub fn set_target_details<
T: std::convert::Into<std::option::Option<crate::model::image_import_job::TargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_details = v.into();
self
}
pub fn disk_image_target_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DiskImageTargetDetails>> {
#[allow(unreachable_patterns)]
self.target_details.as_ref().and_then(|v| match v {
crate::model::image_import_job::TargetDetails::DiskImageTargetDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_disk_image_target_details<
T: std::convert::Into<std::boxed::Box<crate::model::DiskImageTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_details = std::option::Option::Some(
crate::model::image_import_job::TargetDetails::DiskImageTargetDetails(v.into()),
);
self
}
pub fn machine_image_target_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MachineImageTargetDetails>> {
#[allow(unreachable_patterns)]
self.target_details.as_ref().and_then(|v| match v {
crate::model::image_import_job::TargetDetails::MachineImageTargetDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_machine_image_target_details<
T: std::convert::Into<std::boxed::Box<crate::model::MachineImageTargetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.target_details = std::option::Option::Some(
crate::model::image_import_job::TargetDetails::MachineImageTargetDetails(v.into()),
);
self
}
}
impl wkt::message::Message for ImageImportJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ImageImportJob"
}
}
pub mod image_import_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Running,
Succeeded,
Failed,
Cancelling,
Cancelled,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Succeeded => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::Cancelling => std::option::Option::Some(5),
Self::Cancelled => 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::Pending => std::option::Option::Some("PENDING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Running,
3 => Self::Succeeded,
4 => Self::Failed,
5 => Self::Cancelling,
6 => Self::Cancelled,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"RUNNING" => Self::Running,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"CANCELLING" => Self::Cancelling,
"CANCELLED" => Self::Cancelled,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Succeeded => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::Cancelling => serializer.serialize_i32(5),
Self::Cancelled => 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.vmmigration.v1.ImageImportJob.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
CloudStorageUri(std::string::String),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TargetDetails {
DiskImageTargetDetails(std::boxed::Box<crate::model::DiskImageTargetDetails>),
MachineImageTargetDetails(std::boxed::Box<crate::model::MachineImageTargetDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImageImportStep {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub step: std::option::Option<crate::model::image_import_step::Step>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImageImportStep {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_step<
T: std::convert::Into<std::option::Option<crate::model::image_import_step::Step>>,
>(
mut self,
v: T,
) -> Self {
self.step = v.into();
self
}
pub fn initializing(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::InitializingImageImportStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::image_import_step::Step::Initializing(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_initializing<
T: std::convert::Into<std::boxed::Box<crate::model::InitializingImageImportStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(crate::model::image_import_step::Step::Initializing(
v.into(),
));
self
}
pub fn loading_source_files(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::LoadingImageSourceFilesStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::image_import_step::Step::LoadingSourceFiles(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_loading_source_files<
T: std::convert::Into<std::boxed::Box<crate::model::LoadingImageSourceFilesStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::image_import_step::Step::LoadingSourceFiles(v.into()),
);
self
}
pub fn adapting_os(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AdaptingOSStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::image_import_step::Step::AdaptingOs(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_adapting_os<T: std::convert::Into<std::boxed::Box<crate::model::AdaptingOSStep>>>(
mut self,
v: T,
) -> Self {
self.step =
std::option::Option::Some(crate::model::image_import_step::Step::AdaptingOs(v.into()));
self
}
pub fn creating_image(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreatingImageStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::image_import_step::Step::CreatingImage(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_creating_image<
T: std::convert::Into<std::boxed::Box<crate::model::CreatingImageStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::image_import_step::Step::CreatingImage(v.into()),
);
self
}
}
impl wkt::message::Message for ImageImportStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ImageImportStep"
}
}
pub mod image_import_step {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Step {
Initializing(std::boxed::Box<crate::model::InitializingImageImportStep>),
LoadingSourceFiles(std::boxed::Box<crate::model::LoadingImageSourceFilesStep>),
AdaptingOs(std::boxed::Box<crate::model::AdaptingOSStep>),
CreatingImage(std::boxed::Box<crate::model::CreatingImageStep>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InitializingImageImportStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InitializingImageImportStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for InitializingImageImportStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.InitializingImageImportStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LoadingImageSourceFilesStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LoadingImageSourceFilesStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for LoadingImageSourceFilesStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.LoadingImageSourceFilesStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatingImageStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreatingImageStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreatingImageStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreatingImageStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskImageTargetDetails {
pub image_name: std::string::String,
pub target_project: std::string::String,
pub description: std::string::String,
pub family_name: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub additional_licenses: std::vec::Vec<std::string::String>,
pub single_region_storage: bool,
pub encryption: std::option::Option<crate::model::Encryption>,
pub os_adaptation_config:
std::option::Option<crate::model::disk_image_target_details::OsAdaptationConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskImageTargetDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_image_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_name = v.into();
self
}
pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_project = 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_family_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.family_name = 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_additional_licenses<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.additional_licenses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_single_region_storage<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.single_region_storage = v.into();
self
}
pub fn set_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_os_adaptation_config<
T: std::convert::Into<
std::option::Option<crate::model::disk_image_target_details::OsAdaptationConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.os_adaptation_config = v.into();
self
}
pub fn os_adaptation_parameters(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>>
{
#[allow(unreachable_patterns)]
self.os_adaptation_config.as_ref().and_then(|v| match v {
crate::model::disk_image_target_details::OsAdaptationConfig::OsAdaptationParameters(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_os_adaptation_parameters<
T: std::convert::Into<std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>>,
>(
mut self,
v: T,
) -> Self {
self.os_adaptation_config = std::option::Option::Some(
crate::model::disk_image_target_details::OsAdaptationConfig::OsAdaptationParameters(
v.into(),
),
);
self
}
pub fn data_disk_image_import(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DataDiskImageImport>> {
#[allow(unreachable_patterns)]
self.os_adaptation_config.as_ref().and_then(|v| match v {
crate::model::disk_image_target_details::OsAdaptationConfig::DataDiskImageImport(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_data_disk_image_import<
T: std::convert::Into<std::boxed::Box<crate::model::DataDiskImageImport>>,
>(
mut self,
v: T,
) -> Self {
self.os_adaptation_config = std::option::Option::Some(
crate::model::disk_image_target_details::OsAdaptationConfig::DataDiskImageImport(
v.into(),
),
);
self
}
}
impl wkt::message::Message for DiskImageTargetDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DiskImageTargetDetails"
}
}
pub mod disk_image_target_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OsAdaptationConfig {
OsAdaptationParameters(std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>),
DataDiskImageImport(std::boxed::Box<crate::model::DataDiskImageImport>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineImageTargetDetails {
pub machine_image_name: std::string::String,
pub target_project: std::string::String,
pub description: std::string::String,
pub single_region_storage: bool,
pub encryption: std::option::Option<crate::model::Encryption>,
pub machine_image_parameters_overrides:
std::option::Option<crate::model::MachineImageParametersOverrides>,
pub service_account: std::option::Option<crate::model::ServiceAccount>,
pub additional_licenses: std::vec::Vec<std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub tags: std::vec::Vec<std::string::String>,
pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
pub os_adaptation_config:
std::option::Option<crate::model::machine_image_target_details::OsAdaptationConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineImageTargetDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_image_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.machine_image_name = v.into();
self
}
pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_project = 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_single_region_storage<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.single_region_storage = v.into();
self
}
pub fn set_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_machine_image_parameters_overrides<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MachineImageParametersOverrides>,
{
self.machine_image_parameters_overrides = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_machine_image_parameters_overrides<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::MachineImageParametersOverrides>,
{
self.machine_image_parameters_overrides = v.map(|x| x.into());
self
}
pub fn set_service_account<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceAccount>,
{
self.service_account = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceAccount>,
{
self.service_account = v.map(|x| x.into());
self
}
pub fn set_additional_licenses<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.additional_licenses = v.into_iter().map(|i| i.into()).collect();
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_tags<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.tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
{
self.shielded_instance_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
{
self.shielded_instance_config = v.map(|x| x.into());
self
}
pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NetworkInterface>,
{
use std::iter::Iterator;
self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_os_adaptation_config<
T: std::convert::Into<
std::option::Option<crate::model::machine_image_target_details::OsAdaptationConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.os_adaptation_config = v.into();
self
}
pub fn os_adaptation_parameters(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>>
{
#[allow(unreachable_patterns)]
self.os_adaptation_config.as_ref().and_then(|v| match v {
crate::model::machine_image_target_details::OsAdaptationConfig::OsAdaptationParameters(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_os_adaptation_parameters<
T: std::convert::Into<std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>>,
>(
mut self,
v: T,
) -> Self {
self.os_adaptation_config = std::option::Option::Some(
crate::model::machine_image_target_details::OsAdaptationConfig::OsAdaptationParameters(
v.into(),
),
);
self
}
pub fn skip_os_adaptation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SkipOsAdaptation>> {
#[allow(unreachable_patterns)]
self.os_adaptation_config.as_ref().and_then(|v| match v {
crate::model::machine_image_target_details::OsAdaptationConfig::SkipOsAdaptation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_skip_os_adaptation<
T: std::convert::Into<std::boxed::Box<crate::model::SkipOsAdaptation>>,
>(
mut self,
v: T,
) -> Self {
self.os_adaptation_config = std::option::Option::Some(
crate::model::machine_image_target_details::OsAdaptationConfig::SkipOsAdaptation(
v.into(),
),
);
self
}
}
impl wkt::message::Message for MachineImageTargetDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.MachineImageTargetDetails"
}
}
pub mod machine_image_target_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OsAdaptationConfig {
OsAdaptationParameters(std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>),
SkipOsAdaptation(std::boxed::Box<crate::model::SkipOsAdaptation>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceAccount {
pub email: std::string::String,
pub scopes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceAccount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.email = v.into();
self
}
pub fn set_scopes<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.scopes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ServiceAccount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ServiceAccount"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ShieldedInstanceConfig {
pub secure_boot: crate::model::shielded_instance_config::SecureBoot,
pub enable_vtpm: bool,
pub enable_integrity_monitoring: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ShieldedInstanceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_secure_boot<
T: std::convert::Into<crate::model::shielded_instance_config::SecureBoot>,
>(
mut self,
v: T,
) -> Self {
self.secure_boot = v.into();
self
}
pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_vtpm = v.into();
self
}
pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_integrity_monitoring = v.into();
self
}
}
impl wkt::message::Message for ShieldedInstanceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ShieldedInstanceConfig"
}
}
pub mod shielded_instance_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SecureBoot {
Unspecified,
True,
False,
UnknownValue(secure_boot::UnknownValue),
}
#[doc(hidden)]
pub mod secure_boot {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SecureBoot {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::True => std::option::Option::Some(1),
Self::False => 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("SECURE_BOOT_UNSPECIFIED"),
Self::True => std::option::Option::Some("TRUE"),
Self::False => std::option::Option::Some("FALSE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SecureBoot {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SecureBoot {
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 SecureBoot {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::True,
2 => Self::False,
_ => Self::UnknownValue(secure_boot::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SecureBoot {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SECURE_BOOT_UNSPECIFIED" => Self::Unspecified,
"TRUE" => Self::True,
"FALSE" => Self::False,
_ => Self::UnknownValue(secure_boot::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SecureBoot {
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::True => serializer.serialize_i32(1),
Self::False => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SecureBoot {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecureBoot>::new(
".google.cloud.vmmigration.v1.ShieldedInstanceConfig.SecureBoot",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineImageParametersOverrides {
pub machine_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineImageParametersOverrides {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_type = v.into();
self
}
}
impl wkt::message::Message for MachineImageParametersOverrides {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.MachineImageParametersOverrides"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImageImportOsAdaptationParameters {
pub generalize: bool,
pub license_type: crate::model::ComputeEngineLicenseType,
pub boot_conversion: crate::model::BootConversion,
pub adaptation_modifiers: std::vec::Vec<crate::model::AdaptationModifier>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImageImportOsAdaptationParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_generalize<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.generalize = v.into();
self
}
pub fn set_license_type<T: std::convert::Into<crate::model::ComputeEngineLicenseType>>(
mut self,
v: T,
) -> Self {
self.license_type = v.into();
self
}
pub fn set_boot_conversion<T: std::convert::Into<crate::model::BootConversion>>(
mut self,
v: T,
) -> Self {
self.boot_conversion = v.into();
self
}
pub fn set_adaptation_modifiers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AdaptationModifier>,
{
use std::iter::Iterator;
self.adaptation_modifiers = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ImageImportOsAdaptationParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ImageImportOsAdaptationParameters"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataDiskImageImport {
pub guest_os_features: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataDiskImageImport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_guest_os_features<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.guest_os_features = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataDiskImageImport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DataDiskImageImport"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SkipOsAdaptation {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SkipOsAdaptation {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for SkipOsAdaptation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.SkipOsAdaptation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetImageImportRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetImageImportRequest {
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 GetImageImportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetImageImportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImageImportsRequest {
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 ListImageImportsRequest {
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 ListImageImportsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListImageImportsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImageImportsResponse {
pub image_imports: std::vec::Vec<crate::model::ImageImport>,
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 ListImageImportsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_image_imports<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImageImport>,
{
use std::iter::Iterator;
self.image_imports = 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 ListImageImportsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListImageImportsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListImageImportsResponse {
type PageItem = crate::model::ImageImport;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.image_imports
}
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 CreateImageImportRequest {
pub parent: std::string::String,
pub image_import_id: std::string::String,
pub image_import: std::option::Option<crate::model::ImageImport>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateImageImportRequest {
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_image_import_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_import_id = v.into();
self
}
pub fn set_image_import<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ImageImport>,
{
self.image_import = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_image_import<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ImageImport>,
{
self.image_import = 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 CreateImageImportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateImageImportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteImageImportRequest {
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 DeleteImageImportRequest {
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 DeleteImageImportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DeleteImageImportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetImageImportJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetImageImportJobRequest {
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 GetImageImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetImageImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImageImportJobsRequest {
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 ListImageImportJobsRequest {
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 ListImageImportJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListImageImportJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImageImportJobsResponse {
pub image_import_jobs: std::vec::Vec<crate::model::ImageImportJob>,
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 ListImageImportJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_image_import_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImageImportJob>,
{
use std::iter::Iterator;
self.image_import_jobs = 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 ListImageImportJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListImageImportJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListImageImportJobsResponse {
type PageItem = crate::model::ImageImportJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.image_import_jobs
}
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 CancelImageImportJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelImageImportJobRequest {
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 CancelImageImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CancelImageImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelImageImportJobResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelImageImportJobResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CancelImageImportJobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CancelImageImportJobResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskMigrationJob {
pub name: std::string::String,
pub target_details: std::option::Option<crate::model::DiskMigrationJobTargetDetails>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::disk_migration_job::State,
pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
pub steps: std::vec::Vec<crate::model::DiskMigrationStep>,
pub source_disk_details:
std::option::Option<crate::model::disk_migration_job::SourceDiskDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskMigrationJob {
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_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskMigrationJobTargetDetails>,
{
self.target_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskMigrationJobTargetDetails>,
{
self.target_details = 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_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::disk_migration_job::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_rpc::model::Status>,
{
use std::iter::Iterator;
self.errors = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_steps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DiskMigrationStep>,
{
use std::iter::Iterator;
self.steps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_source_disk_details<
T: std::convert::Into<
std::option::Option<crate::model::disk_migration_job::SourceDiskDetails>,
>,
>(
mut self,
v: T,
) -> Self {
self.source_disk_details = v.into();
self
}
pub fn aws_source_disk_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AwsSourceDiskDetails>> {
#[allow(unreachable_patterns)]
self.source_disk_details.as_ref().and_then(|v| match v {
crate::model::disk_migration_job::SourceDiskDetails::AwsSourceDiskDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_aws_source_disk_details<
T: std::convert::Into<std::boxed::Box<crate::model::AwsSourceDiskDetails>>,
>(
mut self,
v: T,
) -> Self {
self.source_disk_details = std::option::Option::Some(
crate::model::disk_migration_job::SourceDiskDetails::AwsSourceDiskDetails(v.into()),
);
self
}
}
impl wkt::message::Message for DiskMigrationJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DiskMigrationJob"
}
}
pub mod disk_migration_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Ready,
Running,
Succeeded,
Cancelling,
Cancelled,
Failed,
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::Running => std::option::Option::Some(3),
Self::Succeeded => std::option::Option::Some(4),
Self::Cancelling => std::option::Option::Some(5),
Self::Cancelled => std::option::Option::Some(6),
Self::Failed => 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::Running => std::option::Option::Some("RUNNING"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Failed => std::option::Option::Some("FAILED"),
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,
3 => Self::Running,
4 => Self::Succeeded,
5 => Self::Cancelling,
6 => Self::Cancelled,
7 => Self::Failed,
_ => 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,
"RUNNING" => Self::Running,
"SUCCEEDED" => Self::Succeeded,
"CANCELLING" => Self::Cancelling,
"CANCELLED" => Self::Cancelled,
"FAILED" => Self::Failed,
_ => 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::Running => serializer.serialize_i32(3),
Self::Succeeded => serializer.serialize_i32(4),
Self::Cancelling => serializer.serialize_i32(5),
Self::Cancelled => serializer.serialize_i32(6),
Self::Failed => 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.vmmigration.v1.DiskMigrationJob.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceDiskDetails {
AwsSourceDiskDetails(std::boxed::Box<crate::model::AwsSourceDiskDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskMigrationJobTargetDetails {
pub target_project: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub encryption: std::option::Option<crate::model::Encryption>,
pub target_storage:
std::option::Option<crate::model::disk_migration_job_target_details::TargetStorage>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskMigrationJobTargetDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_project = 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_encryption<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Encryption>,
{
self.encryption = v.map(|x| x.into());
self
}
pub fn set_target_storage<
T: std::convert::Into<
std::option::Option<crate::model::disk_migration_job_target_details::TargetStorage>,
>,
>(
mut self,
v: T,
) -> Self {
self.target_storage = v.into();
self
}
pub fn target_disk(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineDisk>> {
#[allow(unreachable_patterns)]
self.target_storage.as_ref().and_then(|v| match v {
crate::model::disk_migration_job_target_details::TargetStorage::TargetDisk(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_target_disk<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineDisk>>,
>(
mut self,
v: T,
) -> Self {
self.target_storage = std::option::Option::Some(
crate::model::disk_migration_job_target_details::TargetStorage::TargetDisk(v.into()),
);
self
}
}
impl wkt::message::Message for DiskMigrationJobTargetDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DiskMigrationJobTargetDetails"
}
}
pub mod disk_migration_job_target_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TargetStorage {
TargetDisk(std::boxed::Box<crate::model::ComputeEngineDisk>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskMigrationStep {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub step: std::option::Option<crate::model::disk_migration_step::Step>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskMigrationStep {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_step<
T: std::convert::Into<std::option::Option<crate::model::disk_migration_step::Step>>,
>(
mut self,
v: T,
) -> Self {
self.step = v.into();
self
}
pub fn creating_source_disk_snapshot(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreatingSourceDiskSnapshotStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::disk_migration_step::Step::CreatingSourceDiskSnapshot(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_creating_source_disk_snapshot<
T: std::convert::Into<std::boxed::Box<crate::model::CreatingSourceDiskSnapshotStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::disk_migration_step::Step::CreatingSourceDiskSnapshot(v.into()),
);
self
}
pub fn copying_source_disk_snapshot(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CopyingSourceDiskSnapshotStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::disk_migration_step::Step::CopyingSourceDiskSnapshot(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_copying_source_disk_snapshot<
T: std::convert::Into<std::boxed::Box<crate::model::CopyingSourceDiskSnapshotStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::disk_migration_step::Step::CopyingSourceDiskSnapshot(v.into()),
);
self
}
pub fn provisioning_target_disk(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ProvisioningTargetDiskStep>> {
#[allow(unreachable_patterns)]
self.step.as_ref().and_then(|v| match v {
crate::model::disk_migration_step::Step::ProvisioningTargetDisk(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_provisioning_target_disk<
T: std::convert::Into<std::boxed::Box<crate::model::ProvisioningTargetDiskStep>>,
>(
mut self,
v: T,
) -> Self {
self.step = std::option::Option::Some(
crate::model::disk_migration_step::Step::ProvisioningTargetDisk(v.into()),
);
self
}
}
impl wkt::message::Message for DiskMigrationStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DiskMigrationStep"
}
}
pub mod disk_migration_step {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Step {
CreatingSourceDiskSnapshot(std::boxed::Box<crate::model::CreatingSourceDiskSnapshotStep>),
CopyingSourceDiskSnapshot(std::boxed::Box<crate::model::CopyingSourceDiskSnapshotStep>),
ProvisioningTargetDisk(std::boxed::Box<crate::model::ProvisioningTargetDiskStep>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatingSourceDiskSnapshotStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreatingSourceDiskSnapshotStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreatingSourceDiskSnapshotStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreatingSourceDiskSnapshotStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CopyingSourceDiskSnapshotStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CopyingSourceDiskSnapshotStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CopyingSourceDiskSnapshotStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CopyingSourceDiskSnapshotStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProvisioningTargetDiskStep {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProvisioningTargetDiskStep {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ProvisioningTargetDiskStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ProvisioningTargetDiskStep"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEngineDisk {
pub disk_id: std::string::String,
pub zone: std::string::String,
pub replica_zones: std::vec::Vec<std::string::String>,
pub disk_type: crate::model::ComputeEngineDiskType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEngineDisk {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disk_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.disk_id = 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_replica_zones<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.replica_zones = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
mut self,
v: T,
) -> Self {
self.disk_type = v.into();
self
}
}
impl wkt::message::Message for ComputeEngineDisk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineDisk"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsSourceDiskDetails {
pub volume_id: std::string::String,
pub size_gib: i64,
pub disk_type: crate::model::aws_source_disk_details::Type,
pub tags: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsSourceDiskDetails {
pub fn new() -> Self {
std::default::Default::default()
}
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_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size_gib = v.into();
self
}
pub fn set_disk_type<T: std::convert::Into<crate::model::aws_source_disk_details::Type>>(
mut self,
v: T,
) -> Self {
self.disk_type = v.into();
self
}
pub fn set_tags<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for AwsSourceDiskDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceDiskDetails"
}
}
pub mod aws_source_disk_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Gp2,
Gp3,
Io1,
Io2,
St1,
Sc1,
Standard,
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::Gp2 => std::option::Option::Some(1),
Self::Gp3 => std::option::Option::Some(2),
Self::Io1 => std::option::Option::Some(3),
Self::Io2 => std::option::Option::Some(4),
Self::St1 => std::option::Option::Some(5),
Self::Sc1 => std::option::Option::Some(6),
Self::Standard => 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("TYPE_UNSPECIFIED"),
Self::Gp2 => std::option::Option::Some("GP2"),
Self::Gp3 => std::option::Option::Some("GP3"),
Self::Io1 => std::option::Option::Some("IO1"),
Self::Io2 => std::option::Option::Some("IO2"),
Self::St1 => std::option::Option::Some("ST1"),
Self::Sc1 => std::option::Option::Some("SC1"),
Self::Standard => std::option::Option::Some("STANDARD"),
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::Gp2,
2 => Self::Gp3,
3 => Self::Io1,
4 => Self::Io2,
5 => Self::St1,
6 => Self::Sc1,
7 => Self::Standard,
_ => 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,
"GP2" => Self::Gp2,
"GP3" => Self::Gp3,
"IO1" => Self::Io1,
"IO2" => Self::Io2,
"ST1" => Self::St1,
"SC1" => Self::Sc1,
"STANDARD" => Self::Standard,
_ => 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::Gp2 => serializer.serialize_i32(1),
Self::Gp3 => serializer.serialize_i32(2),
Self::Io1 => serializer.serialize_i32(3),
Self::Io2 => serializer.serialize_i32(4),
Self::St1 => serializer.serialize_i32(5),
Self::Sc1 => serializer.serialize_i32(6),
Self::Standard => serializer.serialize_i32(7),
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.vmmigration.v1.AwsSourceDiskDetails.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDiskMigrationJobRequest {
pub parent: std::string::String,
pub disk_migration_job_id: std::string::String,
pub disk_migration_job: std::option::Option<crate::model::DiskMigrationJob>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDiskMigrationJobRequest {
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_disk_migration_job_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.disk_migration_job_id = v.into();
self
}
pub fn set_disk_migration_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskMigrationJob>,
{
self.disk_migration_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskMigrationJob>,
{
self.disk_migration_job = 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 CreateDiskMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CreateDiskMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiskMigrationJobsRequest {
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 ListDiskMigrationJobsRequest {
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 ListDiskMigrationJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListDiskMigrationJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiskMigrationJobsResponse {
pub disk_migration_jobs: std::vec::Vec<crate::model::DiskMigrationJob>,
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 ListDiskMigrationJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_disk_migration_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DiskMigrationJob>,
{
use std::iter::Iterator;
self.disk_migration_jobs = 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 ListDiskMigrationJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.ListDiskMigrationJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDiskMigrationJobsResponse {
type PageItem = crate::model::DiskMigrationJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.disk_migration_jobs
}
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 GetDiskMigrationJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDiskMigrationJobRequest {
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 GetDiskMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.GetDiskMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDiskMigrationJobRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub disk_migration_job: std::option::Option<crate::model::DiskMigrationJob>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDiskMigrationJobRequest {
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_disk_migration_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskMigrationJob>,
{
self.disk_migration_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskMigrationJob>,
{
self.disk_migration_job = 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 UpdateDiskMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.UpdateDiskMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDiskMigrationJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDiskMigrationJobRequest {
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 DeleteDiskMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.DeleteDiskMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunDiskMigrationJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunDiskMigrationJobRequest {
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 RunDiskMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.RunDiskMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunDiskMigrationJobResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunDiskMigrationJobResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for RunDiskMigrationJobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.RunDiskMigrationJobResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelDiskMigrationJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelDiskMigrationJobRequest {
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 CancelDiskMigrationJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CancelDiskMigrationJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelDiskMigrationJobResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelDiskMigrationJobResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CancelDiskMigrationJobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.vmmigration.v1.CancelDiskMigrationJobResponse"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ComputeEngineDiskType {
Unspecified,
Standard,
Ssd,
Balanced,
HyperdiskBalanced,
UnknownValue(compute_engine_disk_type::UnknownValue),
}
#[doc(hidden)]
pub mod compute_engine_disk_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ComputeEngineDiskType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Standard => std::option::Option::Some(1),
Self::Ssd => std::option::Option::Some(2),
Self::Balanced => std::option::Option::Some(3),
Self::HyperdiskBalanced => 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("COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_STANDARD"),
Self::Ssd => std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_SSD"),
Self::Balanced => std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_BALANCED"),
Self::HyperdiskBalanced => {
std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ComputeEngineDiskType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ComputeEngineDiskType {
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 ComputeEngineDiskType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::Ssd,
3 => Self::Balanced,
4 => Self::HyperdiskBalanced,
_ => Self::UnknownValue(compute_engine_disk_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ComputeEngineDiskType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
"COMPUTE_ENGINE_DISK_TYPE_STANDARD" => Self::Standard,
"COMPUTE_ENGINE_DISK_TYPE_SSD" => Self::Ssd,
"COMPUTE_ENGINE_DISK_TYPE_BALANCED" => Self::Balanced,
"COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
_ => Self::UnknownValue(compute_engine_disk_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ComputeEngineDiskType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Standard => serializer.serialize_i32(1),
Self::Ssd => serializer.serialize_i32(2),
Self::Balanced => serializer.serialize_i32(3),
Self::HyperdiskBalanced => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ComputeEngineDiskType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeEngineDiskType>::new(
".google.cloud.vmmigration.v1.ComputeEngineDiskType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ComputeEngineLicenseType {
Default,
Payg,
Byol,
UnknownValue(compute_engine_license_type::UnknownValue),
}
#[doc(hidden)]
pub mod compute_engine_license_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ComputeEngineLicenseType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Default => std::option::Option::Some(0),
Self::Payg => std::option::Option::Some(1),
Self::Byol => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Default => std::option::Option::Some("COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT"),
Self::Payg => std::option::Option::Some("COMPUTE_ENGINE_LICENSE_TYPE_PAYG"),
Self::Byol => std::option::Option::Some("COMPUTE_ENGINE_LICENSE_TYPE_BYOL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ComputeEngineLicenseType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ComputeEngineLicenseType {
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 ComputeEngineLicenseType {
fn from(value: i32) -> Self {
match value {
0 => Self::Default,
1 => Self::Payg,
2 => Self::Byol,
_ => Self::UnknownValue(compute_engine_license_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ComputeEngineLicenseType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT" => Self::Default,
"COMPUTE_ENGINE_LICENSE_TYPE_PAYG" => Self::Payg,
"COMPUTE_ENGINE_LICENSE_TYPE_BYOL" => Self::Byol,
_ => Self::UnknownValue(compute_engine_license_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ComputeEngineLicenseType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Default => serializer.serialize_i32(0),
Self::Payg => serializer.serialize_i32(1),
Self::Byol => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ComputeEngineLicenseType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeEngineLicenseType>::new(
".google.cloud.vmmigration.v1.ComputeEngineLicenseType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ComputeEngineBootOption {
Unspecified,
Efi,
Bios,
UnknownValue(compute_engine_boot_option::UnknownValue),
}
#[doc(hidden)]
pub mod compute_engine_boot_option {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ComputeEngineBootOption {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Efi => std::option::Option::Some(1),
Self::Bios => 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("COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED")
}
Self::Efi => std::option::Option::Some("COMPUTE_ENGINE_BOOT_OPTION_EFI"),
Self::Bios => std::option::Option::Some("COMPUTE_ENGINE_BOOT_OPTION_BIOS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ComputeEngineBootOption {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ComputeEngineBootOption {
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 ComputeEngineBootOption {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Efi,
2 => Self::Bios,
_ => Self::UnknownValue(compute_engine_boot_option::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ComputeEngineBootOption {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED" => Self::Unspecified,
"COMPUTE_ENGINE_BOOT_OPTION_EFI" => Self::Efi,
"COMPUTE_ENGINE_BOOT_OPTION_BIOS" => Self::Bios,
_ => Self::UnknownValue(compute_engine_boot_option::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ComputeEngineBootOption {
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::Efi => serializer.serialize_i32(1),
Self::Bios => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ComputeEngineBootOption {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeEngineBootOption>::new(
".google.cloud.vmmigration.v1.ComputeEngineBootOption",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OsCapability {
Unspecified,
NvmeStorageAccess,
GvnicNetworkInterface,
IdpfNetworkInterface,
UnknownValue(os_capability::UnknownValue),
}
#[doc(hidden)]
pub mod os_capability {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OsCapability {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NvmeStorageAccess => std::option::Option::Some(1),
Self::GvnicNetworkInterface => std::option::Option::Some(2),
Self::IdpfNetworkInterface => 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_CAPABILITY_UNSPECIFIED"),
Self::NvmeStorageAccess => {
std::option::Option::Some("OS_CAPABILITY_NVME_STORAGE_ACCESS")
}
Self::GvnicNetworkInterface => {
std::option::Option::Some("OS_CAPABILITY_GVNIC_NETWORK_INTERFACE")
}
Self::IdpfNetworkInterface => {
std::option::Option::Some("OS_CAPABILITY_IDPF_NETWORK_INTERFACE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OsCapability {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OsCapability {
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 OsCapability {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NvmeStorageAccess,
2 => Self::GvnicNetworkInterface,
3 => Self::IdpfNetworkInterface,
_ => Self::UnknownValue(os_capability::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OsCapability {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OS_CAPABILITY_UNSPECIFIED" => Self::Unspecified,
"OS_CAPABILITY_NVME_STORAGE_ACCESS" => Self::NvmeStorageAccess,
"OS_CAPABILITY_GVNIC_NETWORK_INTERFACE" => Self::GvnicNetworkInterface,
"OS_CAPABILITY_IDPF_NETWORK_INTERFACE" => Self::IdpfNetworkInterface,
_ => Self::UnknownValue(os_capability::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OsCapability {
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::NvmeStorageAccess => serializer.serialize_i32(1),
Self::GvnicNetworkInterface => serializer.serialize_i32(2),
Self::IdpfNetworkInterface => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OsCapability {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsCapability>::new(
".google.cloud.vmmigration.v1.OsCapability",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BootConversion {
Unspecified,
None,
BiosToEfi,
UnknownValue(boot_conversion::UnknownValue),
}
#[doc(hidden)]
pub mod boot_conversion {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BootConversion {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::None => std::option::Option::Some(1),
Self::BiosToEfi => 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("BOOT_CONVERSION_UNSPECIFIED"),
Self::None => std::option::Option::Some("NONE"),
Self::BiosToEfi => std::option::Option::Some("BIOS_TO_EFI"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BootConversion {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BootConversion {
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 BootConversion {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::None,
2 => Self::BiosToEfi,
_ => Self::UnknownValue(boot_conversion::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BootConversion {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BOOT_CONVERSION_UNSPECIFIED" => Self::Unspecified,
"NONE" => Self::None,
"BIOS_TO_EFI" => Self::BiosToEfi,
_ => Self::UnknownValue(boot_conversion::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BootConversion {
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::None => serializer.serialize_i32(1),
Self::BiosToEfi => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BootConversion {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BootConversion>::new(
".google.cloud.vmmigration.v1.BootConversion",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum UtilizationReportView {
Unspecified,
Basic,
Full,
UnknownValue(utilization_report_view::UnknownValue),
}
#[doc(hidden)]
pub mod utilization_report_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl UtilizationReportView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Full => 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("UTILIZATION_REPORT_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for UtilizationReportView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for UtilizationReportView {
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 UtilizationReportView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
_ => Self::UnknownValue(utilization_report_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for UtilizationReportView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UTILIZATION_REPORT_VIEW_UNSPECIFIED" => Self::Unspecified,
"BASIC" => Self::Basic,
"FULL" => Self::Full,
_ => Self::UnknownValue(utilization_report_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for UtilizationReportView {
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::Basic => serializer.serialize_i32(1),
Self::Full => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for UtilizationReportView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<UtilizationReportView>::new(
".google.cloud.vmmigration.v1.UtilizationReportView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MigratingVmView {
Unspecified,
Basic,
Full,
UnknownValue(migrating_vm_view::UnknownValue),
}
#[doc(hidden)]
pub mod migrating_vm_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MigratingVmView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Full => 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("MIGRATING_VM_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("MIGRATING_VM_VIEW_BASIC"),
Self::Full => std::option::Option::Some("MIGRATING_VM_VIEW_FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MigratingVmView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MigratingVmView {
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 MigratingVmView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
_ => Self::UnknownValue(migrating_vm_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MigratingVmView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MIGRATING_VM_VIEW_UNSPECIFIED" => Self::Unspecified,
"MIGRATING_VM_VIEW_BASIC" => Self::Basic,
"MIGRATING_VM_VIEW_FULL" => Self::Full,
_ => Self::UnknownValue(migrating_vm_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MigratingVmView {
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::Basic => serializer.serialize_i32(1),
Self::Full => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MigratingVmView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigratingVmView>::new(
".google.cloud.vmmigration.v1.MigratingVmView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmArchitecture {
Unspecified,
X86Family,
Arm64,
UnknownValue(vm_architecture::UnknownValue),
}
#[doc(hidden)]
pub mod vm_architecture {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VmArchitecture {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::X86Family => std::option::Option::Some(1),
Self::Arm64 => 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("VM_ARCHITECTURE_UNSPECIFIED"),
Self::X86Family => std::option::Option::Some("VM_ARCHITECTURE_X86_FAMILY"),
Self::Arm64 => std::option::Option::Some("VM_ARCHITECTURE_ARM64"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VmArchitecture {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VmArchitecture {
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 VmArchitecture {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::X86Family,
2 => Self::Arm64,
_ => Self::UnknownValue(vm_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VmArchitecture {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VM_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
"VM_ARCHITECTURE_X86_FAMILY" => Self::X86Family,
"VM_ARCHITECTURE_ARM64" => Self::Arm64,
_ => Self::UnknownValue(vm_architecture::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VmArchitecture {
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::X86Family => serializer.serialize_i32(1),
Self::Arm64 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VmArchitecture {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmArchitecture>::new(
".google.cloud.vmmigration.v1.VmArchitecture",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ComputeEngineNetworkTier {
Unspecified,
NetworkTierStandard,
NetworkTierPremium,
UnknownValue(compute_engine_network_tier::UnknownValue),
}
#[doc(hidden)]
pub mod compute_engine_network_tier {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ComputeEngineNetworkTier {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NetworkTierStandard => std::option::Option::Some(1),
Self::NetworkTierPremium => 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("COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED")
}
Self::NetworkTierStandard => std::option::Option::Some("NETWORK_TIER_STANDARD"),
Self::NetworkTierPremium => std::option::Option::Some("NETWORK_TIER_PREMIUM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ComputeEngineNetworkTier {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ComputeEngineNetworkTier {
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 ComputeEngineNetworkTier {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NetworkTierStandard,
2 => Self::NetworkTierPremium,
_ => Self::UnknownValue(compute_engine_network_tier::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ComputeEngineNetworkTier {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED" => Self::Unspecified,
"NETWORK_TIER_STANDARD" => Self::NetworkTierStandard,
"NETWORK_TIER_PREMIUM" => Self::NetworkTierPremium,
_ => Self::UnknownValue(compute_engine_network_tier::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ComputeEngineNetworkTier {
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::NetworkTierStandard => serializer.serialize_i32(1),
Self::NetworkTierPremium => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ComputeEngineNetworkTier {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeEngineNetworkTier>::new(
".google.cloud.vmmigration.v1.ComputeEngineNetworkTier",
))
}
}