mastodon_api\models/
push.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents a subscription to the Web Push API.
4#[derive(Debug, Clone, Deserialize, Serialize)]
5pub struct WebPushSubscription {
6    /// The ID of the Web Push subscription in the database.
7    pub id: u64,
8    /// The endpoint of the Web Push subscription.
9    pub endpoint: String,
10    /// The server key used for the Web Push subscription.
11    pub server_key: String,
12    /// Which alerts should be delivered to the push endpoint.
13    pub alerts: WebPushAlerts,
14}
15
16/// Represents the alerts that can be delivered via Web Push.
17#[derive(Debug, Clone, Deserialize, Serialize)]
18pub struct WebPushAlerts {
19    /// Whether to notify on new followers.
20    pub follow: bool,
21    /// Whether to notify on new favourites.
22    pub favourite: bool,
23    /// Whether to notify on new reblogs.
24    pub reblog: bool,
25    /// Whether to notify on new mentions.
26    pub mention: bool,
27    /// Whether to notify on new poll results.
28    pub poll: bool,
29    /// Whether to notify on new statuses from followed accounts.
30    pub status: bool,
31}