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.
Files changed (79) 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.rb +78 -0
  6. data/lib/sentdm/models/channel_event_payload.rb +265 -0
  7. data/lib/sentdm/models/contact_event.rb +77 -0
  8. data/lib/sentdm/models/contact_event_payload.rb +172 -0
  9. data/lib/sentdm/models/conversation_messages_list.rb +125 -4
  10. data/lib/sentdm/models/inbound_message_event.rb +16 -8
  11. data/lib/sentdm/models/message_event.rb +16 -8
  12. data/lib/sentdm/models/message_event_payload.rb +30 -1
  13. data/lib/sentdm/models/message_retrieve_activities_response.rb +20 -5
  14. data/lib/sentdm/models/message_retrieve_status_response.rb +133 -6
  15. data/lib/sentdm/models/message_send_params.rb +67 -3
  16. data/lib/sentdm/models/message_send_response.rb +13 -4
  17. data/lib/sentdm/models/template.rb +36 -5
  18. data/lib/sentdm/models/template_body.rb +102 -12
  19. data/lib/sentdm/models/template_body_content.rb +35 -3
  20. data/lib/sentdm/models/template_button.rb +8 -2
  21. data/lib/sentdm/models/template_button_props.rb +12 -1
  22. data/lib/sentdm/models/template_definition.rb +14 -2
  23. data/lib/sentdm/models/template_event.rb +16 -8
  24. data/lib/sentdm/models/template_event_payload.rb +31 -4
  25. data/lib/sentdm/models/template_header.rb +91 -3
  26. data/lib/sentdm/models/template_variable.rb +35 -4
  27. data/lib/sentdm/models/webhook_list_events_response.rb +332 -9
  28. data/lib/sentdm/models.rb +8 -0
  29. data/lib/sentdm/resources/messages.rb +33 -5
  30. data/lib/sentdm/resources/templates.rb +28 -2
  31. data/lib/sentdm/version.rb +1 -1
  32. data/lib/sentdm.rb +5 -1
  33. data/rbi/sentdm/client.rbi +6 -0
  34. data/rbi/sentdm/models/channel_event.rbi +128 -0
  35. data/rbi/sentdm/models/channel_event_payload.rbi +440 -0
  36. data/rbi/sentdm/models/contact_event.rbi +126 -0
  37. data/rbi/sentdm/models/contact_event_payload.rbi +254 -0
  38. data/rbi/sentdm/models/conversation_messages_list.rbi +202 -7
  39. data/rbi/sentdm/models/inbound_message_event.rbi +18 -10
  40. data/rbi/sentdm/models/message_event.rbi +18 -10
  41. data/rbi/sentdm/models/message_event_payload.rbi +34 -0
  42. data/rbi/sentdm/models/message_retrieve_activities_response.rbi +23 -5
  43. data/rbi/sentdm/models/message_retrieve_status_response.rbi +214 -9
  44. data/rbi/sentdm/models/message_send_params.rbi +100 -2
  45. data/rbi/sentdm/models/message_send_response.rbi +15 -5
  46. data/rbi/sentdm/models/template.rbi +58 -4
  47. data/rbi/sentdm/models/template_body.rbi +155 -13
  48. data/rbi/sentdm/models/template_body_content.rbi +59 -1
  49. data/rbi/sentdm/models/template_button.rbi +14 -2
  50. data/rbi/sentdm/models/template_button_props.rbi +22 -0
  51. data/rbi/sentdm/models/template_definition.rbi +20 -2
  52. data/rbi/sentdm/models/template_event.rbi +18 -10
  53. data/rbi/sentdm/models/template_event_payload.rbi +51 -8
  54. data/rbi/sentdm/models/template_header.rbi +143 -2
  55. data/rbi/sentdm/models/template_variable.rbi +38 -1
  56. data/rbi/sentdm/models/webhook_list_events_response.rbi +484 -12
  57. data/rbi/sentdm/models.rbi +8 -0
  58. data/rbi/sentdm/resources/messages.rbi +58 -3
  59. data/rbi/sentdm/resources/templates.rbi +28 -2
  60. data/sig/sentdm/models/channel_event.rbs +44 -0
  61. data/sig/sentdm/models/channel_event_payload.rbs +120 -0
  62. data/sig/sentdm/models/contact_event.rbs +44 -0
  63. data/sig/sentdm/models/contact_event_payload.rbs +78 -0
  64. data/sig/sentdm/models/conversation_messages_list.rbs +48 -3
  65. data/sig/sentdm/models/inbound_message_event.rbs +5 -0
  66. data/sig/sentdm/models/message_event.rbs +5 -0
  67. data/sig/sentdm/models/message_event_payload.rbs +15 -0
  68. data/sig/sentdm/models/message_retrieve_activities_response.rbs +5 -0
  69. data/sig/sentdm/models/message_retrieve_status_response.rbs +48 -3
  70. data/sig/sentdm/models/message_send_params.rbs +15 -0
  71. data/sig/sentdm/models/template.rbs +5 -0
  72. data/sig/sentdm/models/template_body.rbs +44 -0
  73. data/sig/sentdm/models/template_event.rbs +5 -0
  74. data/sig/sentdm/models/template_event_payload.rbs +9 -6
  75. data/sig/sentdm/models/template_header.rbs +44 -0
  76. data/sig/sentdm/models/webhook_list_events_response.rbs +147 -0
  77. data/sig/sentdm/models.rbs +8 -0
  78. data/sig/sentdm/resources/messages.rbs +3 -0
  79. metadata +14 -2
