sentdm 0.32.0 → 0.33.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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/client.rb +6 -0
  5. data/lib/sentdm/models/channel_event_payload.rb +139 -2
  6. data/lib/sentdm/models/contact_event.rb +15 -7
  7. data/lib/sentdm/models/contact_event_payload.rb +77 -16
  8. data/lib/sentdm/models/conversation_messages_list.rb +125 -4
  9. data/lib/sentdm/models/message_event_payload.rb +20 -1
  10. data/lib/sentdm/models/message_retrieve_activities_response.rb +20 -5
  11. data/lib/sentdm/models/message_retrieve_status_response.rb +133 -6
  12. data/lib/sentdm/models/message_send_params.rb +67 -3
  13. data/lib/sentdm/models/message_send_response.rb +13 -4
  14. data/lib/sentdm/models/template_body.rb +82 -1
  15. data/lib/sentdm/models/template_header.rb +91 -3
  16. data/lib/sentdm/models/template_variable.rb +15 -1
  17. data/lib/sentdm/models/webhook_list_events_response.rb +324 -9
  18. data/lib/sentdm/resources/messages.rb +33 -5
  19. data/lib/sentdm/version.rb +1 -1
  20. data/lib/sentdm.rb +1 -1
  21. data/rbi/sentdm/client.rbi +6 -0
  22. data/rbi/sentdm/models/channel_event_payload.rbi +253 -2
  23. data/rbi/sentdm/models/contact_event.rbi +28 -12
  24. data/rbi/sentdm/models/contact_event_payload.rbi +118 -28
  25. data/rbi/sentdm/models/conversation_messages_list.rbi +202 -7
  26. data/rbi/sentdm/models/message_event_payload.rbi +22 -0
  27. data/rbi/sentdm/models/message_retrieve_activities_response.rbi +23 -5
  28. data/rbi/sentdm/models/message_retrieve_status_response.rbi +214 -9
  29. data/rbi/sentdm/models/message_send_params.rbi +100 -2
  30. data/rbi/sentdm/models/message_send_response.rbi +15 -5
  31. data/rbi/sentdm/models/template_body.rbi +133 -0
  32. data/rbi/sentdm/models/template_header.rbi +143 -2
  33. data/rbi/sentdm/models/template_variable.rbi +10 -0
  34. data/rbi/sentdm/models/webhook_list_events_response.rbi +478 -12
  35. data/rbi/sentdm/resources/messages.rbi +58 -3
  36. data/sig/sentdm/models/channel_event_payload.rbs +57 -0
  37. data/sig/sentdm/models/contact_event_payload.rbs +24 -9
  38. data/sig/sentdm/models/conversation_messages_list.rbs +48 -3
  39. data/sig/sentdm/models/message_event_payload.rbs +10 -0
  40. data/sig/sentdm/models/message_retrieve_activities_response.rbs +5 -0
  41. data/sig/sentdm/models/message_retrieve_status_response.rbs +48 -3
  42. data/sig/sentdm/models/message_send_params.rbs +15 -0
  43. data/sig/sentdm/models/template_body.rbs +44 -0
  44. data/sig/sentdm/models/template_header.rbs +44 -0
  45. data/sig/sentdm/models/webhook_list_events_response.rbs +145 -0
  46. data/sig/sentdm/resources/messages.rbs +3 -0
  47. metadata +2 -2
@@ -31,11 +31,24 @@ module Sentdm
31
31
 
32
32
  # @!attribute event_data
33
33
  # The exact event body that was delivered, or attempted, for this record. One of
34
- # the four webhook envelopes: a message status change, an inbound message, a
35
- # template status change, or a contact consent signal. Read field and event to
36
- # tell which, the same way your endpoint does.
34
+ # the six webhook envelopes:
37
35
  #
38
- # @return [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, nil]
36
+ # message — an outbound message changed status. message with event:
37
+ # message.received — someone replied to you. templates — a template was approved,
38
+ # rejected, paused or similar. channel — one of your markets moved in provisioning
39
+ # or compliance. contact — a consent signal: opt-in, opt-out or help. link — a
40
+ # tracked short link was clicked or a hosted file downloaded, or one expired or
41
+ # was revoked.
42
+ #
43
+ # Read field and event to tell which, the same way your endpoint does. The two
44
+ # message envelopes are the reason that is two fields and not one: they share a
45
+ # field and differ by event.
46
+ #
47
+ # Treat the list as open. It has grown twice — channel and then link — and a
48
+ # handler that rejects an envelope it does not recognise will break on the next
49
+ # addition rather than ignore it.
50
+ #
51
+ # @return [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload, nil]
39
52
  optional :event_data, union: -> { Sentdm::Models::WebhookListEventsResponse::EventData }
