prelude-sdk 0.3.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 +33 -0
- data/README.md +1 -1
- data/lib/prelude_sdk/client.rb +15 -1
- data/lib/prelude_sdk/internal/util.rb +22 -7
- data/lib/prelude_sdk/models/notify_send_batch_params.rb +38 -15
- data/lib/prelude_sdk/models/notify_send_params.rb +74 -14
- data/lib/prelude_sdk/models/transactional_send_params.rb +37 -15
- data/lib/prelude_sdk/models/verification_create_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 +6 -2
- data/lib/prelude_sdk/resources/notify.rb +9 -5
- data/lib/prelude_sdk/resources/transactional.rb +1 -1
- data/lib/prelude_sdk/resources/watch.rb +8 -2
- data/lib/prelude_sdk/version.rb +1 -1
- data/rbi/prelude_sdk/internal/util.rbi +8 -0
- data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +55 -17
- data/rbi/prelude_sdk/models/notify_send_params.rbi +114 -17
- data/rbi/prelude_sdk/models/transactional_send_params.rbi +50 -17
- data/rbi/prelude_sdk/models/verification_create_response.rbi +152 -0
- data/rbi/prelude_sdk/models/watch_send_events_params.rbi +4 -2
- data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +4 -2
- data/rbi/prelude_sdk/resources/notify.rbi +31 -6
- data/rbi/prelude_sdk/resources/transactional.rbi +10 -2
- data/rbi/prelude_sdk/resources/watch.rbi +4 -2
- data/sig/prelude_sdk/internal/util.rbs +4 -0
- data/sig/prelude_sdk/models/notify_send_batch_params.rbs +9 -6
- data/sig/prelude_sdk/models/notify_send_params.rbs +35 -6
- data/sig/prelude_sdk/models/transactional_send_params.rbs +7 -5
- data/sig/prelude_sdk/models/verification_create_response.rbs +38 -0
- data/sig/prelude_sdk/resources/notify.rbs +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c30d57028d9ebcfd36fa8b9eec44cb27060d610dea0ad043a84d5d3ba03e63dd
|
|
4
|
+
data.tar.gz: 3704104bbb4293a7bef28aaa073376d8bd873f0b90ae8102c5e73194cd0259eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56012d0287c7baa14666bc5a009ed125c3a40f442e2cdbf4a6c1e2fd65671212ec0cf947bffd9dfd90b5a64197d3525a1f79969f01d4f063e7f860f907b0b729
|
|
7
|
+
data.tar.gz: 497e10803825d58f550569fae77d4e02a20ff1a3a75480c31710513b41c58e19d8ce4d7979b497066f22385ca3c5cab537edd6a10d7b7d9e79ad619cf36d0a64
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 (2026-04-30)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.3.0...v0.4.0](https://github.com/prelude-so/ruby-sdk/compare/v0.3.0...v0.4.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([6ef917b](https://github.com/prelude-so/ruby-sdk/commit/6ef917bcd3a32e40139d32528e20ad17ea3b8278))
|
|
10
|
+
* **api:** api update ([f0ec5a8](https://github.com/prelude-so/ruby-sdk/commit/f0ec5a8d5121f7f8d541a3f9fbf5a2176380bdb2))
|
|
11
|
+
* **api:** api update ([3041c86](https://github.com/prelude-so/ruby-sdk/commit/3041c8644933cc9a849dc02bdf2717c4405bf812))
|
|
12
|
+
* **api:** api update ([3d94aa1](https://github.com/prelude-so/ruby-sdk/commit/3d94aa1539b0ee491fb1b852976aee745c72f08b))
|
|
13
|
+
* **api:** api update ([3f9e6ce](https://github.com/prelude-so/ruby-sdk/commit/3f9e6ce6f97d66c574611befa9c1620b93eeeb76))
|
|
14
|
+
* support setting headers via env ([755c4ac](https://github.com/prelude-so/ruby-sdk/commit/755c4acad1a339802b824f6f719a9084db6742fc))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* align path encoding with RFC 3986 section 3.3 ([20f9b5e](https://github.com/prelude-so/ruby-sdk/commit/20f9b5e3571676a09e4b2aa5a1f554257d67c07d))
|
|
20
|
+
* **internal:** correct multipart form field name encoding ([ba42aef](https://github.com/prelude-so/ruby-sdk/commit/ba42aeff39e77c2911fddb776676bf5ec3b6480d))
|
|
21
|
+
* multipart encoding for file arrays ([00c8720](https://github.com/prelude-so/ruby-sdk/commit/00c87208d38c26848af8a20f0f2ab916d908ca95))
|
|
22
|
+
* variable name typo ([2a83f6e](https://github.com/prelude-so/ruby-sdk/commit/2a83f6eff281991ab4736f6ce752cef42c7e4b60))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Chores
|
|
26
|
+
|
|
27
|
+
* **ci:** skip lint on metadata-only changes ([ecdcd0b](https://github.com/prelude-so/ruby-sdk/commit/ecdcd0b15967ac9ab50887e24c9884804a72c2c7))
|
|
28
|
+
* **ci:** support opting out of skipping builds on metadata-only commits ([86d205e](https://github.com/prelude-so/ruby-sdk/commit/86d205e651fbb5002655857a287ec09b0b2b4370))
|
|
29
|
+
* **internal:** more robust bootstrap script ([1163c75](https://github.com/prelude-so/ruby-sdk/commit/1163c758b68ed31eb3ae60117d8850ba3417c829))
|
|
30
|
+
* **tests:** bump steady to v0.19.6 ([9be6206](https://github.com/prelude-so/ruby-sdk/commit/9be6206e357ce0ab47da60230a356ed5d2e33bc3))
|
|
31
|
+
* **tests:** bump steady to v0.19.7 ([e96d496](https://github.com/prelude-so/ruby-sdk/commit/e96d496b589f7a404288d92b8519ae25fc1f4c96))
|
|
32
|
+
* **tests:** bump steady to v0.20.1 ([f9c136f](https://github.com/prelude-so/ruby-sdk/commit/f9c136fad7a342404cc80b6e5d10a0c5cce19d88))
|
|
33
|
+
* **tests:** bump steady to v0.20.2 ([cf8ca21](https://github.com/prelude-so/ruby-sdk/commit/cf8ca215bacfb6606bfe3ca08db55bacef5c3d18))
|
|
34
|
+
* **tests:** bump steady to v0.22.1 ([4223d7b](https://github.com/prelude-so/ruby-sdk/commit/4223d7b15d68b27d1029eb93e135a96e25244548))
|
|
35
|
+
|
|
3
36
|
## 0.3.0 (2026-03-23)
|
|
4
37
|
|
|
5
38
|
Full Changelog: [v0.2.0...v0.3.0](https://github.com/prelude-so/ruby-sdk/compare/v0.2.0...v0.3.0)
|
data/README.md
CHANGED
data/lib/prelude_sdk/client.rb
CHANGED
|
@@ -81,6 +81,19 @@ module PreludeSDK
|
|
|
81
81
|
raise ArgumentError.new("api_token is required, and can be set via environ: \"API_TOKEN\"")
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
headers = {}
|
|
85
|
+
custom_headers_env = ENV["PRELUDE_CUSTOM_HEADERS"]
|
|
86
|
+
unless custom_headers_env.nil?
|
|
87
|
+
parsed = {}
|
|
88
|
+
custom_headers_env.split("\n").each do |line|
|
|
89
|
+
colon = line.index(":")
|
|
90
|
+
unless colon.nil?
|
|
91
|
+
parsed[line[0...colon].strip] = line[(colon + 1)..].strip
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
headers = parsed.merge(headers)
|
|
95
|
+
end
|
|
96
|
+
|
|
84
97
|
@api_token = api_token.to_s
|
|
85
98
|
|
|
86
99
|
super(
|
|
@@ -88,7 +101,8 @@ module PreludeSDK
|
|
|
88
101
|
timeout: timeout,
|
|
89
102
|
max_retries: max_retries,
|
|
90
103
|
initial_retry_delay: initial_retry_delay,
|
|
91
|
-
max_retry_delay: max_retry_delay
|
|
104
|
+
max_retry_delay: max_retry_delay,
|
|
105
|
+
headers: headers
|
|
92
106
|
)
|
|
93
107
|
|
|
94
108
|
@lookup = PreludeSDK::Resources::Lookup.new(client: self)
|
|
@@ -157,7 +157,7 @@ module PreludeSDK
|
|
|
157
157
|
in Hash | nil => coerced
|
|
158
158
|
coerced
|
|
159
159
|
else
|
|
160
|
-
message = "Expected a #{Hash} or #{PreludeSDK::Internal::Type::BaseModel}, got #{
|
|
160
|
+
message = "Expected a #{Hash} or #{PreludeSDK::Internal::Type::BaseModel}, got #{input.inspect}"
|
|
161
161
|
raise ArgumentError.new(message)
|
|
162
162
|
end
|
|
163
163
|
end
|
|
@@ -237,6 +237,11 @@ module PreludeSDK
|
|
|
237
237
|
end
|
|
238
238
|
end
|
|
239
239
|
|
|
240
|
+
# @type [Regexp]
|
|
241
|
+
#
|
|
242
|
+
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
|
|
243
|
+
RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
|
|
244
|
+
|
|
240
245
|
class << self
|
|
241
246
|
# @api private
|
|
242
247
|
#
|
|
@@ -247,6 +252,15 @@ module PreludeSDK
|
|
|
247
252
|
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
|
|
248
253
|
end
|
|
249
254
|
|
|
255
|
+
# @api private
|
|
256
|
+
#
|
|
257
|
+
# @param path [String, Integer]
|
|
258
|
+
#
|
|
259
|
+
# @return [String]
|
|
260
|
+
def encode_path(path)
|
|
261
|
+
path.to_s.gsub(PreludeSDK::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
|
|
262
|
+
end
|
|
263
|
+
|
|
250
264
|
# @api private
|
|
251
265
|
#
|
|
252
266
|
# @param path [String, Array<String>]
|
|
@@ -259,7 +273,7 @@ module PreludeSDK
|
|
|
259
273
|
in []
|
|
260
274
|
""
|
|
261
275
|
in [String => p, *interpolations]
|
|
262
|
-
encoded = interpolations.map {
|
|
276
|
+
encoded = interpolations.map { encode_path(_1) }
|
|
263
277
|
format(p, *encoded)
|
|
264
278
|
end
|
|
265
279
|
end
|
|
@@ -571,16 +585,15 @@ module PreludeSDK
|
|
|
571
585
|
y << "Content-Disposition: form-data"
|
|
572
586
|
|
|
573
587
|
unless key.nil?
|
|
574
|
-
|
|
575
|
-
y << "; name=\"#{name}\""
|
|
588
|
+
y << "; name=\"#{key}\""
|
|
576
589
|
end
|
|
577
590
|
|
|
578
591
|
case val
|
|
579
592
|
in PreludeSDK::FilePart unless val.filename.nil?
|
|
580
|
-
filename =
|
|
593
|
+
filename = encode_path(val.filename)
|
|
581
594
|
y << "; filename=\"#{filename}\""
|
|
582
595
|
in Pathname | IO
|
|
583
|
-
filename =
|
|
596
|
+
filename = encode_path(::File.basename(val.to_path))
|
|
584
597
|
y << "; filename=\"#{filename}\""
|
|
585
598
|
else
|
|
586
599
|
end
|
|
@@ -597,6 +610,7 @@ module PreludeSDK
|
|
|
597
610
|
#
|
|
598
611
|
# @return [Array(String, Enumerable<String>)]
|
|
599
612
|
private def encode_multipart_streaming(body)
|
|
613
|
+
# rubocop:disable Style/CaseEquality
|
|
600
614
|
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
|
601
615
|
boundary = SecureRandom.urlsafe_base64(46)
|
|
602
616
|
|
|
@@ -606,7 +620,7 @@ module PreludeSDK
|
|
|
606
620
|
in Hash
|
|
607
621
|
body.each do |key, val|
|
|
608
622
|
case val
|
|
609
|
-
in Array if val.all? { primitive?(_1) }
|
|
623
|
+
in Array if val.all? { primitive?(_1) || PreludeSDK::Internal::Type::FileInput === _1 }
|
|
610
624
|
val.each do |v|
|
|
611
625
|
write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
|
|
612
626
|
end
|
|
@@ -622,6 +636,7 @@ module PreludeSDK
|
|
|
622
636
|
|
|
623
637
|
fused_io = fused_enum(strio) { closing.each(&:call) }
|
|
624
638
|
[boundary, fused_io]
|
|
639
|
+
# rubocop:enable Style/CaseEquality
|
|
625
640
|
end
|
|
626
641
|
|
|
627
642
|
# @api private
|
|
@@ -32,8 +32,16 @@ module PreludeSDK
|
|
|
32
32
|
optional :correlation_id, String
|
|
33
33
|
|
|
34
34
|
# @!attribute document
|
|
35
|
-
# A
|
|
36
|
-
#
|
|
35
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
36
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
37
|
+
# type is determined by the template's registered header format; send the matching
|
|
38
|
+
# file type for each.
|
|
39
|
+
#
|
|
40
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
41
|
+
# required and displayed to the recipient.
|
|
42
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
43
|
+
# is ignored.
|
|
44
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
37
45
|
#
|
|
38
46
|
# @return [PreludeSDK::Models::NotifySendBatchParams::Document, nil]
|
|
39
47
|
optional :document, -> { PreludeSDK::NotifySendBatchParams::Document }
|
|
@@ -88,7 +96,7 @@ module PreludeSDK
|
|
|
88
96
|
#
|
|
89
97
|
# @param correlation_id [String] A user-defined identifier to correlate this request with your internal systems.
|
|
90
98
|
#
|
|
91
|
-
# @param document [PreludeSDK::Models::NotifySendBatchParams::Document] A
|
|
99
|
+
# @param document [PreludeSDK::Models::NotifySendBatchParams::Document] A media attachment to include in the message header. Supported on
|
|
92
100
|
#
|
|
93
101
|
# @param expires_at [Time] The message expiration date in RFC3339 format. Messages will not be sent after t
|
|
94
102
|
#
|
|
@@ -105,25 +113,39 @@ module PreludeSDK
|
|
|
105
113
|
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
106
114
|
|
|
107
115
|
class Document < PreludeSDK::Internal::Type::BaseModel
|
|
108
|
-
# @!attribute filename
|
|
109
|
-
# The filename to display for the document.
|
|
110
|
-
#
|
|
111
|
-
# @return [String]
|
|
112
|
-
required :filename, String
|
|
113
|
-
|
|
114
116
|
# @!attribute url
|
|
115
|
-
#
|
|
117
|
+
# HTTPS URL of the media file. The file extension must match the template's
|
|
118
|
+
# registered header format (PDF for DOCUMENT; PNG/JPG/JPEG/WEBP for IMAGE; MP4/3GP
|
|
119
|
+
# for VIDEO).
|
|
116
120
|
#
|
|
117
121
|
# @return [String]
|
|
118
122
|
required :url, String
|
|
119
123
|
|
|
120
|
-
# @!
|
|
121
|
-
#
|
|
122
|
-
#
|
|
124
|
+
# @!attribute filename
|
|
125
|
+
# Filename displayed to the recipient. Required for templates with a `DOCUMENT`
|
|
126
|
+
# header; ignored for `IMAGE` and `VIDEO` headers.
|
|
127
|
+
#
|
|
128
|
+
# @return [String, nil]
|
|
129
|
+
optional :filename, String
|
|
130
|
+
|
|
131
|
+
# @!method initialize(url:, filename: nil)
|
|
132
|
+
# Some parameter documentations has been truncated, see
|
|
133
|
+
# {PreludeSDK::Models::NotifySendBatchParams::Document} for more details.
|
|
134
|
+
#
|
|
135
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
136
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
137
|
+
# type is determined by the template's registered header format; send the matching
|
|
138
|
+
# file type for each.
|
|
139
|
+
#
|
|
140
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
141
|
+
# required and displayed to the recipient.
|
|
142
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
143
|
+
# is ignored.
|
|
144
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
123
145
|
#
|
|
124
|
-
# @param
|
|
146
|
+
# @param url [String] HTTPS URL of the media file. The file extension must match the template's regist
|
|
125
147
|
#
|
|
126
|
-
# @param
|
|
148
|
+
# @param filename [String] Filename displayed to the recipient. Required for templates with a `DOCUMENT` he
|
|
127
149
|
end
|
|
128
150
|
|
|
129
151
|
# Preferred channel for delivery. If unavailable, automatic fallback applies.
|
|
@@ -131,6 +153,7 @@ module PreludeSDK
|
|
|
131
153
|
extend PreludeSDK::Internal::Type::Enum
|
|
132
154
|
|
|
133
155
|
SMS = :sms
|
|
156
|
+
RCS = :rcs
|
|
134
157
|
WHATSAPP = :whatsapp
|
|
135
158
|
|
|
136
159
|
# @!method self.values
|
|
@@ -25,6 +25,13 @@ module PreludeSDK
|
|
|
25
25
|
# @return [String, nil]
|
|
26
26
|
optional :callback_url, String
|
|
27
27
|
|
|
28
|
+
# @!attribute context
|
|
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
|
+
#
|
|
32
|
+
# @return [PreludeSDK::Models::NotifySendParams::Context, nil]
|
|
33
|
+
optional :context, -> { PreludeSDK::NotifySendParams::Context }
|
|
34
|
+
|
|
28
35
|
# @!attribute correlation_id
|
|
29
36
|
# A user-defined identifier to correlate this message with your internal systems.
|
|
30
37
|
# It is returned in the response and any webhook events that refer to this
|
|
@@ -34,8 +41,16 @@ module PreludeSDK
|
|
|
34
41
|
optional :correlation_id, String
|
|
35
42
|
|
|
36
43
|
# @!attribute document
|
|
37
|
-
# A
|
|
38
|
-
#
|
|
44
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
45
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
46
|
+
# type is determined by the template's registered header format; send the matching
|
|
47
|
+
# file type for each.
|
|
48
|
+
#
|
|
49
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
50
|
+
# required and displayed to the recipient.
|
|
51
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
52
|
+
# is ignored.
|
|
53
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
39
54
|
#
|
|
40
55
|
# @return [PreludeSDK::Models::NotifySendParams::Document, nil]
|
|
41
56
|
optional :document, -> { PreludeSDK::NotifySendParams::Document }
|
|
@@ -77,13 +92,21 @@ module PreludeSDK
|
|
|
77
92
|
# @return [Time, nil]
|
|
78
93
|
optional :schedule_at, Time
|
|
79
94
|
|
|
95
|
+
# @!attribute text
|
|
96
|
+
# The reply message body. Required when `context.reply_to` is provided. Used for
|
|
97
|
+
# 2-way WhatsApp messaging to send free-form text replies within a conversation
|
|
98
|
+
# window.
|
|
99
|
+
#
|
|
100
|
+
# @return [String, nil]
|
|
101
|
+
optional :text, String
|
|
102
|
+
|
|
80
103
|
# @!attribute variables
|
|
81
104
|
# The variables to be replaced in the template.
|
|
82
105
|
#
|
|
83
106
|
# @return [Hash{Symbol=>String}, nil]
|
|
84
107
|
optional :variables, PreludeSDK::Internal::Type::HashOf[String]
|
|
85
108
|
|
|
86
|
-
# @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
|
|
109
|
+
# @!method initialize(template_id:, to:, callback_url: nil, context: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, text: nil, variables: nil, request_options: {})
|
|
87
110
|
# Some parameter documentations has been truncated, see
|
|
88
111
|
# {PreludeSDK::Models::NotifySendParams} for more details.
|
|
89
112
|
#
|
|
@@ -93,9 +116,11 @@ module PreludeSDK
|
|
|
93
116
|
#
|
|
94
117
|
# @param callback_url [String] The URL where webhooks will be sent for message delivery events.
|
|
95
118
|
#
|
|
119
|
+
# @param context [PreludeSDK::Models::NotifySendParams::Context] Context for replying to an inbound message. When provided, the message is sent a
|
|
120
|
+
#
|
|
96
121
|
# @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
|
|
97
122
|
#
|
|
98
|
-
# @param document [PreludeSDK::Models::NotifySendParams::Document] A
|
|
123
|
+
# @param document [PreludeSDK::Models::NotifySendParams::Document] A media attachment to include in the message header. Supported on
|
|
99
124
|
#
|
|
100
125
|
# @param expires_at [Time] The message expiration date in RFC3339 format. The message will not be sent if t
|
|
101
126
|
#
|
|
@@ -107,30 +132,64 @@ module PreludeSDK
|
|
|
107
132
|
#
|
|
108
133
|
# @param schedule_at [Time] Schedule the message for future delivery in RFC3339 format. Marketing messages c
|
|
109
134
|
#
|
|
135
|
+
# @param text [String] The reply message body. Required when `context.reply_to` is provided. Used for 2
|
|
136
|
+
#
|
|
110
137
|
# @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
|
|
111
138
|
#
|
|
112
139
|
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
113
140
|
|
|
114
|
-
class
|
|
115
|
-
# @!attribute
|
|
116
|
-
# The
|
|
141
|
+
class Context < PreludeSDK::Internal::Type::BaseModel
|
|
142
|
+
# @!attribute reply_to
|
|
143
|
+
# The inbound message ID (prefixed with `im_`) to reply to. This ID is provided in
|
|
144
|
+
# the `inbound.message.received` webhook event.
|
|
117
145
|
#
|
|
118
146
|
# @return [String]
|
|
119
|
-
required :
|
|
147
|
+
required :reply_to, String
|
|
120
148
|
|
|
149
|
+
# @!method initialize(reply_to:)
|
|
150
|
+
# Some parameter documentations has been truncated, see
|
|
151
|
+
# {PreludeSDK::Models::NotifySendParams::Context} for more details.
|
|
152
|
+
#
|
|
153
|
+
# Context for replying to an inbound message. When provided, the message is sent
|
|
154
|
+
# as a WhatsApp reply within the 24-hour conversation window.
|
|
155
|
+
#
|
|
156
|
+
# @param reply_to [String] The inbound message ID (prefixed with `im_`) to reply to. This ID is provided in
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
class Document < PreludeSDK::Internal::Type::BaseModel
|
|
121
160
|
# @!attribute url
|
|
122
|
-
#
|
|
161
|
+
# HTTPS URL of the media file. The file extension must match the template's
|
|
162
|
+
# registered header format (PDF for DOCUMENT; PNG/JPG/JPEG/WEBP for IMAGE; MP4/3GP
|
|
163
|
+
# for VIDEO).
|
|
123
164
|
#
|
|
124
165
|
# @return [String]
|
|
125
166
|
required :url, String
|
|
126
167
|
|
|
127
|
-
# @!
|
|
128
|
-
#
|
|
129
|
-
#
|
|
168
|
+
# @!attribute filename
|
|
169
|
+
# Filename displayed to the recipient. Required for templates with a `DOCUMENT`
|
|
170
|
+
# header; ignored for `IMAGE` and `VIDEO` headers.
|
|
171
|
+
#
|
|
172
|
+
# @return [String, nil]
|
|
173
|
+
optional :filename, String
|
|
174
|
+
|
|
175
|
+
# @!method initialize(url:, filename: nil)
|
|
176
|
+
# Some parameter documentations has been truncated, see
|
|
177
|
+
# {PreludeSDK::Models::NotifySendParams::Document} for more details.
|
|
178
|
+
#
|
|
179
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
180
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
181
|
+
# type is determined by the template's registered header format; send the matching
|
|
182
|
+
# file type for each.
|
|
183
|
+
#
|
|
184
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
185
|
+
# required and displayed to the recipient.
|
|
186
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
187
|
+
# is ignored.
|
|
188
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
130
189
|
#
|
|
131
|
-
# @param
|
|
190
|
+
# @param url [String] HTTPS URL of the media file. The file extension must match the template's regist
|
|
132
191
|
#
|
|
133
|
-
# @param
|
|
192
|
+
# @param filename [String] Filename displayed to the recipient. Required for templates with a `DOCUMENT` he
|
|
134
193
|
end
|
|
135
194
|
|
|
136
195
|
# The preferred channel to be used in priority for message delivery. If the
|
|
@@ -139,6 +198,7 @@ module PreludeSDK
|
|
|
139
198
|
extend PreludeSDK::Internal::Type::Enum
|
|
140
199
|
|
|
141
200
|
SMS = :sms
|
|
201
|
+
RCS = :rcs
|
|
142
202
|
WHATSAPP = :whatsapp
|
|
143
203
|
|
|
144
204
|
# @!method self.values
|
|
@@ -34,8 +34,16 @@ module PreludeSDK
|
|
|
34
34
|
optional :correlation_id, String
|
|
35
35
|
|
|
36
36
|
# @!attribute document
|
|
37
|
-
# A
|
|
38
|
-
#
|
|
37
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
38
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
39
|
+
# type is determined by the template's registered header format; send the matching
|
|
40
|
+
# file type for each.
|
|
41
|
+
#
|
|
42
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
43
|
+
# required and displayed to the recipient.
|
|
44
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
45
|
+
# is ignored.
|
|
46
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
39
47
|
#
|
|
40
48
|
# @return [PreludeSDK::Models::TransactionalSendParams::Document, nil]
|
|
41
49
|
optional :document, -> { PreludeSDK::TransactionalSendParams::Document }
|
|
@@ -93,7 +101,7 @@ module PreludeSDK
|
|
|
93
101
|
#
|
|
94
102
|
# @param correlation_id [String] A user-defined identifier to correlate this transactional message with. It is re
|
|
95
103
|
#
|
|
96
|
-
# @param document [PreludeSDK::Models::TransactionalSendParams::Document] A
|
|
104
|
+
# @param document [PreludeSDK::Models::TransactionalSendParams::Document] A media attachment to include in the message header. Supported on
|
|
97
105
|
#
|
|
98
106
|
# @param expires_at [String] The message expiration date.
|
|
99
107
|
#
|
|
@@ -108,25 +116,39 @@ module PreludeSDK
|
|
|
108
116
|
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
109
117
|
|
|
110
118
|
class Document < PreludeSDK::Internal::Type::BaseModel
|
|
111
|
-
# @!attribute filename
|
|
112
|
-
# The filename to display for the document.
|
|
113
|
-
#
|
|
114
|
-
# @return [String]
|
|
115
|
-
required :filename, String
|
|
116
|
-
|
|
117
119
|
# @!attribute url
|
|
118
|
-
#
|
|
120
|
+
# HTTPS URL of the media file. The file extension must match the template's
|
|
121
|
+
# registered header format (PDF for DOCUMENT; PNG/JPG/JPEG/WEBP for IMAGE; MP4/3GP
|
|
122
|
+
# for VIDEO).
|
|
119
123
|
#
|
|
120
124
|
# @return [String]
|
|
121
125
|
required :url, String
|
|
122
126
|
|
|
123
|
-
# @!
|
|
124
|
-
#
|
|
125
|
-
#
|
|
127
|
+
# @!attribute filename
|
|
128
|
+
# Filename displayed to the recipient. Required for templates with a `DOCUMENT`
|
|
129
|
+
# header; ignored for `IMAGE` and `VIDEO` headers.
|
|
130
|
+
#
|
|
131
|
+
# @return [String, nil]
|
|
132
|
+
optional :filename, String
|
|
133
|
+
|
|
134
|
+
# @!method initialize(url:, filename: nil)
|
|
135
|
+
# Some parameter documentations has been truncated, see
|
|
136
|
+
# {PreludeSDK::Models::TransactionalSendParams::Document} for more details.
|
|
137
|
+
#
|
|
138
|
+
# A media attachment to include in the message header. Supported on WhatsApp
|
|
139
|
+
# templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
|
|
140
|
+
# type is determined by the template's registered header format; send the matching
|
|
141
|
+
# file type for each.
|
|
142
|
+
#
|
|
143
|
+
# - `DOCUMENT` headers accept PDF and other document formats; `filename` is
|
|
144
|
+
# required and displayed to the recipient.
|
|
145
|
+
# - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
|
|
146
|
+
# is ignored.
|
|
147
|
+
# - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
|
|
126
148
|
#
|
|
127
|
-
# @param
|
|
149
|
+
# @param url [String] HTTPS URL of the media file. The file extension must match the template's regist
|
|
128
150
|
#
|
|
129
|
-
# @param
|
|
151
|
+
# @param filename [String] Filename displayed to the recipient. Required for templates with a `DOCUMENT` he
|
|
130
152
|
end
|
|
131
153
|
|
|
132
154
|
# The preferred delivery channel for the message. When specified, the system will
|
|
@@ -69,13 +69,43 @@ module PreludeSDK
|
|
|
69
69
|
# @return [String, nil]
|
|
70
70
|
optional :request_id, String
|
|
71
71
|
|
|
72
|
+
# @!attribute risk_factors
|
|
73
|
+
# The risk factors that contributed to the verification being blocked. Only
|
|
74
|
+
# present when status is "blocked" and the anti-fraud system detected specific
|
|
75
|
+
# risk signals.
|
|
76
|
+
#
|
|
77
|
+
# - `behavioral_pattern` - The phone number past behavior during verification
|
|
78
|
+
# flows exhibits suspicious patterns.
|
|
79
|
+
# - `device_attribute` - The device exhibits characteristics associated with
|
|
80
|
+
# suspicious activity patterns.
|
|
81
|
+
# - `fraud_database` - The phone number has been flagged as suspicious in one or
|
|
82
|
+
# more of our fraud databases.
|
|
83
|
+
# - `location_discrepancy` - The phone number prefix and IP address discrepancy
|
|
84
|
+
# indicates potential fraud.
|
|
85
|
+
# - `network_fingerprint` - The network connection exhibits characteristics
|
|
86
|
+
# associated with suspicious activity patterns.
|
|
87
|
+
# - `poor_conversion_history` - The phone number has a history of poorly
|
|
88
|
+
# converting to a verified phone number.
|
|
89
|
+
# - `prefix_concentration` - The phone number is part of a range known to be
|
|
90
|
+
# associated with suspicious activity patterns.
|
|
91
|
+
# - `suspected_request_tampering` - The SDK signature is invalid and the request
|
|
92
|
+
# is considered to be tampered with.
|
|
93
|
+
# - `suspicious_ip_address` - The IP address is deemed to be associated with
|
|
94
|
+
# suspicious activity patterns.
|
|
95
|
+
# - `temporary_phone_number` - The phone number is known to be a temporary or
|
|
96
|
+
# disposable number.
|
|
97
|
+
#
|
|
98
|
+
# @return [Array<Symbol, PreludeSDK::Models::VerificationCreateResponse::RiskFactor>, nil]
|
|
99
|
+
optional :risk_factors,
|
|
100
|
+
-> { PreludeSDK::Internal::Type::ArrayOf[enum: PreludeSDK::Models::VerificationCreateResponse::RiskFactor] }
|
|
101
|
+
|
|
72
102
|
# @!attribute silent
|
|
73
103
|
# The silent verification specific properties.
|
|
74
104
|
#
|
|
75
105
|
# @return [PreludeSDK::Models::VerificationCreateResponse::Silent, nil]
|
|
76
106
|
optional :silent, -> { PreludeSDK::Models::VerificationCreateResponse::Silent }
|
|
77
107
|
|
|
78
|
-
# @!method initialize(id:, verification_method:, status:, channels: nil, metadata: nil, reason: nil, request_id: nil, silent: nil)
|
|
108
|
+
# @!method initialize(id:, verification_method:, status:, channels: nil, metadata: nil, reason: nil, request_id: nil, risk_factors: nil, silent: nil)
|
|
79
109
|
# Some parameter documentations has been truncated, see
|
|
80
110
|
# {PreludeSDK::Models::VerificationCreateResponse} for more details.
|
|
81
111
|
#
|
|
@@ -93,6 +123,8 @@ module PreludeSDK
|
|
|
93
123
|
#
|
|
94
124
|
# @param request_id [String]
|
|
95
125
|
#
|
|
126
|
+
# @param risk_factors [Array<Symbol, PreludeSDK::Models::VerificationCreateResponse::RiskFactor>] The risk factors that contributed to the verification being blocked. Only presen
|
|
127
|
+
#
|
|
96
128
|
# @param silent [PreludeSDK::Models::VerificationCreateResponse::Silent] The silent verification specific properties.
|
|
97
129
|
|
|
98
130
|
# The method used for verifying this phone number.
|
|
@@ -198,6 +230,24 @@ module PreludeSDK
|
|
|
198
230
|
# @return [Array<Symbol>]
|
|
199
231
|
end
|
|
200
232
|
|
|
233
|
+
module RiskFactor
|
|
234
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
235
|
+
|
|
236
|
+
BEHAVIORAL_PATTERN = :behavioral_pattern
|
|
237
|
+
DEVICE_ATTRIBUTE = :device_attribute
|
|
238
|
+
FRAUD_DATABASE = :fraud_database
|
|
239
|
+
LOCATION_DISCREPANCY = :location_discrepancy
|
|
240
|
+
NETWORK_FINGERPRINT = :network_fingerprint
|
|
241
|
+
POOR_CONVERSION_HISTORY = :poor_conversion_history
|
|
242
|
+
PREFIX_CONCENTRATION = :prefix_concentration
|
|
243
|
+
SUSPECTED_REQUEST_TAMPERING = :suspected_request_tampering
|
|
244
|
+
SUSPICIOUS_IP_ADDRESS = :suspicious_ip_address
|
|
245
|
+
TEMPORARY_PHONE_NUMBER = :temporary_phone_number
|
|
246
|
+
|
|
247
|
+
# @!method self.values
|
|
248
|
+
# @return [Array<Symbol>]
|
|
249
|
+
end
|
|
250
|
+
|
|
201
251
|
# @see PreludeSDK::Models::VerificationCreateResponse#silent
|
|
202
252
|
class Silent < PreludeSDK::Internal::Type::BaseModel
|
|
203
253
|
# @!attribute request_url
|
|
@@ -8,13 +8,17 @@ module PreludeSDK
|
|
|
8
8
|
include PreludeSDK::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute events
|
|
11
|
-
# A list of events to dispatch.
|
|
11
|
+
# A list of events to dispatch. A maximum of 100 events can be sent in a single
|
|
12
|
+
# request.
|
|
12
13
|
#
|
|
13
14
|
# @return [Array<PreludeSDK::Models::WatchSendEventsParams::Event>]
|
|
14
15
|
required :events, -> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::WatchSendEventsParams::Event] }
|
|
15
16
|
|
|
16
17
|
# @!method initialize(events:, request_options: {})
|
|
17
|
-
#
|
|
18
|
+
# Some parameter documentations has been truncated, see
|
|
19
|
+
# {PreludeSDK::Models::WatchSendEventsParams} for more details.
|
|
20
|
+
#
|
|
21
|
+
# @param events [Array<PreludeSDK::Models::WatchSendEventsParams::Event>] A list of events to dispatch. A maximum of 100 events can be sent in a single re
|
|
18
22
|
#
|
|
19
23
|
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
20
24
|
|
|
@@ -8,14 +8,18 @@ module PreludeSDK
|
|
|
8
8
|
include PreludeSDK::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute feedbacks
|
|
11
|
-
# A list of feedbacks to send.
|
|
11
|
+
# A list of feedbacks to send. A maximum of 100 feedbacks can be sent in a single
|
|
12
|
+
# request.
|
|
12
13
|
#
|
|
13
14
|
# @return [Array<PreludeSDK::Models::WatchSendFeedbacksParams::Feedback>]
|
|
14
15
|
required :feedbacks,
|
|
15
16
|
-> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::WatchSendFeedbacksParams::Feedback] }
|
|
16
17
|
|
|
17
18
|
# @!method initialize(feedbacks:, request_options: {})
|
|
18
|
-
#
|
|
19
|
+
# Some parameter documentations has been truncated, see
|
|
20
|
+
# {PreludeSDK::Models::WatchSendFeedbacksParams} for more details.
|
|
21
|
+
#
|
|
22
|
+
# @param feedbacks [Array<PreludeSDK::Models::WatchSendFeedbacksParams::Feedback>] A list of feedbacks to send. A maximum of 100 feedbacks can be sent in a single
|
|
19
23
|
#
|
|
20
24
|
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
21
25
|
|