prelude-sdk 0.2.0 → 0.3.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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -0
  3. data/README.md +1 -1
  4. data/lib/prelude_sdk/client.rb +7 -0
  5. data/lib/prelude_sdk/internal/transport/pooled_net_requester.rb +13 -11
  6. data/lib/prelude_sdk/internal/util.rb +39 -3
  7. data/lib/prelude_sdk/models/lookup_lookup_params.rb +9 -1
  8. data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +7 -1
  9. data/lib/prelude_sdk/models/notify_get_subscription_phone_number_params.rb +7 -1
  10. data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rb +8 -1
  11. data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rb +8 -1
  12. data/lib/prelude_sdk/models/notify_send_batch_params.rb +32 -1
  13. data/lib/prelude_sdk/models/notify_send_batch_response.rb +39 -1
  14. data/lib/prelude_sdk/models/notify_send_params.rb +32 -1
  15. data/lib/prelude_sdk/models/notify_send_response.rb +36 -1
  16. data/lib/prelude_sdk/models/transactional_send_params.rb +32 -1
  17. data/lib/prelude_sdk/models/verification_create_params.rb +35 -48
  18. data/lib/prelude_sdk/models/verification_create_response.rb +15 -0
  19. data/lib/prelude_sdk/models/verification_management_delete_phone_number_params.rb +8 -1
  20. data/lib/prelude_sdk/models/verification_management_list_phone_numbers_params.rb +7 -1
  21. data/lib/prelude_sdk/models/verification_management_set_phone_number_params.rb +8 -1
  22. data/lib/prelude_sdk/models/watch_predict_params.rb +16 -12
  23. data/lib/prelude_sdk/models/watch_predict_response.rb +51 -1
  24. data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +1 -128
  25. data/lib/prelude_sdk/resources/lookup.rb +4 -1
  26. data/lib/prelude_sdk/resources/notify.rb +13 -5
  27. data/lib/prelude_sdk/resources/transactional.rb +4 -1
  28. data/lib/prelude_sdk/resources/verification.rb +1 -0
  29. data/lib/prelude_sdk/resources/verification_management.rb +1 -0
  30. data/lib/prelude_sdk/resources/watch.rb +1 -0
  31. data/lib/prelude_sdk/version.rb +1 -1
  32. data/rbi/prelude_sdk/client.rbi +7 -0
  33. data/rbi/prelude_sdk/internal/util.rbi +21 -1
  34. data/rbi/prelude_sdk/models/lookup_lookup_params.rbi +8 -0
  35. data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +13 -5
  36. data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_params.rbi +10 -2
  37. data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbi +6 -0
  38. data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbi +6 -0
  39. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +50 -0
  40. data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +80 -0
  41. data/rbi/prelude_sdk/models/notify_send_params.rbi +48 -0
  42. data/rbi/prelude_sdk/models/notify_send_response.rbi +75 -0
  43. data/rbi/prelude_sdk/models/transactional_send_params.rbi +50 -0
  44. data/rbi/prelude_sdk/models/verification_create_params.rbi +53 -93
  45. data/rbi/prelude_sdk/models/verification_create_response.rbi +26 -0
  46. data/rbi/prelude_sdk/models/verification_management_delete_phone_number_params.rbi +16 -1
  47. data/rbi/prelude_sdk/models/verification_management_list_phone_numbers_params.rbi +21 -4
  48. data/rbi/prelude_sdk/models/verification_management_set_phone_number_params.rbi +16 -1
  49. data/rbi/prelude_sdk/models/watch_predict_params.rbi +24 -16
  50. data/rbi/prelude_sdk/models/watch_predict_response.rbi +152 -3
  51. data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +3 -243
  52. data/rbi/prelude_sdk/resources/lookup.rbi +2 -0
  53. data/rbi/prelude_sdk/resources/notify.rbi +9 -0
  54. data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
  55. data/rbi/prelude_sdk/resources/verification.rbi +1 -0
  56. data/rbi/prelude_sdk/resources/verification_management.rbi +1 -0
  57. data/rbi/prelude_sdk/resources/watch.rbi +1 -0
  58. data/sig/prelude_sdk/internal/util.rbs +10 -0
  59. data/sig/prelude_sdk/models/lookup_lookup_params.rbs +8 -1
  60. data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +11 -3
  61. data/sig/prelude_sdk/models/notify_get_subscription_phone_number_params.rbs +6 -1
  62. data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbs +10 -1
  63. data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbs +5 -0
  64. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +21 -0
  65. data/sig/prelude_sdk/models/notify_send_batch_response.rbs +27 -0
  66. data/sig/prelude_sdk/models/notify_send_params.rbs +21 -0
  67. data/sig/prelude_sdk/models/notify_send_response.rbs +27 -0
  68. data/sig/prelude_sdk/models/transactional_send_params.rbs +21 -0
  69. data/sig/prelude_sdk/models/verification_create_params.rbs +2 -21
  70. data/sig/prelude_sdk/models/verification_create_response.rbs +2 -1
  71. data/sig/prelude_sdk/models/verification_management_delete_phone_number_params.rbs +9 -1
  72. data/sig/prelude_sdk/models/verification_management_list_phone_numbers_params.rbs +14 -3
  73. data/sig/prelude_sdk/models/verification_management_set_phone_number_params.rbs +9 -1
  74. data/sig/prelude_sdk/models/watch_predict_response.rbs +41 -3
  75. data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +3 -110
  76. data/sig/prelude_sdk/resources/notify.rbs +2 -0
  77. data/sig/prelude_sdk/resources/transactional.rbs +1 -0
  78. metadata +16 -2
