From bade89a506c380a7d4cab4fdd765e28686c14776 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Wed, 27 Mar 2024 23:10:02 +0100 Subject: simple bot to play around with --- src/ntfy.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/ntfy.rs (limited to 'src/ntfy.rs') 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, + pub event: Event, + pub topic: String, + pub message: Option, + pub title: Option, + pub tags: Option>, + pub priority: Option, + pub click: Option, + // omitted: actions, attachment +} + + +#[derive(Debug, serde::Deserialize, PartialEq, Eq)] +#[serde(rename_all = "snake_case")] +pub enum Event { + Open, + Keepalive, + Message, + PollRequest +} -- cgit v1.2.3