unitpost 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e92552a542bfa040de967b8d88af9aba31d6edbd0001768633793263a0728bc2
4
- data.tar.gz: 7b49579c2d34abdb8efb2d9b01382edb1b1f646467b1c7fe33573c65ce89176a
3
+ metadata.gz: 4ccb9dc0f9caf498bb805032a619f66af911365a8b6d86454280d0ff704c6069
4
+ data.tar.gz: 1922fba2d0f9002330c0543ed981eb9118575ce97419f1e67b06057223ff4393
5
5
  SHA512:
6
- metadata.gz: f35532690b25c113997d1b594db3bf849dc4f60853f2c290eadb95940958b3c5084c59ef71320486728a9a97f666b21a1541599a972edc5e670a609dc640fddf
7
- data.tar.gz: d8d884f80928d12d3023886986c641de6221886a1b0bcde7ab9005a9971f48257aa8df58e8bc7ea5126d3213231dd08cb7ef6dbd41312489bf07127f08b947b9
6
+ metadata.gz: cc977b4a7c69424813876f8d2f26cc4ccafe10f83b51eb5ff16cb350ef925b9866bb7f1b52767184c1fbdc60f6ad41932c8c1ae15e8577dc52f8fb5e5e5fbc6a
7
+ data.tar.gz: 3d8468ab42ad6550efb43cd1a79de8b4939ee82f1a602736499c6c41d287b2eb202d8a54678127d642323367f8f25394f4d6fec5cb3f153517cb49198665c783
data/README.md CHANGED
@@ -51,15 +51,15 @@ key at [unitpost.com → Settings → API keys](https://www.unitpost.com).
51
51
 
52
52
  | Accessor | Covers |
53
53
  | --- | --- |
54
- | `emails` | Send, batch, list, get, update, stats, inbound (`received_*`) |
54
+ | `email` | Send, batch, list, get, update, stats, inbound (`received_*`) |
55
+ | `email.topics` | Topics + contact topic prefs |
56
+ | `email.campaigns` | Draft, schedule, send, pause/resume |
57
+ | `email.templates` | Template CRUD |
58
+ | `email.domains` | Domains + verify |
55
59
  | `contacts` | CRUD, import jobs |
56
60
  | `contact_fields` | Custom field definitions |
57
61
  | `segments` | Segments + membership |
58
- | `topics` | Topics + contact topic prefs |
59
- | `campaigns` | Draft, schedule, send, pause/resume |
60
- | `templates` | Template CRUD |
61
62
  | `brand_kits` | Brand kit |
62
- | `domains` | Domains + verify |
63
63
  | `webhooks` | Endpoints + `verify` |
64
64
  | `api_keys` | API key management |
65
65
  | `suppressions` | Suppression list |
@@ -112,7 +112,7 @@ event = client.webhooks.verify(payload: raw_body, secret: secret, headers: reque
112
112
 
113
113
  ## Idempotency
114
114
 
115
- `emails.send` and `emails.batch` are safe to retry by default — when you don't
115
+ `email.send` and `email.batch` are safe to retry by default — when you don't
116
116
  pass `idempotency_key:`, the SDK generates one so an automatic retry can't
117
117
  double-send. Pass your own to dedupe across separate calls:
118
118
 
@@ -132,7 +132,7 @@ Transient failures are retried automatically: `429`, `5xx`, and transport errors
132
132
  `Retry-After` is honored; otherwise exponential backoff with full jitter is used.
133
133
  Client errors (`401`/`403`/`404`/`409`/`422`) are never retried. Only requests
134
134
  safe to replay are retried: `GET`s and writes carrying an idempotency key (which
135
- `emails.send` and `emails.batch` always do); any other keyless write is never
135
+ `email.send` and `email.batch` always do); any other keyless write is never
136
136
  auto-retried.
137
137
 
138
138
  ```ruby
@@ -962,6 +962,48 @@ module Unitpost
962
962
  is_list: false,
963
963
  list_item_schema: nil
964
964
  },
965
+ {
966
+ operation_id: "sms.get",
967
+ resource: "sms",
968
+ method_name: "get",
969
+ http_method: "GET",
970
+ path: "/sms/{id}",
971
+ path_params: ["id"],
972
+ query_params: [],
973
+ has_body: false,
974
+ request_schema: nil,
975
+ response_schema: "Sms",
976
+ is_list: false,
977
+ list_item_schema: nil
978
+ },
979
+ {
980
+ operation_id: "sms.list",
981
+ resource: "sms",
982
+ method_name: "list",
983
+ http_method: "GET",
984
+ path: "/sms",
985
+ path_params: [],
986
+ query_params: ["limit", "after", "before"],
987
+ has_body: false,
988
+ request_schema: nil,
989
+ response_schema: nil,
990
+ is_list: true,
991
+ list_item_schema: "Sms"
992
+ },
993
+ {
994
+ operation_id: "sms.send",
995
+ resource: "sms",
996
+ method_name: "send",
997
+ http_method: "POST",
998
+ path: "/sms",
999
+ path_params: [],
1000
+ query_params: [],
1001
+ has_body: true,
1002
+ request_schema: "SmsSend",
1003
+ response_schema: "Sms",
1004
+ is_list: false,
1005
+ list_item_schema: nil
1006
+ },
965
1007
  {
966
1008
  operation_id: "suppressions.create",
967
1009
  resource: "suppressions",
@@ -46,6 +46,28 @@ module Unitpost
46
46
  end
47
47
  end
48
48
 
49
+ class Sms < Base
50
+ # SMS channel (beta). Recipient must be E.164; marketing sends require
51
+ # prior express consent on record and honor recipient-local quiet hours.
52
+ # Billing is per segment. When no idempotency_key is given one is
53
+ # generated so a transient retry can't double-send.
54
+ def send(body, idempotency_key: nil)
55
+ @http.request("POST", "/sms", body: body, idempotency_key: idempotency_key || SecureRandom.uuid)
56
+ end
57
+
58
+ def get(id)
59
+ @http.request("GET", "/sms/#{enc(id)}")
60
+ end
61
+
62
+ def list(params = {})
63
+ @http.request("GET", "/sms", query: params)
64
+ end
65
+
66
+ def list_all(params = {})
67
+ paginate("/sms", params)
68
+ end
69
+ end
70
+
49
71
  class Email < Base
50
72
  attr_reader :topics, :campaigns, :templates, :domains
51
73
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Unitpost
4
- VERSION = "0.2.1"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unitpost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unitpost
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-31 00:00:00.000000000 Z
11
+ date: 2026-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday