sentdm 0.32.0 → 0.34.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/client.rb +6 -0
  5. data/lib/sentdm/models/channel_event_payload.rb +154 -7
  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 +214 -6
  9. data/lib/sentdm/models/inbound_message_event_payload.rb +70 -3
  10. data/lib/sentdm/models/me_retrieve_response.rb +21 -1
  11. data/lib/sentdm/models/message_event_payload.rb +42 -1
  12. data/lib/sentdm/models/message_retrieve_activities_response.rb +42 -5
  13. data/lib/sentdm/models/message_retrieve_status_response.rb +222 -8
  14. data/lib/sentdm/models/message_send_params.rb +67 -3
  15. data/lib/sentdm/models/message_send_response.rb +13 -4
  16. data/lib/sentdm/models/template_body.rb +82 -1
  17. data/lib/sentdm/models/template_create_params.rb +11 -1
  18. data/lib/sentdm/models/template_header.rb +91 -3
  19. data/lib/sentdm/models/template_variable.rb +15 -1
  20. data/lib/sentdm/models/webhook_create_params.rb +31 -1
  21. data/lib/sentdm/models/webhook_list_events_response.rb +497 -9
  22. data/lib/sentdm/models/webhook_update_params.rb +31 -1
  23. data/lib/sentdm/resources/me.rb +5 -0
  24. data/lib/sentdm/resources/messages.rb +33 -5
  25. data/lib/sentdm/resources/templates.rb +3 -1
  26. data/lib/sentdm/resources/webhooks.rb +9 -3
  27. data/lib/sentdm/version.rb +1 -1
  28. data/lib/sentdm.rb +1 -1
  29. data/rbi/sentdm/client.rbi +6 -0
  30. data/rbi/sentdm/models/channel_event_payload.rbi +273 -10
  31. data/rbi/sentdm/models/contact_event.rbi +28 -12
  32. data/rbi/sentdm/models/contact_event_payload.rbi +118 -28
  33. data/rbi/sentdm/models/conversation_messages_list.rbi +308 -10
  34. data/rbi/sentdm/models/inbound_message_event_payload.rbi +110 -2
  35. data/rbi/sentdm/models/me_retrieve_response.rbi +35 -0
  36. data/rbi/sentdm/models/message_event_payload.rbi +50 -0
  37. data/rbi/sentdm/models/message_retrieve_activities_response.rbi +49 -5
  38. data/rbi/sentdm/models/message_retrieve_status_response.rbi +320 -12
  39. data/rbi/sentdm/models/message_send_params.rbi +100 -2
  40. data/rbi/sentdm/models/message_send_response.rbi +15 -5
  41. data/rbi/sentdm/models/template_body.rbi +133 -0
  42. data/rbi/sentdm/models/template_create_params.rbi +15 -0
  43. data/rbi/sentdm/models/template_header.rbi +143 -2
  44. data/rbi/sentdm/models/template_variable.rbi +10 -0
  45. data/rbi/sentdm/models/webhook_create_params.rbi +61 -0
  46. data/rbi/sentdm/models/webhook_list_events_response.rbi +747 -12
  47. data/rbi/sentdm/models/webhook_update_params.rbi +61 -0
  48. data/rbi/sentdm/resources/me.rbi +5 -0
  49. data/rbi/sentdm/resources/messages.rbi +58 -3
  50. data/rbi/sentdm/resources/templates.rbi +6 -0
  51. data/rbi/sentdm/resources/webhooks.rbi +15 -1
  52. data/sig/sentdm/models/channel_event_payload.rbs +62 -0
  53. data/sig/sentdm/models/contact_event_payload.rbs +24 -9
  54. data/sig/sentdm/models/conversation_messages_list.rbs +99 -6
  55. data/sig/sentdm/models/inbound_message_event_payload.rbs +37 -0
  56. data/sig/sentdm/models/me_retrieve_response.rbs +7 -0
  57. data/sig/sentdm/models/message_event_payload.rbs +20 -0
  58. data/sig/sentdm/models/message_retrieve_activities_response.rbs +15 -0
  59. data/sig/sentdm/models/message_retrieve_status_response.rbs +99 -6
  60. data/sig/sentdm/models/message_send_params.rbs +15 -0
  61. data/sig/sentdm/models/template_body.rbs +44 -0
  62. data/sig/sentdm/models/template_create_params.rbs +7 -0
  63. data/sig/sentdm/models/template_header.rbs +44 -0
  64. data/sig/sentdm/models/webhook_create_params.rbs +29 -0
  65. data/sig/sentdm/models/webhook_list_events_response.rbs +252 -0
  66. data/sig/sentdm/models/webhook_update_params.rbs +29 -0
  67. data/sig/sentdm/resources/messages.rbs +3 -0
  68. data/sig/sentdm/resources/templates.rbs +1 -0
  69. data/sig/sentdm/resources/webhooks.rbs +2 -0
  70. metadata +2 -2