@@ -22,6 +22,25 @@ module Sentdm
22
22
  # @return [String, nil]
23
23
  optional :account_id, String
24
24
 
25
+ # @!attribute auto_reply_action
26
+ # Which consent keyword this template answers, when it is one of Sent's
27
+ # auto-replies: OPT_IN, OPT_OUT, HELP, or OTHER for a customer-defined keyword.
28
+ #
29
+ # Omitted for an ordinary template, so its presence is the answer to "is this an
30
+ # auto-reply". Sent creates the three compliance auto-replies at signup and they
31
+ # go through review like any other template, so their events arrive mixed in with
32
+ # the customer's own with nothing else to tell them apart.
33
+ #
34
+ # Named for the reader rather than after Template.OptAction, which it is mapped
35
+ # from. The MCP tool result deliberately keeps OptAction, OptKeywords and IsOpt:
36
+ # it mirrors the internal shape on purpose and publishes the keywords too, so
37
+ # renaming one of the three there would leave a surface half in each vocabulary.
38
+ # Two names for one concept, each consistent within its own surface, chosen over a
39
+ # rename that breaks MCP clients silently.
40
+ #
41
+ # @return [String, nil]
42
+ optional :auto_reply_action, String, nil?: true
43
+
25
44
  # @!attribute category
26
45
  # The template's category, for example UTILITY, MARKETING, or AUTHENTICATION.
27
46
  #
@@ -29,10 +48,16 @@ module Sentdm
29
48
  optional :category, String
30
49
 
31
50
  # @!attribute channel
32
- # The channel the template applies to.
51
+ # The channel leg this decision is about, for example whatsapp, sms, or rcs. A
52
+ # template is reviewed per channel and the legs come back independently, so each
53
+ # one reports separately.
54
+ #
55
+ # Omitted when the decision applies to the template as a whole rather than to one
56
+ # leg. That event is the broader news: a template-wide rejection blocks every
57
+ # channel, whatever the individual legs say.
33
58
  #
34
59
  # @return [String, nil]
35
- optional :channel, String
60
+ optional :channel, String, nil?: true
36
61
 
37
62
  # @!attribute language
38
63
  # The template's language code, for example en_US.
@@ -59,7 +84,7 @@ module Sentdm
59
84
  # @return [String, nil]
60
85
  optional :template_name, String
61
86
 
62
- # @!method initialize(status:, whatsapp_template_id:, account_id: nil, category: nil, channel: nil, language: nil, reason: nil, template_id: nil, template_name: nil)
87
+ # @!method initialize(status:, whatsapp_template_id:, account_id: nil, auto_reply_action: nil, category: nil, channel: nil, language: nil, reason: nil, template_id: nil, template_name: nil)
63
88
  # Some parameter documentations has been truncated, see
