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
|
@@ -12,7 +12,7 @@ module Sentdm
|
|
|
12
12
|
#
|
|
13
13
|
# @overload retrieve(user_id, x_profile_id: nil, request_options: {})
|
|
14
14
|
#
|
|
15
|
-
# @param user_id [String]
|
|
15
|
+
# @param user_id [String] User ID from route parameter
|
|
16
16
|
#
|
|
17
17
|
# @param x_profile_id [String] Profile UUID to scope the request to a child profile. Only organization API keys
|
|
18
18
|
#
|
|
@@ -106,7 +106,7 @@ module Sentdm
|
|
|
106
106
|
#
|
|
107
107
|
# @overload remove(user_id, sandbox: nil, x_profile_id: nil, request_options: {})
|
|
108
108
|
#
|
|
109
|
-
# @param user_id [String] Path param
|
|
109
|
+
# @param user_id [String] Path param: User ID from route parameter
|
|
110
110
|
#
|
|
111
111
|
# @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
|
|
112
112
|
#
|
|
@@ -138,7 +138,7 @@ module Sentdm
|
|
|
138
138
|
#
|
|
139
139
|
# @overload update_role(user_id, role: nil, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
140
140
|
#
|
|
141
|
-
# @param user_id [String] Path param
|
|
141
|
+
# @param user_id [String] Path param: User ID from route parameter
|
|
142
142
|
#
|
|
143
143
|
# @param role [String] Body param: User role: admin, billing, or developer (required)
|
|
144
144
|
#
|
data/lib/sentdm/version.rb
CHANGED
data/lib/sentdm.rb
CHANGED
|
@@ -81,8 +81,12 @@ require_relative "sentdm/models/conversation_list_params"
|
|
|
81
81
|
require_relative "sentdm/models/conversation_messages_list"
|
|
82
82
|
require_relative "sentdm/models/destination_country"
|
|
83
83
|
require_relative "sentdm/models/error_detail"
|
|
84
|
+
require_relative "sentdm/models/inbound_message_event"
|
|
85
|
+
require_relative "sentdm/models/inbound_message_event_payload"
|
|
84
86
|
require_relative "sentdm/models/me_retrieve_params"
|
|
85
87
|
require_relative "sentdm/models/me_retrieve_response"
|
|
88
|
+
require_relative "sentdm/models/message_event"
|
|
89
|
+
require_relative "sentdm/models/message_event_payload"
|
|
86
90
|
require_relative "sentdm/models/message_retrieve_activities_params"
|
|
87
91
|
require_relative "sentdm/models/message_retrieve_activities_response"
|
|
88
92
|
require_relative "sentdm/models/message_retrieve_status_params"
|
|
@@ -124,6 +128,8 @@ require_relative "sentdm/models/template_button_props"
|
|
|
124
128
|
require_relative "sentdm/models/template_create_params"
|
|
125
129
|
require_relative "sentdm/models/template_definition"
|
|
126
130
|
require_relative "sentdm/models/template_delete_params"
|
|
131
|
+
require_relative "sentdm/models/template_event"
|
|
132
|
+
require_relative "sentdm/models/template_event_payload"
|
|
127
133
|
require_relative "sentdm/models/template_footer"
|
|
128
134
|
require_relative "sentdm/models/template_header"
|
|
129
135
|
require_relative "sentdm/models/template_list_params"
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class InboundMessageEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Sentdm::InboundMessageEvent, Sentdm::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The specific event within the family, for example message.delivered or
|
|
12
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
13
|
+
# optional.
|
|
14
|
+
sig { returns(T.nilable(String)) }
|
|
15
|
+
attr_accessor :event
|
|
16
|
+
|
|
17
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
18
|
+
# event for the specific change.
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_reader :field
|
|
21
|
+
|
|
22
|
+
sig { params(field: String).void }
|
|
23
|
+
attr_writer :field
|
|
24
|
+
|
|
25
|
+
# Body of a message.received event. Delivered when a contact messages one of your
|
|
26
|
+
# numbers.
|
|
27
|
+
sig { returns(T.nilable(Sentdm::InboundMessageEventPayload)) }
|
|
28
|
+
attr_reader :payload
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
payload: T.nilable(Sentdm::InboundMessageEventPayload::OrHash)
|
|
33
|
+
).void
|
|
34
|
+
end
|
|
35
|
+
attr_writer :payload
|
|
36
|
+
|
|
37
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
38
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
39
|
+
# payload for the latter.
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_reader :timestamp
|
|
42
|
+
|
|
43
|
+
sig { params(timestamp: String).void }
|
|
44
|
+
attr_writer :timestamp
|
|
45
|
+
|
|
46
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
47
|
+
# this shape and varies only in Payload.
|
|
48
|
+
sig do
|
|
49
|
+
params(
|
|
50
|
+
event: T.nilable(String),
|
|
51
|
+
field: String,
|
|
52
|
+
payload: T.nilable(Sentdm::InboundMessageEventPayload::OrHash),
|
|
53
|
+
timestamp: String
|
|
54
|
+
).returns(T.attached_class)
|
|
55
|
+
end
|
|
56
|
+
def self.new(
|
|
57
|
+
# The specific event within the family, for example message.delivered or
|
|
58
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
59
|
+
# optional.
|
|
60
|
+
event: nil,
|
|
61
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
62
|
+
# event for the specific change.
|
|
63
|
+
field: nil,
|
|
64
|
+
# Body of a message.received event. Delivered when a contact messages one of your
|
|
65
|
+
# numbers.
|
|
66
|
+
payload: nil,
|
|
67
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
68
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
69
|
+
# payload for the latter.
|
|
70
|
+
timestamp: nil
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{
|
|
77
|
+
event: T.nilable(String),
|
|
78
|
+
field: String,
|
|
79
|
+
payload: T.nilable(Sentdm::InboundMessageEventPayload),
|
|
80
|
+
timestamp: String
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
def to_hash
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class InboundMessageEventPayload < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Sentdm::InboundMessageEventPayload, Sentdm::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The account the message belongs to.
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_reader :account_id
|
|
14
|
+
|
|
15
|
+
sig { params(account_id: String).void }
|
|
16
|
+
attr_writer :account_id
|
|
17
|
+
|
|
18
|
+
# The channel the message arrived on, for example sms or whatsapp.
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_reader :channel
|
|
21
|
+
|
|
22
|
+
sig { params(channel: String).void }
|
|
23
|
+
attr_writer :channel
|
|
24
|
+
|
|
25
|
+
# The contact's number in E.164 format, meaning the number the message came from.
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_reader :inbound_number
|
|
28
|
+
|
|
29
|
+
sig { params(inbound_number: String).void }
|
|
30
|
+
attr_writer :inbound_number
|
|
31
|
+
|
|
32
|
+
# The inbound message.
|
|
33
|
+
sig { returns(T.nilable(String)) }
|
|
34
|
+
attr_reader :message_id
|
|
35
|
+
|
|
36
|
+
sig { params(message_id: String).void }
|
|
37
|
+
attr_writer :message_id
|
|
38
|
+
|
|
39
|
+
# Your number in E.164 format, meaning the number the message was addressed to.
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_reader :outbound_number
|
|
42
|
+
|
|
43
|
+
sig { params(outbound_number: String).void }
|
|
44
|
+
attr_writer :outbound_number
|
|
45
|
+
|
|
46
|
+
# When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
47
|
+
sig { returns(T.nilable(String)) }
|
|
48
|
+
attr_reader :received_at
|
|
49
|
+
|
|
50
|
+
sig { params(received_at: String).void }
|
|
51
|
+
attr_writer :received_at
|
|
52
|
+
|
|
53
|
+
# The message body. Sent as null when the inbound message carried no text, for
|
|
54
|
+
# example a media-only message. The field is always present, so read it and check
|
|
55
|
+
# for null rather than checking whether the key exists.
|
|
56
|
+
sig { returns(T.nilable(String)) }
|
|
57
|
+
attr_accessor :text
|
|
58
|
+
|
|
59
|
+
# When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ). Same value as
|
|
60
|
+
# ReceivedAt, kept for envelope consistency with outbound events.
|
|
61
|
+
sig { returns(T.nilable(String)) }
|
|
62
|
+
attr_reader :updated_at
|
|
63
|
+
|
|
64
|
+
sig { params(updated_at: String).void }
|
|
65
|
+
attr_writer :updated_at
|
|
66
|
+
|
|
67
|
+
# Body of a message.received event. Delivered when a contact messages one of your
|
|
68
|
+
# numbers.
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
account_id: String,
|
|
72
|
+
channel: String,
|
|
73
|
+
inbound_number: String,
|
|
74
|
+
message_id: String,
|
|
75
|
+
outbound_number: String,
|
|
76
|
+
received_at: String,
|
|
77
|
+
text: T.nilable(String),
|
|
78
|
+
updated_at: String
|
|
79
|
+
).returns(T.attached_class)
|
|
80
|
+
end
|
|
81
|
+
def self.new(
|
|
82
|
+
# The account the message belongs to.
|
|
83
|
+
account_id: nil,
|
|
84
|
+
# The channel the message arrived on, for example sms or whatsapp.
|
|
85
|
+
channel: nil,
|
|
86
|
+
# The contact's number in E.164 format, meaning the number the message came from.
|
|
87
|
+
inbound_number: nil,
|
|
88
|
+
# The inbound message.
|
|
89
|
+
message_id: nil,
|
|
90
|
+
# Your number in E.164 format, meaning the number the message was addressed to.
|
|
91
|
+
outbound_number: nil,
|
|
92
|
+
# When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
93
|
+
received_at: nil,
|
|
94
|
+
# The message body. Sent as null when the inbound message carried no text, for
|
|
95
|
+
# example a media-only message. The field is always present, so read it and check
|
|
96
|
+
# for null rather than checking whether the key exists.
|
|
97
|
+
text: nil,
|
|
98
|
+
# When the message was received, in UTC (yyyy-MM-ddTHH:mm:ssZ). Same value as
|
|
99
|
+
# ReceivedAt, kept for envelope consistency with outbound events.
|
|
100
|
+
updated_at: nil
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
sig do
|
|
105
|
+
override.returns(
|
|
106
|
+
{
|
|
107
|
+
account_id: String,
|
|
108
|
+
channel: String,
|
|
109
|
+
inbound_number: String,
|
|
110
|
+
message_id: String,
|
|
111
|
+
outbound_number: String,
|
|
112
|
+
received_at: String,
|
|
113
|
+
text: T.nilable(String),
|
|
114
|
+
updated_at: String
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
def to_hash
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class MessageEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Sentdm::MessageEvent, Sentdm::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# The specific event within the family, for example message.delivered or
|
|
10
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
11
|
+
# optional.
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_accessor :event
|
|
14
|
+
|
|
15
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
16
|
+
# event for the specific change.
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :field
|
|
19
|
+
|
|
20
|
+
sig { params(field: String).void }
|
|
21
|
+
attr_writer :field
|
|
22
|
+
|
|
23
|
+
# Body of an outbound message lifecycle event. Delivered once per status change,
|
|
24
|
+
# so a single message produces several of these as it moves toward a terminal
|
|
25
|
+
# status.
|
|
26
|
+
sig { returns(T.nilable(Sentdm::MessageEventPayload)) }
|
|
27
|
+
attr_reader :payload
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
params(payload: T.nilable(Sentdm::MessageEventPayload::OrHash)).void
|
|
31
|
+
end
|
|
32
|
+
attr_writer :payload
|
|
33
|
+
|
|
34
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
35
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
36
|
+
# payload for the latter.
|
|
37
|
+
sig { returns(T.nilable(String)) }
|
|
38
|
+
attr_reader :timestamp
|
|
39
|
+
|
|
40
|
+
sig { params(timestamp: String).void }
|
|
41
|
+
attr_writer :timestamp
|
|
42
|
+
|
|
43
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
44
|
+
# this shape and varies only in Payload.
|
|
45
|
+
sig do
|
|
46
|
+
params(
|
|
47
|
+
event: T.nilable(String),
|
|
48
|
+
field: String,
|
|
49
|
+
payload: T.nilable(Sentdm::MessageEventPayload::OrHash),
|
|
50
|
+
timestamp: String
|
|
51
|
+
).returns(T.attached_class)
|
|
52
|
+
end
|
|
53
|
+
def self.new(
|
|
54
|
+
# The specific event within the family, for example message.delivered or
|
|
55
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
56
|
+
# optional.
|
|
57
|
+
event: nil,
|
|
58
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
59
|
+
# event for the specific change.
|
|
60
|
+
field: nil,
|
|
61
|
+
# Body of an outbound message lifecycle event. Delivered once per status change,
|
|
62
|
+
# so a single message produces several of these as it moves toward a terminal
|
|
63
|
+
# status.
|
|
64
|
+
payload: nil,
|
|
65
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
66
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
67
|
+
# payload for the latter.
|
|
68
|
+
timestamp: nil
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
sig do
|
|
73
|
+
override.returns(
|
|
74
|
+
{
|
|
75
|
+
event: T.nilable(String),
|
|
76
|
+
field: String,
|
|
77
|
+
payload: T.nilable(Sentdm::MessageEventPayload),
|
|
78
|
+
timestamp: String
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
def to_hash
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class MessageEventPayload < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Sentdm::MessageEventPayload, Sentdm::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The account the message belongs to.
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_reader :account_id
|
|
14
|
+
|
|
15
|
+
sig { params(account_id: String).void }
|
|
16
|
+
attr_writer :account_id
|
|
17
|
+
|
|
18
|
+
# The agent attributed to the send, when the send was attributed to one.
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_accessor :agent_id
|
|
21
|
+
|
|
22
|
+
# The channel the message went out on, for example sms or whatsapp. A message that
|
|
23
|
+
# falls back to another channel reports the channel actually used.
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_reader :channel
|
|
26
|
+
|
|
27
|
+
sig { params(channel: String).void }
|
|
28
|
+
attr_writer :channel
|
|
29
|
+
|
|
30
|
+
# The message this event describes. Stable across every event in the message's
|
|
31
|
+
# lifecycle, so use it to correlate them.
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_reader :message_id
|
|
34
|
+
|
|
35
|
+
sig { params(message_id: String).void }
|
|
36
|
+
attr_writer :message_id
|
|
37
|
+
|
|
38
|
+
# The status the message just reached, for example SENT, DELIVERED, or FAILED.
|
|
39
|
+
# Sent means dispatched and delivered means confirmed, so treat them as distinct
|
|
40
|
+
# outcomes.
|
|
41
|
+
sig { returns(T.nilable(String)) }
|
|
42
|
+
attr_reader :message_status
|
|
43
|
+
|
|
44
|
+
sig { params(message_status: String).void }
|
|
45
|
+
attr_writer :message_status
|
|
46
|
+
|
|
47
|
+
# The recipient's number in E.164 format.
|
|
48
|
+
sig { returns(T.nilable(String)) }
|
|
49
|
+
attr_reader :outbound_number
|
|
50
|
+
|
|
51
|
+
sig { params(outbound_number: String).void }
|
|
52
|
+
attr_writer :outbound_number
|
|
53
|
+
|
|
54
|
+
# The template the message was sent from, when it was sent from one.
|
|
55
|
+
sig { returns(T.nilable(String)) }
|
|
56
|
+
attr_accessor :template_id
|
|
57
|
+
|
|
58
|
+
# Name of the template the message was sent from. Omitted when the message wasn't
|
|
59
|
+
# template-based.
|
|
60
|
+
sig { returns(T.nilable(String)) }
|
|
61
|
+
attr_accessor :template_name
|
|
62
|
+
|
|
63
|
+
# When the message reached MessageStatus, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
64
|
+
sig { returns(T.nilable(String)) }
|
|
65
|
+
attr_reader :updated_at
|
|
66
|
+
|
|
67
|
+
sig { params(updated_at: String).void }
|
|
68
|
+
attr_writer :updated_at
|
|
69
|
+
|
|
70
|
+
# Body of an outbound message lifecycle event. Delivered once per status change,
|
|
71
|
+
# so a single message produces several of these as it moves toward a terminal
|
|
72
|
+
# status.
|
|
73
|
+
sig do
|
|
74
|
+
params(
|
|
75
|
+
account_id: String,
|
|
76
|
+
agent_id: T.nilable(String),
|
|
77
|
+
channel: String,
|
|
78
|
+
message_id: String,
|
|
79
|
+
message_status: String,
|
|
80
|
+
outbound_number: String,
|
|
81
|
+
template_id: T.nilable(String),
|
|
82
|
+
template_name: T.nilable(String),
|
|
83
|
+
updated_at: String
|
|
84
|
+
).returns(T.attached_class)
|
|
85
|
+
end
|
|
86
|
+
def self.new(
|
|
87
|
+
# The account the message belongs to.
|
|
88
|
+
account_id: nil,
|
|
89
|
+
# The agent attributed to the send, when the send was attributed to one.
|
|
90
|
+
agent_id: nil,
|
|
91
|
+
# The channel the message went out on, for example sms or whatsapp. A message that
|
|
92
|
+
# falls back to another channel reports the channel actually used.
|
|
93
|
+
channel: nil,
|
|
94
|
+
# The message this event describes. Stable across every event in the message's
|
|
95
|
+
# lifecycle, so use it to correlate them.
|
|
96
|
+
message_id: nil,
|
|
97
|
+
# The status the message just reached, for example SENT, DELIVERED, or FAILED.
|
|
98
|
+
# Sent means dispatched and delivered means confirmed, so treat them as distinct
|
|
99
|
+
# outcomes.
|
|
100
|
+
message_status: nil,
|
|
101
|
+
# The recipient's number in E.164 format.
|
|
102
|
+
outbound_number: nil,
|
|
103
|
+
# The template the message was sent from, when it was sent from one.
|
|
104
|
+
template_id: nil,
|
|
105
|
+
# Name of the template the message was sent from. Omitted when the message wasn't
|
|
106
|
+
# template-based.
|
|
107
|
+
template_name: nil,
|
|
108
|
+
# When the message reached MessageStatus, in UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
109
|
+
updated_at: nil
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
sig do
|
|
114
|
+
override.returns(
|
|
115
|
+
{
|
|
116
|
+
account_id: String,
|
|
117
|
+
agent_id: T.nilable(String),
|
|
118
|
+
channel: String,
|
|
119
|
+
message_id: String,
|
|
120
|
+
message_status: String,
|
|
121
|
+
outbound_number: String,
|
|
122
|
+
template_id: T.nilable(String),
|
|
123
|
+
template_name: T.nilable(String),
|
|
124
|
+
updated_at: String
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
end
|
|
128
|
+
def to_hash
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -378,7 +378,10 @@ module Sentdm
|
|
|
378
378
|
sig { params(created_at: Time).void }
|
|
379
379
|
attr_writer :created_at
|
|
380
380
|
|
|
381
|
-
#
|
|
381
|
+
# Deprecated and scheduled for removal. Identifies the Campaign Service Provider
|
|
382
|
+
# that registered the brand, which is Sent, so the value is the same for every
|
|
383
|
+
# brand and every account. Nothing on your side can act on it and there is no
|
|
384
|
+
# replacement. Stop reading it.
|
|
382
385
|
sig { returns(T.nilable(String)) }
|
|
383
386
|
attr_accessor :csp_id
|
|
384
387
|
|
|
@@ -459,7 +462,10 @@ module Sentdm
|
|
|
459
462
|
contact: nil,
|
|
460
463
|
# When the brand was created
|
|
461
464
|
created_at: nil,
|
|
462
|
-
#
|
|
465
|
+
# Deprecated and scheduled for removal. Identifies the Campaign Service Provider
|
|
466
|
+
# that registered the brand, which is Sent, so the value is the same for every
|
|
467
|
+
# brand and every account. Nothing on your side can act on it and there is no
|
|
468
|
+
# replacement. Stop reading it.
|
|
463
469
|
csp_id: nil,
|
|
464
470
|
identity_status: nil,
|
|
465
471
|
# Whether this brand is inherited from the parent organization
|
|
@@ -62,7 +62,7 @@ module Sentdm
|
|
|
62
62
|
attr_accessor :terms_and_conditions_link
|
|
63
63
|
|
|
64
64
|
# Expected messaging volume for this campaign. Numeric string (e.g. "1999",
|
|
65
|
-
# "5000")
|
|
65
|
+
# "5000"). Values below 2000 bill at the low-volume tier.
|
|
66
66
|
sig { returns(T.nilable(String)) }
|
|
67
67
|
attr_accessor :volume
|
|
68
68
|
|
|
@@ -113,7 +113,7 @@ module Sentdm
|
|
|
113
113
|
# URL to terms and conditions
|
|
114
114
|
terms_and_conditions_link: nil,
|
|
115
115
|
# Expected messaging volume for this campaign. Numeric string (e.g. "1999",
|
|
116
|
-
# "5000")
|
|
116
|
+
# "5000"). Values below 2000 bill at the low-volume tier.
|
|
117
117
|
volume: nil
|
|
118
118
|
)
|
|
119
119
|
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class TemplateEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Sentdm::TemplateEvent, Sentdm::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# The specific event within the family, for example message.delivered or
|
|
10
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
11
|
+
# optional.
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_accessor :event
|
|
14
|
+
|
|
15
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
16
|
+
# event for the specific change.
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :field
|
|
19
|
+
|
|
20
|
+
sig { params(field: String).void }
|
|
21
|
+
attr_writer :field
|
|
22
|
+
|
|
23
|
+
# Body of a template status event. Delivered when a template's review outcome
|
|
24
|
+
# changes, so you can react without polling.
|
|
25
|
+
sig { returns(T.nilable(Sentdm::TemplateEventPayload)) }
|
|
26
|
+
attr_reader :payload
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
params(payload: T.nilable(Sentdm::TemplateEventPayload::OrHash)).void
|
|
30
|
+
end
|
|
31
|
+
attr_writer :payload
|
|
32
|
+
|
|
33
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
34
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
35
|
+
# payload for the latter.
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
attr_reader :timestamp
|
|
38
|
+
|
|
39
|
+
sig { params(timestamp: String).void }
|
|
40
|
+
attr_writer :timestamp
|
|
41
|
+
|
|
42
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
43
|
+
# this shape and varies only in Payload.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
event: T.nilable(String),
|
|
47
|
+
field: String,
|
|
48
|
+
payload: T.nilable(Sentdm::TemplateEventPayload::OrHash),
|
|
49
|
+
timestamp: String
|
|
50
|
+
).returns(T.attached_class)
|
|
51
|
+
end
|
|
52
|
+
def self.new(
|
|
53
|
+
# The specific event within the family, for example message.delivered or
|
|
54
|
+
# message.received. Absent on events that have no subtype, so treat it as
|
|
55
|
+
# optional.
|
|
56
|
+
event: nil,
|
|
57
|
+
# The event family, for example message or templates. Route on this first, then on
|
|
58
|
+
# event for the specific change.
|
|
59
|
+
field: nil,
|
|
60
|
+
# Body of a template status event. Delivered when a template's review outcome
|
|
61
|
+
# changes, so you can react without polling.
|
|
62
|
+
payload: nil,
|
|
63
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
64
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
65
|
+
# payload for the latter.
|
|
66
|
+
timestamp: nil
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
sig do
|
|
71
|
+
override.returns(
|
|
72
|
+
{
|
|
73
|
+
event: T.nilable(String),
|
|
74
|
+
field: String,
|
|
75
|
+
payload: T.nilable(Sentdm::TemplateEventPayload),
|
|
76
|
+
timestamp: String
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
def to_hash
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|