#[non_exhaustive]pub struct Insight {
pub name: String,
pub description: String,
pub target_resources: Vec<String>,
pub insight_subtype: String,
pub content: Option<Struct>,
pub last_refresh_time: Option<Timestamp>,
pub observation_period: Option<Duration>,
pub state_info: Option<InsightStateInfo>,
pub category: Category,
pub severity: Severity,
pub etag: String,
pub associated_recommendations: Vec<RecommendationReference>,
/* private fields */
}Expand description
An insight along with the information used to derive the insight. The insight may have associated recommendations as well.
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: StringName of the insight.
description: StringFree-form human readable summary in English. The maximum length is 500 characters.
target_resources: Vec<String>Fully qualified resource names that this insight is targeting.
insight_subtype: StringInsight subtype. Insight content schema will be stable for a given subtype.
content: Option<Struct>A struct of custom fields to explain the insight. Example: “grantedPermissionsCount”: “1000”
last_refresh_time: Option<Timestamp>Timestamp of the latest data used to generate the insight.
observation_period: Option<Duration>Observation period that led to the insight. The source data used to generate the insight ends at last_refresh_time and begins at (last_refresh_time - observation_period).
state_info: Option<InsightStateInfo>Information state and metadata.
category: CategoryCategory being targeted by the insight.
severity: SeverityInsight’s severity.
etag: StringFingerprint of the Insight. Provides optimistic locking when updating states.
associated_recommendations: Vec<RecommendationReference>Recommendations derived from this insight.
Implementations§
Source§impl Insight
impl Insight
pub fn new() -> 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_target_resources<T, V>(self, v: T) -> Self
pub fn set_target_resources<T, V>(self, v: T) -> Self
Sets the value of target_resources.
§Example
let x = Insight::new().set_target_resources(["a", "b", "c"]);Sourcepub fn set_insight_subtype<T: Into<String>>(self, v: T) -> Self
pub fn set_insight_subtype<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_content<T>(self, v: T) -> Self
pub fn set_content<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_content<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_content<T>(self, v: Option<T>) -> Self
Sourcepub fn set_last_refresh_time<T>(self, v: T) -> Self
pub fn set_last_refresh_time<T>(self, v: T) -> Self
Sets the value of last_refresh_time.
§Example
use wkt::Timestamp;
let x = Insight::new().set_last_refresh_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_last_refresh_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_last_refresh_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of last_refresh_time.
§Example
use wkt::Timestamp;
let x = Insight::new().set_or_clear_last_refresh_time(Some(Timestamp::default()/* use setters */));
let x = Insight::new().set_or_clear_last_refresh_time(None::<Timestamp>);Sourcepub fn set_observation_period<T>(self, v: T) -> Self
pub fn set_observation_period<T>(self, v: T) -> Self
Sets the value of observation_period.
§Example
use wkt::Duration;
let x = Insight::new().set_observation_period(Duration::default()/* use setters */);Sourcepub fn set_or_clear_observation_period<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_observation_period<T>(self, v: Option<T>) -> Self
Sets or clears the value of observation_period.
§Example
use wkt::Duration;
let x = Insight::new().set_or_clear_observation_period(Some(Duration::default()/* use setters */));
let x = Insight::new().set_or_clear_observation_period(None::<Duration>);Sourcepub fn set_state_info<T>(self, v: T) -> Selfwhere
T: Into<InsightStateInfo>,
pub fn set_state_info<T>(self, v: T) -> Selfwhere
T: Into<InsightStateInfo>,
Sets the value of state_info.
§Example
use google_cloud_recommender_v1::model::InsightStateInfo;
let x = Insight::new().set_state_info(InsightStateInfo::default()/* use setters */);Sourcepub fn set_or_clear_state_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<InsightStateInfo>,
pub fn set_or_clear_state_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<InsightStateInfo>,
Sets or clears the value of state_info.
§Example
use google_cloud_recommender_v1::model::InsightStateInfo;
let x = Insight::new().set_or_clear_state_info(Some(InsightStateInfo::default()/* use setters */));
let x = Insight::new().set_or_clear_state_info(None::<InsightStateInfo>);Sourcepub fn set_category<T: Into<Category>>(self, v: T) -> Self
pub fn set_category<T: Into<Category>>(self, v: T) -> Self
Sourcepub fn set_severity<T: Into<Severity>>(self, v: T) -> Self
pub fn set_severity<T: Into<Severity>>(self, v: T) -> Self
Sourcepub fn set_associated_recommendations<T, V>(self, v: T) -> Self
pub fn set_associated_recommendations<T, V>(self, v: T) -> Self
Sets the value of associated_recommendations.
§Example
use google_cloud_recommender_v1::model::insight::RecommendationReference;
let x = Insight::new()
.set_associated_recommendations([
RecommendationReference::default()/* use setters */,
RecommendationReference::default()/* use (different) setters */,
]);