Notification entity
This module defines a Hunter.Notification struct and the main functions
for working with Notifications.
Fields
id- The notification IDtype- One of: "mention", "reblog", "favourite", "follow"created_at- The time the notification was createdaccount- TheHunter.Accountsending the notification to the userstatus- TheHunter.Statusassociated with the notification, if applicable
Summary
Functions
Dismiss a single notification
Deletes all notifications from the Mastodon server for the authenticated user
Retrieve single notification
Retrieve user's notifications
Types
@type t() :: %Hunter.Notification{ account: Hunter.Account.t(), created_at: String.t(), id: String.t(), status: Hunter.Status.t(), type: String.t() }
Functions
@spec clear_notification(Hunter.Client.t(), non_neg_integer()) :: boolean()
Dismiss a single notification
Parameters
conn- connection credentialsid- notification id
@spec clear_notifications(Hunter.Client.t()) :: boolean()
Deletes all notifications from the Mastodon server for the authenticated user
Parameters
conn- connection credentials
@spec notification(Hunter.Client.t(), non_neg_integer()) :: t()
Retrieve single notification
Parameters
conn- connection credentialsid- notification identifier
Examples
Hunter.Notification.notification(conn, 17_476)
#=> %Hunter.Notification{account: %{"acct" => "paperswelove@mstdn.io", ...}
@spec notifications(Hunter.Client.t(), Keyword.t()) :: [t()]
Retrieve user's notifications
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get a list of notifications with id less than or equal this valuesince_id- get a list of notifications with id greater than this valuelimit- maximum number of notifications to get, default: 15, max: 30
Examples
Hunter.Notification.notifications(conn)
#=> [%Hunter.Notification{account: %{"acct" => "paperswelove@mstdn.io", ...}]