@@ -206,8 +206,9 @@ module PreludeSDK
206
206
  sig { params(app_version: String).void }
207
207
  attr_writer :app_version
208
208
 
209
- # The unique identifier for the user's device. For Android, this corresponds to
210
- # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
209
+ # A unique ID for the user's device. You should ensure that each user device has a
210
+ # unique `device_id` value. Ideally, for Android, this corresponds to the
211
+ # `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
211
212
  sig { returns(T.nilable(String)) }
212
213
  attr_reader :device_id
213
214
 
@@ -239,15 +240,18 @@ module PreludeSDK
239
240
  end
240
241
  attr_writer :device_platform
241
242
 
242
- # The IP address of the user's device.
243
+ # The public IP v4 or v6 address of the end-user's device. You should collect this
244
+ # from your backend. If your backend is behind a proxy, use the `X-Forwarded-For`,
245
+ # `Forwarded`, `True-Client-IP`, `CF-Connecting-IP` or an equivalent header to get
246
+ # the actual public IP of the end-user's device.
243
247
  sig { returns(T.nilable(String)) }
244
248
  attr_reader :ip
245
249
 
246
250
  sig { params(ip: String).void }
247
251
  attr_writer :ip
248
252
 
249
- # This signal should provide a higher level of trust, indicating that the user is
250
- # genuine. Contact us to discuss your use case. For more details, refer to
253
+ # This signal should indicate a higher level of trust, explicitly stating that the
254
+ # user is genuine. Contact us to discuss your use case. For more details, refer to
251
255
  # [Signals](/verify/v2/documentation/prevent-fraud#signals).
252
256
  sig { returns(T.nilable(T::Boolean)) }
253
257
  attr_reader :is_trusted_user
@@ -255,9 +259,9 @@ module PreludeSDK
255
259
  sig { params(is_trusted_user: T::Boolean).void }
256
260
  attr_writer :is_trusted_user
257
261
 
258
- # The JA4 fingerprint observed for the connection. Prelude will infer it
259
- # automatically when requests go through our client SDK (which uses Prelude's
260
- # edge), but you can also provide it explicitly if you terminate TLS yourself.
262
+ # The JA4 fingerprint observed for the end-user's connection. Prelude will infer
263
+ # it automatically when you use our Frontend SDKs (which use Prelude's edge
264
+ # network), but you can also forward the value if you terminate TLS yourself.
261
265
  sig { returns(T.nilable(String)) }
262
266
  attr_reader :ja4_fingerprint
263
267
 
