windmill_api/models/
alert.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.511.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Alert {
16    #[serde(rename = "name")]
17    pub name: String,
18    #[serde(rename = "tags_to_monitor")]
19    pub tags_to_monitor: Vec<String>,
20    #[serde(rename = "jobs_num_threshold")]
21    pub jobs_num_threshold: i32,
22    #[serde(rename = "alert_cooldown_seconds")]
23    pub alert_cooldown_seconds: i32,
24    #[serde(rename = "alert_time_threshold_seconds")]
25    pub alert_time_threshold_seconds: i32,
26}
27
28impl Alert {
29    pub fn new(name: String, tags_to_monitor: Vec<String>, jobs_num_threshold: i32, alert_cooldown_seconds: i32, alert_time_threshold_seconds: i32) -> Alert {
30        Alert {
31            name,
32            tags_to_monitor,
33            jobs_num_threshold,
34            alert_cooldown_seconds,
35            alert_time_threshold_seconds,
36        }
37    }
38}
39