40
53
 
41
54
  # @!attribute event_type
@@ -77,7 +90,7 @@ module Sentdm
77
90
  #
78
91
  # @param error_message [String, nil]
79
92
  #
80
- # @param event_data [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent] The exact event body that was delivered, or attempted, for this record. One of t
93
+ # @param event_data [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload] The exact event body that was delivered, or attempted, for this record. One of t
81
94
  #
82
95
  # @param event_type [String]
83
96
  #
@@ -90,9 +103,22 @@ module Sentdm
90
103
  # @param response_body [String, nil]
91
104
 
92
105
  # The exact event body that was delivered, or attempted, for this record. One of
93
- # the four webhook envelopes: a message status change, an inbound message, a
94
- # template status change, or a contact consent signal. Read field and event to
95
- # tell which, the same way your endpoint does.
106
+ # the six webhook envelopes:
107
+ #
108
+ # message — an outbound message changed status. message with event:
109
+ # message.received — someone replied to you. templates — a template was approved,
110
+ # rejected, paused or similar. channel — one of your markets moved in provisioning
111
+ # or compliance. contact — a consent signal: opt-in, opt-out or help. link — a
112
+ # tracked short link was clicked or a hosted file downloaded, or one expired or
113
+ # was revoked.
114
+ #
115
+ # Read field and event to tell which, the same way your endpoint does. The two
116
+ # message envelopes are the reason that is two fields and not one: they share a
117
+ # field and differ by event.
118
+ #
119
+ # Treat the list as open. It has grown twice — channel and then link — and a
120
+ # handler that rejects an envelope it does not recognise will break on the next
121
+ # addition rather than ignore it.
96
122
  #
97
123
  # @see Sentdm::Models::WebhookListEventsResponse#event_data
98
124
  module EventData
@@ -118,8 +144,297 @@ module Sentdm
118
144
  # varies only in Payload.
119
145
  variant -> { Sentdm::ContactEvent }
120
146
 
