prelude-sdk 0.3.0 → 0.5.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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -0
  3. data/README.md +1 -1
  4. data/lib/prelude_sdk/client.rb +15 -1
  5. data/lib/prelude_sdk/internal/util.rb +22 -7
  6. data/lib/prelude_sdk/models/notify_send_batch_params.rb +38 -15
  7. data/lib/prelude_sdk/models/notify_send_params.rb +38 -15
  8. data/lib/prelude_sdk/models/transactional_send_params.rb +37 -15
  9. data/lib/prelude_sdk/models/verification_create_response.rb +60 -3
  10. data/lib/prelude_sdk/models/watch_send_events_params.rb +6 -2
  11. data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +6 -2
  12. data/lib/prelude_sdk/resources/notify.rb +4 -4
  13. data/lib/prelude_sdk/resources/transactional.rb +1 -1
  14. data/lib/prelude_sdk/resources/watch.rb +8 -2
  15. data/lib/prelude_sdk/version.rb +1 -1
  16. data/rbi/prelude_sdk/internal/util.rbi +8 -0
  17. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +55 -17
  18. data/rbi/prelude_sdk/models/notify_send_params.rbi +55 -17
  19. data/rbi/prelude_sdk/models/transactional_send_params.rbi +50 -17
  20. data/rbi/prelude_sdk/models/verification_create_response.rbi +169 -3
  21. data/rbi/prelude_sdk/models/watch_send_events_params.rbi +4 -2
  22. data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +4 -2
  23. data/rbi/prelude_sdk/resources/notify.rbi +22 -6
  24. data/rbi/prelude_sdk/resources/transactional.rbi +10 -2
  25. data/rbi/prelude_sdk/resources/watch.rbi +4 -2
  26. data/sig/prelude_sdk/internal/util.rbs +4 -0
  27. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +9 -6
  28. data/sig/prelude_sdk/models/notify_send_params.rbs +9 -6
  29. data/sig/prelude_sdk/models/transactional_send_params.rbs +7 -5
  30. data/sig/prelude_sdk/models/verification_create_response.rbs +40 -1
  31. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0442af375a6b077b348b680c39f073a48a66ff185d57f5f20ee53300531a8bf7
4
- data.tar.gz: 60d8b444c65e5e55b487f61d158c9531fcb02435c66a1f9eaa3688640789d08f
3
+ metadata.gz: e471ff14576be4e30d555ac095637659799c089243d85e8eb0b1e107d5f72a4d
4
+ data.tar.gz: b7429bca67dc1516c3deaccf43ca63535b4b2ec8e07d36889635893b940cb1ee
5
5
  SHA512:
6
- metadata.gz: 6c337ee4e3c9f6d13391ae942cda76beaef0ff292b14b5416f66450005908bfe09d250fad09444635eaabf1fb3e02eb3ad8d356740218a0a7188729487c65639
7
- data.tar.gz: cb6ae9f844d4a6d5313e001802b40b0624e93da2cfdbbefaec0cfa68f2cd14f74a0397dd8ac51d338f52b24c478f350d19d9eb77a8cf4d17d12e9fe7778ffcea
6
+ metadata.gz: ad313a26fcd1936dc0b3e66224f7fdf4488c392c85ac3828ee18ff93463791e07ff0113296d5145ef492a3189787601c8481a8ee83fd735af42b985a52cbb148
7
+ data.tar.gz: 2be45dd24a4db7b69cc636e1db2703d69a88721034ebb50bff9f3f79c1b6df2179b4a1f4a08f9681bd6498c7f50f380034e9ff1e6ee895a437433932bbd9d212
data/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 (2026-05-07)
4
+
5
+ Full Changelog: [v0.4.0...v0.5.0](https://github.com/prelude-so/ruby-sdk/compare/v0.4.0...v0.5.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([4a28614](https://github.com/prelude-so/ruby-sdk/commit/4a286145c86c872f859225d1d892e98c640598af))
10
+ * **api:** api update ([7beed1d](https://github.com/prelude-so/ruby-sdk/commit/7beed1dab00a7fd90594bba5f94f53261e22b549))
11
+
12
+ ## 0.4.0 (2026-04-30)
13
+
14
+ Full Changelog: [v0.3.0...v0.4.0](https://github.com/prelude-so/ruby-sdk/compare/v0.3.0...v0.4.0)
15
+
16
+ ### Features
17
+
18
+ * **api:** api update ([6ef917b](https://github.com/prelude-so/ruby-sdk/commit/6ef917bcd3a32e40139d32528e20ad17ea3b8278))
19
+ * **api:** api update ([f0ec5a8](https://github.com/prelude-so/ruby-sdk/commit/f0ec5a8d5121f7f8d541a3f9fbf5a2176380bdb2))
20
+ * **api:** api update ([3041c86](https://github.com/prelude-so/ruby-sdk/commit/3041c8644933cc9a849dc02bdf2717c4405bf812))
21
+ * **api:** api update ([3d94aa1](https://github.com/prelude-so/ruby-sdk/commit/3d94aa1539b0ee491fb1b852976aee745c72f08b))
22
+ * **api:** api update ([3f9e6ce](https://github.com/prelude-so/ruby-sdk/commit/3f9e6ce6f97d66c574611befa9c1620b93eeeb76))
23
+ * support setting headers via env ([755c4ac](https://github.com/prelude-so/ruby-sdk/commit/755c4acad1a339802b824f6f719a9084db6742fc))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * align path encoding with RFC 3986 section 3.3 ([20f9b5e](https://github.com/prelude-so/ruby-sdk/commit/20f9b5e3571676a09e4b2aa5a1f554257d67c07d))
29
+ * **internal:** correct multipart form field name encoding ([ba42aef](https://github.com/prelude-so/ruby-sdk/commit/ba42aeff39e77c2911fddb776676bf5ec3b6480d))
30
+ * multipart encoding for file arrays ([00c8720](https://github.com/prelude-so/ruby-sdk/commit/00c87208d38c26848af8a20f0f2ab916d908ca95))
31
+ * variable name typo ([2a83f6e](https://github.com/prelude-so/ruby-sdk/commit/2a83f6eff281991ab4736f6ce752cef42c7e4b60))
32
+
33
+
34
+ ### Chores
35
+
36
+ * **ci:** skip lint on metadata-only changes ([ecdcd0b](https://github.com/prelude-so/ruby-sdk/commit/ecdcd0b15967ac9ab50887e24c9884804a72c2c7))
37
+ * **ci:** support opting out of skipping builds on metadata-only commits ([86d205e](https://github.com/prelude-so/ruby-sdk/commit/86d205e651fbb5002655857a287ec09b0b2b4370))
38
+ * **internal:** more robust bootstrap script ([1163c75](https://github.com/prelude-so/ruby-sdk/commit/1163c758b68ed31eb3ae60117d8850ba3417c829))
39
+ * **tests:** bump steady to v0.19.6 ([9be6206](https://github.com/prelude-so/ruby-sdk/commit/9be6206e357ce0ab47da60230a356ed5d2e33bc3))
40
+ * **tests:** bump steady to v0.19.7 ([e96d496](https://github.com/prelude-so/ruby-sdk/commit/e96d496b589f7a404288d92b8519ae25fc1f4c96))
41
+ * **tests:** bump steady to v0.20.1 ([f9c136f](https://github.com/prelude-so/ruby-sdk/commit/f9c136fad7a342404cc80b6e5d10a0c5cce19d88))
42
+ * **tests:** bump steady to v0.20.2 ([cf8ca21](https://github.com/prelude-so/ruby-sdk/commit/cf8ca215bacfb6606bfe3ca08db55bacef5c3d18))
43
+ * **tests:** bump steady to v0.22.1 ([4223d7b](https://github.com/prelude-so/ruby-sdk/commit/4223d7b15d68b27d1029eb93e135a96e25244548))
44
+
3
45
  ## 0.3.0 (2026-03-23)
4
46
 
5
47
  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
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "prelude-sdk", "~> 0.3.0"
20
+ gem "prelude-sdk", "~> 0.5.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -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 #{data.inspect}"
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 { ERB::Util.url_encode(_1) }
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
- name = ERB::Util.url_encode(key.to_s)
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 = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
581
594
  y << "; filename=\"#{filename}\""
582
595
  in Pathname | IO
583
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
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 document to attach to the message. Only supported on WhatsApp templates that
36
- # have a document header.
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 document to attach to the message. Only supported on WhatsApp templates that h
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
- # The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
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
- # @!method initialize(filename:, url:)
121
- # A document to attach to the message. Only supported on WhatsApp templates that
122
- # have a document header.
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 filename [String] The filename to display for the document.
146
+ # @param url [String] HTTPS URL of the media file. The file extension must match the template's regist
125
147
  #
126
- # @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
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
@@ -34,8 +34,16 @@ module PreludeSDK
34
34
  optional :correlation_id, String
35
35
 
36
36
  # @!attribute document
37
- # A document to attach to the message. Only supported on WhatsApp templates that
38
- # have a document header.
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::NotifySendParams::Document, nil]
41
49
  optional :document, -> { PreludeSDK::NotifySendParams::Document }
@@ -95,7 +103,7 @@ module PreludeSDK
95
103
  #
96
104
  # @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
97
105
  #
98
- # @param document [PreludeSDK::Models::NotifySendParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
106
+ # @param document [PreludeSDK::Models::NotifySendParams::Document] A media attachment to include in the message header. Supported on
99
107
  #
100
108
  # @param expires_at [Time] The message expiration date in RFC3339 format. The message will not be sent if t
101
109
  #
@@ -112,25 +120,39 @@ module PreludeSDK
112
120
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
113
121
 
114
122
  class Document < PreludeSDK::Internal::Type::BaseModel
115
- # @!attribute filename
116
- # The filename to display for the document.
117
- #
118
- # @return [String]
119
- required :filename, String
120
-
121
123
  # @!attribute url
122
- # The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
124
+ # HTTPS URL of the media file. The file extension must match the template's
125
+ # registered header format (PDF for DOCUMENT; PNG/JPG/JPEG/WEBP for IMAGE; MP4/3GP
126
+ # for VIDEO).
123
127
  #
124
128
  # @return [String]
125
129
  required :url, String
126
130
 
127
- # @!method initialize(filename:, url:)
128
- # A document to attach to the message. Only supported on WhatsApp templates that
129
- # have a document header.
131
+ # @!attribute filename
132
+ # Filename displayed to the recipient. Required for templates with a `DOCUMENT`
133
+ # header; ignored for `IMAGE` and `VIDEO` headers.
134
+ #
135
+ # @return [String, nil]
136
+ optional :filename, String
137
+
138
+ # @!method initialize(url:, filename: nil)
139
+ # Some parameter documentations has been truncated, see
140
+ # {PreludeSDK::Models::NotifySendParams::Document} for more details.
141
+ #
142
+ # A media attachment to include in the message header. Supported on WhatsApp
143
+ # templates registered with a `DOCUMENT`, `IMAGE`, or `VIDEO` header. The media
144
+ # type is determined by the template's registered header format; send the matching
145
+ # file type for each.
146
+ #
147
+ # - `DOCUMENT` headers accept PDF and other document formats; `filename` is
148
+ # required and displayed to the recipient.
149
+ # - `IMAGE` headers accept `.png`, `.jpg`, `.jpeg`, and `.webp` URLs; `filename`
150
+ # is ignored.
151
+ # - `VIDEO` headers accept `.mp4` and `.3gp` URLs; `filename` is ignored.
130
152
  #
131
- # @param filename [String] The filename to display for the document.
153
+ # @param url [String] HTTPS URL of the media file. The file extension must match the template's regist
132
154
  #
133
- # @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
155
+ # @param filename [String] Filename displayed to the recipient. Required for templates with a `DOCUMENT` he
134
156
  end
135
157
 
136
158
  # The preferred channel to be used in priority for message delivery. If the
@@ -139,6 +161,7 @@ module PreludeSDK
139
161
  extend PreludeSDK::Internal::Type::Enum
140
162
 
141
163
  SMS = :sms
164
+ RCS = :rcs
142
165
  WHATSAPP = :whatsapp
143
166
 
144
167
  # @!method self.values
@@ -34,8 +34,16 @@ module PreludeSDK
34
34
  optional :correlation_id, String
35
35
 
36
36
  # @!attribute document
37
- # A document to attach to the message. Only supported on WhatsApp templates that
38
- # have a document header.
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 document to attach to the message. Only supported on WhatsApp templates that h
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
- # The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
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
- # @!method initialize(filename:, url:)
124
- # A document to attach to the message. Only supported on WhatsApp templates that
125
- # have a document header.
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 filename [String] The filename to display for the document.
149
+ # @param url [String] HTTPS URL of the media file. The file extension must match the template's regist
128
150
  #
129
- # @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
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
@@ -27,6 +27,9 @@ module PreludeSDK
27
27
  # non-voice channels only. This mode must be enabled for your customer account
28
28
  # by Prelude support.
29
29
  # - `blocked` - The verification was blocked.
30
+ # - `shadow_blocked` - The verification triggered a block rule but the decision
31
+ # was not enforced; this is used to dry-run anti-fraud configuration. This mode
32
+ # must be enabled for your customer account by Prelude support.
30
33
  #
31
34
  # @return [Symbol, PreludeSDK::Models::VerificationCreateResponse::Status]
32
35
  required :status, enum: -> { PreludeSDK::Models::VerificationCreateResponse::Status }
@@ -46,7 +49,7 @@ module PreludeSDK
46
49
 
47
50
  # @!attribute reason
48
51
  # The reason why the verification was blocked. Only present when status is
49
- # "blocked".
52
+ # "blocked" or "shadow_blocked".
50
53
  #
51
54
  # - `expired_signature` - The signature of the SDK signals is expired. They should
52
55
  # be sent within the hour following their collection.
@@ -69,13 +72,43 @@ module PreludeSDK
69
72
  # @return [String, nil]
70
73
  optional :request_id, String
71
74
 
75
+ # @!attribute risk_factors
76
+ # The risk factors that contributed to the verification being blocked. Only
77
+ # present when status is "blocked" or "shadow_blocked" and the anti-fraud system
78
+ # detected specific risk signals.
79
+ #
80
+ # - `behavioral_pattern` - The phone number past behavior during verification
81
+ # flows exhibits suspicious patterns.
82
+ # - `device_attribute` - The device exhibits characteristics associated with
83
+ # suspicious activity patterns.
84
+ # - `fraud_database` - The phone number has been flagged as suspicious in one or
85
+ # more of our fraud databases.
86
+ # - `location_discrepancy` - The phone number prefix and IP address discrepancy
87
+ # indicates potential fraud.
88
+ # - `network_fingerprint` - The network connection exhibits characteristics
89
+ # associated with suspicious activity patterns.
90
+ # - `poor_conversion_history` - The phone number has a history of poorly
91
+ # converting to a verified phone number.
92
+ # - `prefix_concentration` - The phone number is part of a range known to be
93
+ # associated with suspicious activity patterns.
94
+ # - `suspected_request_tampering` - The SDK signature is invalid and the request
95
+ # is considered to be tampered with.
96
+ # - `suspicious_ip_address` - The IP address is deemed to be associated with
97
+ # suspicious activity patterns.
98
+ # - `temporary_phone_number` - The phone number is known to be a temporary or
99
+ # disposable number.
100
+ #
101
+ # @return [Array<Symbol, PreludeSDK::Models::VerificationCreateResponse::RiskFactor>, nil]
102
+ optional :risk_factors,
103
+ -> { PreludeSDK::Internal::Type::ArrayOf[enum: PreludeSDK::Models::VerificationCreateResponse::RiskFactor] }
104
+
72
105
  # @!attribute silent
73
106
  # The silent verification specific properties.
74
107
  #
75
108
  # @return [PreludeSDK::Models::VerificationCreateResponse::Silent, nil]
76
109
  optional :silent, -> { PreludeSDK::Models::VerificationCreateResponse::Silent }
77
110
 
78
- # @!method initialize(id:, verification_method:, status:, channels: nil, metadata: nil, reason: nil, request_id: nil, silent: nil)
111
+ # @!method initialize(id:, verification_method:, status:, channels: nil, metadata: nil, reason: nil, request_id: nil, risk_factors: nil, silent: nil)
79
112
  # Some parameter documentations has been truncated, see
80
113
  # {PreludeSDK::Models::VerificationCreateResponse} for more details.
81
114
  #
@@ -93,6 +126,8 @@ module PreludeSDK
93
126
  #
94
127
  # @param request_id [String]
95
128
  #
129
+ # @param risk_factors [Array<Symbol, PreludeSDK::Models::VerificationCreateResponse::RiskFactor>] The risk factors that contributed to the verification being blocked. Only presen
130
+ #
96
131
  # @param silent [PreludeSDK::Models::VerificationCreateResponse::Silent] The silent verification specific properties.
97
132
 
98
133
  # The method used for verifying this phone number.
@@ -118,6 +153,9 @@ module PreludeSDK
118
153
  # non-voice channels only. This mode must be enabled for your customer account
119
154
  # by Prelude support.
120
155
  # - `blocked` - The verification was blocked.
156
+ # - `shadow_blocked` - The verification triggered a block rule but the decision
157
+ # was not enforced; this is used to dry-run anti-fraud configuration. This mode
158
+ # must be enabled for your customer account by Prelude support.
121
159
  #
122
160
  # @see PreludeSDK::Models::VerificationCreateResponse#status
123
161
  module Status
@@ -127,6 +165,7 @@ module PreludeSDK
127
165
  RETRY = :retry
128
166
  CHALLENGED = :challenged
129
167
  BLOCKED = :blocked
168
+ SHADOW_BLOCKED = :shadow_blocked
130
169
 
131
170
  # @!method self.values
132
171
  # @return [Array<Symbol>]
@@ -167,7 +206,7 @@ module PreludeSDK
167
206
  end
168
207
 
169
208
  # The reason why the verification was blocked. Only present when status is
170
- # "blocked".
209
+ # "blocked" or "shadow_blocked".
171
210
  #
172
211
  # - `expired_signature` - The signature of the SDK signals is expired. They should
173
212
  # be sent within the hour following their collection.
@@ -198,6 +237,24 @@ module PreludeSDK
198
237
  # @return [Array<Symbol>]
199
238
  end
200
239
 
240
+ module RiskFactor
241
+ extend PreludeSDK::Internal::Type::Enum
242
+
243
+ BEHAVIORAL_PATTERN = :behavioral_pattern
244
+ DEVICE_ATTRIBUTE = :device_attribute
245
+ FRAUD_DATABASE = :fraud_database
246
+ LOCATION_DISCREPANCY = :location_discrepancy
247
+ NETWORK_FINGERPRINT = :network_fingerprint
248
+ POOR_CONVERSION_HISTORY = :poor_conversion_history
249
+ PREFIX_CONCENTRATION = :prefix_concentration
250
+ SUSPECTED_REQUEST_TAMPERING = :suspected_request_tampering
251
+ SUSPICIOUS_IP_ADDRESS = :suspicious_ip_address
252
+ TEMPORARY_PHONE_NUMBER = :temporary_phone_number
253
+
254
+ # @!method self.values
255
+ # @return [Array<Symbol>]
256
+ end
257
+
201
258
  # @see PreludeSDK::Models::VerificationCreateResponse#silent
202
259
  class Silent < PreludeSDK::Internal::Type::BaseModel
203
260
  # @!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
- # @param events [Array<PreludeSDK::Models::WatchSendEventsParams::Event>] A list of events to dispatch.
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
- # @param feedbacks [Array<PreludeSDK::Models::WatchSendFeedbacksParams::Feedback>] A list of feedbacks to send.
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
 
@@ -156,8 +156,8 @@ module PreludeSDK
156
156
  # Some parameter documentations has been truncated, see
157
157
  # {PreludeSDK::Models::NotifySendParams} for more details.
158
158
  #
159
- # Send transactional and marketing messages to your users via SMS and WhatsApp
160
- # with automatic compliance enforcement.
159
+ # Send transactional and marketing messages to your users via SMS, RCS and
160
+ # WhatsApp with automatic compliance enforcement.
161
161
  #
162
162
  # @overload send_(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: {})
163
163
  #
@@ -169,7 +169,7 @@ module PreludeSDK
169
169
  #
170
170
  # @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
171
171
  #
172
- # @param document [PreludeSDK::Models::NotifySendParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
172
+ # @param document [PreludeSDK::Models::NotifySendParams::Document] A media attachment to include in the message header. Supported on
173
173
  #
174
174
  # @param expires_at [Time] The message expiration date in RFC3339 format. The message will not be sent if t
175
175
  #
@@ -214,7 +214,7 @@ module PreludeSDK
214
214
  #
215
215
  # @param correlation_id [String] A user-defined identifier to correlate this request with your internal systems.
216
216
  #
217
- # @param document [PreludeSDK::Models::NotifySendBatchParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
217
+ # @param document [PreludeSDK::Models::NotifySendBatchParams::Document] A media attachment to include in the message header. Supported on
218
218
  #
219
219
  # @param expires_at [Time] The message expiration date in RFC3339 format. Messages will not be sent after t
220
220
  #
@@ -22,7 +22,7 @@ module PreludeSDK
22
22
  #
23
23
  # @param correlation_id [String] A user-defined identifier to correlate this transactional message with. It is re
24
24
  #
25
- # @param document [PreludeSDK::Models::TransactionalSendParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
25
+ # @param document [PreludeSDK::Models::TransactionalSendParams::Document] A media attachment to include in the message header. Supported on
26
26
  #
27
27
  # @param expires_at [String] The message expiration date.
28
28
  #