@@ -67,7 +67,14 @@ module Sentdm
67
67
 
68
68
  # @!attribute message_body
69
69
  # Structured message body format for database storage. Preserves channel-specific
70
- # components (header, body, footer, buttons).
70
+ # components (header, header media, body, footer, buttons, MMS subject and media).
71
+ #
72
+ # Persisted as the messageBody jsonb column on Messages. Every write path goes
73
+ # through MessageUtils.MessageBodyJsonOptions, which writes nulls, so the envelope
74
+ # shape is stable regardless of channel or status. Anything that rebuilds this
75
+ # object field by field — the four IMessageBodyStrategy implementations and
76
+ # MessageUtils.BuildSegmentBody — has to carry every member, or that member is
77
+ # silently dropped on whichever path forgot it.
71
78
  #
72
79
  # @return [Sentdm::Models::ConversationMessagesList::Message::MessageBody, nil]
73
80
  optional :message_body, -> { Sentdm::ConversationMessagesList::Message::MessageBody }, nil?: true
@@ -87,6 +94,24 @@ module Sentdm
87
94
  # @return [Float, nil]
88
95
  optional :price, Float, nil?: true
89
96
 
97
+ # @!attribute reason
98
+ # A human-readable sentence for reason_code, for example "Insufficient balance".
99
+ # Omitted whenever reason_code is.
100
+ #
101
+ # @return [String, nil]
102
+ optional :reason, String, nil?: true
103
+
104
+ # @!attribute reason_code
105
+ # Why the message is at its current status, as a stable platform code such as
106
+ # DELIVERY_007, BUSINESS_003 or DELIVERY_003. Present when the current status is
107
+ # FAILED, FILTERED or BLOCKED and the lifecycle was loaded; omitted otherwise.
108
+ # Switch on this rather than on reason: the code is stable, the wording may be
109
+ # improved. It is the platform's classification of the outcome, never a carrier or
110
+ # vendor code.
111
+ #
112
+ # @return [String, nil]
113
+ optional :reason_code, String, nil?: true
114
+
90
115
  # @!attribute region_code
91
116
  #
92
117
  # @return [String, nil]
@@ -112,11 +137,16 @@ module Sentdm
112
137
  # @return [String, nil]
113
138
  optional :template_name, String, nil?: true
114
139
 
115
- # @!method initialize(id: nil, active_contact_price: nil, channel: nil, contact_id: nil, created_at: nil, customer_id: nil, direction: nil, events: nil, message_body: nil, phone: nil, phone_international: nil, price: nil, region_code: nil, status: nil, template_category: nil, template_id: nil, template_name: nil)
140
+ # @!method initialize(id: nil, active_contact_price: nil, channel: nil, contact_id: nil, created_at: nil, customer_id: nil, direction: nil, events: nil, message_body: nil, phone: nil, phone_international: nil, price: nil, reason: nil, reason_code: nil, region_code: nil, status: nil, template_category: nil, template_id: nil, template_name: nil)
116
141
  # Some parameter documentations has been truncated, see
117
142
  # {Sentdm::Models::ConversationMessagesList::Message} for more details.
118
143
  #
119
- # Message response for v3 API — same shape as v2 with snake_case JSON conventions
144
+ # Message response for v3 API — same shape as v2 with snake_case JSON conventions.
145
+ #
146
+ # The shape of a message that was sent immediately: it never has a scheduled_at
147
+ # key. A message that is or was held for a later instant is a
148
+ # ScheduledMessageResponse, and the endpoint decides which of the two to answer
149
+ # with. From always returns this type.
120
150
  #
121
151
  # @param id [String]
122
152
  #