@@ -299,22 +303,26 @@ module PreludeSDK
299
303
  def self.new(
300
304
  # The version of your application.
301
305
  app_version: nil,
302
- # The unique identifier for the user's device. For Android, this corresponds to
303
- # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
306
+ # A unique ID for the user's device. You should ensure that each user device has a
307
+ # unique `device_id` value. Ideally, for Android, this corresponds to the
308
+ # `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
304
309
  device_id: nil,
305
310
  # The model of the user's device.
306
311
  device_model: nil,
307
312
  # The type of the user's device.
308
313
  device_platform: nil,
309
- # The IP address of the user's device.
314
+ # The public IP v4 or v6 address of the end-user's device. You should collect this
315
+ # from your backend. If your backend is behind a proxy, use the `X-Forwarded-For`,
316
+ # `Forwarded`, `True-Client-IP`, `CF-Connecting-IP` or an equivalent header to get
317
+ # the actual public IP of the end-user's device.
310
318
  ip: nil,
311
- # This signal should provide a higher level of trust, indicating that the user is
312
- # genuine. Contact us to discuss your use case. For more details, refer to
319
+ # This signal should indicate a higher level of trust, explicitly stating that the
320
+ # user is genuine. Contact us to discuss your use case. For more details, refer to
313
321
  # [Signals](/verify/v2/documentation/prevent-fraud#signals).
314
322
  is_trusted_user: nil,
315
- # The JA4 fingerprint observed for the connection. Prelude will infer it
316
- # automatically when requests go through our client SDK (which uses Prelude's
317
- # edge), but you can also provide it explicitly if you terminate TLS yourself.
323
+ # The JA4 fingerprint observed for the end-user's connection. Prelude will infer
324
+ # it automatically when you use our Frontend SDKs (which use Prelude's edge
325
+ # network), but you can also forward the value if you terminate TLS yourself.
318
326
  ja4_fingerprint: nil,
319
327
  # The version of the user's device operating system.
320
328
  os_version: nil,
@@ -28,12 +28,61 @@ module PreludeSDK
28
28
  sig { returns(String) }
29
29
  attr_accessor :request_id
30
30
 
31
+ # The risk factors that contributed to the suspicious prediction. Only present
32
+ # when prediction is "suspicious" and the anti-fraud system detected specific risk
33
+ # signals.
34
+ #
35
+ # - `behavioral_pattern` - The phone number past behavior during verification
36
+ # flows exhibits suspicious patterns.
37
+ # - `device_attribute` - The device exhibits characteristics associated with
38
+ # suspicious activity patterns.
39
+ # - `fraud_database` - The phone number has been flagged as suspicious in one or
40
+ # more of our fraud databases.
41
+ # - `location_discrepancy` - The phone number prefix and IP address discrepancy
42
+ # indicates potential fraud.
43
+ # - `network_fingerprint` - The network connection exhibits characteristics
44
+ # associated with suspicious activity patterns.
45
+ # - `poor_conversion_history` - The phone number has a history of poorly
46
+ # converting to a verified phone number.
47
+ # - `prefix_concentration` - The phone number is part of a range known to be
48
+ # associated with suspicious activity patterns.
49
+ # - `suspected_request_tampering` - The SDK signature is invalid and the request
50
+ # is considered to be tampered with.
51
+ # - `suspicious_ip_address` - The IP address is deemed to be associated with
52
+ # suspicious activity patterns.
53
+ # - `temporary_phone_number` - The phone number is known to be a temporary or
54
+ # disposable number.
55
+ sig do
56
+ returns(
57
+ T.nilable(
58
+ T::Array[
59
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
60
+ ]
61
+ )
62
+ )
63
+ end
64
+ attr_reader :risk_factors
65
+
66
+ sig do
67
+ params(
68
+ risk_factors:
69
+ T::Array[
70
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::OrSymbol
71
+ ]
72
+ ).void
73
+ end
74
+ attr_writer :risk_factors
75
+
31
76
  sig do
32
77
  params(
33
78
  id: String,
34
79
  prediction:
35
80
  PreludeSDK::Models::WatchPredictResponse::Prediction::OrSymbol,
36
- request_id: String
81
+ request_id: String,
82
+ risk_factors:
83
+ T::Array[
84
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::OrSymbol
85
+ ]
37
86
  ).returns(T.attached_class)
38
87
  end
39
88
  def self.new(
@@ -43,7 +92,32 @@ module PreludeSDK
43
92
  prediction:,
44
93
  # A string that identifies this specific request. Report it back to us to help us
45
94
  # diagnose your issues.
46
- request_id:
95
+ request_id:,
96
+ # The risk factors that contributed to the suspicious prediction. Only present
97
+ # when prediction is "suspicious" and the anti-fraud system detected specific risk
98
+ # signals.
99
+ #
100
+ # - `behavioral_pattern` - The phone number past behavior during verification
101
+ # flows exhibits suspicious patterns.
102
+ # - `device_attribute` - The device exhibits characteristics associated with
103
+ # suspicious activity patterns.
104
+ # - `fraud_database` - The phone number has been flagged as suspicious in one or
105
+ # more of our fraud databases.
106
+ # - `location_discrepancy` - The phone number prefix and IP address discrepancy
107
+ # indicates potential fraud.
108
+ # - `network_fingerprint` - The network connection exhibits characteristics
109
+ # associated with suspicious activity patterns.
110
+ # - `poor_conversion_history` - The phone number has a history of poorly
111
+ # converting to a verified phone number.
112
+ # - `prefix_concentration` - The phone number is part of a range known to be
113
+ # associated with suspicious activity patterns.
114
+ # - `suspected_request_tampering` - The SDK signature is invalid and the request
115
+ # is considered to be tampered with.
116
+ # - `suspicious_ip_address` - The IP address is deemed to be associated with
117
+ # suspicious activity patterns.
118
+ # - `temporary_phone_number` - The phone number is known to be a temporary or
119
+ # disposable number.
120
+ risk_factors: nil
47
121
  )
48
122
  end
49
123
 
@@ -53,7 +127,11 @@ module PreludeSDK
53
127
  id: String,
54
128
  prediction:
55
129
  PreludeSDK::Models::WatchPredictResponse::Prediction::TaggedSymbol,
56
- request_id: String
130
+ request_id: String,
131
+ risk_factors:
132
+ T::Array[
133
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
134
+ ]
57
135
  }
