ExNtfy.Attachment (ex_ntfy v0.1.0)

Copy Markdown View Source

An attachment on a received ntfy message.

For server-hosted uploads all five fields are set; for attach-by-URL messages only name and url are present.

Summary

Functions

Builds an attachment from a decoded JSON map.

Types

t()

@type t() :: %ExNtfy.Attachment{
  expires: integer() | nil,
  name: String.t(),
  size: non_neg_integer() | nil,
  type: String.t() | nil,
  url: String.t()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Builds an attachment from a decoded JSON map.

Lenient: missing fields become nil, unknown fields are ignored.