@@ -142,6 +172,10 @@ module Sentdm
142
172
  #
143
173
  # @param price [Float, nil]
144
174
  #
175
+ # @param reason [String, nil] A human-readable sentence for reason_code, for example "Insufficient balance". O
176
+ #
177
+ # @param reason_code [String, nil] Why the message is at its current status, as a stable platform code such as
178
+ #
145
179
  # @param region_code [String]
146
180
  #
147
181
  # @param status [String]
@@ -168,12 +202,37 @@ module Sentdm
168
202
  # @return [String, nil]
169
203
  optional :description, String, nil?: true
170
204
 
171
- # @!method initialize(status:, timestamp:, description: nil)
205
+ # @!attribute reason
206
+ # A human-readable sentence for reason_code. Omitted whenever reason_code is.
207
+ #
208
+ # @return [String, nil]
209
+ optional :reason, String, nil?: true
210
+
211
+ # @!attribute reason_code
212
+ # Why the message reached this status, as a stable platform code such as
213
+ # DELIVERY_007. Present on FAILED, FILTERED and BLOCKED events; omitted on every
214
+ # status that needs no explanation. Same wire name and vocabulary as on the
215
+ # activities list and the webhook.
216
+ #
217
+ # @return [String, nil]
218
+ optional :reason_code, String, nil?: true
219
+
220
+ # @!method initialize(status:, timestamp:, description: nil, reason: nil, reason_code: nil)
221
+ # Some parameter documentations has been truncated, see
222
+ # {Sentdm::Models::ConversationMessagesList::Message::Event} for more details.
223
+ #
172
224
  # Represents a status change event in a message's lifecycle (v3)
173
225
  #
174
226
  # @param status [String]
227
+ #
175
228
  # @param timestamp [Time]
229
+ #
176
230
  # @param description [String, nil]
231
+ #
232
+ # @param reason [String, nil] A human-readable sentence for reason_code. Omitted whenever reason_code is.
233
+ #
234
+ # @param reason_code [String, nil] Why the message reached this status, as a stable platform code such as
235
+ # DELIVERY\_
177
236
  end
178
237
 
179
238
  # @see Sentdm::Models::ConversationMessagesList::Message#message_body
@@ -202,14 +261,65 @@ module Sentdm
202
261
  # @return [String, nil]
203
262
  optional :header, String, nil?: true
204
263
 
205
- # @!method initialize(buttons: nil, content: nil, footer: nil, header: nil)
264
+ # @!attribute header_media
265
+ # The media asset that rode a message's header, recorded as sent.
266
+ #
267
+ # @return [Sentdm::Models::ConversationMessagesList::Message::MessageBody::HeaderMedia, nil]
268
+ optional :header_media,
269
+ -> { Sentdm::ConversationMessagesList::Message::MessageBody::HeaderMedia },
270
+ api_name: :headerMedia,
271
+ nil?: true
272
+
273
+ # @!attribute media
274
+ # MMS attachments, as the publicly fetchable URLs handed to the carrier. Null on
275
+ # every other channel.
276
+ #
277
+ # Persisted rather than derived because a resend and a curfew release rebuild the
278
+ # send from the stored row — MessageReplayCommandBuilder reads templateId and
279
+ # templateVariables and nothing else — so media that lives only on the original
280
+ # request would silently turn a replayed MMS into a text message.
281
+ #
282
+ # @return [Array<Sentdm::Models::ConversationMessagesList::Message::MessageBody::Media>, nil]
283
+ optional :media,
284
+ -> {
285
+ Sentdm::Internal::Type::ArrayOf[Sentdm::ConversationMessagesList::Message::MessageBody::Media]
286
+ },
287
+ nil?: true
288
+
289
+ # @!attribute subject
290
+ # MMS subject line. Null on every other channel.
291
+ #
292
+ # @return [String, nil]
293
+ optional :subject, String, nil?: true
294
+
295
+ # @!method initialize(buttons: nil, content: nil, footer: nil, header: nil, header_media: nil, media: nil, subject: nil)
296
+ # Some parameter documentations has been truncated, see
297
+ # {Sentdm::Models::ConversationMessagesList::Message::MessageBody} for more
298
+ # details.
299
+ #
206
300
  # Structured message body format for database storage. Preserves channel-specific