64
89
  # {Sentdm::Models::TemplateEventPayload} for more details.
65
90
  #
@@ -72,9 +97,11 @@ module Sentdm
72
97
  #
73
98
  # @param account_id [String] The account the template belongs to.
74
99
  #
100
+ # @param auto_reply_action [String, nil] Which consent keyword this template answers, when it is one of Sent's auto-repli
101
+ #
75
102
  # @param category [String] The template's category, for example UTILITY, MARKETING, or
76
103
  #
77
- # @param channel [String] The channel the template applies to.
104
+ # @param channel [String, nil] The channel leg this decision is about, for example whatsapp, sms, or rcs.
78
105
  #
79
106
  # @param language [String] The template's language code, for example en_US.
80
107
  #
@@ -10,8 +10,56 @@ module Sentdm
10
10
  # @return [String]
11
11
  required :template, String
12
12
 
13
+ # @!attribute example_url
14
+ # Request-only. The s.dm URL of the asset Meta's reviewers see —
15
+ # https://s.dm/s/{ID}, eight uppercase characters, uploaded to s.dm out of band.
16
+ # NormalizeRichHeader folds it into the synthesized media variable's Props.Sample
17
+ # and clears it, so it never persists and a stored definition is indistinguishable
18
+ # from an imported one.
19
+ #
20
+ # Stricter than the send path on purpose:
21
+ # TemplateUtils.ValidateMediaVariableValues accepts any absolute https URL for the
22
+ # per-send asset, because that one is the customer's and may live behind a signed
23
+ # CDN link. This one is the review sample, has to outlive every resubmission, and
24
+ # so must be ours. Do not "fix" one to match the other.
25
+ #
26
+ # @return [String, nil]
27
+ optional :example_url, String, nil?: true
28
+
29
+ # @!attribute location
30
+ # The map pin a location header drops. Meta wants none of this at creation — the
31
+ # component is just {"type":"header","format":"location"} — so these values exist
32
+ # for Sent: a preview, and the default a StaticResource header falls back to at
33
+ # send.
34
+ #
35
+ # @return [Sentdm::Models::TemplateHeader::Location, nil]
36
+ optional :location, -> { Sentdm::TemplateHeader::Location }, nil?: true
37
+
38
+ # @!attribute static_resource
39
+ # Whether the asset registered at creation is reused when a caller omits the
40
+ # header's variable at send time. Default false — the caller must supply it per
41
+ # message, which is the behaviour every existing template has. Written only when
42
+ # true, so a default-valued header serializes byte-identically to one imported
43
+ # from Meta.
44
+ #
45
+ # Stored and validated but not yet honoured at send: that lands with the Resumable
46
+ # Upload work, alongside the code that lets such a template be approved in the
47
+ # first place.
48
+ #
49
+ # @return [Boolean, nil]
50
+ optional :static_resource, Sentdm::Internal::Type::Boolean
51
+
13
52
  # @!attribute type
14
- # The type of header (e.g., "text", "image", "video", "document")
53
+ # The kind of header. One of:
54
+ #
55
+ # text — up to 60 characters, at most one variable. image — png, jpg or jpeg.
56
+ # Needs ExampleUrl. video — mp4. Needs ExampleUrl. gif — mp4, max 3.5MB. WhatsApp
57
+ # renders larger files as an ordinary video. Needs ExampleUrl. document — pdf or
58
+ # docx; only the first page is shown as a thumbnail, so pdf is the practical
59
+ # choice. Needs ExampleUrl. location — a map pin, supplied through Location.
60
+ #
61
+ # Kept lowercase because MetaToTemplateConverter writes Meta's format through
62
+ # ToLowerInvariant() into this field on import, and the two are compared directly.
15
63
  #
16
64
  # @return [String, nil]
17
65
  optional :type, String, nil?: true
