prelude-sdk 0.5.0 → 0.6.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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +1 -1
  4. data/lib/prelude_sdk/internal/transport/base_client.rb +5 -0
  5. data/lib/prelude_sdk/models/notify_send_batch_params.rb +13 -1
  6. data/lib/prelude_sdk/models/notify_send_params.rb +13 -1
  7. data/lib/prelude_sdk/models/transactional_send_params.rb +11 -1
  8. data/lib/prelude_sdk/models/verification_check_params.rb +44 -1
  9. data/lib/prelude_sdk/models/verification_check_response.rb +12 -3
  10. data/lib/prelude_sdk/models/verification_create_params.rb +82 -4
  11. data/lib/prelude_sdk/models/watch_predict_params.rb +3 -3
  12. data/lib/prelude_sdk/models/watch_send_events_params.rb +22 -3
  13. data/lib/prelude_sdk/resources/notify.rb +6 -2
  14. data/lib/prelude_sdk/resources/transactional.rb +3 -1
  15. data/lib/prelude_sdk/resources/verification.rb +3 -1
  16. data/lib/prelude_sdk/resources/watch.rb +19 -6
  17. data/lib/prelude_sdk/version.rb +1 -1
  18. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +19 -0
  19. data/rbi/prelude_sdk/models/notify_send_params.rbi +19 -0
  20. data/rbi/prelude_sdk/models/transactional_send_params.rbi +15 -0
  21. data/rbi/prelude_sdk/models/verification_check_params.rbi +68 -0
  22. data/rbi/prelude_sdk/models/verification_check_response.rbi +19 -3
  23. data/rbi/prelude_sdk/models/verification_create_params.rbi +184 -3
  24. data/rbi/prelude_sdk/models/watch_predict_params.rbi +3 -3
  25. data/rbi/prelude_sdk/models/watch_send_events_params.rbi +27 -3
  26. data/rbi/prelude_sdk/resources/notify.rbi +14 -0
  27. data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
  28. data/rbi/prelude_sdk/resources/verification.rbi +6 -0
  29. data/rbi/prelude_sdk/resources/watch.rbi +19 -6
  30. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +7 -0
  31. data/sig/prelude_sdk/models/notify_send_params.rbs +7 -0
  32. data/sig/prelude_sdk/models/transactional_send_params.rbs +7 -0
  33. data/sig/prelude_sdk/models/verification_check_params.rbs +31 -1
  34. data/sig/prelude_sdk/models/verification_check_response.rbs +8 -1
  35. data/sig/prelude_sdk/models/verification_create_params.rbs +38 -0
  36. data/sig/prelude_sdk/resources/notify.rbs +2 -0
  37. data/sig/prelude_sdk/resources/transactional.rbs +1 -0
  38. data/sig/prelude_sdk/resources/verification.rbs +1 -0
  39. metadata +2 -2
@@ -78,6 +78,17 @@ module PreludeSDK
78
78
  sig { params(locale: String).void }
79
79
  attr_writer :locale
80
80
 
81
+ # Maximum number of automatic retry attempts across channels for each send in the
82
+ # batch, in addition to the first attempt. For example, `2` allows up to 3 total
83
+ # delivery attempts per recipient. Lower values reduce delivery cost on
84
+ # hard-to-reach numbers at the expense of deliverability. When omitted, your
85
+ # account's configured default applies.
86
+ sig { returns(T.nilable(Integer)) }
87
+ attr_reader :max_auto_retries
88
+
89
+ sig { params(max_auto_retries: Integer).void }
90
+ attr_writer :max_auto_retries
91
+
81
92
  # Preferred channel for delivery. If unavailable, automatic fallback applies.
82
93
  sig do