207
- # components (header, body, footer, buttons).
301
+ # components (header, header media, body, footer, buttons, MMS subject and media).
302
+ #
303
+ # Persisted as the messageBody jsonb column on Messages. Every write path goes
304
+ # through MessageUtils.MessageBodyJsonOptions, which writes nulls, so the envelope
305
+ # shape is stable regardless of channel or status. Anything that rebuilds this
306
+ # object field by field — the four IMessageBodyStrategy implementations and
307
+ # MessageUtils.BuildSegmentBody — has to carry every member, or that member is
308
+ # silently dropped on whichever path forgot it.
208
309
  #
209
310
  # @param buttons [Array<Sentdm::Models::ConversationMessagesList::Message::MessageBody::Button>, nil]
311
+ #
210
312
  # @param content [String]
313
+ #
211
314
  # @param footer [String, nil]
315
+ #
212
316
  # @param header [String, nil]
317
+ #
318
+ # @param header_media [Sentdm::Models::ConversationMessagesList::Message::MessageBody::HeaderMedia, nil] The media asset that rode a message's header, recorded as sent.
319
+ #
320
+ # @param media [Array<Sentdm::Models::ConversationMessagesList::Message::MessageBody::Media>, nil] MMS attachments, as the publicly fetchable URLs handed to the carrier. Null on e
321
+ #
322
+ # @param subject [String, nil] MMS subject line. Null on every other channel.
213
323
 
214
324
  class Button < Sentdm::Internal::Type::BaseModel
215
325
  # @!attribute postback_data
@@ -238,6 +348,104 @@ module Sentdm
238
348
  # @param type [String]
239
349
  # @param value [String]
240
350
  end
351
+
352
+ # @see Sentdm::Models::ConversationMessagesList::Message::MessageBody#header_media
353
+ class HeaderMedia < Sentdm::Internal::Type::BaseModel
354
+ # @!attribute type
355
+ # "image", "video" or "document" — taken from the header's media variable.
356
+ #
357
+ # @return [String, nil]
358
+ optional :type, String
359
+
360
+ # @!attribute url
361
+ # The https URL the caller supplied for this send. Never the template's stored
362
+ # props.sample, which is Meta's expiring header_handle rather than what was
363
+ # delivered.
364
+ #
365
+ # @return [String, nil]
366
+ optional :url, String
367
+
368
+ # @!method initialize(type: nil, url: nil)
369
+ # Some parameter documentations has been truncated, see
370
+ # {Sentdm::Models::ConversationMessagesList::Message::MessageBody::HeaderMedia}
371
+ # for more details.
372
+ #
373
+ # The media asset that rode a message's header, recorded as sent.
374
+ #
375
+ # @param type [String] "image", "video" or "document" — taken from the header's media variable.
376
+ #
377
+ # @param url [String] The https URL the caller supplied for this send. Never the template's stored
378
+ end
379
+
380
+ class Media < Sentdm::Internal::Type::BaseModel
381
+ # @!attribute media_type
382
+ # One of MmsMediaTypes when the content type is known. Advisory — a reader should
383
+ # trust the fetched object's own Content-Type.
384
+ #
385
+ # @return [String, nil]
386
+ optional :media_type, String, api_name: :mediaType, nil?: true
387
+
388
+ # @!attribute mime_type
389
+ # Content type as the provider declared it. Null when it declared none.
390
+ #
391
+ # @return [String, nil]
392
+ optional :mime_type, String, api_name: :mimeType, nil?: true
393
+
394
+ # @!attribute size_bytes
395
+ # Size as the provider declared it. Never measured here — nothing downloads the
396
+ # file.
397
+ #
398
+ # @return [Integer, nil]
399
+ optional :size_bytes, Integer, api_name: :sizeBytes, nil?: true
400
+
401
+ # @!attribute source_hash_sha256
402
+ # Inbound only: the SHA-256 the provider declared alongside the attachment, when
403
+ # it declared one. Relayed to the customer so they can verify what they fetch
404
+ # matches what the carrier said it sent. It is the only integrity signal available
405
+ # on an attachment nobody here has read.
406
+ #
407
+ # @return [String, nil]
408
+ optional :source_hash_sha256, String, api_name: :sourceHashSha256, nil?: true
409
+
410
+ # @!attribute url
411
+ # Where the file lives. Outbound: the URL the customer gave us and the carrier
412
+ # fetched. Inbound: the URL the carrier hosts it at, relayed unchanged.
413
+ #
414
+ # @return [String, nil]
415
+ optional :url, String, nil?: true
416
+
417
+ # @!method initialize(media_type: nil, mime_type: nil, size_bytes: nil, source_hash_sha256: nil, url: nil)
418
+ # Some parameter documentations has been truncated, see
419
+ # {Sentdm::Models::ConversationMessagesList::Message::MessageBody::Media} for more
420
+ # details.
421
+ #
422
+ # One attachment on a message, in either direction — and in both, a URL somebody
423
+ # else hosts.
424
+ #
425
+ # Outbound: the customer supplied a public URL and we handed it to the carrier.
426
+ # Inbound: the carrier hosts the file and we record where. sent.dm never holds the
427
+ # bytes, so there is no key, no expiry bookkeeping and nothing minted per read —
428
+ # what is stored is what is served.
429
+ #
430
+ # An inbound link expires on the carrier's own schedule and is unauthenticated.
431
+ # That is the customer's to manage, and it is documented where they will see it
432
+ # rather than only here — a recipient who needs an attachment to outlive that
433
+ # window copies it on receipt.
434
+ #
435
+ # Storing a presigned URL is the specific mistake this shape still avoids:
436
+ # M260826130000 and M260826140000 exist because RCS assets were stored as signed
437
+ # URLs and went stale. Nothing here is signed.
438
+ #
439
+ # @param media_type [String, nil] One of MmsMediaTypes when the content type is known. Advisory — a reader should
440
+ #
441
+ # @param mime_type [String, nil] Content type as the provider declared it. Null when it declared none.
442
+ #
443
+ # @param size_bytes [Integer, nil] Size as the provider declared it. Never measured here — nothing downloads the fi
444
+ #
445
+ # @param source_hash_sha256 [String, nil] Inbound only: the SHA-256 the provider declared alongside the attachment, when i
446
+ #
447
+ # @param url [String, nil] Where the file lives. Outbound: the URL the customer gave us and the carrier fet
448
+ end
241
449
  end
