sentdm 0.26.0 → 0.27.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 +27 -0
- data/README.md +1 -1
- data/lib/sentdm/models/inbound_message_event.rb +52 -0
- data/lib/sentdm/models/inbound_message_event_payload.rb +81 -0
- data/lib/sentdm/models/message_event.rb +53 -0
- data/lib/sentdm/models/message_event_payload.rb +92 -0
- data/lib/sentdm/models/profile_detail.rb +10 -2
- data/lib/sentdm/models/profiles/campaign_data.rb +1 -1
- data/lib/sentdm/models/template_event.rb +52 -0
- data/lib/sentdm/models/template_event_payload.rb +88 -0
- data/lib/sentdm/models/webhook_list_events_response.rb +45 -3
- data/lib/sentdm/models.rb +12 -0
- data/lib/sentdm/resources/messages.rb +6 -4
- data/lib/sentdm/resources/profiles.rb +3 -3
- data/lib/sentdm/resources/users.rb +3 -3
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +6 -0
- data/rbi/sentdm/models/inbound_message_event.rbi +88 -0
- data/rbi/sentdm/models/inbound_message_event_payload.rbi +122 -0
- data/rbi/sentdm/models/message_event.rbi +86 -0
- data/rbi/sentdm/models/message_event_payload.rbi +132 -0
- data/rbi/sentdm/models/profile_detail.rbi +8 -2
- data/rbi/sentdm/models/profiles/campaign_data.rbi +2 -2
- data/rbi/sentdm/models/template_event.rbi +84 -0
- data/rbi/sentdm/models/template_event_payload.rbi +131 -0
- data/rbi/sentdm/models/webhook_list_events_response.rbi +60 -4
- data/rbi/sentdm/models.rbi +12 -0
- data/rbi/sentdm/resources/messages.rbi +6 -4
- data/rbi/sentdm/resources/profiles.rbi +3 -2
- data/rbi/sentdm/resources/users.rbi +3 -2
- data/sig/sentdm/models/inbound_message_event.rbs +39 -0
- data/sig/sentdm/models/inbound_message_event_payload.rbs +69 -0
- data/sig/sentdm/models/message_event.rbs +39 -0
- data/sig/sentdm/models/message_event_payload.rbs +72 -0
- data/sig/sentdm/models/template_event.rbs +39 -0
- data/sig/sentdm/models/template_event_payload.rbs +76 -0
- data/sig/sentdm/models/webhook_list_events_response.rbs +18 -5
- data/sig/sentdm/models.rbs +12 -0
- metadata +20 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1fe0d0bd33cc0f7333bc39ef8e8dad0e38b2c1d3452a443bb16f7de1b4c14fc
|
|
4
|
+
data.tar.gz: 2aff81314575ca55fb4ba7f39e9ea9370c6ad389f89aa4ef7bd51723a3f51a03
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91b34527619316f7093d7716bc75d24f7e6df54b992f8e1bf302d9646f2e5909a7ef0f318976ca22fad58947a70d4f0c3f1f75a3101af185256769e82afc020a
|
|
7
|
+
data.tar.gz: c839bc5eedae76bfc24e8601d0da3ed4ca8bfbe25473e36d6b794ecdb9a7f13636974b581acc2e6d219668a5c196f27b334dd84a2a5b4b11fdde78d40744c884
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.27.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.26.0...v0.27.0) (2026-08-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Highlights
|
|
7
|
+
|
|
8
|
+
Webhook payloads are now typed. The events Sent POSTs to your endpoint — `MessageEvent`, `InboundMessageEvent` and `TemplateEvent`, each with its own payload type — are generated types you can deserialize into, instead of a shape you had to hand-write from the docs.
|
|
9
|
+
|
|
10
|
+
The webhook delivery log is typed too. `event_data` on `GET /v3/webhooks/{id}/events` returns the exact envelope that was delivered, and now describes itself as one of those three rather than an opaque object.
|
|
11
|
+
|
|
12
|
+
Also in this release:
|
|
13
|
+
|
|
14
|
+
- `csp_id` on the brand object is deprecated and will be removed in a later release. It identifies the Campaign Service Provider that registered the brand, which is Sent, so the value is the same for every account. There is no replacement. Your own TCR identifiers, `tcr_brand_id` and `universal_ein`, are unaffected.
|
|
15
|
+
- Corrected descriptions for blocked sends, which now name the cases that gate a send before any delivery attempt: insufficient balance, a template not approved for sending, and free-form content with no open conversation.
|
|
16
|
+
- `campaign.volume` documents what an omitted value does. Leave it out and the campaign registers as standard, the higher-fee tier, with no error.
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **api:** sync OpenAPI spec from production ([3913d60](https://github.com/sentdm/sent-dm-ruby/commit/3913d6099298feaa278b76ac8a44f7809e13e815))
|
|
21
|
+
* **api:** sync OpenAPI spec from production ([cb9fb87](https://github.com/sentdm/sent-dm-ruby/commit/cb9fb87ae298bc8c33adcc9f3960102215502d47))
|
|
22
|
+
* **api:** sync OpenAPI spec from production ([8690f90](https://github.com/sentdm/sent-dm-ruby/commit/8690f905c974d5c45da6f6b1c9b0883b550c871f))
|
|
23
|
+
* **sdk:** expose the delivered webhook payloads as models ([4b43f3f](https://github.com/sentdm/sent-dm-ruby/commit/4b43f3f16729ec3ee3736149308ffc7ada08480a))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Chores
|
|
27
|
+
|
|
28
|
+
* add eager seal-dispatch workflow ([c005db3](https://github.com/sentdm/sent-dm-ruby/commit/c005db35357a408367f76e964e00912f5fc83116))
|
|
29
|
+
|
|
3
30
|
## [0.26.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.25.0...v0.26.0) (2026-08-08)
|
|
4
31
|
|
|
5
32
|
|
data/README.md
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class InboundMessageEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute event
|
|
7
|
+
# The specific event within the family, for example message.delivered or
|
|
8
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
9
|
+
# optional.
|
|
10
|
+
#
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
optional :event, String, nil?: true
|
|
13
|
+
|
|
14
|
+
# @!attribute field
|
|
15
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
16
|
+
# event for the specific change.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :field, String
|
|
20
|
+
|
|
21
|
+
# @!attribute payload
|
|
22
|
+
# Body of a message.received event. Delivered when a contact messages one of your
|
|
23
|
+
# numbers.
|
|
24
|
+
#
|
|
25
|
+
# @return [Sentdm::Models::InboundMessageEventPayload, nil]
|
|
26
|
+
optional :payload, -> { Sentdm::InboundMessageEventPayload }, nil?: true
|
|
27
|
+
|
|
28
|
+
# @!attribute timestamp
|
|
29
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
30
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
31
|
+
# payload for the latter.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :timestamp, String
|
|
35
|
+
|
|
36
|
+
# @!method initialize(event: nil, field: nil, payload: nil, timestamp: nil)
|
|
37
|
+
# Some parameter documentations has been truncated, see
|
|
38
|
+
# {Sentdm::Models::InboundMessageEvent} for more details.
|
|
39
|
+
#
|
|
40
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
41
|
+
# this shape and varies only in Payload.
|
|
42
|
+
#
|
|
43
|
+
# @param event [String, nil] The specific event within the family, for example message.delivered or
|
|
44
|
+
#
|
|
45
|
+
# @param field [String] The event family, for example message or templates. Route on this first, then
|
|
46
|
+
#
|
|
47
|
+
# @param payload [Sentdm::Models::InboundMessageEventPayload, nil] Body of a message.received event. Delivered when a contact messages one of your
|
|
48
|
+
#
|
|
49
|
+
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class InboundMessageEventPayload < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute account_id
|
|
7
|
+
# The account the message belongs to.
|
|
8
|
+
#
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
optional :account_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute channel
|
|
13
|
+
# The channel the message arrived on, for example sms or whatsapp.
|
|
14
|
+
#
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
optional :channel, String
|
|
17
|
+
|
|
18
|
+
# @!attribute inbound_number
|
|
19
|
+
# The contact's number in E.164 format, meaning the number the message came from.
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
optional :inbound_number, String
|
|
23
|
+
|
|
24
|
+
# @!attribute message_id
|
|
25
|
+
# The inbound message.
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :message_id, String
|
|
29
|
+
|
|
30
|
+
# @!attribute outbound_number
|
|
31
|
+
# Your number in E.164 format, meaning the number the message was addressed to.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :outbound_number, String
|
|
35
|
+
|
|
36
|
+
# @!attribute received_at
|
|
37
|
+
# When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
38
|
+
#
|
|
39
|
+
# @return [String, nil]
|
|
40
|
+
optional :received_at, String
|
|
41
|
+
|
|
42
|
+
# @!attribute text
|
|
43
|
+
# The message body. Sent as null when the inbound message carried no text, for
|
|
44
|
+
# example a media-only message. The field is always present, so read it and check
|
|
45
|
+
# for null rather than checking whether the key exists.
|
|
46
|
+
#
|
|
47
|
+
# @return [String, nil]
|
|
48
|
+
optional :text, String, nil?: true
|
|
49
|
+
|
|
50
|
+
# @!attribute updated_at
|
|
51
|
+
# When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ). Same value as
|
|
52
|
+
# ReceivedAt, kept for envelope consistency with outbound events.
|
|
53
|
+
#
|
|
54
|
+
# @return [String, nil]
|
|
55
|
+
optional :updated_at, String
|
|
56
|
+
|
|
57
|
+
# @!method initialize(account_id: nil, channel: nil, inbound_number: nil, message_id: nil, outbound_number: nil, received_at: nil, text: nil, updated_at: nil)
|
|
58
|
+
# Some parameter documentations has been truncated, see
|
|
59
|
+
# {Sentdm::Models::InboundMessageEventPayload} for more details.
|
|
60
|
+
#
|
|
61
|
+
# Body of a message.received event. Delivered when a contact messages one of your
|
|
62
|
+
# numbers.
|
|
63
|
+
#
|
|
64
|
+
# @param account_id [String] The account the message belongs to.
|
|
65
|
+
#
|
|
66
|
+
# @param channel [String] The channel the message arrived on, for example sms or whatsapp.
|
|
67
|
+
#
|
|
68
|
+
# @param inbound_number [String] The contact's number in E.164 format, meaning the number the message came from.
|
|
69
|
+
#
|
|
70
|
+
# @param message_id [String] The inbound message.
|
|
71
|
+
#
|
|
72
|
+
# @param outbound_number [String] Your number in E.164 format, meaning the number the message was addressed to.
|
|
73
|
+
#
|
|
74
|
+
# @param received_at [String] When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
75
|
+
#
|
|
76
|
+
# @param text [String, nil] The message body. Sent as null when the inbound message carried no text, for
|
|
77
|
+
#
|
|
78
|
+
# @param updated_at [String] When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ). Same value as
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class MessageEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute event
|
|
7
|
+
# The specific event within the family, for example message.delivered or
|
|
8
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
9
|
+
# optional.
|
|
10
|
+
#
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
optional :event, String, nil?: true
|
|
13
|
+
|
|
14
|
+
# @!attribute field
|
|
15
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
16
|
+
# event for the specific change.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :field, String
|
|
20
|
+
|
|
21
|
+
# @!attribute payload
|
|
22
|
+
# Body of an outbound message lifecycle event. Delivered once per status change,
|
|
23
|
+
# so a single message produces several of these as it moves toward a terminal
|
|
24
|
+
# status.
|
|
25
|
+
#
|
|
26
|
+
# @return [Sentdm::Models::MessageEventPayload, nil]
|
|
27
|
+
optional :payload, -> { Sentdm::MessageEventPayload }, nil?: true
|
|
28
|
+
|
|
29
|
+
# @!attribute timestamp
|
|
30
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
31
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
32
|
+
# payload for the latter.
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :timestamp, String
|
|
36
|
+
|
|
37
|
+
# @!method initialize(event: nil, field: nil, payload: nil, timestamp: nil)
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {Sentdm::Models::MessageEvent} for more details.
|
|
40
|
+
#
|
|
41
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
42
|
+
# this shape and varies only in Payload.
|
|
43
|
+
#
|
|
44
|
+
# @param event [String, nil] The specific event within the family, for example message.delivered or
|
|
45
|
+
#
|
|
46
|
+
# @param field [String] The event family, for example message or templates. Route on this first, then
|
|
47
|
+
#
|
|
48
|
+
# @param payload [Sentdm::Models::MessageEventPayload, nil] Body of an outbound message lifecycle event. Delivered once per status change, s
|
|
49
|
+
#
|
|
50
|
+
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class MessageEventPayload < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute account_id
|
|
7
|
+
# The account the message belongs to.
|
|
8
|
+
#
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
optional :account_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute agent_id
|
|
13
|
+
# The agent attributed to the send, when the send was attributed to one.
|
|
14
|
+
#
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
optional :agent_id, String, nil?: true
|
|
17
|
+
|
|
18
|
+
# @!attribute channel
|
|
19
|
+
# The channel the message went out on, for example sms or whatsapp. A message that
|
|
20
|
+
# falls back to another channel reports the channel actually used.
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :channel, String
|
|
24
|
+
|
|
25
|
+
# @!attribute message_id
|
|
26
|
+
# The message this event describes. Stable across every event in the message's
|
|
27
|
+
# lifecycle, so use it to correlate them.
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :message_id, String
|
|
31
|
+
|
|
32
|
+
# @!attribute message_status
|
|
33
|
+
# The status the message just reached, for example SENT, DELIVERED, or FAILED.
|
|
34
|
+
# Sent means dispatched and delivered means confirmed, so treat them as distinct
|
|
35
|
+
# outcomes.
|
|
36
|
+
#
|
|
37
|
+
# @return [String, nil]
|
|
38
|
+
optional :message_status, String
|
|
39
|
+
|
|
40
|
+
# @!attribute outbound_number
|
|
41
|
+
# The recipient's number in E.164 format.
|
|
42
|
+
#
|
|
43
|
+
# @return [String, nil]
|
|
44
|
+
optional :outbound_number, String
|
|
45
|
+
|
|
46
|
+
# @!attribute template_id
|
|
47
|
+
# The template the message was sent from, when it was sent from one.
|
|
48
|
+
#
|
|
49
|
+
# @return [String, nil]
|
|
50
|
+
optional :template_id, String, nil?: true
|
|
51
|
+
|
|
52
|
+
# @!attribute template_name
|
|
53
|
+
# Name of the template the message was sent from. Omitted when the message wasn't
|
|
54
|
+
# template-based.
|
|
55
|
+
#
|
|
56
|
+
# @return [String, nil]
|
|
57
|
+
optional :template_name, String, nil?: true
|
|
58
|
+
|
|
59
|
+
# @!attribute updated_at
|
|
60
|
+
# When the message reached MessageStatus, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
61
|
+
#
|
|
62
|
+
# @return [String, nil]
|
|
63
|
+
optional :updated_at, String
|
|
64
|
+
|
|
65
|
+
# @!method initialize(account_id: nil, agent_id: nil, channel: nil, message_id: nil, message_status: nil, outbound_number: nil, template_id: nil, template_name: nil, updated_at: nil)
|
|
66
|
+
# Some parameter documentations has been truncated, see
|
|
67
|
+
# {Sentdm::Models::MessageEventPayload} for more details.
|
|
68
|
+
#
|
|
69
|
+
# Body of an outbound message lifecycle event. Delivered once per status change,
|
|
70
|
+
# so a single message produces several of these as it moves toward a terminal
|
|
71
|
+
# status.
|
|
72
|
+
#
|
|
73
|
+
# @param account_id [String] The account the message belongs to.
|
|
74
|
+
#
|
|
75
|
+
# @param agent_id [String, nil] The agent attributed to the send, when the send was attributed to one.
|
|
76
|
+
#
|
|
77
|
+
# @param channel [String] The channel the message went out on, for example sms or whatsapp. A message
|
|
78
|
+
#
|
|
79
|
+
# @param message_id [String] The message this event describes. Stable across every event in the message's lif
|
|
80
|
+
#
|
|
81
|
+
# @param message_status [String] The status the message just reached, for example SENT, DELIVERED, or
|
|
82
|
+
#
|
|
83
|
+
# @param outbound_number [String] The recipient's number in E.164 format.
|
|
84
|
+
#
|
|
85
|
+
# @param template_id [String, nil] The template the message was sent from, when it was sent from one.
|
|
86
|
+
#
|
|
87
|
+
# @param template_name [String, nil] Name of the template the message was sent from. Omitted when the message wasn't
|
|
88
|
+
#
|
|
89
|
+
# @param updated_at [String] When the message reached MessageStatus, in UTC
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -276,7 +276,12 @@ module Sentdm
|
|
|
276
276
|
optional :created_at, Time
|
|
277
277
|
|
|
278
278
|
# @!attribute csp_id
|
|
279
|
-
#
|
|
279
|
+
# @deprecated
|
|
280
|
+
#
|
|
281
|
+
# Deprecated and scheduled for removal. Identifies the Campaign Service Provider
|
|
282
|
+
# that registered the brand, which is Sent, so the value is the same for every
|
|
283
|
+
# brand and every account. Nothing on your side can act on it and there is no
|
|
284
|
+
# replacement. Stop reading it.
|
|
280
285
|
#
|
|
281
286
|
# @return [String, nil]
|
|
282
287
|
optional :csp_id, String, nil?: true
|
|
@@ -328,6 +333,9 @@ module Sentdm
|
|
|
328
333
|
optional :updated_at, Time, nil?: true
|
|
329
334
|
|
|
330
335
|
# @!method initialize(id: nil, business: nil, compliance: nil, contact: nil, created_at: nil, csp_id: nil, identity_status: nil, is_inherited: nil, status: nil, submitted_at: nil, submitted_to_tcr: nil, tcr_brand_id: nil, universal_ein: nil, updated_at: nil)
|
|
336
|
+
# Some parameter documentations has been truncated, see
|
|
337
|
+
# {Sentdm::Models::ProfileDetail::Brand} for more details.
|
|
338
|
+
#
|
|
331
339
|
# Brand response with nested contact, business, and compliance sections — mirrors
|
|
332
340
|
# the request structure.
|
|
333
341
|
#
|
|
@@ -341,7 +349,7 @@ module Sentdm
|
|
|
341
349
|
#
|
|
342
350
|
# @param created_at [Time] When the brand was created
|
|
343
351
|
#
|
|
344
|
-
# @param csp_id [String, nil]
|
|
352
|
+
# @param csp_id [String, nil] Deprecated and scheduled for removal. Identifies the Campaign Service Provider t
|
|
345
353
|
#
|
|
346
354
|
# @param identity_status [Symbol, Sentdm::Models::ProfileDetail::Brand::IdentityStatus, nil]
|
|
347
355
|
#
|
|
@@ -86,7 +86,7 @@ module Sentdm
|
|
|
86
86
|
|
|
87
87
|
# @!attribute volume
|
|
88
88
|
# Expected messaging volume for this campaign. Numeric string (e.g. "1999",
|
|
89
|
-
# "5000")
|
|
89
|
+
# "5000"). Values below 2000 bill at the low-volume tier.
|
|
90
90
|
#
|
|
91
91
|
# @return [String, nil]
|
|
92
92
|
optional :volume, String, nil?: true
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class TemplateEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute event
|
|
7
|
+
# The specific event within the family, for example message.delivered or
|
|
8
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
9
|
+
# optional.
|
|
10
|
+
#
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
optional :event, String, nil?: true
|
|
13
|
+
|
|
14
|
+
# @!attribute field
|
|
15
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
16
|
+
# event for the specific change.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :field, String
|
|
20
|
+
|
|
21
|
+
# @!attribute payload
|
|
22
|
+
# Body of a template status event. Delivered when a template's review outcome
|
|
23
|
+
# changes, so you can react without polling.
|
|
24
|
+
#
|
|
25
|
+
# @return [Sentdm::Models::TemplateEventPayload, nil]
|
|
26
|
+
optional :payload, -> { Sentdm::TemplateEventPayload }, nil?: true
|
|
27
|
+
|
|
28
|
+
# @!attribute timestamp
|
|
29
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
30
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
31
|
+
# payload for the latter.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :timestamp, String
|
|
35
|
+
|
|
36
|
+
# @!method initialize(event: nil, field: nil, payload: nil, timestamp: nil)
|
|
37
|
+
# Some parameter documentations has been truncated, see
|
|
38
|
+
# {Sentdm::Models::TemplateEvent} for more details.
|
|
39
|
+
#
|
|
40
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
41
|
+
# this shape and varies only in Payload.
|
|
42
|
+
#
|
|
43
|
+
# @param event [String, nil] The specific event within the family, for example message.delivered or
|
|
44
|
+
#
|
|
45
|
+
# @param field [String] The event family, for example message or templates. Route on this first, then
|
|
46
|
+
#
|
|
47
|
+
# @param payload [Sentdm::Models::TemplateEventPayload, nil] Body of a template status event. Delivered when a template's review outcome chan
|
|
48
|
+
#
|
|
49
|
+
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class TemplateEventPayload < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute account_id
|
|
7
|
+
# The account the template belongs to.
|
|
8
|
+
#
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
optional :account_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute category
|
|
13
|
+
# The template's category, for example UTILITY, MARKETING, or AUTHENTICATION.
|
|
14
|
+
#
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
optional :category, String
|
|
17
|
+
|
|
18
|
+
# @!attribute channel
|
|
19
|
+
# The channel the template applies to.
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
optional :channel, String
|
|
23
|
+
|
|
24
|
+
# @!attribute language
|
|
25
|
+
# The template's language code, for example en_US.
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :language, String
|
|
29
|
+
|
|
30
|
+
# @!attribute reason
|
|
31
|
+
# Why the template reached Status, when a reason was given. Populated on a
|
|
32
|
+
# rejection.
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :reason, String, nil?: true
|
|
36
|
+
|
|
37
|
+
# @!attribute status
|
|
38
|
+
# The review status the template just reached, for example APPROVED or REJECTED.
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :status, String
|
|
42
|
+
|
|
43
|
+
# @!attribute template_id
|
|
44
|
+
# The template in Sent.
|
|
45
|
+
#
|
|
46
|
+
# @return [String, nil]
|
|
47
|
+
optional :template_id, String
|
|
48
|
+
|
|
49
|
+
# @!attribute template_name
|
|
50
|
+
# The template's display name.
|
|
51
|
+
#
|
|
52
|
+
# @return [String, nil]
|
|
53
|
+
optional :template_name, String
|
|
54
|
+
|
|
55
|
+
# @!attribute whatsapp_template_id
|
|
56
|
+
# The template's identifier with Meta, assigned when the template is submitted for
|
|
57
|
+
# review.
|
|
58
|
+
#
|
|
59
|
+
# @return [String, nil]
|
|
60
|
+
optional :whatsapp_template_id, String
|
|
61
|
+
|
|
62
|
+
# @!method initialize(account_id: nil, category: nil, channel: nil, language: nil, reason: nil, status: nil, template_id: nil, template_name: nil, whatsapp_template_id: nil)
|
|
63
|
+
# Some parameter documentations has been truncated, see
|
|
64
|
+
# {Sentdm::Models::TemplateEventPayload} for more details.
|
|
65
|
+
#
|
|
66
|
+
# Body of a template status event. Delivered when a template's review outcome
|
|
67
|
+
# changes, so you can react without polling.
|
|
68
|
+
#
|
|
69
|
+
# @param account_id [String] The account the template belongs to.
|
|
70
|
+
#
|
|
71
|
+
# @param category [String] The template's category, for example UTILITY, MARKETING, or
|
|
72
|
+
#
|
|
73
|
+
# @param channel [String] The channel the template applies to.
|
|
74
|
+
#
|
|
75
|
+
# @param language [String] The template's language code, for example en_US.
|
|
76
|
+
#
|
|
77
|
+
# @param reason [String, nil] Why the template reached Status, when a reason was given. Populated on a
|
|
78
|
+
#
|
|
79
|
+
# @param status [String] The review status the template just reached, for example APPROVED or
|
|
80
|
+
#
|
|
81
|
+
# @param template_id [String] The template in Sent.
|
|
82
|
+
#
|
|
83
|
+
# @param template_name [String] The template's display name.
|
|
84
|
+
#
|
|
85
|
+
# @param whatsapp_template_id [String] The template's identifier with Meta, assigned when the template is submitted for
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -87,9 +87,13 @@ module Sentdm
|
|
|
87
87
|
optional :error_message, String, nil?: true
|
|
88
88
|
|
|
89
89
|
# @!attribute event_data
|
|
90
|
+
# The exact event body that was delivered, or attempted, for this record. One of
|
|
91
|
+
# the three webhook envelopes: a message status change, an inbound message, or a
|
|
92
|
+
# template status change. Read field and event to tell which, the same way your
|
|
93
|
+
# endpoint does.
|
|
90
94
|
#
|
|
91
|
-
# @return [
|
|
92
|
-
optional :event_data, Sentdm::
|
|
95
|
+
# @return [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, nil]
|
|
96
|
+
optional :event_data, union: -> { Sentdm::Models::WebhookListEventsResponse::Data::Event::EventData }
|
|
93
97
|
|
|
94
98
|
# @!attribute event_type
|
|
95
99
|
#
|
|
@@ -117,17 +121,55 @@ module Sentdm
|
|
|
117
121
|
optional :response_body, String, nil?: true
|
|
118
122
|
|
|
119
123
|
# @!method initialize(id: nil, created_at: nil, delivery_attempts: nil, delivery_status: nil, error_message: nil, event_data: nil, event_type: nil, http_status_code: nil, processing_completed_at: nil, processing_started_at: nil, response_body: nil)
|
|
124
|
+
# Some parameter documentations has been truncated, see
|
|
125
|
+
# {Sentdm::Models::WebhookListEventsResponse::Data::Event} for more details.
|
|
126
|
+
#
|
|
120
127
|
# @param id [String]
|
|
128
|
+
#
|
|
121
129
|
# @param created_at [Time]
|
|
130
|
+
#
|
|
122
131
|
# @param delivery_attempts [Integer]
|
|
132
|
+
#
|
|
123
133
|
# @param delivery_status [String]
|
|
134
|
+
#
|
|
124
135
|
# @param error_message [String, nil]
|
|
125
|
-
#
|
|
136
|
+
#
|
|
137
|
+
# @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
|
|
138
|
+
#
|
|
126
139
|
# @param event_type [String]
|
|
140
|
+
#
|
|
127
141
|
# @param http_status_code [Integer, nil]
|
|
142
|
+
#
|
|
128
143
|
# @param processing_completed_at [Time, nil]
|
|
144
|
+
#
|
|
129
145
|
# @param processing_started_at [Time, nil]
|
|
146
|
+
#
|
|
130
147
|
# @param response_body [String, nil]
|
|
148
|
+
|
|
149
|
+
# The exact event body that was delivered, or attempted, for this record. One of
|
|
150
|
+
# the three webhook envelopes: a message status change, an inbound message, or a
|
|
151
|
+
# template status change. Read field and event to tell which, the same way your
|
|
152
|
+
# endpoint does.
|
|
153
|
+
#
|
|
154
|
+
# @see Sentdm::Models::WebhookListEventsResponse::Data::Event#event_data
|
|
155
|
+
module EventData
|
|
156
|
+
extend Sentdm::Internal::Type::Union
|
|
157
|
+
|
|
158
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
159
|
+
# varies only in Payload.
|
|
160
|
+
variant -> { Sentdm::MessageEvent }
|
|
161
|
+
|
|
162
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
163
|
+
# varies only in Payload.
|
|
164
|
+
variant -> { Sentdm::InboundMessageEvent }
|
|
165
|
+
|
|
166
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
167
|
+
# varies only in Payload.
|
|
168
|
+
variant -> { Sentdm::TemplateEvent }
|
|
169
|
+
|
|
170
|
+
# @!method self.variants
|
|
171
|
+
# @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent)]
|
|
172
|
+
end
|
|
131
173
|
end
|
|
132
174
|
end
|
|
133
175
|
end
|
data/lib/sentdm/models.rb
CHANGED
|
@@ -93,8 +93,16 @@ module Sentdm
|
|
|
93
93
|
|
|
94
94
|
ErrorDetail = Sentdm::Models::ErrorDetail
|
|
95
95
|
|
|
96
|
+
InboundMessageEvent = Sentdm::Models::InboundMessageEvent
|
|
97
|
+
|
|
98
|
+
InboundMessageEventPayload = Sentdm::Models::InboundMessageEventPayload
|
|
99
|
+
|
|
96
100
|
MeRetrieveParams = Sentdm::Models::MeRetrieveParams
|
|
97
101
|
|
|
102
|
+
MessageEvent = Sentdm::Models::MessageEvent
|
|
103
|
+
|
|
104
|
+
MessageEventPayload = Sentdm::Models::MessageEventPayload
|
|
105
|
+
|
|
98
106
|
MessageRetrieveActivitiesParams = Sentdm::Models::MessageRetrieveActivitiesParams
|
|
99
107
|
|
|
100
108
|
MessageRetrieveStatusParams = Sentdm::Models::MessageRetrieveStatusParams
|
|
@@ -147,6 +155,10 @@ module Sentdm
|
|
|
147
155
|
|
|
148
156
|
TemplateDeleteParams = Sentdm::Models::TemplateDeleteParams
|
|
149
157
|
|
|
158
|
+
TemplateEvent = Sentdm::Models::TemplateEvent
|
|
159
|
+
|
|
160
|
+
TemplateEventPayload = Sentdm::Models::TemplateEventPayload
|
|
161
|
+
|
|
150
162
|
TemplateFooter = Sentdm::Models::TemplateFooter
|
|
151
163
|
|
|
152
164
|
TemplateHeader = Sentdm::Models::TemplateHeader
|
|
@@ -67,10 +67,12 @@ module Sentdm
|
|
|
67
67
|
# multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
|
|
68
68
|
# "whatsapp"]), a separate message is created for each (recipient, channel) pair.
|
|
69
69
|
# Returns immediately with per-recipient message IDs for async tracking via
|
|
70
|
-
# webhooks or the GET /messages/{id} endpoint.
|
|
71
|
-
#
|
|
72
|
-
#
|
|
73
|
-
#
|
|
70
|
+
# webhooks or the GET /messages/{id} endpoint. Sends gated before any delivery
|
|
71
|
+
# attempt do not reject the request — an account-level precondition such as
|
|
72
|
+
# insufficient balance, a template not approved for sending, or free-form content
|
|
73
|
+
# with no open conversation with the contact. The send is accepted with 202 and
|
|
74
|
+
# the affected messages are reported as BLOCKED on GET /messages/{id} and the
|
|
75
|
+
# message.blocked webhook.
|
|
74
76
|
#
|
|
75
77
|
# @overload send_(channel: nil, sandbox: nil, template: nil, text: nil, to: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
76
78
|
#
|
|
@@ -113,7 +113,7 @@ module Sentdm
|
|
|
113
113
|
#
|
|
114
114
|
# @overload retrieve(profile_id, x_profile_id: nil, request_options: {})
|
|
115
115
|
#
|
|
116
|
-
# @param profile_id [String]
|
|
116
|
+
# @param profile_id [String] Profile ID from route parameter
|
|
117
117
|
#
|
|
118
118
|
# @param x_profile_id [String] Profile UUID to scope the request to a child profile. Only organization API keys
|
|
119
119
|
#
|
|
@@ -157,7 +157,7 @@ module Sentdm
|
|
|
157
157
|
#
|
|
158
158
|
# @overload update(profile_id, allow_contact_sharing: nil, allow_number_change_during_onboarding: nil, allow_template_sharing: nil, billing_contact: nil, billing_model: nil, brand: nil, description: nil, icon: nil, inherit_contacts: nil, inherit_tcr_brand: nil, inherit_tcr_campaign: nil, inherit_templates: nil, name: nil, payment_details: nil, sandbox: nil, sending_phone_number: nil, sending_phone_number_profile_id: nil, sending_whatsapp_number_profile_id: nil, short_name: nil, whatsapp_phone_number: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
159
159
|
#
|
|
160
|
-
# @param profile_id [String] Path param
|
|
160
|
+
# @param profile_id [String] Path param: Profile ID from route parameter
|
|
161
161
|
#
|
|
162
162
|
# @param allow_contact_sharing [Boolean, nil] Body param: Whether contacts are shared across profiles (optional)
|
|
163
163
|
#
|
|
@@ -257,7 +257,7 @@ module Sentdm
|
|
|
257
257
|
#
|
|
258
258
|
# @overload delete(profile_id, sandbox: nil, x_profile_id: nil, request_options: {})
|
|
259
259
|
#
|
|
260
|
-
# @param profile_id [String] Path param
|
|
260
|
+
# @param profile_id [String] Path param: Profile ID from route parameter
|
|
261
261
|
#
|
|
262
262
|
# @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
|
|
263
263
|
#
|