#[non_exhaustive]pub struct Asset {
pub name: String,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub labels: HashMap<String, String>,
pub attributes: HashMap<String, String>,
pub insight_list: Option<InsightList>,
pub performance_data: Option<AssetPerformanceData>,
pub sources: Vec<String>,
pub assigned_groups: Vec<String>,
pub asset_details: Option<AssetDetails>,
/* private fields */
}Expand description
An asset represents a resource in your environment. Asset types include virtual machines and databases.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringOutput only. The full name of the asset.
create_time: Option<Timestamp>Output only. The timestamp when the asset was created.
update_time: Option<Timestamp>Output only. The timestamp when the asset was last updated.
labels: HashMap<String, String>Labels as key value pairs.
attributes: HashMap<String, String>Generic asset attributes.
insight_list: Option<InsightList>Output only. The list of insights associated with the asset.
performance_data: Option<AssetPerformanceData>Output only. Performance data for the asset.
sources: Vec<String>Output only. The list of sources contributing to the asset.
assigned_groups: Vec<String>Output only. The list of groups that the asset is assigned to.
asset_details: Option<AssetDetails>The internal information of an asset. Only one field can be specified with different attributes based on the type of the asset.
Implementations§
Source§impl Asset
impl Asset
pub fn new() -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = Asset::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = Asset::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Asset::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = Asset::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = Asset::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Asset::new().set_or_clear_update_time(None::<Timestamp>);Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_attributes<T, K, V>(self, v: T) -> Self
pub fn set_attributes<T, K, V>(self, v: T) -> Self
Sets the value of attributes.
§Example
let x = Asset::new().set_attributes([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_insight_list<T>(self, v: T) -> Selfwhere
T: Into<InsightList>,
pub fn set_insight_list<T>(self, v: T) -> Selfwhere
T: Into<InsightList>,
Sets the value of insight_list.
§Example
use google_cloud_migrationcenter_v1::model::InsightList;
let x = Asset::new().set_insight_list(InsightList::default()/* use setters */);Sourcepub fn set_or_clear_insight_list<T>(self, v: Option<T>) -> Selfwhere
T: Into<InsightList>,
pub fn set_or_clear_insight_list<T>(self, v: Option<T>) -> Selfwhere
T: Into<InsightList>,
Sets or clears the value of insight_list.
§Example
use google_cloud_migrationcenter_v1::model::InsightList;
let x = Asset::new().set_or_clear_insight_list(Some(InsightList::default()/* use setters */));
let x = Asset::new().set_or_clear_insight_list(None::<InsightList>);Sourcepub fn set_performance_data<T>(self, v: T) -> Selfwhere
T: Into<AssetPerformanceData>,
pub fn set_performance_data<T>(self, v: T) -> Selfwhere
T: Into<AssetPerformanceData>,
Sets the value of performance_data.
§Example
use google_cloud_migrationcenter_v1::model::AssetPerformanceData;
let x = Asset::new().set_performance_data(AssetPerformanceData::default()/* use setters */);Sourcepub fn set_or_clear_performance_data<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssetPerformanceData>,
pub fn set_or_clear_performance_data<T>(self, v: Option<T>) -> Selfwhere
T: Into<AssetPerformanceData>,
Sets or clears the value of performance_data.
§Example
use google_cloud_migrationcenter_v1::model::AssetPerformanceData;
let x = Asset::new().set_or_clear_performance_data(Some(AssetPerformanceData::default()/* use setters */));
let x = Asset::new().set_or_clear_performance_data(None::<AssetPerformanceData>);Sourcepub fn set_sources<T, V>(self, v: T) -> Self
pub fn set_sources<T, V>(self, v: T) -> Self
Sourcepub fn set_assigned_groups<T, V>(self, v: T) -> Self
pub fn set_assigned_groups<T, V>(self, v: T) -> Self
Sets the value of assigned_groups.
§Example
let x = Asset::new().set_assigned_groups(["a", "b", "c"]);Sourcepub fn set_asset_details<T: Into<Option<AssetDetails>>>(self, v: T) -> Self
pub fn set_asset_details<T: Into<Option<AssetDetails>>>(self, v: T) -> Self
Sets the value of asset_details.
Note that all the setters affecting asset_details are mutually
exclusive.
§Example
use google_cloud_migrationcenter_v1::model::MachineDetails;
let x = Asset::new().set_asset_details(Some(
google_cloud_migrationcenter_v1::model::asset::AssetDetails::MachineDetails(MachineDetails::default().into())));Sourcepub fn machine_details(&self) -> Option<&Box<MachineDetails>>
pub fn machine_details(&self) -> Option<&Box<MachineDetails>>
The value of asset_details
if it holds a MachineDetails, None if the field is not set or
holds a different branch.
Sourcepub fn set_machine_details<T: Into<Box<MachineDetails>>>(self, v: T) -> Self
pub fn set_machine_details<T: Into<Box<MachineDetails>>>(self, v: T) -> Self
Sets the value of asset_details
to hold a MachineDetails.
Note that all the setters affecting asset_details are
mutually exclusive.
§Example
use google_cloud_migrationcenter_v1::model::MachineDetails;
let x = Asset::new().set_machine_details(MachineDetails::default()/* use setters */);
assert!(x.machine_details().is_some());