alertmanager_webhook_types/
lib.rs1pub mod v4;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Serialize, Deserialize, Debug)]
6#[non_exhaustive]
7#[serde(tag = "version")]
8pub enum Webhook {
9 #[serde(rename = "4")]
11 Webhook4(v4::Webhook),
12}
13
14#[cfg(test)]
15mod tests {
16 #[test]
17 fn decode_sample_v4_payload() {
18 let json_string = include_str!("../assets/sample-v4-payload.json");
20 let json_value: Result<super::Webhook, _> = serde_json::from_str(json_string);
21 assert!(json_value.is_ok());
22 }
23}