58
136
  )
59
137
  end
@@ -91,6 +169,77 @@ module PreludeSDK
91
169
  def self.values
92
170
  end
93
171
  end
172
+
173
+ module RiskFactor
174
+ extend PreludeSDK::Internal::Type::Enum
175
+
176
+ TaggedSymbol =
177
+ T.type_alias do
178
+ T.all(Symbol, PreludeSDK::Models::WatchPredictResponse::RiskFactor)
179
+ end
180
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
181
+
182
+ BEHAVIORAL_PATTERN =
183
+ T.let(
184
+ :behavioral_pattern,
185
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
186
+ )
187
+ DEVICE_ATTRIBUTE =
188
+ T.let(
189
+ :device_attribute,
190
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
191
+ )
192
+ FRAUD_DATABASE =
193
+ T.let(
194
+ :fraud_database,
195
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
196
+ )
197
+ LOCATION_DISCREPANCY =
198
+ T.let(
199
+ :location_discrepancy,
200
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
201
+ )
202
+ NETWORK_FINGERPRINT =
203
+ T.let(
204
+ :network_fingerprint,
205
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
206
+ )
207
+ POOR_CONVERSION_HISTORY =
208
+ T.let(
209
+ :poor_conversion_history,
210
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
211
+ )
212
+ PREFIX_CONCENTRATION =
213
+ T.let(
214
+ :prefix_concentration,
215
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
216
+ )
217
+ SUSPECTED_REQUEST_TAMPERING =
218
+ T.let(
219
+ :suspected_request_tampering,
220
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
221
+ )
222
+ SUSPICIOUS_IP_ADDRESS =
223
+ T.let(
224
+ :suspicious_ip_address,
225
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
226
+ )
227
+ TEMPORARY_PHONE_NUMBER =
228
+ T.let(
229
+ :temporary_phone_number,
230
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
231
+ )
232
+
233
+ sig do
234
+ override.returns(
235
+ T::Array[
236
+ PreludeSDK::Models::WatchPredictResponse::RiskFactor::TaggedSymbol
237
+ ]
238
+ )
239
+ end
240
+ def self.values
241
+ end
242
+ end
94
243
  end
95
244
  end
96
245
  end
@@ -72,13 +72,6 @@ module PreludeSDK
72
72
  end
73
73
  attr_accessor :type
74
74
 
75
- # The identifier of the dispatch that came from the front-end SDK.
76
- sig { returns(T.nilable(String)) }
77
- attr_reader :dispatch_id
78
-
79
- sig { params(dispatch_id: String).void }
80
- attr_writer :dispatch_id
81
-
82
75
  # The metadata for this feedback.
83
76
  sig do
84
77
  returns(
@@ -95,34 +88,14 @@ module PreludeSDK
95
88
  end
96
89
  attr_writer :metadata
97
90
 
98
- # The signals used for anti-fraud. For more details, refer to
99
- # [Signals](/verify/v2/documentation/prevent-fraud#signals).
100
- sig do
101
- returns(
102
- T.nilable(PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals)
103
- )
104
- end
105
- attr_reader :signals
106
-
107
- sig do
108
- params(
109
- signals:
110
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::OrHash
111
- ).void
112
- end
113
- attr_writer :signals
114
-
115
91
  sig do
116
92
  params(
117
93
  target:
118
94
  PreludeSDK::WatchSendFeedbacksParams::Feedback::Target::OrHash,
119
95
  type:
120
96
  PreludeSDK::WatchSendFeedbacksParams::Feedback::Type::OrSymbol,
121
- dispatch_id: String,
122
97
  metadata:
123
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Metadata::OrHash,
124
- signals:
125
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::OrHash
98
+ PreludeSDK::WatchSendFeedbacksParams::Feedback::Metadata::OrHash
126
99
  ).returns(T.attached_class)
127
100
  end
128
101
  def self.new(
@@ -130,13 +103,8 @@ module PreludeSDK
130
103
  target:,
131
104
  # The type of feedback.
132
105
  type:,
133
- # The identifier of the dispatch that came from the front-end SDK.
134
- dispatch_id: nil,
135
106
  # The metadata for this feedback.
136
- metadata: nil,
137
- # The signals used for anti-fraud. For more details, refer to
138
- # [Signals](/verify/v2/documentation/prevent-fraud#signals).
139
- signals: nil
107
+ metadata: nil
140
108
  )
141
109
  end
142
110
 
@@ -146,10 +114,7 @@ module PreludeSDK
146
114
  target: PreludeSDK::WatchSendFeedbacksParams::Feedback::Target,
147
115
  type:
148
116
  PreludeSDK::WatchSendFeedbacksParams::Feedback::Type::OrSymbol,
149
- dispatch_id: String,
150
- metadata:
151
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Metadata,
152
- signals: PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals
117
+ metadata: PreludeSDK::WatchSendFeedbacksParams::Feedback::Metadata
153
118
  }
154
119
  )
155
120
  end
@@ -306,211 +271,6 @@ module PreludeSDK
306
271
  def to_hash
307
272
  end
308
273
  end
309
-
310
- class Signals < PreludeSDK::Internal::Type::BaseModel
311
- OrHash =
312
- T.type_alias do
313
- T.any(
314
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals,
315
- PreludeSDK::Internal::AnyHash
316
- )
317
- end
318
-
319
- # The version of your application.
320
- sig { returns(T.nilable(String)) }
321
- attr_reader :app_version
322
-
323
- sig { params(app_version: String).void }
324
- attr_writer :app_version
325
-
326
- # The unique identifier for the user's device. For Android, this corresponds to
327
- # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
328
- sig { returns(T.nilable(String)) }
329
- attr_reader :device_id
330
-
331
- sig { params(device_id: String).void }
332
- attr_writer :device_id
333
-
334
- # The model of the user's device.
335
- sig { returns(T.nilable(String)) }
336
- attr_reader :device_model
337
-
338
- sig { params(device_model: String).void }
339
- attr_writer :device_model
340
-
341
- # The type of the user's device.
342
- sig do
343
- returns(
344
- T.nilable(
345
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::OrSymbol
346
- )
347
- )
348
- end
349
- attr_reader :device_platform
350
-
351
- sig do
352
- params(
353
- device_platform:
354
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::OrSymbol
355
- ).void
356
- end
357
- attr_writer :device_platform
358
-
359
- # The IP address of the user's device.
360
- sig { returns(T.nilable(String)) }
361
- attr_reader :ip
362
-
363
- sig { params(ip: String).void }
364
- attr_writer :ip
365
-
366
- # This signal should provide a higher level of trust, indicating that the user is
367
- # genuine. Contact us to discuss your use case. For more details, refer to
368
- # [Signals](/verify/v2/documentation/prevent-fraud#signals).
369
- sig { returns(T.nilable(T::Boolean)) }
370
- attr_reader :is_trusted_user
371
-
372
- sig { params(is_trusted_user: T::Boolean).void }
373
- attr_writer :is_trusted_user
374
-
375
- # The JA4 fingerprint observed for the connection. Prelude will infer it
376
- # automatically when requests go through our client SDK (which uses Prelude's
377
- # edge), but you can also provide it explicitly if you terminate TLS yourself.
378
- sig { returns(T.nilable(String)) }
379
- attr_reader :ja4_fingerprint
380
-
381
- sig { params(ja4_fingerprint: String).void }
382
- attr_writer :ja4_fingerprint
383
-
384
- # The version of the user's device operating system.
385
- sig { returns(T.nilable(String)) }
386
- attr_reader :os_version
387
-
388
- sig { params(os_version: String).void }
389
- attr_writer :os_version
390
-
391
- # The user agent of the user's device. If the individual fields (os_version,
392
- # device_platform, device_model) are provided, we will prioritize those values
393
- # instead of parsing them from the user agent string.
394
- sig { returns(T.nilable(String)) }
395
- attr_reader :user_agent
396
-
397
- sig { params(user_agent: String).void }
398
- attr_writer :user_agent
399
-
400
- # The signals used for anti-fraud. For more details, refer to
401
- # [Signals](/verify/v2/documentation/prevent-fraud#signals).
402
- sig do
403
- params(
404
- app_version: String,
405
- device_id: String,
406
- device_model: String,
407
- device_platform:
408
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::OrSymbol,
409
- ip: String,
410
- is_trusted_user: T::Boolean,
411
- ja4_fingerprint: String,
412
- os_version: String,
413
- user_agent: String
414
- ).returns(T.attached_class)
415
- end
416
- def self.new(
417
- # The version of your application.
418
- app_version: nil,
419
- # The unique identifier for the user's device. For Android, this corresponds to
420
- # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
421
- device_id: nil,
422
- # The model of the user's device.
423
- device_model: nil,
424
- # The type of the user's device.
425
- device_platform: nil,
426
- # The IP address of the user's device.
427
- ip: nil,
428
- # This signal should provide a higher level of trust, indicating that the user is
429
- # genuine. Contact us to discuss your use case. For more details, refer to
430
- # [Signals](/verify/v2/documentation/prevent-fraud#signals).
431
- is_trusted_user: nil,
432
- # The JA4 fingerprint observed for the connection. Prelude will infer it
433
- # automatically when requests go through our client SDK (which uses Prelude's
434
- # edge), but you can also provide it explicitly if you terminate TLS yourself.
435
- ja4_fingerprint: nil,
436
- # The version of the user's device operating system.
437
- os_version: nil,
438
- # The user agent of the user's device. If the individual fields (os_version,
439
- # device_platform, device_model) are provided, we will prioritize those values
440
- # instead of parsing them from the user agent string.
441
- user_agent: nil
442
- )
443
- end
444
-
445
- sig do
446
- override.returns(
447
- {
448
- app_version: String,
449
- device_id: String,
450
- device_model: String,
451
- device_platform:
452
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::OrSymbol,
453
- ip: String,
454
- is_trusted_user: T::Boolean,
455
- ja4_fingerprint: String,
456
- os_version: String,
457
- user_agent: String
458
- }
459
- )
460
- end
461
- def to_hash
462
- end
463
-
464
- # The type of the user's device.
465
- module DevicePlatform
466
- extend PreludeSDK::Internal::Type::Enum
467
-
468
- TaggedSymbol =
469
- T.type_alias do
470
- T.all(
471
- Symbol,
472
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform
473
- )
474
- end
475
- OrSymbol = T.type_alias { T.any(Symbol, String) }
476
-
477
- ANDROID =
478
- T.let(
479
- :android,
480
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::TaggedSymbol
481
- )
482
- IOS =
483
- T.let(
484
- :ios,
485
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::TaggedSymbol
486
- )
487
- IPADOS =
488
- T.let(
489
- :ipados,
490
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::TaggedSymbol
491
- )
492
- TVOS =
493
- T.let(
494
- :tvos,
495
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::TaggedSymbol
496
- )
497
- WEB =
498
- T.let(
499
- :web,
500
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::TaggedSymbol
501
- )
502
-
503
- sig do
504
- override.returns(
505
- T::Array[
506
- PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform::TaggedSymbol
507
- ]
508
- )
509
- end
510
- def self.values
511
- end
512
- end
513
- end
514
274
  end
515
275
  end
516
276
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module PreludeSDK
4
4
  module Resources
5
+ # Retrieve detailed information about a phone number including carrier data, line
6
+ # type, and portability status.
5
7
  class Lookup
6
8
  # Retrieve detailed information about a phone number including carrier data, line
7
9
  # type, and portability status.
@@ -2,6 +2,7 @@
2
2
 
3
3
  module PreludeSDK