147
+ # The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
148
+ # varies only in Payload.
149
+ variant -> { Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload }
150
+
151
+ class SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload < Sentdm::Internal::Type::BaseModel
152
+ # @!attribute event
153
+ # The specific event within the family, for example message.delivered,
154
+ # message.received or contact.opt_out. Absent on events that have no subtype, so
155
+ # treat it as optional.
156
+ #
157
+ # @return [String, nil]
158
+ optional :event, String, nil?: true
159
+
160
+ # @!attribute field
161
+ # The event family, for example message, templates or contact. Route on this
162
+ # first, then on event for the specific change.
163
+ #
164
+ # @return [String, nil]
165
+ optional :field, String
166
+
167
+ # @!attribute payload
168
+ # Body of a link event: something happened to a tracked link Sent published on the
169
+ # customer's behalf. A link points either at a URL the customer supplied or at a
170
+ # file Sent hosts for them; LinkKind says which. Delivered when an eligible
171
+ # request is served, or when a published link reaches the end of its life.
172
+ #
173
+ # A click is a request, not a read receipt. link.clicked means the redirect was
174
+ # served; link.downloaded means bytes went out. Neither proves a person saw
175
+ # anything — messaging providers and link scanners fetch URLs on their own, which
176
+ # is what TrafficClass exists to tell apart. Filter on it before reporting a
177
+ # click-through rate; treat likely_human as a hint, never as delivery
178
+ # confirmation.
179
+ #
180
+ # RecordId identifies the link; the X-Webhook-Event-ID header identifies the
181
+ # delivery. One link is hit many times, so those are the two keys a subscriber
182
+ # needs: group by the first, deduplicate on the second — exactly as on every other
183
+ # family. The payload carries no event identifier of its own, for the same reason
184
+ # none of the others do.
185
+ #
186
+ # Nothing here identifies the visitor. No IP address and no visitor token crosses
187
+ # this boundary. Country, Device and Browser are coarse buckets derived at the
188
+ # edge and are absent whenever the request did not supply enough to derive them.
189
+ #
190
+ # @return [Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload::Payload, nil]
191
+ optional :payload,
192
+ -> { Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload::Payload },
193
+ nil?: true
194
+
195
+ # @!attribute request_id
196
+ # The event-specific body.
197
+ #
198
+ # @return [String, nil]
199
+ optional :request_id, String, nil?: true
200
+
201
+ # @!attribute timestamp
202
+ # When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
203
+ # time, not the time the underlying change happened. Use the timestamp inside the
204
+ # payload for the latter.
205
+ #
206
+ # @return [String, nil]
207
+ optional :timestamp, String
208
+
209
+ # @!method initialize(event: nil, field: nil, payload: nil, request_id: nil, timestamp: nil)
210
+ # Some parameter documentations has been truncated, see
211
+ # {Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload}
212
+ # for more details.
213
+ #
214
+ # The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
215
+ # this shape and varies only in Payload.
216
+ #
217
+ # @param event [String, nil] The specific event within the family, for example message.delivered,
218
+ #
219
+ # @param field [String] The event family, for example message, templates or contact. Route on
220
+ #
221
+ # @param payload [Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload::Payload, nil] Body of a link event: something happened to a tracked link Sent published on the
222
+ #
223
+ # @param request_id [String, nil] The event-specific body.
224
+ #
225
+ # @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
226
+
227
+ # @see Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload#payload
228
+ class Payload < Sentdm::Internal::Type::BaseModel
229
+ # @!attribute record_id
230
+ # The link's public identifier — the eight-character code in the short URL, for
231
+ # example A78B2BU0. Unique across both kinds, and never reused, so it is the
232
+ # stable key to group one link's events by.
233
+ #
234
+ # @return [String]
235
+ required :record_id, String
236
+
237
+ # @!attribute access_country
238
+ # Where the request appeared to come from, as an ISO 3166-1 alpha-2 code. Named
239
+ # separately from the country on a channel event, which is a destination market
240
+ # the customer registered for — this one is a property of a single visitor and is
241
+ # absent when the edge could not resolve it.
242
+ #
243
+ # @return [String, nil]
244
+ optional :access_country, String, nil?: true
245
+
246
+ # @!attribute access_outcome
247
+ # How the request was served, when the edge recorded it. Free text describing the
248
+ # outcome — show it to a human rather than branching on it.
249
+ #
250
+ # @return [String, nil]
251
+ optional :access_outcome, String, nil?: true
252
+
253
+ # @!attribute browser
254
+ # The requesting browser family, for example chrome or safari, or unknown. Derived
255
+ # from the user agent.
256
+ #
257
+ # @return [String, nil]
258
+ optional :browser, String, nil?: true
259
+
260
+ # @!attribute bytes_served
261
+ # How many bytes were served, for a file access. A ranged request reports the
262
+ # bytes in that range, not the size of the file, so several accesses of one file
263
+ # can each report a part.
264
+ #
265
+ # @return [Integer, nil]
266
+ optional :bytes_served, Integer, nil?: true
267
+
268
+ # @!attribute channel
269
+ # The channel the message carrying this link went out on: sms, whatsapp, or rcs.
270
+ #
271
+ # @return [String, nil]
272
+ optional :channel, String, nil?: true
273
+
274
+ # @!attribute customer_id
275
+ # The organization the link belongs to. Always the parent account, never a sender
276
+ # profile — read SenderProfileId for that.
277
+ #
278
+ # This family publishes the owner as an explicit pair rather than the single
279
+ # account_id the other families use. The pair says which organization and which
280
+ # profile without the subscriber deriving either, which is the trade: one more key
281
+ # against not having to know that account_id silently becomes the profile when one
282
+ # exists.
283
+ #
284
+ # @return [String, nil]
285
+ optional :customer_id, String
286
+
287
+ # @!attribute device
288
+ # The requesting device class: mobile, tablet, desktop or unknown. Derived from
289
+ # the user agent.
290
+ #
291
+ # @return [String, nil]
292
+ optional :device, String, nil?: true
293
+
294
+ # @!attribute link_kind
295
+ # What the link points at: url for a destination the customer supplied, file for
296
+ # media Sent hosts. Always present, and implied by the event — link.clicked is
297
+ # always url and link.downloaded always file — but published as its own field so a
298
+ # subscriber can branch on the kind without parsing the event name, the same
299
+ # separation the channel family keeps between its event and its status.
300
+ #
301
+ # @return [String, nil]
302
+ optional :link_kind, String
303
+
304
+ # @!attribute message_id
305
+ # The message the link was published in.
306
+ #
307
+ # The event can arrive before the message is readable through GET /v3/messages: a
308
+ # provider may fetch a link within milliseconds of the send, and nothing here
309
+ # waits for the message row. Retry the read rather than treating an unknown id as
310
+ # an error.
311
+ #
312
+ # @return [String, nil]
313
+ optional :message_id, String, nil?: true
314
+
315
+ # @!attribute occurred_at
316
+ # When the access or lifecycle change actually happened, in UTC
317
+ # (yyyy-MM-ddTHH:mm:ssZ). The envelope's timestamp is when Sent emitted the event;
318
+ # this is when the thing occurred, and the two differ by the ingest delay.
319
+ #
320
+ # @return [String, nil]
321
+ optional :occurred_at, String
322
+
323
+ # @!attribute reference_key
324
+ # The caller-supplied label tying this link back to a position in the message, for
325
+ # example body:0 for the first link in the body. Present when the link was created
326
+ # with one.
327
+ #
328
+ # @return [String, nil]
329
+ optional :reference_key, String, nil?: true
330
+
331
+ # @!attribute referrer_host
332
+ # The host of the page that linked here, when the request supplied one. The host
333
+ # only — never a full referring URL.
334
+ #
335
+ # @return [String, nil]
336
+ optional :referrer_host, String, nil?: true
337
+
338
+ # @!attribute request_method
339
+ # The HTTP method of the request that was served, for an access event. Omitted on
340
+ # link.expired and link.revoked, which describe no request.
341
+ #
342
+ # @return [String, nil]
343
+ optional :request_method, String, nil?: true
344
+
345
+ # @!attribute sender_profile_id
346
+ # The sender profile that owns the link, or null when the organization owns it
347
+ # directly. Always on the wire so a handler reads one shape rather than branching
348
+ # on whether the key arrived.
349
+ #
350
+ # sender_profile_id, not profile_id: the API already publishes
351
+ # messaging_profile_id and sending_phone_number_profile_id for provider-side
352
+ # profiles, which are a different thing entirely. The unqualified name would read
353
+ # as one of those.
354
+ #
355
+ # @return [String, nil]
356
+ optional :sender_profile_id, String, nil?: true
357
+
358
+ # @!attribute status_code
359
+ # The HTTP status Sent answered the request with: 302 for a link, 200 or 206 for a
360
+ # file. Omitted on lifecycle events.
361
+ #
362
+ # @return [Integer, nil]
363
+ optional :status_code, Integer, nil?: true
364
+
365
+ # @!attribute traffic_class
366
+ # A coarse guess at what made the request: likely_human, provider (a messaging
367
+ # platform prefetching the link), bot, or unknown. Derived from the user agent, so
368
+ # it is a hint for filtering noise rather than a fact to bill or report on.
369
+ #
370
+ # @return [String, nil]
371
+ optional :traffic_class, String, nil?: true
372
+
373
+ # @!method initialize(record_id:, access_country: nil, access_outcome: nil, browser: nil, bytes_served: nil, channel: nil, customer_id: nil, device: nil, link_kind: nil, message_id: nil, occurred_at: nil, reference_key: nil, referrer_host: nil, request_method: nil, sender_profile_id: nil, status_code: nil, traffic_class: nil)
374
+ # Some parameter documentations has been truncated, see
375
+ # {Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload::Payload}
376
+ # for more details.
377
+ #
378
+ # Body of a link event: something happened to a tracked link Sent published on the
379
+ # customer's behalf. A link points either at a URL the customer supplied or at a
380
+ # file Sent hosts for them; LinkKind says which. Delivered when an eligible
381
+ # request is served, or when a published link reaches the end of its life.
382
+ #
383
+ # A click is a request, not a read receipt. link.clicked means the redirect was
384
+ # served; link.downloaded means bytes went out. Neither proves a person saw
385
+ # anything — messaging providers and link scanners fetch URLs on their own, which
386
+ # is what TrafficClass exists to tell apart. Filter on it before reporting a
387
+ # click-through rate; treat likely_human as a hint, never as delivery
388
+ # confirmation.
389
+ #
390
+ # RecordId identifies the link; the X-Webhook-Event-ID header identifies the
391
+ # delivery. One link is hit many times, so those are the two keys a subscriber
392
+ # needs: group by the first, deduplicate on the second — exactly as on every other
393
+ # family. The payload carries no event identifier of its own, for the same reason
394
+ # none of the others do.
395
+ #
396
+ # Nothing here identifies the visitor. No IP address and no visitor token crosses
397
+ # this boundary. Country, Device and Browser are coarse buckets derived at the
398
+ # edge and are absent whenever the request did not supply enough to derive them.
399
+ #
400
+ # @param record_id [String] The link's public identifier — the eight-character code in the short URL, for ex
401
+ #
402
+ # @param access_country [String, nil] Where the request appeared to come from, as an ISO 3166-1 alpha-2 code. Named se
403
+ #
404
+ # @param access_outcome [String, nil] How the request was served, when the edge recorded it. Free text describing the
405
+ #
406
+ # @param browser [String, nil] The requesting browser family, for example chrome or safari, or
407
+ #
408
+ # @param bytes_served [Integer, nil] How many bytes were served, for a file access. A ranged request reports the byte
409
+ #
410
+ # @param channel [String, nil] The channel the message carrying this link went out on: sms, whatsapp, or
411
+ #
412
+ # @param customer_id [String] The organization the link belongs to. Always the parent account, never a sender
413
+ #
414
+ # @param device [String, nil] The requesting device class: mobile, tablet, desktop or
415
+ #
416
+ # @param link_kind [String] What the link points at: url for a destination the customer supplied, file for
417
+ #
418
+ # @param message_id [String, nil] The message the link was published in.
419
+ #
420
+ # @param occurred_at [String] When the access or lifecycle change actually happened, in UTC
421
+ #
422
+ # @param reference_key [String, nil] The caller-supplied label tying this link back to a position in the message, for
423
+ #
424
+ # @param referrer_host [String, nil] The host of the page that linked here, when the request supplied one. The host o
425
+ #
426
+ # @param request_method [String, nil] The HTTP method of the request that was served, for an access event. Omitted on
427
+ #
428
+ # @param sender_profile_id [String, nil] The sender profile that owns the link, or null when the organization owns it dir
429
+ #
430
+ # @param status_code [Integer, nil] The HTTP status Sent answered the request with: 302 for a link, 200 or
431
+ #
432
+ # @param traffic_class [String, nil] A coarse guess at what made the request: likely_human, provider (a messaging
433
+ end
434
+ end
435
+
121
436
  # @!method self.variants