242
450
  end
243
451
  end
@@ -22,11 +22,28 @@ module Sentdm
22
22
  optional :account_id, String
23
23
 
24
24
  # @!attribute channel
25
- # The channel the message arrived on, for example sms or whatsapp.
25
+ # The channel the message arrived on, for example sms or mms.
26
26
  #
27
27
  # @return [String, nil]
28
28
  optional :channel, String
29
29
 
30
+ # @!attribute media
31
+ # Attachments the contact sent, present only on channels that carry them (mms
32
+ # today) and omitted entirely otherwise.
33
+ #
34
+ # Each url points at the carrier's own copy of the file — sent.dm records where
35
+ # the attachment is, not the attachment itself. The link is unauthenticated and
36
+ # expires on the carrier's schedule, which differs between them: assume days, not
37
+ # months. Download what you need on receipt; re-reading the message through GET
38
+ # /v3/messages/{id} returns the same stored link, not a fresh one, so once it
39
+ # lapses the entry remains with whatever the carrier declared about the file but
40
+ # the file is no longer reachable.
41
+ #
42
+ # @return [Array<Sentdm::Models::InboundMessageEventPayload::Media>, nil]
43
+ optional :media,
44
+ -> { Sentdm::Internal::Type::ArrayOf[Sentdm::InboundMessageEventPayload::Media] },
45
+ nil?: true
46
+
30
47
  # @!attribute message_id
31
48
  # The inbound message.
32
49
  #
@@ -54,7 +71,7 @@ module Sentdm
54
71
  # @return [String, nil]
55
72
  optional :updated_at, String
56
73
 
57
- # @!method initialize(inbound_number:, received_at:, account_id: nil, channel: nil, message_id: nil, outbound_number: nil, text: nil, updated_at: nil)
74
+ # @!method initialize(inbound_number:, received_at:, account_id: nil, channel: nil, media: nil, message_id: nil, outbound_number: nil, text: nil, updated_at: nil)
58
75
  # Some parameter documentations has been truncated, see
59
76
  # {Sentdm::Models::InboundMessageEventPayload} for more details.
60
77
  #