@@ -22,7 +70,7 @@ module Sentdm
22
70
  # @return [Array<Sentdm::Models::TemplateVariable>, nil]
23
71
  optional :variables, -> { Sentdm::Internal::Type::ArrayOf[Sentdm::TemplateVariable] }, nil?: true
24
72
 
25
- # @!method initialize(template:, type: nil, variables: nil)
73
+ # @!method initialize(template:, example_url: nil, location: nil, static_resource: nil, type: nil, variables: nil)
26
74
  # Some parameter documentations has been truncated, see
27
75
  # {Sentdm::Models::TemplateHeader} for more details.
28
76
  #
@@ -30,9 +78,49 @@ module Sentdm
30
78
  #
31
79
  # @param template [String] The header template text with optional variable placeholders (e.g., "Welcome to
32
80
  #
33
- # @param type [String, nil] The type of header (e.g., "text", "image", "video", "document")
81
+ # @param example_url [String, nil] Request-only. The s.dm URL of the asset Meta's reviewers see — https://s.dm/s/{I
82
+ #
83
+ # @param location [Sentdm::Models::TemplateHeader::Location, nil] The map pin a location header drops. Meta wants none of this at creation — the c
84
+ #
85
+ # @param static_resource [Boolean] Whether the asset registered at creation is reused when a caller omits the heade
86
+ #
87
+ # @param type [String, nil] The kind of header. One of:
34
88
  #
35
89
  # @param variables [Array<Sentdm::Models::TemplateVariable>, nil] List of variables used in the header template
90
+
91
+ # @see Sentdm::Models::TemplateHeader#location
92
+ class Location < Sentdm::Internal::Type::BaseModel
93
+ # @!attribute address
94
+ #
95
+ # @return [String]
96
+ required :address, String
97
+
98
+ # @!attribute latitude
99
+ #
100
+ # @return [String]
101
+ required :latitude, String
102
+
103
+ # @!attribute longitude
104
+ #
105
+ # @return [String]
106
+ required :longitude, String
107
+
108
+ # @!attribute name
109
+ #
110
+ # @return [String]
111
+ required :name, String
112
+
113
+ # @!method initialize(address:, latitude:, longitude:, name:)
114
+ # The map pin a location header drops. Meta wants none of this at creation — the
115
+ # component is just {"type":"header","format":"location"} — so these values exist
116
+ # for Sent: a preview, and the default a StaticResource header falls back to at
117
+ # send.
118
+ #
119
+ # @param address [String]
120
+ # @param latitude [String]
121
+ # @param longitude [String]
122
+ # @param name [String]
123
+ end
36
124
  end
37
125
  end
38
126
  end
@@ -4,6 +4,9 @@ module Sentdm
4
4
  module Models
5
5
  class TemplateVariable < Sentdm::Internal::Type::BaseModel
6
6
  # @!attribute name
7
+ # The variable's name, and the key callers use for it in a send request's
8
+ # parameters object. Must start with a letter and hold only letters, digits and
9
+ # underscores.
7
10
  #
8
11
  # @return [String]
9
12
  required :name, String
@@ -14,20 +17,34 @@ module Sentdm
14
17
  required :props, -> { Sentdm::TemplateVariable::Props }
15
18
 
16
19
  # @!attribute type
20
+ # One of variable, link or media. Decides which Props fields are required.
17
21
  #
18
22
  # @return [String]
19
23
  required :type, String
20
24
 
21
25
  # @!attribute id
26
+ # The variable's index, and the number its {{index:variable}} placeholder refers
27
+ # to.
28
+ #
29
+ # Omitting it is only safe for a section holding a single variable. The field is a
30
+ # non-nullable int, so every variable that leaves it out defaults to 0, and a
31
+ # section with two such variables is refused by the unique-id rule ("variables
32
+ # must have unique IDs"). Number them from 0 in the order they appear.
22
33
  #
23
34
  # @return [Integer, nil]
24
35
  optional :id, Integer
25
36
 
26
37
  # @!method initialize(name:, props:, type:, id: nil)