83
94
  returns(
@@ -121,6 +132,7 @@ module PreludeSDK
121
132
  expires_at: Time,
122
133
  from: String,
123
134
  locale: String,
135
+ max_auto_retries: Integer,
124
136
  preferred_channel:
125
137
  PreludeSDK::NotifySendBatchParams::PreferredChannel::OrSymbol,
126
138
  schedule_at: Time,
@@ -155,6 +167,12 @@ module PreludeSDK
155
167
  from: nil,
156
168
  # A BCP-47 formatted locale string.
157
169
  locale: nil,
170
+ # Maximum number of automatic retry attempts across channels for each send in the
171
+ # batch, in addition to the first attempt. For example, `2` allows up to 3 total
172
+ # delivery attempts per recipient. Lower values reduce delivery cost on
173
+ # hard-to-reach numbers at the expense of deliverability. When omitted, your
174
+ # account's configured default applies.
175
+ max_auto_retries: nil,
158
176
  # Preferred channel for delivery. If unavailable, automatic fallback applies.
159
177
  preferred_channel: nil,
160
178
  # Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply
@@ -177,6 +195,7 @@ module PreludeSDK
177
195
  expires_at: Time,
178
196
  from: String,
179
197
  locale: String,
198
+ max_auto_retries: Integer,
180
199
  preferred_channel:
181
200
  PreludeSDK::NotifySendBatchParams::PreferredChannel::OrSymbol,
182
201
  schedule_at: Time,
@@ -78,6 +78,17 @@ module PreludeSDK
78
78
  sig { params(locale: String).void }
79
79
  attr_writer :locale
80
80
 
81
+ # Maximum number of automatic retry attempts across channels for this send, in
82
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
83
+ # attempts. Lower values reduce delivery cost on hard-to-reach numbers at the
84
+ # expense of deliverability. When omitted, your account's configured default
85
+ # applies.
86
+ sig { returns(T.nilable(Integer)) }
87
+ attr_reader :max_auto_retries
88
+
89
+ sig { params(max_auto_retries: Integer).void }
90
+ attr_writer :max_auto_retries
91
+
81
92
  # The preferred channel to be used in priority for message delivery. If the
82
93
  # channel is unavailable, the system will fallback to other available channels.
83
94
  sig do
@@ -121,6 +132,7 @@ module PreludeSDK
121
132
  expires_at: Time,
122
133
  from: String,
123
134
  locale: String,
135
+ max_auto_retries: Integer,
124
136
  preferred_channel:
125
137
  PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
126
138
  schedule_at: Time,
@@ -160,6 +172,12 @@ module PreludeSDK
160
172
  # code of the phone number. If the language specified doesn't exist, the default
161
173
  # set on the template will be used.
162
174
  locale: nil,
175
+ # Maximum number of automatic retry attempts across channels for this send, in
176
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
177
+ # attempts. Lower values reduce delivery cost on hard-to-reach numbers at the
178
+ # expense of deliverability. When omitted, your account's configured default
179
+ # applies.
180
+ max_auto_retries: nil,
163
181
  # The preferred channel to be used in priority for message delivery. If the
164
182
  # channel is unavailable, the system will fallback to other available channels.
165
183
  preferred_channel: nil,
@@ -184,6 +202,7 @@ module PreludeSDK
184
202
  expires_at: Time,
185
203
  from: String,
186
204
  locale: String,
205
+ max_auto_retries: Integer,
187
206
  preferred_channel:
188
207
  PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
189
208
  schedule_at: Time,
@@ -82,6 +82,15 @@ module PreludeSDK
82
82
  sig { params(locale: String).void }
83
83
  attr_writer :locale
84
84
 
85
+ # Maximum number of automatic retry attempts across channels for this send, in
86
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
87
+ # attempts. When omitted, your account's configured default applies.
88
+ sig { returns(T.nilable(Integer)) }
89
+ attr_reader :max_auto_retries
90
+
91
+ sig { params(max_auto_retries: Integer).void }
92
+ attr_writer :max_auto_retries
93
+
85
94
  # The preferred delivery channel for the message. When specified, the system will
86
95
  # prioritize sending via the requested channel if the template is configured for
87
96
  # it.
@@ -125,6 +134,7 @@ module PreludeSDK
125
134
  expires_at: String,
126
135
  from: String,
127
136
  locale: String,
137
+ max_auto_retries: Integer,
128
138
  preferred_channel:
129
139
  PreludeSDK::TransactionalSendParams::PreferredChannel::OrSymbol,
130
140
  variables: T::Hash[Symbol, String],
@@ -162,6 +172,10 @@ module PreludeSDK
162
172
  # code of the phone number. If the language specified doesn't exist, the default
163
173
  # set on the template will be used.
164
174
  locale: nil,
175
+ # Maximum number of automatic retry attempts across channels for this send, in
176
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
177
+ # attempts. When omitted, your account's configured default applies.
178
+ max_auto_retries: nil,
165
179
  # The preferred delivery channel for the message. When specified, the system will
166
180
  # prioritize sending via the requested channel if the template is configured for
167
181
  # it.
@@ -189,6 +203,7 @@ module PreludeSDK
189
203
  expires_at: String,
190
204
  from: String,
191
205
  locale: String,
206
+ max_auto_retries: Integer,
192
207
  preferred_channel:
193
208
  PreludeSDK::TransactionalSendParams::PreferredChannel::OrSymbol,
194
209
  variables: T::Hash[Symbol, String],
@@ -28,10 +28,23 @@ module PreludeSDK
28
28
  end
29
29
  attr_writer :target
30
30
 
31
+ # Required when checking a code issued under the `prelude:psd2` template. The
32
+ # submitted variables must match those provided at issuance; any mismatch
33
+ # invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
34
+ # non-PSD2 verifications.
35
+ sig { returns(T.nilable(PreludeSDK::VerificationCheckParams::Psd2)) }
36
+ attr_reader :psd2
37
+
38
+ sig do
39
+ params(psd2: PreludeSDK::VerificationCheckParams::Psd2::OrHash).void
40
+ end
41
+ attr_writer :psd2
42
+
31
43
  sig do
32
44
  params(
33
45
  code: String,
34
46
  target: PreludeSDK::VerificationCheckParams::Target::OrHash,
47
+ psd2: PreludeSDK::VerificationCheckParams::Psd2::OrHash,
35
48
  request_options: PreludeSDK::RequestOptions::OrHash
36
49
  ).returns(T.attached_class)
37
50
  end
@@ -41,6 +54,11 @@ module PreludeSDK
41
54
  # The verification target. Either a phone number or an email address. To use the
42
55
  # email verification feature contact us to discuss your use case.
43
56
  target:,
57
+ # Required when checking a code issued under the `prelude:psd2` template. The
58
+ # submitted variables must match those provided at issuance; any mismatch
59
+ # invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
60
+ # non-PSD2 verifications.
61
+ psd2: nil,
44
62
  request_options: {}
45
63
  )