@@ -67,7 +84,9 @@ module Sentdm
67
84
  #
68
85
  # @param account_id [String] The account the message belongs to.
69
86
  #
70
- # @param channel [String] The channel the message arrived on, for example sms or whatsapp.
87
+ # @param channel [String] The channel the message arrived on, for example sms or mms.
88
+ #
89
+ # @param media [Array<Sentdm::Models::InboundMessageEventPayload::Media>, nil] Attachments the contact sent, present only on channels that carry them (mms toda
71
90
  #
72
91
  # @param message_id [String] The inbound message.
73
92
  #
@@ -76,6 +95,54 @@ module Sentdm
76
95
  # @param text [String, nil] The message body. Sent as null when the inbound message carried no text, for
77
96
  #
78
97
  # @param updated_at [String] When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ). Same value as
98
+
99
+ class Media < Sentdm::Internal::Type::BaseModel
100
+ # @!attribute hash_sha256
101
+ # SHA-256 of the file as the carrier declared it, when it declares one. Verify
102
+ # what you download against this — sent.dm never reads the bytes, so it is the
103
+ # only integrity signal available.
104
+ #
105
+ # @return [String, nil]
106
+ optional :hash_sha256, String, nil?: true
107
+
108
+ # @!attribute mime_type
109
+ # Content type as the carrier reported it, for example image/jpeg.
110
+ #
111
+ # @return [String, nil]
112
+ optional :mime_type, String, nil?: true
113
+
114
+ # @!attribute size_bytes
115
+ # Size in bytes as the carrier declared it. Absent when it declared none.
116
+ #
117
+ # @return [Integer, nil]
118
+ optional :size_bytes, Integer, nil?: true
119
+
120
+ # @!attribute url
121
+ # Where the carrier hosts the attachment.
122
+ #
123
+ # This link expires and is not authenticated. sent.dm relays it rather than
124
+ # copying the file, so how long it stays fetchable is the carrier's decision and
125
+ # differs between them — assume days, not months. Anyone holding the URL can fetch
126
+ # it until it lapses. Copy the file on receipt if you need it to outlive that
127
+ # window; do not store this URL as a permanent reference.
128
+ #
129
+ # @return [String, nil]
130
+ optional :url, String, nil?: true
131
+
132
+ # @!method initialize(hash_sha256: nil, mime_type: nil, size_bytes: nil, url: nil)
133
+ # Some parameter documentations has been truncated, see
134
+ # {Sentdm::Models::InboundMessageEventPayload::Media} for more details.
135
+ #
136
+ # One attachment on an inbound message.
137
+ #
138
+ # @param hash_sha256 [String, nil] SHA-256 of the file as the carrier declared it, when it declares one. Verify wha
139
+ #
140
+ # @param mime_type [String, nil] Content type as the carrier reported it, for example image/jpeg.
141
+ #
142
+ # @param size_bytes [Integer, nil] Size in bytes as the carrier declared it. Absent when it declared none.
143
+ #
144
+ # @param url [String, nil] Where the carrier hosts the attachment.
145
+ end
79
146
  end
80
147
  end
81
148
  end
@@ -77,6 +77,24 @@ module Sentdm
77
77
  # @return [String, nil]
78
78
  optional :email, String, nil?: true
79
79
 
80
+ # @!attribute enable_template_auto_creation_for_sp
81
+ # Whether this account may mark a template for automatic creation on its sender
82
+ # profiles. Granted by Sent per account and off by default, so it is what a
83
+ # template-create form reads to decide whether to offer the option at all —
84
+ # marking a template without it does nothing.
85
+ #
86
+ # Top-level rather than inside settings, which is written for type: "profile" only
87
+ # and so would never carry it to the account type that can act on it.
88
+ #
89
+ # This is the capability, not the stored flag: a profile reports false whatever
90
+ # its own row holds. A sender profile owns no sender profiles, so a template it
91
+ # marked would have nothing to be created on and the fan-out would never read the
92
+ # flag. The admin GET /customers/{id} reports the stored value instead, because
93
+ # that is the one an operator granted.
94
+ #
95
+ # @return [Boolean, nil]
96
+ optional :enable_template_auto_creation_for_sp, Sentdm::Internal::Type::Boolean
97
+
80
98
  # @!attribute icon
81
99
  # Account icon URL
