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,388 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Verification#create
6
+ class VerificationCreateParams < PreludeSDK::Internal::Type::BaseModel
7
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
+ include PreludeSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute target
11
+ # The verification target. Either a phone number or an email address. To use the
12
+ # email verification feature contact us to discuss your use case.
13
+ #
14
+ # @return [PreludeSDK::Models::VerificationCreateParams::Target]
15
+ required :target, -> { PreludeSDK::VerificationCreateParams::Target }
16
+
17
+ # @!attribute dispatch_id
18
+ # The identifier of the dispatch that came from the front-end SDK.
19
+ #
20
+ # @return [String, nil]
21
+ optional :dispatch_id, String
22
+
23
+ # @!attribute metadata
24
+ # The metadata for this verification. This object will be returned with every
25
+ # response or webhook sent that refers to this verification.
26
+ #
27
+ # @return [PreludeSDK::Models::VerificationCreateParams::Metadata, nil]
28
+ optional :metadata, -> { PreludeSDK::VerificationCreateParams::Metadata }
29
+
30
+ # @!attribute options
31
+ # Verification options
32
+ #
33
+ # @return [PreludeSDK::Models::VerificationCreateParams::Options, nil]
34
+ optional :options, -> { PreludeSDK::VerificationCreateParams::Options }
35
+
36
+ # @!attribute signals
37
+ # The signals used for anti-fraud. For more details, refer to
38
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
39
+ #
40
+ # @return [PreludeSDK::Models::VerificationCreateParams::Signals, nil]
41
+ optional :signals, -> { PreludeSDK::VerificationCreateParams::Signals }
42
+
43
+ # @!method initialize(target:, dispatch_id: nil, metadata: nil, options: nil, signals: nil, request_options: {})
44
+ # Some parameter documentations has been truncated, see
45
+ # {PreludeSDK::Models::VerificationCreateParams} for more details.
46
+ #
47
+ # @param target [PreludeSDK::Models::VerificationCreateParams::Target] The verification target. Either a phone number or an email address. To use the e
48
+ #
49
+ # @param dispatch_id [String] The identifier of the dispatch that came from the front-end SDK.
50
+ #
51
+ # @param metadata [PreludeSDK::Models::VerificationCreateParams::Metadata] The metadata for this verification. This object will be returned with every resp
52
+ #
53
+ # @param options [PreludeSDK::Models::VerificationCreateParams::Options] Verification options
54
+ #
55
+ # @param signals [PreludeSDK::Models::VerificationCreateParams::Signals] The signals used for anti-fraud. For more details, refer to [Signals](/verify/v2
56
+ #
57
+ # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
58
+
59
+ class Target < PreludeSDK::Internal::Type::BaseModel
60
+ # @!attribute type
61
+ # The type of the target. Either "phone_number" or "email_address".
62
+ #
63
+ # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Target::Type]
64
+ required :type, enum: -> { PreludeSDK::VerificationCreateParams::Target::Type }
65
+
66
+ # @!attribute value
67
+ # An E.164 formatted phone number or an email address.
68
+ #
69
+ # @return [String]
70
+ required :value, String
71
+
72
+ # @!method initialize(type:, value:)
73
+ # The verification target. Either a phone number or an email address. To use the
74
+ # email verification feature contact us to discuss your use case.
75
+ #
76
+ # @param type [Symbol, PreludeSDK::Models::VerificationCreateParams::Target::Type] The type of the target. Either "phone_number" or "email_address".
77
+ #
78
+ # @param value [String] An E.164 formatted phone number or an email address.
79
+
80
+ # The type of the target. Either "phone_number" or "email_address".
81
+ #
82
+ # @see PreludeSDK::Models::VerificationCreateParams::Target#type
83
+ module Type
84
+ extend PreludeSDK::Internal::Type::Enum
85
+
86
+ PHONE_NUMBER = :phone_number
87
+ EMAIL_ADDRESS = :email_address
88
+
89
+ # @!method self.values
90
+ # @return [Array<Symbol>]
91
+ end
92
+ end
93
+
94
+ class Metadata < PreludeSDK::Internal::Type::BaseModel
95
+ # @!attribute correlation_id
96
+ # A user-defined identifier to correlate this verification with.
97
+ #
98
+ # @return [String, nil]
99
+ optional :correlation_id, String
100
+
101
+ # @!method initialize(correlation_id: nil)
102
+ # The metadata for this verification. This object will be returned with every
103
+ # response or webhook sent that refers to this verification.
104
+ #
105
+ # @param correlation_id [String] A user-defined identifier to correlate this verification with.
106
+ end
107
+
108
+ class Options < PreludeSDK::Internal::Type::BaseModel
109
+ # @!attribute app_realm
110
+ # This allows you to automatically retrieve and fill the OTP code on mobile apps.
111
+ # Currently only Android devices are supported.
112
+ #
113
+ # @return [PreludeSDK::Models::VerificationCreateParams::Options::AppRealm, nil]
114
+ optional :app_realm, -> { PreludeSDK::VerificationCreateParams::Options::AppRealm }
115
+
116
+ # @!attribute callback_url
117
+ # The URL where webhooks will be sent when verification events occur, including
118
+ # verification creation, attempt creation, and delivery status changes. For more
119
+ # details, refer to [Webhook](/verify/v2/documentation/webhook).
120
+ #
121
+ # @return [String, nil]
122
+ optional :callback_url, String
123
+
124
+ # @!attribute code_size
125
+ # The size of the code generated. It should be between 4 and 8. Defaults to the
126
+ # code size specified from the Dashboard.
127
+ #
128
+ # @return [Integer, nil]
129
+ optional :code_size, Integer
130
+
131
+ # @!attribute custom_code
132
+ # The custom code to use for OTP verification. To use the custom code feature,
133
+ # contact us to enable it for your account. For more details, refer to
134
+ # [Custom Code](/verify/v2/documentation/custom-codes).
135
+ #
136
+ # @return [String, nil]
137
+ optional :custom_code, String
138
+
139
+ # @!attribute locale
140
+ # A BCP-47 formatted locale string with the language the text message will be sent
141
+ # to. If there's no locale set, the language will be determined by the country
142
+ # code of the phone number. If the language specified doesn't exist, it defaults
143
+ # to US English.
144
+ #
145
+ # @return [String, nil]
146
+ optional :locale, String
147
+
148
+ # @!attribute method_
149
+ # The method used for verifying this phone number. The 'voice' option provides an
150
+ # accessible alternative for visually impaired users by delivering the
151
+ # verification code through a phone call rather than a text message. It also
152
+ # allows verification of landline numbers that cannot receive SMS messages.
153
+ #
154
+ # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Method, nil]
155
+ optional :method_,
156
+ enum: -> {
157
+ PreludeSDK::VerificationCreateParams::Options::Method
158
+ },
159
+ api_name: :method
160
+
161
+ # @!attribute preferred_channel
162
+ # The preferred channel to be used in priority for verification.
163
+ #
164
+ # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::PreferredChannel, nil]
165
+ optional :preferred_channel,
166
+ enum: -> {
167
+ PreludeSDK::VerificationCreateParams::Options::PreferredChannel
168
+ }
169
+
170
+ # @!attribute sender_id
171
+ # The Sender ID to use for this message. The Sender ID needs to be enabled by
172
+ # Prelude.
173
+ #
174
+ # @return [String, nil]
175
+ optional :sender_id, String
176
+
177
+ # @!attribute template_id
178
+ # The identifier of a verification template. It applies use case-specific
179
+ # settings, such as the message content or certain verification parameters.
180
+ #
181
+ # @return [String, nil]
182
+ optional :template_id, String
183
+
184
+ # @!attribute variables
185
+ # The variables to be replaced in the template.
186
+ #
187
+ # @return [Hash{Symbol=>String}, nil]
188
+ optional :variables, PreludeSDK::Internal::Type::HashOf[String]
189
+
190
+ # @!method initialize(app_realm: nil, callback_url: nil, code_size: nil, custom_code: nil, locale: nil, method_: nil, preferred_channel: nil, sender_id: nil, template_id: nil, variables: nil)
191
+ # Some parameter documentations has been truncated, see
192
+ # {PreludeSDK::Models::VerificationCreateParams::Options} for more details.
193
+ #
194
+ # Verification options
195
+ #
196
+ # @param app_realm [PreludeSDK::Models::VerificationCreateParams::Options::AppRealm] This allows you to automatically retrieve and fill the OTP code on mobile apps.
197
+ #
198
+ # @param callback_url [String] The URL where webhooks will be sent when verification events occur, including ve
199
+ #
200
+ # @param code_size [Integer] The size of the code generated. It should be between 4 and 8. Defaults to the co
201
+ #
202
+ # @param custom_code [String] The custom code to use for OTP verification. To use the custom code feature, con
203
+ #
204
+ # @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
205
+ #
206
+ # @param method_ [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Method] The method used for verifying this phone number. The 'voice' option provides an
207
+ #
208
+ # @param preferred_channel [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::PreferredChannel] The preferred channel to be used in priority for verification.
209
+ #
210
+ # @param sender_id [String] The Sender ID to use for this message. The Sender ID needs to be enabled by Prel
211
+ #
212
+ # @param template_id [String] The identifier of a verification template. It applies use case-specific settings
213
+ #
214
+ # @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
215
+
216
+ # @see PreludeSDK::Models::VerificationCreateParams::Options#app_realm
217
+ class AppRealm < PreludeSDK::Internal::Type::BaseModel
218
+ # @!attribute platform
219
+ # The platform the SMS will be sent to. We are currently only supporting
220
+ # "android".
221
+ #
222
+ # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::AppRealm::Platform]
223
+ required :platform, enum: -> { PreludeSDK::VerificationCreateParams::Options::AppRealm::Platform }
224
+
225
+ # @!attribute value
226
+ # The Android SMS Retriever API hash code that identifies your app.
227
+ #
228
+ # @return [String]
229
+ required :value, String
230
+
231
+ # @!method initialize(platform:, value:)
232
+ # Some parameter documentations has been truncated, see
233
+ # {PreludeSDK::Models::VerificationCreateParams::Options::AppRealm} for more
234
+ # details.
235
+ #
236
+ # This allows you to automatically retrieve and fill the OTP code on mobile apps.
237
+ # Currently only Android devices are supported.
238
+ #
239
+ # @param platform [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::AppRealm::Platform] The platform the SMS will be sent to. We are currently only supporting "android"
240
+ #
241
+ # @param value [String] The Android SMS Retriever API hash code that identifies your app.
242
+
243
+ # The platform the SMS will be sent to. We are currently only supporting
244
+ # "android".
245
+ #
246
+ # @see PreludeSDK::Models::VerificationCreateParams::Options::AppRealm#platform
247
+ module Platform
248
+ extend PreludeSDK::Internal::Type::Enum
249
+
250
+ ANDROID = :android
251
+
252
+ # @!method self.values
253
+ # @return [Array<Symbol>]
254
+ end
255
+ end
256
+
257
+ # The method used for verifying this phone number. The 'voice' option provides an
258
+ # accessible alternative for visually impaired users by delivering the
259
+ # verification code through a phone call rather than a text message. It also
260
+ # allows verification of landline numbers that cannot receive SMS messages.
261
+ #
262
+ # @see PreludeSDK::Models::VerificationCreateParams::Options#method_
263
+ module Method
264
+ extend PreludeSDK::Internal::Type::Enum
265
+
266
+ AUTO = :auto
267
+ VOICE = :voice
268
+
269
+ # @!method self.values
270
+ # @return [Array<Symbol>]
271
+ end
272
+
273
+ # The preferred channel to be used in priority for verification.
274
+ #
275
+ # @see PreludeSDK::Models::VerificationCreateParams::Options#preferred_channel
276
+ module PreferredChannel
277
+ extend PreludeSDK::Internal::Type::Enum
278
+
279
+ SMS = :sms
280
+ RCS = :rcs
281
+ WHATSAPP = :whatsapp
282
+ VIBER = :viber
283
+ ZALO = :zalo
284
+ TELEGRAM = :telegram
285
+ SILENT = :silent
286
+ VOICE = :voice
287
+
288
+ # @!method self.values
289
+ # @return [Array<Symbol>]
290
+ end
291
+ end
292
+
293
+ class Signals < PreludeSDK::Internal::Type::BaseModel
294
+ # @!attribute app_version
295
+ # The version of your application.
296
+ #
297
+ # @return [String, nil]
298
+ optional :app_version, String
299
+
300
+ # @!attribute device_id
301
+ # The unique identifier for the user's device. For Android, this corresponds to
302
+ # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
303
+ #
304
+ # @return [String, nil]
305
+ optional :device_id, String
306
+
307
+ # @!attribute device_model
308
+ # The model of the user's device.
309
+ #
310
+ # @return [String, nil]
311
+ optional :device_model, String
312
+
313
+ # @!attribute device_platform
314
+ # The type of the user's device.
315
+ #
316
+ # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Signals::DevicePlatform, nil]
317
+ optional :device_platform, enum: -> { PreludeSDK::VerificationCreateParams::Signals::DevicePlatform }
318
+
319
+ # @!attribute ip
320
+ # The IP address of the user's device.
321
+ #
322
+ # @return [String, nil]
323
+ optional :ip, String
324
+
325
+ # @!attribute is_trusted_user
326
+ # This signal should provide a higher level of trust, indicating that the user is
327
+ # genuine. Contact us to discuss your use case. For more details, refer to
328
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
329
+ #
330
+ # @return [Boolean, nil]
331
+ optional :is_trusted_user, PreludeSDK::Internal::Type::Boolean
332
+
333
+ # @!attribute os_version
334
+ # The version of the user's device operating system.
335
+ #
336
+ # @return [String, nil]
337
+ optional :os_version, String
338
+
339
+ # @!attribute user_agent
340
+ # The user agent of the user's device. If the individual fields (os_version,
341
+ # device_platform, device_model) are provided, we will prioritize those values
342
+ # instead of parsing them from the user agent string.
343
+ #
344
+ # @return [String, nil]
345
+ optional :user_agent, String
346
+
347
+ # @!method initialize(app_version: nil, device_id: nil, device_model: nil, device_platform: nil, ip: nil, is_trusted_user: nil, os_version: nil, user_agent: nil)
348
+ # Some parameter documentations has been truncated, see
349
+ # {PreludeSDK::Models::VerificationCreateParams::Signals} for more details.
350
+ #
351
+ # The signals used for anti-fraud. For more details, refer to
352
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
353
+ #
354
+ # @param app_version [String] The version of your application.
355
+ #
356
+ # @param device_id [String] The unique identifier for the user's device. For Android, this corresponds to th
357
+ #
358
+ # @param device_model [String] The model of the user's device.
359
+ #
360
+ # @param device_platform [Symbol, PreludeSDK::Models::VerificationCreateParams::Signals::DevicePlatform] The type of the user's device.
361
+ #
362
+ # @param ip [String] The IP address of the user's device.
363
+ #
364
+ # @param is_trusted_user [Boolean] This signal should provide a higher level of trust, indicating that the user is
365
+ #
366
+ # @param os_version [String] The version of the user's device operating system.
367
+ #
368
+ # @param user_agent [String] The user agent of the user's device. If the individual fields (os_version, devic
369
+
370
+ # The type of the user's device.
371
+ #
372
+ # @see PreludeSDK::Models::VerificationCreateParams::Signals#device_platform
373
+ module DevicePlatform
374
+ extend PreludeSDK::Internal::Type::Enum
375
+
376
+ ANDROID = :android
377
+ IOS = :ios
378
+ IPADOS = :ipados
379
+ TVOS = :tvos
380
+ WEB = :web
381
+
382
+ # @!method self.values
383
+ # @return [Array<Symbol>]
384
+ end
385
+ end
386
+ end
387
+ end
388
+ end
@@ -0,0 +1,148 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Verification#create
6
+ class VerificationCreateResponse < PreludeSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The verification identifier.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute method_
14
+ # The method used for verifying this phone number.
15
+ #
16
+ # @return [Symbol, PreludeSDK::Models::VerificationCreateResponse::Method]
17
+ required :method_, enum: -> { PreludeSDK::Models::VerificationCreateResponse::Method }, api_name: :method
18
+
19
+ # @!attribute status
20
+ # The status of the verification.
21
+ #
22
+ # @return [Symbol, PreludeSDK::Models::VerificationCreateResponse::Status]
23
+ required :status, enum: -> { PreludeSDK::Models::VerificationCreateResponse::Status }
24
+
25
+ # @!attribute channels
26
+ # The ordered sequence of channels to be used for verification
27
+ #
28
+ # @return [Array<String>, nil]
29
+ optional :channels, PreludeSDK::Internal::Type::ArrayOf[String]
30
+
31
+ # @!attribute metadata
32
+ # The metadata for this verification.
33
+ #
34
+ # @return [PreludeSDK::Models::VerificationCreateResponse::Metadata, nil]
35
+ optional :metadata, -> { PreludeSDK::Models::VerificationCreateResponse::Metadata }
36
+
37
+ # @!attribute reason
38
+ # The reason why the verification was blocked. Only present when status is
39
+ # "blocked".
40
+ #
41
+ # @return [Symbol, PreludeSDK::Models::VerificationCreateResponse::Reason, nil]
42
+ optional :reason, enum: -> { PreludeSDK::Models::VerificationCreateResponse::Reason }
43
+
44
+ # @!attribute request_id
45
+ #
46
+ # @return [String, nil]
47
+ optional :request_id, String
48
+
49
+ # @!attribute silent
50
+ # The silent verification specific properties.
51
+ #
52
+ # @return [PreludeSDK::Models::VerificationCreateResponse::Silent, nil]
53
+ optional :silent, -> { PreludeSDK::Models::VerificationCreateResponse::Silent }
54
+
55
+ # @!method initialize(id:, method_:, status:, channels: nil, metadata: nil, reason: nil, request_id: nil, silent: nil)
56
+ # Some parameter documentations has been truncated, see
57
+ # {PreludeSDK::Models::VerificationCreateResponse} for more details.
58
+ #
59
+ # @param id [String] The verification identifier.
60
+ #
61
+ # @param method_ [Symbol, PreludeSDK::Models::VerificationCreateResponse::Method] The method used for verifying this phone number.
62
+ #
63
+ # @param status [Symbol, PreludeSDK::Models::VerificationCreateResponse::Status] The status of the verification.
64
+ #
65
+ # @param channels [Array<String>] The ordered sequence of channels to be used for verification
66
+ #
67
+ # @param metadata [PreludeSDK::Models::VerificationCreateResponse::Metadata] The metadata for this verification.
68
+ #
69
+ # @param reason [Symbol, PreludeSDK::Models::VerificationCreateResponse::Reason] The reason why the verification was blocked. Only present when status is "blocke
70
+ #
71
+ # @param request_id [String]
72
+ #
73
+ # @param silent [PreludeSDK::Models::VerificationCreateResponse::Silent] The silent verification specific properties.
74
+
75
+ # The method used for verifying this phone number.
76
+ #
77
+ # @see PreludeSDK::Models::VerificationCreateResponse#method_
78
+ module Method
79
+ extend PreludeSDK::Internal::Type::Enum
80
+
81
+ MESSAGE = :message
82
+ SILENT = :silent
83
+ VOICE = :voice
84
+
85
+ # @!method self.values
86
+ # @return [Array<Symbol>]
87
+ end
88
+
89
+ # The status of the verification.
90
+ #
91
+ # @see PreludeSDK::Models::VerificationCreateResponse#status
92
+ module Status
93
+ extend PreludeSDK::Internal::Type::Enum
94
+
95
+ SUCCESS = :success
96
+ RETRY = :retry
97
+ BLOCKED = :blocked
98
+
99
+ # @!method self.values
100
+ # @return [Array<Symbol>]
101
+ end
102
+
103
+ # @see PreludeSDK::Models::VerificationCreateResponse#metadata
104
+ class Metadata < PreludeSDK::Internal::Type::BaseModel
105
+ # @!attribute correlation_id
106
+ #
107
+ # @return [String, nil]
108
+ optional :correlation_id, String
109
+
110
+ # @!method initialize(correlation_id: nil)
111
+ # The metadata for this verification.
112
+ #
113
+ # @param correlation_id [String]
114
+ end
115
+
116
+ # The reason why the verification was blocked. Only present when status is
117
+ # "blocked".
118
+ #
119
+ # @see PreludeSDK::Models::VerificationCreateResponse#reason
120
+ module Reason
121
+ extend PreludeSDK::Internal::Type::Enum
122
+
123
+ SUSPICIOUS = :suspicious
124
+ REPEATED_ATTEMPTS = :repeated_attempts
125
+ INVALID_PHONE_LINE = :invalid_phone_line
126
+ INVALID_PHONE_NUMBER = :invalid_phone_number
127
+ IN_BLOCK_LIST = :in_block_list
128
+
129
+ # @!method self.values
130
+ # @return [Array<Symbol>]
131
+ end
132
+
133
+ # @see PreludeSDK::Models::VerificationCreateResponse#silent
134
+ class Silent < PreludeSDK::Internal::Type::BaseModel
135
+ # @!attribute request_url
136
+ # The URL to start the silent verification towards.
137
+ #
138
+ # @return [String]
139
+ required :request_url, String
140
+
141
+ # @!method initialize(request_url:)
142
+ # The silent verification specific properties.
143
+ #
144
+ # @param request_url [String] The URL to start the silent verification towards.
145
+ end
146
+ end
147
+ end
148
+ end