46
64
  end
@@ -50,6 +68,7 @@ module PreludeSDK
50
68
  {
51
69
  code: String,
52
70
  target: PreludeSDK::VerificationCheckParams::Target,
71
+ psd2: PreludeSDK::VerificationCheckParams::Psd2,
53
72
  request_options: PreludeSDK::RequestOptions
54
73
  }
55
74
  )
@@ -135,6 +154,55 @@ module PreludeSDK
135
154
  end
136
155
  end
137
156
  end
157
+
158
+ class Psd2 < PreludeSDK::Internal::Type::BaseModel
159
+ OrHash =
160
+ T.type_alias do
161
+ T.any(
162
+ PreludeSDK::VerificationCheckParams::Psd2,
163
+ PreludeSDK::Internal::AnyHash
164
+ )
165
+ end
166
+
167
+ # Decimal amount of the transaction.
168
+ sig { returns(String) }
169
+ attr_accessor :amount
170
+
171
+ # ISO 4217 currency code.
172
+ sig { returns(String) }
173
+ attr_accessor :currency
174
+
175
+ # Payee name displayed to the payer.
176
+ sig { returns(String) }
177
+ attr_accessor :recipient
178
+
179
+ # Required when checking a code issued under the `prelude:psd2` template. The
180
+ # submitted variables must match those provided at issuance; any mismatch
181
+ # invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
182
+ # non-PSD2 verifications.
183
+ sig do
184
+ params(amount: String, currency: String, recipient: String).returns(
185
+ T.attached_class
186
+ )
187
+ end
188
+ def self.new(
189
+ # Decimal amount of the transaction.
190
+ amount:,
191
+ # ISO 4217 currency code.
192
+ currency:,
193
+ # Payee name displayed to the payer.
194
+ recipient:
195
+ )
196
+ end
197
+
198
+ sig do
199
+ override.returns(
200
+ { amount: String, currency: String, recipient: String }
201
+ )
202
+ end
203
+ def to_hash
204
+ end
205
+ end
138
206
  end