82
100
  #
@@ -155,7 +173,7 @@ module Sentdm
155
173
  # @return [String, nil]
156
174
  optional :type, String
157
175
 
158
- # @!method initialize(id: nil, channels: nil, created_at: nil, description: nil, email: nil, icon: nil, name: nil, organization_id: nil, profiles: nil, sending_phone_number: nil, sending_phone_number_profile_id: nil, settings: nil, short_name: nil, status: nil, type: nil)
176
+ # @!method initialize(id: nil, channels: nil, created_at: nil, description: nil, email: nil, enable_template_auto_creation_for_sp: nil, icon: nil, name: nil, organization_id: nil, profiles: nil, sending_phone_number: nil, sending_phone_number_profile_id: nil, settings: nil, short_name: nil, status: nil, type: nil)
159
177
  # Some parameter documentations has been truncated, see
160
178
  # {Sentdm::Models::MeRetrieveResponse::Data} for more details.
161
179
  #
@@ -173,6 +191,8 @@ module Sentdm
173
191
  #
174
192
  # @param email [String, nil] Contact email address
175
193
  #
194
+ # @param enable_template_auto_creation_for_sp [Boolean] Whether this account may mark a template for automatic creation on its sender pr
195
+ #
176
196
  # @param icon [String, nil] Account icon URL
177
197
  #
178
198
  # @param name [String] Account name
@@ -51,6 +51,39 @@ module Sentdm
51
51
  # @return [String, nil]
52
52
  optional :outbound_number, String
53
53
 
54
+ # @!attribute reason
55
+ # A human-readable sentence for ReasonCode, for example "The recipient is not
56
+ # registered on this channel". Omitted whenever reason_code is.
57
+ #
58
+ # @return [String, nil]
59
+ optional :reason, String, nil?: true
60
+
61
+ # @!attribute reason_code
62
+ # Why the message reached this status, as a stable platform code such as
63
+ # DELIVERY_007 or BUSINESS_003. Present on message.failed, message.filtered and
64
+ # message.blocked; omitted on every status that needs no explanation. Switch on
65
+ # this rather than on Reason: the code is stable, the wording may be improved. It
66
+ # is the platform's classification of the outcome and never a carrier or vendor
67
+ # code.
68
+ #
69
+ # @return [String, nil]
70
+ optional :reason_code, String, nil?: true
71
+
72
+ # @!attribute schedule_reason
73
+ # message.scheduled only: why the message is held, either because you scheduled it
74
+ # or because the recipient is inside a protected quiet-hours window. Omitted on
75
+ # every other event.
76
+ #
77
+ # @return [String, nil]
78
+ optional :schedule_reason, String, nil?: true
79
+
80
+ # @!attribute scheduled_at
81
+ # message.scheduled only: when the held message will be released for delivery, in
82
+ # UTC (yyyy-MM-ddTHH:mm:ssZ). Omitted on every other event.
83
+ #
84
+ # @return [String, nil]
85
+ optional :scheduled_at, String, nil?: true
86
+
54
87
  # @!attribute template_id
55
88
  # The template the message was sent from, when it was sent from one.
56
89
  #
@@ -70,7 +103,7 @@ module Sentdm
70
103
  # @return [String, nil]
71
104
  optional :updated_at, String
72
105
 
73
- # @!method initialize(message_status:, account_id: nil, agent_id: nil, body: nil, channel: nil, message_id: nil, outbound_number: nil, template_id: nil, template_name: nil, updated_at: nil)
106
+ # @!method initialize(message_status:, account_id: nil, agent_id: nil, body: nil, channel: nil, message_id: nil, outbound_number: nil, reason: nil, reason_code: nil, schedule_reason: nil, scheduled_at: nil, template_id: nil, template_name: nil, updated_at: nil)
74
107
  # Some parameter documentations has been truncated, see
75
108
  # {Sentdm::Models::MessageEventPayload} for more details.
76
109
  #
@@ -92,6 +125,14 @@ module Sentdm
92
125
  #
93
126
  # @param outbound_number [String] The recipient's number in E.164 format.
94
127
  #
