use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Alert {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "tags_to_monitor")]
pub tags_to_monitor: Vec<String>,
#[serde(rename = "jobs_num_threshold")]
pub jobs_num_threshold: i32,
#[serde(rename = "alert_cooldown_seconds")]
pub alert_cooldown_seconds: i32,
#[serde(rename = "alert_time_threshold_seconds")]
pub alert_time_threshold_seconds: i32,
}
impl Alert {
pub fn new(name: String, tags_to_monitor: Vec<String>, jobs_num_threshold: i32, alert_cooldown_seconds: i32, alert_time_threshold_seconds: i32) -> Alert {
Alert {
name,
tags_to_monitor,
jobs_num_threshold,
alert_cooldown_seconds,
alert_time_threshold_seconds,
}
}
}