wimp

A Gleam client for the Pushover push notification API.

https://pushover.net/api

Types

The unix timestamp when the app counter will reset.

pub opaque type Builder
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.

pub type Priority {
  Emergency(retry: Int, expire: Int)
  High
  Normal
  Low
  Lowest
}

Constructors

  • Emergency(retry: Int, expire: Int)
  • High
  • Normal
  • Low
  • Lowest

Functions

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 - Bike
  • bugle - Bugle
  • cashregister - Cash Register
  • classical - Classical
  • cosmic - Cosmic
  • falling - Falling
  • gamelan - Gamelan
  • incoming - Incoming
  • intermission - Intermission
  • magic - Magic
  • mechanical - Mechanical
  • pianobar - Piano Bar
  • siren - Siren
  • spacealarm - Space Alarm
  • tugboat - Tug Boat
  • alien - Alien Alarm (long)
  • climb - Climb (long)
  • persistent - Persistent (long)
  • echo - Pushover Echo (long)
  • updown - Up Down (long)
  • vibrate - Vibrate Only
  • none - 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.

pub fn title(builder: Builder, title: String) -> Builder

Set the title of the message.

Titles are limited to 250 characters in length, longer titles will be truncated.

Search Document