diff options
author | stuebinm | 2024-03-27 23:10:02 +0100 |
---|---|---|
committer | stuebinm | 2024-03-27 23:10:02 +0100 |
commit | bade89a506c380a7d4cab4fdd765e28686c14776 (patch) | |
tree | 451bd9fdee32b03c159bcbff71699afaaef48341 /src/ntfy.rs |
simple bot to play around with
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 +} |