mastodon API rust lib elefren, fixed and updated. and also all ASYNC! NB. most examples are now wrong.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
elefren-fork/src/entities/notification.rs

36 lines
1.1 KiB

//! Module containing all info about notifications.
use serde::Deserialize;
6 years ago
use super::{account::Account, status::Status};
7 years ago
use chrono::prelude::*;
/// A struct containing info about a notification.
#[derive(Debug, Clone, Deserialize, PartialEq)]
7 years ago
pub struct Notification {
/// The notification ID.
pub id: String,
/// The type of notification.
#[serde(rename = "type")]
7 years ago
pub notification_type: NotificationType,
/// The time the notification was created.
pub created_at: DateTime<Utc>,
/// The Account sending the notification to the user.
7 years ago
pub account: Account,
/// The Status associated with the notification, if applicable.
7 years ago
pub status: Option<Status>,
}
/// The type of notification.
#[derive(Debug, Clone, Copy, Deserialize, PartialEq)]
#[serde(rename_all = "lowercase")]
7 years ago
pub enum NotificationType {
/// Someone mentioned the application client in another status.
7 years ago
Mention,
/// Someone reblogged one of the application client's statuses.
7 years ago
Reblog,
/// Someone favourited one of the application client's statuses.
7 years ago
Favourite,
/// Someone followed the application client.
7 years ago
Follow,
}