wimp
A Gleam client for the Pushover push notification API.
https://pushover.net/api
Types
pub type Error {
MessageLimitExceeded(limits: Limits)
InvalidApplicationToken
BadRequest(body: String)
RateLimited(limits: Limits, body: String)
UnexpectedResponse(status: Int, body: String)
}
Constructors
-
MessageLimitExceeded(limits: Limits) -
InvalidApplicationToken -
BadRequest(body: String) -
RateLimited(limits: Limits, body: String) -
UnexpectedResponse(status: Int, body: String)
pub type Formatting {
Html
Text
Monospace
}
Constructors
-
Html -
Text -
Monospace
pub type Limits {
Limits(app_limit: Int, app_remaining: Int, app_reset: Int)
}
Constructors
-
Limits(app_limit: Int, app_remaining: Int, app_reset: Int)Arguments
- app_reset
-
The unix timestamp when the app counter will reset.
Values
pub fn decode_message_response(
resp: Response(String),
) -> Result(Limits, Error)
Decode the response from Pushover to determine whether the message sending was successful or not.
pub fn device(builder: Builder, device: String) -> Builder
Set the device to send the message to.
pub fn formatting(
builder: Builder,
formatting: Formatting,
) -> Builder
Set the formatting of the message.
pub fn message_request(builder: Builder) -> Request(String)
pub fn new(
token token: String,
user user: String,
message message: String,
) -> Builder
Create a new Pushover message to send to a Pushover user as the application for the token.
Messages are limited to 1024 characters in length, longer messages will be truncated.
pub fn priority(builder: Builder, priority: Priority) -> Builder
Set the priority of the message.
pub fn sound(builder: Builder, sound: String) -> Builder
Set the sound of the message.
The default sounds are:
pushover- Pushover (default)bike- Bikebugle- Buglecashregister- Cash Registerclassical- Classicalcosmic- Cosmicfalling- Fallinggamelan- Gamelanincoming- Incomingintermission- Intermissionmagic- Magicmechanical- Mechanicalpianobar- Piano Barsiren- Sirenspacealarm- Space Alarmtugboat- Tug Boatalien- Alien Alarm (long)climb- Climb (long)persistent- Persistent (long)echo- Pushover Echo (long)updown- Up Down (long)vibrate- Vibrate Onlynone- None (silent)
pub fn supplimentary_url(
builder: Builder,
title title: String,
url url: String,
) -> Builder
Set a supplimentary URL and a title for the link.
pub fn time_to_live(
builder: Builder,
seconds time_to_live: Int,
) -> Builder
Set the time to live of the message in seconds.