27
- # @param name [String]
38
+ # Some parameter documentations has been truncated, see
39
+ # {Sentdm::Models::TemplateVariable} for more details.
40
+ #
41
+ # @param name [String] The variable's name, and the key callers use for it in a send request's paramete
42
+ #
28
43
  # @param props [Sentdm::Models::TemplateVariable::Props]
29
- # @param type [String]
30
- # @param id [Integer]
44
+ #
45
+ # @param type [String] One of variable, link or media. Decides which Props fields
46
+ #
47
+ # @param id [Integer] The variable's index, and the number its {{index:variable}} placeholder refers t
31
48
 
32
49
  # @see Sentdm::Models::TemplateVariable#props
33
50
  class Props < Sentdm::Internal::Type::BaseModel
@@ -37,6 +54,11 @@ module Sentdm
37
54
  required :media_type, String, api_name: :mediaType
38
55
 
39
56
  # @!attribute sample
57
+ # Example value substituted into the template when previewing it and when
58
+ # submitting it to Meta for review. Free text by nature, so the converter accepts
59
+ # a JSON number or boolean here and normalizes it — see
60
+ # JsonScalarToStringConverter for why — and guarantees it is always serialized
61
+ # back out as a JSON string.
40
62
  #
41
63
  # @return [String]
42
64
  required :sample, String
@@ -67,12 +89,21 @@ module Sentdm
67
89
  optional :short_url, String, api_name: :shortUrl, nil?: true
68
90
 
69
91
  # @!method initialize(media_type:, sample:, url:, variable_type:, alt: nil, regex: nil, short_url: nil)
92
+ # Some parameter documentations has been truncated, see
93
+ # {Sentdm::Models::TemplateVariable::Props} for more details.
94
+ #
70
95
  # @param media_type [String]
71
- # @param sample [String]
96
+ #
97
+ # @param sample [String] Example value substituted into the template when previewing it and when submitti
98
+ #
72
99
  # @param url [String]
100
+ #
73
101
  # @param variable_type [String]
102
+ #
74
103
  # @param alt [String, nil]
104
+ #
75
105
  # @param regex [String, nil]
106
+ #
76
107
  # @param short_url [String, nil]
77
108
  end
78
109
  end
@@ -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 three webhook envelopes: a message status change, an inbound message, or a
35
- # template status change. Read field and event to tell which, the same way your
36
- # endpoint does.
34
+ # the six webhook envelopes:
37
35
  #
38
- # @return [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, 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] 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 three webhook envelopes: a message status change, an inbound message, or a
94
- # template status change. Read field and event to tell which, the same way your
95
- # 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
@@ -110,8 +136,305 @@ module Sentdm
110
136
  # varies only in Payload.
111
137
  variant -> { Sentdm::TemplateEvent }
112
138
 
139
+ # The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
140
+ # varies only in Payload.
141
+ variant -> { Sentdm::ChannelEvent }
142
+
143
+ # The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
144
+ # varies only in Payload.
145
+ variant -> { Sentdm::ContactEvent }
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
+
113
436
  # @!method self.variants
114
- # @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent)]
437
+ # @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload)]
115
438
  end
116
439
  end
117
440
  end
data/lib/sentdm/models.rb CHANGED
@@ -67,10 +67,18 @@ module Sentdm
67
67
 
68
68
  BrandsBrandData = Sentdm::Models::BrandsBrandData
69
69
 
70
+ ChannelEvent = Sentdm::Models::ChannelEvent
71
+
72
+ ChannelEventPayload = Sentdm::Models::ChannelEventPayload
73
+
70
74
  ContactCreateParams = Sentdm::Models::ContactCreateParams
71
75
 
72
76
  ContactDeleteParams = Sentdm::Models::ContactDeleteParams
73
77
 
78
+ ContactEvent = Sentdm::Models::ContactEvent
79
+
80
+ ContactEventPayload = Sentdm::Models::ContactEventPayload
81
+
74
82
  ContactListParams = Sentdm::Models::ContactListParams
75
83
 
76
84
  ContactMessageSummary = Sentdm::Models::ContactMessageSummary