didit-sdk 1.0.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 (234) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +25 -0
  3. data/LICENSE +21 -0
  4. data/README.md +277 -0
  5. data/lib/didit/authentication/base64_url.rb +34 -0
  6. data/lib/didit/authentication/cache.rb +201 -0
  7. data/lib/didit/authentication/http.rb +150 -0
  8. data/lib/didit/authentication/issuer.rb +115 -0
  9. data/lib/didit/authentication/jws.rb +231 -0
  10. data/lib/didit/authentication/key_set.rb +89 -0
  11. data/lib/didit/authentication/pkce.rb +64 -0
  12. data/lib/didit/authentication/types.rb +175 -0
  13. data/lib/didit/authentication.rb +546 -0
  14. data/lib/didit/client.rb +211 -0
  15. data/lib/didit/errors.rb +153 -0
  16. data/lib/didit/file_part.rb +85 -0
  17. data/lib/didit/internal/config.rb +94 -0
  18. data/lib/didit/internal/errors.rb +83 -0
  19. data/lib/didit/internal/log.rb +41 -0
  20. data/lib/didit/internal/multipart.rb +60 -0
  21. data/lib/didit/internal/request.rb +322 -0
  22. data/lib/didit/internal/transport.rb +198 -0
  23. data/lib/didit/internal/util.rb +76 -0
  24. data/lib/didit/internal.rb +15 -0
  25. data/lib/didit/model.rb +199 -0
  26. data/lib/didit/page.rb +130 -0
  27. data/lib/didit/raw_response.rb +57 -0
  28. data/lib/didit/resource.rb +15 -0
  29. data/lib/didit/resources/account.rb +309 -0
  30. data/lib/didit/resources/address_validation.rb +73 -0
  31. data/lib/didit/resources/age_estimation.rb +110 -0
  32. data/lib/didit/resources/aml.rb +166 -0
  33. data/lib/didit/resources/aml_monitoring.rb +30 -0
  34. data/lib/didit/resources/analytics.rb +87 -0
  35. data/lib/didit/resources/bank.rb +65 -0
  36. data/lib/didit/resources/billing.rb +61 -0
  37. data/lib/didit/resources/biometric_templates.rb +234 -0
  38. data/lib/didit/resources/blocklist.rb +130 -0
  39. data/lib/didit/resources/business_sessions.rb +29 -0
  40. data/lib/didit/resources/businesses.rb +471 -0
  41. data/lib/didit/resources/cases.rb +2116 -0
  42. data/lib/didit/resources/customization.rb +153 -0
  43. data/lib/didit/resources/database_validation.rb +327 -0
  44. data/lib/didit/resources/document_ai.rb +145 -0
  45. data/lib/didit/resources/email.rb +254 -0
  46. data/lib/didit/resources/face_match.rb +103 -0
  47. data/lib/didit/resources/face_search.rb +103 -0
  48. data/lib/didit/resources/fraud_checks.rb +130 -0
  49. data/lib/didit/resources/id_verification.rb +163 -0
  50. data/lib/didit/resources/id_wallets.rb +1468 -0
  51. data/lib/didit/resources/investigator.rb +419 -0
  52. data/lib/didit/resources/ip.rb +68 -0
  53. data/lib/didit/resources/kyb.rb +256 -0
  54. data/lib/didit/resources/lists.rb +332 -0
  55. data/lib/didit/resources/monitoring_events.rb +466 -0
  56. data/lib/didit/resources/networks.rb +427 -0
  57. data/lib/didit/resources/passive_liveness.rb +103 -0
  58. data/lib/didit/resources/phone.rb +271 -0
  59. data/lib/didit/resources/pricing.rb +40 -0
  60. data/lib/didit/resources/proof_of_address.rb +167 -0
  61. data/lib/didit/resources/questionnaires.rb +170 -0
  62. data/lib/didit/resources/regulatory_reports.rb +314 -0
  63. data/lib/didit/resources/report_templates.rb +146 -0
  64. data/lib/didit/resources/sessions.rb +2820 -0
  65. data/lib/didit/resources/transactions.rb +981 -0
  66. data/lib/didit/resources/travel_rule.rb +1202 -0
  67. data/lib/didit/resources/users.rb +521 -0
  68. data/lib/didit/resources/wallet_screening.rb +190 -0
  69. data/lib/didit/resources/webhooks.rb +396 -0
  70. data/lib/didit/resources/workflows.rb +214 -0
  71. data/lib/didit/resources.rb +263 -0
  72. data/lib/didit/types/account.rb +11 -0
  73. data/lib/didit/types/account_components.rb +105 -0
  74. data/lib/didit/types/address_validation.rb +8 -0
  75. data/lib/didit/types/age_estimation.rb +89 -0
  76. data/lib/didit/types/aml.rb +193 -0
  77. data/lib/didit/types/aml_monitoring.rb +73 -0
  78. data/lib/didit/types/analytics.rb +62 -0
  79. data/lib/didit/types/bank.rb +8 -0
  80. data/lib/didit/types/billing.rb +18 -0
  81. data/lib/didit/types/biometric_templates.rb +292 -0
  82. data/lib/didit/types/blocklist.rb +31 -0
  83. data/lib/didit/types/businesses.rb +45 -0
  84. data/lib/didit/types/cases.rb +368 -0
  85. data/lib/didit/types/components.rb +12206 -0
  86. data/lib/didit/types/customization.rb +8 -0
  87. data/lib/didit/types/database_validation.rb +177 -0
  88. data/lib/didit/types/document_ai.rb +135 -0
  89. data/lib/didit/types/email.rb +116 -0
  90. data/lib/didit/types/face_match.rb +93 -0
  91. data/lib/didit/types/face_search.rb +129 -0
  92. data/lib/didit/types/fraud_checks.rb +8 -0
  93. data/lib/didit/types/id_verification.rb +231 -0
  94. data/lib/didit/types/id_wallets.rb +8 -0
  95. data/lib/didit/types/investigator.rb +221 -0
  96. data/lib/didit/types/ip.rb +8 -0
  97. data/lib/didit/types/kyb.rb +1391 -0
  98. data/lib/didit/types/lists.rb +111 -0
  99. data/lib/didit/types/monitoring_events.rb +235 -0
  100. data/lib/didit/types/networks.rb +120 -0
  101. data/lib/didit/types/passive_liveness.rb +95 -0
  102. data/lib/didit/types/phone.rb +69 -0
  103. data/lib/didit/types/proof_of_address.rb +166 -0
  104. data/lib/didit/types/questionnaires.rb +29 -0
  105. data/lib/didit/types/regulatory_reports.rb +100 -0
  106. data/lib/didit/types/report_templates.rb +41 -0
  107. data/lib/didit/types/sessions.rb +1441 -0
  108. data/lib/didit/types/transactions.rb +245 -0
  109. data/lib/didit/types/travel_rule.rb +168 -0
  110. data/lib/didit/types/users.rb +180 -0
  111. data/lib/didit/types/wallet_screening.rb +49 -0
  112. data/lib/didit/types/webhooks.rb +355 -0
  113. data/lib/didit/types/workflows.rb +32 -0
  114. data/lib/didit/types.rb +1681 -0
  115. data/lib/didit/version.rb +5 -0
  116. data/lib/didit/webhooks/canonical_json.rb +187 -0
  117. data/lib/didit/webhooks/client_methods.rb +23 -0
  118. data/lib/didit/webhooks/events.rb +221 -0
  119. data/lib/didit/webhooks/headers.rb +83 -0
  120. data/lib/didit/webhooks/verifier.rb +260 -0
  121. data/lib/didit/webhooks.rb +99 -0
  122. data/lib/didit-sdk.rb +4 -0
  123. data/lib/didit.rb +31 -0
  124. data/sig/didit/authentication/base64_url.rbs +10 -0
  125. data/sig/didit/authentication/cache.rbs +60 -0
  126. data/sig/didit/authentication/http.rbs +37 -0
  127. data/sig/didit/authentication/issuer.rbs +17 -0
  128. data/sig/didit/authentication/jws.rbs +41 -0
  129. data/sig/didit/authentication/jwt.rbs +14 -0
  130. data/sig/didit/authentication/key_set.rbs +25 -0
  131. data/sig/didit/authentication/pkce.rbs +20 -0
  132. data/sig/didit/authentication/types.rbs +114 -0
  133. data/sig/didit/authentication.rbs +81 -0
  134. data/sig/didit/client.rbs +61 -0
  135. data/sig/didit/errors.rbs +80 -0
  136. data/sig/didit/file_part.rbs +19 -0
  137. data/sig/didit/internal.rbs +199 -0
  138. data/sig/didit/model.rbs +42 -0
  139. data/sig/didit/page.rbs +34 -0
  140. data/sig/didit/raw_response.rbs +20 -0
  141. data/sig/didit/resource.rbs +8 -0
  142. data/sig/didit/resources/account.rbs +23 -0
  143. data/sig/didit/resources/address_validation.rbs +9 -0
  144. data/sig/didit/resources/age_estimation.rbs +9 -0
  145. data/sig/didit/resources/aml.rbs +10 -0
  146. data/sig/didit/resources/aml_monitoring.rbs +9 -0
  147. data/sig/didit/resources/analytics.rbs +9 -0
  148. data/sig/didit/resources/bank.rbs +9 -0
  149. data/sig/didit/resources/billing.rbs +10 -0
  150. data/sig/didit/resources/biometric_templates.rbs +13 -0
  151. data/sig/didit/resources/blocklist.rbs +11 -0
  152. data/sig/didit/resources/business_sessions.rbs +9 -0
  153. data/sig/didit/resources/businesses.rbs +22 -0
  154. data/sig/didit/resources/cases.rbs +103 -0
  155. data/sig/didit/resources/customization.rbs +10 -0
  156. data/sig/didit/resources/database_validation.rbs +9 -0
  157. data/sig/didit/resources/document_ai.rbs +9 -0
  158. data/sig/didit/resources/email.rbs +11 -0
  159. data/sig/didit/resources/face_match.rbs +9 -0
  160. data/sig/didit/resources/face_search.rbs +9 -0
  161. data/sig/didit/resources/fraud_checks.rbs +11 -0
  162. data/sig/didit/resources/id_verification.rbs +9 -0
  163. data/sig/didit/resources/id_wallets.rbs +37 -0
  164. data/sig/didit/resources/investigator.rbs +23 -0
  165. data/sig/didit/resources/ip.rbs +9 -0
  166. data/sig/didit/resources/kyb.rbs +12 -0
  167. data/sig/didit/resources/lists.rbs +20 -0
  168. data/sig/didit/resources/monitoring_events.rbs +16 -0
  169. data/sig/didit/resources/networks.rbs +25 -0
  170. data/sig/didit/resources/passive_liveness.rbs +9 -0
  171. data/sig/didit/resources/phone.rbs +11 -0
  172. data/sig/didit/resources/pricing.rbs +9 -0
  173. data/sig/didit/resources/proof_of_address.rbs +9 -0
  174. data/sig/didit/resources/questionnaires.rbs +13 -0
  175. data/sig/didit/resources/regulatory_reports.rbs +16 -0
  176. data/sig/didit/resources/report_templates.rbs +13 -0
  177. data/sig/didit/resources/sessions.rbs +78 -0
  178. data/sig/didit/resources/transactions.rbs +43 -0
  179. data/sig/didit/resources/travel_rule.rbs +62 -0
  180. data/sig/didit/resources/users.rbs +21 -0
  181. data/sig/didit/resources/wallet_screening.rbs +11 -0
  182. data/sig/didit/resources/webhooks.rbs +23 -0
  183. data/sig/didit/resources/workflows.rbs +13 -0
  184. data/sig/didit/resources.rbs +50 -0
  185. data/sig/didit/types/account.rbs +22 -0
  186. data/sig/didit/types/account_components.rbs +94 -0
  187. data/sig/didit/types/address_validation.rbs +7 -0
  188. data/sig/didit/types/age_estimation.rbs +80 -0
  189. data/sig/didit/types/aml.rbs +174 -0
  190. data/sig/didit/types/aml_monitoring.rbs +67 -0
  191. data/sig/didit/types/analytics.rbs +57 -0
  192. data/sig/didit/types/bank.rbs +9 -0
  193. data/sig/didit/types/billing.rbs +19 -0
  194. data/sig/didit/types/biometric_templates.rbs +268 -0
  195. data/sig/didit/types/blocklist.rbs +33 -0
  196. data/sig/didit/types/businesses.rbs +54 -0
  197. data/sig/didit/types/cases.rbs +414 -0
  198. data/sig/didit/types/components.rbs +10920 -0
  199. data/sig/didit/types/customization.rbs +7 -0
  200. data/sig/didit/types/database_validation.rbs +152 -0
  201. data/sig/didit/types/document_ai.rbs +123 -0
  202. data/sig/didit/types/email.rbs +112 -0
  203. data/sig/didit/types/face_match.rbs +86 -0
  204. data/sig/didit/types/face_search.rbs +112 -0
  205. data/sig/didit/types/fraud_checks.rbs +9 -0
  206. data/sig/didit/types/id_verification.rbs +196 -0
  207. data/sig/didit/types/id_wallets.rbs +55 -0
  208. data/sig/didit/types/investigator.rbs +212 -0
  209. data/sig/didit/types/ip.rbs +7 -0
  210. data/sig/didit/types/kyb.rbs +1254 -0
  211. data/sig/didit/types/lists.rbs +106 -0
  212. data/sig/didit/types/monitoring_events.rbs +234 -0
  213. data/sig/didit/types/networks.rbs +113 -0
  214. data/sig/didit/types/passive_liveness.rbs +87 -0
  215. data/sig/didit/types/phone.rbs +65 -0
  216. data/sig/didit/types/proof_of_address.rbs +144 -0
  217. data/sig/didit/types/questionnaires.rbs +30 -0
  218. data/sig/didit/types/regulatory_reports.rbs +101 -0
  219. data/sig/didit/types/report_templates.rbs +42 -0
  220. data/sig/didit/types/sessions.rbs +1349 -0
  221. data/sig/didit/types/transactions.rbs +273 -0
  222. data/sig/didit/types/travel_rule.rbs +188 -0
  223. data/sig/didit/types/users.rbs +181 -0
  224. data/sig/didit/types/wallet_screening.rbs +40 -0
  225. data/sig/didit/types/webhooks.rbs +311 -0
  226. data/sig/didit/types/workflows.rbs +30 -0
  227. data/sig/didit/webhooks/canonical_json.rbs +25 -0
  228. data/sig/didit/webhooks/client_methods.rbs +11 -0
  229. data/sig/didit/webhooks/events.rbs +125 -0
  230. data/sig/didit/webhooks/headers.rbs +22 -0
  231. data/sig/didit/webhooks/verifier.rbs +54 -0
  232. data/sig/didit/webhooks.rbs +37 -0
  233. data/sig/didit.rbs +20 -0
  234. metadata +300 -0
