hunter v0.5.1 Hunter.Notification View Source
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.Account
sending the notification to the userstatus
- TheHunter.Status
associated with the notification, if applicable
Link to this section Summary
Functions
Dismiss a single notification
Deletes all notifications from the Mastodon server for the authenticated user
Retrieve single notification
Retrieve user's notifications
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %Hunter.Notification{
account: Hunter.Account.t(),
created_at: String.t(),
id: String.t(),
status: Hunter.Status.t(),
type: String.t()
}
t() :: %Hunter.Notification{ account: Hunter.Account.t(), created_at: String.t(), id: String.t(), status: Hunter.Status.t(), type: String.t() }
Link to this section Functions
Link to this function
clear_notification(conn, id)
View Source
clear_notification(conn, id)
View Source
clear_notification(Hunter.Client.t(), non_neg_integer()) :: boolean()
clear_notification(Hunter.Client.t(), non_neg_integer()) :: boolean()
Dismiss a single notification
Parameters
conn
- connection credentialsid
- notification id
Link to this function
clear_notifications(conn)
View Source
clear_notifications(conn)
View Source
clear_notifications(Hunter.Client.t()) :: boolean()
clear_notifications(Hunter.Client.t()) :: boolean()
Deletes all notifications from the Mastodon server for the authenticated user
Parameters
conn
- connection credentials
Link to this function
notification(conn, id)
View Source
notification(conn, id)
View Source
notification(Hunter.Client.t(), non_neg_integer()) :: Hunter.Notification.t()
notification(Hunter.Client.t(), non_neg_integer()) :: Hunter.Notification.t()
Retrieve single notification
Parameters
conn
- connection credentialsid
- notification identifier
Examples
Hunter.Notification.notification(conn, 17_476)
#=> %Hunter.Notification{account: %{"acct" => "paperswelove@mstdn.io", ...}
Link to this function
notifications(conn, options \\ [])
View Source
notifications(conn, options \\ [])
View Source
notifications(Hunter.Client.t(), Keyword.t()) :: [Hunter.Notification.t()]
notifications(Hunter.Client.t(), Keyword.t()) :: [Hunter.Notification.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", ...}]