sentdm 0.31.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/sentdm/client.rb +6 -0
- data/lib/sentdm/models/channel_event.rb +78 -0
- data/lib/sentdm/models/channel_event_payload.rb +265 -0
- data/lib/sentdm/models/contact_event.rb +77 -0
- data/lib/sentdm/models/contact_event_payload.rb +172 -0
- data/lib/sentdm/models/conversation_messages_list.rb +125 -4
- data/lib/sentdm/models/inbound_message_event.rb +16 -8
- data/lib/sentdm/models/message_event.rb +16 -8
- data/lib/sentdm/models/message_event_payload.rb +30 -1
- data/lib/sentdm/models/message_retrieve_activities_response.rb +20 -5
- data/lib/sentdm/models/message_retrieve_status_response.rb +133 -6
- data/lib/sentdm/models/message_send_params.rb +67 -3
- data/lib/sentdm/models/message_send_response.rb +13 -4
- data/lib/sentdm/models/template.rb +36 -5
- data/lib/sentdm/models/template_body.rb +102 -12
- data/lib/sentdm/models/template_body_content.rb +35 -3
- data/lib/sentdm/models/template_button.rb +8 -2
- data/lib/sentdm/models/template_button_props.rb +12 -1
- data/lib/sentdm/models/template_definition.rb +14 -2
- data/lib/sentdm/models/template_event.rb +16 -8
- data/lib/sentdm/models/template_event_payload.rb +31 -4
- data/lib/sentdm/models/template_header.rb +91 -3
- data/lib/sentdm/models/template_variable.rb +35 -4
- data/lib/sentdm/models/webhook_list_events_response.rb +332 -9
- data/lib/sentdm/models.rb +8 -0
- data/lib/sentdm/resources/messages.rb +33 -5
- data/lib/sentdm/resources/templates.rb +28 -2
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +5 -1
- data/rbi/sentdm/client.rbi +6 -0
- data/rbi/sentdm/models/channel_event.rbi +128 -0
- data/rbi/sentdm/models/channel_event_payload.rbi +440 -0
- data/rbi/sentdm/models/contact_event.rbi +126 -0
- data/rbi/sentdm/models/contact_event_payload.rbi +254 -0
- data/rbi/sentdm/models/conversation_messages_list.rbi +202 -7
- data/rbi/sentdm/models/inbound_message_event.rbi +18 -10
- data/rbi/sentdm/models/message_event.rbi +18 -10
- data/rbi/sentdm/models/message_event_payload.rbi +34 -0
- data/rbi/sentdm/models/message_retrieve_activities_response.rbi +23 -5
- data/rbi/sentdm/models/message_retrieve_status_response.rbi +214 -9
- data/rbi/sentdm/models/message_send_params.rbi +100 -2
- data/rbi/sentdm/models/message_send_response.rbi +15 -5
- data/rbi/sentdm/models/template.rbi +58 -4
- data/rbi/sentdm/models/template_body.rbi +155 -13
- data/rbi/sentdm/models/template_body_content.rbi +59 -1
- data/rbi/sentdm/models/template_button.rbi +14 -2
- data/rbi/sentdm/models/template_button_props.rbi +22 -0
- data/rbi/sentdm/models/template_definition.rbi +20 -2
- data/rbi/sentdm/models/template_event.rbi +18 -10
- data/rbi/sentdm/models/template_event_payload.rbi +51 -8
- data/rbi/sentdm/models/template_header.rbi +143 -2
- data/rbi/sentdm/models/template_variable.rbi +38 -1
- data/rbi/sentdm/models/webhook_list_events_response.rbi +484 -12
- data/rbi/sentdm/models.rbi +8 -0
- data/rbi/sentdm/resources/messages.rbi +58 -3
- data/rbi/sentdm/resources/templates.rbi +28 -2
- data/sig/sentdm/models/channel_event.rbs +44 -0
- data/sig/sentdm/models/channel_event_payload.rbs +120 -0
- data/sig/sentdm/models/contact_event.rbs +44 -0
- data/sig/sentdm/models/contact_event_payload.rbs +78 -0
- data/sig/sentdm/models/conversation_messages_list.rbs +48 -3
- data/sig/sentdm/models/inbound_message_event.rbs +5 -0
- data/sig/sentdm/models/message_event.rbs +5 -0
- data/sig/sentdm/models/message_event_payload.rbs +15 -0
- data/sig/sentdm/models/message_retrieve_activities_response.rbs +5 -0
- data/sig/sentdm/models/message_retrieve_status_response.rbs +48 -3
- data/sig/sentdm/models/message_send_params.rbs +15 -0
- data/sig/sentdm/models/template.rbs +5 -0
- data/sig/sentdm/models/template_body.rbs +44 -0
- data/sig/sentdm/models/template_event.rbs +5 -0
- data/sig/sentdm/models/template_event_payload.rbs +9 -6
- data/sig/sentdm/models/template_header.rbs +44 -0
- data/sig/sentdm/models/webhook_list_events_response.rbs +147 -0
- data/sig/sentdm/models.rbs +8 -0
- data/sig/sentdm/resources/messages.rbs +3 -0
- metadata +14 -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
|
|
@@ -116,7 +123,12 @@ module Sentdm
|
|
|
116
123
|
# Some parameter documentations has been truncated, see
|
|
117
124
|
# {Sentdm::Models::ConversationMessagesList::Message} for more details.
|
|
118
125
|
#
|
|
119
|
-
# Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
126
|
+
# Message response for v3 API — same shape as v2 with snake_case JSON conventions.
|
|
127
|
+
#
|
|
128
|
+
# The shape of a message that was sent immediately: it never has a scheduled_at
|
|
129
|
+
# key. A message that is or was held for a later instant is a
|
|
130
|
+
# ScheduledMessageResponse, and the endpoint decides which of the two to answer
|
|
131
|
+
# with. From always returns this type.
|
|
120
132
|
#
|
|
121
133
|
# @param id [String]
|
|
122
134
|
#
|
|
@@ -202,14 +214,65 @@ module Sentdm
|
|
|
202
214
|
# @return [String, nil]
|
|
203
215
|
optional :header, String, nil?: true
|
|
204
216
|
|
|
205
|
-
# @!
|
|
217
|
+
# @!attribute header_media
|
|
218
|
+
# The media asset that rode a message's header, recorded as sent.
|
|
219
|
+
#
|
|
220
|
+
# @return [Sentdm::Models::ConversationMessagesList::Message::MessageBody::HeaderMedia, nil]
|
|
221
|
+
optional :header_media,
|
|
222
|
+
-> { Sentdm::ConversationMessagesList::Message::MessageBody::HeaderMedia },
|
|
223
|
+
api_name: :headerMedia,
|
|
224
|
+
nil?: true
|
|
225
|
+
|
|
226
|
+
# @!attribute media
|
|
227
|
+
# MMS attachments, as the publicly fetchable URLs handed to the carrier. Null on
|
|
228
|
+
# every other channel.
|
|
229
|
+
#
|
|
230
|
+
# Persisted rather than derived because a resend and a curfew release rebuild the
|
|
231
|
+
# send from the stored row — MessageReplayCommandBuilder reads templateId and
|
|
232
|
+
# templateVariables and nothing else — so media that lives only on the original
|
|
233
|
+
# request would silently turn a replayed MMS into a text message.
|
|
234
|
+
#
|
|
235
|
+
# @return [Array<Sentdm::Models::ConversationMessagesList::Message::MessageBody::Media>, nil]
|
|
236
|
+
optional :media,
|
|
237
|
+
-> {
|
|
238
|
+
Sentdm::Internal::Type::ArrayOf[Sentdm::ConversationMessagesList::Message::MessageBody::Media]
|
|
239
|
+
},
|
|
240
|
+
nil?: true
|
|
241
|
+
|
|
242
|
+
# @!attribute subject
|
|
243
|
+
# MMS subject line. Null on every other channel.
|
|
244
|
+
#
|
|
245
|
+
# @return [String, nil]
|
|
246
|
+
optional :subject, String, nil?: true
|
|
247
|
+
|
|
248
|
+
# @!method initialize(buttons: nil, content: nil, footer: nil, header: nil, header_media: nil, media: nil, subject: nil)
|
|
249
|
+
# Some parameter documentations has been truncated, see
|
|
250
|
+
# {Sentdm::Models::ConversationMessagesList::Message::MessageBody} for more
|
|
251
|
+
# details.
|
|
252
|
+
#
|
|
206
253
|
# Structured message body format for database storage. Preserves channel-specific
|
|
207
|
-
# components (header, body, footer, buttons).
|
|
254
|
+
# components (header, header media, body, footer, buttons, MMS subject and media).
|
|
255
|
+
#
|
|
256
|
+
# Persisted as the messageBody jsonb column on Messages. Every write path goes
|
|
257
|
+
# through MessageUtils.MessageBodyJsonOptions, which writes nulls, so the envelope
|
|
258
|
+
# shape is stable regardless of channel or status. Anything that rebuilds this
|
|
259
|
+
# object field by field — the four IMessageBodyStrategy implementations and
|
|
260
|
+
# MessageUtils.BuildSegmentBody — has to carry every member, or that member is
|
|
261
|
+
# silently dropped on whichever path forgot it.
|
|
208
262
|
#
|
|
209
263
|
# @param buttons [Array<Sentdm::Models::ConversationMessagesList::Message::MessageBody::Button>, nil]
|
|
264
|
+
#
|
|
210
265
|
# @param content [String]
|
|
266
|
+
#
|
|
211
267
|
# @param footer [String, nil]
|
|
268
|
+
#
|
|
212
269
|
# @param header [String, nil]
|
|
270
|
+
#
|
|
271
|
+
# @param header_media [Sentdm::Models::ConversationMessagesList::Message::MessageBody::HeaderMedia, nil] The media asset that rode a message's header, recorded as sent.
|
|
272
|
+
#
|
|
273
|
+
# @param media [Array<Sentdm::Models::ConversationMessagesList::Message::MessageBody::Media>, nil] MMS attachments, as the publicly fetchable URLs handed to the carrier. Null on e
|
|
274
|
+
#
|
|
275
|
+
# @param subject [String, nil] MMS subject line. Null on every other channel.
|
|
213
276
|
|
|
214
277
|
class Button < Sentdm::Internal::Type::BaseModel
|
|
215
278
|
# @!attribute postback_data
|
|
@@ -238,6 +301,64 @@ module Sentdm
|
|
|
238
301
|
# @param type [String]
|
|
239
302
|
# @param value [String]
|
|
240
303
|
end
|
|
304
|
+
|
|
305
|
+
# @see Sentdm::Models::ConversationMessagesList::Message::MessageBody#header_media
|
|
306
|
+
class HeaderMedia < Sentdm::Internal::Type::BaseModel
|
|
307
|
+
# @!attribute type
|
|
308
|
+
# "image", "video" or "document" — taken from the header's media variable.
|
|
309
|
+
#
|
|
310
|
+
# @return [String, nil]
|
|
311
|
+
optional :type, String
|
|
312
|
+
|
|
313
|
+
# @!attribute url
|
|
314
|
+
# The https URL the caller supplied for this send. Never the template's stored
|
|
315
|
+
# props.sample, which is Meta's expiring header_handle rather than what was
|
|
316
|
+
# delivered.
|
|
317
|
+
#
|
|
318
|
+
# @return [String, nil]
|
|
319
|
+
optional :url, String
|
|
320
|
+
|
|
321
|
+
# @!method initialize(type: nil, url: nil)
|
|
322
|
+
# Some parameter documentations has been truncated, see
|
|
323
|
+
# {Sentdm::Models::ConversationMessagesList::Message::MessageBody::HeaderMedia}
|
|
324
|
+
# for more details.
|
|
325
|
+
#
|
|
326
|
+
# The media asset that rode a message's header, recorded as sent.
|
|
327
|
+
#
|
|
328
|
+
# @param type [String] "image", "video" or "document" — taken from the header's media variable.
|
|
329
|
+
#
|
|
330
|
+
# @param url [String] The https URL the caller supplied for this send. Never the template's stored
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
class Media < Sentdm::Internal::Type::BaseModel
|
|
334
|
+
# @!attribute media_type
|
|
335
|
+
# One of Constants.MmsMediaTypes when known. Advisory — the carrier reads the
|
|
336
|
+
# fetched object's Content-Type, not this.
|
|
337
|
+
#
|
|
338
|
+
# @return [String, nil]
|
|
339
|
+
optional :media_type, String, api_name: :mediaType, nil?: true
|
|
340
|
+
|
|
341
|
+
# @!attribute url
|
|
342
|
+
#
|
|
343
|
+
# @return [String, nil]
|
|
344
|
+
optional :url, String
|
|
345
|
+
|
|
346
|
+
# @!method initialize(media_type: nil, url: nil)
|
|
347
|
+
# Some parameter documentations has been truncated, see
|
|
348
|
+
# {Sentdm::Models::ConversationMessagesList::Message::MessageBody::Media} for more
|
|
349
|
+
# details.
|
|
350
|
+
#
|
|
351
|
+
# One attachment on a message: a customer-supplied public URL handed to the
|
|
352
|
+
# carrier as-is.
|
|
353
|
+
#
|
|
354
|
+
# A URL and nothing else. sent.dm never takes custody of MMS media — the customer hosts it and we
|
|
355
|
+
# pass the link through at send time — so there is no storage key, size or expiry to record. If we ever
|
|
356
|
+
# do host attachments, that belongs with the change that introduces the hosting, not here.
|
|
357
|
+
#
|
|
358
|
+
# @param media_type [String, nil] One of Constants.MmsMediaTypes when known. Advisory — the carrier reads the
|
|
359
|
+
#
|
|
360
|
+
# @param url [String]
|
|
361
|
+
end
|
|
241
362
|
end
|
|
242
363
|
end
|
|
243
364
|
end
|
|
@@ -4,16 +4,16 @@ module Sentdm
|
|
|
4
4
|
module Models
|
|
5
5
|
class InboundMessageEvent < Sentdm::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute event
|
|
7
|
-
# The specific event within the family, for example message.delivered
|
|
8
|
-
# message.received. Absent on events that have no subtype, so
|
|
9
|
-
# optional.
|
|
7
|
+
# The specific event within the family, for example message.delivered,
|
|
8
|
+
# message.received or contact.opt_out. Absent on events that have no subtype, so
|
|
9
|
+
# treat it as optional.
|
|
10
10
|
#
|
|
11
11
|
# @return [String, nil]
|
|
12
12
|
optional :event, String, nil?: true
|
|
13
13
|
|
|
14
14
|
# @!attribute field
|
|
15
|
-
# The event family, for example message or
|
|
16
|
-
# event for the specific change.
|
|
15
|
+
# The event family, for example message, templates or contact. Route on this
|
|
16
|
+
# first, then on event for the specific change.
|
|
17
17
|
#
|
|
18
18
|
# @return [String, nil]
|
|
19
19
|
optional :field, String
|
|
@@ -25,6 +25,12 @@ module Sentdm
|
|
|
25
25
|
# @return [Sentdm::Models::InboundMessageEventPayload, nil]
|
|
26
26
|
optional :payload, -> { Sentdm::InboundMessageEventPayload }, nil?: true
|
|
27
27
|
|
|
28
|
+
# @!attribute request_id
|
|
29
|
+
# The event-specific body.
|
|
30
|
+
#
|
|
31
|
+
# @return [String, nil]
|
|
32
|
+
optional :request_id, String, nil?: true
|
|
33
|
+
|
|
28
34
|
# @!attribute timestamp
|
|
29
35
|
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
30
36
|
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
@@ -33,19 +39,21 @@ module Sentdm
|
|
|
33
39
|
# @return [String, nil]
|
|
34
40
|
optional :timestamp, String
|
|
35
41
|
|
|
36
|
-
# @!method initialize(event: nil, field: nil, payload: nil, timestamp: nil)
|
|
42
|
+
# @!method initialize(event: nil, field: nil, payload: nil, request_id: nil, timestamp: nil)
|
|
37
43
|
# Some parameter documentations has been truncated, see
|
|
38
44
|
# {Sentdm::Models::InboundMessageEvent} for more details.
|
|
39
45
|
#
|
|
40
46
|
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
41
47
|
# this shape and varies only in Payload.
|
|
42
48
|
#
|
|
43
|
-
# @param event [String, nil] The specific event within the family, for example message.delivered
|
|
49
|
+
# @param event [String, nil] The specific event within the family, for example message.delivered,
|
|
44
50
|
#
|
|
45
|
-
# @param field [String] The event family, for example message or
|
|
51
|
+
# @param field [String] The event family, for example message, templates or contact. Route on
|
|
46
52
|
#
|
|
47
53
|
# @param payload [Sentdm::Models::InboundMessageEventPayload, nil] Body of a message.received event. Delivered when a contact messages one of your
|
|
48
54
|
#
|
|
55
|
+
# @param request_id [String, nil] The event-specific body.
|
|
56
|
+
#
|
|
49
57
|
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
50
58
|
end
|
|
51
59
|
end
|
|
@@ -4,16 +4,16 @@ module Sentdm
|
|
|
4
4
|
module Models
|
|
5
5
|
class MessageEvent < Sentdm::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute event
|
|
7
|
-
# The specific event within the family, for example message.delivered
|
|
8
|
-
# message.received. Absent on events that have no subtype, so
|
|
9
|
-
# optional.
|
|
7
|
+
# The specific event within the family, for example message.delivered,
|
|
8
|
+
# message.received or contact.opt_out. Absent on events that have no subtype, so
|
|
9
|
+
# treat it as optional.
|
|
10
10
|
#
|
|
11
11
|
# @return [String, nil]
|
|
12
12
|
optional :event, String, nil?: true
|
|
13
13
|
|
|
14
14
|
# @!attribute field
|
|
15
|
-
# The event family, for example message or
|
|
16
|
-
# event for the specific change.
|
|
15
|
+
# The event family, for example message, templates or contact. Route on this
|
|
16
|
+
# first, then on event for the specific change.
|
|
17
17
|
#
|
|
18
18
|
# @return [String, nil]
|
|
19
19
|
optional :field, String
|
|
@@ -26,6 +26,12 @@ module Sentdm
|
|
|
26
26
|
# @return [Sentdm::Models::MessageEventPayload, nil]
|
|
27
27
|
optional :payload, -> { Sentdm::MessageEventPayload }, nil?: true
|
|
28
28
|
|
|
29
|
+
# @!attribute request_id
|
|
30
|
+
# The event-specific body.
|
|
31
|
+
#
|
|
32
|
+
# @return [String, nil]
|
|
33
|
+
optional :request_id, String, nil?: true
|
|
34
|
+
|
|
29
35
|
# @!attribute timestamp
|
|
30
36
|
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
31
37
|
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
@@ -34,19 +40,21 @@ module Sentdm
|
|
|
34
40
|
# @return [String, nil]
|
|
35
41
|
optional :timestamp, String
|
|
36
42
|
|
|
37
|
-
# @!method initialize(event: nil, field: nil, payload: nil, timestamp: nil)
|
|
43
|
+
# @!method initialize(event: nil, field: nil, payload: nil, request_id: nil, timestamp: nil)
|
|
38
44
|
# Some parameter documentations has been truncated, see
|
|
39
45
|
# {Sentdm::Models::MessageEvent} for more details.
|
|
40
46
|
#
|
|
41
47
|
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
42
48
|
# this shape and varies only in Payload.
|
|
43
49
|
#
|
|
44
|
-
# @param event [String, nil] The specific event within the family, for example message.delivered
|
|
50
|
+
# @param event [String, nil] The specific event within the family, for example message.delivered,
|
|
45
51
|
#
|
|
46
|
-
# @param field [String] The event family, for example message or
|
|
52
|
+
# @param field [String] The event family, for example message, templates or contact. Route on
|
|
47
53
|
#
|
|
48
54
|
# @param payload [Sentdm::Models::MessageEventPayload, nil] Body of an outbound message lifecycle event. Delivered once per status change, s
|
|
49
55
|
#
|
|
56
|
+
# @param request_id [String, nil] The event-specific body.
|
|
57
|
+
#
|
|
50
58
|
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
51
59
|
end
|
|
52
60
|
end
|
|
@@ -23,6 +23,14 @@ module Sentdm
|
|
|
23
23
|
# @return [String, nil]
|
|
24
24
|
optional :agent_id, String, nil?: true
|
|
25
25
|
|
|
26
|
+
# @!attribute body
|
|
27
|
+
# The rendered message body, as plain text. Sent as null when we aren't asserting
|
|
28
|
+
# a body for this event. The field is always present, so read it and check for
|
|
29
|
+
# null rather than checking whether the key exists. Truncated to 3072 characters.
|
|
30
|
+
#
|
|
31
|
+
# @return [String, nil]
|
|
32
|
+
optional :body, String, nil?: true
|
|
33
|
+
|
|
26
34
|
# @!attribute channel
|
|
27
35
|
# The channel the message went out on, for example sms or whatsapp. A message that
|
|
28
36
|
# falls back to another channel reports the channel actually used.
|
|
@@ -43,6 +51,21 @@ module Sentdm
|
|
|
43
51
|
# @return [String, nil]
|
|
44
52
|
optional :outbound_number, String
|
|
45
53
|
|
|
54
|
+
# @!attribute schedule_reason
|
|
55
|
+
# message.scheduled only: why the message is held, either because you scheduled it
|
|
56
|
+
# or because the recipient is inside a protected quiet-hours window. Omitted on
|
|
57
|
+
# every other event.
|
|
58
|
+
#
|
|
59
|
+
# @return [String, nil]
|
|
60
|
+
optional :schedule_reason, String, nil?: true
|
|
61
|
+
|
|
62
|
+
# @!attribute scheduled_at
|
|
63
|
+
# message.scheduled only: when the held message will be released for delivery, in
|
|
64
|
+
# UTC (yyyy-MM-ddTHH:mm:ssZ). Omitted on every other event.
|
|
65
|
+
#
|
|
66
|
+
# @return [String, nil]
|
|
67
|
+
optional :scheduled_at, String, nil?: true
|
|
68
|
+
|
|
46
69
|
# @!attribute template_id
|
|
47
70
|
# The template the message was sent from, when it was sent from one.
|
|
48
71
|
#
|
|
@@ -62,7 +85,7 @@ module Sentdm
|
|
|
62
85
|
# @return [String, nil]
|
|
63
86
|
optional :updated_at, String
|
|
64
87
|
|
|
65
|
-
# @!method initialize(message_status:, account_id: nil, agent_id: nil, channel: nil, message_id: nil, outbound_number: nil, template_id: nil, template_name: nil, updated_at: nil)
|
|
88
|
+
# @!method initialize(message_status:, account_id: nil, agent_id: nil, body: nil, channel: nil, message_id: nil, outbound_number: nil, schedule_reason: nil, scheduled_at: nil, template_id: nil, template_name: nil, updated_at: nil)
|
|
66
89
|
# Some parameter documentations has been truncated, see
|
|
67
90
|
# {Sentdm::Models::MessageEventPayload} for more details.
|
|
68
91
|
#
|
|
@@ -76,12 +99,18 @@ module Sentdm
|
|
|
76
99
|
#
|
|
77
100
|
# @param agent_id [String, nil] The agent attributed to the send, when the send was attributed to one.
|
|
78
101
|
#
|
|
102
|
+
# @param body [String, nil] The rendered message body, as plain text. Sent as null when we aren't asserting
|
|
103
|
+
#
|
|
79
104
|
# @param channel [String] The channel the message went out on, for example sms or whatsapp. A message
|
|
80
105
|
#
|
|
81
106
|
# @param message_id [String] The message this event describes. Stable across every event in the message's lif
|
|
82
107
|
#
|
|
83
108
|
# @param outbound_number [String] The recipient's number in E.164 format.
|
|
84
109
|
#
|
|
110
|
+
# @param schedule_reason [String, nil] message.scheduled only: why the message is held, either because you scheduled it
|
|
111
|
+
#
|
|
112
|
+
# @param scheduled_at [String, nil] message.scheduled only: when the held message will be released for delivery, in
|
|
113
|
+
#
|
|
85
114
|
# @param template_id [String, nil] The template the message was sent from, when it was sent from one.
|
|
86
115
|
#
|
|
87
116
|
# @param template_name [String, nil] Name of the template the message was sent from. Omitted when the message wasn't
|
|
@@ -98,9 +98,18 @@ module Sentdm
|
|
|
98
98
|
# @return [String, nil]
|
|
99
99
|
optional :price, String, nil?: true
|
|
100
100
|
|
|
101
|
+
# @!attribute scheduled_at
|
|
102
|
+
# SCHEDULED activities only: when the held message will be released for delivery,
|
|
103
|
+
# in UTC. Same wire name as on the send response, the message and the webhook.
|
|
104
|
+
# Omitted on every other activity. A message that quiet hours moved at release has
|
|
105
|
+
# two SCHEDULED entries, each carrying the instant as it stood at that moment.
|
|
106
|
+
#
|
|
107
|
+
# @return [Time, nil]
|
|
108
|
+
optional :scheduled_at, Time, nil?: true
|
|
109
|
+
|
|
101
110
|
# @!attribute status
|
|
102
|
-
# Activity status. Outbound: QUEUED, PROCESSED, ROUTED,
|
|
103
|
-
# FAILED. Inbound (from contact): RECEIVED (terminal).
|
|
111
|
+
# Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SCHEDULED, SENT,
|
|
112
|
+
# DELIVERED, READ, FAILED. Inbound (from contact): RECEIVED (terminal).
|
|
104
113
|
#
|
|
105
114
|
# @return [String, nil]
|
|
106
115
|
optional :status, String
|
|
@@ -111,12 +120,16 @@ module Sentdm
|
|
|
111
120
|
# @return [Time, nil]
|
|
112
121
|
optional :timestamp, Time
|
|
113
122
|
|
|
114
|
-
# @!method initialize(active_contact_price: nil, description: nil, from: nil, price: nil, status: nil, timestamp: nil)
|
|
123
|
+
# @!method initialize(active_contact_price: nil, description: nil, from: nil, price: nil, scheduled_at: nil, status: nil, timestamp: nil)
|
|
115
124
|
# Some parameter documentations has been truncated, see
|
|
116
125
|
# {Sentdm::Models::MessageRetrieveActivitiesResponse::Data::Activity} for more
|
|
117
126
|
# details.
|
|
118
127
|
#
|
|
119
|
-
# A single message activity event for v3 API
|
|
128
|
+
# A single message activity event for v3 API.
|
|
129
|
+
#
|
|
130
|
+
# The activity list mixes statuses, so unlike a message it is one shape rather
|
|
131
|
+
# than two: a SCHEDULED entry carries scheduled_at, and every other entry has no
|
|
132
|
+
# such key.
|
|
120
133
|
#
|
|
121
134
|
# @param active_contact_price [String, nil] Active contact markup applied on top of the channel cost, formatted to 4 decimal
|
|
122
135
|
#
|
|
@@ -126,7 +139,9 @@ module Sentdm
|
|
|
126
139
|
#
|
|
127
140
|
# @param price [String, nil] Channel cost for this activity (e.g., SMS/WhatsApp provider cost), formatted to
|
|
128
141
|
#
|
|
129
|
-
# @param
|
|
142
|
+
# @param scheduled_at [Time, nil] SCHEDULED activities only: when the held message will be released for delivery,
|
|
143
|
+
#
|
|
144
|
+
# @param status [String] Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SCHEDULED, SENT, DELIVERED
|
|
130
145
|
#
|
|
131
146
|
# @param timestamp [Time] When this activity occurred
|
|
132
147
|
end
|
|
@@ -5,7 +5,12 @@ module Sentdm
|
|
|
5
5
|
# @see Sentdm::Resources::Messages#retrieve_status
|
|
6
6
|
class MessageRetrieveStatusResponse < Sentdm::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute data
|
|
8
|
-
# Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
8
|
+
# Message response for v3 API — same shape as v2 with snake_case JSON conventions.
|
|
9
|
+
#
|
|
10
|
+
# The shape of a message that was sent immediately: it never has a scheduled_at
|
|
11
|
+
# key. A message that is or was held for a later instant is a
|
|
12
|
+
# ScheduledMessageResponse, and the endpoint decides which of the two to answer
|
|
13
|
+
# with. From always returns this type.
|
|
9
14
|
#
|
|
10
15
|
# @return [Sentdm::Models::MessageRetrieveStatusResponse::Data, nil]
|
|
11
16
|
optional :data, -> { Sentdm::Models::MessageRetrieveStatusResponse::Data }, nil?: true
|
|
@@ -29,9 +34,12 @@ module Sentdm
|
|
|
29
34
|
optional :success, Sentdm::Internal::Type::Boolean
|
|
30
35
|
|
|
31
36
|
# @!method initialize(data: nil, error: nil, meta: nil, success: nil)
|
|
37
|
+
# Some parameter documentations has been truncated, see
|
|
38
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse} for more details.
|
|
39
|
+
#
|
|
32
40
|
# Standard API response envelope for all v3 endpoints
|
|
33
41
|
#
|
|
34
|
-
# @param data [Sentdm::Models::MessageRetrieveStatusResponse::Data, nil] Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
42
|
+
# @param data [Sentdm::Models::MessageRetrieveStatusResponse::Data, nil] Message response for v3 API — same shape as v2 with snake_case JSON conventions.
|
|
35
43
|
#
|
|
36
44
|
# @param error [Sentdm::Models::ErrorDetail, nil] Error information
|
|
37
45
|
#
|
|
@@ -85,7 +93,14 @@ module Sentdm
|
|
|
85
93
|
|
|
86
94
|
# @!attribute message_body
|
|
87
95
|
# Structured message body format for database storage. Preserves channel-specific
|
|
88
|
-
# components (header, body, footer, buttons).
|
|
96
|
+
# components (header, header media, body, footer, buttons, MMS subject and media).
|
|
97
|
+
#
|
|
98
|
+
# Persisted as the messageBody jsonb column on Messages. Every write path goes
|
|
99
|
+
# through MessageUtils.MessageBodyJsonOptions, which writes nulls, so the envelope
|
|
100
|
+
# shape is stable regardless of channel or status. Anything that rebuilds this
|
|
101
|
+
# object field by field — the four IMessageBodyStrategy implementations and
|
|
102
|
+
# MessageUtils.BuildSegmentBody — has to carry every member, or that member is
|
|
103
|
+
# silently dropped on whichever path forgot it.
|
|
89
104
|
#
|
|
90
105
|
# @return [Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody, nil]
|
|
91
106
|
optional :message_body,
|
|
@@ -136,7 +151,12 @@ module Sentdm
|
|
|
136
151
|
# Some parameter documentations has been truncated, see
|
|
137
152
|
# {Sentdm::Models::MessageRetrieveStatusResponse::Data} for more details.
|
|
138
153
|
#
|
|
139
|
-
# Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
154
|
+
# Message response for v3 API — same shape as v2 with snake_case JSON conventions.
|
|
155
|
+
#
|
|
156
|
+
# The shape of a message that was sent immediately: it never has a scheduled_at
|
|
157
|
+
# key. A message that is or was held for a later instant is a
|
|
158
|
+
# ScheduledMessageResponse, and the endpoint decides which of the two to answer
|
|
159
|
+
# with. From always returns this type.
|
|
140
160
|
#
|
|
141
161
|
# @param id [String]
|
|
142
162
|
#
|
|
@@ -220,14 +240,63 @@ module Sentdm
|
|
|
220
240
|
# @return [String, nil]
|
|
221
241
|
optional :header, String, nil?: true
|
|
222
242
|
|
|
223
|
-
# @!
|
|
243
|
+
# @!attribute header_media
|
|
244
|
+
# The media asset that rode a message's header, recorded as sent.
|
|
245
|
+
#
|
|
246
|
+
# @return [Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::HeaderMedia, nil]
|
|
247
|
+
optional :header_media,
|
|
248
|
+
-> { Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::HeaderMedia },
|
|
249
|
+
api_name: :headerMedia,
|
|
250
|
+
nil?: true
|
|
251
|
+
|
|
252
|
+
# @!attribute media
|
|
253
|
+
# MMS attachments, as the publicly fetchable URLs handed to the carrier. Null on
|
|
254
|
+
# every other channel.
|
|
255
|
+
#
|
|
256
|
+
# Persisted rather than derived because a resend and a curfew release rebuild the
|
|
257
|
+
# send from the stored row — MessageReplayCommandBuilder reads templateId and
|
|
258
|
+
# templateVariables and nothing else — so media that lives only on the original
|
|
259
|
+
# request would silently turn a replayed MMS into a text message.
|
|
260
|
+
#
|
|
261
|
+
# @return [Array<Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Media>, nil]
|
|
262
|
+
optional :media,
|
|
263
|
+
-> { Sentdm::Internal::Type::ArrayOf[Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Media] },
|
|
264
|
+
nil?: true
|
|
265
|
+
|
|
266
|
+
# @!attribute subject
|
|
267
|
+
# MMS subject line. Null on every other channel.
|
|
268
|
+
#
|
|
269
|
+
# @return [String, nil]
|
|
270
|
+
optional :subject, String, nil?: true
|
|
271
|
+
|
|
272
|
+
# @!method initialize(buttons: nil, content: nil, footer: nil, header: nil, header_media: nil, media: nil, subject: nil)
|
|
273
|
+
# Some parameter documentations has been truncated, see
|
|
274
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody} for more
|
|
275
|
+
# details.
|
|
276
|
+
#
|
|
224
277
|
# Structured message body format for database storage. Preserves channel-specific
|
|
225
|
-
# components (header, body, footer, buttons).
|
|
278
|
+
# components (header, header media, body, footer, buttons, MMS subject and media).
|
|
279
|
+
#
|
|
280
|
+
# Persisted as the messageBody jsonb column on Messages. Every write path goes
|
|
281
|
+
# through MessageUtils.MessageBodyJsonOptions, which writes nulls, so the envelope
|
|
282
|
+
# shape is stable regardless of channel or status. Anything that rebuilds this
|
|
283
|
+
# object field by field — the four IMessageBodyStrategy implementations and
|
|
284
|
+
# MessageUtils.BuildSegmentBody — has to carry every member, or that member is
|
|
285
|
+
# silently dropped on whichever path forgot it.
|
|
226
286
|
#
|
|
227
287
|
# @param buttons [Array<Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Button>, nil]
|
|
288
|
+
#
|
|
228
289
|
# @param content [String]
|
|
290
|
+
#
|
|
229
291
|
# @param footer [String, nil]
|
|
292
|
+
#
|
|
230
293
|
# @param header [String, nil]
|
|
294
|
+
#
|
|
295
|
+
# @param header_media [Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::HeaderMedia, nil] The media asset that rode a message's header, recorded as sent.
|
|
296
|
+
#
|
|
297
|
+
# @param media [Array<Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Media>, nil] MMS attachments, as the publicly fetchable URLs handed to the carrier. Null on e
|
|
298
|
+
#
|
|
299
|
+
# @param subject [String, nil] MMS subject line. Null on every other channel.
|
|
231
300
|
|
|
232
301
|
class Button < Sentdm::Internal::Type::BaseModel
|
|
233
302
|
# @!attribute postback_data
|
|
@@ -256,6 +325,64 @@ module Sentdm
|
|
|
256
325
|
# @param type [String]
|
|
257
326
|
# @param value [String]
|
|
258
327
|
end
|
|
328
|
+
|
|
329
|
+
# @see Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody#header_media
|
|
330
|
+
class HeaderMedia < Sentdm::Internal::Type::BaseModel
|
|
331
|
+
# @!attribute type
|
|
332
|
+
# "image", "video" or "document" — taken from the header's media variable.
|
|
333
|
+
#
|
|
334
|
+
# @return [String, nil]
|
|
335
|
+
optional :type, String
|
|
336
|
+
|
|
337
|
+
# @!attribute url
|
|
338
|
+
# The https URL the caller supplied for this send. Never the template's stored
|
|
339
|
+
# props.sample, which is Meta's expiring header_handle rather than what was
|
|
340
|
+
# delivered.
|
|
341
|
+
#
|
|
342
|
+
# @return [String, nil]
|
|
343
|
+
optional :url, String
|
|
344
|
+
|
|
345
|
+
# @!method initialize(type: nil, url: nil)
|
|
346
|
+
# Some parameter documentations has been truncated, see
|
|
347
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::HeaderMedia}
|
|
348
|
+
# for more details.
|
|
349
|
+
#
|
|
350
|
+
# The media asset that rode a message's header, recorded as sent.
|
|
351
|
+
#
|
|
352
|
+
# @param type [String] "image", "video" or "document" — taken from the header's media variable.
|
|
353
|
+
#
|
|
354
|
+
# @param url [String] The https URL the caller supplied for this send. Never the template's stored
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
class Media < Sentdm::Internal::Type::BaseModel
|
|
358
|
+
# @!attribute media_type
|
|
359
|
+
# One of Constants.MmsMediaTypes when known. Advisory — the carrier reads the
|
|
360
|
+
# fetched object's Content-Type, not this.
|
|
361
|
+
#
|
|
362
|
+
# @return [String, nil]
|
|
363
|
+
optional :media_type, String, api_name: :mediaType, nil?: true
|
|
364
|
+
|
|
365
|
+
# @!attribute url
|
|
366
|
+
#
|
|
367
|
+
# @return [String, nil]
|
|
368
|
+
optional :url, String
|
|
369
|
+
|
|
370
|
+
# @!method initialize(media_type: nil, url: nil)
|
|
371
|
+
# Some parameter documentations has been truncated, see
|
|
372
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Media} for
|
|
373
|
+
# more details.
|
|
374
|
+
#
|
|
375
|
+
# One attachment on a message: a customer-supplied public URL handed to the
|
|
376
|
+
# carrier as-is.
|
|
377
|
+
#
|
|
378
|
+
# A URL and nothing else. sent.dm never takes custody of MMS media — the customer hosts it and we
|
|
379
|
+
# pass the link through at send time — so there is no storage key, size or expiry to record. If we ever
|
|
380
|
+
# do host attachments, that belongs with the change that introduces the hosting, not here.
|
|
381
|
+
#
|
|
382
|
+
# @param media_type [String, nil] One of Constants.MmsMediaTypes when known. Advisory — the carrier reads the
|
|
383
|
+
#
|
|
384
|
+
# @param url [String]
|
|
385
|
+
end
|
|
259
386
|
end
|
|
260
387
|
end
|
|
261
388
|
end
|