122
- # @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent)]
437
+ # @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload)]
123
438
  end
124
439
  end
125
440
  end
@@ -13,12 +13,20 @@ module Sentdm
13
13
  # **A message needs a sender.** What you can send, where, and at what cost is
14
14
  # decided by the markets under **Channels** — so a recipient in a country you hold
15
15
  # no sender for is refused here rather than queued.
16
+ #
17
+ # **A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a
18
+ # finished message — typically one BLOCKED for insufficient balance — back through
19
+ # the send pipeline. It is a new attempt, not a free retry: every policy runs
20
+ # again, the message is billed again, and its status webhooks fire again. A
21
+ # FILTERED message is never resendable.
16
22
  class Messages
17
23
  # Some parameter documentations has been truncated, see
18
24
  # {Sentdm::Models::MessageRetrieveActivitiesParams} for more details.
19
25
  #
20
26
  # Retrieves the activity log for a specific message. Activities track the message
21
- # lifecycle including acceptance, processing, sending, delivery, and any errors.
27
+ # lifecycle including acceptance, processing, sending, delivery, and any errors. A
28
+ # SCHEDULED entry carries scheduled_at, the release instant in UTC as it stood at
29
+ # that moment. Other entries have no scheduled_at key.
22
30
  #
23
31
  # @overload retrieve_activities(id, x_profile_id: nil, request_options: {})
