#[non_exhaustive]pub struct Rule {Show 18 fields
pub name: String,
pub revision_id: String,
pub display_name: String,
pub text: String,
pub author: String,
pub severity: Option<Severity>,
pub metadata: HashMap<String, String>,
pub create_time: Option<Timestamp>,
pub revision_create_time: Option<Timestamp>,
pub compilation_state: CompilationState,
pub type: RuleType,
pub reference_lists: Vec<String>,
pub allowed_run_frequencies: Vec<RunFrequency>,
pub etag: String,
pub scope: String,
pub compilation_diagnostics: Vec<CompilationDiagnostic>,
pub near_real_time_live_rule_eligible: bool,
pub inputs_used: Option<InputsUsed>,
/* private fields */
}Expand description
The Rule resource represents a user-created rule. NEXT TAG: 21
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. Full resource name for the rule.
Format:
projects/{project}/locations/{location}/instances/{instance}/rules/{rule}
revision_id: StringOutput only. The revision ID of the rule.
A new revision is created whenever the rule text is changed in any way.
Format: v_{10 digits}_{9 digits}
Populated in REVISION_METADATA_ONLY view and FULL view.
display_name: StringOutput only. Display name of the rule. Populated in BASIC view and FULL view.
text: StringThe YARA-L content of the rule. Populated in FULL view.
Output only. The author of the rule. Extracted from the meta section of text. Populated in BASIC view and FULL view.
severity: Option<Severity>Output only. The severity of the rule as specified in the meta section of text. Populated in BASIC view and FULL view.
metadata: HashMap<String, String>Output only. Additional metadata specified in the meta section of text. Populated in FULL view.
create_time: Option<Timestamp>Output only. The timestamp of when the rule was created. Populated in FULL view.
revision_create_time: Option<Timestamp>Output only. The timestamp of when the rule revision was created. Populated in FULL, REVISION_METADATA_ONLY views.
compilation_state: CompilationStateOutput only. The current compilation state of the rule. Populated in FULL view.
type: RuleTypeOutput only. User-facing type of the rule. Extracted from the events section of rule text. Populated in BASIC view and FULL view.
reference_lists: Vec<String>Output only. Resource names of the reference lists used in this rule. Populated in FULL view.
allowed_run_frequencies: Vec<RunFrequency>Output only. The run frequencies that are allowed for the rule. Populated in BASIC view and FULL view.
etag: StringThe etag for this rule. If this is provided on update, the request will succeed if and only if it matches the server-computed value, and will fail with an ABORTED error otherwise. Populated in BASIC view and FULL view.
scope: StringResource name of the DataAccessScope bound to this rule.
Populated in BASIC view and FULL view.
If reference lists are used in the rule, validations will be performed
against this scope to ensure that the reference lists are compatible with
both the user’s and the rule’s scopes.
The scope should be in the format:
projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{scope}.
compilation_diagnostics: Vec<CompilationDiagnostic>Output only. A list of a rule’s corresponding compilation diagnostic messages such as compilation errors and compilation warnings. Populated in FULL view.
near_real_time_live_rule_eligible: boolOutput only. Indicate the rule can run in near real time live rule. If this is true, the rule uses the near real time live rule when the run frequency is set to LIVE.
inputs_used: Option<InputsUsed>Output only. The set of inputs used in the rule. For example, if the rule uses $e.principal.hostname, then the uses_udm field will be true.
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn set_revision_id<T: Into<String>>(self, v: T) -> Self
pub fn set_revision_id<T: Into<String>>(self, v: T) -> Self
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_severity<T>(self, v: T) -> Self
pub fn set_severity<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_severity<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_severity<T>(self, v: Option<T>) -> Self
Sourcepub fn set_metadata<T, K, V>(self, v: T) -> Self
pub fn set_metadata<T, K, V>(self, v: T) -> 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 = Rule::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 = Rule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Rule::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_revision_create_time<T>(self, v: T) -> Self
pub fn set_revision_create_time<T>(self, v: T) -> Self
Sets the value of revision_create_time.
§Example
use wkt::Timestamp;
let x = Rule::new().set_revision_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_revision_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_revision_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of revision_create_time.
§Example
use wkt::Timestamp;
let x = Rule::new().set_or_clear_revision_create_time(Some(Timestamp::default()/* use setters */));
let x = Rule::new().set_or_clear_revision_create_time(None::<Timestamp>);Sourcepub fn set_compilation_state<T: Into<CompilationState>>(self, v: T) -> Self
pub fn set_compilation_state<T: Into<CompilationState>>(self, v: T) -> Self
Sets the value of compilation_state.
§Example
use google_cloud_chronicle_v1::model::rule::CompilationState;
let x0 = Rule::new().set_compilation_state(CompilationState::Succeeded);
let x1 = Rule::new().set_compilation_state(CompilationState::Failed);Sourcepub fn set_reference_lists<T, V>(self, v: T) -> Self
pub fn set_reference_lists<T, V>(self, v: T) -> Self
Sets the value of reference_lists.
§Example
let x = Rule::new().set_reference_lists(["a", "b", "c"]);Sourcepub fn set_allowed_run_frequencies<T, V>(self, v: T) -> Self
pub fn set_allowed_run_frequencies<T, V>(self, v: T) -> Self
Sets the value of allowed_run_frequencies.
§Example
use google_cloud_chronicle_v1::model::RunFrequency;
let x = Rule::new().set_allowed_run_frequencies([
RunFrequency::Live,
RunFrequency::Hourly,
RunFrequency::Daily,
]);Sourcepub fn set_compilation_diagnostics<T, V>(self, v: T) -> Self
pub fn set_compilation_diagnostics<T, V>(self, v: T) -> Self
Sets the value of compilation_diagnostics.
§Example
use google_cloud_chronicle_v1::model::CompilationDiagnostic;
let x = Rule::new()
.set_compilation_diagnostics([
CompilationDiagnostic::default()/* use setters */,
CompilationDiagnostic::default()/* use (different) setters */,
]);Sourcepub fn set_near_real_time_live_rule_eligible<T: Into<bool>>(self, v: T) -> Self
pub fn set_near_real_time_live_rule_eligible<T: Into<bool>>(self, v: T) -> Self
Sets the value of near_real_time_live_rule_eligible.
§Example
let x = Rule::new().set_near_real_time_live_rule_eligible(true);Sourcepub fn set_inputs_used<T>(self, v: T) -> Selfwhere
T: Into<InputsUsed>,
pub fn set_inputs_used<T>(self, v: T) -> Selfwhere
T: Into<InputsUsed>,
Sets the value of inputs_used.
§Example
use google_cloud_chronicle_v1::model::InputsUsed;
let x = Rule::new().set_inputs_used(InputsUsed::default()/* use setters */);Sourcepub fn set_or_clear_inputs_used<T>(self, v: Option<T>) -> Selfwhere
T: Into<InputsUsed>,
pub fn set_or_clear_inputs_used<T>(self, v: Option<T>) -> Selfwhere
T: Into<InputsUsed>,
Sets or clears the value of inputs_used.
§Example
use google_cloud_chronicle_v1::model::InputsUsed;
let x = Rule::new().set_or_clear_inputs_used(Some(InputsUsed::default()/* use setters */));
let x = Rule::new().set_or_clear_inputs_used(None::<InputsUsed>);