@@ -0,0 +1,419 @@
1
+ # Code generated by codegen from openapi/*.json. DO NOT EDIT.
2
+ # frozen_string_literal: true
3
+
4
+ module Didit
5
+ module Resources
6
+ # The +investigator+ resource.
7
+ class Investigator < Didit::Resource
8
+ # Accept a recommendation
9
+ #
10
+ # Applies the recommended action through the item's normal path, so your usual webhooks fire. A `narrative`
11
+ # makes it edited and accepted. Restricted keys need the `decisions` scope (write); transaction alerts also need
12
+ # `transactions` (write). Escalating a verification or transaction opens a case.
13
+ #
14
+ # +POST /v3/investigator/runs/{run_id}/accept/+
15
+ #
16
+ # @param run_id [String]
17
+ # @param narrative [String] A rewritten narrative. Sending one records the decision as edited and accepted.
18
+ # @param send_email [Boolean] Email the person about the decision.
19
+ # @param email_address [String] Required when `send_email` is true.
20
+ # @param email_language [String]
21
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
22
+ # @return [Didit::Types::InvestigatorDecision]
23
+ def accept_run(
24
+ run_id,
25
+ narrative: OMIT,
26
+ send_email: OMIT,
27
+ email_address: OMIT,
28
+ email_language: OMIT,
29
+ request_options: nil
30
+ )
31
+ @client.request(
32
+ :post,
33
+ "/v3/investigator/runs/{run_id}/accept/",
34
+ path_params: { "run_id" => run_id },
35
+ body: {
36
+ "narrative" => narrative,
37
+ "send_email" => send_email,
38
+ "email_address" => email_address,
39
+ "email_language" => email_language
40
+ },
41
+ response: Types::InvestigatorDecision,
42
+ request_options: request_options
43
+ )
44
+ end
45
+
46
+ # Batch accept recommendations
47
+ #
48
+ # Accepts up to 50 reports marked Ready to accept. Each is its own decision: one that cannot be accepted is
49
+ # skipped with its reason. Restricted keys need the `decisions` scope (write); transaction alerts also need
50
+ # `transactions` (write). Escalating a verification or transaction opens a case.
51
+ #
52
+ # +POST /v3/investigator/runs/batch-accept/+
53
+ #
54
+ # @param run_ids [Array<String>]
55
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
56
+ # @return [Didit::Types::InvestigatorBatchAcceptResponse]
57
+ def batch_accept_runs(run_ids:, request_options: nil)
58
+ @client.request(
59
+ :post,
60
+ "/v3/investigator/runs/batch-accept/",
61
+ body: {
62
+ "run_ids" => run_ids
63
+ },
64
+ response: Types::InvestigatorBatchAcceptResponse,
65
+ request_options: request_options
66
+ )
67
+ end
68
+
69
+ # Export Investigator activity
70
+ #
71
+ # The same entries as CSV, one row per decision, newest first, up to 10,000 entries. Restricted keys need the
72
+ # `decisions` scope (read); transaction alerts also need `transactions`.
73
+ #
74
+ # +GET /v3/investigator/activity/export/+
75
+ #
76
+ # @param scope [String] `identity` (sessions, and cases not opened by a transaction rule) or `transactions`
77
+ # (transaction alerts, and cases a transaction rule opened).
78
+ # @param group [String]
79
+ # @param actor [String] `agent` for the Investigator, or a person's email.
80
+ # @param since [Time, String]
81
+ # @param until [Time, String]
82
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
83
+ # @return [String, nil] the body bytes, or nil when a block receives the chunks
84
+ def export_activity(scope: OMIT, group: OMIT, actor: OMIT, since: OMIT, until: OMIT, request_options: nil, &block)
85
+ @client.request(
86
+ :get,
87
+ "/v3/investigator/activity/export/",
88
+ query: {
89
+ "scope" => scope,
90
+ "group" => group,
91
+ "actor" => actor,
92
+ "since" => since,
93
+ "until" => binding.local_variable_get(:until)
94
+ },
95
+ response: :binary,
96
+ accept: "text/csv, application/json",
97
+ request_options: request_options, &block
98
+ )
99
+ end
100
+
101
+ # List Investigator activity
102
+ #
103
+ # The append-only audit trail, newest first. A batch accept is one entry. Adds `counts` per group and `actors`.
104
+ # Restricted keys need the `decisions` scope (read); transaction alerts also need `transactions`.
105
+ #
106
+ # +GET /v3/investigator/activity/+
107
+ #
108
+ # @param scope [String] `identity` (sessions, and cases not opened by a transaction rule) or `transactions`
109
+ # (transaction alerts, and cases a transaction rule opened).
110
+ # @param group [String]
111
+ # @param actor [String] `agent` for the Investigator, or a person's email.
112
+ # @param since [Time, String]
113
+ # @param until [Time, String]
114
+ # @param limit [Integer]
115
+ # @param offset [Integer]
116
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
117
+ # @return [Didit::Page<Hash>]
118
+ def list_activity(
119
+ scope: OMIT,
120
+ group: OMIT,
121
+ actor: OMIT,
122
+ since: OMIT,
123
+ until: OMIT,
124
+ limit: OMIT,
125
+ offset: OMIT,
126
+ request_options: nil
127
+ )
128
+ @client.request(
129
+ :get,
130
+ "/v3/investigator/activity/",
131
+ query: {
132
+ "scope" => scope,
133
+ "group" => group,
134
+ "actor" => actor,
135
+ "since" => since,
136
+ "until" => binding.local_variable_get(:until),
137
+ "limit" => limit,
138
+ "offset" => offset
139
+ },
140
+ page: :any,
141
+ request_options: request_options
142
+ )
143
+ end
144
+
145
+ # List the locked guardrails
146
+ #
147
+ # The five guardrails that apply to every queue. They cannot be switched off. Restricted keys need the
148
+ # `decisions` scope (read); transaction alerts also need `transactions`.
149
+ #
150
+ # +GET /v3/investigator/guardrails/+
151
+ #
152
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
153
+ # @return [Didit::Types::InvestigatorListGuardrailsResponse]
154
+ def list_guardrails(request_options: nil)
155
+ @client.request(
156
+ :get,
157
+ "/v3/investigator/guardrails/",
158
+ response: Types::InvestigatorListGuardrailsResponse,
159
+ request_options: request_options
160
+ )
161
+ end
162
+
163
+ # List the Investigator queue
164
+ #
165
+ # Open reports, **Ready to accept** first, then by deadline, risk and wait. `counts` covers every kind in scope.
166
+ # `count` is capped at 100. Restricted keys need the `decisions` scope (read); transaction alerts also need
167
+ # `transactions`.
168
+ #
169
+ # +GET /v3/investigator/queue/+
170
+ #
171
+ # @param scope [String] `identity` (sessions, and cases not opened by a transaction rule) or `transactions`
172
+ # (transaction alerts, and cases a transaction rule opened).
173
+ # @param kind [String] `session`, `business_session`, `transaction` or `case`, or several separated by commas.
174
+ # @param queue [String]
175
+ # @param recommendation [String]
176
+ # @param confidence [String]
177
+ # @param ready [Boolean]
178
+ # @param search [String] Name, company, case title, number, transaction ID or item ID.
179
+ # @param limit [Integer]
180
+ # @param offset [Integer]
181
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
182
+ # @return [Didit::Page<Didit::Types::InvestigatorQueueRow>]
183
+ def list_queue(
184
+ scope: OMIT,
185
+ kind: OMIT,
186
+ queue: OMIT,
187
+ recommendation: OMIT,
188
+ confidence: OMIT,
189
+ ready: OMIT,
190
+ search: OMIT,
191
+ limit: OMIT,
192
+ offset: OMIT,
193
+ request_options: nil
194
+ )
195
+ @client.request(
196
+ :get,
197
+ "/v3/investigator/queue/",
198
+ query: {
199
+ "scope" => scope,
200
+ "kind" => kind,
201
+ "queue" => queue,
202
+ "recommendation" => recommendation,
203
+ "confidence" => confidence,
204
+ "ready" => ready,
205
+ "search" => search,
206
+ "limit" => limit,
207
+ "offset" => offset
208
+ },
209
+ page: Types::InvestigatorQueueRow,
210
+ request_options: request_options
211
+ )
212
+ end
213
+
214
+ # Override a recommendation
215
+ #
216
+ # Takes another action with a category and a reason. Also overrides a decision the Investigator took on its own
217
+ # while it still stands. Restricted keys need the `decisions` scope (write); transaction alerts also need
218
+ # `transactions` (write). Escalating a verification or transaction opens a case.
219
+ #
220
+ # +POST /v3/investigator/runs/{run_id}/override/+
221
+ #
222
+ # @param run_id [String]
223
+ # @param action [String]
224
+ # @param category [String]
225
+ # @param reason [String]
226
+ # @param send_email [Boolean] Email the person about the decision.
227
+ # @param email_address [String] Required when `send_email` is true.
228
+ # @param email_language [String]
229
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
230
+ # @return [Didit::Types::InvestigatorDecision]
231
+ def override_run(
232
+ run_id,
233
+ action:,
234
+ category:,
235
+ reason:,
236
+ send_email: OMIT,
237
+ email_address: OMIT,
238
+ email_language: OMIT,
239
+ request_options: nil
240
+ )
241
+ @client.request(
242
+ :post,
243
+ "/v3/investigator/runs/{run_id}/override/",
244
+ path_params: { "run_id" => run_id },
245
+ body: {
246
+ "action" => action,
247
+ "category" => category,
248
+ "reason" => reason,
249
+ "send_email" => send_email,
250
+ "email_address" => email_address,
251
+ "email_language" => email_language
252
+ },
253
+ response: Types::InvestigatorDecision,
254
+ request_options: request_options
255
+ )
256
+ end
257
+
258
+ # Investigator dashboard
259
+ #
260
+ # The last 30 days: reviews, decisions, automation rate, hours saved, spend, overrides, quality samples since
261
+ # go-live, per-queue and weekly figures. Restricted keys need the `decisions` scope (read); transaction alerts
262
+ # also need `transactions`.
263
+ #
264
+ # +GET /v3/investigator/dashboard/+
265
+ #
266
+ # @param scope [String] `identity` (sessions, and cases not opened by a transaction rule) or `transactions`
267
+ # (transaction alerts, and cases a transaction rule opened).
268
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
269
+ # @return [Didit::Types::InvestigatorRetrieveDashboardResponse]
270
+ def retrieve_dashboard(scope: OMIT, request_options: nil)
271
+ @client.request(
272
+ :get,
273
+ "/v3/investigator/dashboard/",
274
+ query: {
275
+ "scope" => scope
276
+ },
277
+ response: Types::InvestigatorRetrieveDashboardResponse,
278
+ request_options: request_options
279
+ )
280
+ end
281
+
282
+ # Investigator performance
283
+ #
284
+ # Agreement with your team, volume, time saved, confidence calibration, per-queue results, override reasons and
285
+ # disagreements for a period. Restricted keys need the `decisions` scope (read); transaction alerts also need
286
+ # `transactions`.
287
+ #
288
+ # +GET /v3/investigator/performance/+
289
+ #
290
+ # @param scope [String] `identity` (sessions, and cases not opened by a transaction rule) or `transactions`
291
+ # (transaction alerts, and cases a transaction rule opened).
292
+ # @param period [String] Days, ending today.
293
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
294
+ # @return [Didit::Types::InvestigatorRetrievePerformanceResponse]
295
+ def retrieve_performance(scope: OMIT, period: OMIT, request_options: nil)
296
+ @client.request(
297
+ :get,
298
+ "/v3/investigator/performance/",
299
+ query: {
300
+ "scope" => scope,
301
+ "period" => period
302
+ },
303
+ response: Types::InvestigatorRetrievePerformanceResponse,
304
+ request_options: request_options
305
+ )
306
+ end
307
+
308
+ # Get an Investigator report
309
+ #
310
+ # The full report of one run. 404 when the run has no completed report, or its item was deleted. Restricted keys
311
+ # need the `decisions` scope (read); transaction alerts also need `transactions`.
312
+ #
313
+ # +GET /v3/investigator/runs/{run_id}/+
314
+ #
315
+ # @param run_id [String]
316
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
317
+ # @return [Didit::Types::InvestigatorRunDetail]
318
+ def retrieve_run(run_id, request_options: nil)
319
+ @client.request(
320
+ :get,
321
+ "/v3/investigator/runs/{run_id}/",
322
+ path_params: { "run_id" => run_id },
323
+ response: Types::InvestigatorRunDetail,
324
+ request_options: request_options
325
+ )
326
+ end
327
+
328
+ # Get Investigator settings
329
+ #
330
+ # The stage (`none`, `shadow` or `live`) and the monthly spend limit with this month's spend. Restricted keys
331
+ # need the `applications` scope (read).
332
+ #
333
+ # +GET /v3/investigator/settings/+
334
+ #
335
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
336
+ # @return [Didit::Types::InvestigatorSettings]
337
+ def retrieve_settings(request_options: nil)
338
+ @client.request(
339
+ :get,
340
+ "/v3/investigator/settings/",
341
+ response: Types::InvestigatorSettings,
342
+ request_options: request_options
343
+ )
344
+ end
345
+
346
+ # Investigator summary
347
+ #
348
+ # Stage, queue counts, reports prepared and decided today, 30-day agreement, prices and the autonomy level of
349
+ # each queue. Restricted keys need the `decisions` scope (read); transaction alerts also need `transactions`.
350
+ #
351
+ # +GET /v3/investigator/summary/+
352
+ #
353
+ # @param scope [String] `identity` (sessions, and cases not opened by a transaction rule) or `transactions`
354
+ # (transaction alerts, and cases a transaction rule opened).
355
+ # @param timezone [String] IANA time zone (for example `Europe/Madrid`) that "today" counts from. UTC by
356
+ # default.
357
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
358
+ # @return [Didit::Types::InvestigatorRetrieveSummaryResponse]
359
+ def retrieve_summary(scope: OMIT, timezone: OMIT, request_options: nil)
360
+ @client.request(
361
+ :get,
362
+ "/v3/investigator/summary/",
363
+ query: {
364
+ "scope" => scope,
365
+ "timezone" => timezone
366
+ },
367
+ response: Types::InvestigatorRetrieveSummaryResponse,
368
+ request_options: request_options
369
+ )
370
+ end
371
+
372
+ # Get a transaction's Investigator review
373
+ #
374
+ # The transaction's latest review, or `investigator: null` when it never had one. Restricted keys need the
375
+ # `decisions` and `transactions` scopes (read).
376
+ #
377
+ # +GET /v3/investigator/transactions/{transaction_id}/+
378
+ #
379
+ # @param transaction_id [String]
380
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
381
+ # @return [Didit::Types::InvestigatorRetrieveTransactionResponse]
382
+ def retrieve_transaction(transaction_id, request_options: nil)
383
+ @client.request(
384
+ :get,
385
+ "/v3/investigator/transactions/{transaction_id}/",
386
+ path_params: { "transaction_id" => transaction_id },
387
+ response: Types::InvestigatorRetrieveTransactionResponse,
388
+ request_options: request_options
389
+ )
390
+ end
391
+
392
+ # Update Investigator settings
393
+ #
394
+ # Change the stage, the monthly spend limit, or both. Moving past `none` needs a plan that includes the
395
+ # Investigator (Growth or higher); `live` also needs a contract that prices it, if you have one. Restricted keys
396
+ # need the `applications` scope (write).
397
+ #
398
+ # +PATCH /v3/investigator/settings/+
399
+ #
400
+ # @param stage [String]
401
+ # @param monthly_spend_limit [String, nil] Monthly limit in your billing currency, 0.01 to 1,000,000. Null turns
402
+ # it off.
403
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
404
+ # @return [Didit::Types::InvestigatorSettings]
405
+ def update_settings(stage: OMIT, monthly_spend_limit: OMIT, request_options: nil)
406
+ @client.request(
407
+ :patch,
408
+ "/v3/investigator/settings/",
409
+ body: {
410
+ "stage" => stage,
411
+ "monthly_spend_limit" => monthly_spend_limit
412
+ },
413
+ response: Types::InvestigatorSettings,
414
+ request_options: request_options
415
+ )
416
+ end
417
+ end
418
+ end
419
+ end
@@ -0,0 +1,68 @@
1
+ # Code generated by codegen from openapi/*.json. DO NOT EDIT.
2
+ # frozen_string_literal: true
3
+
4
+ module Didit
5
+ module Resources
6
+ # The +ip+ resource.
7
+ class Ip < Didit::Resource
8
+ # Risk-score an IP address
9
+ #
10
+ # Return geolocation, network ownership, VPN/Tor and data-center flags, threat data, and `country_mismatch` for
11
+ # a supplied IP address. The endpoint creates an API session and returns its id as `request_id`.
12
+ #
13
+ # **Decision.** `status` is `In Review` when the resolved country conflicts with `claimed_country`, or when the
14
+ # address is associated with VPN, Tor, or data-center infrastructure. Otherwise it is `Approved`.
15
+ #
16
+ # **Best effort.** IP enrichment is best effort. If no enrichment source returns usable data, the endpoint
17
+ # returns an approved response with `ip.ip_address: null`, `ip.country_mismatch: null`, and an empty `ip.threat`
18
+ # object.
19
+ #
20
+ # **Billing.** Live calls use IP Risk API pricing. The request is billable once the lookup starts.
21
+ #
22
+ # **Sandbox.** Sandbox keys validate the request and return deterministic approved data without consuming
23
+ # credits, creating a session, or contributing to Networks.
24
+ #
25
+ # **Authentication.** Send your application's API key in `x-api-key`. Missing or invalid credentials return
26
+ # `403` - this API never returns `401`.
27
+ #
28
+ # **Rate limit.** Shared write budget of 300 requests per minute per API key across all POST/PATCH/DELETE
29
+ # endpoints.
30
+ #
31
+ # +POST /v3/ip/risk/+
32
+ #
33
+ # @param ip_address [String] IPv4 or IPv6 address to score.
34
+ # @param claimed_country [String] Optional ISO 3166-1 alpha-2 or alpha-3 country claimed by the user or session.
35
+ # Used to calculate `country_mismatch`.
36
+ # @param user_agent [String] User agent observed by your backend. Stored as request context; it does not provide
37
+ # device fingerprinting.
38
+ # @param vendor_data [String] Your stable reference for this request. Stored on the API session and echoed in
39
+ # the response.
40
+ # @param metadata [Hash, nil] Your non-sensitive JSON metadata. Stored on the API session and echoed in the
41
+ # response.
42
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
43
+ # @return [Didit::Types::IPRiskResponse]
44
+ def assess_risk(
45
+ ip_address:,
46
+ claimed_country: OMIT,
47
+ user_agent: OMIT,
48
+ vendor_data: OMIT,
49
+ metadata: OMIT,
50
+ request_options: nil
51
+ )
52
+ @client.request(
53
+ :post,
54
+ "/v3/ip/risk/",
55
+ body: {
56
+ "ip_address" => ip_address,
57
+ "claimed_country" => claimed_country,
58
+ "user_agent" => user_agent,
59
+ "vendor_data" => vendor_data,
60
+ "metadata" => metadata
61
+ },
62
+ response: Types::IPRiskResponse,
63
+ request_options: request_options
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end