#[non_exhaustive]pub struct NotificationRuleAttributes {
pub created_at: i64,
pub created_by: RuleUser,
pub enabled: bool,
pub modified_at: i64,
pub modified_by: RuleUser,
pub name: String,
pub selectors: Selectors,
pub targets: Vec<String>,
pub time_aggregation: Option<i64>,
pub version: i64,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Attributes of the notification rule.
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.created_at: i64
Date as Unix timestamp in milliseconds.
created_by: RuleUser
User creating or modifying a rule.
enabled: bool
Field used to enable or disable the rule.
modified_at: i64
Date as Unix timestamp in milliseconds.
modified_by: RuleUser
User creating or modifying a rule.
name: String
Name of the notification rule.
selectors: Selectors
Selectors are used to filter security issues for which notifications should be generated. Users can specify rule severities, rule types, a query to filter security issues on tags and attributes, and the trigger source. Only the trigger_source field is required.
targets: Vec<String>
List of recipients to notify when a notification rule is triggered. Many different target types are supported, such as email addresses, Slack channels, and PagerDuty services. The appropriate integrations need to be properly configured to send notifications to the specified targets.
time_aggregation: Option<i64>
Time aggregation period (in seconds) is used to aggregate the results of the notification rule evaluation. Results are aggregated over a selected time frame using a rolling window, which updates with each new evaluation. Notifications are only sent for new issues discovered during the window. Time aggregation is only available for vulnerability-based notification rules. When omitted or set to 0, no aggregation is done.
version: i64
Version of the notification rule. It is updated when the rule is modified.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl NotificationRuleAttributes
impl NotificationRuleAttributes
pub fn new( created_at: i64, created_by: RuleUser, enabled: bool, modified_at: i64, modified_by: RuleUser, name: String, selectors: Selectors, targets: Vec<String>, version: i64, ) -> NotificationRuleAttributes
pub fn time_aggregation(self, value: i64) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for NotificationRuleAttributes
impl Clone for NotificationRuleAttributes
Source§fn clone(&self) -> NotificationRuleAttributes
fn clone(&self) -> NotificationRuleAttributes
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more