prelude-sdk 0.7.0 → 0.8.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 (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +3 -5
  4. data/lib/prelude_sdk/client.rb +4 -0
  5. data/lib/prelude_sdk/internal/type/base_model.rb +5 -5
  6. data/lib/prelude_sdk/models/intel/kyc_match_params.rb +96 -0
  7. data/lib/prelude_sdk/models/intel/kyc_match_response.rb +305 -0
  8. data/lib/prelude_sdk/models/notify_reply_params.rb +60 -0
  9. data/lib/prelude_sdk/models/notify_reply_response.rb +65 -0
  10. data/lib/prelude_sdk/models/signals.rb +125 -0
  11. data/lib/prelude_sdk/models/target.rb +39 -0
  12. data/lib/prelude_sdk/models/verification/phone/history_list_params.rb +177 -0
  13. data/lib/prelude_sdk/models/verification/phone/history_list_response.rb +286 -0
  14. data/lib/prelude_sdk/models/verification/phone/history_retrieve_params.rb +24 -0
  15. data/lib/prelude_sdk/models/verification/phone/history_retrieve_response.rb +890 -0
  16. data/lib/prelude_sdk/models/verification/phone/phone_verification_carrier.rb +29 -0
  17. data/lib/prelude_sdk/models/verification/phone/phone_verification_money.rb +35 -0
  18. data/lib/prelude_sdk/models/verification/phone/phone_verification_psd2_transaction.rb +29 -0
  19. data/lib/prelude_sdk/models/verification_check_params.rb +3 -38
  20. data/lib/prelude_sdk/models/verification_create_params.rb +6 -161
  21. data/lib/prelude_sdk/models/verification_management/sandbox_add_phone_number_params.rb +37 -0
  22. data/lib/prelude_sdk/models/verification_management/sandbox_add_phone_number_response.rb +27 -0
  23. data/lib/prelude_sdk/models/verification_management/sandbox_delete_phone_number_params.rb +22 -0
  24. data/lib/prelude_sdk/models/verification_management/sandbox_delete_phone_number_response.rb +19 -0
  25. data/lib/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_params.rb +16 -0
  26. data/lib/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_response.rb +47 -0
  27. data/lib/prelude_sdk/models/watch_evaluate_params.rb +68 -0
  28. data/lib/prelude_sdk/models/watch_evaluate_response.rb +266 -0
  29. data/lib/prelude_sdk/models/watch_predict_params.rb +6 -160
  30. data/lib/prelude_sdk/models/watch_send_events_params.rb +3 -38
  31. data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +3 -38
  32. data/lib/prelude_sdk/models.rb +14 -0
  33. data/lib/prelude_sdk/resources/intel/kyc.rb +62 -0
  34. data/lib/prelude_sdk/resources/intel.rb +20 -0
  35. data/lib/prelude_sdk/resources/notify.rb +35 -0
  36. data/lib/prelude_sdk/resources/verification/phone/history.rb +104 -0
  37. data/lib/prelude_sdk/resources/verification/phone.rb +21 -0
  38. data/lib/prelude_sdk/resources/verification.rb +7 -3
  39. data/lib/prelude_sdk/resources/verification_management/sandbox.rb +99 -0
  40. data/lib/prelude_sdk/resources/verification_management.rb +5 -0
  41. data/lib/prelude_sdk/resources/watch.rb +45 -2
  42. data/lib/prelude_sdk/version.rb +1 -1
  43. data/lib/prelude_sdk.rb +26 -0
  44. data/rbi/prelude_sdk/client.rbi +3 -0
  45. data/rbi/prelude_sdk/models/intel/kyc_match_params.rbi +147 -0
  46. data/rbi/prelude_sdk/models/intel/kyc_match_response.rbi +736 -0
  47. data/rbi/prelude_sdk/models/notify_reply_params.rbi +87 -0
  48. data/rbi/prelude_sdk/models/notify_reply_response.rbi +94 -0
  49. data/rbi/prelude_sdk/models/signals.rbi +200 -0
  50. data/rbi/prelude_sdk/models/target.rbi +61 -0
  51. data/rbi/prelude_sdk/models/verification/phone/history_list_params.rbi +436 -0
  52. data/rbi/prelude_sdk/models/verification/phone/history_list_response.rbi +661 -0
  53. data/rbi/prelude_sdk/models/verification/phone/history_retrieve_params.rbi +42 -0
  54. data/rbi/prelude_sdk/models/verification/phone/history_retrieve_response.rbi +2229 -0
  55. data/rbi/prelude_sdk/models/verification/phone/phone_verification_carrier.rbi +39 -0
  56. data/rbi/prelude_sdk/models/verification/phone/phone_verification_money.rbi +46 -0
  57. data/rbi/prelude_sdk/models/verification/phone/phone_verification_psd2_transaction.rbi +68 -0
  58. data/rbi/prelude_sdk/models/verification_check_params.rbi +4 -85
  59. data/rbi/prelude_sdk/models/verification_create_params.rbi +8 -328
  60. data/rbi/prelude_sdk/models/verification_management/sandbox_add_phone_number_params.rbi +58 -0
  61. data/rbi/prelude_sdk/models/verification_management/sandbox_add_phone_number_response.rbi +42 -0
  62. data/rbi/prelude_sdk/models/verification_management/sandbox_delete_phone_number_params.rbi +43 -0
  63. data/rbi/prelude_sdk/models/verification_management/sandbox_delete_phone_number_response.rbi +32 -0
  64. data/rbi/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_params.rbi +34 -0
  65. data/rbi/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_response.rbi +101 -0
  66. data/rbi/prelude_sdk/models/watch_evaluate_params.rbi +109 -0
  67. data/rbi/prelude_sdk/models/watch_evaluate_response.rbi +496 -0
  68. data/rbi/prelude_sdk/models/watch_predict_params.rbi +8 -320
  69. data/rbi/prelude_sdk/models/watch_send_events_params.rbi +4 -93
  70. data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +4 -95
  71. data/rbi/prelude_sdk/models.rbi +14 -0
  72. data/rbi/prelude_sdk/resources/intel/kyc.rbi +61 -0
  73. data/rbi/prelude_sdk/resources/intel.rbi +17 -0
  74. data/rbi/prelude_sdk/resources/notify.rbi +31 -0
  75. data/rbi/prelude_sdk/resources/verification/phone/history.rbi +112 -0
  76. data/rbi/prelude_sdk/resources/verification/phone.rbi +18 -0
  77. data/rbi/prelude_sdk/resources/verification.rbi +6 -3
  78. data/rbi/prelude_sdk/resources/verification_management/sandbox.rbi +76 -0
  79. data/rbi/prelude_sdk/resources/verification_management.rbi +4 -0
  80. data/rbi/prelude_sdk/resources/watch.rbi +49 -2
  81. data/sig/prelude_sdk/client.rbs +2 -0
  82. data/sig/prelude_sdk/models/intel/kyc_match_params.rbs +91 -0
  83. data/sig/prelude_sdk/models/intel/kyc_match_response.rbs +276 -0
  84. data/sig/prelude_sdk/models/notify_reply_params.rbs +50 -0
  85. data/sig/prelude_sdk/models/notify_reply_response.rbs +54 -0
  86. data/sig/prelude_sdk/models/signals.rbs +101 -0
  87. data/sig/prelude_sdk/models/target.rbs +29 -0
  88. data/sig/prelude_sdk/models/verification/phone/history_list_params.rbs +187 -0
  89. data/sig/prelude_sdk/models/verification/phone/history_list_response.rbs +241 -0
  90. data/sig/prelude_sdk/models/verification/phone/history_retrieve_params.rbs +27 -0
  91. data/sig/prelude_sdk/models/verification/phone/history_retrieve_response.rbs +873 -0
  92. data/sig/prelude_sdk/models/verification/phone/phone_verification_carrier.rbs +23 -0
  93. data/sig/prelude_sdk/models/verification/phone/phone_verification_money.rbs +21 -0
  94. data/sig/prelude_sdk/models/verification/phone/phone_verification_psd2_transaction.rbs +37 -0
  95. data/sig/prelude_sdk/models/verification_check_params.rbs +4 -37
  96. data/sig/prelude_sdk/models/verification_create_params.rbs +9 -142
  97. data/sig/prelude_sdk/models/verification_management/sandbox_add_phone_number_params.rbs +30 -0
  98. data/sig/prelude_sdk/models/verification_management/sandbox_add_phone_number_response.rbs +18 -0
  99. data/sig/prelude_sdk/models/verification_management/sandbox_delete_phone_number_params.rbs +26 -0
  100. data/sig/prelude_sdk/models/verification_management/sandbox_delete_phone_number_response.rbs +15 -0
  101. data/sig/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_params.rbs +17 -0
  102. data/sig/prelude_sdk/models/verification_management/sandbox_list_phone_numbers_response.rbs +45 -0
  103. data/sig/prelude_sdk/models/watch_evaluate_params.rbs +52 -0
  104. data/sig/prelude_sdk/models/watch_evaluate_response.rbs +178 -0
  105. data/sig/prelude_sdk/models/watch_predict_params.rbs +9 -142
  106. data/sig/prelude_sdk/models/watch_send_events_params.rbs +4 -37
  107. data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +4 -37
  108. data/sig/prelude_sdk/models.rbs +14 -0
  109. data/sig/prelude_sdk/resources/intel/kyc.rbs +23 -0
  110. data/sig/prelude_sdk/resources/intel.rbs +9 -0
  111. data/sig/prelude_sdk/resources/notify.rbs +9 -0
  112. data/sig/prelude_sdk/resources/verification/phone/history.rbs +32 -0
  113. data/sig/prelude_sdk/resources/verification/phone.rbs +11 -0
  114. data/sig/prelude_sdk/resources/verification.rbs +5 -3
  115. data/sig/prelude_sdk/resources/verification_management/sandbox.rbs +24 -0
  116. data/sig/prelude_sdk/resources/verification_management.rbs +2 -0
  117. data/sig/prelude_sdk/resources/watch.rbs +11 -2
  118. metadata +79 -1
@@ -0,0 +1,125 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ class Signals < PreludeSDK::Internal::Type::BaseModel
6
+ # @!attribute app_version
7
+ # The version of your application.
8
+ #
9
+ # @return [String, nil]
10
+ optional :app_version, String
11
+
12
+ # @!attribute device_id
13
+ # A unique ID for the user's device. You should ensure that each user device has a
14
+ # unique `device_id` value. Ideally, for Android, this corresponds to the
15
+ # `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
16
+ #
17
+ # @return [String, nil]
18
+ optional :device_id, String
19
+
20
+ # @!attribute device_model
21
+ # The model of the user's device.
22
+ #
23
+ # @return [String, nil]
24
+ optional :device_model, String
25
+
26
+ # @!attribute device_platform
27
+ # The type of the user's device.
28
+ #
29
+ # @return [Symbol, PreludeSDK::Models::Signals::DevicePlatform, nil]
30
+ optional :device_platform, enum: -> { PreludeSDK::Signals::DevicePlatform }
31
+
32
+ # @!attribute existing_user
33
+ # Whether the end-user already exists in your system, for example an existing
34
+ # account signing in again rather than a first-time signup. Unlike
35
+ # `is_trusted_user`, this signal does not bypass fraud checks; it is taken into
36
+ # account as one additional anti-fraud signal. For more details, refer to
37
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
38
+ #
39
+ # @return [Boolean, nil]
40
+ optional :existing_user, PreludeSDK::Internal::Type::Boolean
41
+
42
+ # @!attribute ip
43
+ # The public IP v4 or v6 address of the end-user's device. You should collect this
44
+ # from your backend. If your backend is behind a proxy, use the `X-Forwarded-For`,
45
+ # `Forwarded`, `True-Client-IP`, `CF-Connecting-IP` or an equivalent header to get
46
+ # the actual public IP of the end-user's device.
47
+ #
48
+ # @return [String, nil]
49
+ optional :ip, String
50
+
51
+ # @!attribute is_trusted_user
52
+ # This signal should indicate a higher level of trust, explicitly stating that the
53
+ # user is genuine. Contact us to discuss your use case. For more details, refer to
54
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
55
+ #
56
+ # @return [Boolean, nil]
57
+ optional :is_trusted_user, PreludeSDK::Internal::Type::Boolean
58
+
59
+ # @!attribute ja4_fingerprint
60
+ # The JA4 fingerprint observed for the end-user's connection. Prelude will infer
61
+ # it automatically when you use our Frontend SDKs (which use Prelude's edge
62
+ # network), but you can also forward the value if you terminate TLS yourself.
63
+ #
64
+ # @return [String, nil]
65
+ optional :ja4_fingerprint, String
66
+
67
+ # @!attribute os_version
68
+ # The version of the user's device operating system.
69
+ #
70
+ # @return [String, nil]
71
+ optional :os_version, String
72
+
73
+ # @!attribute user_agent
74
+ # The user agent of the user's device. If the individual fields (os_version,
75
+ # device_platform, device_model) are provided, we will prioritize those values
76
+ # instead of parsing them from the user agent string.
77
+ #
78
+ # @return [String, nil]
79
+ optional :user_agent, String
80
+
81
+ # @!method initialize(app_version: nil, device_id: nil, device_model: nil, device_platform: nil, existing_user: nil, ip: nil, is_trusted_user: nil, ja4_fingerprint: nil, os_version: nil, user_agent: nil)
82
+ # Some parameter documentations has been truncated, see
83
+ # {PreludeSDK::Models::Signals} for more details.
84
+ #
85
+ # The signals used for anti-fraud. For more details, refer to
86
+ # [Signals](/verify/v2/documentation/prevent-fraud#signals).
87
+ #
88
+ # @param app_version [String] The version of your application.
89
+ #
90
+ # @param device_id [String] A unique ID for the user's device. You should ensure that each user device has a
91
+ #
92
+ # @param device_model [String] The model of the user's device.
93
+ #
94
+ # @param device_platform [Symbol, PreludeSDK::Models::Signals::DevicePlatform] The type of the user's device.
95
+ #
96
+ # @param existing_user [Boolean] Whether the end-user already exists in your system, for example an existing acco
97
+ #
98
+ # @param ip [String] The public IP v4 or v6 address of the end-user's device. You should collect this
99
+ #
100
+ # @param is_trusted_user [Boolean] This signal should indicate a higher level of trust, explicitly stating that the
101
+ #
102
+ # @param ja4_fingerprint [String] The JA4 fingerprint observed for the end-user's connection. Prelude will infer i
103
+ #
104
+ # @param os_version [String] The version of the user's device operating system.
105
+ #
106
+ # @param user_agent [String] The user agent of the user's device. If the individual fields (os_version, devic
107
+
108
+ # The type of the user's device.
109
+ #
110
+ # @see PreludeSDK::Models::Signals#device_platform
111
+ module DevicePlatform
112
+ extend PreludeSDK::Internal::Type::Enum
113
+
114
+ ANDROID = :android
115
+ IOS = :ios
116
+ IPADOS = :ipados
117
+ TVOS = :tvos
118
+ WEB = :web
119
+
120
+ # @!method self.values
121
+ # @return [Array<Symbol>]
122
+ end
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ class Target < PreludeSDK::Internal::Type::BaseModel
6
+ # @!attribute type
7
+ # The type of the target. Either "phone_number" or "email_address".
8
+ #
9
+ # @return [Symbol, PreludeSDK::Models::Target::Type]
10
+ required :type, enum: -> { PreludeSDK::Target::Type }
11
+
12
+ # @!attribute value
13
+ # An E.164 formatted phone number or an email address.
14
+ #
15
+ # @return [String]
16
+ required :value, String
17
+
18
+ # @!method initialize(type:, value:)
19
+ # The operation target. Either a phone number or an email address.
20
+ #
21
+ # @param type [Symbol, PreludeSDK::Models::Target::Type] The type of the target. Either "phone_number" or "email_address".
22
+ #
23
+ # @param value [String] An E.164 formatted phone number or an email address.
24
+
25
+ # The type of the target. Either "phone_number" or "email_address".
26
+ #
27
+ # @see PreludeSDK::Models::Target#type
28
+ module Type
29
+ extend PreludeSDK::Internal::Type::Enum
30
+
31
+ PHONE_NUMBER = :phone_number
32
+ EMAIL_ADDRESS = :email_address
33
+
34
+ # @!method self.values
35
+ # @return [Array<Symbol>]
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,177 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ module Verification
6
+ module Phone
7
+ # @see PreludeSDK::Resources::Verification::Phone::History#list
8
+ class HistoryListParams < PreludeSDK::Internal::Type::BaseModel
9
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
10
+ include PreludeSDK::Internal::Type::RequestParameters
11
+
12
+ # @!attribute channels
13
+ # Only verifications that could use one of these channels. Repeat the parameter
14
+ # for several values.
15
+ #
16
+ # @return [Array<Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::Channel>, nil]
17
+ optional :channels,
18
+ -> { PreludeSDK::Internal::Type::ArrayOf[enum: PreludeSDK::Verification::Phone::HistoryListParams::Channel] }
19
+
20
+ # @!attribute cursor
21
+ # Pagination cursor from the previous response.
22
+ #
23
+ # @return [String, nil]
24
+ optional :cursor, String
25
+
26
+ # @!attribute device_platform
27
+ # Only verifications created from this device platform.
28
+ #
29
+ # @return [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::DevicePlatform, nil]
30
+ optional :device_platform, enum: -> { PreludeSDK::Verification::Phone::HistoryListParams::DevicePlatform }
31
+
32
+ # @!attribute from
33
+ # Only verifications created at or after this RFC 3339 timestamp. Goes with `to`,
34
+ # at most 6 months apart. Without them the whole history is searched.
35
+ #
36
+ # @return [Time, nil]
37
+ optional :from, Time
38
+
39
+ # @!attribute limit
40
+ # Maximum number of verifications to return per page.
41
+ #
42
+ # @return [Integer, nil]
43
+ optional :limit, Integer
44
+
45
+ # @!attribute max_attempts
46
+ # Only verifications that sent at most this many messages. `0` keeps the
47
+ # verifications that never sent one.
48
+ #
49
+ # @return [Integer, nil]
50
+ optional :max_attempts, Integer
51
+
52
+ # @!attribute min_attempts
53
+ # Only verifications that sent at least this many messages.
54
+ #
55
+ # @return [Integer, nil]
56
+ optional :min_attempts, Integer
57
+
58
+ # @!attribute phone_number
59
+ # Only verifications targeting this E.164 phone number. The leading `+` may be
60
+ # omitted.
61
+ #
62
+ # @return [String, nil]
63
+ optional :phone_number, String
64
+
65
+ # @!attribute region
66
+ # Only verifications of phone numbers from this region, as an ISO 3166-1 alpha-2
67
+ # code.
68
+ #
69
+ # @return [String, nil]
70
+ optional :region, String
71
+
72
+ # @!attribute status
73
+ # Only verifications in this status. `pending_check` cannot be filtered on.
74
+ #
75
+ # @return [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::Status, nil]
76
+ optional :status, enum: -> { PreludeSDK::Verification::Phone::HistoryListParams::Status }
77
+
78
+ # @!attribute template_id
79
+ # Only verifications sent with this template, as returned in `template_id` by
80
+ # [Get a phone verification](/verify/v2/api-reference/history/get-a-phone-verification).
81
+ # Built-in templates (`prelude:*`) cannot be filtered on.
82
+ #
83
+ # @return [String, nil]
84
+ optional :template_id, String
85
+
86
+ # @!attribute to
87
+ # Only verifications created at or before this RFC 3339 timestamp. Goes with
88
+ # `from`.
89
+ #
90
+ # @return [Time, nil]
91
+ optional :to, Time
92
+
93
+ # @!method initialize(channels: nil, cursor: nil, device_platform: nil, from: nil, limit: nil, max_attempts: nil, min_attempts: nil, phone_number: nil, region: nil, status: nil, template_id: nil, to: nil, request_options: {})
94
+ # Some parameter documentations has been truncated, see
95
+ # {PreludeSDK::Models::Verification::Phone::HistoryListParams} for more details.
96
+ #
97
+ # @param channels [Array<Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::Channel>] Only verifications that could use one of these channels. Repeat the parameter fo
98
+ #
99
+ # @param cursor [String] Pagination cursor from the previous response.
100
+ #
101
+ # @param device_platform [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::DevicePlatform] Only verifications created from this device platform.
102
+ #
103
+ # @param from [Time] Only verifications created at or after this RFC 3339 timestamp. Goes with `to`,
104
+ #
105
+ # @param limit [Integer] Maximum number of verifications to return per page.
106
+ #
107
+ # @param max_attempts [Integer] Only verifications that sent at most this many messages. `0` keeps the verificat
108
+ #
109
+ # @param min_attempts [Integer] Only verifications that sent at least this many messages.
110
+ #
111
+ # @param phone_number [String] Only verifications targeting this E.164 phone number. The leading `+` may be omi
112
+ #
113
+ # @param region [String] Only verifications of phone numbers from this region, as an ISO 3166-1 alpha-2 c
114
+ #
115
+ # @param status [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::Status] Only verifications in this status. `pending_check` cannot be filtered on.
116
+ #
117
+ # @param template_id [String] Only verifications sent with this template, as returned in `template_id` by [Get
118
+ #
119
+ # @param to [Time] Only verifications created at or before this RFC 3339 timestamp. Goes with `from
120
+ #
121
+ # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
122
+
123
+ module Channel
124
+ extend PreludeSDK::Internal::Type::Enum
125
+
126
+ SMS = :sms
127
+ RCS = :rcs
128
+ WHATSAPP = :whatsapp
129
+ VIBER = :viber
130
+ ZALO = :zalo
131
+ TELEGRAM = :telegram
132
+ VOICE = :voice
133
+ SILENT = :silent
134
+
135
+ # @!method self.values
136
+ # @return [Array<Symbol>]
137
+ end
138
+
139
+ # Only verifications created from this device platform.
140
+ module DevicePlatform
141
+ extend PreludeSDK::Internal::Type::Enum
142
+
143
+ ANDROID = :android
144
+ IOS = :ios
145
+ IPADOS = :ipados
146
+ TVOS = :tvos
147
+ WEB = :web
148
+
149
+ # @!method self.values
150
+ # @return [Array<Symbol>]
151
+ end
152
+
153
+ # Only verifications in this status. `pending_check` cannot be filtered on.
154
+ module Status
155
+ extend PreludeSDK::Internal::Type::Enum
156
+
157
+ CONVERTED = :converted
158
+ NOT_CONVERTED = :not_converted
159
+ PENDING_CHECK = :pending_check
160
+ SENT = :sent
161
+ CHALLENGED = :challenged
162
+ SUSPECTED_FRAUD = :suspected_fraud
163
+ IN_BLOCKLIST = :in_blocklist
164
+ INVALID_LINE = :invalid_line
165
+ INVALID_NUMBER = :invalid_number
166
+ RATE_LIMITED = :rate_limited
167
+ EXPIRED_SIGNALS = :expired_signals
168
+ SHADOWED = :shadowed
169
+
170
+ # @!method self.values
171
+ # @return [Array<Symbol>]
172
+ end
173
+ end
174
+ end
175
+ end
176
+ end
177
+ end
@@ -0,0 +1,286 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ module Verification
6
+ module Phone
7
+ # @see PreludeSDK::Resources::Verification::Phone::History#list
8
+ class HistoryListResponse < PreludeSDK::Internal::Type::BaseModel
9
+ # @!attribute verifications
10
+ # The page of verifications, most recent first.
11
+ #
12
+ # @return [Array<PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification>]
13
+ required :verifications,
14
+ -> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification] }
15
+
16
+ # @!attribute next_cursor
17
+ # Pagination cursor for the next page of results. Omitted if there are no more
18
+ # pages.
19
+ #
20
+ # @return [String, nil]
21
+ optional :next_cursor, String
22
+
23
+ # @!method initialize(verifications:, next_cursor: nil)
24
+ # Some parameter documentations has been truncated, see
25
+ # {PreludeSDK::Models::Verification::Phone::HistoryListResponse} for more details.
26
+ #
27
+ # @param verifications [Array<PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification>] The page of verifications, most recent first.
28
+ #
29
+ # @param next_cursor [String] Pagination cursor for the next page of results. Omitted if there are no more pag
30
+
31
+ class Verification < PreludeSDK::Internal::Type::BaseModel
32
+ # @!attribute id
33
+ # The verification identifier.
34
+ #
35
+ # @return [String]
36
+ required :id, String
37
+
38
+ # @!attribute channels
39
+ # The channels the verification could use, and which one the end user converted
40
+ # through. Empty when the verification used only channels this API does not list.
41
+ #
42
+ # @return [Array<PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Channel>]
43
+ required :channels,
44
+ -> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Channel] }
45
+
46
+ # @!attribute created_at
47
+ #
48
+ # @return [Time]
49
+ required :created_at, Time
50
+
51
+ # @!attribute delivered
52
+ # Whether at least one message was reported delivered.
53
+ #
54
+ # @return [Boolean]
55
+ required :delivered, PreludeSDK::Internal::Type::Boolean
56
+
57
+ # @!attribute phone_number
58
+ # The E.164 phone number the verification targeted.
59
+ #
60
+ # @return [String]
61
+ required :phone_number, String
62
+
63
+ # @!attribute status
64
+ # The outcome of the verification.
65
+ #
66
+ # - `converted` - The end user submitted a valid code.
67
+ # - `not_converted` - The verification expired without a valid code.
68
+ # - `pending_check` - A code was delivered and Prelude is still waiting for a
69
+ # check.
70
+ # - `sent` - A code was sent and the verification window is still open.
71
+ # - `challenged` - The verification was restricted to non-SMS and non-voice
72
+ # channels.
73
+ # - `suspected_fraud` - The anti-fraud system blocked the verification.
74
+ # - `in_blocklist` - The phone number is on the configured block list.
75
+ # - `invalid_line` - The phone number is not a valid line type.
76
+ # - `invalid_number` - The phone number is not a valid number.
77
+ # - `rate_limited` - The verification was refused by a rate limit.
78
+ # - `expired_signals` - The SDK signals were collected too long before the
79
+ # request.
80
+ # - `shadowed` - The anti-fraud system flagged the verification without blocking
81
+ # it.
82
+ #
83
+ # @return [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Status]
84
+ required :status,
85
+ enum: -> { PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Status }
86
+
87
+ # @!attribute attempts
88
+ # Number of messages sent for the verification, `0` when none was. Absent for
89
+ # sandboxed phone numbers.
90
+ #
91
+ # @return [Integer, nil]
92
+ optional :attempts, Integer
93
+
94
+ # @!attribute converted_at
95
+ # When the end user submitted a valid code. Absent unless the verification
96
+ # converted.
97
+ #
98
+ # @return [Time, nil]
99
+ optional :converted_at, Time
100
+
101
+ # @!attribute cost
102
+ # Total cost of the verification. Absent when nothing was billed.
103
+ #
104
+ # @return [PreludeSDK::Models::Verification::Phone::PhoneVerificationMoney, nil]
105
+ optional :cost, -> { PreludeSDK::Verification::Phone::PhoneVerificationMoney }
106
+
107
+ # @!attribute device_platform
108
+ # Platform of the end-user device, when known.
109
+ #
110
+ # @return [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::DevicePlatform, nil]
111
+ optional :device_platform,
112
+ enum: -> { PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::DevicePlatform }
113
+
114
+ # @!attribute phone_number_condition
115
+ # Whether the phone number was allow-listed, block-listed, or sandboxed at
116
+ # verification time.
117
+ #
118
+ # @return [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::PhoneNumberCondition, nil]
119
+ optional :phone_number_condition,
120
+ enum: -> { PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::PhoneNumberCondition }
121
+
122
+ # @!attribute signals_hash_status
123
+ # Whether the SDK signals integrity check passed.
124
+ #
125
+ # @return [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::SignalsHashStatus, nil]
126
+ optional :signals_hash_status,
127
+ enum: -> { PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::SignalsHashStatus }
128
+
129
+ # @!method initialize(id:, channels:, created_at:, delivered:, phone_number:, status:, attempts: nil, converted_at: nil, cost: nil, device_platform: nil, phone_number_condition: nil, signals_hash_status: nil)
130
+ # Some parameter documentations has been truncated, see
131
+ # {PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification} for
132
+ # more details.
133
+ #
134
+ # One entry of the verification history.
135
+ # [Get a phone verification](/verify/v2/api-reference/history/get-a-phone-verification)
136
+ # returns the full record.
137
+ #
138
+ # @param id [String] The verification identifier.
139
+ #
140
+ # @param channels [Array<PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Channel>] The channels the verification could use, and which one the end user converted th
141
+ #
142
+ # @param created_at [Time]
143
+ #
144
+ # @param delivered [Boolean] Whether at least one message was reported delivered.
145
+ #
146
+ # @param phone_number [String] The E.164 phone number the verification targeted.
147
+ #
148
+ # @param status [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Status] The outcome of the verification.
149
+ #
150
+ # @param attempts [Integer] Number of messages sent for the verification, `0` when none was. Absent for sand
151
+ #
152
+ # @param converted_at [Time] When the end user submitted a valid code. Absent unless the verification convert
153
+ #
154
+ # @param cost [PreludeSDK::Models::Verification::Phone::PhoneVerificationMoney] Total cost of the verification. Absent when nothing was billed.
155
+ #
156
+ # @param device_platform [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::DevicePlatform] Platform of the end-user device, when known.
157
+ #
158
+ # @param phone_number_condition [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::PhoneNumberCondition] Whether the phone number was allow-listed, block-listed, or sandboxed at verific
159
+ #
160
+ # @param signals_hash_status [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::SignalsHashStatus] Whether the SDK signals integrity check passed.
161
+
162
+ class Channel < PreludeSDK::Internal::Type::BaseModel
163
+ # @!attribute channel
164
+ #
165
+ # @return [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Channel::Channel]
166
+ required :channel,
167
+ enum: -> { PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Channel::Channel }
168
+
169
+ # @!attribute converted
170
+ # Whether the end user submitted a valid code received through this channel.
171
+ #
172
+ # @return [Boolean]
173
+ required :converted, PreludeSDK::Internal::Type::Boolean
174
+
175
+ # @!method initialize(channel:, converted:)
176
+ # @param channel [Symbol, PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Channel::Channel]
177
+ #
178
+ # @param converted [Boolean] Whether the end user submitted a valid code received through this channel.
179
+
180
+ # @see PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification::Channel#channel
181
+ module Channel
182
+ extend PreludeSDK::Internal::Type::Enum
183
+
184
+ SMS = :sms
185
+ RCS = :rcs
186
+ WHATSAPP = :whatsapp
187
+ VIBER = :viber
188
+ ZALO = :zalo
189
+ TELEGRAM = :telegram
190
+ VOICE = :voice
191
+ SILENT = :silent
192
+
193
+ # @!method self.values
194
+ # @return [Array<Symbol>]
195
+ end
196
+ end
197
+
198
+ # The outcome of the verification.
199
+ #
200
+ # - `converted` - The end user submitted a valid code.
201
+ # - `not_converted` - The verification expired without a valid code.
202
+ # - `pending_check` - A code was delivered and Prelude is still waiting for a
203
+ # check.
204
+ # - `sent` - A code was sent and the verification window is still open.
205
+ # - `challenged` - The verification was restricted to non-SMS and non-voice
206
+ # channels.
207
+ # - `suspected_fraud` - The anti-fraud system blocked the verification.
208
+ # - `in_blocklist` - The phone number is on the configured block list.
209
+ # - `invalid_line` - The phone number is not a valid line type.
210
+ # - `invalid_number` - The phone number is not a valid number.
211
+ # - `rate_limited` - The verification was refused by a rate limit.
212
+ # - `expired_signals` - The SDK signals were collected too long before the
213
+ # request.
214
+ # - `shadowed` - The anti-fraud system flagged the verification without blocking
215
+ # it.
216
+ #
217
+ # @see PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification#status
218
+ module Status
219
+ extend PreludeSDK::Internal::Type::Enum
220
+
221
+ CONVERTED = :converted
222
+ NOT_CONVERTED = :not_converted
223
+ PENDING_CHECK = :pending_check
224
+ SENT = :sent
225
+ CHALLENGED = :challenged
226
+ SUSPECTED_FRAUD = :suspected_fraud
227
+ IN_BLOCKLIST = :in_blocklist
228
+ INVALID_LINE = :invalid_line
229
+ INVALID_NUMBER = :invalid_number
230
+ RATE_LIMITED = :rate_limited
231
+ EXPIRED_SIGNALS = :expired_signals
232
+ SHADOWED = :shadowed
233
+
234
+ # @!method self.values
235
+ # @return [Array<Symbol>]
236
+ end
237
+
238
+ # Platform of the end-user device, when known.
239
+ #
240
+ # @see PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification#device_platform
241
+ module DevicePlatform
242
+ extend PreludeSDK::Internal::Type::Enum
243
+
244
+ ANDROID = :android
245
+ IOS = :ios
246
+ IPADOS = :ipados
247
+ TVOS = :tvos
248
+ WEB = :web
249
+
250
+ # @!method self.values
251
+ # @return [Array<Symbol>]
252
+ end
253
+
254
+ # Whether the phone number was allow-listed, block-listed, or sandboxed at
255
+ # verification time.
256
+ #
257
+ # @see PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification#phone_number_condition
258
+ module PhoneNumberCondition
259
+ extend PreludeSDK::Internal::Type::Enum
260
+
261
+ ALLOW_LISTED = :allow_listed
262
+ BLOCK_LISTED = :block_listed
263
+ SANDBOXED = :sandboxed
264
+
265
+ # @!method self.values
266
+ # @return [Array<Symbol>]
267
+ end
268
+
269
+ # Whether the SDK signals integrity check passed.
270
+ #
271
+ # @see PreludeSDK::Models::Verification::Phone::HistoryListResponse::Verification#signals_hash_status
272
+ module SignalsHashStatus
273
+ extend PreludeSDK::Internal::Type::Enum
274
+
275
+ VALID = :valid
276
+ INVALID = :invalid
277
+
278
+ # @!method self.values
279
+ # @return [Array<Symbol>]
280
+ end
281
+ end
282
+ end
283
+ end
284
+ end
285
+ end
286
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ module Verification
6
+ module Phone
7
+ # @see PreludeSDK::Resources::Verification::Phone::History#retrieve
8
+ class HistoryRetrieveParams < PreludeSDK::Internal::Type::BaseModel
9
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
10
+ include PreludeSDK::Internal::Type::RequestParameters
11
+
12
+ # @!attribute id
13
+ #
14
+ # @return [String]
15
+ required :id, String
16
+
17
+ # @!method initialize(id:, request_options: {})
18
+ # @param id [String]
19
+ # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end