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
|
/// see https://docs.ntfy.sh/subscribe/api/#json-message-format
#[derive(Debug, serde::Deserialize)]
#[allow(unused)]
pub struct Message {
pub id: String,
pub time: u64,
pub expires: Option<u64>,
pub event: Event,
pub topic: String,
pub message: Option<String>,
pub title: Option<String>,
pub tags: Option<Vec<String>>,
pub priority: Option<usize>,
pub click: Option<String>,
// omitted: actions, attachment
}
#[derive(Debug, serde::Deserialize, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum Event {
Open,
Keepalive,
Message,
PollRequest
}
|