prelude-sdk 0.1.0.pre.alpha.2

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 (125) hide show
  1. checksums.yaml +7 -0
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +352 -0
  4. data/README.md +217 -0
  5. data/SECURITY.md +27 -0
  6. data/lib/prelude_sdk/client.rb +87 -0
  7. data/lib/prelude_sdk/errors.rb +214 -0
  8. data/lib/prelude_sdk/file_part.rb +55 -0
  9. data/lib/prelude_sdk/internal/transport/base_client.rb +555 -0
  10. data/lib/prelude_sdk/internal/transport/pooled_net_requester.rb +209 -0
  11. data/lib/prelude_sdk/internal/type/array_of.rb +167 -0
  12. data/lib/prelude_sdk/internal/type/base_model.rb +536 -0
  13. data/lib/prelude_sdk/internal/type/base_page.rb +55 -0
  14. data/lib/prelude_sdk/internal/type/boolean.rb +77 -0
  15. data/lib/prelude_sdk/internal/type/converter.rb +300 -0
  16. data/lib/prelude_sdk/internal/type/enum.rb +131 -0
  17. data/lib/prelude_sdk/internal/type/file_input.rb +108 -0
  18. data/lib/prelude_sdk/internal/type/hash_of.rb +187 -0
  19. data/lib/prelude_sdk/internal/type/request_parameters.rb +42 -0
  20. data/lib/prelude_sdk/internal/type/union.rb +235 -0
  21. data/lib/prelude_sdk/internal/type/unknown.rb +81 -0
  22. data/lib/prelude_sdk/internal/util.rb +914 -0
  23. data/lib/prelude_sdk/internal.rb +20 -0
  24. data/lib/prelude_sdk/models/lookup_lookup_params.rb +37 -0
  25. data/lib/prelude_sdk/models/lookup_lookup_response.rb +236 -0
  26. data/lib/prelude_sdk/models/transactional_send_params.rb +84 -0
  27. data/lib/prelude_sdk/models/transactional_send_response.rb +81 -0
  28. data/lib/prelude_sdk/models/verification_check_params.rb +69 -0
  29. data/lib/prelude_sdk/models/verification_check_response.rb +67 -0
  30. data/lib/prelude_sdk/models/verification_create_params.rb +388 -0
  31. data/lib/prelude_sdk/models/verification_create_response.rb +148 -0
  32. data/lib/prelude_sdk/models/watch_predict_params.rb +191 -0
  33. data/lib/prelude_sdk/models/watch_predict_response.rb +50 -0
  34. data/lib/prelude_sdk/models/watch_send_events_params.rb +100 -0
  35. data/lib/prelude_sdk/models/watch_send_events_response.rb +41 -0
  36. data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +229 -0
  37. data/lib/prelude_sdk/models/watch_send_feedbacks_response.rb +41 -0
  38. data/lib/prelude_sdk/models.rb +55 -0
  39. data/lib/prelude_sdk/request_options.rb +77 -0
  40. data/lib/prelude_sdk/resources/lookup.rb +42 -0
  41. data/lib/prelude_sdk/resources/transactional.rb +53 -0
  42. data/lib/prelude_sdk/resources/verification.rb +76 -0
  43. data/lib/prelude_sdk/resources/watch.rb +91 -0
  44. data/lib/prelude_sdk/version.rb +5 -0
  45. data/lib/prelude_sdk.rb +71 -0
  46. data/manifest.yaml +15 -0
  47. data/rbi/prelude_sdk/client.rbi +59 -0
  48. data/rbi/prelude_sdk/errors.rbi +178 -0
  49. data/rbi/prelude_sdk/file_part.rbi +37 -0
  50. data/rbi/prelude_sdk/internal/transport/base_client.rbi +296 -0
  51. data/rbi/prelude_sdk/internal/transport/pooled_net_requester.rbi +80 -0
  52. data/rbi/prelude_sdk/internal/type/array_of.rbi +104 -0
  53. data/rbi/prelude_sdk/internal/type/base_model.rbi +304 -0
  54. data/rbi/prelude_sdk/internal/type/base_page.rbi +42 -0
  55. data/rbi/prelude_sdk/internal/type/boolean.rbi +58 -0
  56. data/rbi/prelude_sdk/internal/type/converter.rbi +162 -0
  57. data/rbi/prelude_sdk/internal/type/enum.rbi +82 -0
  58. data/rbi/prelude_sdk/internal/type/file_input.rbi +59 -0
  59. data/rbi/prelude_sdk/internal/type/hash_of.rbi +104 -0
  60. data/rbi/prelude_sdk/internal/type/request_parameters.rbi +29 -0
  61. data/rbi/prelude_sdk/internal/type/union.rbi +121 -0
  62. data/rbi/prelude_sdk/internal/type/unknown.rbi +58 -0
  63. data/rbi/prelude_sdk/internal/util.rbi +487 -0
  64. data/rbi/prelude_sdk/internal.rbi +18 -0
  65. data/rbi/prelude_sdk/models/lookup_lookup_params.rbi +78 -0
  66. data/rbi/prelude_sdk/models/lookup_lookup_response.rbi +520 -0
  67. data/rbi/prelude_sdk/models/transactional_send_params.rbi +126 -0
  68. data/rbi/prelude_sdk/models/transactional_send_response.rbi +113 -0
  69. data/rbi/prelude_sdk/models/verification_check_params.rbi +140 -0
  70. data/rbi/prelude_sdk/models/verification_check_response.rbi +149 -0
  71. data/rbi/prelude_sdk/models/verification_create_params.rbi +805 -0
  72. data/rbi/prelude_sdk/models/verification_create_response.rbi +336 -0
  73. data/rbi/prelude_sdk/models/watch_predict_params.rbi +382 -0
  74. data/rbi/prelude_sdk/models/watch_predict_response.rbi +96 -0
  75. data/rbi/prelude_sdk/models/watch_send_events_params.rbi +245 -0
  76. data/rbi/prelude_sdk/models/watch_send_events_response.rbi +82 -0
  77. data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +500 -0
  78. data/rbi/prelude_sdk/models/watch_send_feedbacks_response.rbi +86 -0
  79. data/rbi/prelude_sdk/models.rbi +17 -0
  80. data/rbi/prelude_sdk/request_options.rbi +59 -0
  81. data/rbi/prelude_sdk/resources/lookup.rbi +33 -0
  82. data/rbi/prelude_sdk/resources/transactional.rbi +50 -0
  83. data/rbi/prelude_sdk/resources/verification.rbi +61 -0
  84. data/rbi/prelude_sdk/resources/watch.rbi +67 -0
  85. data/rbi/prelude_sdk/version.rbi +5 -0
  86. data/sig/prelude_sdk/client.rbs +32 -0
  87. data/sig/prelude_sdk/errors.rbs +110 -0
  88. data/sig/prelude_sdk/file_part.rbs +21 -0
  89. data/sig/prelude_sdk/internal/transport/base_client.rbs +131 -0
  90. data/sig/prelude_sdk/internal/transport/pooled_net_requester.rbs +45 -0
  91. data/sig/prelude_sdk/internal/type/array_of.rbs +48 -0
  92. data/sig/prelude_sdk/internal/type/base_model.rbs +102 -0
  93. data/sig/prelude_sdk/internal/type/base_page.rbs +24 -0
  94. data/sig/prelude_sdk/internal/type/boolean.rbs +26 -0
  95. data/sig/prelude_sdk/internal/type/converter.rbs +62 -0
  96. data/sig/prelude_sdk/internal/type/enum.rbs +32 -0
  97. data/sig/prelude_sdk/internal/type/file_input.rbs +25 -0
  98. data/sig/prelude_sdk/internal/type/hash_of.rbs +48 -0
  99. data/sig/prelude_sdk/internal/type/request_parameters.rbs +19 -0
  100. data/sig/prelude_sdk/internal/type/union.rbs +52 -0
  101. data/sig/prelude_sdk/internal/type/unknown.rbs +26 -0
  102. data/sig/prelude_sdk/internal/util.rbs +185 -0
  103. data/sig/prelude_sdk/internal.rbs +9 -0
  104. data/sig/prelude_sdk/models/lookup_lookup_params.rbs +38 -0
  105. data/sig/prelude_sdk/models/lookup_lookup_response.rbs +179 -0
  106. data/sig/prelude_sdk/models/transactional_send_params.rbs +73 -0
  107. data/sig/prelude_sdk/models/transactional_send_response.rbs +66 -0
  108. data/sig/prelude_sdk/models/verification_check_params.rbs +61 -0
  109. data/sig/prelude_sdk/models/verification_check_response.rbs +67 -0
  110. data/sig/prelude_sdk/models/verification_create_params.rbs +345 -0
  111. data/sig/prelude_sdk/models/verification_create_response.rbs +136 -0
  112. data/sig/prelude_sdk/models/watch_predict_params.rbs +180 -0
  113. data/sig/prelude_sdk/models/watch_predict_response.rbs +41 -0
  114. data/sig/prelude_sdk/models/watch_send_events_params.rbs +98 -0
  115. data/sig/prelude_sdk/models/watch_send_events_response.rbs +35 -0
  116. data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +211 -0
  117. data/sig/prelude_sdk/models/watch_send_feedbacks_response.rbs +35 -0
  118. data/sig/prelude_sdk/models.rbs +15 -0
  119. data/sig/prelude_sdk/request_options.rbs +36 -0
  120. data/sig/prelude_sdk/resources/lookup.rbs +13 -0
  121. data/sig/prelude_sdk/resources/transactional.rbs +19 -0
  122. data/sig/prelude_sdk/resources/verification.rbs +22 -0
  123. data/sig/prelude_sdk/resources/watch.rbs +25 -0
  124. data/sig/prelude_sdk/version.rbs +3 -0
  125. metadata +182 -0
