#[non_exhaustive]pub struct Workload {
pub name: String,
pub display_name: String,
pub description: String,
pub workload_reference: Option<WorkloadReference>,
pub workload_properties: Option<WorkloadProperties>,
pub discovered_workload: String,
pub attributes: Option<Attributes>,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub uid: String,
pub state: State,
/* private fields */
}Expand description
Workload is an App Hub data model that contains a discovered workload, which represents a binary deployment (such as managed instance groups (MIGs) and GKE deployments) that performs the smallest logical subset of business functionality.
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: StringIdentifier. The resource name of the Workload. Format:
"projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}"
display_name: StringOptional. User-defined name for the Workload. Can have a maximum length of 63 characters.
description: StringOptional. User-defined description of a Workload. Can have a maximum length of 2048 characters.
workload_reference: Option<WorkloadReference>Output only. Reference of an underlying compute resource represented by the Workload. These are immutable.
workload_properties: Option<WorkloadProperties>Output only. Properties of an underlying compute resource represented by the Workload. These are immutable.
discovered_workload: StringRequired. Immutable. The resource name of the original discovered workload.
attributes: Option<Attributes>Optional. Consumer provided attributes.
create_time: Option<Timestamp>Output only. Create time.
update_time: Option<Timestamp>Output only. Update time.
uid: StringOutput only. A universally unique identifier (UUID) for the Workload in
the UUID4 format.
state: StateOutput only. Workload state.
Implementations§
Source§impl Workload
impl Workload
Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_workload_reference<T>(self, v: T) -> Selfwhere
T: Into<WorkloadReference>,
pub fn set_workload_reference<T>(self, v: T) -> Selfwhere
T: Into<WorkloadReference>,
Sets the value of workload_reference.
§Example
use google_cloud_apphub_v1::model::WorkloadReference;
let x = Workload::new().set_workload_reference(WorkloadReference::default()/* use setters */);Sourcepub fn set_or_clear_workload_reference<T>(self, v: Option<T>) -> Selfwhere
T: Into<WorkloadReference>,
pub fn set_or_clear_workload_reference<T>(self, v: Option<T>) -> Selfwhere
T: Into<WorkloadReference>,
Sets or clears the value of workload_reference.
§Example
use google_cloud_apphub_v1::model::WorkloadReference;
let x = Workload::new().set_or_clear_workload_reference(Some(WorkloadReference::default()/* use setters */));
let x = Workload::new().set_or_clear_workload_reference(None::<WorkloadReference>);Sourcepub fn set_workload_properties<T>(self, v: T) -> Selfwhere
T: Into<WorkloadProperties>,
pub fn set_workload_properties<T>(self, v: T) -> Selfwhere
T: Into<WorkloadProperties>,
Sets the value of workload_properties.
§Example
use google_cloud_apphub_v1::model::WorkloadProperties;
let x = Workload::new().set_workload_properties(WorkloadProperties::default()/* use setters */);Sourcepub fn set_or_clear_workload_properties<T>(self, v: Option<T>) -> Selfwhere
T: Into<WorkloadProperties>,
pub fn set_or_clear_workload_properties<T>(self, v: Option<T>) -> Selfwhere
T: Into<WorkloadProperties>,
Sets or clears the value of workload_properties.
§Example
use google_cloud_apphub_v1::model::WorkloadProperties;
let x = Workload::new().set_or_clear_workload_properties(Some(WorkloadProperties::default()/* use setters */));
let x = Workload::new().set_or_clear_workload_properties(None::<WorkloadProperties>);Sourcepub fn set_discovered_workload<T: Into<String>>(self, v: T) -> Self
pub fn set_discovered_workload<T: Into<String>>(self, v: T) -> Self
Sets the value of discovered_workload.
§Example
let x = Workload::new().set_discovered_workload(format!("projects/{project_id}/locations/{location_id}"));Sourcepub fn set_attributes<T>(self, v: T) -> Selfwhere
T: Into<Attributes>,
pub fn set_attributes<T>(self, v: T) -> Selfwhere
T: Into<Attributes>,
Sets the value of attributes.
§Example
use google_cloud_apphub_v1::model::Attributes;
let x = Workload::new().set_attributes(Attributes::default()/* use setters */);Sourcepub fn set_or_clear_attributes<T>(self, v: Option<T>) -> Selfwhere
T: Into<Attributes>,
pub fn set_or_clear_attributes<T>(self, v: Option<T>) -> Selfwhere
T: Into<Attributes>,
Sets or clears the value of attributes.
§Example
use google_cloud_apphub_v1::model::Attributes;
let x = Workload::new().set_or_clear_attributes(Some(Attributes::default()/* use setters */));
let x = Workload::new().set_or_clear_attributes(None::<Attributes>);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 = Workload::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 = Workload::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Workload::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 = Workload::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 = Workload::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Workload::new().set_or_clear_update_time(None::<Timestamp>);Trait Implementations§
impl StructuralPartialEq for Workload
Auto Trait Implementations§
impl Freeze for Workload
impl RefUnwindSafe for Workload
impl Send for Workload
impl Sync for Workload
impl Unpin for Workload
impl UnsafeUnpin for Workload
impl UnwindSafe for Workload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request