Unicom360.SMS.SendResult (Unicom360 v0.1.0)

Copy Markdown View Source

The result of Unicom360.SMS.send/3 (canonical name SmsSendResult).

  • api_reference - the gateway's reference for the request; quote it to support.
  • message - the gateway's message ("successful").
  • results - one Unicom360.SMS.Result per recipient, in the gateway's order, which is not the request's order past the tenth recipient.
  • raw - the JSON object the result was parsed from, unmodified.
  • extra - every member of the envelope this version does not model.

Summary

Functions

The results the gateway accepted (status exactly "ACKNOWLEDGED"), in response order.

The first result for number, or nil.

Every other result (for example "Invalid mobile number"), in response order.

Types

t()

@type t() :: %Unicom360.SMS.SendResult{
  api_reference: String.t() | nil,
  extra: map(),
  message: String.t() | nil,
  raw: map(),
  results: [Unicom360.SMS.Result.t()]
}

Functions

accepted(send_result)

@spec accepted(t()) :: [Unicom360.SMS.Result.t()]

The results the gateway accepted (status exactly "ACKNOWLEDGED"), in response order.

by_number(send_result, number)

@spec by_number(t(), String.t()) :: Unicom360.SMS.Result.t() | nil

The first result for number, or nil.

Compares digits only, so "+260 97 123 4567" finds "260971234567". Local formats are not expanded: pass the international form.

invalid(send_result)

@spec invalid(t()) :: [Unicom360.SMS.Result.t()]

Every other result (for example "Invalid mobile number"), in response order.