139
207
  end
140
208
  end
@@ -11,7 +11,9 @@ module PreludeSDK
11
11
  )
12
12
  end
13
13
 
14
- # The status of the check.
14
+ # The status of the check. For `prelude:psd2` codes, `transaction_missing` is
15
+ # returned when the `psd2` block is omitted, and `transaction_mismatch` when the
16
+ # submitted variables differ from those provided at issuance.
15
17
  sig do
16
18
  returns(
17
19
  PreludeSDK::Models::VerificationCheckResponse::Status::TaggedSymbol
@@ -59,7 +61,9 @@ module PreludeSDK
59
61
  ).returns(T.attached_class)
60
62
  end
61
63
  def self.new(
62
- # The status of the check.
64
+ # The status of the check. For `prelude:psd2` codes, `transaction_missing` is
65
+ # returned when the `psd2` block is omitted, and `transaction_mismatch` when the
66
+ # submitted variables differ from those provided at issuance.
63
67
  status:,
64
68
  # The verification identifier.
65
69
  id: nil,
@@ -83,7 +87,9 @@ module PreludeSDK
83
87
  def to_hash
84
88
  end
85
89
 
86
- # The status of the check.
90
+ # The status of the check. For `prelude:psd2` codes, `transaction_missing` is
91
+ # returned when the `psd2` block is omitted, and `transaction_mismatch` when the
92
+ # submitted variables differ from those provided at issuance.
87
93
  module Status
88
94
  extend PreludeSDK::Internal::Type::Enum
89
95
 
@@ -108,6 +114,16 @@ module PreludeSDK
108
114
  :expired_or_not_found,
109
115
  PreludeSDK::Models::VerificationCheckResponse::Status::TaggedSymbol
110
116
  )
117
+ TRANSACTION_MISSING =
118
+ T.let(
119
+ :transaction_missing,
120
+ PreludeSDK::Models::VerificationCheckResponse::Status::TaggedSymbol
121
+ )
122
+ TRANSACTION_MISMATCH =
123
+ T.let(
124
+ :transaction_mismatch,
125
+ PreludeSDK::Models::VerificationCheckResponse::Status::TaggedSymbol
126
+ )
111
127
 
112
128
  sig do
