#![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_type;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Asset {
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 attributes: std::collections::HashMap<std::string::String, std::string::String>,
pub insight_list: std::option::Option<crate::model::InsightList>,
pub performance_data: std::option::Option<crate::model::AssetPerformanceData>,
pub sources: std::vec::Vec<std::string::String>,
pub assigned_groups: std::vec::Vec<std::string::String>,
pub asset_details: std::option::Option<crate::model::asset::AssetDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Asset {
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_attributes<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.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_insight_list<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InsightList>,
{
self.insight_list = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_insight_list<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InsightList>,
{
self.insight_list = v.map(|x| x.into());
self
}
pub fn set_performance_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AssetPerformanceData>,
{
self.performance_data = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_performance_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AssetPerformanceData>,
{
self.performance_data = v.map(|x| x.into());
self
}
pub fn set_sources<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.sources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_assigned_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.assigned_groups = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_asset_details<
T: std::convert::Into<std::option::Option<crate::model::asset::AssetDetails>>,
>(
mut self,
v: T,
) -> Self {
self.asset_details = v.into();
self
}
pub fn machine_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MachineDetails>> {
#[allow(unreachable_patterns)]
self.asset_details.as_ref().and_then(|v| match v {
crate::model::asset::AssetDetails::MachineDetails(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_machine_details<
T: std::convert::Into<std::boxed::Box<crate::model::MachineDetails>>,
>(
mut self,
v: T,
) -> Self {
self.asset_details =
std::option::Option::Some(crate::model::asset::AssetDetails::MachineDetails(v.into()));
self
}
}
impl wkt::message::Message for Asset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Asset"
}
}
pub mod asset {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AssetDetails {
MachineDetails(std::boxed::Box<crate::model::MachineDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PreferenceSet {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub display_name: std::string::String,
pub description: std::string::String,
pub virtual_machine_preferences: std::option::Option<crate::model::VirtualMachinePreferences>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PreferenceSet {
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_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_virtual_machine_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VirtualMachinePreferences>,
{
self.virtual_machine_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_virtual_machine_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VirtualMachinePreferences>,
{
self.virtual_machine_preferences = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PreferenceSet {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.PreferenceSet"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportJob {
pub name: std::string::String,
pub display_name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub complete_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::import_job::ImportJobState,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub asset_source: std::string::String,
pub report: std::option::Option<crate::model::import_job::Report>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportJob {
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_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_complete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.complete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_complete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.complete_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::import_job::ImportJobState>>(
mut self,
v: T,
) -> Self {
self.state = 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_asset_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.asset_source = v.into();
self
}
pub fn set_report<
T: std::convert::Into<std::option::Option<crate::model::import_job::Report>>,
>(
mut self,
v: T,
) -> Self {
self.report = v.into();
self
}
pub fn validation_report(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ValidationReport>> {
#[allow(unreachable_patterns)]
self.report.as_ref().and_then(|v| match v {
crate::model::import_job::Report::ValidationReport(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_validation_report<
T: std::convert::Into<std::boxed::Box<crate::model::ValidationReport>>,
>(
mut self,
v: T,
) -> Self {
self.report =
std::option::Option::Some(crate::model::import_job::Report::ValidationReport(v.into()));
self
}
pub fn execution_report(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ExecutionReport>> {
#[allow(unreachable_patterns)]
self.report.as_ref().and_then(|v| match v {
crate::model::import_job::Report::ExecutionReport(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_execution_report<
T: std::convert::Into<std::boxed::Box<crate::model::ExecutionReport>>,
>(
mut self,
v: T,
) -> Self {
self.report =
std::option::Option::Some(crate::model::import_job::Report::ExecutionReport(v.into()));
self
}
}
impl wkt::message::Message for ImportJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ImportJob"
}
}
pub mod import_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ImportJobState {
Unspecified,
Pending,
Running,
Completed,
Failed,
Validating,
FailedValidation,
Ready,
UnknownValue(import_job_state::UnknownValue),
}
#[doc(hidden)]
pub mod import_job_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ImportJobState {
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::Completed => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::Validating => std::option::Option::Some(5),
Self::FailedValidation => std::option::Option::Some(6),
Self::Ready => 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("IMPORT_JOB_STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("IMPORT_JOB_STATE_PENDING"),
Self::Running => std::option::Option::Some("IMPORT_JOB_STATE_RUNNING"),
Self::Completed => std::option::Option::Some("IMPORT_JOB_STATE_COMPLETED"),
Self::Failed => std::option::Option::Some("IMPORT_JOB_STATE_FAILED"),
Self::Validating => std::option::Option::Some("IMPORT_JOB_STATE_VALIDATING"),
Self::FailedValidation => {
std::option::Option::Some("IMPORT_JOB_STATE_FAILED_VALIDATION")
}
Self::Ready => std::option::Option::Some("IMPORT_JOB_STATE_READY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ImportJobState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ImportJobState {
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 ImportJobState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Running,
3 => Self::Completed,
4 => Self::Failed,
5 => Self::Validating,
6 => Self::FailedValidation,
7 => Self::Ready,
_ => Self::UnknownValue(import_job_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ImportJobState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IMPORT_JOB_STATE_UNSPECIFIED" => Self::Unspecified,
"IMPORT_JOB_STATE_PENDING" => Self::Pending,
"IMPORT_JOB_STATE_RUNNING" => Self::Running,
"IMPORT_JOB_STATE_COMPLETED" => Self::Completed,
"IMPORT_JOB_STATE_FAILED" => Self::Failed,
"IMPORT_JOB_STATE_VALIDATING" => Self::Validating,
"IMPORT_JOB_STATE_FAILED_VALIDATION" => Self::FailedValidation,
"IMPORT_JOB_STATE_READY" => Self::Ready,
_ => Self::UnknownValue(import_job_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ImportJobState {
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::Completed => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::Validating => serializer.serialize_i32(5),
Self::FailedValidation => serializer.serialize_i32(6),
Self::Ready => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ImportJobState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportJobState>::new(
".google.cloud.migrationcenter.v1.ImportJob.ImportJobState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Report {
ValidationReport(std::boxed::Box<crate::model::ValidationReport>),
ExecutionReport(std::boxed::Box<crate::model::ExecutionReport>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportDataFile {
pub name: std::string::String,
pub display_name: std::string::String,
pub format: crate::model::ImportJobFormat,
pub create_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::import_data_file::State,
pub file_info: std::option::Option<crate::model::import_data_file::FileInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportDataFile {
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_format<T: std::convert::Into<crate::model::ImportJobFormat>>(
mut self,
v: T,
) -> Self {
self.format = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::import_data_file::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_file_info<
T: std::convert::Into<std::option::Option<crate::model::import_data_file::FileInfo>>,
>(
mut self,
v: T,
) -> Self {
self.file_info = v.into();
self
}
pub fn upload_file_info(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UploadFileInfo>> {
#[allow(unreachable_patterns)]
self.file_info.as_ref().and_then(|v| match v {
crate::model::import_data_file::FileInfo::UploadFileInfo(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_upload_file_info<
T: std::convert::Into<std::boxed::Box<crate::model::UploadFileInfo>>,
>(
mut self,
v: T,
) -> Self {
self.file_info = std::option::Option::Some(
crate::model::import_data_file::FileInfo::UploadFileInfo(v.into()),
);
self
}
}
impl wkt::message::Message for ImportDataFile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ImportDataFile"
}
}
pub mod import_data_file {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
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::Creating => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::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::Creating,
2 => 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,
"CREATING" => Self::Creating,
"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::Creating => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.migrationcenter.v1.ImportDataFile.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FileInfo {
UploadFileInfo(std::boxed::Box<crate::model::UploadFileInfo>),
}
}
#[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 labels: std::collections::HashMap<std::string::String, std::string::String>,
pub display_name: std::string::String,
pub description: std::string::String,
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_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_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
}
}
impl wkt::message::Message for Group {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Group"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ErrorFrame {
pub name: std::string::String,
pub violations: std::vec::Vec<crate::model::FrameViolationEntry>,
pub original_frame: std::option::Option<crate::model::AssetFrame>,
pub ingestion_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ErrorFrame {
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_violations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FrameViolationEntry>,
{
use std::iter::Iterator;
self.violations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_original_frame<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AssetFrame>,
{
self.original_frame = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_original_frame<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AssetFrame>,
{
self.original_frame = v.map(|x| x.into());
self
}
pub fn set_ingestion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.ingestion_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ingestion_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.ingestion_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ErrorFrame {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ErrorFrame"
}
}
#[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 display_name: std::string::String,
pub description: std::string::String,
pub r#type: crate::model::source::SourceType,
pub priority: i32,
pub managed: bool,
pub pending_frame_count: i32,
pub error_frame_count: i32,
pub state: crate::model::source::State,
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_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_type<T: std::convert::Into<crate::model::source::SourceType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.priority = v.into();
self
}
pub fn set_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.managed = v.into();
self
}
pub fn set_pending_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.pending_frame_count = v.into();
self
}
pub fn set_error_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.error_frame_count = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::source::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for Source {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Source"
}
}
pub mod source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceType {
Unknown,
Upload,
GuestOsScan,
InventoryScan,
Custom,
UnknownValue(source_type::UnknownValue),
}
#[doc(hidden)]
pub mod source_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SourceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unknown => std::option::Option::Some(0),
Self::Upload => std::option::Option::Some(1),
Self::GuestOsScan => std::option::Option::Some(2),
Self::InventoryScan => std::option::Option::Some(3),
Self::Custom => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unknown => std::option::Option::Some("SOURCE_TYPE_UNKNOWN"),
Self::Upload => std::option::Option::Some("SOURCE_TYPE_UPLOAD"),
Self::GuestOsScan => std::option::Option::Some("SOURCE_TYPE_GUEST_OS_SCAN"),
Self::InventoryScan => std::option::Option::Some("SOURCE_TYPE_INVENTORY_SCAN"),
Self::Custom => std::option::Option::Some("SOURCE_TYPE_CUSTOM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SourceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SourceType {
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 SourceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unknown,
1 => Self::Upload,
2 => Self::GuestOsScan,
3 => Self::InventoryScan,
4 => Self::Custom,
_ => Self::UnknownValue(source_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SourceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SOURCE_TYPE_UNKNOWN" => Self::Unknown,
"SOURCE_TYPE_UPLOAD" => Self::Upload,
"SOURCE_TYPE_GUEST_OS_SCAN" => Self::GuestOsScan,
"SOURCE_TYPE_INVENTORY_SCAN" => Self::InventoryScan,
"SOURCE_TYPE_CUSTOM" => Self::Custom,
_ => Self::UnknownValue(source_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SourceType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unknown => serializer.serialize_i32(0),
Self::Upload => serializer.serialize_i32(1),
Self::GuestOsScan => serializer.serialize_i32(2),
Self::InventoryScan => serializer.serialize_i32(3),
Self::Custom => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SourceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
".google.cloud.migrationcenter.v1.Source.SourceType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Deleting,
Invalid,
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::Active => std::option::Option::Some(1),
Self::Deleting => std::option::Option::Some(2),
Self::Invalid => 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::Active => std::option::Option::Some("ACTIVE"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Invalid => std::option::Option::Some("INVALID"),
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::Active,
2 => Self::Deleting,
3 => Self::Invalid,
_ => 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,
"ACTIVE" => Self::Active,
"DELETING" => Self::Deleting,
"INVALID" => Self::Invalid,
_ => 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::Active => serializer.serialize_i32(1),
Self::Deleting => serializer.serialize_i32(2),
Self::Invalid => 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.migrationcenter.v1.Source.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReportConfig {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub display_name: std::string::String,
pub description: std::string::String,
pub group_preferenceset_assignments:
std::vec::Vec<crate::model::report_config::GroupPreferenceSetAssignment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReportConfig {
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_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_group_preferenceset_assignments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::report_config::GroupPreferenceSetAssignment>,
{
use std::iter::Iterator;
self.group_preferenceset_assignments = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ReportConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportConfig"
}
}
pub mod report_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GroupPreferenceSetAssignment {
pub group: std::string::String,
pub preference_set: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GroupPreferenceSetAssignment {
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_preference_set<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.preference_set = v.into();
self
}
}
impl wkt::message::Message for GroupPreferenceSetAssignment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportConfig.GroupPreferenceSetAssignment"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Report {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub display_name: std::string::String,
pub description: std::string::String,
pub r#type: crate::model::report::Type,
pub state: crate::model::report::State,
pub summary: std::option::Option<crate::model::ReportSummary>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Report {
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_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_type<T: std::convert::Into<crate::model::report::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::report::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_summary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReportSummary>,
{
self.summary = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_summary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReportSummary>,
{
self.summary = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Report {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Report"
}
}
pub mod report {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
TotalCostOfOwnership,
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::TotalCostOfOwnership => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::TotalCostOfOwnership => std::option::Option::Some("TOTAL_COST_OF_OWNERSHIP"),
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::TotalCostOfOwnership,
_ => 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,
"TOTAL_COST_OF_OWNERSHIP" => Self::TotalCostOfOwnership,
_ => 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::TotalCostOfOwnership => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.migrationcenter.v1.Report.Type",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
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::Pending => 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::Pending => std::option::Option::Some("PENDING"),
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::Pending,
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,
"PENDING" => Self::Pending,
"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::Pending => 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.migrationcenter.v1.Report.State",
))
}
}
}
#[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.migrationcenter.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAssetsRequest {
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::AssetView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAssetsRequest {
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::AssetView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListAssetsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListAssetsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAssetsResponse {
pub assets: std::vec::Vec<crate::model::Asset>,
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 ListAssetsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_assets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Asset>,
{
use std::iter::Iterator;
self.assets = 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 ListAssetsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListAssetsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAssetsResponse {
type PageItem = crate::model::Asset;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.assets
}
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 GetAssetRequest {
pub name: std::string::String,
pub view: crate::model::AssetView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAssetRequest {
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::AssetView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GetAssetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAssetRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub asset: std::option::Option<crate::model::Asset>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAssetRequest {
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_asset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Asset>,
{
self.asset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Asset>,
{
self.asset = 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 UpdateAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.UpdateAssetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchUpdateAssetsRequest {
pub parent: std::string::String,
pub requests: std::vec::Vec<crate::model::UpdateAssetRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchUpdateAssetsRequest {
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_requests<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::UpdateAssetRequest>,
{
use std::iter::Iterator;
self.requests = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BatchUpdateAssetsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.BatchUpdateAssetsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchUpdateAssetsResponse {
pub assets: std::vec::Vec<crate::model::Asset>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchUpdateAssetsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_assets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Asset>,
{
use std::iter::Iterator;
self.assets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BatchUpdateAssetsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.BatchUpdateAssetsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAssetRequest {
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 DeleteAssetRequest {
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 DeleteAssetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DeleteAssetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchDeleteAssetsRequest {
pub parent: std::string::String,
pub names: std::vec::Vec<std::string::String>,
pub allow_missing: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchDeleteAssetsRequest {
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_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.names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
}
impl wkt::message::Message for BatchDeleteAssetsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.BatchDeleteAssetsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReportAssetFramesRequest {
pub parent: std::string::String,
pub frames: std::option::Option<crate::model::Frames>,
pub source: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReportAssetFramesRequest {
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_frames<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Frames>,
{
self.frames = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_frames<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Frames>,
{
self.frames = v.map(|x| x.into());
self
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
}
impl wkt::message::Message for ReportAssetFramesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportAssetFramesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReportAssetFramesResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReportAssetFramesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ReportAssetFramesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportAssetFramesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AggregateAssetsValuesRequest {
pub parent: std::string::String,
pub aggregations: std::vec::Vec<crate::model::Aggregation>,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AggregateAssetsValuesRequest {
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_aggregations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Aggregation>,
{
use std::iter::Iterator;
self.aggregations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for AggregateAssetsValuesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AggregateAssetsValuesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AggregateAssetsValuesResponse {
pub results: std::vec::Vec<crate::model::AggregationResult>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AggregateAssetsValuesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AggregationResult>,
{
use std::iter::Iterator;
self.results = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AggregateAssetsValuesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AggregateAssetsValuesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateImportJobRequest {
pub parent: std::string::String,
pub import_job_id: std::string::String,
pub import_job: std::option::Option<crate::model::ImportJob>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateImportJobRequest {
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_import_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.import_job_id = v.into();
self
}
pub fn set_import_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ImportJob>,
{
self.import_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ImportJob>,
{
self.import_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 CreateImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.CreateImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImportJobsRequest {
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::ImportJobView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListImportJobsRequest {
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::ImportJobView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListImportJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListImportJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImportJobsResponse {
pub import_jobs: std::vec::Vec<crate::model::ImportJob>,
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 ListImportJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_import_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImportJob>,
{
use std::iter::Iterator;
self.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 ListImportJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListImportJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListImportJobsResponse {
type PageItem = crate::model::ImportJob;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.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 GetImportJobRequest {
pub name: std::string::String,
pub view: crate::model::ImportJobView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetImportJobRequest {
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::ImportJobView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GetImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteImportJobRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteImportJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DeleteImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateImportJobRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub import_job: std::option::Option<crate::model::ImportJob>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateImportJobRequest {
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_import_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ImportJob>,
{
self.import_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ImportJob>,
{
self.import_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 UpdateImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.UpdateImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValidateImportJobRequest {
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 ValidateImportJobRequest {
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 ValidateImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ValidateImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunImportJobRequest {
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 RunImportJobRequest {
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 RunImportJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.RunImportJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetImportDataFileRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetImportDataFileRequest {
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 GetImportDataFileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GetImportDataFileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImportDataFilesRequest {
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 ListImportDataFilesRequest {
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 ListImportDataFilesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListImportDataFilesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListImportDataFilesResponse {
pub import_data_files: std::vec::Vec<crate::model::ImportDataFile>,
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 ListImportDataFilesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_import_data_files<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImportDataFile>,
{
use std::iter::Iterator;
self.import_data_files = 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 ListImportDataFilesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListImportDataFilesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListImportDataFilesResponse {
type PageItem = crate::model::ImportDataFile;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.import_data_files
}
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 CreateImportDataFileRequest {
pub parent: std::string::String,
pub import_data_file_id: std::string::String,
pub import_data_file: std::option::Option<crate::model::ImportDataFile>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateImportDataFileRequest {
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_import_data_file_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.import_data_file_id = v.into();
self
}
pub fn set_import_data_file<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ImportDataFile>,
{
self.import_data_file = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_data_file<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ImportDataFile>,
{
self.import_data_file = 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 CreateImportDataFileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.CreateImportDataFileRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteImportDataFileRequest {
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 DeleteImportDataFileRequest {
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 DeleteImportDataFileRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DeleteImportDataFileRequest"
}
}
#[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.migrationcenter.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.migrationcenter.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.migrationcenter.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.migrationcenter.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.migrationcenter.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.migrationcenter.v1.DeleteGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AddAssetsToGroupRequest {
pub group: std::string::String,
pub request_id: std::string::String,
pub assets: std::option::Option<crate::model::AssetList>,
pub allow_existing: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AddAssetsToGroupRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_assets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AssetList>,
{
self.assets = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_assets<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AssetList>,
{
self.assets = v.map(|x| x.into());
self
}
pub fn set_allow_existing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_existing = v.into();
self
}
}
impl wkt::message::Message for AddAssetsToGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AddAssetsToGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RemoveAssetsFromGroupRequest {
pub group: std::string::String,
pub request_id: std::string::String,
pub assets: std::option::Option<crate::model::AssetList>,
pub allow_missing: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RemoveAssetsFromGroupRequest {
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_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_assets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AssetList>,
{
self.assets = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_assets<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AssetList>,
{
self.assets = v.map(|x| x.into());
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
}
impl wkt::message::Message for RemoveAssetsFromGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.RemoveAssetsFromGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListErrorFramesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub view: crate::model::ErrorFrameView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListErrorFramesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::ErrorFrameView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListErrorFramesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListErrorFramesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListErrorFramesResponse {
pub error_frames: std::vec::Vec<crate::model::ErrorFrame>,
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 ListErrorFramesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_error_frames<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ErrorFrame>,
{
use std::iter::Iterator;
self.error_frames = 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 ListErrorFramesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListErrorFramesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListErrorFramesResponse {
type PageItem = crate::model::ErrorFrame;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.error_frames
}
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 GetErrorFrameRequest {
pub name: std::string::String,
pub view: crate::model::ErrorFrameView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetErrorFrameRequest {
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::ErrorFrameView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetErrorFrameRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GetErrorFrameRequest"
}
}
#[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.migrationcenter.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.migrationcenter.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.migrationcenter.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.migrationcenter.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.migrationcenter.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.migrationcenter.v1.DeleteSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPreferenceSetsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListPreferenceSetsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListPreferenceSetsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListPreferenceSetsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPreferenceSetsResponse {
pub preference_sets: std::vec::Vec<crate::model::PreferenceSet>,
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 ListPreferenceSetsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_preference_sets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PreferenceSet>,
{
use std::iter::Iterator;
self.preference_sets = 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 ListPreferenceSetsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListPreferenceSetsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListPreferenceSetsResponse {
type PageItem = crate::model::PreferenceSet;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.preference_sets
}
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 GetPreferenceSetRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetPreferenceSetRequest {
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 GetPreferenceSetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GetPreferenceSetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePreferenceSetRequest {
pub parent: std::string::String,
pub preference_set_id: std::string::String,
pub preference_set: std::option::Option<crate::model::PreferenceSet>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreatePreferenceSetRequest {
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_preference_set_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.preference_set_id = v.into();
self
}
pub fn set_preference_set<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PreferenceSet>,
{
self.preference_set = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_preference_set<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PreferenceSet>,
{
self.preference_set = 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 CreatePreferenceSetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.CreatePreferenceSetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdatePreferenceSetRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub preference_set: std::option::Option<crate::model::PreferenceSet>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdatePreferenceSetRequest {
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_preference_set<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PreferenceSet>,
{
self.preference_set = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_preference_set<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PreferenceSet>,
{
self.preference_set = 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 UpdatePreferenceSetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.UpdatePreferenceSetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePreferenceSetRequest {
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 DeletePreferenceSetRequest {
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 DeletePreferenceSetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DeletePreferenceSetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSettingsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSettingsRequest {
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 GetSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GetSettingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSettingsRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub settings: std::option::Option<crate::model::Settings>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSettingsRequest {
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_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Settings>,
{
self.settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Settings>,
{
self.settings = 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 UpdateSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.UpdateSettingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateReportConfigRequest {
pub parent: std::string::String,
pub report_config_id: std::string::String,
pub report_config: std::option::Option<crate::model::ReportConfig>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateReportConfigRequest {
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_report_config_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.report_config_id = v.into();
self
}
pub fn set_report_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReportConfig>,
{
self.report_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_report_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReportConfig>,
{
self.report_config = 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 CreateReportConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.CreateReportConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteReportConfigRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteReportConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteReportConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DeleteReportConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetReportRequest {
pub name: std::string::String,
pub view: crate::model::ReportView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetReportRequest {
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::ReportView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GetReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReportsRequest {
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::ReportView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReportsRequest {
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::ReportView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListReportsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListReportsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReportsResponse {
pub reports: std::vec::Vec<crate::model::Report>,
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 ListReportsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reports<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Report>,
{
use std::iter::Iterator;
self.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 ListReportsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListReportsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListReportsResponse {
type PageItem = crate::model::Report;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.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 DeleteReportRequest {
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 DeleteReportRequest {
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 DeleteReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DeleteReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetReportConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetReportConfigRequest {
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 GetReportConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GetReportConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReportConfigsRequest {
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 ListReportConfigsRequest {
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 ListReportConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListReportConfigsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReportConfigsResponse {
pub report_configs: std::vec::Vec<crate::model::ReportConfig>,
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 ListReportConfigsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_report_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ReportConfig>,
{
use std::iter::Iterator;
self.report_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListReportConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ListReportConfigsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListReportConfigsResponse {
type PageItem = crate::model::ReportConfig;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.report_configs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateReportRequest {
pub parent: std::string::String,
pub report_id: std::string::String,
pub report: std::option::Option<crate::model::Report>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateReportRequest {
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_report_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.report_id = v.into();
self
}
pub fn set_report<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Report>,
{
self.report = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_report<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Report>,
{
self.report = 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 CreateReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.CreateReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Frames {
pub frames_data: std::vec::Vec<crate::model::AssetFrame>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Frames {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_frames_data<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AssetFrame>,
{
use std::iter::Iterator;
self.frames_data = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Frames {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Frames"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AssetFrame {
pub report_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub attributes: std::collections::HashMap<std::string::String, std::string::String>,
pub performance_samples: std::vec::Vec<crate::model::PerformanceSample>,
pub trace_token: std::string::String,
pub frame_data: std::option::Option<crate::model::asset_frame::FrameData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AssetFrame {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_report_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.report_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_report_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.report_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_attributes<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.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_performance_samples<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PerformanceSample>,
{
use std::iter::Iterator;
self.performance_samples = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_trace_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.trace_token = v.into();
self
}
pub fn set_frame_data<
T: std::convert::Into<std::option::Option<crate::model::asset_frame::FrameData>>,
>(
mut self,
v: T,
) -> Self {
self.frame_data = v.into();
self
}
pub fn machine_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MachineDetails>> {
#[allow(unreachable_patterns)]
self.frame_data.as_ref().and_then(|v| match v {
crate::model::asset_frame::FrameData::MachineDetails(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_machine_details<
T: std::convert::Into<std::boxed::Box<crate::model::MachineDetails>>,
>(
mut self,
v: T,
) -> Self {
self.frame_data = std::option::Option::Some(
crate::model::asset_frame::FrameData::MachineDetails(v.into()),
);
self
}
}
impl wkt::message::Message for AssetFrame {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AssetFrame"
}
}
pub mod asset_frame {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FrameData {
MachineDetails(std::boxed::Box<crate::model::MachineDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineDetails {
pub uuid: std::string::String,
pub machine_name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub core_count: i32,
pub memory_mb: i32,
pub power_state: crate::model::machine_details::PowerState,
pub architecture: std::option::Option<crate::model::MachineArchitectureDetails>,
pub guest_os: std::option::Option<crate::model::GuestOsDetails>,
pub network: std::option::Option<crate::model::MachineNetworkDetails>,
pub disks: std::option::Option<crate::model::MachineDiskDetails>,
pub platform: std::option::Option<crate::model::PlatformDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_machine_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_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_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.core_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_power_state<T: std::convert::Into<crate::model::machine_details::PowerState>>(
mut self,
v: T,
) -> Self {
self.power_state = v.into();
self
}
pub fn set_architecture<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MachineArchitectureDetails>,
{
self.architecture = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_architecture<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MachineArchitectureDetails>,
{
self.architecture = v.map(|x| x.into());
self
}
pub fn set_guest_os<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GuestOsDetails>,
{
self.guest_os = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_guest_os<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GuestOsDetails>,
{
self.guest_os = v.map(|x| x.into());
self
}
pub fn set_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MachineNetworkDetails>,
{
self.network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MachineNetworkDetails>,
{
self.network = v.map(|x| x.into());
self
}
pub fn set_disks<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MachineDiskDetails>,
{
self.disks = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disks<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MachineDiskDetails>,
{
self.disks = v.map(|x| x.into());
self
}
pub fn set_platform<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PlatformDetails>,
{
self.platform = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_platform<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PlatformDetails>,
{
self.platform = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MachineDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.MachineDetails"
}
}
pub mod machine_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PowerState {
Unspecified,
Pending,
Active,
Suspending,
Suspended,
Deleting,
Deleted,
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::Pending => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::Suspending => std::option::Option::Some(3),
Self::Suspended => std::option::Option::Some(4),
Self::Deleting => std::option::Option::Some(5),
Self::Deleted => 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("POWER_STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Suspending => std::option::Option::Some("SUSPENDING"),
Self::Suspended => std::option::Option::Some("SUSPENDED"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Deleted => std::option::Option::Some("DELETED"),
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::Pending,
2 => Self::Active,
3 => Self::Suspending,
4 => Self::Suspended,
5 => Self::Deleting,
6 => Self::Deleted,
_ => 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,
"PENDING" => Self::Pending,
"ACTIVE" => Self::Active,
"SUSPENDING" => Self::Suspending,
"SUSPENDED" => Self::Suspended,
"DELETING" => Self::Deleting,
"DELETED" => Self::Deleted,
_ => 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::Pending => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::Suspending => serializer.serialize_i32(3),
Self::Suspended => serializer.serialize_i32(4),
Self::Deleting => serializer.serialize_i32(5),
Self::Deleted => serializer.serialize_i32(6),
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.migrationcenter.v1.MachineDetails.PowerState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineArchitectureDetails {
pub cpu_architecture: std::string::String,
pub cpu_name: std::string::String,
pub vendor: std::string::String,
pub cpu_thread_count: i32,
pub cpu_socket_count: i32,
pub bios: std::option::Option<crate::model::BiosDetails>,
pub firmware_type: crate::model::machine_architecture_details::FirmwareType,
pub hyperthreading: crate::model::machine_architecture_details::CpuHyperThreading,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineArchitectureDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cpu_architecture<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cpu_architecture = v.into();
self
}
pub fn set_cpu_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cpu_name = v.into();
self
}
pub fn set_vendor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vendor = v.into();
self
}
pub fn set_cpu_thread_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_thread_count = v.into();
self
}
pub fn set_cpu_socket_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cpu_socket_count = v.into();
self
}
pub fn set_bios<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BiosDetails>,
{
self.bios = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bios<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BiosDetails>,
{
self.bios = v.map(|x| x.into());
self
}
pub fn set_firmware_type<
T: std::convert::Into<crate::model::machine_architecture_details::FirmwareType>,
>(
mut self,
v: T,
) -> Self {
self.firmware_type = v.into();
self
}
pub fn set_hyperthreading<
T: std::convert::Into<crate::model::machine_architecture_details::CpuHyperThreading>,
>(
mut self,
v: T,
) -> Self {
self.hyperthreading = v.into();
self
}
}
impl wkt::message::Message for MachineArchitectureDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.MachineArchitectureDetails"
}
}
pub mod machine_architecture_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FirmwareType {
Unspecified,
Bios,
Efi,
UnknownValue(firmware_type::UnknownValue),
}
#[doc(hidden)]
pub mod firmware_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FirmwareType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Bios => std::option::Option::Some(1),
Self::Efi => 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_TYPE_UNSPECIFIED"),
Self::Bios => std::option::Option::Some("BIOS"),
Self::Efi => std::option::Option::Some("EFI"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FirmwareType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FirmwareType {
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 FirmwareType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Bios,
2 => Self::Efi,
_ => Self::UnknownValue(firmware_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FirmwareType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FIRMWARE_TYPE_UNSPECIFIED" => Self::Unspecified,
"BIOS" => Self::Bios,
"EFI" => Self::Efi,
_ => Self::UnknownValue(firmware_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FirmwareType {
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::Bios => serializer.serialize_i32(1),
Self::Efi => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FirmwareType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FirmwareType>::new(
".google.cloud.migrationcenter.v1.MachineArchitectureDetails.FirmwareType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CpuHyperThreading {
Unspecified,
Disabled,
Enabled,
UnknownValue(cpu_hyper_threading::UnknownValue),
}
#[doc(hidden)]
pub mod cpu_hyper_threading {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CpuHyperThreading {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Disabled => std::option::Option::Some(1),
Self::Enabled => 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("CPU_HYPER_THREADING_UNSPECIFIED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CpuHyperThreading {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CpuHyperThreading {
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 CpuHyperThreading {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Disabled,
2 => Self::Enabled,
_ => Self::UnknownValue(cpu_hyper_threading::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CpuHyperThreading {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CPU_HYPER_THREADING_UNSPECIFIED" => Self::Unspecified,
"DISABLED" => Self::Disabled,
"ENABLED" => Self::Enabled,
_ => Self::UnknownValue(cpu_hyper_threading::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CpuHyperThreading {
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::Disabled => serializer.serialize_i32(1),
Self::Enabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CpuHyperThreading {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CpuHyperThreading>::new(
".google.cloud.migrationcenter.v1.MachineArchitectureDetails.CpuHyperThreading",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BiosDetails {
#[deprecated]
pub bios_name: std::string::String,
pub id: std::string::String,
pub manufacturer: std::string::String,
pub version: std::string::String,
pub release_date: std::option::Option<google_cloud_type::model::Date>,
pub smbios_uuid: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BiosDetails {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_bios_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bios_name = v.into();
self
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_manufacturer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.manufacturer = 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_release_date<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.release_date = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_release_date<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.release_date = v.map(|x| x.into());
self
}
pub fn set_smbios_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.smbios_uuid = v.into();
self
}
}
impl wkt::message::Message for BiosDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.BiosDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineNetworkDetails {
pub primary_ip_address: std::string::String,
pub public_ip_address: std::string::String,
pub primary_mac_address: std::string::String,
pub adapters: std::option::Option<crate::model::NetworkAdapterList>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineNetworkDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_primary_ip_address<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.primary_ip_address = v.into();
self
}
pub fn set_public_ip_address<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.public_ip_address = v.into();
self
}
pub fn set_primary_mac_address<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.primary_mac_address = v.into();
self
}
pub fn set_adapters<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NetworkAdapterList>,
{
self.adapters = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_adapters<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NetworkAdapterList>,
{
self.adapters = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MachineNetworkDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.MachineNetworkDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkAdapterList {
pub entries: std::vec::Vec<crate::model::NetworkAdapterDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkAdapterList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NetworkAdapterDetails>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NetworkAdapterList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NetworkAdapterList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkAdapterDetails {
pub adapter_type: std::string::String,
pub mac_address: std::string::String,
pub addresses: std::option::Option<crate::model::NetworkAddressList>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkAdapterDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_adapter_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.adapter_type = v.into();
self
}
pub fn set_mac_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mac_address = v.into();
self
}
pub fn set_addresses<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NetworkAddressList>,
{
self.addresses = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_addresses<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NetworkAddressList>,
{
self.addresses = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for NetworkAdapterDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NetworkAdapterDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkAddressList {
pub entries: std::vec::Vec<crate::model::NetworkAddress>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkAddressList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NetworkAddress>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NetworkAddressList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NetworkAddressList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkAddress {
pub ip_address: std::string::String,
pub subnet_mask: std::string::String,
pub bcast: std::string::String,
pub fqdn: std::string::String,
pub assignment: crate::model::network_address::AddressAssignment,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkAddress {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip_address = v.into();
self
}
pub fn set_subnet_mask<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnet_mask = v.into();
self
}
pub fn set_bcast<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bcast = v.into();
self
}
pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.fqdn = v.into();
self
}
pub fn set_assignment<
T: std::convert::Into<crate::model::network_address::AddressAssignment>,
>(
mut self,
v: T,
) -> Self {
self.assignment = v.into();
self
}
}
impl wkt::message::Message for NetworkAddress {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NetworkAddress"
}
}
pub mod network_address {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AddressAssignment {
Unspecified,
Static,
Dhcp,
UnknownValue(address_assignment::UnknownValue),
}
#[doc(hidden)]
pub mod address_assignment {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AddressAssignment {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Static => std::option::Option::Some(1),
Self::Dhcp => 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("ADDRESS_ASSIGNMENT_UNSPECIFIED"),
Self::Static => std::option::Option::Some("ADDRESS_ASSIGNMENT_STATIC"),
Self::Dhcp => std::option::Option::Some("ADDRESS_ASSIGNMENT_DHCP"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AddressAssignment {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AddressAssignment {
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 AddressAssignment {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Static,
2 => Self::Dhcp,
_ => Self::UnknownValue(address_assignment::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AddressAssignment {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ADDRESS_ASSIGNMENT_UNSPECIFIED" => Self::Unspecified,
"ADDRESS_ASSIGNMENT_STATIC" => Self::Static,
"ADDRESS_ASSIGNMENT_DHCP" => Self::Dhcp,
_ => Self::UnknownValue(address_assignment::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AddressAssignment {
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::Static => serializer.serialize_i32(1),
Self::Dhcp => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AddressAssignment {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AddressAssignment>::new(
".google.cloud.migrationcenter.v1.NetworkAddress.AddressAssignment",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineDiskDetails {
pub total_capacity_bytes: i64,
pub total_free_bytes: i64,
pub disks: std::option::Option<crate::model::DiskEntryList>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineDiskDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_total_capacity_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_capacity_bytes = v.into();
self
}
pub fn set_total_free_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_free_bytes = v.into();
self
}
pub fn set_disks<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskEntryList>,
{
self.disks = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disks<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskEntryList>,
{
self.disks = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MachineDiskDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.MachineDiskDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskEntryList {
pub entries: std::vec::Vec<crate::model::DiskEntry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskEntryList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DiskEntry>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DiskEntryList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DiskEntryList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskEntry {
pub capacity_bytes: i64,
pub free_bytes: i64,
pub disk_label: std::string::String,
pub disk_label_type: std::string::String,
pub interface_type: crate::model::disk_entry::InterfaceType,
pub partitions: std::option::Option<crate::model::DiskPartitionList>,
pub hw_address: std::string::String,
pub platform_specific: std::option::Option<crate::model::disk_entry::PlatformSpecific>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_capacity_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.capacity_bytes = v.into();
self
}
pub fn set_free_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.free_bytes = v.into();
self
}
pub fn set_disk_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.disk_label = v.into();
self
}
pub fn set_disk_label_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.disk_label_type = v.into();
self
}
pub fn set_interface_type<T: std::convert::Into<crate::model::disk_entry::InterfaceType>>(
mut self,
v: T,
) -> Self {
self.interface_type = v.into();
self
}
pub fn set_partitions<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskPartitionList>,
{
self.partitions = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_partitions<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskPartitionList>,
{
self.partitions = v.map(|x| x.into());
self
}
pub fn set_hw_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.hw_address = v.into();
self
}
pub fn set_platform_specific<
T: std::convert::Into<std::option::Option<crate::model::disk_entry::PlatformSpecific>>,
>(
mut self,
v: T,
) -> Self {
self.platform_specific = v.into();
self
}
pub fn vmware(&self) -> std::option::Option<&std::boxed::Box<crate::model::VmwareDiskConfig>> {
#[allow(unreachable_patterns)]
self.platform_specific.as_ref().and_then(|v| match v {
crate::model::disk_entry::PlatformSpecific::Vmware(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_vmware<T: std::convert::Into<std::boxed::Box<crate::model::VmwareDiskConfig>>>(
mut self,
v: T,
) -> Self {
self.platform_specific =
std::option::Option::Some(crate::model::disk_entry::PlatformSpecific::Vmware(v.into()));
self
}
}
impl wkt::message::Message for DiskEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DiskEntry"
}
}
pub mod disk_entry {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum InterfaceType {
Unspecified,
Ide,
Sata,
Sas,
Scsi,
Nvme,
Fc,
Iscsi,
UnknownValue(interface_type::UnknownValue),
}
#[doc(hidden)]
pub mod interface_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl InterfaceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ide => std::option::Option::Some(1),
Self::Sata => std::option::Option::Some(2),
Self::Sas => std::option::Option::Some(3),
Self::Scsi => std::option::Option::Some(4),
Self::Nvme => std::option::Option::Some(5),
Self::Fc => std::option::Option::Some(6),
Self::Iscsi => 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("INTERFACE_TYPE_UNSPECIFIED"),
Self::Ide => std::option::Option::Some("IDE"),
Self::Sata => std::option::Option::Some("SATA"),
Self::Sas => std::option::Option::Some("SAS"),
Self::Scsi => std::option::Option::Some("SCSI"),
Self::Nvme => std::option::Option::Some("NVME"),
Self::Fc => std::option::Option::Some("FC"),
Self::Iscsi => std::option::Option::Some("ISCSI"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for InterfaceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for InterfaceType {
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 InterfaceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ide,
2 => Self::Sata,
3 => Self::Sas,
4 => Self::Scsi,
5 => Self::Nvme,
6 => Self::Fc,
7 => Self::Iscsi,
_ => Self::UnknownValue(interface_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for InterfaceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"INTERFACE_TYPE_UNSPECIFIED" => Self::Unspecified,
"IDE" => Self::Ide,
"SATA" => Self::Sata,
"SAS" => Self::Sas,
"SCSI" => Self::Scsi,
"NVME" => Self::Nvme,
"FC" => Self::Fc,
"ISCSI" => Self::Iscsi,
_ => Self::UnknownValue(interface_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for InterfaceType {
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::Ide => serializer.serialize_i32(1),
Self::Sata => serializer.serialize_i32(2),
Self::Sas => serializer.serialize_i32(3),
Self::Scsi => serializer.serialize_i32(4),
Self::Nvme => serializer.serialize_i32(5),
Self::Fc => serializer.serialize_i32(6),
Self::Iscsi => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for InterfaceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<InterfaceType>::new(
".google.cloud.migrationcenter.v1.DiskEntry.InterfaceType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PlatformSpecific {
Vmware(std::boxed::Box<crate::model::VmwareDiskConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskPartitionList {
pub entries: std::vec::Vec<crate::model::DiskPartition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskPartitionList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DiskPartition>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DiskPartitionList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DiskPartitionList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskPartition {
pub r#type: std::string::String,
pub file_system: std::string::String,
pub mount_point: std::string::String,
pub capacity_bytes: i64,
pub free_bytes: i64,
pub uuid: std::string::String,
pub sub_partitions: std::option::Option<std::boxed::Box<crate::model::DiskPartitionList>>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskPartition {
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_file_system<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.file_system = v.into();
self
}
pub fn set_mount_point<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mount_point = v.into();
self
}
pub fn set_capacity_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.capacity_bytes = v.into();
self
}
pub fn set_free_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.free_bytes = 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_sub_partitions<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskPartitionList>,
{
self.sub_partitions = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_sub_partitions<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskPartitionList>,
{
self.sub_partitions = v.map(|x| std::boxed::Box::new(x.into()));
self
}
}
impl wkt::message::Message for DiskPartition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DiskPartition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareDiskConfig {
pub backing_type: crate::model::vmware_disk_config::BackingType,
pub shared: bool,
pub vmdk_mode: crate::model::vmware_disk_config::VmdkMode,
pub rdm_compatibility: crate::model::vmware_disk_config::RdmCompatibility,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareDiskConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backing_type<
T: std::convert::Into<crate::model::vmware_disk_config::BackingType>,
>(
mut self,
v: T,
) -> Self {
self.backing_type = v.into();
self
}
pub fn set_shared<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.shared = v.into();
self
}
pub fn set_vmdk_mode<T: std::convert::Into<crate::model::vmware_disk_config::VmdkMode>>(
mut self,
v: T,
) -> Self {
self.vmdk_mode = v.into();
self
}
pub fn set_rdm_compatibility<
T: std::convert::Into<crate::model::vmware_disk_config::RdmCompatibility>,
>(
mut self,
v: T,
) -> Self {
self.rdm_compatibility = v.into();
self
}
}
impl wkt::message::Message for VmwareDiskConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.VmwareDiskConfig"
}
}
pub mod vmware_disk_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BackingType {
Unspecified,
FlatV1,
FlatV2,
Pmem,
RdmV1,
RdmV2,
Sesparse,
SesparseV1,
SesparseV2,
UnknownValue(backing_type::UnknownValue),
}
#[doc(hidden)]
pub mod backing_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BackingType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::FlatV1 => std::option::Option::Some(1),
Self::FlatV2 => std::option::Option::Some(2),
Self::Pmem => std::option::Option::Some(3),
Self::RdmV1 => std::option::Option::Some(4),
Self::RdmV2 => std::option::Option::Some(5),
Self::Sesparse => std::option::Option::Some(6),
Self::SesparseV1 => std::option::Option::Some(7),
Self::SesparseV2 => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("BACKING_TYPE_UNSPECIFIED"),
Self::FlatV1 => std::option::Option::Some("BACKING_TYPE_FLAT_V1"),
Self::FlatV2 => std::option::Option::Some("BACKING_TYPE_FLAT_V2"),
Self::Pmem => std::option::Option::Some("BACKING_TYPE_PMEM"),
Self::RdmV1 => std::option::Option::Some("BACKING_TYPE_RDM_V1"),
Self::RdmV2 => std::option::Option::Some("BACKING_TYPE_RDM_V2"),
Self::Sesparse => std::option::Option::Some("BACKING_TYPE_SESPARSE"),
Self::SesparseV1 => std::option::Option::Some("BACKING_TYPE_SESPARSE_V1"),
Self::SesparseV2 => std::option::Option::Some("BACKING_TYPE_SESPARSE_V2"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BackingType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BackingType {
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 BackingType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::FlatV1,
2 => Self::FlatV2,
3 => Self::Pmem,
4 => Self::RdmV1,
5 => Self::RdmV2,
6 => Self::Sesparse,
7 => Self::SesparseV1,
8 => Self::SesparseV2,
_ => Self::UnknownValue(backing_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BackingType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BACKING_TYPE_UNSPECIFIED" => Self::Unspecified,
"BACKING_TYPE_FLAT_V1" => Self::FlatV1,
"BACKING_TYPE_FLAT_V2" => Self::FlatV2,
"BACKING_TYPE_PMEM" => Self::Pmem,
"BACKING_TYPE_RDM_V1" => Self::RdmV1,
"BACKING_TYPE_RDM_V2" => Self::RdmV2,
"BACKING_TYPE_SESPARSE" => Self::Sesparse,
"BACKING_TYPE_SESPARSE_V1" => Self::SesparseV1,
"BACKING_TYPE_SESPARSE_V2" => Self::SesparseV2,
_ => Self::UnknownValue(backing_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BackingType {
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::FlatV1 => serializer.serialize_i32(1),
Self::FlatV2 => serializer.serialize_i32(2),
Self::Pmem => serializer.serialize_i32(3),
Self::RdmV1 => serializer.serialize_i32(4),
Self::RdmV2 => serializer.serialize_i32(5),
Self::Sesparse => serializer.serialize_i32(6),
Self::SesparseV1 => serializer.serialize_i32(7),
Self::SesparseV2 => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BackingType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackingType>::new(
".google.cloud.migrationcenter.v1.VmwareDiskConfig.BackingType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VmdkMode {
Unspecified,
Dependent,
IndependentPersistent,
IndependentNonpersistent,
UnknownValue(vmdk_mode::UnknownValue),
}
#[doc(hidden)]
pub mod vmdk_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VmdkMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Dependent => std::option::Option::Some(1),
Self::IndependentPersistent => std::option::Option::Some(2),
Self::IndependentNonpersistent => 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("VMDK_MODE_UNSPECIFIED"),
Self::Dependent => std::option::Option::Some("DEPENDENT"),
Self::IndependentPersistent => std::option::Option::Some("INDEPENDENT_PERSISTENT"),
Self::IndependentNonpersistent => {
std::option::Option::Some("INDEPENDENT_NONPERSISTENT")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VmdkMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VmdkMode {
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 VmdkMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Dependent,
2 => Self::IndependentPersistent,
3 => Self::IndependentNonpersistent,
_ => Self::UnknownValue(vmdk_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VmdkMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VMDK_MODE_UNSPECIFIED" => Self::Unspecified,
"DEPENDENT" => Self::Dependent,
"INDEPENDENT_PERSISTENT" => Self::IndependentPersistent,
"INDEPENDENT_NONPERSISTENT" => Self::IndependentNonpersistent,
_ => Self::UnknownValue(vmdk_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VmdkMode {
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::Dependent => serializer.serialize_i32(1),
Self::IndependentPersistent => serializer.serialize_i32(2),
Self::IndependentNonpersistent => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VmdkMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmdkMode>::new(
".google.cloud.migrationcenter.v1.VmwareDiskConfig.VmdkMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RdmCompatibility {
Unspecified,
PhysicalCompatibility,
VirtualCompatibility,
UnknownValue(rdm_compatibility::UnknownValue),
}
#[doc(hidden)]
pub mod rdm_compatibility {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RdmCompatibility {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PhysicalCompatibility => std::option::Option::Some(1),
Self::VirtualCompatibility => 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("RDM_COMPATIBILITY_UNSPECIFIED"),
Self::PhysicalCompatibility => std::option::Option::Some("PHYSICAL_COMPATIBILITY"),
Self::VirtualCompatibility => std::option::Option::Some("VIRTUAL_COMPATIBILITY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RdmCompatibility {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RdmCompatibility {
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 RdmCompatibility {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PhysicalCompatibility,
2 => Self::VirtualCompatibility,
_ => Self::UnknownValue(rdm_compatibility::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RdmCompatibility {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RDM_COMPATIBILITY_UNSPECIFIED" => Self::Unspecified,
"PHYSICAL_COMPATIBILITY" => Self::PhysicalCompatibility,
"VIRTUAL_COMPATIBILITY" => Self::VirtualCompatibility,
_ => Self::UnknownValue(rdm_compatibility::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RdmCompatibility {
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::PhysicalCompatibility => serializer.serialize_i32(1),
Self::VirtualCompatibility => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RdmCompatibility {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RdmCompatibility>::new(
".google.cloud.migrationcenter.v1.VmwareDiskConfig.RdmCompatibility",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GuestOsDetails {
pub os_name: std::string::String,
pub family: crate::model::OperatingSystemFamily,
pub version: std::string::String,
pub config: std::option::Option<crate::model::GuestConfigDetails>,
pub runtime: std::option::Option<crate::model::GuestRuntimeDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GuestOsDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_os_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.os_name = v.into();
self
}
pub fn set_family<T: std::convert::Into<crate::model::OperatingSystemFamily>>(
mut self,
v: T,
) -> Self {
self.family = 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_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GuestConfigDetails>,
{
self.config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GuestConfigDetails>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_runtime<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GuestRuntimeDetails>,
{
self.runtime = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_runtime<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GuestRuntimeDetails>,
{
self.runtime = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GuestOsDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GuestOsDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GuestConfigDetails {
pub issue: std::string::String,
pub fstab: std::option::Option<crate::model::FstabEntryList>,
pub hosts: std::option::Option<crate::model::HostsEntryList>,
pub nfs_exports: std::option::Option<crate::model::NfsExportList>,
pub selinux_mode: crate::model::guest_config_details::SeLinuxMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GuestConfigDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_issue<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.issue = v.into();
self
}
pub fn set_fstab<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FstabEntryList>,
{
self.fstab = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_fstab<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FstabEntryList>,
{
self.fstab = v.map(|x| x.into());
self
}
pub fn set_hosts<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::HostsEntryList>,
{
self.hosts = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hosts<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::HostsEntryList>,
{
self.hosts = v.map(|x| x.into());
self
}
pub fn set_nfs_exports<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NfsExportList>,
{
self.nfs_exports = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_nfs_exports<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NfsExportList>,
{
self.nfs_exports = v.map(|x| x.into());
self
}
pub fn set_selinux_mode<
T: std::convert::Into<crate::model::guest_config_details::SeLinuxMode>,
>(
mut self,
v: T,
) -> Self {
self.selinux_mode = v.into();
self
}
}
impl wkt::message::Message for GuestConfigDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GuestConfigDetails"
}
}
pub mod guest_config_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SeLinuxMode {
Unspecified,
Disabled,
Permissive,
Enforcing,
UnknownValue(se_linux_mode::UnknownValue),
}
#[doc(hidden)]
pub mod se_linux_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SeLinuxMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Disabled => std::option::Option::Some(1),
Self::Permissive => std::option::Option::Some(2),
Self::Enforcing => 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("SE_LINUX_MODE_UNSPECIFIED"),
Self::Disabled => std::option::Option::Some("SE_LINUX_MODE_DISABLED"),
Self::Permissive => std::option::Option::Some("SE_LINUX_MODE_PERMISSIVE"),
Self::Enforcing => std::option::Option::Some("SE_LINUX_MODE_ENFORCING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SeLinuxMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SeLinuxMode {
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 SeLinuxMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Disabled,
2 => Self::Permissive,
3 => Self::Enforcing,
_ => Self::UnknownValue(se_linux_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SeLinuxMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SE_LINUX_MODE_UNSPECIFIED" => Self::Unspecified,
"SE_LINUX_MODE_DISABLED" => Self::Disabled,
"SE_LINUX_MODE_PERMISSIVE" => Self::Permissive,
"SE_LINUX_MODE_ENFORCING" => Self::Enforcing,
_ => Self::UnknownValue(se_linux_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SeLinuxMode {
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::Disabled => serializer.serialize_i32(1),
Self::Permissive => serializer.serialize_i32(2),
Self::Enforcing => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SeLinuxMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SeLinuxMode>::new(
".google.cloud.migrationcenter.v1.GuestConfigDetails.SeLinuxMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FstabEntryList {
pub entries: std::vec::Vec<crate::model::FstabEntry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FstabEntryList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FstabEntry>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FstabEntryList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.FstabEntryList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FstabEntry {
pub spec: std::string::String,
pub file: std::string::String,
pub vfstype: std::string::String,
pub mntops: std::string::String,
pub freq: i32,
pub passno: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FstabEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spec = v.into();
self
}
pub fn set_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.file = v.into();
self
}
pub fn set_vfstype<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vfstype = v.into();
self
}
pub fn set_mntops<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mntops = v.into();
self
}
pub fn set_freq<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.freq = v.into();
self
}
pub fn set_passno<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.passno = v.into();
self
}
}
impl wkt::message::Message for FstabEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.FstabEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HostsEntryList {
pub entries: std::vec::Vec<crate::model::HostsEntry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HostsEntryList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::HostsEntry>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for HostsEntryList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.HostsEntryList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HostsEntry {
pub ip: std::string::String,
pub host_names: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HostsEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip = v.into();
self
}
pub fn set_host_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.host_names = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for HostsEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.HostsEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NfsExportList {
pub entries: std::vec::Vec<crate::model::NfsExport>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NfsExportList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NfsExport>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NfsExportList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NfsExportList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NfsExport {
pub export_directory: std::string::String,
pub hosts: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NfsExport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_export_directory<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.export_directory = v.into();
self
}
pub fn set_hosts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.hosts = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NfsExport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NfsExport"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GuestRuntimeDetails {
pub services: std::option::Option<crate::model::RunningServiceList>,
pub processes: std::option::Option<crate::model::RunningProcessList>,
pub network: std::option::Option<crate::model::RuntimeNetworkInfo>,
pub last_boot_time: std::option::Option<wkt::Timestamp>,
pub domain: std::string::String,
pub machine_name: std::string::String,
pub installed_apps: std::option::Option<crate::model::GuestInstalledApplicationList>,
pub open_file_list: std::option::Option<crate::model::OpenFileList>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GuestRuntimeDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_services<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RunningServiceList>,
{
self.services = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_services<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RunningServiceList>,
{
self.services = v.map(|x| x.into());
self
}
pub fn set_processes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RunningProcessList>,
{
self.processes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_processes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RunningProcessList>,
{
self.processes = v.map(|x| x.into());
self
}
pub fn set_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RuntimeNetworkInfo>,
{
self.network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RuntimeNetworkInfo>,
{
self.network = v.map(|x| x.into());
self
}
pub fn set_last_boot_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_boot_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_boot_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_boot_time = v.map(|x| x.into());
self
}
pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.domain = v.into();
self
}
pub fn set_machine_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_name = v.into();
self
}
pub fn set_installed_apps<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GuestInstalledApplicationList>,
{
self.installed_apps = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_installed_apps<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GuestInstalledApplicationList>,
{
self.installed_apps = v.map(|x| x.into());
self
}
pub fn set_open_file_list<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OpenFileList>,
{
self.open_file_list = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_open_file_list<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OpenFileList>,
{
self.open_file_list = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GuestRuntimeDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GuestRuntimeDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunningServiceList {
pub entries: std::vec::Vec<crate::model::RunningService>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunningServiceList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RunningService>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RunningServiceList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.RunningServiceList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunningService {
pub service_name: std::string::String,
pub state: crate::model::running_service::State,
pub start_mode: crate::model::running_service::StartMode,
pub exe_path: std::string::String,
pub cmdline: std::string::String,
pub pid: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunningService {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::running_service::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_start_mode<T: std::convert::Into<crate::model::running_service::StartMode>>(
mut self,
v: T,
) -> Self {
self.start_mode = v.into();
self
}
pub fn set_exe_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.exe_path = v.into();
self
}
pub fn set_cmdline<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cmdline = v.into();
self
}
pub fn set_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.pid = v.into();
self
}
}
impl wkt::message::Message for RunningService {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.RunningService"
}
}
pub mod running_service {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Paused,
Stopped,
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::Active => std::option::Option::Some(1),
Self::Paused => std::option::Option::Some(2),
Self::Stopped => 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::Active => std::option::Option::Some("ACTIVE"),
Self::Paused => std::option::Option::Some("PAUSED"),
Self::Stopped => std::option::Option::Some("STOPPED"),
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::Active,
2 => Self::Paused,
3 => Self::Stopped,
_ => 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,
"ACTIVE" => Self::Active,
"PAUSED" => Self::Paused,
"STOPPED" => Self::Stopped,
_ => 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::Active => serializer.serialize_i32(1),
Self::Paused => serializer.serialize_i32(2),
Self::Stopped => 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.migrationcenter.v1.RunningService.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StartMode {
Unspecified,
Boot,
System,
Auto,
Manual,
Disabled,
UnknownValue(start_mode::UnknownValue),
}
#[doc(hidden)]
pub mod start_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl StartMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Boot => std::option::Option::Some(1),
Self::System => std::option::Option::Some(2),
Self::Auto => std::option::Option::Some(3),
Self::Manual => std::option::Option::Some(4),
Self::Disabled => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("START_MODE_UNSPECIFIED"),
Self::Boot => std::option::Option::Some("BOOT"),
Self::System => std::option::Option::Some("SYSTEM"),
Self::Auto => std::option::Option::Some("AUTO"),
Self::Manual => std::option::Option::Some("MANUAL"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for StartMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for StartMode {
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 StartMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Boot,
2 => Self::System,
3 => Self::Auto,
4 => Self::Manual,
5 => Self::Disabled,
_ => Self::UnknownValue(start_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for StartMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"START_MODE_UNSPECIFIED" => Self::Unspecified,
"BOOT" => Self::Boot,
"SYSTEM" => Self::System,
"AUTO" => Self::Auto,
"MANUAL" => Self::Manual,
"DISABLED" => Self::Disabled,
_ => Self::UnknownValue(start_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for StartMode {
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::Boot => serializer.serialize_i32(1),
Self::System => serializer.serialize_i32(2),
Self::Auto => serializer.serialize_i32(3),
Self::Manual => serializer.serialize_i32(4),
Self::Disabled => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for StartMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<StartMode>::new(
".google.cloud.migrationcenter.v1.RunningService.StartMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunningProcessList {
pub entries: std::vec::Vec<crate::model::RunningProcess>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunningProcessList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RunningProcess>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RunningProcessList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.RunningProcessList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunningProcess {
pub pid: i64,
pub exe_path: std::string::String,
pub cmdline: std::string::String,
pub user: std::string::String,
pub attributes: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunningProcess {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.pid = v.into();
self
}
pub fn set_exe_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.exe_path = v.into();
self
}
pub fn set_cmdline<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cmdline = v.into();
self
}
pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user = v.into();
self
}
pub fn set_attributes<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.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for RunningProcess {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.RunningProcess"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuntimeNetworkInfo {
pub scan_time: std::option::Option<wkt::Timestamp>,
pub connections: std::option::Option<crate::model::NetworkConnectionList>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuntimeNetworkInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_scan_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.scan_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scan_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.scan_time = v.map(|x| x.into());
self
}
pub fn set_connections<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NetworkConnectionList>,
{
self.connections = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_connections<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NetworkConnectionList>,
{
self.connections = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RuntimeNetworkInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.RuntimeNetworkInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkConnectionList {
pub entries: std::vec::Vec<crate::model::NetworkConnection>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkConnectionList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NetworkConnection>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NetworkConnectionList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NetworkConnectionList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkConnection {
pub protocol: std::string::String,
pub local_ip_address: std::string::String,
pub local_port: i32,
pub remote_ip_address: std::string::String,
pub remote_port: i32,
pub state: crate::model::network_connection::State,
pub pid: i64,
pub process_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkConnection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.protocol = v.into();
self
}
pub fn set_local_ip_address<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.local_ip_address = v.into();
self
}
pub fn set_local_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.local_port = v.into();
self
}
pub fn set_remote_ip_address<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.remote_ip_address = v.into();
self
}
pub fn set_remote_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.remote_port = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::network_connection::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.pid = v.into();
self
}
pub fn set_process_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.process_name = v.into();
self
}
}
impl wkt::message::Message for NetworkConnection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NetworkConnection"
}
}
pub mod network_connection {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Opening,
Open,
Listen,
Closing,
Closed,
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::Opening => std::option::Option::Some(1),
Self::Open => std::option::Option::Some(2),
Self::Listen => std::option::Option::Some(3),
Self::Closing => std::option::Option::Some(4),
Self::Closed => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Opening => std::option::Option::Some("OPENING"),
Self::Open => std::option::Option::Some("OPEN"),
Self::Listen => std::option::Option::Some("LISTEN"),
Self::Closing => std::option::Option::Some("CLOSING"),
Self::Closed => std::option::Option::Some("CLOSED"),
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::Opening,
2 => Self::Open,
3 => Self::Listen,
4 => Self::Closing,
5 => Self::Closed,
_ => 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,
"OPENING" => Self::Opening,
"OPEN" => Self::Open,
"LISTEN" => Self::Listen,
"CLOSING" => Self::Closing,
"CLOSED" => Self::Closed,
_ => 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::Opening => serializer.serialize_i32(1),
Self::Open => serializer.serialize_i32(2),
Self::Listen => serializer.serialize_i32(3),
Self::Closing => serializer.serialize_i32(4),
Self::Closed => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.migrationcenter.v1.NetworkConnection.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GuestInstalledApplicationList {
pub entries: std::vec::Vec<crate::model::GuestInstalledApplication>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GuestInstalledApplicationList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GuestInstalledApplication>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GuestInstalledApplicationList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GuestInstalledApplicationList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GuestInstalledApplication {
pub application_name: std::string::String,
pub vendor: std::string::String,
pub install_time: std::option::Option<wkt::Timestamp>,
pub path: std::string::String,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GuestInstalledApplication {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_application_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.application_name = v.into();
self
}
pub fn set_vendor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vendor = v.into();
self
}
pub fn set_install_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.install_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_install_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.install_time = v.map(|x| x.into());
self
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for GuestInstalledApplication {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GuestInstalledApplication"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OpenFileList {
pub entries: std::vec::Vec<crate::model::OpenFileDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OpenFileList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::OpenFileDetails>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for OpenFileList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.OpenFileList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OpenFileDetails {
pub command: std::string::String,
pub user: std::string::String,
pub file_type: std::string::String,
pub file_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OpenFileDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.command = v.into();
self
}
pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user = v.into();
self
}
pub fn set_file_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.file_type = v.into();
self
}
pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.file_path = v.into();
self
}
}
impl wkt::message::Message for OpenFileDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.OpenFileDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PlatformDetails {
pub vendor_details: std::option::Option<crate::model::platform_details::VendorDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PlatformDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vendor_details<
T: std::convert::Into<std::option::Option<crate::model::platform_details::VendorDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vendor_details = v.into();
self
}
pub fn vmware_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VmwarePlatformDetails>> {
#[allow(unreachable_patterns)]
self.vendor_details.as_ref().and_then(|v| match v {
crate::model::platform_details::VendorDetails::VmwareDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_vmware_details<
T: std::convert::Into<std::boxed::Box<crate::model::VmwarePlatformDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vendor_details = std::option::Option::Some(
crate::model::platform_details::VendorDetails::VmwareDetails(v.into()),
);
self
}
pub fn aws_ec2_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AwsEc2PlatformDetails>> {
#[allow(unreachable_patterns)]
self.vendor_details.as_ref().and_then(|v| match v {
crate::model::platform_details::VendorDetails::AwsEc2Details(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_aws_ec2_details<
T: std::convert::Into<std::boxed::Box<crate::model::AwsEc2PlatformDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vendor_details = std::option::Option::Some(
crate::model::platform_details::VendorDetails::AwsEc2Details(v.into()),
);
self
}
pub fn azure_vm_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AzureVmPlatformDetails>> {
#[allow(unreachable_patterns)]
self.vendor_details.as_ref().and_then(|v| match v {
crate::model::platform_details::VendorDetails::AzureVmDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_azure_vm_details<
T: std::convert::Into<std::boxed::Box<crate::model::AzureVmPlatformDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vendor_details = std::option::Option::Some(
crate::model::platform_details::VendorDetails::AzureVmDetails(v.into()),
);
self
}
pub fn generic_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::GenericPlatformDetails>> {
#[allow(unreachable_patterns)]
self.vendor_details.as_ref().and_then(|v| match v {
crate::model::platform_details::VendorDetails::GenericDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_generic_details<
T: std::convert::Into<std::boxed::Box<crate::model::GenericPlatformDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vendor_details = std::option::Option::Some(
crate::model::platform_details::VendorDetails::GenericDetails(v.into()),
);
self
}
pub fn physical_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PhysicalPlatformDetails>> {
#[allow(unreachable_patterns)]
self.vendor_details.as_ref().and_then(|v| match v {
crate::model::platform_details::VendorDetails::PhysicalDetails(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_physical_details<
T: std::convert::Into<std::boxed::Box<crate::model::PhysicalPlatformDetails>>,
>(
mut self,
v: T,
) -> Self {
self.vendor_details = std::option::Option::Some(
crate::model::platform_details::VendorDetails::PhysicalDetails(v.into()),
);
self
}
}
impl wkt::message::Message for PlatformDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.PlatformDetails"
}
}
pub mod platform_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VendorDetails {
VmwareDetails(std::boxed::Box<crate::model::VmwarePlatformDetails>),
AwsEc2Details(std::boxed::Box<crate::model::AwsEc2PlatformDetails>),
AzureVmDetails(std::boxed::Box<crate::model::AzureVmPlatformDetails>),
GenericDetails(std::boxed::Box<crate::model::GenericPlatformDetails>),
PhysicalDetails(std::boxed::Box<crate::model::PhysicalPlatformDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwarePlatformDetails {
pub vcenter_version: std::string::String,
pub esx_version: std::string::String,
pub osid: std::string::String,
pub vcenter_folder: std::string::String,
pub vcenter_uri: std::string::String,
pub vcenter_vm_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwarePlatformDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vcenter_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vcenter_version = v.into();
self
}
pub fn set_esx_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.esx_version = v.into();
self
}
pub fn set_osid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.osid = v.into();
self
}
pub fn set_vcenter_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vcenter_folder = v.into();
self
}
pub fn set_vcenter_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vcenter_uri = v.into();
self
}
pub fn set_vcenter_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vcenter_vm_id = v.into();
self
}
}
impl wkt::message::Message for VmwarePlatformDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.VmwarePlatformDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsEc2PlatformDetails {
pub machine_type_label: std::string::String,
pub location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsEc2PlatformDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_type_label<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.machine_type_label = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
}
impl wkt::message::Message for AwsEc2PlatformDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AwsEc2PlatformDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureVmPlatformDetails {
pub machine_type_label: std::string::String,
pub location: std::string::String,
pub provisioning_state: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureVmPlatformDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_type_label<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.machine_type_label = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_provisioning_state<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.provisioning_state = v.into();
self
}
}
impl wkt::message::Message for AzureVmPlatformDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AzureVmPlatformDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenericPlatformDetails {
pub location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenericPlatformDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
}
impl wkt::message::Message for GenericPlatformDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GenericPlatformDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PhysicalPlatformDetails {
pub location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PhysicalPlatformDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
}
impl wkt::message::Message for PhysicalPlatformDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.PhysicalPlatformDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MemoryUsageSample {
pub utilized_percentage: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MemoryUsageSample {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_utilized_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.utilized_percentage = v.into();
self
}
}
impl wkt::message::Message for MemoryUsageSample {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.MemoryUsageSample"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CpuUsageSample {
pub utilized_percentage: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CpuUsageSample {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_utilized_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.utilized_percentage = v.into();
self
}
}
impl wkt::message::Message for CpuUsageSample {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.CpuUsageSample"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkUsageSample {
pub average_ingress_bps: f32,
pub average_egress_bps: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkUsageSample {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_average_ingress_bps<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.average_ingress_bps = v.into();
self
}
pub fn set_average_egress_bps<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.average_egress_bps = v.into();
self
}
}
impl wkt::message::Message for NetworkUsageSample {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.NetworkUsageSample"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskUsageSample {
pub average_iops: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskUsageSample {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_average_iops<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.average_iops = v.into();
self
}
}
impl wkt::message::Message for DiskUsageSample {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DiskUsageSample"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PerformanceSample {
pub sample_time: std::option::Option<wkt::Timestamp>,
pub memory: std::option::Option<crate::model::MemoryUsageSample>,
pub cpu: std::option::Option<crate::model::CpuUsageSample>,
pub network: std::option::Option<crate::model::NetworkUsageSample>,
pub disk: std::option::Option<crate::model::DiskUsageSample>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PerformanceSample {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sample_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.sample_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sample_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.sample_time = v.map(|x| x.into());
self
}
pub fn set_memory<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MemoryUsageSample>,
{
self.memory = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_memory<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MemoryUsageSample>,
{
self.memory = v.map(|x| x.into());
self
}
pub fn set_cpu<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CpuUsageSample>,
{
self.cpu = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cpu<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CpuUsageSample>,
{
self.cpu = v.map(|x| x.into());
self
}
pub fn set_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NetworkUsageSample>,
{
self.network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NetworkUsageSample>,
{
self.network = v.map(|x| x.into());
self
}
pub fn set_disk<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskUsageSample>,
{
self.disk = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskUsageSample>,
{
self.disk = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PerformanceSample {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.PerformanceSample"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AssetPerformanceData {
pub daily_resource_usage_aggregations:
std::vec::Vec<crate::model::DailyResourceUsageAggregation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AssetPerformanceData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_daily_resource_usage_aggregations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DailyResourceUsageAggregation>,
{
use std::iter::Iterator;
self.daily_resource_usage_aggregations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AssetPerformanceData {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AssetPerformanceData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DailyResourceUsageAggregation {
pub date: std::option::Option<google_cloud_type::model::Date>,
pub cpu: std::option::Option<crate::model::daily_resource_usage_aggregation::Cpu>,
pub memory: std::option::Option<crate::model::daily_resource_usage_aggregation::Memory>,
pub network: std::option::Option<crate::model::daily_resource_usage_aggregation::Network>,
pub disk: std::option::Option<crate::model::daily_resource_usage_aggregation::Disk>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DailyResourceUsageAggregation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_date<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.date = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_date<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.date = v.map(|x| x.into());
self
}
pub fn set_cpu<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Cpu>,
{
self.cpu = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cpu<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Cpu>,
{
self.cpu = v.map(|x| x.into());
self
}
pub fn set_memory<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Memory>,
{
self.memory = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_memory<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Memory>,
{
self.memory = v.map(|x| x.into());
self
}
pub fn set_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Network>,
{
self.network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Network>,
{
self.network = v.map(|x| x.into());
self
}
pub fn set_disk<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Disk>,
{
self.disk = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Disk>,
{
self.disk = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DailyResourceUsageAggregation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DailyResourceUsageAggregation"
}
}
pub mod daily_resource_usage_aggregation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Stats {
pub average: f32,
pub median: f32,
pub nintey_fifth_percentile: f32,
pub peak: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Stats {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_average<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.average = v.into();
self
}
pub fn set_median<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.median = v.into();
self
}
pub fn set_nintey_fifth_percentile<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.nintey_fifth_percentile = v.into();
self
}
pub fn set_peak<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.peak = v.into();
self
}
}
impl wkt::message::Message for Stats {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DailyResourceUsageAggregation.Stats"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Cpu {
pub utilization_percentage:
std::option::Option<crate::model::daily_resource_usage_aggregation::Stats>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Cpu {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_utilization_percentage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.utilization_percentage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_utilization_percentage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.utilization_percentage = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Cpu {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DailyResourceUsageAggregation.CPU"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Memory {
pub utilization_percentage:
std::option::Option<crate::model::daily_resource_usage_aggregation::Stats>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Memory {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_utilization_percentage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.utilization_percentage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_utilization_percentage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.utilization_percentage = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Memory {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DailyResourceUsageAggregation.Memory"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Network {
pub ingress_bps: std::option::Option<crate::model::daily_resource_usage_aggregation::Stats>,
pub egress_bps: std::option::Option<crate::model::daily_resource_usage_aggregation::Stats>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Network {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ingress_bps<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.ingress_bps = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ingress_bps<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.ingress_bps = v.map(|x| x.into());
self
}
pub fn set_egress_bps<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.egress_bps = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_egress_bps<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.egress_bps = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Network {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DailyResourceUsageAggregation.Network"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Disk {
pub iops: std::option::Option<crate::model::daily_resource_usage_aggregation::Stats>,
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_iops<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.iops = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_iops<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::daily_resource_usage_aggregation::Stats>,
{
self.iops = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Disk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.DailyResourceUsageAggregation.Disk"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InsightList {
pub insights: std::vec::Vec<crate::model::Insight>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InsightList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_insights<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Insight>,
{
use std::iter::Iterator;
self.insights = 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
}
}
impl wkt::message::Message for InsightList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.InsightList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Insight {
pub insight: std::option::Option<crate::model::insight::Insight>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Insight {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_insight<
T: std::convert::Into<std::option::Option<crate::model::insight::Insight>>,
>(
mut self,
v: T,
) -> Self {
self.insight = v.into();
self
}
pub fn migration_insight(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MigrationInsight>> {
#[allow(unreachable_patterns)]
self.insight.as_ref().and_then(|v| match v {
crate::model::insight::Insight::MigrationInsight(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_migration_insight<
T: std::convert::Into<std::boxed::Box<crate::model::MigrationInsight>>,
>(
mut self,
v: T,
) -> Self {
self.insight =
std::option::Option::Some(crate::model::insight::Insight::MigrationInsight(v.into()));
self
}
pub fn generic_insight(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::GenericInsight>> {
#[allow(unreachable_patterns)]
self.insight.as_ref().and_then(|v| match v {
crate::model::insight::Insight::GenericInsight(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_generic_insight<
T: std::convert::Into<std::boxed::Box<crate::model::GenericInsight>>,
>(
mut self,
v: T,
) -> Self {
self.insight =
std::option::Option::Some(crate::model::insight::Insight::GenericInsight(v.into()));
self
}
}
impl wkt::message::Message for Insight {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Insight"
}
}
pub mod insight {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Insight {
MigrationInsight(std::boxed::Box<crate::model::MigrationInsight>),
GenericInsight(std::boxed::Box<crate::model::GenericInsight>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenericInsight {
pub message_id: i64,
pub default_message: std::string::String,
pub additional_information: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenericInsight {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.message_id = v.into();
self
}
pub fn set_default_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.default_message = v.into();
self
}
pub fn set_additional_information<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_information = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GenericInsight {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.GenericInsight"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MigrationInsight {
pub fit: std::option::Option<crate::model::FitDescriptor>,
pub migration_target: std::option::Option<crate::model::migration_insight::MigrationTarget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MigrationInsight {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_fit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FitDescriptor>,
{
self.fit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_fit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FitDescriptor>,
{
self.fit = v.map(|x| x.into());
self
}
pub fn set_migration_target<
T: std::convert::Into<std::option::Option<crate::model::migration_insight::MigrationTarget>>,
>(
mut self,
v: T,
) -> Self {
self.migration_target = v.into();
self
}
pub fn compute_engine_target(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineMigrationTarget>> {
#[allow(unreachable_patterns)]
self.migration_target.as_ref().and_then(|v| match v {
crate::model::migration_insight::MigrationTarget::ComputeEngineTarget(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_compute_engine_target<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineMigrationTarget>>,
>(
mut self,
v: T,
) -> Self {
self.migration_target = std::option::Option::Some(
crate::model::migration_insight::MigrationTarget::ComputeEngineTarget(v.into()),
);
self
}
}
impl wkt::message::Message for MigrationInsight {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.MigrationInsight"
}
}
pub mod migration_insight {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MigrationTarget {
ComputeEngineTarget(std::boxed::Box<crate::model::ComputeEngineMigrationTarget>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEngineMigrationTarget {
pub shape: std::option::Option<crate::model::ComputeEngineShapeDescriptor>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEngineMigrationTarget {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_shape<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ComputeEngineShapeDescriptor>,
{
self.shape = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_shape<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ComputeEngineShapeDescriptor>,
{
self.shape = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ComputeEngineMigrationTarget {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ComputeEngineMigrationTarget"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEngineShapeDescriptor {
pub memory_mb: i32,
pub physical_core_count: i32,
pub logical_core_count: i32,
pub series: std::string::String,
pub machine_type: std::string::String,
pub storage: std::vec::Vec<crate::model::ComputeStorageDescriptor>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEngineShapeDescriptor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.memory_mb = v.into();
self
}
pub fn set_physical_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.physical_core_count = v.into();
self
}
pub fn set_logical_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.logical_core_count = v.into();
self
}
pub fn set_series<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.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_storage<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ComputeStorageDescriptor>,
{
use std::iter::Iterator;
self.storage = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ComputeEngineShapeDescriptor {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeStorageDescriptor {
pub r#type: crate::model::PersistentDiskType,
pub size_gb: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeStorageDescriptor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::PersistentDiskType>>(
mut self,
v: T,
) -> Self {
self.r#type = 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 ComputeStorageDescriptor {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ComputeStorageDescriptor"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FitDescriptor {
pub fit_level: crate::model::fit_descriptor::FitLevel,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FitDescriptor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_fit_level<T: std::convert::Into<crate::model::fit_descriptor::FitLevel>>(
mut self,
v: T,
) -> Self {
self.fit_level = v.into();
self
}
}
impl wkt::message::Message for FitDescriptor {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.FitDescriptor"
}
}
pub mod fit_descriptor {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FitLevel {
Unspecified,
Fit,
NoFit,
RequiresEffort,
UnknownValue(fit_level::UnknownValue),
}
#[doc(hidden)]
pub mod fit_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FitLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Fit => std::option::Option::Some(1),
Self::NoFit => std::option::Option::Some(2),
Self::RequiresEffort => 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("FIT_LEVEL_UNSPECIFIED"),
Self::Fit => std::option::Option::Some("FIT"),
Self::NoFit => std::option::Option::Some("NO_FIT"),
Self::RequiresEffort => std::option::Option::Some("REQUIRES_EFFORT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FitLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FitLevel {
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 FitLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Fit,
2 => Self::NoFit,
3 => Self::RequiresEffort,
_ => Self::UnknownValue(fit_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FitLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FIT_LEVEL_UNSPECIFIED" => Self::Unspecified,
"FIT" => Self::Fit,
"NO_FIT" => Self::NoFit,
"REQUIRES_EFFORT" => Self::RequiresEffort,
_ => Self::UnknownValue(fit_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FitLevel {
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::Fit => serializer.serialize_i32(1),
Self::NoFit => serializer.serialize_i32(2),
Self::RequiresEffort => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FitLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FitLevel>::new(
".google.cloud.migrationcenter.v1.FitDescriptor.FitLevel",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Aggregation {
pub field: std::string::String,
pub aggregation_function: std::option::Option<crate::model::aggregation::AggregationFunction>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Aggregation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
pub fn set_aggregation_function<
T: std::convert::Into<std::option::Option<crate::model::aggregation::AggregationFunction>>,
>(
mut self,
v: T,
) -> Self {
self.aggregation_function = v.into();
self
}
pub fn count(&self) -> std::option::Option<&std::boxed::Box<crate::model::aggregation::Count>> {
#[allow(unreachable_patterns)]
self.aggregation_function.as_ref().and_then(|v| match v {
crate::model::aggregation::AggregationFunction::Count(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_count<T: std::convert::Into<std::boxed::Box<crate::model::aggregation::Count>>>(
mut self,
v: T,
) -> Self {
self.aggregation_function = std::option::Option::Some(
crate::model::aggregation::AggregationFunction::Count(v.into()),
);
self
}
pub fn sum(&self) -> std::option::Option<&std::boxed::Box<crate::model::aggregation::Sum>> {
#[allow(unreachable_patterns)]
self.aggregation_function.as_ref().and_then(|v| match v {
crate::model::aggregation::AggregationFunction::Sum(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_sum<T: std::convert::Into<std::boxed::Box<crate::model::aggregation::Sum>>>(
mut self,
v: T,
) -> Self {
self.aggregation_function = std::option::Option::Some(
crate::model::aggregation::AggregationFunction::Sum(v.into()),
);
self
}
pub fn histogram(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::aggregation::Histogram>> {
#[allow(unreachable_patterns)]
self.aggregation_function.as_ref().and_then(|v| match v {
crate::model::aggregation::AggregationFunction::Histogram(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_histogram<
T: std::convert::Into<std::boxed::Box<crate::model::aggregation::Histogram>>,
>(
mut self,
v: T,
) -> Self {
self.aggregation_function = std::option::Option::Some(
crate::model::aggregation::AggregationFunction::Histogram(v.into()),
);
self
}
pub fn frequency(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::aggregation::Frequency>> {
#[allow(unreachable_patterns)]
self.aggregation_function.as_ref().and_then(|v| match v {
crate::model::aggregation::AggregationFunction::Frequency(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_frequency<
T: std::convert::Into<std::boxed::Box<crate::model::aggregation::Frequency>>,
>(
mut self,
v: T,
) -> Self {
self.aggregation_function = std::option::Option::Some(
crate::model::aggregation::AggregationFunction::Frequency(v.into()),
);
self
}
}
impl wkt::message::Message for Aggregation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Aggregation"
}
}
pub mod aggregation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Count {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Count {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Count {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Aggregation.Count"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Sum {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Sum {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Sum {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Aggregation.Sum"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Histogram {
pub lower_bounds: std::vec::Vec<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Histogram {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lower_bounds<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<f64>,
{
use std::iter::Iterator;
self.lower_bounds = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Histogram {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Aggregation.Histogram"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Frequency {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Frequency {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Frequency {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Aggregation.Frequency"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AggregationFunction {
Count(std::boxed::Box<crate::model::aggregation::Count>),
Sum(std::boxed::Box<crate::model::aggregation::Sum>),
Histogram(std::boxed::Box<crate::model::aggregation::Histogram>),
Frequency(std::boxed::Box<crate::model::aggregation::Frequency>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AggregationResult {
pub field: std::string::String,
pub result: std::option::Option<crate::model::aggregation_result::Result>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AggregationResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
pub fn set_result<
T: std::convert::Into<std::option::Option<crate::model::aggregation_result::Result>>,
>(
mut self,
v: T,
) -> Self {
self.result = v.into();
self
}
pub fn count(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::aggregation_result::Count>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::aggregation_result::Result::Count(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_count<
T: std::convert::Into<std::boxed::Box<crate::model::aggregation_result::Count>>,
>(
mut self,
v: T,
) -> Self {
self.result =
std::option::Option::Some(crate::model::aggregation_result::Result::Count(v.into()));
self
}
pub fn sum(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::aggregation_result::Sum>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::aggregation_result::Result::Sum(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_sum<
T: std::convert::Into<std::boxed::Box<crate::model::aggregation_result::Sum>>,
>(
mut self,
v: T,
) -> Self {
self.result =
std::option::Option::Some(crate::model::aggregation_result::Result::Sum(v.into()));
self
}
pub fn histogram(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::aggregation_result::Histogram>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::aggregation_result::Result::Histogram(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_histogram<
T: std::convert::Into<std::boxed::Box<crate::model::aggregation_result::Histogram>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::aggregation_result::Result::Histogram(v.into()),
);
self
}
pub fn frequency(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::aggregation_result::Frequency>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::aggregation_result::Result::Frequency(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_frequency<
T: std::convert::Into<std::boxed::Box<crate::model::aggregation_result::Frequency>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::aggregation_result::Result::Frequency(v.into()),
);
self
}
}
impl wkt::message::Message for AggregationResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AggregationResult"
}
}
pub mod aggregation_result {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Count {
pub value: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Count {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for Count {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AggregationResult.Count"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Sum {
pub value: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Sum {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for Sum {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AggregationResult.Sum"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Histogram {
pub buckets: std::vec::Vec<crate::model::aggregation_result::histogram::Bucket>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Histogram {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_buckets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::aggregation_result::histogram::Bucket>,
{
use std::iter::Iterator;
self.buckets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Histogram {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AggregationResult.Histogram"
}
}
pub mod histogram {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Bucket {
pub lower_bound: f64,
pub upper_bound: f64,
pub count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Bucket {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lower_bound<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.lower_bound = v.into();
self
}
pub fn set_upper_bound<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.upper_bound = v.into();
self
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
}
impl wkt::message::Message for Bucket {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Frequency {
pub values: std::collections::HashMap<std::string::String, i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Frequency {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_values<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<i64>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for Frequency {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AggregationResult.Frequency"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
Count(std::boxed::Box<crate::model::aggregation_result::Count>),
Sum(std::boxed::Box<crate::model::aggregation_result::Sum>),
Histogram(std::boxed::Box<crate::model::aggregation_result::Histogram>),
Frequency(std::boxed::Box<crate::model::aggregation_result::Frequency>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FileValidationReport {
pub file_name: std::string::String,
pub row_errors: std::vec::Vec<crate::model::ImportRowError>,
pub partial_report: bool,
pub file_errors: std::vec::Vec<crate::model::ImportError>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FileValidationReport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.file_name = v.into();
self
}
pub fn set_row_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImportRowError>,
{
use std::iter::Iterator;
self.row_errors = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_partial_report<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.partial_report = v.into();
self
}
pub fn set_file_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImportError>,
{
use std::iter::Iterator;
self.file_errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FileValidationReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.FileValidationReport"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValidationReport {
pub file_validations: std::vec::Vec<crate::model::FileValidationReport>,
pub job_errors: std::vec::Vec<crate::model::ImportError>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ValidationReport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_file_validations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FileValidationReport>,
{
use std::iter::Iterator;
self.file_validations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_job_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ImportError>,
{
use std::iter::Iterator;
self.job_errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ValidationReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ValidationReport"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionReport {
pub frames_reported: i32,
pub execution_errors: std::option::Option<crate::model::ValidationReport>,
pub total_rows_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionReport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_frames_reported<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.frames_reported = v.into();
self
}
pub fn set_execution_errors<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ValidationReport>,
{
self.execution_errors = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_execution_errors<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ValidationReport>,
{
self.execution_errors = v.map(|x| x.into());
self
}
pub fn set_total_rows_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_rows_count = v.into();
self
}
}
impl wkt::message::Message for ExecutionReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ExecutionReport"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportError {
pub error_details: std::string::String,
pub severity: crate::model::import_error::Severity,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportError {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.error_details = v.into();
self
}
pub fn set_severity<T: std::convert::Into<crate::model::import_error::Severity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
}
impl wkt::message::Message for ImportError {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ImportError"
}
}
pub mod import_error {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Severity {
Unspecified,
Error,
Warning,
Info,
UnknownValue(severity::UnknownValue),
}
#[doc(hidden)]
pub mod severity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Severity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Error => std::option::Option::Some(1),
Self::Warning => std::option::Option::Some(2),
Self::Info => 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("SEVERITY_UNSPECIFIED"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Warning => std::option::Option::Some("WARNING"),
Self::Info => std::option::Option::Some("INFO"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Severity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Severity {
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 Severity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Error,
2 => Self::Warning,
3 => Self::Info,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Severity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SEVERITY_UNSPECIFIED" => Self::Unspecified,
"ERROR" => Self::Error,
"WARNING" => Self::Warning,
"INFO" => Self::Info,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Severity {
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::Error => serializer.serialize_i32(1),
Self::Warning => serializer.serialize_i32(2),
Self::Info => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Severity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
".google.cloud.migrationcenter.v1.ImportError.Severity",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImportRowError {
#[deprecated]
pub row_number: i32,
pub vm_name: std::string::String,
pub vm_uuid: std::string::String,
pub errors: std::vec::Vec<crate::model::ImportError>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImportRowError {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_row_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.row_number = v.into();
self
}
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_vm_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vm_uuid = 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<crate::model::ImportError>,
{
use std::iter::Iterator;
self.errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ImportRowError {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ImportRowError"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UploadFileInfo {
pub signed_uri: std::string::String,
pub headers: std::collections::HashMap<std::string::String, std::string::String>,
pub uri_expiration_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UploadFileInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.signed_uri = v.into();
self
}
pub fn set_headers<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.headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_uri_expiration_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.uri_expiration_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_uri_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.uri_expiration_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UploadFileInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.UploadFileInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AssetList {
pub asset_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AssetList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_asset_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.asset_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AssetList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.AssetList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FrameViolationEntry {
pub field: std::string::String,
pub violation: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FrameViolationEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
pub fn set_violation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.violation = v.into();
self
}
}
impl wkt::message::Message for FrameViolationEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.FrameViolationEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VirtualMachinePreferences {
pub target_product: crate::model::ComputeMigrationTargetProduct,
pub region_preferences: std::option::Option<crate::model::RegionPreferences>,
pub commitment_plan: crate::model::CommitmentPlan,
pub sizing_optimization_strategy: crate::model::SizingOptimizationStrategy,
pub compute_engine_preferences: std::option::Option<crate::model::ComputeEnginePreferences>,
pub vmware_engine_preferences: std::option::Option<crate::model::VmwareEnginePreferences>,
pub sole_tenancy_preferences: std::option::Option<crate::model::SoleTenancyPreferences>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VirtualMachinePreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_product<
T: std::convert::Into<crate::model::ComputeMigrationTargetProduct>,
>(
mut self,
v: T,
) -> Self {
self.target_product = v.into();
self
}
pub fn set_region_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RegionPreferences>,
{
self.region_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_region_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RegionPreferences>,
{
self.region_preferences = v.map(|x| x.into());
self
}
pub fn set_commitment_plan<T: std::convert::Into<crate::model::CommitmentPlan>>(
mut self,
v: T,
) -> Self {
self.commitment_plan = v.into();
self
}
pub fn set_sizing_optimization_strategy<
T: std::convert::Into<crate::model::SizingOptimizationStrategy>,
>(
mut self,
v: T,
) -> Self {
self.sizing_optimization_strategy = v.into();
self
}
pub fn set_compute_engine_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ComputeEnginePreferences>,
{
self.compute_engine_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_compute_engine_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ComputeEnginePreferences>,
{
self.compute_engine_preferences = v.map(|x| x.into());
self
}
pub fn set_vmware_engine_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VmwareEnginePreferences>,
{
self.vmware_engine_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vmware_engine_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VmwareEnginePreferences>,
{
self.vmware_engine_preferences = v.map(|x| x.into());
self
}
pub fn set_sole_tenancy_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SoleTenancyPreferences>,
{
self.sole_tenancy_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sole_tenancy_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SoleTenancyPreferences>,
{
self.sole_tenancy_preferences = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for VirtualMachinePreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.VirtualMachinePreferences"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEnginePreferences {
pub machine_preferences: std::option::Option<crate::model::MachinePreferences>,
pub license_type: crate::model::LicenseType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEnginePreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MachinePreferences>,
{
self.machine_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_machine_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MachinePreferences>,
{
self.machine_preferences = v.map(|x| x.into());
self
}
pub fn set_license_type<T: std::convert::Into<crate::model::LicenseType>>(
mut self,
v: T,
) -> Self {
self.license_type = v.into();
self
}
}
impl wkt::message::Message for ComputeEnginePreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ComputeEnginePreferences"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachinePreferences {
pub allowed_machine_series: std::vec::Vec<crate::model::MachineSeries>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachinePreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allowed_machine_series<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MachineSeries>,
{
use std::iter::Iterator;
self.allowed_machine_series = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MachinePreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.MachinePreferences"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineSeries {
pub code: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineSeries {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.code = v.into();
self
}
}
impl wkt::message::Message for MachineSeries {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.MachineSeries"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareEnginePreferences {
pub cpu_overcommit_ratio: f64,
pub memory_overcommit_ratio: f64,
pub storage_deduplication_compression_ratio: f64,
pub commitment_plan: crate::model::vmware_engine_preferences::CommitmentPlan,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareEnginePreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cpu_overcommit_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.cpu_overcommit_ratio = v.into();
self
}
pub fn set_memory_overcommit_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.memory_overcommit_ratio = v.into();
self
}
pub fn set_storage_deduplication_compression_ratio<T: std::convert::Into<f64>>(
mut self,
v: T,
) -> Self {
self.storage_deduplication_compression_ratio = v.into();
self
}
pub fn set_commitment_plan<
T: std::convert::Into<crate::model::vmware_engine_preferences::CommitmentPlan>,
>(
mut self,
v: T,
) -> Self {
self.commitment_plan = v.into();
self
}
}
impl wkt::message::Message for VmwareEnginePreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.VmwareEnginePreferences"
}
}
pub mod vmware_engine_preferences {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CommitmentPlan {
Unspecified,
OnDemand,
Commitment1YearMonthlyPayments,
Commitment3YearMonthlyPayments,
Commitment1YearUpfrontPayment,
Commitment3YearUpfrontPayment,
UnknownValue(commitment_plan::UnknownValue),
}
#[doc(hidden)]
pub mod commitment_plan {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CommitmentPlan {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::OnDemand => std::option::Option::Some(1),
Self::Commitment1YearMonthlyPayments => std::option::Option::Some(2),
Self::Commitment3YearMonthlyPayments => std::option::Option::Some(3),
Self::Commitment1YearUpfrontPayment => std::option::Option::Some(4),
Self::Commitment3YearUpfrontPayment => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("COMMITMENT_PLAN_UNSPECIFIED"),
Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
Self::Commitment1YearMonthlyPayments => {
std::option::Option::Some("COMMITMENT_1_YEAR_MONTHLY_PAYMENTS")
}
Self::Commitment3YearMonthlyPayments => {
std::option::Option::Some("COMMITMENT_3_YEAR_MONTHLY_PAYMENTS")
}
Self::Commitment1YearUpfrontPayment => {
std::option::Option::Some("COMMITMENT_1_YEAR_UPFRONT_PAYMENT")
}
Self::Commitment3YearUpfrontPayment => {
std::option::Option::Some("COMMITMENT_3_YEAR_UPFRONT_PAYMENT")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CommitmentPlan {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CommitmentPlan {
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 CommitmentPlan {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::OnDemand,
2 => Self::Commitment1YearMonthlyPayments,
3 => Self::Commitment3YearMonthlyPayments,
4 => Self::Commitment1YearUpfrontPayment,
5 => Self::Commitment3YearUpfrontPayment,
_ => Self::UnknownValue(commitment_plan::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CommitmentPlan {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMMITMENT_PLAN_UNSPECIFIED" => Self::Unspecified,
"ON_DEMAND" => Self::OnDemand,
"COMMITMENT_1_YEAR_MONTHLY_PAYMENTS" => Self::Commitment1YearMonthlyPayments,
"COMMITMENT_3_YEAR_MONTHLY_PAYMENTS" => Self::Commitment3YearMonthlyPayments,
"COMMITMENT_1_YEAR_UPFRONT_PAYMENT" => Self::Commitment1YearUpfrontPayment,
"COMMITMENT_3_YEAR_UPFRONT_PAYMENT" => Self::Commitment3YearUpfrontPayment,
_ => Self::UnknownValue(commitment_plan::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CommitmentPlan {
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::OnDemand => serializer.serialize_i32(1),
Self::Commitment1YearMonthlyPayments => serializer.serialize_i32(2),
Self::Commitment3YearMonthlyPayments => serializer.serialize_i32(3),
Self::Commitment1YearUpfrontPayment => serializer.serialize_i32(4),
Self::Commitment3YearUpfrontPayment => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CommitmentPlan {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommitmentPlan>::new(
".google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SoleTenancyPreferences {
pub cpu_overcommit_ratio: f64,
pub host_maintenance_policy: crate::model::sole_tenancy_preferences::HostMaintenancePolicy,
pub commitment_plan: crate::model::sole_tenancy_preferences::CommitmentPlan,
pub node_types: std::vec::Vec<crate::model::SoleTenantNodeType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SoleTenancyPreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cpu_overcommit_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.cpu_overcommit_ratio = v.into();
self
}
pub fn set_host_maintenance_policy<
T: std::convert::Into<crate::model::sole_tenancy_preferences::HostMaintenancePolicy>,
>(
mut self,
v: T,
) -> Self {
self.host_maintenance_policy = v.into();
self
}
pub fn set_commitment_plan<
T: std::convert::Into<crate::model::sole_tenancy_preferences::CommitmentPlan>,
>(
mut self,
v: T,
) -> Self {
self.commitment_plan = v.into();
self
}
pub fn set_node_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SoleTenantNodeType>,
{
use std::iter::Iterator;
self.node_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SoleTenancyPreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.SoleTenancyPreferences"
}
}
pub mod sole_tenancy_preferences {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HostMaintenancePolicy {
Unspecified,
Default,
RestartInPlace,
MigrateWithinNodeGroup,
UnknownValue(host_maintenance_policy::UnknownValue),
}
#[doc(hidden)]
pub mod host_maintenance_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl HostMaintenancePolicy {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Default => std::option::Option::Some(1),
Self::RestartInPlace => std::option::Option::Some(2),
Self::MigrateWithinNodeGroup => 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("HOST_MAINTENANCE_POLICY_UNSPECIFIED")
}
Self::Default => std::option::Option::Some("HOST_MAINTENANCE_POLICY_DEFAULT"),
Self::RestartInPlace => {
std::option::Option::Some("HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE")
}
Self::MigrateWithinNodeGroup => {
std::option::Option::Some("HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for HostMaintenancePolicy {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for HostMaintenancePolicy {
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 HostMaintenancePolicy {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Default,
2 => Self::RestartInPlace,
3 => Self::MigrateWithinNodeGroup,
_ => Self::UnknownValue(host_maintenance_policy::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for HostMaintenancePolicy {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HOST_MAINTENANCE_POLICY_UNSPECIFIED" => Self::Unspecified,
"HOST_MAINTENANCE_POLICY_DEFAULT" => Self::Default,
"HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE" => Self::RestartInPlace,
"HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP" => Self::MigrateWithinNodeGroup,
_ => Self::UnknownValue(host_maintenance_policy::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for HostMaintenancePolicy {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Default => serializer.serialize_i32(1),
Self::RestartInPlace => serializer.serialize_i32(2),
Self::MigrateWithinNodeGroup => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for HostMaintenancePolicy {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<HostMaintenancePolicy>::new(
".google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CommitmentPlan {
Unspecified,
OnDemand,
Commitment1Year,
Commitment3Year,
UnknownValue(commitment_plan::UnknownValue),
}
#[doc(hidden)]
pub mod commitment_plan {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CommitmentPlan {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::OnDemand => std::option::Option::Some(1),
Self::Commitment1Year => std::option::Option::Some(2),
Self::Commitment3Year => 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("COMMITMENT_PLAN_UNSPECIFIED"),
Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
Self::Commitment1Year => std::option::Option::Some("COMMITMENT_1_YEAR"),
Self::Commitment3Year => std::option::Option::Some("COMMITMENT_3_YEAR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CommitmentPlan {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CommitmentPlan {
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 CommitmentPlan {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::OnDemand,
2 => Self::Commitment1Year,
3 => Self::Commitment3Year,
_ => Self::UnknownValue(commitment_plan::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CommitmentPlan {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMMITMENT_PLAN_UNSPECIFIED" => Self::Unspecified,
"ON_DEMAND" => Self::OnDemand,
"COMMITMENT_1_YEAR" => Self::Commitment1Year,
"COMMITMENT_3_YEAR" => Self::Commitment3Year,
_ => Self::UnknownValue(commitment_plan::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CommitmentPlan {
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::OnDemand => serializer.serialize_i32(1),
Self::Commitment1Year => serializer.serialize_i32(2),
Self::Commitment3Year => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CommitmentPlan {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommitmentPlan>::new(
".google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SoleTenantNodeType {
pub node_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SoleTenantNodeType {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_node_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.node_name = v.into();
self
}
}
impl wkt::message::Message for SoleTenantNodeType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.SoleTenantNodeType"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RegionPreferences {
pub preferred_regions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RegionPreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_preferred_regions<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.preferred_regions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RegionPreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.RegionPreferences"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Settings {
pub name: std::string::String,
pub preference_set: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Settings {
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_preference_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.preference_set = v.into();
self
}
}
impl wkt::message::Message for Settings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.Settings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReportSummary {
pub all_assets_stats: std::option::Option<crate::model::report_summary::AssetAggregateStats>,
pub group_findings: std::vec::Vec<crate::model::report_summary::GroupFinding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReportSummary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_all_assets_stats<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::AssetAggregateStats>,
{
self.all_assets_stats = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_all_assets_stats<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::AssetAggregateStats>,
{
self.all_assets_stats = v.map(|x| x.into());
self
}
pub fn set_group_findings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::report_summary::GroupFinding>,
{
use std::iter::Iterator;
self.group_findings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ReportSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary"
}
}
pub mod report_summary {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChartData {
pub data_points: std::vec::Vec<crate::model::report_summary::chart_data::DataPoint>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChartData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_points<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::report_summary::chart_data::DataPoint>,
{
use std::iter::Iterator;
self.data_points = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ChartData {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.ChartData"
}
}
pub mod chart_data {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataPoint {
pub label: std::string::String,
pub value: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataPoint {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.label = v.into();
self
}
pub fn set_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for DataPoint {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UtilizationChartData {
pub used: i64,
pub free: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UtilizationChartData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_used<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.used = v.into();
self
}
pub fn set_free<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.free = v.into();
self
}
}
impl wkt::message::Message for UtilizationChartData {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HistogramChartData {
pub buckets: std::vec::Vec<crate::model::report_summary::histogram_chart_data::Bucket>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HistogramChartData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_buckets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::report_summary::histogram_chart_data::Bucket>,
{
use std::iter::Iterator;
self.buckets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for HistogramChartData {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData"
}
}
pub mod histogram_chart_data {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Bucket {
pub lower_bound: i64,
pub upper_bound: i64,
pub count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Bucket {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lower_bound<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.lower_bound = v.into();
self
}
pub fn set_upper_bound<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.upper_bound = v.into();
self
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
}
impl wkt::message::Message for Bucket {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AssetAggregateStats {
pub total_memory_bytes: i64,
pub total_storage_bytes: i64,
pub total_cores: i64,
pub total_assets: i64,
pub memory_utilization_chart:
std::option::Option<crate::model::report_summary::UtilizationChartData>,
pub storage_utilization_chart:
std::option::Option<crate::model::report_summary::UtilizationChartData>,
pub operating_system: std::option::Option<crate::model::report_summary::ChartData>,
pub core_count_histogram:
std::option::Option<crate::model::report_summary::HistogramChartData>,
pub memory_bytes_histogram:
std::option::Option<crate::model::report_summary::HistogramChartData>,
pub storage_bytes_histogram:
std::option::Option<crate::model::report_summary::HistogramChartData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AssetAggregateStats {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_total_memory_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_memory_bytes = v.into();
self
}
pub fn set_total_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_storage_bytes = v.into();
self
}
pub fn set_total_cores<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_cores = v.into();
self
}
pub fn set_total_assets<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_assets = v.into();
self
}
pub fn set_memory_utilization_chart<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::UtilizationChartData>,
{
self.memory_utilization_chart = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_memory_utilization_chart<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::UtilizationChartData>,
{
self.memory_utilization_chart = v.map(|x| x.into());
self
}
pub fn set_storage_utilization_chart<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::UtilizationChartData>,
{
self.storage_utilization_chart = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_storage_utilization_chart<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::report_summary::UtilizationChartData>,
{
self.storage_utilization_chart = v.map(|x| x.into());
self
}
pub fn set_operating_system<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::ChartData>,
{
self.operating_system = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_operating_system<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::ChartData>,
{
self.operating_system = v.map(|x| x.into());
self
}
pub fn set_core_count_histogram<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::HistogramChartData>,
{
self.core_count_histogram = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_core_count_histogram<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::HistogramChartData>,
{
self.core_count_histogram = v.map(|x| x.into());
self
}
pub fn set_memory_bytes_histogram<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::HistogramChartData>,
{
self.memory_bytes_histogram = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_memory_bytes_histogram<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::HistogramChartData>,
{
self.memory_bytes_histogram = v.map(|x| x.into());
self
}
pub fn set_storage_bytes_histogram<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::HistogramChartData>,
{
self.storage_bytes_histogram = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_storage_bytes_histogram<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::HistogramChartData>,
{
self.storage_bytes_histogram = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AssetAggregateStats {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MachineSeriesAllocation {
pub machine_series: std::option::Option<crate::model::MachineSeries>,
pub allocated_asset_count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MachineSeriesAllocation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_series<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MachineSeries>,
{
self.machine_series = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_machine_series<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MachineSeries>,
{
self.machine_series = v.map(|x| x.into());
self
}
pub fn set_allocated_asset_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.allocated_asset_count = v.into();
self
}
}
impl wkt::message::Message for MachineSeriesAllocation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeEngineFinding {
pub allocated_regions: std::vec::Vec<std::string::String>,
pub allocated_asset_count: i64,
pub machine_series_allocations:
std::vec::Vec<crate::model::report_summary::MachineSeriesAllocation>,
pub allocated_disk_types: std::vec::Vec<crate::model::PersistentDiskType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeEngineFinding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allocated_regions<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.allocated_regions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allocated_asset_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.allocated_asset_count = v.into();
self
}
pub fn set_machine_series_allocations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::report_summary::MachineSeriesAllocation>,
{
use std::iter::Iterator;
self.machine_series_allocations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allocated_disk_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PersistentDiskType>,
{
use std::iter::Iterator;
self.allocated_disk_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ComputeEngineFinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareEngineFinding {
pub allocated_regions: std::vec::Vec<std::string::String>,
pub allocated_asset_count: i64,
pub node_allocations: std::vec::Vec<crate::model::report_summary::VmwareNodeAllocation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareEngineFinding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allocated_regions<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.allocated_regions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allocated_asset_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.allocated_asset_count = v.into();
self
}
pub fn set_node_allocations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::report_summary::VmwareNodeAllocation>,
{
use std::iter::Iterator;
self.node_allocations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VmwareEngineFinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareNodeAllocation {
pub vmware_node: std::option::Option<crate::model::report_summary::VmwareNode>,
pub node_count: i64,
pub allocated_asset_count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareNodeAllocation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vmware_node<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::VmwareNode>,
{
self.vmware_node = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vmware_node<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::VmwareNode>,
{
self.vmware_node = v.map(|x| x.into());
self
}
pub fn set_node_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.node_count = v.into();
self
}
pub fn set_allocated_asset_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.allocated_asset_count = v.into();
self
}
}
impl wkt::message::Message for VmwareNodeAllocation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VmwareNode {
pub code: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VmwareNode {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.code = v.into();
self
}
}
impl wkt::message::Message for VmwareNode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.VmwareNode"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SoleTenantFinding {
pub allocated_regions: std::vec::Vec<std::string::String>,
pub allocated_asset_count: i64,
pub node_allocations: std::vec::Vec<crate::model::report_summary::SoleTenantNodeAllocation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SoleTenantFinding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allocated_regions<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.allocated_regions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allocated_asset_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.allocated_asset_count = v.into();
self
}
pub fn set_node_allocations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::report_summary::SoleTenantNodeAllocation>,
{
use std::iter::Iterator;
self.node_allocations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SoleTenantFinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SoleTenantNodeAllocation {
pub node: std::option::Option<crate::model::SoleTenantNodeType>,
pub node_count: i64,
pub allocated_asset_count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SoleTenantNodeAllocation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_node<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SoleTenantNodeType>,
{
self.node = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SoleTenantNodeType>,
{
self.node = v.map(|x| x.into());
self
}
pub fn set_node_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.node_count = v.into();
self
}
pub fn set_allocated_asset_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.allocated_asset_count = v.into();
self
}
}
impl wkt::message::Message for SoleTenantNodeAllocation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GroupPreferenceSetFinding {
pub display_name: std::string::String,
pub description: std::string::String,
pub machine_preferences: std::option::Option<crate::model::VirtualMachinePreferences>,
pub monthly_cost_total: std::option::Option<google_cloud_type::model::Money>,
pub monthly_cost_compute: std::option::Option<google_cloud_type::model::Money>,
pub monthly_cost_os_license: std::option::Option<google_cloud_type::model::Money>,
pub monthly_cost_network_egress: std::option::Option<google_cloud_type::model::Money>,
pub monthly_cost_storage: std::option::Option<google_cloud_type::model::Money>,
pub monthly_cost_other: std::option::Option<google_cloud_type::model::Money>,
pub compute_engine_finding:
std::option::Option<crate::model::report_summary::ComputeEngineFinding>,
pub vmware_engine_finding:
std::option::Option<crate::model::report_summary::VmwareEngineFinding>,
pub sole_tenant_finding:
std::option::Option<crate::model::report_summary::SoleTenantFinding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GroupPreferenceSetFinding {
pub fn new() -> Self {
std::default::Default::default()
}
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_machine_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VirtualMachinePreferences>,
{
self.machine_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_machine_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VirtualMachinePreferences>,
{
self.machine_preferences = v.map(|x| x.into());
self
}
pub fn set_monthly_cost_total<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_total = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monthly_cost_total<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_total = v.map(|x| x.into());
self
}
pub fn set_monthly_cost_compute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_compute = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monthly_cost_compute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_compute = v.map(|x| x.into());
self
}
pub fn set_monthly_cost_os_license<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_os_license = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monthly_cost_os_license<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_os_license = v.map(|x| x.into());
self
}
pub fn set_monthly_cost_network_egress<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_network_egress = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monthly_cost_network_egress<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_network_egress = v.map(|x| x.into());
self
}
pub fn set_monthly_cost_storage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_storage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monthly_cost_storage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_storage = v.map(|x| x.into());
self
}
pub fn set_monthly_cost_other<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_other = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_monthly_cost_other<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.monthly_cost_other = v.map(|x| x.into());
self
}
pub fn set_compute_engine_finding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::ComputeEngineFinding>,
{
self.compute_engine_finding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_compute_engine_finding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::ComputeEngineFinding>,
{
self.compute_engine_finding = v.map(|x| x.into());
self
}
pub fn set_vmware_engine_finding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::VmwareEngineFinding>,
{
self.vmware_engine_finding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vmware_engine_finding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::VmwareEngineFinding>,
{
self.vmware_engine_finding = v.map(|x| x.into());
self
}
pub fn set_sole_tenant_finding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::SoleTenantFinding>,
{
self.sole_tenant_finding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sole_tenant_finding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::SoleTenantFinding>,
{
self.sole_tenant_finding = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GroupPreferenceSetFinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.GroupPreferenceSetFinding"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GroupFinding {
pub display_name: std::string::String,
pub description: std::string::String,
pub asset_aggregate_stats:
std::option::Option<crate::model::report_summary::AssetAggregateStats>,
#[deprecated]
pub overlapping_asset_count: i64,
pub preference_set_findings:
std::vec::Vec<crate::model::report_summary::GroupPreferenceSetFinding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GroupFinding {
pub fn new() -> Self {
std::default::Default::default()
}
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_asset_aggregate_stats<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::report_summary::AssetAggregateStats>,
{
self.asset_aggregate_stats = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_asset_aggregate_stats<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::report_summary::AssetAggregateStats>,
{
self.asset_aggregate_stats = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_overlapping_asset_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.overlapping_asset_count = v.into();
self
}
pub fn set_preference_set_findings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::report_summary::GroupPreferenceSetFinding>,
{
use std::iter::Iterator;
self.preference_set_findings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GroupFinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.migrationcenter.v1.ReportSummary.GroupFinding"
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AssetView {
Unspecified,
Basic,
Full,
UnknownValue(asset_view::UnknownValue),
}
#[doc(hidden)]
pub mod asset_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AssetView {
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("ASSET_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("ASSET_VIEW_BASIC"),
Self::Full => std::option::Option::Some("ASSET_VIEW_FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AssetView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AssetView {
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 AssetView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
_ => Self::UnknownValue(asset_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AssetView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ASSET_VIEW_UNSPECIFIED" => Self::Unspecified,
"ASSET_VIEW_BASIC" => Self::Basic,
"ASSET_VIEW_FULL" => Self::Full,
_ => Self::UnknownValue(asset_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AssetView {
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 AssetView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AssetView>::new(
".google.cloud.migrationcenter.v1.AssetView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OperatingSystemFamily {
OsFamilyUnknown,
OsFamilyWindows,
OsFamilyLinux,
OsFamilyUnix,
UnknownValue(operating_system_family::UnknownValue),
}
#[doc(hidden)]
pub mod operating_system_family {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OperatingSystemFamily {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::OsFamilyUnknown => std::option::Option::Some(0),
Self::OsFamilyWindows => std::option::Option::Some(1),
Self::OsFamilyLinux => std::option::Option::Some(2),
Self::OsFamilyUnix => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::OsFamilyUnknown => std::option::Option::Some("OS_FAMILY_UNKNOWN"),
Self::OsFamilyWindows => std::option::Option::Some("OS_FAMILY_WINDOWS"),
Self::OsFamilyLinux => std::option::Option::Some("OS_FAMILY_LINUX"),
Self::OsFamilyUnix => std::option::Option::Some("OS_FAMILY_UNIX"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OperatingSystemFamily {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OperatingSystemFamily {
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 OperatingSystemFamily {
fn from(value: i32) -> Self {
match value {
0 => Self::OsFamilyUnknown,
1 => Self::OsFamilyWindows,
2 => Self::OsFamilyLinux,
3 => Self::OsFamilyUnix,
_ => Self::UnknownValue(operating_system_family::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OperatingSystemFamily {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OS_FAMILY_UNKNOWN" => Self::OsFamilyUnknown,
"OS_FAMILY_WINDOWS" => Self::OsFamilyWindows,
"OS_FAMILY_LINUX" => Self::OsFamilyLinux,
"OS_FAMILY_UNIX" => Self::OsFamilyUnix,
_ => Self::UnknownValue(operating_system_family::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OperatingSystemFamily {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::OsFamilyUnknown => serializer.serialize_i32(0),
Self::OsFamilyWindows => serializer.serialize_i32(1),
Self::OsFamilyLinux => serializer.serialize_i32(2),
Self::OsFamilyUnix => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OperatingSystemFamily {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperatingSystemFamily>::new(
".google.cloud.migrationcenter.v1.OperatingSystemFamily",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ImportJobFormat {
Unspecified,
RvtoolsXlsx,
RvtoolsCsv,
ExportedAwsCsv,
ExportedAzureCsv,
StratozoneCsv,
UnknownValue(import_job_format::UnknownValue),
}
#[doc(hidden)]
pub mod import_job_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ImportJobFormat {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RvtoolsXlsx => std::option::Option::Some(1),
Self::RvtoolsCsv => std::option::Option::Some(2),
Self::ExportedAwsCsv => std::option::Option::Some(4),
Self::ExportedAzureCsv => std::option::Option::Some(5),
Self::StratozoneCsv => 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("IMPORT_JOB_FORMAT_UNSPECIFIED"),
Self::RvtoolsXlsx => std::option::Option::Some("IMPORT_JOB_FORMAT_RVTOOLS_XLSX"),
Self::RvtoolsCsv => std::option::Option::Some("IMPORT_JOB_FORMAT_RVTOOLS_CSV"),
Self::ExportedAwsCsv => std::option::Option::Some("IMPORT_JOB_FORMAT_EXPORTED_AWS_CSV"),
Self::ExportedAzureCsv => {
std::option::Option::Some("IMPORT_JOB_FORMAT_EXPORTED_AZURE_CSV")
}
Self::StratozoneCsv => std::option::Option::Some("IMPORT_JOB_FORMAT_STRATOZONE_CSV"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ImportJobFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ImportJobFormat {
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 ImportJobFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RvtoolsXlsx,
2 => Self::RvtoolsCsv,
4 => Self::ExportedAwsCsv,
5 => Self::ExportedAzureCsv,
6 => Self::StratozoneCsv,
_ => Self::UnknownValue(import_job_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ImportJobFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IMPORT_JOB_FORMAT_UNSPECIFIED" => Self::Unspecified,
"IMPORT_JOB_FORMAT_RVTOOLS_XLSX" => Self::RvtoolsXlsx,
"IMPORT_JOB_FORMAT_RVTOOLS_CSV" => Self::RvtoolsCsv,
"IMPORT_JOB_FORMAT_EXPORTED_AWS_CSV" => Self::ExportedAwsCsv,
"IMPORT_JOB_FORMAT_EXPORTED_AZURE_CSV" => Self::ExportedAzureCsv,
"IMPORT_JOB_FORMAT_STRATOZONE_CSV" => Self::StratozoneCsv,
_ => Self::UnknownValue(import_job_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ImportJobFormat {
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::RvtoolsXlsx => serializer.serialize_i32(1),
Self::RvtoolsCsv => serializer.serialize_i32(2),
Self::ExportedAwsCsv => serializer.serialize_i32(4),
Self::ExportedAzureCsv => serializer.serialize_i32(5),
Self::StratozoneCsv => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ImportJobFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportJobFormat>::new(
".google.cloud.migrationcenter.v1.ImportJobFormat",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ImportJobView {
Unspecified,
Basic,
Full,
UnknownValue(import_job_view::UnknownValue),
}
#[doc(hidden)]
pub mod import_job_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ImportJobView {
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("IMPORT_JOB_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("IMPORT_JOB_VIEW_BASIC"),
Self::Full => std::option::Option::Some("IMPORT_JOB_VIEW_FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ImportJobView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ImportJobView {
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 ImportJobView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
_ => Self::UnknownValue(import_job_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ImportJobView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IMPORT_JOB_VIEW_UNSPECIFIED" => Self::Unspecified,
"IMPORT_JOB_VIEW_BASIC" => Self::Basic,
"IMPORT_JOB_VIEW_FULL" => Self::Full,
_ => Self::UnknownValue(import_job_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ImportJobView {
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 ImportJobView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportJobView>::new(
".google.cloud.migrationcenter.v1.ImportJobView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ErrorFrameView {
Unspecified,
Basic,
Full,
UnknownValue(error_frame_view::UnknownValue),
}
#[doc(hidden)]
pub mod error_frame_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ErrorFrameView {
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("ERROR_FRAME_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("ERROR_FRAME_VIEW_BASIC"),
Self::Full => std::option::Option::Some("ERROR_FRAME_VIEW_FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ErrorFrameView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ErrorFrameView {
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 ErrorFrameView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
_ => Self::UnknownValue(error_frame_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ErrorFrameView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ERROR_FRAME_VIEW_UNSPECIFIED" => Self::Unspecified,
"ERROR_FRAME_VIEW_BASIC" => Self::Basic,
"ERROR_FRAME_VIEW_FULL" => Self::Full,
_ => Self::UnknownValue(error_frame_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ErrorFrameView {
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 ErrorFrameView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorFrameView>::new(
".google.cloud.migrationcenter.v1.ErrorFrameView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PersistentDiskType {
Unspecified,
Standard,
Balanced,
Ssd,
UnknownValue(persistent_disk_type::UnknownValue),
}
#[doc(hidden)]
pub mod persistent_disk_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PersistentDiskType {
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::Balanced => std::option::Option::Some(2),
Self::Ssd => 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("PERSISTENT_DISK_TYPE_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("PERSISTENT_DISK_TYPE_STANDARD"),
Self::Balanced => std::option::Option::Some("PERSISTENT_DISK_TYPE_BALANCED"),
Self::Ssd => std::option::Option::Some("PERSISTENT_DISK_TYPE_SSD"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PersistentDiskType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PersistentDiskType {
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 PersistentDiskType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::Balanced,
3 => Self::Ssd,
_ => Self::UnknownValue(persistent_disk_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PersistentDiskType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PERSISTENT_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
"PERSISTENT_DISK_TYPE_STANDARD" => Self::Standard,
"PERSISTENT_DISK_TYPE_BALANCED" => Self::Balanced,
"PERSISTENT_DISK_TYPE_SSD" => Self::Ssd,
_ => Self::UnknownValue(persistent_disk_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PersistentDiskType {
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::Balanced => serializer.serialize_i32(2),
Self::Ssd => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PersistentDiskType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PersistentDiskType>::new(
".google.cloud.migrationcenter.v1.PersistentDiskType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LicenseType {
Unspecified,
Default,
BringYourOwnLicense,
UnknownValue(license_type::UnknownValue),
}
#[doc(hidden)]
pub mod license_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LicenseType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Default => std::option::Option::Some(1),
Self::BringYourOwnLicense => 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("LICENSE_TYPE_UNSPECIFIED"),
Self::Default => std::option::Option::Some("LICENSE_TYPE_DEFAULT"),
Self::BringYourOwnLicense => {
std::option::Option::Some("LICENSE_TYPE_BRING_YOUR_OWN_LICENSE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LicenseType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LicenseType {
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 LicenseType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Default,
2 => Self::BringYourOwnLicense,
_ => Self::UnknownValue(license_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LicenseType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LICENSE_TYPE_UNSPECIFIED" => Self::Unspecified,
"LICENSE_TYPE_DEFAULT" => Self::Default,
"LICENSE_TYPE_BRING_YOUR_OWN_LICENSE" => Self::BringYourOwnLicense,
_ => Self::UnknownValue(license_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LicenseType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Default => serializer.serialize_i32(1),
Self::BringYourOwnLicense => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LicenseType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LicenseType>::new(
".google.cloud.migrationcenter.v1.LicenseType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SizingOptimizationStrategy {
Unspecified,
SameAsSource,
Moderate,
Aggressive,
UnknownValue(sizing_optimization_strategy::UnknownValue),
}
#[doc(hidden)]
pub mod sizing_optimization_strategy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SizingOptimizationStrategy {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SameAsSource => std::option::Option::Some(1),
Self::Moderate => std::option::Option::Some(2),
Self::Aggressive => 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("SIZING_OPTIMIZATION_STRATEGY_UNSPECIFIED")
}
Self::SameAsSource => {
std::option::Option::Some("SIZING_OPTIMIZATION_STRATEGY_SAME_AS_SOURCE")
}
Self::Moderate => std::option::Option::Some("SIZING_OPTIMIZATION_STRATEGY_MODERATE"),
Self::Aggressive => {
std::option::Option::Some("SIZING_OPTIMIZATION_STRATEGY_AGGRESSIVE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SizingOptimizationStrategy {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SizingOptimizationStrategy {
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 SizingOptimizationStrategy {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SameAsSource,
2 => Self::Moderate,
3 => Self::Aggressive,
_ => Self::UnknownValue(sizing_optimization_strategy::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SizingOptimizationStrategy {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SIZING_OPTIMIZATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
"SIZING_OPTIMIZATION_STRATEGY_SAME_AS_SOURCE" => Self::SameAsSource,
"SIZING_OPTIMIZATION_STRATEGY_MODERATE" => Self::Moderate,
"SIZING_OPTIMIZATION_STRATEGY_AGGRESSIVE" => Self::Aggressive,
_ => Self::UnknownValue(sizing_optimization_strategy::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SizingOptimizationStrategy {
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::SameAsSource => serializer.serialize_i32(1),
Self::Moderate => serializer.serialize_i32(2),
Self::Aggressive => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SizingOptimizationStrategy {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<SizingOptimizationStrategy>::new(
".google.cloud.migrationcenter.v1.SizingOptimizationStrategy",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CommitmentPlan {
Unspecified,
None,
OneYear,
ThreeYears,
UnknownValue(commitment_plan::UnknownValue),
}
#[doc(hidden)]
pub mod commitment_plan {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CommitmentPlan {
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::OneYear => std::option::Option::Some(2),
Self::ThreeYears => 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("COMMITMENT_PLAN_UNSPECIFIED"),
Self::None => std::option::Option::Some("COMMITMENT_PLAN_NONE"),
Self::OneYear => std::option::Option::Some("COMMITMENT_PLAN_ONE_YEAR"),
Self::ThreeYears => std::option::Option::Some("COMMITMENT_PLAN_THREE_YEARS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CommitmentPlan {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CommitmentPlan {
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 CommitmentPlan {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::None,
2 => Self::OneYear,
3 => Self::ThreeYears,
_ => Self::UnknownValue(commitment_plan::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CommitmentPlan {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMMITMENT_PLAN_UNSPECIFIED" => Self::Unspecified,
"COMMITMENT_PLAN_NONE" => Self::None,
"COMMITMENT_PLAN_ONE_YEAR" => Self::OneYear,
"COMMITMENT_PLAN_THREE_YEARS" => Self::ThreeYears,
_ => Self::UnknownValue(commitment_plan::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CommitmentPlan {
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::OneYear => serializer.serialize_i32(2),
Self::ThreeYears => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CommitmentPlan {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommitmentPlan>::new(
".google.cloud.migrationcenter.v1.CommitmentPlan",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ComputeMigrationTargetProduct {
Unspecified,
ComputeEngine,
VmwareEngine,
SoleTenancy,
UnknownValue(compute_migration_target_product::UnknownValue),
}
#[doc(hidden)]
pub mod compute_migration_target_product {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ComputeMigrationTargetProduct {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ComputeEngine => std::option::Option::Some(1),
Self::VmwareEngine => std::option::Option::Some(2),
Self::SoleTenancy => 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("COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED")
}
Self::ComputeEngine => {
std::option::Option::Some("COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE")
}
Self::VmwareEngine => {
std::option::Option::Some("COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE")
}
Self::SoleTenancy => {
std::option::Option::Some("COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ComputeMigrationTargetProduct {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ComputeMigrationTargetProduct {
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 ComputeMigrationTargetProduct {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ComputeEngine,
2 => Self::VmwareEngine,
3 => Self::SoleTenancy,
_ => Self::UnknownValue(compute_migration_target_product::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ComputeMigrationTargetProduct {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED" => Self::Unspecified,
"COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE" => Self::ComputeEngine,
"COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE" => Self::VmwareEngine,
"COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY" => Self::SoleTenancy,
_ => Self::UnknownValue(compute_migration_target_product::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ComputeMigrationTargetProduct {
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::ComputeEngine => serializer.serialize_i32(1),
Self::VmwareEngine => serializer.serialize_i32(2),
Self::SoleTenancy => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ComputeMigrationTargetProduct {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<ComputeMigrationTargetProduct>::new(
".google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ReportView {
Unspecified,
Basic,
Full,
Standard,
UnknownValue(report_view::UnknownValue),
}
#[doc(hidden)]
pub mod report_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ReportView {
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::Standard => 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("REPORT_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("REPORT_VIEW_BASIC"),
Self::Full => std::option::Option::Some("REPORT_VIEW_FULL"),
Self::Standard => std::option::Option::Some("REPORT_VIEW_STANDARD"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ReportView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ReportView {
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 ReportView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
3 => Self::Standard,
_ => Self::UnknownValue(report_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ReportView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REPORT_VIEW_UNSPECIFIED" => Self::Unspecified,
"REPORT_VIEW_BASIC" => Self::Basic,
"REPORT_VIEW_FULL" => Self::Full,
"REPORT_VIEW_STANDARD" => Self::Standard,
_ => Self::UnknownValue(report_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ReportView {
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::Standard => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ReportView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReportView>::new(
".google.cloud.migrationcenter.v1.ReportView",
))
}
}