prelude-sdk 0.2.0 → 0.4.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 +81 -0
- data/README.md +1 -1
- data/lib/prelude_sdk/client.rb +22 -1
- data/lib/prelude_sdk/internal/transport/pooled_net_requester.rb +13 -11
- data/lib/prelude_sdk/internal/util.rb +61 -10
- data/lib/prelude_sdk/models/lookup_lookup_params.rb +9 -1
- data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +7 -1
- data/lib/prelude_sdk/models/notify_get_subscription_phone_number_params.rb +7 -1
- data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rb +8 -1
- data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rb +8 -1
- data/lib/prelude_sdk/models/notify_send_batch_params.rb +55 -1
- data/lib/prelude_sdk/models/notify_send_batch_response.rb +39 -1
- data/lib/prelude_sdk/models/notify_send_params.rb +92 -1
- data/lib/prelude_sdk/models/notify_send_response.rb +36 -1
- data/lib/prelude_sdk/models/transactional_send_params.rb +54 -1
- data/lib/prelude_sdk/models/verification_create_params.rb +35 -48
- data/lib/prelude_sdk/models/verification_create_response.rb +66 -1
- data/lib/prelude_sdk/models/verification_management_delete_phone_number_params.rb +8 -1
- data/lib/prelude_sdk/models/verification_management_list_phone_numbers_params.rb +7 -1
- data/lib/prelude_sdk/models/verification_management_set_phone_number_params.rb +8 -1
- data/lib/prelude_sdk/models/watch_predict_params.rb +16 -12
- data/lib/prelude_sdk/models/watch_predict_response.rb +51 -1
- data/lib/prelude_sdk/models/watch_send_events_params.rb +6 -2
- data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +7 -130
- data/lib/prelude_sdk/resources/lookup.rb +4 -1
- data/lib/prelude_sdk/resources/notify.rb +19 -7
- data/lib/prelude_sdk/resources/transactional.rb +4 -1
- data/lib/prelude_sdk/resources/verification.rb +1 -0
- data/lib/prelude_sdk/resources/verification_management.rb +1 -0
- data/lib/prelude_sdk/resources/watch.rb +9 -2
- data/lib/prelude_sdk/version.rb +1 -1
- data/rbi/prelude_sdk/client.rbi +7 -0
- data/rbi/prelude_sdk/internal/util.rbi +29 -1
- data/rbi/prelude_sdk/models/lookup_lookup_params.rbi +8 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +13 -5
- data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_params.rbi +10 -2
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbi +6 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbi +6 -0
- data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +88 -0
- data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +80 -0
- data/rbi/prelude_sdk/models/notify_send_params.rbi +145 -0
- data/rbi/prelude_sdk/models/notify_send_response.rbi +75 -0
- data/rbi/prelude_sdk/models/transactional_send_params.rbi +83 -0
- data/rbi/prelude_sdk/models/verification_create_params.rbi +53 -93
- data/rbi/prelude_sdk/models/verification_create_response.rbi +178 -0
- data/rbi/prelude_sdk/models/verification_management_delete_phone_number_params.rbi +16 -1
- data/rbi/prelude_sdk/models/verification_management_list_phone_numbers_params.rbi +21 -4
- data/rbi/prelude_sdk/models/verification_management_set_phone_number_params.rbi +16 -1
- data/rbi/prelude_sdk/models/watch_predict_params.rbi +24 -16
- data/rbi/prelude_sdk/models/watch_predict_response.rbi +152 -3
- data/rbi/prelude_sdk/models/watch_send_events_params.rbi +4 -2
- data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +7 -245
- data/rbi/prelude_sdk/resources/lookup.rbi +2 -0
- data/rbi/prelude_sdk/resources/notify.rbi +36 -2
- data/rbi/prelude_sdk/resources/transactional.rbi +13 -0
- data/rbi/prelude_sdk/resources/verification.rbi +1 -0
- data/rbi/prelude_sdk/resources/verification_management.rbi +1 -0
- data/rbi/prelude_sdk/resources/watch.rbi +5 -2
- data/sig/prelude_sdk/internal/util.rbs +14 -0
- data/sig/prelude_sdk/models/lookup_lookup_params.rbs +8 -1
- data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +11 -3
- data/sig/prelude_sdk/models/notify_get_subscription_phone_number_params.rbs +6 -1
- data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbs +10 -1
- data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbs +5 -0
- data/sig/prelude_sdk/models/notify_send_batch_params.rbs +25 -1
- data/sig/prelude_sdk/models/notify_send_batch_response.rbs +27 -0
- data/sig/prelude_sdk/models/notify_send_params.rbs +51 -1
- data/sig/prelude_sdk/models/notify_send_response.rbs +27 -0
- data/sig/prelude_sdk/models/transactional_send_params.rbs +23 -0
- data/sig/prelude_sdk/models/verification_create_params.rbs +2 -21
- data/sig/prelude_sdk/models/verification_create_response.rbs +40 -1
- data/sig/prelude_sdk/models/verification_management_delete_phone_number_params.rbs +9 -1
- data/sig/prelude_sdk/models/verification_management_list_phone_numbers_params.rbs +14 -3
- data/sig/prelude_sdk/models/verification_management_set_phone_number_params.rbs +9 -1
- data/sig/prelude_sdk/models/watch_predict_response.rbs +41 -3
- data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +3 -110
- data/sig/prelude_sdk/resources/notify.rbs +4 -0
- data/sig/prelude_sdk/resources/transactional.rbs +1 -0
- metadata +16 -2
|
@@ -11,6 +11,10 @@ module PreludeSDK
|
|
|
11
11
|
T.any(PreludeSDK::LookupLookupParams, PreludeSDK::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# An E.164 formatted phone number to look up.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :phone_number
|
|
17
|
+
|
|
14
18
|
# Optional features. Possible values are:
|
|
15
19
|
#
|
|
16
20
|
# - `cnam` - Retrieve CNAM (Caller ID Name) along with other information. Contact
|
|
@@ -31,11 +35,14 @@ module PreludeSDK
|
|
|
31
35
|
|
|
32
36
|
sig do
|
|
33
37
|
params(
|
|
38
|
+
phone_number: String,
|
|
34
39
|
type: T::Array[PreludeSDK::LookupLookupParams::Type::OrSymbol],
|
|
35
40
|
request_options: PreludeSDK::RequestOptions::OrHash
|
|
36
41
|
).returns(T.attached_class)
|
|
37
42
|
end
|
|
38
43
|
def self.new(
|
|
44
|
+
# An E.164 formatted phone number to look up.
|
|
45
|
+
phone_number:,
|
|
39
46
|
# Optional features. Possible values are:
|
|
40
47
|
#
|
|
41
48
|
# - `cnam` - Retrieve CNAM (Caller ID Name) along with other information. Contact
|
|
@@ -48,6 +55,7 @@ module PreludeSDK
|
|
|
48
55
|
sig do
|
|
49
56
|
override.returns(
|
|
50
57
|
{
|
|
58
|
+
phone_number: String,
|
|
51
59
|
type: T::Array[PreludeSDK::LookupLookupParams::Type::OrSymbol],
|
|
52
60
|
request_options: PreludeSDK::RequestOptions
|
|
53
61
|
}
|
|
@@ -14,15 +14,23 @@ module PreludeSDK
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :config_id
|
|
19
|
+
|
|
17
20
|
sig do
|
|
18
|
-
params(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
params(
|
|
22
|
+
config_id: String,
|
|
23
|
+
request_options: PreludeSDK::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
21
25
|
end
|
|
22
|
-
def self.new(request_options: {})
|
|
26
|
+
def self.new(config_id:, request_options: {})
|
|
23
27
|
end
|
|
24
28
|
|
|
25
|
-
sig
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ config_id: String, request_options: PreludeSDK::RequestOptions }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
26
34
|
def to_hash
|
|
27
35
|
end
|
|
28
36
|
end
|
|
@@ -17,18 +17,26 @@ module PreludeSDK
|
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :config_id
|
|
19
19
|
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :phone_number
|
|
22
|
+
|
|
20
23
|
sig do
|
|
21
24
|
params(
|
|
22
25
|
config_id: String,
|
|
26
|
+
phone_number: String,
|
|
23
27
|
request_options: PreludeSDK::RequestOptions::OrHash
|
|
24
28
|
).returns(T.attached_class)
|
|
25
29
|
end
|
|
26
|
-
def self.new(config_id:, request_options: {})
|
|
30
|
+
def self.new(config_id:, phone_number:, request_options: {})
|
|
27
31
|
end
|
|
28
32
|
|
|
29
33
|
sig do
|
|
30
34
|
override.returns(
|
|
31
|
-
{
|
|
35
|
+
{
|
|
36
|
+
config_id: String,
|
|
37
|
+
phone_number: String,
|
|
38
|
+
request_options: PreludeSDK::RequestOptions
|
|
39
|
+
}
|
|
32
40
|
)
|
|
33
41
|
end
|
|
34
42
|
def to_hash
|
|
@@ -17,6 +17,9 @@ module PreludeSDK
|
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :config_id
|
|
19
19
|
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :phone_number
|
|
22
|
+
|
|
20
23
|
# Pagination cursor from the previous response
|
|
21
24
|
sig { returns(T.nilable(String)) }
|
|
22
25
|
attr_reader :cursor
|
|
@@ -34,6 +37,7 @@ module PreludeSDK
|
|
|
34
37
|
sig do
|
|
35
38
|
params(
|
|
36
39
|
config_id: String,
|
|
40
|
+
phone_number: String,
|
|
37
41
|
cursor: String,
|
|
38
42
|
limit: Integer,
|
|
39
43
|
request_options: PreludeSDK::RequestOptions::OrHash
|
|
@@ -41,6 +45,7 @@ module PreludeSDK
|
|
|
41
45
|
end
|
|
42
46
|
def self.new(
|
|
43
47
|
config_id:,
|
|
48
|
+
phone_number:,
|
|
44
49
|
# Pagination cursor from the previous response
|
|
45
50
|
cursor: nil,
|
|
46
51
|
# Maximum number of events to return per page
|
|
@@ -53,6 +58,7 @@ module PreludeSDK
|
|
|
53
58
|
override.returns(
|
|
54
59
|
{
|
|
55
60
|
config_id: String,
|
|
61
|
+
phone_number: String,
|
|
56
62
|
cursor: String,
|
|
57
63
|
limit: Integer,
|
|
58
64
|
request_options: PreludeSDK::RequestOptions
|
|
@@ -14,6 +14,9 @@ module PreludeSDK
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :config_id
|
|
19
|
+
|
|
17
20
|
# Pagination cursor from the previous response
|
|
18
21
|
sig { returns(T.nilable(String)) }
|
|
19
22
|
attr_reader :cursor
|
|
@@ -48,6 +51,7 @@ module PreludeSDK
|
|
|
48
51
|
|
|
49
52
|
sig do
|
|
50
53
|
params(
|
|
54
|
+
config_id: String,
|
|
51
55
|
cursor: String,
|
|
52
56
|
limit: Integer,
|
|
53
57
|
state:
|
|
@@ -56,6 +60,7 @@ module PreludeSDK
|
|
|
56
60
|
).returns(T.attached_class)
|
|
57
61
|
end
|
|
58
62
|
def self.new(
|
|
63
|
+
config_id:,
|
|
59
64
|
# Pagination cursor from the previous response
|
|
60
65
|
cursor: nil,
|
|
61
66
|
# Maximum number of phone numbers to return per page
|
|
@@ -69,6 +74,7 @@ module PreludeSDK
|
|
|
69
74
|
sig do
|
|
70
75
|
override.returns(
|
|
71
76
|
{
|
|
77
|
+
config_id: String,
|
|
72
78
|
cursor: String,
|
|
73
79
|
limit: Integer,
|
|
74
80
|
state:
|
|
@@ -36,6 +36,26 @@ module PreludeSDK
|
|
|
36
36
|
sig { params(correlation_id: String).void }
|
|
37
37
|
attr_writer :correlation_id
|
|
38
38
|
|
|
39
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
40
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
41
|
+
# type is determined by the template's registered header format; send the matching
|
|
42
|
+
# file type for each.
|
|
43
|
+
#
|
|
44
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
45
|
+
# required and displayed to the recipient.
|
|
46
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
47
|
+
# is ignored.
|
|
48
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
49
|
+
sig { returns(T.nilable(PreludeSDK::NotifySendBatchParams::Document)) }
|
|
50
|
+
attr_reader :document
|
|
51
|
+
|
|
52
|
+
sig do
|
|
53
|
+
params(
|
|
54
|
+
document: PreludeSDK::NotifySendBatchParams::Document::OrHash
|
|
55
|
+
).void
|
|
56
|
+
end
|
|
57
|
+
attr_writer :document
|
|
58
|
+
|
|
39
59
|
# The message expiration date in RFC3339 format. Messages will not be sent after
|
|
40
60
|
# this time.
|
|
41
61
|
sig { returns(T.nilable(Time)) }
|
|
@@ -97,6 +117,7 @@ module PreludeSDK
|
|
|
97
117
|
to: T::Array[String],
|
|
98
118
|
callback_url: String,
|
|
99
119
|
correlation_id: String,
|
|
120
|
+
document: PreludeSDK::NotifySendBatchParams::Document::OrHash,
|
|
100
121
|
expires_at: Time,
|
|
101
122
|
from: String,
|
|
102
123
|
locale: String,
|
|
@@ -116,6 +137,17 @@ module PreludeSDK
|
|
|
116
137
|
callback_url: nil,
|
|
117
138
|
# A user-defined identifier to correlate this request with your internal systems.
|
|
118
139
|
correlation_id: nil,
|
|
140
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
141
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
142
|
+
# type is determined by the template's registered header format; send the matching
|
|
143
|
+
# file type for each.
|
|
144
|
+
#
|
|
145
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
146
|
+
# required and displayed to the recipient.
|
|
147
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
148
|
+
# is ignored.
|
|
149
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
150
|
+
document: nil,
|
|
119
151
|
# The message expiration date in RFC3339 format. Messages will not be sent after
|
|
120
152
|
# this time.
|
|
121
153
|
expires_at: nil,
|
|
@@ -141,6 +173,7 @@ module PreludeSDK
|
|
|
141
173
|
to: T::Array[String],
|
|
142
174
|
callback_url: String,
|
|
143
175
|
correlation_id: String,
|
|
176
|
+
document: PreludeSDK::NotifySendBatchParams::Document,
|
|
144
177
|
expires_at: Time,
|
|
145
178
|
from: String,
|
|
146
179
|
locale: String,
|
|
@@ -155,6 +188,56 @@ module PreludeSDK
|
|
|
155
188
|
def to_hash
|
|
156
189
|
end
|
|
157
190
|
|
|
191
|
+
class Document < PreludeSDK::Internal::Type::BaseModel
|
|
192
|
+
OrHash =
|
|
193
|
+
T.type_alias do
|
|
194
|
+
T.any(
|
|
195
|
+
PreludeSDK::NotifySendBatchParams::Document,
|
|
196
|
+
PreludeSDK::Internal::AnyHash
|
|
197
|
+
)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# HTTPS URL of the media file. The file extension must match the template's
|
|
201
|
+
# registered header format (PDF for DOCUMENT; PNG/JPG/JPEG/WEBP for IMAGE; MP4/3GP
|
|
202
|
+
# for VIDEO).
|
|
203
|
+
sig { returns(String) }
|
|
204
|
+
attr_accessor :url
|
|
205
|
+
|
|
206
|
+
# Filename displayed to the recipient. Required for templates with a `DOCUMENT`
|
|
207
|
+
# header; ignored for `IMAGE` and `VIDEO` headers.
|
|
208
|
+
sig { returns(T.nilable(String)) }
|
|
209
|
+
attr_reader :filename
|
|
210
|
+
|
|
211
|
+
sig { params(filename: String).void }
|
|
212
|
+
attr_writer :filename
|
|
213
|
+
|
|
214
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
215
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
216
|
+
# type is determined by the template's registered header format; send the matching
|
|
217
|
+
# file type for each.
|
|
218
|
+
#
|
|
219
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
220
|
+
# required and displayed to the recipient.
|
|
221
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
222
|
+
# is ignored.
|
|
223
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
224
|
+
sig { params(url: String, filename: String).returns(T.attached_class) }
|
|
225
|
+
def self.new(
|
|
226
|
+
# HTTPS URL of the media file. The file extension must match the template's
|
|
227
|
+
# registered header format (PDF for DOCUMENT; PNG/JPG/JPEG/WEBP for IMAGE; MP4/3GP
|
|
228
|
+
# for VIDEO).
|
|
229
|
+
url:,
|
|
230
|
+
# Filename displayed to the recipient. Required for templates with a `DOCUMENT`
|
|
231
|
+
# header; ignored for `IMAGE` and `VIDEO` headers.
|
|
232
|
+
filename: nil
|
|
233
|
+
)
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
sig { override.returns({ url: String, filename: String }) }
|
|
237
|
+
def to_hash
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
|
|
158
241
|
# Preferred channel for delivery. If unavailable, automatic fallback applies.
|
|
159
242
|
module PreferredChannel
|
|
160
243
|
extend PreludeSDK::Internal::Type::Enum
|
|
@@ -170,6 +253,11 @@ module PreludeSDK
|
|
|
170
253
|
:sms,
|
|
171
254
|
PreludeSDK::NotifySendBatchParams::PreferredChannel::TaggedSymbol
|
|
172
255
|
)
|
|
256
|
+
RCS =
|
|
257
|
+
T.let(
|
|
258
|
+
:rcs,
|
|
259
|
+
PreludeSDK::NotifySendBatchParams::PreferredChannel::TaggedSymbol
|
|
260
|
+
)
|
|
173
261
|
WHATSAPP =
|
|
174
262
|
T.let(
|
|
175
263
|
:whatsapp,
|
|
@@ -269,6 +269,35 @@ module PreludeSDK
|
|
|
269
269
|
sig { params(created_at: Time).void }
|
|
270
270
|
attr_writer :created_at
|
|
271
271
|
|
|
272
|
+
# The SMS encoding type based on message content. GSM-7 supports standard
|
|
273
|
+
# characters (up to 160 chars per segment), while UCS-2 supports Unicode including
|
|
274
|
+
# emoji (up to 70 chars per segment). Only present for SMS messages.
|
|
275
|
+
sig do
|
|
276
|
+
returns(
|
|
277
|
+
T.nilable(
|
|
278
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding::TaggedSymbol
|
|
279
|
+
)
|
|
280
|
+
)
|
|
281
|
+
end
|
|
282
|
+
attr_reader :encoding
|
|
283
|
+
|
|
284
|
+
sig do
|
|
285
|
+
params(
|
|
286
|
+
encoding:
|
|
287
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding::OrSymbol
|
|
288
|
+
).void
|
|
289
|
+
end
|
|
290
|
+
attr_writer :encoding
|
|
291
|
+
|
|
292
|
+
# The estimated number of SMS segments for this message. This value is not
|
|
293
|
+
# contractual; the actual segment count will be determined after the SMS is sent
|
|
294
|
+
# by the provider. Only present for SMS messages.
|
|
295
|
+
sig { returns(T.nilable(Integer)) }
|
|
296
|
+
attr_reader :estimated_segment_count
|
|
297
|
+
|
|
298
|
+
sig { params(estimated_segment_count: Integer).void }
|
|
299
|
+
attr_writer :estimated_segment_count
|
|
300
|
+
|
|
272
301
|
# The message expiration date in RFC3339 format.
|
|
273
302
|
sig { returns(T.nilable(Time)) }
|
|
274
303
|
attr_reader :expires_at
|
|
@@ -310,6 +339,9 @@ module PreludeSDK
|
|
|
310
339
|
id: String,
|
|
311
340
|
correlation_id: String,
|
|
312
341
|
created_at: Time,
|
|
342
|
+
encoding:
|
|
343
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding::OrSymbol,
|
|
344
|
+
estimated_segment_count: Integer,
|
|
313
345
|
expires_at: Time,
|
|
314
346
|
from: String,
|
|
315
347
|
locale: String,
|
|
@@ -324,6 +356,14 @@ module PreludeSDK
|
|
|
324
356
|
correlation_id: nil,
|
|
325
357
|
# The message creation date in RFC3339 format.
|
|
326
358
|
created_at: nil,
|
|
359
|
+
# The SMS encoding type based on message content. GSM-7 supports standard
|
|
360
|
+
# characters (up to 160 chars per segment), while UCS-2 supports Unicode including
|
|
361
|
+
# emoji (up to 70 chars per segment). Only present for SMS messages.
|
|
362
|
+
encoding: nil,
|
|
363
|
+
# The estimated number of SMS segments for this message. This value is not
|
|
364
|
+
# contractual; the actual segment count will be determined after the SMS is sent
|
|
365
|
+
# by the provider. Only present for SMS messages.
|
|
366
|
+
estimated_segment_count: nil,
|
|
327
367
|
# The message expiration date in RFC3339 format.
|
|
328
368
|
expires_at: nil,
|
|
329
369
|
# The Sender ID used for this message.
|
|
@@ -343,6 +383,9 @@ module PreludeSDK
|
|
|
343
383
|
id: String,
|
|
344
384
|
correlation_id: String,
|
|
345
385
|
created_at: Time,
|
|
386
|
+
encoding:
|
|
387
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding::TaggedSymbol,
|
|
388
|
+
estimated_segment_count: Integer,
|
|
346
389
|
expires_at: Time,
|
|
347
390
|
from: String,
|
|
348
391
|
locale: String,
|
|
@@ -353,6 +396,43 @@ module PreludeSDK
|
|
|
353
396
|
end
|
|
354
397
|
def to_hash
|
|
355
398
|
end
|
|
399
|
+
|
|
400
|
+
# The SMS encoding type based on message content. GSM-7 supports standard
|
|
401
|
+
# characters (up to 160 chars per segment), while UCS-2 supports Unicode including
|
|
402
|
+
# emoji (up to 70 chars per segment). Only present for SMS messages.
|
|
403
|
+
module Encoding
|
|
404
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
405
|
+
|
|
406
|
+
TaggedSymbol =
|
|
407
|
+
T.type_alias do
|
|
408
|
+
T.all(
|
|
409
|
+
Symbol,
|
|
410
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding
|
|
411
|
+
)
|
|
412
|
+
end
|
|
413
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
414
|
+
|
|
415
|
+
GSM_7 =
|
|
416
|
+
T.let(
|
|
417
|
+
:"GSM-7",
|
|
418
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding::TaggedSymbol
|
|
419
|
+
)
|
|
420
|
+
UCS_2 =
|
|
421
|
+
T.let(
|
|
422
|
+
:"UCS-2",
|
|
423
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding::TaggedSymbol
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
sig do
|
|
427
|
+
override.returns(
|
|
428
|
+
T::Array[
|
|
429
|
+
PreludeSDK::Models::NotifySendBatchResponse::Result::Message::Encoding::TaggedSymbol
|
|
430
|
+
]
|
|
431
|
+
)
|
|
432
|
+
end
|
|
433
|
+
def self.values
|
|
434
|
+
end
|
|
435
|
+
end
|
|
356
436
|
end
|
|
357
437
|
end
|
|
358
438
|
end
|
|
@@ -26,6 +26,16 @@ module PreludeSDK
|
|
|
26
26
|
sig { params(callback_url: String).void }
|
|
27
27
|
attr_writer :callback_url
|
|
28
28
|
|
|
29
|
+
# Context for replying to an inbound message. When provided, the message is sent
|
|
30
|
+
# as a WhatsApp reply within the 24-hour conversation window.
|
|
31
|
+
sig { returns(T.nilable(PreludeSDK::NotifySendParams::Context)) }
|
|
32
|
+
attr_reader :context
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(context: PreludeSDK::NotifySendParams::Context::OrHash).void
|
|
36
|
+
end
|
|
37
|
+
attr_writer :context
|
|
38
|
+
|
|
29
39
|
# A user-defined identifier to correlate this message with your internal systems.
|
|
30
40
|
# It is returned in the response and any webhook events that refer to this
|
|
31
41
|
# message.
|
|
@@ -35,6 +45,24 @@ module PreludeSDK
|
|
|
35
45
|
sig { params(correlation_id: String).void }
|
|
36
46
|
attr_writer :correlation_id
|
|
37
47
|
|
|
48
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
49
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
50
|
+
# type is determined by the template's registered header format; send the matching
|
|
51
|
+
# file type for each.
|
|
52
|
+
#
|
|
53
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
54
|
+
# required and displayed to the recipient.
|
|
55
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
56
|
+
# is ignored.
|
|
57
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
58
|
+
sig { returns(T.nilable(PreludeSDK::NotifySendParams::Document)) }
|
|
59
|
+
attr_reader :document
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
params(document: PreludeSDK::NotifySendParams::Document::OrHash).void
|
|
63
|
+
end
|
|
64
|
+
attr_writer :document
|
|
65
|
+
|
|
38
66
|
# The message expiration date in RFC3339 format. The message will not be sent if
|
|
39
67
|
# this time is reached.
|
|
40
68
|
sig { returns(T.nilable(Time)) }
|
|
@@ -86,6 +114,15 @@ module PreludeSDK
|
|
|
86
114
|
sig { params(schedule_at: Time).void }
|
|
87
115
|
attr_writer :schedule_at
|
|
88
116
|
|
|
117
|
+
# The reply message body. Required when `context.reply_to` is provided. Used for
|
|
118
|
+
# 2-way WhatsApp messaging to send free-form text replies within a conversation
|
|
119
|
+
# window.
|
|
120
|
+
sig { returns(T.nilable(String)) }
|
|
121
|
+
attr_reader :text
|
|
122
|
+
|
|
123
|
+
sig { params(text: String).void }
|
|
124
|
+
attr_writer :text
|
|
125
|
+
|
|
89
126
|
# The variables to be replaced in the template.
|
|
90
127
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
91
128
|
attr_reader :variables
|
|
@@ -98,13 +135,16 @@ module PreludeSDK
|
|
|
98
135
|
template_id: String,
|
|
99
136
|
to: String,
|
|
100
137
|
callback_url: String,
|
|
138
|
+
context: PreludeSDK::NotifySendParams::Context::OrHash,
|
|
101
139
|
correlation_id: String,
|
|
140
|
+
document: PreludeSDK::NotifySendParams::Document::OrHash,
|
|
102
141
|
expires_at: Time,
|
|
103
142
|
from: String,
|
|
104
143
|
locale: String,
|
|
105
144
|
preferred_channel:
|
|
106
145
|
PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
|
|
107
146
|
schedule_at: Time,
|
|
147
|
+
text: String,
|
|
108
148
|
variables: T::Hash[Symbol, String],
|
|
109
149
|
request_options: PreludeSDK::RequestOptions::OrHash
|
|
110
150
|
).returns(T.attached_class)
|
|
@@ -116,10 +156,24 @@ module PreludeSDK
|
|
|
116
156
|
to:,
|
|
117
157
|
# The URL where webhooks will be sent for message delivery events.
|
|
118
158
|
callback_url: nil,
|
|
159
|
+
# Context for replying to an inbound message. When provided, the message is sent
|
|
160
|
+
# as a WhatsApp reply within the 24-hour conversation window.
|
|
161
|
+
context: nil,
|
|
119
162
|
# A user-defined identifier to correlate this message with your internal systems.
|
|
120
163
|
# It is returned in the response and any webhook events that refer to this
|
|
121
164
|
# message.
|
|
122
165
|
correlation_id: nil,
|
|
166
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
167
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
168
|
+
# type is determined by the template's registered header format; send the matching
|
|
169
|
+
# file type for each.
|
|
170
|
+
#
|
|
171
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
172
|
+
# required and displayed to the recipient.
|
|
173
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
174
|
+
# is ignored.
|
|
175
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
176
|
+
document: nil,
|
|
123
177
|
# The message expiration date in RFC3339 format. The message will not be sent if
|
|
124
178
|
# this time is reached.
|
|
125
179
|
expires_at: nil,
|
|
@@ -137,6 +191,10 @@ module PreludeSDK
|
|
|
137
191
|
# can be scheduled up to 90 days in advance and will be automatically adjusted for
|
|
138
192
|
# compliance with local time window restrictions.
|
|
139
193
|
schedule_at: nil,
|
|
194
|
+
# The reply message body. Required when `context.reply_to` is provided. Used for
|
|
195
|
+
# 2-way WhatsApp messaging to send free-form text replies within a conversation
|
|
196
|
+
# window.
|
|
197
|
+
text: nil,
|
|
140
198
|
# The variables to be replaced in the template.
|
|
141
199
|
variables: nil,
|
|
142
200
|
request_options: {}
|
|
@@ -149,13 +207,16 @@ module PreludeSDK
|
|
|
149
207
|
template_id: String,
|
|
150
208
|
to: String,
|
|
151
209
|
callback_url: String,
|
|
210
|
+
context: PreludeSDK::NotifySendParams::Context,
|
|
152
211
|
correlation_id: String,
|
|
212
|
+
document: PreludeSDK::NotifySendParams::Document,
|
|
153
213
|
expires_at: Time,
|
|
154
214
|
from: String,
|
|
155
215
|
locale: String,
|
|
156
216
|
preferred_channel:
|
|
157
217
|
PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
|
|
158
218
|
schedule_at: Time,
|
|
219
|
+
text: String,
|
|
159
220
|
variables: T::Hash[Symbol, String],
|
|
160
221
|
request_options: PreludeSDK::RequestOptions
|
|
161
222
|
}
|
|
@@ -164,6 +225,85 @@ module PreludeSDK
|
|
|
164
225
|
def to_hash
|
|
165
226
|
end
|
|
166
227
|
|
|
228
|
+
class Context < PreludeSDK::Internal::Type::BaseModel
|
|
229
|
+
OrHash =
|
|
230
|
+
T.type_alias do
|
|
231
|
+
T.any(
|
|
232
|
+
PreludeSDK::NotifySendParams::Context,
|
|
233
|
+
PreludeSDK::Internal::AnyHash
|
|
234
|
+
)
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# The inbound message ID (prefixed with `im_`) to reply to. This ID is provided in
|
|
238
|
+
# the `inbound.message.received` webhook event.
|
|
239
|
+
sig { returns(String) }
|
|
240
|
+
attr_accessor :reply_to
|
|
241
|
+
|
|
242
|
+
# Context for replying to an inbound message. When provided, the message is sent
|
|
243
|
+
# as a WhatsApp reply within the 24-hour conversation window.
|
|
244
|
+
sig { params(reply_to: String).returns(T.attached_class) }
|
|
245
|
+
def self.new(
|
|
246
|
+
# The inbound message ID (prefixed with `im_`) to reply to. This ID is provided in
|
|
247
|
+
# the `inbound.message.received` webhook event.
|
|
248
|
+
reply_to:
|
|
249
|
+
)
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
sig { override.returns({ reply_to: String }) }
|
|
253
|
+
def to_hash
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
class Document < PreludeSDK::Internal::Type::BaseModel
|
|
258
|
+
OrHash =
|
|
259
|
+
T.type_alias do
|
|
260
|
+
T.any(
|
|
261
|
+
PreludeSDK::NotifySendParams::Document,
|
|
262
|
+
PreludeSDK::Internal::AnyHash
|
|
263
|
+
)
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# HTTPS URL of the media file. The file extension must match the template's
|
|
267
|
+
# registered header format (PDF for DOCUMENT; PNG/JPG/JPEG/WEBP for IMAGE; MP4/3GP
|
|
268
|
+
# for VIDEO).
|
|
269
|
+
sig { returns(String) }
|
|
270
|
+
attr_accessor :url
|
|
271
|
+
|
|
272
|
+
# Filename displayed to the recipient. Required for templates with a `DOCUMENT`
|
|
273
|
+
# header; ignored for `IMAGE` and `VIDEO` headers.
|
|
274
|
+
sig { returns(T.nilable(String)) }
|
|
275
|
+
attr_reader :filename
|
|
276
|
+
|
|
277
|
+
sig { params(filename: String).void }
|
|
278
|
+
attr_writer :filename
|
|
279
|
+
|
|
280
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
281
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
282
|
+
# type is determined by the template's registered header format; send the matching
|
|
283
|
+
# file type for each.
|
|
284
|
+
#
|
|
285
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
286
|
+
# required and displayed to the recipient.
|
|
287
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
288
|
+
# is ignored.
|
|
289
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
290
|
+
sig { params(url: String, filename: String).returns(T.attached_class) }
|
|
291
|
+
def self.new(
|
|
292
|
+
# HTTPS URL of the media file. The file extension must match the template's
|
|
293
|
+
# registered header format (PDF for DOCUMENT; PNG/JPG/JPEG/WEBP for IMAGE; MP4/3GP
|
|
294
|
+
# for VIDEO).
|
|
295
|
+
url:,
|
|
296
|
+
# Filename displayed to the recipient. Required for templates with a `DOCUMENT`
|
|
297
|
+
# header; ignored for `IMAGE` and `VIDEO` headers.
|
|
298
|
+
filename: nil
|
|
299
|
+
)
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
sig { override.returns({ url: String, filename: String }) }
|
|
303
|
+
def to_hash
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
|
|
167
307
|
# The preferred channel to be used in priority for message delivery. If the
|
|
168
308
|
# channel is unavailable, the system will fallback to other available channels.
|
|
169
309
|
module PreferredChannel
|
|
@@ -180,6 +320,11 @@ module PreludeSDK
|
|
|
180
320
|
:sms,
|
|
181
321
|
PreludeSDK::NotifySendParams::PreferredChannel::TaggedSymbol
|
|
182
322
|
)
|
|
323
|
+
RCS =
|
|
324
|
+
T.let(
|
|
325
|
+
:rcs,
|
|
326
|
+
PreludeSDK::NotifySendParams::PreferredChannel::TaggedSymbol
|
|
327
|
+
)
|
|
183
328
|
WHATSAPP =
|
|
184
329
|
T.let(
|
|
185
330
|
:whatsapp,
|