diff options
Diffstat (limited to 'src/ntfy.rs')
-rw-r--r-- | src/ntfy.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ntfy.rs b/src/ntfy.rs new file mode 100644 index 0000000..48e9f36 --- /dev/null +++ b/src/ntfy.rs @@ -0,0 +1,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 +} |