pub struct Notification {
pub notification_id: u64,
pub app: String,
pub user: String,
pub datetime: String,
pub object_type: String,
pub object_id: String,
pub subject: String,
pub message: String,
pub link: String,
pub actions: Vec<NotificationAction>,
}Expand description
A Nextcloud notification item.
Returned by the Nextcloud Notifications OCS API v2.
See the official Nextcloud Notifications API v2 Notification Element documentation.
Fields§
§notification_id: u64Unique identifier of the notification, used to retrieve or dismiss it.
app: StringName of the Nextcloud app that triggered the notification (e.g. "files_sharing").
user: StringUser ID of the user that receives the notification.
datetime: StringISO 8601 date and time when the notification was published.
object_type: StringType of the object the notification is about (e.g. "remote_share").
object_id: StringIdentifier of the object within the originating app.
subject: StringTranslated short subject presented to the user.
message: StringOptional translated detailed message text.
link: StringOptional link to follow when the subject or message is clicked.
actions: Vec<NotificationAction>Optional list of interactive actions available for this notification.
Implementations§
Source§impl Notification
impl Notification
Sourcepub fn new(
notification_id: u64,
app: String,
user: String,
datetime: String,
object_type: String,
object_id: String,
subject: String,
message: String,
link: String,
actions: Vec<NotificationAction>,
) -> Self
pub fn new( notification_id: u64, app: String, user: String, datetime: String, object_type: String, object_id: String, subject: String, message: String, link: String, actions: Vec<NotificationAction>, ) -> Self
Creates a new notification instance.
Sourcepub const fn notification_id(&self) -> u64
pub const fn notification_id(&self) -> u64
Unique identifier of the notification.
Sourcepub fn object_type(&self) -> &str
pub fn object_type(&self) -> &str
Classification of the object this notification references.
Sourcepub fn link(&self) -> &str
pub fn link(&self) -> &str
URL link associated with the notification, or empty if none was provided.
Sourcepub fn actions(&self) -> &[NotificationAction]
pub fn actions(&self) -> &[NotificationAction]
Interactive actions available for this notification.