1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
mod entities;
pub use entities::alert::AlertData as AlertData;
pub use entities::alert::Alert as Alert;
pub use entities::alert::Priority as Priority;
pub struct OpsGenie {
api_key: String,
}
impl OpsGenie {
pub fn new(key: String) -> OpsGenie {
OpsGenie {
api_key: key.clone(),
}
}
pub fn alert(&self, alert_data: AlertData) -> Result<Alert, reqwest::Error> {
Alert::create(&self.api_key, alert_data)
}
}