24
32
  #
@@ -46,7 +54,11 @@ module Sentdm
46
54
  # {Sentdm::Models::MessageRetrieveStatusParams} for more details.
47
55
  #
48
56
  # Retrieves the current status and details of a message by ID. Includes delivery
49
- # status, timestamps, and error information if applicable.
57
+ # status, timestamps, and error information if applicable. A message that is or
58
+ # was held for a later time (a send you scheduled with scheduled_at, or a
59
+ # quiet-hours hold) is returned as a ScheduledMessageResponse: the same fields
60
+ # plus scheduled_at, the release instant in UTC. A message sent immediately has no
61
+ # scheduled_at key.
50
62
  #
51
63
  # @overload retrieve_status(id, x_profile_id: nil, request_options: {})
52
64
  #
@@ -82,14 +94,30 @@ module Sentdm
82
94
  # insufficient balance, a template not approved for sending, or free-form content
83
95
  # with no open conversation with the contact. The send is accepted with 202 and
84
96
  # the affected messages are reported as BLOCKED on GET /messages/{id} and the
85
- # message.blocked webhook.
86
- #
87
- # @overload send_(channel: nil, sandbox: nil, template: nil, text: nil, to: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
97
+ # message.blocked webhook. To send later, set scheduled_at (ISO-8601 with an
98
+ # explicit UTC offset; a value without one is rejected) between 1 minute and 30
99
+ # days ahead: the response is a ScheduledSendMessageResponse (the same fields plus
100
+ # scheduled_at; status is still QUEUED), each message then moves to SCHEDULED, is
101
+ # held and released at that time (within a few minutes), and a message.scheduled
102
+ # webhook fires once it is held. Balance and template approval are evaluated at
103
+ # release, not at acceptance. Quiet hours are not checked when the request is
104
+ # accepted: if the time falls inside a legally protected quiet-hours window for a
105
+ # recipient, that message is moved to the next allowed time at release and a
106
+ # second message.scheduled webhook reports the new scheduled_at. An account may
107
+ # hold at most 1,000,000 scheduled messages at once (429 LIMIT_001).
108
+ #
109
+ # @overload send_(channel: nil, media_urls: nil, sandbox: nil, scheduled_at: nil, subject: nil, template: nil, text: nil, to: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
88
110
  #