4
4
  module Resources
5
+ # Send transactional and marketing messages with compliance enforcement.
5
6
  class Notify
6
7
  # Retrieve a specific subscription management configuration by its ID.
7
8
  sig do
@@ -121,6 +122,7 @@ module PreludeSDK
121
122
  to: String,
122
123
  callback_url: String,
123
124
  correlation_id: String,
125
+ document: PreludeSDK::NotifySendParams::Document::OrHash,
124
126
  expires_at: Time,
125
127
  from: String,
126
128
  locale: String,
@@ -142,6 +144,9 @@ module PreludeSDK
142
144
  # It is returned in the response and any webhook events that refer to this
143
145
  # message.
144
146
  correlation_id: nil,
147
+ # A document to attach to the message. Only supported on WhatsApp templates that
148
+ # have a document header.
149
+ document: nil,
145
150
  # The message expiration date in RFC3339 format. The message will not be sent if
146
151
  # this time is reached.
147
152
  expires_at: nil,
@@ -172,6 +177,7 @@ module PreludeSDK
172
177
  to: T::Array[String],
173
178
  callback_url: String,
174
179
  correlation_id: String,
180
+ document: PreludeSDK::NotifySendBatchParams::Document::OrHash,
175
181
  expires_at: Time,
176
182
  from: String,
177
183
  locale: String,
@@ -191,6 +197,9 @@ module PreludeSDK
191
197
  callback_url: nil,
192
198
  # A user-defined identifier to correlate this request with your internal systems.
193
199
  correlation_id: nil,
200
+ # A document to attach to the message. Only supported on WhatsApp templates that
201
+ # have a document header.
202
+ document: nil,
194
203
  # The message expiration date in RFC3339 format. Messages will not be sent after
195
204
  # this time.
196
205
  expires_at: nil,
@@ -2,6 +2,7 @@
2
2
 
3
3
  module PreludeSDK
4
4
  module Resources
5
+ # Send transactional messages (deprecated - use Notify API instead).
5
6
  class Transactional
6
7
  # Legacy route maintained for backward compatibility. Migrate to `/v2/notify`
7
8
  # instead.
@@ -11,6 +12,7 @@ module PreludeSDK
11
12
  to: String,
12
13
  callback_url: String,
13
14
  correlation_id: String,
15
+ document: PreludeSDK::TransactionalSendParams::Document::OrHash,
14
16
  expires_at: String,
15
17
  from: String,
16
18
  locale: String,
@@ -31,6 +33,9 @@ module PreludeSDK
31
33
  # returned in the response and any webhook events that refer to this
32
34
  # transactionalmessage.
33
35
  correlation_id: nil,
36
+ # A document to attach to the message. Only supported on WhatsApp templates that
37
+ # have a document header.
38
+ document: nil,
34
39
  # The message expiration date.
35
40
  expires_at: nil,
36
41
  # The Sender ID.
@@ -2,6 +2,7 @@
2
2
 
3
3
  module PreludeSDK
4
4
  module Resources
5
+ # Verify phone numbers.
5
6
  class Verification
6
7
  # Create a new verification for a specific phone number. If another non-expired
7
8
  # verification exists (the request is performed within the verification window),
@@ -2,6 +2,7 @@
2
2
 
3
3
  module PreludeSDK
4
4
  module Resources
5
+ # Verify phone numbers.
5
6
  class VerificationManagement
6
7
  # Remove a phone number from the allow or block list.
7
8
  #
@@ -2,6 +2,7 @@
2
2
 
3
3
  module PreludeSDK
4
4
  module Resources
5
+ # Evaluate email addresses and phone numbers for trustworthiness.
5
6
  class Watch
6
7
  # Predict the outcome of a verification based on Prelude’s anti-fraud system.
7
8
  sig do
@@ -106,6 +106,16 @@ module PreludeSDK
106
106
  JSON_CONTENT: Regexp
107
107
  JSONL_CONTENT: Regexp
108
108
 
109
+ def encode_query_params: (
110
+ ::Hash[Symbol, top] query
111
+ ) -> ::Hash[Symbol, top]
112
+
113
+ private def write_query_param_element!: (
114
+ ::Hash[Symbol, top] collection,
115
+ String key,
116
+ top element
117
+ ) -> nil
118
+
109
119
  def self?.write_multipart_content: (
110
120
  Enumerator::Yielder y,
111
121
  val: top,