128
+ # @param reason [String, nil] A human-readable sentence for ReasonCode, for example "The recipient is not regi
129
+ #
130
+ # @param reason_code [String, nil] Why the message reached this status, as a stable platform code such as
131
+ #
132
+ # @param schedule_reason [String, nil] message.scheduled only: why the message is held, either because you scheduled it
133
+ #
134
+ # @param scheduled_at [String, nil] message.scheduled only: when the held message will be released for delivery, in
135
+ #
95
136
  # @param template_id [String, nil] The template the message was sent from, when it was sent from one.
96
137
  #
97
138
  # @param template_name [String, nil] Name of the template the message was sent from. Omitted when the message wasn't
@@ -98,9 +98,35 @@ module Sentdm
98
98
  # @return [String, nil]
99
99
  optional :price, String, nil?: true
100
100
 
101
+ # @!attribute reason
102
+ # A human-readable sentence for reason_code, for example "The recipient is not
103
+ # registered on this channel" Omitted whenever reason_code is.
104
+ #
105
+ # @return [String, nil]
106
+ optional :reason, String, nil?: true
107
+
108
+ # @!attribute reason_code
109
+ # Why the message reached this status, as a stable platform code such as
110
+ # DELIVERY_007 or BUSINESS_003. Present on FAILED, FILTERED and BLOCKED
111
+ # activities; omitted on every status that needs no explanation. Switch on this
112
+ # rather than on reason: the code is stable, the wording may be improved. Same
113
+ # wire name and vocabulary as on the message and the webhook.
114
+ #
115
+ # @return [String, nil]
116
+ optional :reason_code, String, nil?: true
117
+
118
+ # @!attribute scheduled_at
119
+ # SCHEDULED activities only: when the held message will be released for delivery,
120
+ # in UTC. Same wire name as on the send response, the message and the webhook.
121
+ # Omitted on every other activity. A message that quiet hours moved at release has
122
+ # two SCHEDULED entries, each carrying the instant as it stood at that moment.
123
+ #
124
+ # @return [Time, nil]
125
+ optional :scheduled_at, Time, nil?: true
126
+
101
127
  # @!attribute status
102
- # Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SENT, DELIVERED, READ,
103
- # FAILED. Inbound (from contact): RECEIVED (terminal).
128
+ # Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SCHEDULED, SENT,
129
+ # DELIVERED, READ, FAILED. Inbound (from contact): RECEIVED (terminal).
104
130
  #
105
131
  # @return [String, nil]
106
132
  optional :status, String
@@ -111,12 +137,16 @@ module Sentdm
111
137
  # @return [Time, nil]
112
138
  optional :timestamp, Time
113
139
 
114
- # @!method initialize(active_contact_price: nil, description: nil, from: nil, price: nil, status: nil, timestamp: nil)
140
+ # @!method initialize(active_contact_price: nil, description: nil, from: nil, price: nil, reason: nil, reason_code: nil, scheduled_at: nil, status: nil, timestamp: nil)
115
141
  # Some parameter documentations has been truncated, see
116
142
  # {Sentdm::Models::MessageRetrieveActivitiesResponse::Data::Activity} for more
117
143
  # details.
118
144
  #
119
- # A single message activity event for v3 API
145
+ # A single message activity event for v3 API.
146
+ #
147
+ # The activity list mixes statuses, so unlike a message it is one shape rather
148
+ # than two: a SCHEDULED entry carries scheduled_at, and every other entry has no
149
+ # such key.
120
150
  #
121
151
  # @param active_contact_price [String, nil] Active contact markup applied on top of the channel cost, formatted to 4 decimal
122
152
  #
@@ -126,7 +156,14 @@ module Sentdm
126
156
  #
127
157
  # @param price [String, nil] Channel cost for this activity (e.g., SMS/WhatsApp provider cost), formatted to
128
158
  #
129
- # @param status [String] Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SENT, DELIVERED, READ, FAI
159
+ # @param reason [String, nil] A human-readable sentence for reason_code, for example "The recipient is not reg
160
+ #
161
+ # @param reason_code [String, nil] Why the message reached this status, as a stable platform code such as
162
+ # DELIVERY\_
163
+ #
164
+ # @param scheduled_at [Time, nil] SCHEDULED activities only: when the held message will be released for delivery,
165
+ #
166
+ # @param status [String] Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SCHEDULED, SENT, DELIVERED
130
167
  #
131
168
  # @param timestamp [Time] When this activity occurred
132
169
  end