89
111
  # @param channel [Array<String>, nil] Body param: Channels to broadcast on, e.g. ["whatsapp", "sms"].
90
112
  #
113
+ # @param media_urls [Array<String>, nil] Body param: Attachments for this send, as publicly fetchable https URLs. Used by
114
+ #
91
115
  # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
92
116
  #
117
+ # @param scheduled_at [Time, nil] Body param: Optional future send time as an ISO-8601 timestamp with an explicit
118
+ #
119
+ # @param subject [String, nil] Body param: Subject line for this send, overriding the template's. MMS only; ign
120
+ #
93
121
  # @param template [Sentdm::Models::MessageSendParams::Template, nil] Body param: SDK-style template reference: resolve by ID or by name, with optiona
94
122
  #
95
123
  # @param text [String, nil] Body param: Plain-text (free-form) message body. Provide either Template or this
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sentdm
4
- VERSION = "0.32.0"
4
+ VERSION = "0.33.0"
5
5
  end
data/lib/sentdm.rb CHANGED
@@ -58,6 +58,7 @@ require_relative "sentdm/internal/templates_page"
58
58
  require_relative "sentdm/internal/webhook_events_page"
59
59
  require_relative "sentdm/internal/webhooks_page"
60
60
  require_relative "sentdm/models/mutation_request"
61
+ require_relative "sentdm/models/template_body_content"
61
62
  require_relative "sentdm/models/api_meta"
62
63
  require_relative "sentdm/models/api_response_of_contact"
63
64
  require_relative "sentdm/models/api_response_of_contact_message_summary"
@@ -130,7 +131,6 @@ require_relative "sentdm/models/tcr_brand_relationship"
130
131
  require_relative "sentdm/models/tcr_vertical"
131
132
  require_relative "sentdm/models/template"
132
133
  require_relative "sentdm/models/template_body"
133
- require_relative "sentdm/models/template_body_content"
134
134
  require_relative "sentdm/models/template_button"
135
135
  require_relative "sentdm/models/template_button_props"
136
136
  require_relative "sentdm/models/template_create_params"
@@ -78,6 +78,12 @@ module Sentdm
78
78
  # **A message needs a sender.** What you can send, where, and at what cost is
79
79
  # decided by the markets under **Channels** — so a recipient in a country you hold
80
80
  # no sender for is refused here rather than queued.
81
+ #
82
+ # **A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a
83
+ # finished message — typically one BLOCKED for insufficient balance — back through
84
+ # the send pipeline. It is a new attempt, not a free retry: every policy runs
85
+ # again, the message is billed again, and its status webhooks fire again. A
86
+ # FILTERED message is never resendable.
81
87
  sig { returns(Sentdm::Resources::Messages) }
82
88
  attr_reader :messages
83
89