sentdm 0.31.0 → 0.32.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 +7 -0
- data/README.md +1 -1
- data/lib/sentdm/models/channel_event.rb +78 -0
- data/lib/sentdm/models/channel_event_payload.rb +128 -0
- data/lib/sentdm/models/contact_event.rb +69 -0
- data/lib/sentdm/models/contact_event_payload.rb +111 -0
- 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 +11 -1
- data/lib/sentdm/models/template.rb +36 -5
- data/lib/sentdm/models/template_body.rb +20 -11
- 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_variable.rb +20 -3
- data/lib/sentdm/models/webhook_list_events_response.rb +17 -9
- data/lib/sentdm/models.rb +8 -0
- data/lib/sentdm/resources/templates.rb +28 -2
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +4 -0
- data/rbi/sentdm/models/channel_event.rbi +128 -0
- data/rbi/sentdm/models/channel_event_payload.rbi +189 -0
- data/rbi/sentdm/models/contact_event.rbi +110 -0
- data/rbi/sentdm/models/contact_event_payload.rbi +164 -0
- 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 +12 -0
- data/rbi/sentdm/models/template.rbi +58 -4
- data/rbi/sentdm/models/template_body.rbi +22 -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_variable.rbi +28 -1
- data/rbi/sentdm/models/webhook_list_events_response.rbi +18 -12
- data/rbi/sentdm/models.rbi +8 -0
- 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 +63 -0
- data/sig/sentdm/models/contact_event.rbs +44 -0
- data/sig/sentdm/models/contact_event_payload.rbs +63 -0
- 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 +5 -0
- data/sig/sentdm/models/template.rbs +5 -0
- data/sig/sentdm/models/template_event.rbs +5 -0
- data/sig/sentdm/models/template_event_payload.rbs +9 -6
- data/sig/sentdm/models/webhook_list_events_response.rbs +2 -0
- data/sig/sentdm/models.rbs +8 -0
- metadata +14 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5dab566c65206bbd97b0e29e8660f25932a22d58359db63e20c4d4ba9cbd8dec
|
|
4
|
+
data.tar.gz: 5e097f125343b76d26132686ff963dcfba40c316b6e9a8a4b13dc0fd493014aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a47bec3101129a85381094c226cf6be44786562b5a882683bcc6c40dbeeb40d6da8ef8dd4a47254a7f6dc09cefea91655170baa7495755a54d922d127f0d6e56
|
|
7
|
+
data.tar.gz: a5239a8ae31862ca952d547205f9fd35b909f3bf43320f45afbed14f881110de646b5697a2f247b43bc91861ef5df95f43b5f6353becce01a133086bf844bb6b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.32.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.31.0...v0.32.0) (2026-09-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** sync OpenAPI spec from production ([d1e2524](https://github.com/sentdm/sent-dm-ruby/commit/d1e2524bd0002641b5466b2eaf1ba189c9d80acf))
|
|
9
|
+
|
|
3
10
|
## [0.31.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.30.0...v0.31.0) (2026-09-10)
|
|
4
11
|
|
|
5
12
|
|
data/README.md
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class ChannelEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute event
|
|
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
|
+
#
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
optional :event, String, nil?: true
|
|
13
|
+
|
|
14
|
+
# @!attribute field
|
|
15
|
+
# The event family, for example message, templates or contact. Route on this
|
|
16
|
+
# first, then on event for the specific change.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :field, String
|
|
20
|
+
|
|
21
|
+
# @!attribute payload
|
|
22
|
+
# Body of a channel event: where one of the customer's channels stands in
|
|
23
|
+
# provisioning and compliance. Delivered when a milestone moves — a registration
|
|
24
|
+
# filed, a verdict returned, a resubmission asked for, a sender gone live — so a
|
|
25
|
+
# customer's own onboarding UI does not have to poll GET /v3/channels.
|
|
26
|
+
#
|
|
27
|
+
# The subject is one item, never the account. A customer's "SMS channel" has no
|
|
28
|
+
# status; a market does. Country, NumberType and SenderValue name which one, so a
|
|
29
|
+
# customer terminating only to Kosovo never receives an event about US 10DLC.
|
|
30
|
+
#
|
|
31
|
+
# Status is the stable half of the contract. It is the same four-value set GET
|
|
32
|
+
# /v3/channels publishes, computed through the same code, so an event and a read
|
|
33
|
+
# of the same market cannot disagree. A subscriber that reads nothing but the
|
|
34
|
+
# status and the subject fields is a correct subscriber. The sub-type on the
|
|
35
|
+
# envelope names the specific milestone and is additive — that vocabulary comes
|
|
36
|
+
# from registries and carriers, which are parties Sent does not control.
|
|
37
|
+
#
|
|
38
|
+
# Status means provisioning and compliance are complete, not that a send will
|
|
39
|
+
# succeed right now. An account can be suspended, or a destination blocked by a
|
|
40
|
+
# routing rule, without either showing up here. Those are separate surfaces and
|
|
41
|
+
# deliberately not modelled on this payload.
|
|
42
|
+
#
|
|
43
|
+
# @return [Sentdm::Models::ChannelEventPayload, nil]
|
|
44
|
+
optional :payload, -> { Sentdm::ChannelEventPayload }, nil?: true
|
|
45
|
+
|
|
46
|
+
# @!attribute request_id
|
|
47
|
+
# The event-specific body.
|
|
48
|
+
#
|
|
49
|
+
# @return [String, nil]
|
|
50
|
+
optional :request_id, String, nil?: true
|
|
51
|
+
|
|
52
|
+
# @!attribute timestamp
|
|
53
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
54
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
55
|
+
# payload for the latter.
|
|
56
|
+
#
|
|
57
|
+
# @return [String, nil]
|
|
58
|
+
optional :timestamp, String
|
|
59
|
+
|
|
60
|
+
# @!method initialize(event: nil, field: nil, payload: nil, request_id: nil, timestamp: nil)
|
|
61
|
+
# Some parameter documentations has been truncated, see
|
|
62
|
+
# {Sentdm::Models::ChannelEvent} for more details.
|
|
63
|
+
#
|
|
64
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
65
|
+
# this shape and varies only in Payload.
|
|
66
|
+
#
|
|
67
|
+
# @param event [String, nil] The specific event within the family, for example message.delivered,
|
|
68
|
+
#
|
|
69
|
+
# @param field [String] The event family, for example message, templates or contact. Route on
|
|
70
|
+
#
|
|
71
|
+
# @param payload [Sentdm::Models::ChannelEventPayload, nil] Body of a channel event: where one of the customer's channels stands in provisio
|
|
72
|
+
#
|
|
73
|
+
# @param request_id [String, nil] The event-specific body.
|
|
74
|
+
#
|
|
75
|
+
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class ChannelEventPayload < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute country
|
|
7
|
+
# The market's destination country as an ISO 3166-1 alpha-2 code, for example XK.
|
|
8
|
+
# Always present, and the property that identifies this payload among the
|
|
9
|
+
# delivered envelopes — see DeliveredWebhookEvents. Every event in this family
|
|
10
|
+
# reports one market, and a market has a country.
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :country, String
|
|
14
|
+
|
|
15
|
+
# @!attribute account_id
|
|
16
|
+
# The account whose market this is, named as on every other family. When an
|
|
17
|
+
# organization receives an event for one of its sender profiles this is the
|
|
18
|
+
# profile, so a reseller compares it with its own id and anything different is one
|
|
19
|
+
# of its profiles.
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
optional :account_id, String
|
|
23
|
+
|
|
24
|
+
# @!attribute channel
|
|
25
|
+
# The channel this market belongs to: sms, whatsapp, or rcs. Never sent — that
|
|
26
|
+
# value belongs to message events, where it names the smart-routing brand rather
|
|
27
|
+
# than a channel that can be provisioned.
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :channel, String
|
|
31
|
+
|
|
32
|
+
# @!attribute number_type
|
|
33
|
+
# The kind of sender the market uses, for example TEN_DLC, LOCAL, or ALPHANUMERIC.
|
|
34
|
+
# Omitted when the subject has no sender type of its own.
|
|
35
|
+
#
|
|
36
|
+
# @return [String, nil]
|
|
37
|
+
optional :number_type, String, nil?: true
|
|
38
|
+
|
|
39
|
+
# @!attribute reason
|
|
40
|
+
# Why the market reached this state, when a reason was given — a correction
|
|
41
|
+
# explained, or a campaign lapse. Free text, passed through from the registry or
|
|
42
|
+
# carrier that wrote it, so treat it as a message to show a human rather than a
|
|
43
|
+
# value to branch on.
|
|
44
|
+
#
|
|
45
|
+
# @return [String, nil]
|
|
46
|
+
optional :reason, String, nil?: true
|
|
47
|
+
|
|
48
|
+
# @!attribute sender_value
|
|
49
|
+
# The sender itself — a number in E.164, or an alphanumeric sender ID.
|
|
50
|
+
#
|
|
51
|
+
# Always present, and null until a sender exists. The key is on every delivery so
|
|
52
|
+
# a subscriber reads one shape rather than branching on whether the field arrived
|
|
53
|
+
# — the same choice template_id makes on the message payload.
|
|
54
|
+
#
|
|
55
|
+
# It can carry a value at any point in the lifecycle, not only once the market is
|
|
56
|
+
# live: a number ordered and not yet active at the carrier is already known during
|
|
57
|
+
# PROVISIONING, and an alphanumeric sender the customer chose themselves is known
|
|
58
|
+
# before anything is filed. It is null while the market is still waiting on a
|
|
59
|
+
# number, which for a US 10DLC registration is every event up to
|
|
60
|
+
# channel.activated.
|
|
61
|
+
#
|
|
62
|
+
# @return [String, nil]
|
|
63
|
+
optional :sender_value, String, nil?: true
|
|
64
|
+
|
|
65
|
+
# @!attribute status
|
|
66
|
+
# Where the market stands: PENDING_REVIEW, ACTION_NEEDED, PROVISIONING, ACTIVE or
|
|
67
|
+
# INACTIVE. PENDING_REVIEW means a registry or a carrier holds it and the wait is
|
|
68
|
+
# theirs; ACTION_NEEDED means it is yours; PROVISIONING means the verdict is in
|
|
69
|
+
# and Sent is acquiring the sender; INACTIVE means it had a working sender and no
|
|
70
|
+
# longer does.
|
|
71
|
+
#
|
|
72
|
+
# Each event name is the transition into one of these, but the two are separate
|
|
73
|
+
# fields and may legitimately differ. A resubmission filed against a market whose
|
|
74
|
+
# sender is already live is channel.submitted carrying ACTIVE: a correction is
|
|
75
|
+
# with the registry and the sender keeps working. Read both.
|
|
76
|
+
#
|
|
77
|
+
# @return [String, nil]
|
|
78
|
+
optional :status, String
|
|
79
|
+
|
|
80
|
+
# @!attribute updated_at
|
|
81
|
+
# When the transition happened, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
82
|
+
#
|
|
83
|
+
# @return [String, nil]
|
|
84
|
+
optional :updated_at, String
|
|
85
|
+
|
|
86
|
+
# @!method initialize(country:, account_id: nil, channel: nil, number_type: nil, reason: nil, sender_value: nil, status: nil, updated_at: nil)
|
|
87
|
+
# Some parameter documentations has been truncated, see
|
|
88
|
+
# {Sentdm::Models::ChannelEventPayload} for more details.
|
|
89
|
+
#
|
|
90
|
+
# Body of a channel event: where one of the customer's channels stands in
|
|
91
|
+
# provisioning and compliance. Delivered when a milestone moves — a registration
|
|
92
|
+
# filed, a verdict returned, a resubmission asked for, a sender gone live — so a
|
|
93
|
+
# customer's own onboarding UI does not have to poll GET /v3/channels.
|
|
94
|
+
#
|
|
95
|
+
# The subject is one item, never the account. A customer's "SMS channel" has no
|
|
96
|
+
# status; a market does. Country, NumberType and SenderValue name which one, so a
|
|
97
|
+
# customer terminating only to Kosovo never receives an event about US 10DLC.
|
|
98
|
+
#
|
|
99
|
+
# Status is the stable half of the contract. It is the same four-value set GET
|
|
100
|
+
# /v3/channels publishes, computed through the same code, so an event and a read
|
|
101
|
+
# of the same market cannot disagree. A subscriber that reads nothing but the
|
|
102
|
+
# status and the subject fields is a correct subscriber. The sub-type on the
|
|
103
|
+
# envelope names the specific milestone and is additive — that vocabulary comes
|
|
104
|
+
# from registries and carriers, which are parties Sent does not control.
|
|
105
|
+
#
|
|
106
|
+
# Status means provisioning and compliance are complete, not that a send will
|
|
107
|
+
# succeed right now. An account can be suspended, or a destination blocked by a
|
|
108
|
+
# routing rule, without either showing up here. Those are separate surfaces and
|
|
109
|
+
# deliberately not modelled on this payload.
|
|
110
|
+
#
|
|
111
|
+
# @param country [String] The market's destination country as an ISO 3166-1 alpha-2 code, for example XK.
|
|
112
|
+
#
|
|
113
|
+
# @param account_id [String] The account whose market this is, named as on every other family. When an organi
|
|
114
|
+
#
|
|
115
|
+
# @param channel [String] The channel this market belongs to: sms, whatsapp, or rcs. Never
|
|
116
|
+
#
|
|
117
|
+
# @param number_type [String, nil] The kind of sender the market uses, for example TEN_DLC, LOCAL, or
|
|
118
|
+
#
|
|
119
|
+
# @param reason [String, nil] Why the market reached this state, when a reason was given — a correction explai
|
|
120
|
+
#
|
|
121
|
+
# @param sender_value [String, nil] The sender itself — a number in E.164, or an alphanumeric sender ID.
|
|
122
|
+
#
|
|
123
|
+
# @param status [String] Where the market stands: PENDING_REVIEW, ACTION_NEEDED, PROVISIONING,
|
|
124
|
+
#
|
|
125
|
+
# @param updated_at [String] When the transition happened, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class ContactEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute event
|
|
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
|
+
#
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
optional :event, String, nil?: true
|
|
13
|
+
|
|
14
|
+
# @!attribute field
|
|
15
|
+
# The event family, for example message, templates or contact. Route on this
|
|
16
|
+
# first, then on event for the specific change.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :field, String
|
|
20
|
+
|
|
21
|
+
# @!attribute payload
|
|
22
|
+
# Body of a contact.opt_in, contact.opt_out or contact.help event. Delivered when
|
|
23
|
+
# a contact signals a consent change or asks for help.
|
|
24
|
+
#
|
|
25
|
+
# These events state the signal outright, so you do not have to recognise keywords
|
|
26
|
+
# in the text of a message.received event. They also cover cases that produce no
|
|
27
|
+
# inbound message at all, such as a network handling an opt-out on your behalf.
|
|
28
|
+
#
|
|
29
|
+
# Fields are ordered identity → resulting state → provenance → join key. Nothing
|
|
30
|
+
# here restates the envelope: which of the three signals occurred is the
|
|
31
|
+
# envelope's event, and when it was emitted is its timestamp. Retries carry the
|
|
32
|
+
# same X-Webhook-Event-ID header, which is what to deduplicate on.
|
|
33
|
+
#
|
|
34
|
+
# @return [Sentdm::Models::ContactEventPayload, nil]
|
|
35
|
+
optional :payload, -> { Sentdm::ContactEventPayload }, nil?: true
|
|
36
|
+
|
|
37
|
+
# @!attribute request_id
|
|
38
|
+
# The event-specific body.
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :request_id, String, nil?: true
|
|
42
|
+
|
|
43
|
+
# @!attribute timestamp
|
|
44
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
45
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
46
|
+
# payload for the latter.
|
|
47
|
+
#
|
|
48
|
+
# @return [String, nil]
|
|
49
|
+
optional :timestamp, String
|
|
50
|
+
|
|
51
|
+
# @!method initialize(event: nil, field: nil, payload: nil, request_id: nil, timestamp: nil)
|
|
52
|
+
# Some parameter documentations has been truncated, see
|
|
53
|
+
# {Sentdm::Models::ContactEvent} for more details.
|
|
54
|
+
#
|
|
55
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
56
|
+
# this shape and varies only in Payload.
|
|
57
|
+
#
|
|
58
|
+
# @param event [String, nil] The specific event within the family, for example message.delivered,
|
|
59
|
+
#
|
|
60
|
+
# @param field [String] The event family, for example message, templates or contact. Route on
|
|
61
|
+
#
|
|
62
|
+
# @param payload [Sentdm::Models::ContactEventPayload, nil] Body of a contact.opt_in, contact.opt_out or contact.help event. Delivered
|
|
63
|
+
#
|
|
64
|
+
# @param request_id [String, nil] The event-specific body.
|
|
65
|
+
#
|
|
66
|
+
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class ContactEventPayload < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute opt_out
|
|
7
|
+
# Whether the contact is opted out after this signal — the state to write to your
|
|
8
|
+
# own record. Same meaning as opt_out on the contact resource. On contact.help
|
|
9
|
+
# this reports the contact's existing state, which help does not change.
|
|
10
|
+
#
|
|
11
|
+
# Two signals from the same contact can arrive out of order, because each one is
|
|
12
|
+
# queued on its own rather than against the contact. Compare the envelope's
|
|
13
|
+
# timestamp before you overwrite a newer state with an older one. That timestamp
|
|
14
|
+
# is second-precision, so treat two signals stamped in the same second as
|
|
15
|
+
# unordered and read the contact resource to settle them.
|
|
16
|
+
#
|
|
17
|
+
# @return [Boolean]
|
|
18
|
+
required :opt_out, Sentdm::Internal::Type::Boolean
|
|
19
|
+
|
|
20
|
+
# @!attribute source
|
|
21
|
+
# How the signal reached us. INBOUND_KEYWORD means the contact sent a message
|
|
22
|
+
# whose text matched one of the keywords; PROVIDER_SIGNAL means the network
|
|
23
|
+
# reported it. A provider signal usually carries no message_id or text, so read
|
|
24
|
+
# both for null rather than inferring them from this field.
|
|
25
|
+
#
|
|
26
|
+
# @return [String]
|
|
27
|
+
required :source, String
|
|
28
|
+
|
|
29
|
+
# @!attribute account_id
|
|
30
|
+
# The account the contact belongs to. Present so one endpoint can serve several
|
|
31
|
+
# accounts.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :account_id, String
|
|
35
|
+
|
|
36
|
+
# @!attribute channel
|
|
37
|
+
# The channel the signal arrived on, for example sms or whatsapp.
|
|
38
|
+
#
|
|
39
|
+
# @return [String, nil]
|
|
40
|
+
optional :channel, String
|
|
41
|
+
|
|
42
|
+
# @!attribute contact_id
|
|
43
|
+
# The contact who raised the signal. Always populated, including for contact.help
|
|
44
|
+
# from a number you have not messaged before — the contact is created if it does
|
|
45
|
+
# not exist yet, so this identifier is always resolvable against the contacts API.
|
|
46
|
+
#
|
|
47
|
+
# @return [String, nil]
|
|
48
|
+
optional :contact_id, String
|
|
49
|
+
|
|
50
|
+
# @!attribute message_id
|
|
51
|
+
# The inbound message that carried the signal, matching message_id on the
|
|
52
|
+
# corresponding message.received event so the two can be joined.
|
|
53
|
+
#
|
|
54
|
+
# Sent as null when the signal did not arrive as a message — for example when a
|
|
55
|
+
# network processed an opt-out on your behalf — and also when the message belongs
|
|
56
|
+
# to a different account than this event, which can happen on a shared WhatsApp
|
|
57
|
+
# number. The field is always present, so read it and check for null rather than
|
|
58
|
+
# checking whether the key exists.
|
|
59
|
+
#
|
|
60
|
+
# @return [String, nil]
|
|
61
|
+
optional :message_id, String, nil?: true
|
|
62
|
+
|
|
63
|
+
# @!attribute phone_number
|
|
64
|
+
# The contact's number in E.164 format. Same value as phone_number on the contact
|
|
65
|
+
# resource.
|
|
66
|
+
#
|
|
67
|
+
# @return [String, nil]
|
|
68
|
+
optional :phone_number, String
|
|
69
|
+
|
|
70
|
+
# @!attribute text
|
|
71
|
+
# The text the contact sent, for example STOP or UNSUBSCRIBE. Sent as null when
|
|
72
|
+
# the signal did not arrive as text. The field is always present, so read it and
|
|
73
|
+
# check for null rather than checking whether the key exists.
|
|
74
|
+
#
|
|
75
|
+
# @return [String, nil]
|
|
76
|
+
optional :text, String, nil?: true
|
|
77
|
+
|
|
78
|
+
# @!method initialize(opt_out:, source:, account_id: nil, channel: nil, contact_id: nil, message_id: nil, phone_number: nil, text: nil)
|
|
79
|
+
# Some parameter documentations has been truncated, see
|
|
80
|
+
# {Sentdm::Models::ContactEventPayload} for more details.
|
|
81
|
+
#
|
|
82
|
+
# Body of a contact.opt_in, contact.opt_out or contact.help event. Delivered when
|
|
83
|
+
# a contact signals a consent change or asks for help.
|
|
84
|
+
#
|
|
85
|
+
# These events state the signal outright, so you do not have to recognise keywords
|
|
86
|
+
# in the text of a message.received event. They also cover cases that produce no
|
|
87
|
+
# inbound message at all, such as a network handling an opt-out on your behalf.
|
|
88
|
+
#
|
|
89
|
+
# Fields are ordered identity → resulting state → provenance → join key. Nothing
|
|
90
|
+
# here restates the envelope: which of the three signals occurred is the
|
|
91
|
+
# envelope's event, and when it was emitted is its timestamp. Retries carry the
|
|
92
|
+
# same X-Webhook-Event-ID header, which is what to deduplicate on.
|
|
93
|
+
#
|
|
94
|
+
# @param opt_out [Boolean] Whether the contact is opted out after this signal — the state to write to your
|
|
95
|
+
#
|
|
96
|
+
# @param source [String] How the signal reached us. INBOUND_KEYWORD means the contact sent a message whos
|
|
97
|
+
#
|
|
98
|
+
# @param account_id [String] The account the contact belongs to. Present so one endpoint can serve several ac
|
|
99
|
+
#
|
|
100
|
+
# @param channel [String] The channel the signal arrived on, for example sms or whatsapp.
|
|
101
|
+
#
|
|
102
|
+
# @param contact_id [String] The contact who raised the signal. Always populated, including for contact.help
|
|
103
|
+
#
|
|
104
|
+
# @param message_id [String, nil] The inbound message that carried the signal, matching message_id on the
|
|
105
|
+
#
|
|
106
|
+
# @param phone_number [String] The contact's number in E.164 format. Same value as phone_number on the contact
|
|
107
|
+
#
|
|
108
|
+
# @param text [String, nil] The text the contact sent, for example STOP or UNSUBSCRIBE. Sent as
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
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.
|
|
@@ -62,7 +70,7 @@ module Sentdm
|
|
|
62
70
|
# @return [String, nil]
|
|
63
71
|
optional :updated_at, String
|
|
64
72
|
|
|
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)
|
|
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)
|
|
66
74
|
# Some parameter documentations has been truncated, see
|
|
67
75
|
# {Sentdm::Models::MessageEventPayload} for more details.
|
|
68
76
|
#
|
|
@@ -76,6 +84,8 @@ module Sentdm
|
|
|
76
84
|
#
|
|
77
85
|
# @param agent_id [String, nil] The agent attributed to the send, when the send was attributed to one.
|
|
78
86
|
#
|
|
87
|
+
# @param body [String, nil] The rendered message body, as plain text. Sent as null when we aren't asserting
|
|
88
|
+
#
|
|
79
89
|
# @param channel [String] The channel the message went out on, for example sms or whatsapp. A message
|
|
80
90
|
#
|
|
81
91
|
# @param message_id [String] The message this event describes. Stable across every event in the message's lif
|
|
@@ -17,6 +17,23 @@ module Sentdm
|
|
|
17
17
|
# @return [String, nil]
|
|
18
18
|
optional :id, String
|
|
19
19
|
|
|
20
|
+
# @!attribute auto_reply_action
|
|
21
|
+
# Which consent keyword this template answers, when it is one of Sent's
|
|
22
|
+
# auto-replies: OPT_IN, OPT_OUT, HELP, or OTHER for a customer-defined keyword.
|
|
23
|
+
# Null for an ordinary template, and omitted from the response, so its presence is
|
|
24
|
+
# the answer to "is this an auto-reply".
|
|
25
|
+
#
|
|
26
|
+
# Deliberately not required, unlike CustomerId, even though the same "no single
|
|
27
|
+
# mapper" argument applies: NJsonSchema publishes a C# required member in the
|
|
28
|
+
# schema's required array, so the contract would have advertised a field this
|
|
29
|
+
# response omits for every ordinary template, and a generated client could refuse
|
|
30
|
+
# the common case. A compile-time guard is not worth a wrong published contract.
|
|
31
|
+
# Every mapping site sets it explicitly, and TemplateResponseSchemaTests pins the
|
|
32
|
+
# field as optional so it cannot be reintroduced.
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :auto_reply_action, String, nil?: true
|
|
36
|
+
|
|
20
37
|
# @!attribute category
|
|
21
38
|
# Template category: MARKETING, UTILITY, AUTHENTICATION
|
|
22
39
|
#
|
|
@@ -24,7 +41,18 @@ module Sentdm
|
|
|
24
41
|
optional :category, String
|
|
25
42
|
|
|
26
43
|
# @!attribute channels
|
|
27
|
-
#
|
|
44
|
+
# The channels this template's definition can render on, in canonical order: sms,
|
|
45
|
+
# whatsapp, rcs.
|
|
46
|
+
#
|
|
47
|
+
# Derived from the definition's body, mirroring each channel's send-time fallback
|
|
48
|
+
# chain, so a channel is listed only when a real body would be produced for it:
|
|
49
|
+
# SMS reads sms ?? multiChannel, WhatsApp reads whatsapp ?? multiChannel, and RCS
|
|
50
|
+
# reads rcs ?? multiChannel ?? sms. A multiChannel body therefore reports all
|
|
51
|
+
# three, and the extra SMS fallback on RCS is why an sms/whatsapp pair reports RCS
|
|
52
|
+
# too.
|
|
53
|
+
#
|
|
54
|
+
# This says what the content can render on, not what may be sent: sending also
|
|
55
|
+
# needs the template approved for that channel.
|
|
28
56
|
#
|
|
29
57
|
# @return [Array<String>, nil]
|
|
30
58
|
optional :channels, Sentdm::Internal::Type::ArrayOf[String], nil?: true
|
|
@@ -54,7 +82,8 @@ module Sentdm
|
|
|
54
82
|
optional :name, String
|
|
55
83
|
|
|
56
84
|
# @!attribute status
|
|
57
|
-
# Template status:
|
|
85
|
+
# Template status: DRAFT, PENDING, APPROVED, REJECTED. A template created with
|
|
86
|
+
# submit_for_review: false starts as DRAFT and stays there until it is submitted.
|
|
58
87
|
#
|
|
59
88
|
# @return [String, nil]
|
|
60
89
|
optional :status, String
|
|
@@ -71,7 +100,7 @@ module Sentdm
|
|
|
71
100
|
# @return [Array<String>, nil]
|
|
72
101
|
optional :variables, Sentdm::Internal::Type::ArrayOf[String], nil?: true
|
|
73
102
|
|
|
74
|
-
# @!method initialize(customer_id:, id: nil, category: nil, channels: nil, created_at: nil, is_published: nil, language: nil, name: nil, status: nil, updated_at: nil, variables: nil)
|
|
103
|
+
# @!method initialize(customer_id:, id: nil, auto_reply_action: nil, category: nil, channels: nil, created_at: nil, is_published: nil, language: nil, name: nil, status: nil, updated_at: nil, variables: nil)
|
|
75
104
|
# Some parameter documentations has been truncated, see {Sentdm::Models::Template}
|
|
76
105
|
# for more details.
|
|
77
106
|
#
|
|
@@ -81,9 +110,11 @@ module Sentdm
|
|
|
81
110
|
#
|
|
82
111
|
# @param id [String] Unique template identifier
|
|
83
112
|
#
|
|
113
|
+
# @param auto_reply_action [String, nil] Which consent keyword this template answers, when it is one of Sent's auto-repli
|
|
114
|
+
#
|
|
84
115
|
# @param category [String] Template category: MARKETING, UTILITY, AUTHENTICATION
|
|
85
116
|
#
|
|
86
|
-
# @param channels [Array<String>, nil]
|
|
117
|
+
# @param channels [Array<String>, nil] The channels this template's definition can render on, in canonical order: sms,
|
|
87
118
|
#
|
|
88
119
|
# @param created_at [Time] When the template was created
|
|
89
120
|
#
|
|
@@ -93,7 +124,7 @@ module Sentdm
|
|
|
93
124
|
#
|
|
94
125
|
# @param name [String] Template display name
|
|
95
126
|
#
|
|
96
|
-
# @param status [String] Template status:
|
|
127
|
+
# @param status [String] Template status: DRAFT, PENDING, APPROVED, REJECTED. A template created with
|
|
97
128
|
#
|
|
98
129
|
# @param updated_at [Time, nil] When the template was last updated
|
|
99
130
|
#
|