@@ -0,0 +1,805 @@
1
+ # typed: strong
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ class VerificationCreateParams < PreludeSDK::Internal::Type::BaseModel
6
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
7
+ include PreludeSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ PreludeSDK::VerificationCreateParams,
13
+ PreludeSDK::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # The verification target. Either a phone number or an email address. To use the
18
+ # email verification feature contact us to discuss your use case.
19
+ sig { returns(PreludeSDK::VerificationCreateParams::Target) }
20
+ attr_reader :target
21
+
22
+ sig do
23
+ params(
24
+ target: PreludeSDK::VerificationCreateParams::Target::OrHash
25
+ ).void
26
+ end
27
+ attr_writer :target
28
+
29
+ # The identifier of the dispatch that came from the front-end SDK.
30
+ sig { returns(T.nilable(String)) }
31
+ attr_reader :dispatch_id
32
+
33
+ sig { params(dispatch_id: String).void }
34
+ attr_writer :dispatch_id
35
+
36
+ # The metadata for this verification. This object will be returned with every
37
+ # response or webhook sent that refers to this verification.
38
+ sig { returns(T.nilable(PreludeSDK::VerificationCreateParams::Metadata)) }
39
+ attr_reader :metadata
40
+
41
+ sig do
42
+ params(
43
+ metadata: PreludeSDK::VerificationCreateParams::Metadata::OrHash
44
+ ).void
45
+ end
46
+ attr_writer :metadata
47
+
48
+ # Verification options
49
+ sig { returns(T.nilable(PreludeSDK::VerificationCreateParams::Options)) }
50
+ attr_reader :options
51
+
52
+ sig do
53
+ params(
54
+ options: PreludeSDK::VerificationCreateParams::Options::OrHash
55
+ ).void
56
+ end
57
+ attr_writer :options
58
+
59
+ # The signals used for anti-fraud. For more details, refer to
60
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
61
+ sig { returns(T.nilable(PreludeSDK::VerificationCreateParams::Signals)) }
62
+ attr_reader :signals
63
+
64
+ sig do
65
+ params(
66
+ signals: PreludeSDK::VerificationCreateParams::Signals::OrHash
67
+ ).void
68
+ end
69
+ attr_writer :signals
70
+
71
+ sig do
72
+ params(
73
+ target: PreludeSDK::VerificationCreateParams::Target::OrHash,
74
+ dispatch_id: String,
75
+ metadata: PreludeSDK::VerificationCreateParams::Metadata::OrHash,
76
+ options: PreludeSDK::VerificationCreateParams::Options::OrHash,
77
+ signals: PreludeSDK::VerificationCreateParams::Signals::OrHash,
78
+ request_options: PreludeSDK::RequestOptions::OrHash
79
+ ).returns(T.attached_class)
80
+ end
81
+ def self.new(
82
+ # The verification target. Either a phone number or an email address. To use the
83
+ # email verification feature contact us to discuss your use case.
84
+ target:,
85
+ # The identifier of the dispatch that came from the front-end SDK.
86
+ dispatch_id: nil,
87
+ # The metadata for this verification. This object will be returned with every
88
+ # response or webhook sent that refers to this verification.
89
+ metadata: nil,
90
+ # Verification options
91
+ options: nil,
92
+ # The signals used for anti-fraud. For more details, refer to
93
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
94
+ signals: nil,
95
+ request_options: {}
96
+ )
97
+ end
98
+
99
+ sig do
100
+ override.returns(
101
+ {
102
+ target: PreludeSDK::VerificationCreateParams::Target,
103
+ dispatch_id: String,
104
+ metadata: PreludeSDK::VerificationCreateParams::Metadata,
105
+ options: PreludeSDK::VerificationCreateParams::Options,
106
+ signals: PreludeSDK::VerificationCreateParams::Signals,
107
+ request_options: PreludeSDK::RequestOptions
108
+ }
109
+ )
110
+ end
111
+ def to_hash
112
+ end
113
+
114
+ class Target < PreludeSDK::Internal::Type::BaseModel
115
+ OrHash =
116
+ T.type_alias do
117
+ T.any(
118
+ PreludeSDK::VerificationCreateParams::Target,
119
+ PreludeSDK::Internal::AnyHash
120
+ )
121
+ end
122
+
123
+ # The type of the target. Either "phone_number" or "email_address".
124
+ sig do
125
+ returns(PreludeSDK::VerificationCreateParams::Target::Type::OrSymbol)
126
+ end
127
+ attr_accessor :type
128
+
129
+ # An E.164 formatted phone number or an email address.
130
+ sig { returns(String) }
131
+ attr_accessor :value
132
+
133
+ # The verification target. Either a phone number or an email address. To use the
134
+ # email verification feature contact us to discuss your use case.
135
+ sig do
136
+ params(
137
+ type: PreludeSDK::VerificationCreateParams::Target::Type::OrSymbol,
138
+ value: String
139
+ ).returns(T.attached_class)
140
+ end
141
+ def self.new(
142
+ # The type of the target. Either "phone_number" or "email_address".
143
+ type:,
144
+ # An E.164 formatted phone number or an email address.
145
+ value:
146
+ )
147
+ end
148
+
149
+ sig do
150
+ override.returns(
151
+ {
152
+ type:
153
+ PreludeSDK::VerificationCreateParams::Target::Type::OrSymbol,
154
+ value: String
155
+ }
156
+ )
157
+ end
158
+ def to_hash
159
+ end
160
+
161
+ # The type of the target. Either "phone_number" or "email_address".
162
+ module Type
163
+ extend PreludeSDK::Internal::Type::Enum
164
+
165
+ TaggedSymbol =
166
+ T.type_alias do
167
+ T.all(Symbol, PreludeSDK::VerificationCreateParams::Target::Type)
168
+ end
169
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
170
+
171
+ PHONE_NUMBER =
172
+ T.let(
173
+ :phone_number,
174
+ PreludeSDK::VerificationCreateParams::Target::Type::TaggedSymbol
175
+ )
176
+ EMAIL_ADDRESS =
177
+ T.let(
178
+ :email_address,
179
+ PreludeSDK::VerificationCreateParams::Target::Type::TaggedSymbol
180
+ )
181
+
182
+ sig do
183
+ override.returns(
184
+ T::Array[
185
+ PreludeSDK::VerificationCreateParams::Target::Type::TaggedSymbol
186
+ ]
187
+ )
188
+ end
189
+ def self.values
190
+ end
191
+ end
192
+ end
193
+
194
+ class Metadata < PreludeSDK::Internal::Type::BaseModel
195
+ OrHash =
196
+ T.type_alias do
197
+ T.any(
198
+ PreludeSDK::VerificationCreateParams::Metadata,
199
+ PreludeSDK::Internal::AnyHash
200
+ )
201
+ end
202
+
203
+ # A user-defined identifier to correlate this verification with.
204
+ sig { returns(T.nilable(String)) }
205
+ attr_reader :correlation_id
206
+
207
+ sig { params(correlation_id: String).void }
208
+ attr_writer :correlation_id
209
+
210
+ # The metadata for this verification. This object will be returned with every
211
+ # response or webhook sent that refers to this verification.
212
+ sig { params(correlation_id: String).returns(T.attached_class) }
213
+ def self.new(
214
+ # A user-defined identifier to correlate this verification with.
215
+ correlation_id: nil
216
+ )
217
+ end
218
+
219
+ sig { override.returns({ correlation_id: String }) }
220
+ def to_hash
221
+ end
222
+ end
223
+
224
+ class Options < PreludeSDK::Internal::Type::BaseModel
225
+ OrHash =
226
+ T.type_alias do
227
+ T.any(
228
+ PreludeSDK::VerificationCreateParams::Options,
229
+ PreludeSDK::Internal::AnyHash
230
+ )
231
+ end
232
+
233
+ # This allows you to automatically retrieve and fill the OTP code on mobile apps.
234
+ # Currently only Android devices are supported.
235
+ sig do
236
+ returns(
237
+ T.nilable(PreludeSDK::VerificationCreateParams::Options::AppRealm)
238
+ )
239
+ end
240
+ attr_reader :app_realm
241
+
242
+ sig do
243
+ params(
244
+ app_realm:
245
+ PreludeSDK::VerificationCreateParams::Options::AppRealm::OrHash
246
+ ).void
247
+ end
248
+ attr_writer :app_realm
249
+
250
+ # The URL where webhooks will be sent when verification events occur, including
251
+ # verification creation, attempt creation, and delivery status changes. For more
252
+ # details, refer to [Webhook](/verify/v2/documentation/webhook).
253
+ sig { returns(T.nilable(String)) }
254
+ attr_reader :callback_url
255
+
256
+ sig { params(callback_url: String).void }
257
+ attr_writer :callback_url
258
+
259
+ # The size of the code generated. It should be between 4 and 8. Defaults to the
260
+ # code size specified from the Dashboard.
261
+ sig { returns(T.nilable(Integer)) }
262
+ attr_reader :code_size
263
+
264
+ sig { params(code_size: Integer).void }
265
+ attr_writer :code_size
266
+
267
+ # The custom code to use for OTP verification. To use the custom code feature,
268
+ # contact us to enable it for your account. For more details, refer to
269
+ # [Custom Code](/verify/v2/documentation/custom-codes).
270
+ sig { returns(T.nilable(String)) }
271
+ attr_reader :custom_code
272
+
273
+ sig { params(custom_code: String).void }
274
+ attr_writer :custom_code
275
+
276
+ # A BCP-47 formatted locale string with the language the text message will be sent
277
+ # to. If there's no locale set, the language will be determined by the country
278
+ # code of the phone number. If the language specified doesn't exist, it defaults
279
+ # to US English.
280
+ sig { returns(T.nilable(String)) }
281
+ attr_reader :locale
282
+
283
+ sig { params(locale: String).void }
284
+ attr_writer :locale
285
+
286
+ # The method used for verifying this phone number. The 'voice' option provides an
287
+ # accessible alternative for visually impaired users by delivering the
288
+ # verification code through a phone call rather than a text message. It also
289
+ # allows verification of landline numbers that cannot receive SMS messages.
290
+ sig do
291
+ returns(
292
+ T.nilable(
293
+ PreludeSDK::VerificationCreateParams::Options::Method::OrSymbol
294
+ )
295
+ )
296
+ end
297
+ attr_reader :method_
298
+
299
+ sig do
300
+ params(
301
+ method_:
302
+ PreludeSDK::VerificationCreateParams::Options::Method::OrSymbol
303
+ ).void
304
+ end
305
+ attr_writer :method_
306
+
307
+ # The preferred channel to be used in priority for verification.
308
+ sig do
309
+ returns(
310
+ T.nilable(
311
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::OrSymbol
312
+ )
313
+ )
314
+ end
315
+ attr_reader :preferred_channel
316
+
317
+ sig do
318
+ params(
319
+ preferred_channel:
320
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::OrSymbol
321
+ ).void
322
+ end
323
+ attr_writer :preferred_channel
324
+
325
+ # The Sender ID to use for this message. The Sender ID needs to be enabled by
326
+ # Prelude.
327
+ sig { returns(T.nilable(String)) }
328
+ attr_reader :sender_id
329
+
330
+ sig { params(sender_id: String).void }
331
+ attr_writer :sender_id
332
+
333
+ # The identifier of a verification template. It applies use case-specific
334
+ # settings, such as the message content or certain verification parameters.
335
+ sig { returns(T.nilable(String)) }
336
+ attr_reader :template_id
337
+
338
+ sig { params(template_id: String).void }
339
+ attr_writer :template_id
340
+
341
+ # The variables to be replaced in the template.
342
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
343
+ attr_reader :variables
344
+
345
+ sig { params(variables: T::Hash[Symbol, String]).void }
346
+ attr_writer :variables
347
+
348
+ # Verification options
349
+ sig do
350
+ params(
351
+ app_realm:
352
+ PreludeSDK::VerificationCreateParams::Options::AppRealm::OrHash,
353
+ callback_url: String,
354
+ code_size: Integer,
355
+ custom_code: String,
356
+ locale: String,
357
+ method_:
358
+ PreludeSDK::VerificationCreateParams::Options::Method::OrSymbol,
359
+ preferred_channel:
360
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::OrSymbol,
361
+ sender_id: String,
362
+ template_id: String,
363
+ variables: T::Hash[Symbol, String]
364
+ ).returns(T.attached_class)
365
+ end
366
+ def self.new(
367
+ # This allows you to automatically retrieve and fill the OTP code on mobile apps.
368
+ # Currently only Android devices are supported.
369
+ app_realm: nil,
370
+ # The URL where webhooks will be sent when verification events occur, including
371
+ # verification creation, attempt creation, and delivery status changes. For more
372
+ # details, refer to [Webhook](/verify/v2/documentation/webhook).
373
+ callback_url: nil,
374
+ # The size of the code generated. It should be between 4 and 8. Defaults to the
375
+ # code size specified from the Dashboard.
376
+ code_size: nil,
377
+ # The custom code to use for OTP verification. To use the custom code feature,
378
+ # contact us to enable it for your account. For more details, refer to
379
+ # [Custom Code](/verify/v2/documentation/custom-codes).
380
+ custom_code: nil,
381
+ # A BCP-47 formatted locale string with the language the text message will be sent
382
+ # to. If there's no locale set, the language will be determined by the country
383
+ # code of the phone number. If the language specified doesn't exist, it defaults
384
+ # to US English.
385
+ locale: nil,
386
+ # The method used for verifying this phone number. The 'voice' option provides an
387
+ # accessible alternative for visually impaired users by delivering the
388
+ # verification code through a phone call rather than a text message. It also
389
+ # allows verification of landline numbers that cannot receive SMS messages.
390
+ method_: nil,
391
+ # The preferred channel to be used in priority for verification.
392
+ preferred_channel: nil,
393
+ # The Sender ID to use for this message. The Sender ID needs to be enabled by
394
+ # Prelude.
395
+ sender_id: nil,
396
+ # The identifier of a verification template. It applies use case-specific
397
+ # settings, such as the message content or certain verification parameters.
398
+ template_id: nil,
399
+ # The variables to be replaced in the template.
400
+ variables: nil
401
+ )
402
+ end
403
+
404
+ sig do
405
+ override.returns(
406
+ {
407
+ app_realm:
408
+ PreludeSDK::VerificationCreateParams::Options::AppRealm,
409
+ callback_url: String,
410
+ code_size: Integer,
411
+ custom_code: String,
412
+ locale: String,
413
+ method_:
414
+ PreludeSDK::VerificationCreateParams::Options::Method::OrSymbol,
415
+ preferred_channel:
416
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::OrSymbol,
417
+ sender_id: String,
418
+ template_id: String,
419
+ variables: T::Hash[Symbol, String]
420
+ }
421
+ )
422
+ end
423
+ def to_hash
424
+ end
425
+
426
+ class AppRealm < PreludeSDK::Internal::Type::BaseModel
427
+ OrHash =
428
+ T.type_alias do
429
+ T.any(
430
+ PreludeSDK::VerificationCreateParams::Options::AppRealm,
431
+ PreludeSDK::Internal::AnyHash
432
+ )
433
+ end
434
+
435
+ # The platform the SMS will be sent to. We are currently only supporting
436
+ # "android".
437
+ sig do
438
+ returns(
439
+ PreludeSDK::VerificationCreateParams::Options::AppRealm::Platform::OrSymbol
440
+ )
441
+ end
442
+ attr_accessor :platform
443
+
444
+ # The Android SMS Retriever API hash code that identifies your app.
445
+ sig { returns(String) }
446
+ attr_accessor :value
447
+
448
+ # This allows you to automatically retrieve and fill the OTP code on mobile apps.
449
+ # Currently only Android devices are supported.
450
+ sig do
451
+ params(
452
+ platform:
453
+ PreludeSDK::VerificationCreateParams::Options::AppRealm::Platform::OrSymbol,
454
+ value: String
455
+ ).returns(T.attached_class)
456
+ end
457
+ def self.new(
458
+ # The platform the SMS will be sent to. We are currently only supporting
459
+ # "android".
460
+ platform:,
461
+ # The Android SMS Retriever API hash code that identifies your app.
462
+ value:
463
+ )
464
+ end
465
+
466
+ sig do
467
+ override.returns(
468
+ {
469
+ platform:
470
+ PreludeSDK::VerificationCreateParams::Options::AppRealm::Platform::OrSymbol,
471
+ value: String
472
+ }
473
+ )
474
+ end
475
+ def to_hash
476
+ end
477
+
478
+ # The platform the SMS will be sent to. We are currently only supporting
479
+ # "android".
480
+ module Platform
481
+ extend PreludeSDK::Internal::Type::Enum
482
+
483
+ TaggedSymbol =
484
+ T.type_alias do
485
+ T.all(
486
+ Symbol,
487
+ PreludeSDK::VerificationCreateParams::Options::AppRealm::Platform
488
+ )
489
+ end
490
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
491
+
492
+ ANDROID =
493
+ T.let(
494
+ :android,
495
+ PreludeSDK::VerificationCreateParams::Options::AppRealm::Platform::TaggedSymbol
496
+ )
497
+
498
+ sig do
499
+ override.returns(
500
+ T::Array[
501
+ PreludeSDK::VerificationCreateParams::Options::AppRealm::Platform::TaggedSymbol
502
+ ]
503
+ )
504
+ end
505
+ def self.values
506
+ end
507
+ end
508
+ end
509
+
510
+ # The method used for verifying this phone number. The 'voice' option provides an
511
+ # accessible alternative for visually impaired users by delivering the
512
+ # verification code through a phone call rather than a text message. It also
513
+ # allows verification of landline numbers that cannot receive SMS messages.
514
+ module Method
515
+ extend PreludeSDK::Internal::Type::Enum
516
+
517
+ TaggedSymbol =
518
+ T.type_alias do
519
+ T.all(
520
+ Symbol,
521
+ PreludeSDK::VerificationCreateParams::Options::Method
522
+ )
523
+ end
524
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
525
+
526
+ AUTO =
527
+ T.let(
528
+ :auto,
529
+ PreludeSDK::VerificationCreateParams::Options::Method::TaggedSymbol
530
+ )
531
+ VOICE =
532
+ T.let(
533
+ :voice,
534
+ PreludeSDK::VerificationCreateParams::Options::Method::TaggedSymbol
535
+ )
536
+
537
+ sig do
538
+ override.returns(
539
+ T::Array[
540
+ PreludeSDK::VerificationCreateParams::Options::Method::TaggedSymbol
541
+ ]
542
+ )
543
+ end
544
+ def self.values
545
+ end
546
+ end
547
+
548
+ # The preferred channel to be used in priority for verification.
549
+ module PreferredChannel
550
+ extend PreludeSDK::Internal::Type::Enum
551
+
552
+ TaggedSymbol =
553
+ T.type_alias do
554
+ T.all(
555
+ Symbol,
556
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel
557
+ )
558
+ end
559
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
560
+
561
+ SMS =
562
+ T.let(
563
+ :sms,
564
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
565
+ )
566
+ RCS =
567
+ T.let(
568
+ :rcs,
569
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
570
+ )
571
+ WHATSAPP =
572
+ T.let(
573
+ :whatsapp,
574
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
575
+ )
576
+ VIBER =
577
+ T.let(
578
+ :viber,
579
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
580
+ )
581
+ ZALO =
582
+ T.let(
583
+ :zalo,
584
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
585
+ )
586
+ TELEGRAM =
587
+ T.let(
588
+ :telegram,
589
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
590
+ )
591
+ SILENT =
592
+ T.let(
593
+ :silent,
594
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
595
+ )
596
+ VOICE =
597
+ T.let(
598
+ :voice,
599
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
600
+ )
601
+
602
+ sig do
603
+ override.returns(
604
+ T::Array[
605
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel::TaggedSymbol
606
+ ]
607
+ )
608
+ end
609
+ def self.values
610
+ end
611
+ end
612
+ end
613
+
614
+ class Signals < PreludeSDK::Internal::Type::BaseModel
615
+ OrHash =
616
+ T.type_alias do
617
+ T.any(
618
+ PreludeSDK::VerificationCreateParams::Signals,
619
+ PreludeSDK::Internal::AnyHash
620
+ )
621
+ end
622
+
623
+ # The version of your application.
624
+ sig { returns(T.nilable(String)) }
625
+ attr_reader :app_version
626
+
627
+ sig { params(app_version: String).void }
628
+ attr_writer :app_version
629
+
630
+ # The unique identifier for the user's device. For Android, this corresponds to
631
+ # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
632
+ sig { returns(T.nilable(String)) }
633
+ attr_reader :device_id
634
+
635
+ sig { params(device_id: String).void }
636
+ attr_writer :device_id
637
+
638
+ # The model of the user's device.
639
+ sig { returns(T.nilable(String)) }
640
+ attr_reader :device_model
641
+
642
+ sig { params(device_model: String).void }
643
+ attr_writer :device_model
644
+
645
+ # The type of the user's device.
646
+ sig do
647
+ returns(
648
+ T.nilable(
649
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::OrSymbol
650
+ )
651
+ )
652
+ end
653
+ attr_reader :device_platform
654
+
655
+ sig do
656
+ params(
657
+ device_platform:
658
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::OrSymbol
659
+ ).void
660
+ end
661
+ attr_writer :device_platform
662
+
663
+ # The IP address of the user's device.
664
+ sig { returns(T.nilable(String)) }
665
+ attr_reader :ip
666
+
667
+ sig { params(ip: String).void }
668
+ attr_writer :ip
669
+
670
+ # This signal should provide a higher level of trust, indicating that the user is
671
+ # genuine. Contact us to discuss your use case. For more details, refer to
672
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
673
+ sig { returns(T.nilable(T::Boolean)) }
674
+ attr_reader :is_trusted_user
675
+
676
+ sig { params(is_trusted_user: T::Boolean).void }
677
+ attr_writer :is_trusted_user
678
+
679
+ # The version of the user's device operating system.
680
+ sig { returns(T.nilable(String)) }
681
+ attr_reader :os_version
682
+
683
+ sig { params(os_version: String).void }
684
+ attr_writer :os_version
685
+
686
+ # The user agent of the user's device. If the individual fields (os_version,
687
+ # device_platform, device_model) are provided, we will prioritize those values
688
+ # instead of parsing them from the user agent string.
689
+ sig { returns(T.nilable(String)) }
690
+ attr_reader :user_agent
691
+
692
+ sig { params(user_agent: String).void }
693
+ attr_writer :user_agent
694
+
695
+ # The signals used for anti-fraud. For more details, refer to
696
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
697
+ sig do
698
+ params(
699
+ app_version: String,
700
+ device_id: String,
701
+ device_model: String,
702
+ device_platform:
703
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::OrSymbol,
704
+ ip: String,
705
+ is_trusted_user: T::Boolean,
706
+ os_version: String,
707
+ user_agent: String
708
+ ).returns(T.attached_class)
709
+ end
710
+ def self.new(
711
+ # The version of your application.
712
+ app_version: nil,
713
+ # The unique identifier for the user's device. For Android, this corresponds to
714
+ # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
715
+ device_id: nil,
716
+ # The model of the user's device.
717
+ device_model: nil,
718
+ # The type of the user's device.
719
+ device_platform: nil,
720
+ # The IP address of the user's device.
721
+ ip: nil,
722
+ # This signal should provide a higher level of trust, indicating that the user is
723
+ # genuine. Contact us to discuss your use case. For more details, refer to
724
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
725
+ is_trusted_user: nil,
726
+ # The version of the user's device operating system.
727
+ os_version: nil,
728
+ # The user agent of the user's device. If the individual fields (os_version,
729
+ # device_platform, device_model) are provided, we will prioritize those values
730
+ # instead of parsing them from the user agent string.
731
+ user_agent: nil
732
+ )
733
+ end
734
+
735
+ sig do
736
+ override.returns(
737
+ {
738
+ app_version: String,
739
+ device_id: String,
740
+ device_model: String,
741
+ device_platform:
742
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::OrSymbol,
743
+ ip: String,
744
+ is_trusted_user: T::Boolean,
745
+ os_version: String,
746
+ user_agent: String
747
+ }
748
+ )
749
+ end
750
+ def to_hash
751
+ end
752
+
753
+ # The type of the user's device.
754
+ module DevicePlatform
755
+ extend PreludeSDK::Internal::Type::Enum
756
+
757
+ TaggedSymbol =
758
+ T.type_alias do
759
+ T.all(
760
+ Symbol,
761
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform
762
+ )
763
+ end
764
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
765
+
766
+ ANDROID =
767
+ T.let(
768
+ :android,
769
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::TaggedSymbol
770
+ )
771
+ IOS =
772
+ T.let(
773
+ :ios,
774
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::TaggedSymbol
775
+ )
776
+ IPADOS =
777
+ T.let(
778
+ :ipados,
779
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::TaggedSymbol
780
+ )
781
+ TVOS =
782
+ T.let(
783
+ :tvos,
784
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::TaggedSymbol
785
+ )
786
+ WEB =
787
+ T.let(
788
+ :web,
789
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::TaggedSymbol
790
+ )
791
+
792
+ sig do
793
+ override.returns(
794
+ T::Array[
795
+ PreludeSDK::VerificationCreateParams::Signals::DevicePlatform::TaggedSymbol
796
+ ]
797
+ )
798
+ end
799
+ def self.values
800
+ end
801
+ end
802
+ end
803
+ end
804
+ end
805
+ end