113
129
  override.returns(
@@ -258,6 +258,37 @@ module PreludeSDK
258
258
  sig { params(callback_url: String).void }
259
259
  attr_writer :callback_url
260
260
 
261
+ # The channels this verification may use, in the order they are tried. Channels
262
+ # you omit are never used, including on retries. This option can only be set when
263
+ # the verification is created. The list is recorded on the verification and
264
+ # applies for its whole lifecycle, so `channels` sent while retrying an existing
265
+ # verification is ignored — unlike `preferred_channel`, which is honored on every
266
+ # retry. Every channel you list must be enabled on your account and active in the
267
+ # destination country, otherwise the request fails with
268
+ # `channel_not_enabled_in_region`. Prelude still picks the best provider within
269
+ # each channel. Cannot be combined with `preferred_channel`. Voice is requested
270
+ # through `method` instead. Disabled by default — contact support to enable it.
271
+ sig do
272
+ returns(
273
+ T.nilable(
274
+ T::Array[
275
+ PreludeSDK::VerificationCreateParams::Options::Channel::OrSymbol
276
+ ]
277
+ )
278
+ )
279
+ end
280
+ attr_reader :channels
281
+
282
+ sig do
283
+ params(
284
+ channels:
285
+ T::Array[
286
+ PreludeSDK::VerificationCreateParams::Options::Channel::OrSymbol
287
+ ]
288
+ ).void
289
+ end
290
+ attr_writer :channels
291
+
261
292
  # The size of the code generated. It should be between 4 and 8. Defaults to the
262
293
  # code size specified from the Dashboard.
263
294
  sig { returns(T.nilable(Integer)) }
@@ -275,6 +306,19 @@ module PreludeSDK
275
306
  sig { params(custom_code: String).void }
276
307
  attr_writer :custom_code
277
308
 
309
+ # When `true`, the verification is routed through challenge-safe channels
310
+ # (non-SMS/Voice) regardless of country eligibility or any antispam outcome. The
311
+ # resulting verification has `status: "challenged"`. Use this when you have your
312
+ # own signal that the request is suspicious and want stricter routing — the
313
+ # verification is **not** classified as fraud and does not contribute to
314
+ # anti-fraud counters or risk factors. This feature is disabled by default —
315
+ # contact Prelude support to enable it on your account.
316
+ sig { returns(T.nilable(T::Boolean)) }
317
+ attr_reader :force_challenge
318
+
319
+ sig { params(force_challenge: T::Boolean).void }
320
+ attr_writer :force_challenge
321
+
278
322
  # A BCP-47 formatted locale string with the language the text message will be sent
279
323
  # to. If there's no locale set, the language will be determined by the country
280
324
  # code of the phone number. If the language specified doesn't exist, it defaults
@@ -285,6 +329,27 @@ module PreludeSDK
285
329
  sig { params(locale: String).void }
286
330
  attr_writer :locale
287
331
 
332
+ # Maximum number of delivery attempts Prelude may add on its own after the one you
333
+ # requested. `0` means a single attempt: if it cannot be delivered, Prelude
334
+ # neither tries another provider nor another channel, and does not retry
335
+ # automatically. `1` allows one additional attempt, and so on — a value larger
336
+ # than the number of routes available for the destination simply behaves like the
337
+ # default. When omitted, Prelude retries as your account is configured, across as
338
+ # many channels as the route offers.
339
+ #
340
+ # This option can only be set when the verification is created. The value is
341
+ # recorded on the verification and applies for its whole lifecycle, so a
342
+ # `max_auto_fallbacks` sent while retrying an existing verification is ignored —
343
+ # the limit cannot be raised or lowered after the fact. A retry you ask for is not
344
+ # an automatic attempt, so it gets a fresh allowance of the same limit. This
345
+ # option is disabled by default — contact Prelude support to enable it on your
346
+ # account.
347
+ sig { returns(T.nilable(Integer)) }
348
+ attr_reader :max_auto_fallbacks
349
+
350
+ sig { params(max_auto_fallbacks: Integer).void }
351
+ attr_writer :max_auto_fallbacks
352
+
288
353
  # The method used for verifying this phone number. The 'voice' option provides an
289
354
  # accessible alternative for visually impaired users by delivering the
290
355
  # verification code through a phone call rather than a text message. It also
@@ -309,7 +374,12 @@ module PreludeSDK
309
374
  end
310
375
  attr_writer :verification_method
311
376
 
312
- # The preferred channel to be used in priority for verification.
377
+ # The channel to prioritize when delivering the verification. Prelude prioritizes
378
+ # this channel on the first attempt and continues to prefer it on retries while an
379
+ # untried route on that channel remains; once those are exhausted, retries fall
380
+ # back to the next best available route. If the channel is unavailable (for
381
+ # example, when a verification is challenged), Prelude uses the best available
382
+ # route instead. Cannot be combined with `channels`.
313
383
  sig do
314
384
  returns(
315
385
  T.nilable(
@@ -356,9 +426,15 @@ module PreludeSDK
356
426
  app_realm:
357
427
  PreludeSDK::VerificationCreateParams::Options::AppRealm::OrHash,
358
428
  callback_url: String,
429
+ channels:
430
+ T::Array[
431
+ PreludeSDK::VerificationCreateParams::Options::Channel::OrSymbol
432
+ ],
359
433
  code_size: Integer,
360
434
  custom_code: String,
435
+ force_challenge: T::Boolean,
361
436
  locale: String,
437
+ max_auto_fallbacks: Integer,
362
438
  verification_method:
363
439
  PreludeSDK::VerificationCreateParams::Options::Method::OrSymbol,
364
440
  preferred_channel:
@@ -376,6 +452,17 @@ module PreludeSDK
376
452
  # verification creation, attempt creation, and delivery status changes. For more
377
453
  # details, refer to [Webhook](/verify/v2/documentation/webhook).
378
454
  callback_url: nil,
455
+ # The channels this verification may use, in the order they are tried. Channels
456
+ # you omit are never used, including on retries. This option can only be set when
457
+ # the verification is created. The list is recorded on the verification and
458
+ # applies for its whole lifecycle, so `channels` sent while retrying an existing
459
+ # verification is ignored — unlike `preferred_channel`, which is honored on every
460
+ # retry. Every channel you list must be enabled on your account and active in the
461
+ # destination country, otherwise the request fails with
462
+ # `channel_not_enabled_in_region`. Prelude still picks the best provider within
463
+ # each channel. Cannot be combined with `preferred_channel`. Voice is requested
464
+ # through `method` instead. Disabled by default — contact support to enable it.
465
+ channels: nil,
379
466
  # The size of the code generated. It should be between 4 and 8. Defaults to the
380
467
  # code size specified from the Dashboard.
381
468
  code_size: nil,
@@ -383,11 +470,35 @@ module PreludeSDK
383
470
  # contact us to enable it for your account. For more details, refer to
384
471
  # [Custom Code](/verify/v2/documentation/custom-codes).
385
472
  custom_code: nil,
473
+ # When `true`, the verification is routed through challenge-safe channels
474
+ # (non-SMS/Voice) regardless of country eligibility or any antispam outcome. The
475
+ # resulting verification has `status: "challenged"`. Use this when you have your
476
+ # own signal that the request is suspicious and want stricter routing — the
477
+ # verification is **not** classified as fraud and does not contribute to
478
+ # anti-fraud counters or risk factors. This feature is disabled by default —
479
+ # contact Prelude support to enable it on your account.
480
+ force_challenge: nil,
386
481
  # A BCP-47 formatted locale string with the language the text message will be sent
387
482
  # to. If there's no locale set, the language will be determined by the country
388
483
  # code of the phone number. If the language specified doesn't exist, it defaults
389
484
  # to US English.
390
485
  locale: nil,
486
+ # Maximum number of delivery attempts Prelude may add on its own after the one you
487
+ # requested. `0` means a single attempt: if it cannot be delivered, Prelude
488
+ # neither tries another provider nor another channel, and does not retry
489
+ # automatically. `1` allows one additional attempt, and so on — a value larger
490
+ # than the number of routes available for the destination simply behaves like the
491
+ # default. When omitted, Prelude retries as your account is configured, across as
492
+ # many channels as the route offers.
493
+ #
494
+ # This option can only be set when the verification is created. The value is
495
+ # recorded on the verification and applies for its whole lifecycle, so a
496
+ # `max_auto_fallbacks` sent while retrying an existing verification is ignored —
497
+ # the limit cannot be raised or lowered after the fact. A retry you ask for is not
498
+ # an automatic attempt, so it gets a fresh allowance of the same limit. This
499
+ # option is disabled by default — contact Prelude support to enable it on your
500
+ # account.
501
+ max_auto_fallbacks: nil,
391
502
  # The method used for verifying this phone number. The 'voice' option provides an
392
503
  # accessible alternative for visually impaired users by delivering the
393
504
  # verification code through a phone call rather than a text message. It also
@@ -396,7 +507,12 @@ module PreludeSDK
396
507
  # skips silent verification, useful for scenarios requiring direct user
397
508
  # interaction.
398
509
  verification_method: nil,
399
- # The preferred channel to be used in priority for verification.
510
+ # The channel to prioritize when delivering the verification. Prelude prioritizes
511
+ # this channel on the first attempt and continues to prefer it on retries while an
512
+ # untried route on that channel remains; once those are exhausted, retries fall
513
+ # back to the next best available route. If the channel is unavailable (for
514
+ # example, when a verification is challenged), Prelude uses the best available
515
+ # route instead. Cannot be combined with `channels`.
400
516
  preferred_channel: nil,
401
517
  # The Sender ID to use for this message. The Sender ID needs to be enabled by
402
518
  # Prelude.
@@ -415,9 +531,15 @@ module PreludeSDK
415
531
  app_realm:
416
532
  PreludeSDK::VerificationCreateParams::Options::AppRealm,
417
533
  callback_url: String,
534
+ channels:
535
+ T::Array[
536
+ PreludeSDK::VerificationCreateParams::Options::Channel::OrSymbol
537
+ ],
418
538
  code_size: Integer,
419
539
  custom_code: String,
540
+ force_challenge: T::Boolean,
420
541
  locale: String,
542
+ max_auto_fallbacks: Integer,
421
543
  verification_method:
422
544
  PreludeSDK::VerificationCreateParams::Options::Method::OrSymbol,
423
545
  preferred_channel:
@@ -530,6 +652,60 @@ module PreludeSDK
530
652
  end
531
653
  end
532
654
 
655
+ module Channel
656
+ extend PreludeSDK::Internal::Type::Enum
657
+
658
+ TaggedSymbol =
659
+ T.type_alias do
660
+ T.all(
661
+ Symbol,
662
+ PreludeSDK::VerificationCreateParams::Options::Channel
663
+ )
664
+ end
665
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
666
+
667
+ SMS =
668
+ T.let(
669
+ :sms,
670
+ PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
671
+ )
672
+ RCS =
673
+ T.let(
674
+ :rcs,
675
+ PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
676
+ )
677
+ WHATSAPP =
678
+ T.let(
679
+ :whatsapp,
680
+ PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
681
+ )
682
+ VIBER =
683
+ T.let(
684
+ :viber,
685
+ PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
686
+ )
687
+ ZALO =
688
+ T.let(
689
+ :zalo,
690
+ PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
691
+ )
692
+ TELEGRAM =
693
+ T.let(
694
+ :telegram,
695
+ PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
696
+ )
697
+
698
+ sig do
699
+ override.returns(
700
+ T::Array[
701
+ PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
702
+ ]
703
+ )
704
+ end
705
+ def self.values
706
+ end
707
+ end
708
+
533
709
  # The method used for verifying this phone number. The 'voice' option provides an
534
710
  # accessible alternative for visually impaired users by delivering the
535
711
  # verification code through a phone call rather than a text message. It also
@@ -576,7 +752,12 @@ module PreludeSDK
576
752
  end
577
753
  end
578
754
 
579
- # The preferred channel to be used in priority for verification.
755
+ # The channel to prioritize when delivering the verification. Prelude prioritizes
756
+ # this channel on the first attempt and continues to prefer it on retries while an
757
+ # untried route on that channel remains; once those are exhausted, retries fall
758
+ # back to the next best available route. If the channel is unavailable (for
759
+ # example, when a verification is challenged), Prelude uses the best available
760
+ # route instead. Cannot be combined with `channels`.
580
761
  module PreferredChannel
581
762
  extend PreludeSDK::Internal::Type::Enum
582
763
 
@@ -11,7 +11,7 @@ module PreludeSDK
11
11
  T.any(PreludeSDK::WatchPredictParams, PreludeSDK::Internal::AnyHash)
12
12
  end
13
13
 
14
- # The prediction target. Only supports phone numbers for now.
14
+ # The signup identifier to score — a phone number or email address.
15
15
  sig { returns(PreludeSDK::WatchPredictParams::Target) }
16
16
  attr_reader :target
17
17
 
@@ -56,7 +56,7 @@ module PreludeSDK
56
56
  ).returns(T.attached_class)
57
57
  end
58
58
  def self.new(
59
- # The prediction target. Only supports phone numbers for now.
59
+ # The signup identifier to score — a phone number or email address.
60
60
  target:,
61
61
  # The identifier of the dispatch that came from the front-end SDK.
62
62
  dispatch_id: nil,
@@ -100,7 +100,7 @@ module PreludeSDK
100
100
  sig { returns(String) }
101
101
  attr_accessor :value
102
102
 
103
- # The prediction target. Only supports phone numbers for now.
103
+ # The signup identifier to score — a phone number or email address.
104
104
  sig do
105
105
  params(
106
106
  type: PreludeSDK::WatchPredictParams::Target::Type::OrSymbol,
@@ -53,7 +53,15 @@ module PreludeSDK
53
53
  )
54
54
  end
55
55
 
56
- # A confidence level you want to assign to the event.
56
+ # How much this event tells us to trust the end-user's legitimacy — not how
57
+ # certain you are that the event occurred. In increasing order of trust:
58
+ # `minimum`, `low`, `neutral`, `high`, `maximum`.
59
+ #
60
+ # Use `minimum` for an event tied to a user you trust the least to be legitimate
61
+ # (e.g. a `payment.chargeback`), and `maximum` for an event tied to a highly
62
+ # trustworthy user (e.g. a confirmed 3DS payment). Prelude weights these signals
63
+ # when scoring traffic: it filters out users tied to low-confidence events while
64
+ # preserving the experience for users tied to high-confidence ones.
57
65
  sig do
58
66
  returns(
59
67
  PreludeSDK::WatchSendEventsParams::Event::Confidence::OrSymbol
@@ -85,7 +93,15 @@ module PreludeSDK
85
93
  ).returns(T.attached_class)
86
94
  end
87
95
  def self.new(
88
- # A confidence level you want to assign to the event.
96
+ # How much this event tells us to trust the end-user's legitimacy — not how
97
+ # certain you are that the event occurred. In increasing order of trust:
98
+ # `minimum`, `low`, `neutral`, `high`, `maximum`.
99
+ #
100
+ # Use `minimum` for an event tied to a user you trust the least to be legitimate
101
+ # (e.g. a `payment.chargeback`), and `maximum` for an event tied to a highly
102
+ # trustworthy user (e.g. a confirmed 3DS payment). Prelude weights these signals
103
+ # when scoring traffic: it filters out users tied to low-confidence events while
104
+ # preserving the experience for users tied to high-confidence ones.
89
105
  confidence:,
90
106
  # A label to describe what the event refers to.
91
107
  label:,
@@ -107,7 +123,15 @@ module PreludeSDK
107
123
  def to_hash
108
124
  end
109
125
 
110
- # A confidence level you want to assign to the event.
126
+ # How much this event tells us to trust the end-user's legitimacy — not how
127
+ # certain you are that the event occurred. In increasing order of trust:
128
+ # `minimum`, `low`, `neutral`, `high`, `maximum`.
129
+ #
130
+ # Use `minimum` for an event tied to a user you trust the least to be legitimate
131
+ # (e.g. a `payment.chargeback`), and `maximum` for an event tied to a highly
132
+ # trustworthy user (e.g. a confirmed 3DS payment). Prelude weights these signals
133
+ # when scoring traffic: it filters out users tied to low-confidence events while
134
+ # preserving the experience for users tied to high-confidence ones.
111
135
  module Confidence
112
136
  extend PreludeSDK::Internal::Type::Enum
113
137
 
@@ -126,6 +126,7 @@ module PreludeSDK
126
126
  expires_at: Time,
127
127
  from: String,
128
128
  locale: String,
129
+ max_auto_retries: Integer,
129
130
  preferred_channel:
130
131
  PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
131
132
  schedule_at: Time,
@@ -165,6 +166,12 @@ module PreludeSDK
165
166
  # code of the phone number. If the language specified doesn't exist, the default
166
167
  # set on the template will be used.
167
168
  locale: nil,
169
+ # Maximum number of automatic retry attempts across channels for this send, in
170
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
171
+ # attempts. Lower values reduce delivery cost on hard-to-reach numbers at the
172
+ # expense of deliverability. When omitted, your account's configured default
173
+ # applies.
174
+ max_auto_retries: nil,
168
175
  # The preferred channel to be used in priority for message delivery. If the
169
176
  # channel is unavailable, the system will fallback to other available channels.
170
177
  preferred_channel: nil,
@@ -189,6 +196,7 @@ module PreludeSDK
189
196
  expires_at: Time,
190
197
  from: String,
191
198
  locale: String,
199
+ max_auto_retries: Integer,
192
200
  preferred_channel:
193
201
  PreludeSDK::NotifySendBatchParams::PreferredChannel::OrSymbol,
194
202
  schedule_at: Time,
@@ -223,6 +231,12 @@ module PreludeSDK
223
231
  from: nil,
224
232
  # A BCP-47 formatted locale string.
225
233
  locale: nil,
234
+ # Maximum number of automatic retry attempts across channels for each send in the
235
+ # batch, in addition to the first attempt. For example, `2` allows up to 3 total
236
+ # delivery attempts per recipient. Lower values reduce delivery cost on
237
+ # hard-to-reach numbers at the expense of deliverability. When omitted, your
238
+ # account's configured default applies.
239
+ max_auto_retries: nil,
226
240
  # Preferred channel for delivery. If unavailable, automatic fallback applies.
227
241
  preferred_channel: nil,
228
242
  # Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply