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,2116 @@
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 +cases+ resource.
7
+ class Cases < Didit::Resource
8
+ # @return [Didit::Resources::Cases::Blueprints]
9
+ def blueprints
10
+ @blueprints ||= Blueprints.new(@client)
11
+ end
12
+
13
+ # @return [Didit::Resources::Cases::Checklist]
14
+ def checklist
15
+ @checklist ||= Checklist.new(@client)
16
+ end
17
+
18
+ # @return [Didit::Resources::Cases::Links]
19
+ def links
20
+ @links ||= Links.new(@client)
21
+ end
22
+
23
+ # @return [Didit::Resources::Cases::Notes]
24
+ def notes
25
+ @notes ||= Notes.new(@client)
26
+ end
27
+
28
+ # @return [Didit::Resources::Cases::RegulatoryReports]
29
+ def regulatory_reports
30
+ @regulatory_reports ||= RegulatoryReports.new(@client)
31
+ end
32
+
33
+ # @return [Didit::Resources::Cases::Requests]
34
+ def requests
35
+ @requests ||= Requests.new(@client)
36
+ end
37
+
38
+ # @return [Didit::Resources::Cases::RoutingRules]
39
+ def routing_rules
40
+ @routing_rules ||= RoutingRules.new(@client)
41
+ end
42
+
43
+ # @return [Didit::Resources::Cases::Teams]
44
+ def teams
45
+ @teams ||= Teams.new(@client)
46
+ end
47
+
48
+ # Apply one explicit action to the case subject. Supply a unique client_reference to obtain an action receipt
49
+ # and make retries idempotent. Reusing that reference with a different payload returns 409. With a reference,
50
+ # inspect receipt.status even when HTTP status is 200: FAILED means no action was applied. Repeating a failed
51
+ # request does not execute it again unless retry is true. Omitting client_reference preserves the legacy
52
+ # response.
53
+ #
54
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/entity-actions/+
55
+ #
56
+ # @param case_uuid [String]
57
+ # @param action [String] * `set_status` - set_status * `add_tags` - add_tags * `add_note` - add_note *
58
+ # `add_to_blocklist` - add_to_blocklist
59
+ # @param client_reference [String]
60
+ # @param retry [Boolean]
61
+ # @param status [String, nil]
62
+ # @param tags [Array<String>]
63
+ # @param note [String, nil]
64
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
65
+ # @return [Didit::Types::CaseActionCaseEntityActionResult]
66
+ def apply_entity_action(
67
+ case_uuid,
68
+ action:,
69
+ client_reference: OMIT,
70
+ retry: OMIT,
71
+ status: OMIT,
72
+ tags: OMIT,
73
+ note: OMIT,
74
+ request_options: nil
75
+ )
76
+ @client.request(
77
+ :post,
78
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/entity-actions/",
79
+ path_params: { "case_uuid" => case_uuid },
80
+ body: {
81
+ "action" => action,
82
+ "client_reference" => client_reference,
83
+ "retry" => binding.local_variable_get(:retry),
84
+ "status" => status,
85
+ "tags" => tags,
86
+ "note" => note
87
+ },
88
+ scope: :application,
89
+ response: Types::CaseActionCaseEntityActionResult,
90
+ request_options: request_options
91
+ )
92
+ end
93
+
94
+ # Approve staged resolution (4-eyes)
95
+ #
96
+ # Apply a resolution staged by resolve on a four-eyes blueprint. The caller must be a different officer than the
97
+ # one who submitted it, otherwise 403. When the resolution names a checker (the case's `checker`), only that
98
+ # member can approve it: any other caller, including an API key, gets 403.
99
+ #
100
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/approve/+
101
+ #
102
+ # @param case_uuid [String] Case UUID.
103
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
104
+ # @return [Didit::Types::CaseDetail]
105
+ def approve_resolution(case_uuid, request_options: nil)
106
+ @client.request(
107
+ :post,
108
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/approve/",
109
+ path_params: { "case_uuid" => case_uuid },
110
+ scope: :application,
111
+ response: Types::CaseDetail,
112
+ request_options: request_options
113
+ )
114
+ end
115
+
116
+ # Assign or unassign case
117
+ #
118
+ # Assign the case to a user, or unassign it by sending assignee_user_id: null. assignee_email/assignee_name
119
+ # auto-provision a User row when the assignee does not exist yet.
120
+ #
121
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/assign/+
122
+ #
123
+ # @param case_uuid [String] Case UUID.
124
+ # @param assignee_user_id [String, nil] null to unassign.
125
+ # @param assignee_email [String, nil]
126
+ # @param assignee_name [String, nil]
127
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
128
+ # @return [Didit::Types::CaseDetail]
129
+ def assign(case_uuid, assignee_user_id:, assignee_email: OMIT, assignee_name: OMIT, request_options: nil)
130
+ @client.request(
131
+ :post,
132
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/assign/",
133
+ path_params: { "case_uuid" => case_uuid },
134
+ body: {
135
+ "assignee_user_id" => assignee_user_id,
136
+ "assignee_email" => assignee_email,
137
+ "assignee_name" => assignee_name
138
+ },
139
+ scope: :application,
140
+ response: Types::CaseDetail,
141
+ request_options: request_options
142
+ )
143
+ end
144
+
145
+ # Bulk assign cases
146
+ #
147
+ # Assign (or unassign, with assignee_user_id: null) several cases at once. All cases must share the same
148
+ # blueprint; mismatches are reported per case without aborting the batch.
149
+ #
150
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/bulk/assign/+
151
+ #
152
+ # @param case_uuids [Array<String>]
153
+ # @param assignee_user_id [String, nil]
154
+ # @param assignee_email [String, nil]
155
+ # @param assignee_name [String, nil]
156
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
157
+ # @return [Didit::Types::CaseBulkUpdateResult]
158
+ def bulk_assign(case_uuids:, assignee_user_id:, assignee_email: OMIT, assignee_name: OMIT, request_options: nil)
159
+ @client.request(
160
+ :post,
161
+ "/v3/organization/{organization_id}/application/{application_id}/cases/bulk/assign/",
162
+ body: {
163
+ "case_uuids" => case_uuids,
164
+ "assignee_user_id" => assignee_user_id,
165
+ "assignee_email" => assignee_email,
166
+ "assignee_name" => assignee_name
167
+ },
168
+ scope: :application,
169
+ response: Types::CaseBulkUpdateResult,
170
+ request_options: request_options
171
+ )
172
+ end
173
+
174
+ # Bulk update case status
175
+ #
176
+ # Apply the same status transition to several cases in one call: OPEN reopens, AWAITING_USER requests info,
177
+ # RESOLVED resolves (resolution required). Each case is evaluated independently; gate failures (incomplete
178
+ # checklist, missing required note) are reported per case without aborting the batch.
179
+ #
180
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/bulk/status/+
181
+ #
182
+ # @param case_uuids [Array<String>]
183
+ # @param status [String]
184
+ # @param resolution [String] Required when status is RESOLVED.
185
+ # @param note [String, nil]
186
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
187
+ # @return [Didit::Types::CaseBulkUpdateResult]
188
+ def bulk_update_status(case_uuids:, status:, resolution: OMIT, note: OMIT, request_options: nil)
189
+ @client.request(
190
+ :post,
191
+ "/v3/organization/{organization_id}/application/{application_id}/cases/bulk/status/",
192
+ body: {
193
+ "case_uuids" => case_uuids,
194
+ "status" => status,
195
+ "resolution" => resolution,
196
+ "note" => note
197
+ },
198
+ scope: :application,
199
+ response: Types::CaseBulkUpdateResult,
200
+ request_options: request_options
201
+ )
202
+ end
203
+
204
+ # Create case
205
+ #
206
+ # Create a case anchored to exactly one subject (a user or a business), directly or by deriving the subject from
207
+ # an attached session/transaction link. Source is always `MANUAL` for API-created cases.
208
+ #
209
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/+
210
+ #
211
+ # @param title [String]
212
+ # @param blueprint [String, nil] CaseBlueprint UUID. Omit for no blueprint.
213
+ # @param priority [String]
214
+ # @param due_at [Time, String, nil]
215
+ # @param tags [Array<String>]
216
+ # @param subject [Hash] Required unless links is provided; the case's exactly-one subject.
217
+ # @param links [Array<Hash>] Sessions/business sessions/transactions to attach on creation, e.g.
218
+ # [{"entity_type": "transaction", "entity_uuid": "..."}]. When subject is omitted, the subject is derived from
219
+ # the first link's owner.
220
+ # @param assigned_to [String, nil] User UUID to assign immediately.
221
+ # @param review_duplicates [Boolean] Recheck existing investigations before creating the case. When true, a
222
+ # subject with existing cases requires a nonblank separate_incident_reason. The console always enables this
223
+ # protection. Omitting it preserves existing API behavior.
224
+ # @param separate_incident_reason [String]
225
+ # @param source_context [Hash]
226
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
227
+ # @return [Didit::Types::CaseDetail]
228
+ def create(
229
+ title:,
230
+ blueprint: OMIT,
231
+ priority: OMIT,
232
+ due_at: OMIT,
233
+ tags: OMIT,
234
+ subject: OMIT,
235
+ links: OMIT,
236
+ assigned_to: OMIT,
237
+ review_duplicates: OMIT,
238
+ separate_incident_reason: OMIT,
239
+ source_context: OMIT,
240
+ request_options: nil
241
+ )
242
+ @client.request(
243
+ :post,
244
+ "/v3/organization/{organization_id}/application/{application_id}/cases/",
245
+ body: {
246
+ "title" => title,
247
+ "blueprint" => blueprint,
248
+ "priority" => priority,
249
+ "due_at" => due_at,
250
+ "tags" => tags,
251
+ "subject" => subject,
252
+ "links" => links,
253
+ "assigned_to" => assigned_to,
254
+ "review_duplicates" => review_duplicates,
255
+ "separate_incident_reason" => separate_incident_reason,
256
+ "source_context" => source_context
257
+ },
258
+ scope: :application,
259
+ response: Types::CaseDetail,
260
+ request_options: request_options
261
+ )
262
+ end
263
+
264
+ # Delete case
265
+ #
266
+ # Delete a case permanently. Its draft regulatory reports are deleted with it. Linked verifications, people,
267
+ # companies and transactions are not deleted. There is no undelete endpoint.
268
+ #
269
+ # If the case has a finalized regulatory report, the whole request is refused with `409` and nothing is deleted.
270
+ # The body uses `code: in_filed_report` and names each report with `uuid`, `report_number`, `report_type` and
271
+ # `case_uuid`. Delete the reports, then repeat the request.
272
+ #
273
+ # +DELETE /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/+
274
+ #
275
+ # @param case_uuid [String] Case UUID.
276
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
277
+ # @return [nil]
278
+ def delete(case_uuid, request_options: nil)
279
+ @client.request(
280
+ :delete,
281
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/",
282
+ path_params: { "case_uuid" => case_uuid },
283
+ scope: :application,
284
+ request_options: request_options
285
+ )
286
+ end
287
+
288
+ # Escalate case
289
+ #
290
+ # Move the case to its blueprint's configured escalation_blueprint. Requires the current blueprint to have
291
+ # escalation_enabled and an escalation_blueprint set, otherwise 400.
292
+ #
293
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/escalate/+
294
+ #
295
+ # @param case_uuid [String] Case UUID.
296
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
297
+ # @return [Didit::Types::CaseDetail]
298
+ def escalate(case_uuid, request_options: nil)
299
+ @client.request(
300
+ :post,
301
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/escalate/",
302
+ path_params: { "case_uuid" => case_uuid },
303
+ scope: :application,
304
+ response: Types::CaseDetail,
305
+ request_options: request_options
306
+ )
307
+ end
308
+
309
+ # Review existing cases for a subject or owned source record before manual case creation. Both open and resolved
310
+ # investigations are returned. Each page contains at most 20 cases; use next_offset to request another page.
311
+ #
312
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/duplicates/+
313
+ #
314
+ # @param subject [Hash]
315
+ # @param links [Array<Hash>]
316
+ # @param offset [Integer]
317
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
318
+ # @return [Didit::Types::CaseDuplicateCaseDuplicatePage]
319
+ def find_duplicates(subject: OMIT, links: OMIT, offset: OMIT, request_options: nil)
320
+ @client.request(
321
+ :post,
322
+ "/v3/organization/{organization_id}/application/{application_id}/cases/duplicates/",
323
+ body: {
324
+ "subject" => subject,
325
+ "links" => links,
326
+ "offset" => offset
327
+ },
328
+ scope: :application,
329
+ response: Types::CaseDuplicateCaseDuplicatePage,
330
+ request_options: request_options
331
+ )
332
+ end
333
+
334
+ # List cases
335
+ #
336
+ # List cases for the application, newest first. Supports filtering, search, and sorting; see query parameters.
337
+ # Paginated with `limit`/`offset`.
338
+ #
339
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/+
340
+ #
341
+ # @param limit [Integer] Page size. Defaults to 50.
342
+ # @param offset [Integer] Zero-based offset of the first record.
343
+ # @param status_in [String] Comma-separated statuses to include, e.g. OPEN,AWAITING_USER.
344
+ # @param priority [String] Comma-separated priorities to include.
345
+ # @param source_in [String] Comma-separated sources to include.
346
+ # @param blueprint [String] Filter to cases on this blueprint.
347
+ # @param assigned_to [String] Filter to cases assigned to this user.
348
+ # @param unassigned [Boolean] true for unassigned cases, false for assigned cases.
349
+ # @param tag [String] Filter to cases carrying this exact tag.
350
+ # @param search [String] Matches title, case_number, tag, subject name/UUID/external ID, linked session UUID, or
351
+ # linked transaction UUID.
352
+ # @param date_from [Date, String] Created-at lower bound (inclusive).
353
+ # @param date_to [Date, String] Created-at upper bound (inclusive).
354
+ # @param due_before [Time, String] due_at upper bound.
355
+ # @param overdue [Boolean] true to return only overdue open/awaiting-user cases.
356
+ # @param ordering [String] Sort order. due_at sorts nulls last.
357
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
358
+ # @return [Didit::Page<Didit::Types::CaseListItem>]
359
+ def list(
360
+ limit: OMIT,
361
+ offset: OMIT,
362
+ status_in: OMIT,
363
+ priority: OMIT,
364
+ source_in: OMIT,
365
+ blueprint: OMIT,
366
+ assigned_to: OMIT,
367
+ unassigned: OMIT,
368
+ tag: OMIT,
369
+ search: OMIT,
370
+ date_from: OMIT,
371
+ date_to: OMIT,
372
+ due_before: OMIT,
373
+ overdue: OMIT,
374
+ ordering: OMIT,
375
+ request_options: nil
376
+ )
377
+ @client.request(
378
+ :get,
379
+ "/v3/organization/{organization_id}/application/{application_id}/cases/",
380
+ query: {
381
+ "limit" => limit,
382
+ "offset" => offset,
383
+ "status__in" => status_in,
384
+ "priority" => priority,
385
+ "source__in" => source_in,
386
+ "blueprint" => blueprint,
387
+ "assigned_to" => assigned_to,
388
+ "unassigned" => unassigned,
389
+ "tag" => tag,
390
+ "search" => search,
391
+ "date_from" => date_from,
392
+ "date_to" => date_to,
393
+ "due_before" => due_before,
394
+ "overdue" => overdue,
395
+ "ordering" => ordering
396
+ },
397
+ scope: :application,
398
+ page: Types::CaseListItem,
399
+ request_options: request_options
400
+ )
401
+ end
402
+
403
+ # List subject-action receipts, newest first, with at most 20 results per page. Use next_offset for the next
404
+ # page. Input note text is not exposed in the history.
405
+ #
406
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/action-receipts/+
407
+ #
408
+ # @param case_uuid [String]
409
+ # @param offset [Integer]
410
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
411
+ # @return [Didit::Types::CaseActionCaseActionReceiptPage]
412
+ def list_action_receipts(case_uuid, offset: OMIT, request_options: nil)
413
+ @client.request(
414
+ :get,
415
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/action-receipts/",
416
+ path_params: { "case_uuid" => case_uuid },
417
+ query: {
418
+ "offset" => offset
419
+ },
420
+ scope: :application,
421
+ response: Types::CaseActionCaseActionReceiptPage,
422
+ request_options: request_options
423
+ )
424
+ end
425
+
426
+ # List case AML hits
427
+ #
428
+ # List AML screening hits for the case's subject. Same shape as the hits returned by POST /v3/aml/.
429
+ #
430
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/aml/+
431
+ #
432
+ # @param case_uuid [String] Case UUID.
433
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
434
+ # @return [Array<Didit::Types::AMLScreening>]
435
+ def list_aml_hits(case_uuid, request_options: nil)
436
+ @client.request(
437
+ :get,
438
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/aml/",
439
+ path_params: { "case_uuid" => case_uuid },
440
+ scope: :application,
441
+ response: [:array, Types::AMLScreening],
442
+ request_options: request_options
443
+ )
444
+ end
445
+
446
+ # List case events
447
+ #
448
+ # Read-only audit timeline of the case (created, status changes, assignment, resolution, escalation, transfers,
449
+ # tag/priority/due-date changes, entity actions, and more).
450
+ #
451
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/events/+
452
+ #
453
+ # @param case_uuid [String] Case UUID.
454
+ # @param limit [Integer] Page size.
455
+ # @param offset [Integer] Zero-based offset.
456
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
457
+ # @return [Didit::Page<Didit::Types::CaseEvent>]
458
+ def list_events(case_uuid, limit: OMIT, offset: OMIT, request_options: nil)
459
+ @client.request(
460
+ :get,
461
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/events/",
462
+ path_params: { "case_uuid" => case_uuid },
463
+ query: {
464
+ "limit" => limit,
465
+ "offset" => offset
466
+ },
467
+ scope: :application,
468
+ page: Types::CaseEvent,
469
+ request_options: request_options
470
+ )
471
+ end
472
+
473
+ # List eligible case reviewers
474
+ #
475
+ # Requires `list:cases` for the requested application.
476
+ #
477
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/reviewers/+
478
+ #
479
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
480
+ # @return [Didit::Types::CasesListReviewersResponse]
481
+ def list_reviewers(request_options: nil)
482
+ @client.request(
483
+ :get,
484
+ "/v3/organization/{organization_id}/application/{application_id}/cases/reviewers/",
485
+ scope: :application,
486
+ response: Types::CasesListReviewersResponse,
487
+ request_options: request_options
488
+ )
489
+ end
490
+
491
+ # Print case (PDF)
492
+ #
493
+ # Render the full case (summary, subject, checklist state, notes, attached sessions/transactions, events, FIU
494
+ # report list) as a PDF and return a presigned download URL.
495
+ #
496
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/print/+
497
+ #
498
+ # @param case_uuid [String] Case UUID.
499
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
500
+ # @return [Didit::Types::CasesPrintResponse]
501
+ def print(case_uuid, request_options: nil)
502
+ @client.request(
503
+ :get,
504
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/print/",
505
+ path_params: { "case_uuid" => case_uuid },
506
+ scope: :application,
507
+ response: Types::CasesPrintResponse,
508
+ request_options: request_options
509
+ )
510
+ end
511
+
512
+ # Reject staged resolution (4-eyes)
513
+ #
514
+ # Reject a resolution staged by resolve and return the case to its maker blueprint. The caller must be a
515
+ # different officer than the one who submitted it, otherwise 403. When the resolution names a checker (the
516
+ # case's `checker`), only that member can reject it: any other caller, including an API key, gets 403.
517
+ #
518
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/reject-approval/+
519
+ #
520
+ # @param case_uuid [String] Case UUID.
521
+ # @param notes [String, nil]
522
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
523
+ # @return [Didit::Types::CaseDetail]
524
+ def reject_resolution(case_uuid, notes: OMIT, request_options: nil)
525
+ @client.request(
526
+ :post,
527
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/reject-approval/",
528
+ path_params: { "case_uuid" => case_uuid },
529
+ body: {
530
+ "notes" => notes
531
+ },
532
+ scope: :application,
533
+ response: Types::CaseDetail,
534
+ request_options: request_options
535
+ )
536
+ end
537
+
538
+ # Reopen case
539
+ #
540
+ # Move an awaiting-user or resolved case back to open, clearing resolution, resolution_notes, resolved_at, and
541
+ # resolved_by_email.
542
+ #
543
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/reopen/+
544
+ #
545
+ # @param case_uuid [String] Case UUID.
546
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
547
+ # @return [Didit::Types::CaseDetail]
548
+ def reopen(case_uuid, request_options: nil)
549
+ @client.request(
550
+ :post,
551
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/reopen/",
552
+ path_params: { "case_uuid" => case_uuid },
553
+ scope: :application,
554
+ response: Types::CaseDetail,
555
+ request_options: request_options
556
+ )
557
+ end
558
+
559
+ # Request info (awaiting user)
560
+ #
561
+ # Move an open case to awaiting_user while more information is collected from the verified user. Fails with 400
562
+ # if a resolution is currently pending 4-eyes approval.
563
+ #
564
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/request-info/+
565
+ #
566
+ # @param case_uuid [String] Case UUID.
567
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
568
+ # @return [Didit::Types::CaseDetail]
569
+ def request_info(case_uuid, request_options: nil)
570
+ @client.request(
571
+ :post,
572
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/request-info/",
573
+ path_params: { "case_uuid" => case_uuid },
574
+ scope: :application,
575
+ response: Types::CaseDetail,
576
+ request_options: request_options
577
+ )
578
+ end
579
+
580
+ # Resolve case
581
+ #
582
+ # Resolve the case with one of five resolutions: FALSE_POSITIVE (no concern found), VALID_THREAT (concern
583
+ # confirmed), INCONCLUSIVE, REQUIREMENTS_NOT_MET or REQUIREMENTS_SATISFIED. Blocked with 400 if the blueprint's
584
+ # checklist is not optional and items remain incomplete, or if the blueprint requires a resolution note and none
585
+ # is given. When the case's blueprint has a four-eyes checker step (four_eyes_checker_blueprint), the resolution
586
+ # is staged (case.pending_resolution) and the case moves to the checker blueprint instead of resolving
587
+ # immediately; a different officer must call approve or reject-approval. Submit a four-eyes resolution as a
588
+ # console member: a resolution an API key submits has no recorded maker, so approve and reject-approval return
589
+ # 403 for every caller. On a four-eyes blueprint you can name the member who must approve with `checker`: then
590
+ # only that member can approve or reject the resolution, and the response's `checker` names them. Without
591
+ # `checker`, the resolution waits on the checker blueprint's queue. Sending `checker` for a blueprint without a
592
+ # checker step returns 400.
593
+ #
594
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/resolve/+
595
+ #
596
+ # @param case_uuid [String] Case UUID.
597
+ # @param resolution [String]
598
+ # @param note [String, nil] Required when the blueprint sets require_resolution_note.
599
+ # @param checker [String, nil] Four-eyes blueprints only. The user uuid of the member who must approve this
600
+ # resolution (the same id as `assigned_to.uuid` on a case, or `members[].user_id` on a review team). The member
601
+ # must have case access to this application and cannot be the officer who submits the resolution. Omit it or
602
+ # send null to leave the resolution to the checker queue.
603
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
604
+ # @return [Didit::Types::CaseDetail]
605
+ def resolve(case_uuid, resolution:, note: OMIT, checker: OMIT, request_options: nil)
606
+ @client.request(
607
+ :post,
608
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/resolve/",
609
+ path_params: { "case_uuid" => case_uuid },
610
+ body: {
611
+ "resolution" => resolution,
612
+ "note" => note,
613
+ "checker" => checker
614
+ },
615
+ scope: :application,
616
+ response: Types::CaseDetail,
617
+ request_options: request_options
618
+ )
619
+ end
620
+
621
+ # Get case
622
+ #
623
+ # Retrieve a case with its subject, blueprint, notes, events, links, and checklist.
624
+ #
625
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/+
626
+ #
627
+ # @param case_uuid [String] Case UUID.
628
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
629
+ # @return [Didit::Types::CaseDetail]
630
+ def retrieve(case_uuid, request_options: nil)
631
+ @client.request(
632
+ :get,
633
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/",
634
+ path_params: { "case_uuid" => case_uuid },
635
+ scope: :application,
636
+ response: Types::CaseDetail,
637
+ request_options: request_options
638
+ )
639
+ end
640
+
641
+ # Case analytics
642
+ #
643
+ # Aggregate case analytics for the date range (defaults to the last 30 days; max 731 days). Charts, tables,
644
+ # totals, assignment events, and current queue counts use the same application-scoped filters. Filters use
645
+ # current case values. Dates apply to each metric event, so older cases assigned or resolved during the period
646
+ # remain included. Queue depth is independent of the date range. Invalid filters return 400; an unknown
647
+ # blueprint or assignee returns an empty result.
648
+ #
649
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/statistics/+
650
+ #
651
+ # @param date_from [Date, String] Range start (inclusive). Defaults to 30 days ago.
652
+ # @param date_to [Date, String] Range end (inclusive). Defaults to today.
653
+ # @param blueprint [String] Filter by the current blueprint UUID.
654
+ # @param assigned_to [String] Filter by the current assigned reviewer user UUID.
655
+ # @param priority [String] Filter by current case priority.
656
+ # @param source [String] Filter by case creation source.
657
+ # @param status [String] Filter by current case status.
658
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
659
+ # @return [Didit::Types::CasesRetrieveStatisticsResponse]
660
+ def retrieve_statistics(
661
+ date_from: OMIT,
662
+ date_to: OMIT,
663
+ blueprint: OMIT,
664
+ assigned_to: OMIT,
665
+ priority: OMIT,
666
+ source: OMIT,
667
+ status: OMIT,
668
+ request_options: nil
669
+ )
670
+ @client.request(
671
+ :get,
672
+ "/v3/organization/{organization_id}/application/{application_id}/cases/statistics/",
673
+ query: {
674
+ "date_from" => date_from,
675
+ "date_to" => date_to,
676
+ "blueprint" => blueprint,
677
+ "assigned_to" => assigned_to,
678
+ "priority" => priority,
679
+ "source" => source,
680
+ "status" => status
681
+ },
682
+ scope: :application,
683
+ response: Types::CasesRetrieveStatisticsResponse,
684
+ request_options: request_options
685
+ )
686
+ end
687
+
688
+ # Retry only this failed subject action using its saved inputs. Current write permission is checked. Applied
689
+ # actions return their receipt without executing again. Case closure is independent.
690
+ #
691
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/action-receipts/{receipt_uuid}/retry/+
692
+ #
693
+ # @param case_uuid [String]
694
+ # @param receipt_uuid [String]
695
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
696
+ # @return [Didit::Types::CaseActionCaseActionReceipt]
697
+ def retry_action_receipt(case_uuid, receipt_uuid, request_options: nil)
698
+ @client.request(
699
+ :post,
700
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/action-receipts/{receipt_uuid}/retry/",
701
+ path_params: { "case_uuid" => case_uuid, "receipt_uuid" => receipt_uuid },
702
+ scope: :application,
703
+ response: Types::CaseActionCaseActionReceipt,
704
+ request_options: request_options
705
+ )
706
+ end
707
+
708
+ # Transfer case
709
+ #
710
+ # Move the case to a different, active blueprint of the same application. Requires the current blueprint to have
711
+ # transfer_enabled, otherwise 400.
712
+ #
713
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/transfer/+
714
+ #
715
+ # @param case_uuid [String] Case UUID.
716
+ # @param target_blueprint [String]
717
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
718
+ # @return [Didit::Types::CaseDetail]
719
+ def transfer(case_uuid, target_blueprint:, request_options: nil)
720
+ @client.request(
721
+ :post,
722
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/transfer/",
723
+ path_params: { "case_uuid" => case_uuid },
724
+ body: {
725
+ "target_blueprint" => target_blueprint
726
+ },
727
+ scope: :application,
728
+ response: Types::CaseDetail,
729
+ request_options: request_options
730
+ )
731
+ end
732
+
733
+ # Update case
734
+ #
735
+ # Update the case's title, priority, due date, tags, or owning review team. Send only the fields you want to
736
+ # change; fields you omit keep their value. `tags` replaces the whole tag list. `team` takes the uuid of an
737
+ # active review team of this application (list them with `GET .../cases/teams/`), or null to clear the team.
738
+ # Requires a full-access API key, or `write:cases` for a console member: a key with restricted access gets 403.
739
+ # Logs PRIORITY_CHANGED, DUE_DATE_CHANGED, TAG_ADDED, TAG_REMOVED and TEAM_CHANGED events as applicable; a title
740
+ # change is saved without a timeline event. Returns the updated case.
741
+ #
742
+ # +PATCH /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/+
743
+ #
744
+ # @param case_uuid [String] Case UUID.
745
+ # @param title [String] New case title.
746
+ # @param priority [String]
747
+ # @param due_at [Time, String, nil] New deadline. Send null to clear it.
748
+ # @param tags [Array<String>] The complete tag list. It replaces the current tags.
749
+ # @param team [String, nil] UUID of the review team that owns the case. It must be an active team of this
750
+ # application. Send null to clear the team.
751
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
752
+ # @return [Didit::Types::CaseDetail]
753
+ def update(case_uuid, title: OMIT, priority: OMIT, due_at: OMIT, tags: OMIT, team: OMIT, request_options: nil)
754
+ @client.request(
755
+ :patch,
756
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/",
757
+ path_params: { "case_uuid" => case_uuid },
758
+ body: {
759
+ "title" => title,
760
+ "priority" => priority,
761
+ "due_at" => due_at,
762
+ "tags" => tags,
763
+ "team" => team
764
+ },
765
+ scope: :application,
766
+ response: Types::CaseDetail,
767
+ request_options: request_options
768
+ )
769
+ end
770
+
771
+ # The +cases.blueprints+ resource.
772
+ class Blueprints < Didit::Resource
773
+ # Create blueprint
774
+ #
775
+ # Create a case blueprint: general settings (assignment, escalation, transfer, 4-eyes pairing) plus
776
+ # content_config, the six sections that drive the case page. Set publish=false to create an unpublished draft;
777
+ # Publish creates its first live version. Discarding a never-published draft deletes it.
778
+ #
779
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/+
780
+ #
781
+ # @param name [String] Max 24 characters, e.g. "AML investigation".
782
+ # @param assignee_pool [Array<String>] List of User UUIDs. Empty arrays are rejected with "Pick at least one
783
+ # assignee".
784
+ # @param description [String, nil]
785
+ # @param assignment_method [String]
786
+ # @param max_active_cases [Integer, nil] Automatic-mode threshold: "fewer than N cases of this blueprint
787
+ # assigned".
788
+ # @param escalation_enabled [Boolean]
789
+ # @param escalation_blueprint [String, nil] Target blueprint UUID. Not enforced at save time, but the escalate
790
+ # action fails with 400 until both escalation_enabled and escalation_blueprint are set.
791
+ # @param transfer_enabled [Boolean]
792
+ # @param four_eyes_checker_blueprint [String, nil] Setting this enables 4-eyes review: resolutions on this
793
+ # blueprint stage on the checker blueprint's queue.
794
+ # @param require_resolution_note [Boolean]
795
+ # @param content_config [Hash] The six togglable sections that drive which tabs and fields appear on the case
796
+ # page. Unknown sections or keys are rejected.
797
+ # @param is_active [Boolean]
798
+ # @param default_deadline_hours [Integer, nil] Default deadline for newly opened cases. Existing case
799
+ # deadlines are unchanged.
800
+ # @param publish [Boolean] Set false to save a never-published draft. The record remains inactive at version 0
801
+ # until the draft is explicitly published. Omitting this field preserves immediate creation for existing
802
+ # integrations.
803
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
804
+ # @return [Didit::Types::CaseBlueprintDetail]
805
+ def create(
806
+ name:,
807
+ assignee_pool:,
808
+ description: OMIT,
809
+ assignment_method: OMIT,
810
+ max_active_cases: OMIT,
811
+ escalation_enabled: OMIT,
812
+ escalation_blueprint: OMIT,
813
+ transfer_enabled: OMIT,
814
+ four_eyes_checker_blueprint: OMIT,
815
+ require_resolution_note: OMIT,
816
+ content_config: OMIT,
817
+ is_active: OMIT,
818
+ default_deadline_hours: OMIT,
819
+ publish: OMIT,
820
+ request_options: nil
821
+ )
822
+ @client.request(
823
+ :post,
824
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/",
825
+ body: {
826
+ "name" => name,
827
+ "assignee_pool" => assignee_pool,
828
+ "description" => description,
829
+ "assignment_method" => assignment_method,
830
+ "max_active_cases" => max_active_cases,
831
+ "escalation_enabled" => escalation_enabled,
832
+ "escalation_blueprint" => escalation_blueprint,
833
+ "transfer_enabled" => transfer_enabled,
834
+ "four_eyes_checker_blueprint" => four_eyes_checker_blueprint,
835
+ "require_resolution_note" => require_resolution_note,
836
+ "content_config" => content_config,
837
+ "is_active" => is_active,
838
+ "default_deadline_hours" => default_deadline_hours,
839
+ "publish" => publish
840
+ },
841
+ scope: :application,
842
+ response: Types::CaseBlueprintDetail,
843
+ request_options: request_options
844
+ )
845
+ end
846
+
847
+ # Delete blueprint
848
+ #
849
+ # Delete a blueprint. Deletion always succeeds and does not touch the blueprint's cases: existing cases keep
850
+ # their blueprint reference and its settings continue to apply to them. A deleted blueprint no longer appears
851
+ # in blueprint lists and can no longer be chosen as a transfer target; if a maker blueprint is deleted while a
852
+ # resolution is pending 4-eyes approval, a rejected resolution leaves the case on the checker blueprint.
853
+ #
854
+ # +DELETE /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/+
855
+ #
856
+ # @param blueprint_uuid [String] Blueprint UUID.
857
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
858
+ # @return [nil]
859
+ def delete(blueprint_uuid, request_options: nil)
860
+ @client.request(
861
+ :delete,
862
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/",
863
+ path_params: { "blueprint_uuid" => blueprint_uuid },
864
+ scope: :application,
865
+ request_options: request_options
866
+ )
867
+ end
868
+
869
+ # +DELETE /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/draft/+
870
+ #
871
+ # @param blueprint_uuid [String]
872
+ # @param expected_version [Integer]
873
+ # @param expected_revision [String, nil]
874
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
875
+ # @return [nil]
876
+ def discard_draft(blueprint_uuid, expected_version:, expected_revision:, request_options: nil)
877
+ @client.request(
878
+ :delete,
879
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/draft/",
880
+ path_params: { "blueprint_uuid" => blueprint_uuid },
881
+ body: {
882
+ "expected_version" => expected_version,
883
+ "expected_revision" => expected_revision
884
+ },
885
+ scope: :application,
886
+ request_options: request_options
887
+ )
888
+ end
889
+
890
+ # Install blueprint presets
891
+ #
892
+ # Copy one or more presets into the application as editable blueprints. Idempotent per preset_key; omit
893
+ # preset_keys to install every preset not yet installed.
894
+ #
895
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/presets/install/+
896
+ #
897
+ # @param preset_keys [Array<String>, nil] Subset of screening_hit, aml_investigation, suspicious_activity,
898
+ # kyc. Omit to install all.
899
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
900
+ # @return [Didit::Types::CaseBlueprintPresetInstallResult]
901
+ def install_presets(preset_keys: OMIT, request_options: nil)
902
+ @client.request(
903
+ :post,
904
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/presets/install/",
905
+ body: {
906
+ "preset_keys" => preset_keys
907
+ },
908
+ scope: :application,
909
+ response: Types::CaseBlueprintPresetInstallResult,
910
+ request_options: request_options
911
+ )
912
+ end
913
+
914
+ # List blueprints
915
+ #
916
+ # List case blueprints for the application.
917
+ #
918
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/+
919
+ #
920
+ # @param limit [Integer] Page size.
921
+ # @param offset [Integer] Zero-based offset.
922
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
923
+ # @return [Didit::Page<Didit::Types::CaseBlueprintListItem>]
924
+ def list(limit: OMIT, offset: OMIT, request_options: nil)
925
+ @client.request(
926
+ :get,
927
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/",
928
+ query: {
929
+ "limit" => limit,
930
+ "offset" => offset
931
+ },
932
+ scope: :application,
933
+ page: Types::CaseBlueprintListItem,
934
+ request_options: request_options
935
+ )
936
+ end
937
+
938
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/history/+
939
+ #
940
+ # @param blueprint_uuid [String]
941
+ # @param ordering [String] Which field to use when ordering the results.
942
+ # @param limit [Integer] Number of results to return per page.
943
+ # @param offset [Integer] The initial index from which to return the results.
944
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
945
+ # @return [Didit::Page<Didit::Types::CasePublicationPolicyRevision>]
946
+ def list_history(blueprint_uuid, ordering: OMIT, limit: OMIT, offset: OMIT, request_options: nil)
947
+ @client.request(
948
+ :get,
949
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/history/",
950
+ path_params: { "blueprint_uuid" => blueprint_uuid },
951
+ query: {
952
+ "ordering" => ordering,
953
+ "limit" => limit,
954
+ "offset" => offset
955
+ },
956
+ scope: :application,
957
+ page: Types::CasePublicationPolicyRevision,
958
+ request_options: request_options
959
+ )
960
+ end
961
+
962
+ # List blueprint presets
963
+ #
964
+ # List the four built-in presets (Screening hit, AML investigation, Suspicious activity, KYC review) with
965
+ # their content_config and whether each is already installed on this application.
966
+ #
967
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/presets/+
968
+ #
969
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
970
+ # @return [Didit::Types::CasesBlueprintsListPresetsResponse]
971
+ def list_presets(request_options: nil)
972
+ @client.request(
973
+ :get,
974
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/presets/",
975
+ scope: :application,
976
+ response: Types::CasesBlueprintsListPresetsResponse,
977
+ request_options: request_options
978
+ )
979
+ end
980
+
981
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/publish/+
982
+ #
983
+ # @param blueprint_uuid [String]
984
+ # @param expected_version [Integer]
985
+ # @param expected_revision [String, nil]
986
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
987
+ # @return [Didit::Types::CasePublicationCaseBlueprint]
988
+ def publish(blueprint_uuid, expected_version:, expected_revision:, request_options: nil)
989
+ @client.request(
990
+ :post,
991
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/publish/",
992
+ path_params: { "blueprint_uuid" => blueprint_uuid },
993
+ body: {
994
+ "expected_version" => expected_version,
995
+ "expected_revision" => expected_revision
996
+ },
997
+ scope: :application,
998
+ response: Types::CasePublicationCaseBlueprint,
999
+ request_options: request_options
1000
+ )
1001
+ end
1002
+
1003
+ # Get blueprint
1004
+ #
1005
+ # Retrieve a blueprint, including its connected creation sources (AML config, transaction rules, workflow
1006
+ # nodes) and which blueprints escalate to it.
1007
+ #
1008
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/+
1009
+ #
1010
+ # @param blueprint_uuid [String] Blueprint UUID.
1011
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1012
+ # @return [Didit::Types::CaseBlueprintDetail]
1013
+ def retrieve(blueprint_uuid, request_options: nil)
1014
+ @client.request(
1015
+ :get,
1016
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/",
1017
+ path_params: { "blueprint_uuid" => blueprint_uuid },
1018
+ scope: :application,
1019
+ response: Types::CaseBlueprintDetail,
1020
+ request_options: request_options
1021
+ )
1022
+ end
1023
+
1024
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/draft/+
1025
+ #
1026
+ # @param blueprint_uuid [String]
1027
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1028
+ # @return [Didit::Types::CasePublicationPolicyDraftResponse]
1029
+ def retrieve_draft(blueprint_uuid, request_options: nil)
1030
+ @client.request(
1031
+ :get,
1032
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/draft/",
1033
+ path_params: { "blueprint_uuid" => blueprint_uuid },
1034
+ scope: :application,
1035
+ response: Types::CasePublicationPolicyDraftResponse,
1036
+ request_options: request_options
1037
+ )
1038
+ end
1039
+
1040
+ # +PUT /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/draft/+
1041
+ #
1042
+ # @param blueprint_uuid [String]
1043
+ # @param expected_version [Integer]
1044
+ # @param expected_revision [String, nil]
1045
+ # @param changes [Hash]
1046
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1047
+ # @return [Didit::Types::CasePublicationPolicyDraft]
1048
+ def save_draft(blueprint_uuid, expected_version:, expected_revision:, changes:, request_options: nil)
1049
+ @client.request(
1050
+ :put,
1051
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/draft/",
1052
+ path_params: { "blueprint_uuid" => blueprint_uuid },
1053
+ body: {
1054
+ "expected_version" => expected_version,
1055
+ "expected_revision" => expected_revision,
1056
+ "changes" => changes
1057
+ },
1058
+ scope: :application,
1059
+ response: Types::CasePublicationPolicyDraft,
1060
+ request_options: request_options
1061
+ )
1062
+ end
1063
+
1064
+ # Update blueprint
1065
+ #
1066
+ # Partially update a blueprint's general settings or content_config.
1067
+ #
1068
+ # +PATCH /v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/+
1069
+ #
1070
+ # @param blueprint_uuid [String] Blueprint UUID.
1071
+ # @param name [String] Max 24 characters, e.g. "AML investigation".
1072
+ # @param description [String, nil]
1073
+ # @param assignee_pool [Array<String>] List of User UUIDs. Empty arrays are rejected with "Pick at least one
1074
+ # assignee".
1075
+ # @param assignment_method [String]
1076
+ # @param max_active_cases [Integer, nil] Automatic-mode threshold: "fewer than N cases of this blueprint
1077
+ # assigned".
1078
+ # @param escalation_enabled [Boolean]
1079
+ # @param escalation_blueprint [String, nil] Target blueprint UUID. Not enforced at save time, but the escalate
1080
+ # action fails with 400 until both escalation_enabled and escalation_blueprint are set.
1081
+ # @param transfer_enabled [Boolean]
1082
+ # @param four_eyes_checker_blueprint [String, nil] Setting this enables 4-eyes review: resolutions on this
1083
+ # blueprint stage on the checker blueprint's queue.
1084
+ # @param require_resolution_note [Boolean]
1085
+ # @param content_config [Hash] The six togglable sections that drive which tabs and fields appear on the case
1086
+ # page. Unknown sections or keys are rejected.
1087
+ # @param is_active [Boolean]
1088
+ # @param default_deadline_hours [Integer, nil] Default deadline for newly opened cases. Existing case
1089
+ # deadlines are unchanged.
1090
+ # @param expected_version [Integer] The version opened by the editor. A stale version returns 409 without
1091
+ # changing the review policy.
1092
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1093
+ # @return [Didit::Types::CaseBlueprintDetail]
1094
+ def update(
1095
+ blueprint_uuid,
1096
+ name: OMIT,
1097
+ description: OMIT,
1098
+ assignee_pool: OMIT,
1099
+ assignment_method: OMIT,
1100
+ max_active_cases: OMIT,
1101
+ escalation_enabled: OMIT,
1102
+ escalation_blueprint: OMIT,
1103
+ transfer_enabled: OMIT,
1104
+ four_eyes_checker_blueprint: OMIT,
1105
+ require_resolution_note: OMIT,
1106
+ content_config: OMIT,
1107
+ is_active: OMIT,
1108
+ default_deadline_hours: OMIT,
1109
+ expected_version: OMIT,
1110
+ request_options: nil
1111
+ )
1112
+ @client.request(
1113
+ :patch,
1114
+ "/v3/organization/{organization_id}/application/{application_id}/cases/blueprints/{blueprint_uuid}/",
1115
+ path_params: { "blueprint_uuid" => blueprint_uuid },
1116
+ body: {
1117
+ "name" => name,
1118
+ "description" => description,
1119
+ "assignee_pool" => assignee_pool,
1120
+ "assignment_method" => assignment_method,
1121
+ "max_active_cases" => max_active_cases,
1122
+ "escalation_enabled" => escalation_enabled,
1123
+ "escalation_blueprint" => escalation_blueprint,
1124
+ "transfer_enabled" => transfer_enabled,
1125
+ "four_eyes_checker_blueprint" => four_eyes_checker_blueprint,
1126
+ "require_resolution_note" => require_resolution_note,
1127
+ "content_config" => content_config,
1128
+ "is_active" => is_active,
1129
+ "default_deadline_hours" => default_deadline_hours,
1130
+ "expected_version" => expected_version
1131
+ },
1132
+ scope: :application,
1133
+ response: Types::CaseBlueprintDetail,
1134
+ request_options: request_options
1135
+ )
1136
+ end
1137
+ end
1138
+
1139
+ # The +cases.checklist+ resource.
1140
+ class Checklist < Didit::Resource
1141
+ # List case checklist
1142
+ #
1143
+ # List the case's checklist items, copied from the blueprint's content_config.checklist.items at creation,
1144
+ # ordered.
1145
+ #
1146
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/checklist/+
1147
+ #
1148
+ # @param case_uuid [String] Case UUID.
1149
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1150
+ # @return [Array<Didit::Types::CaseChecklistItem>]
1151
+ def list(case_uuid, request_options: nil)
1152
+ @client.request(
1153
+ :get,
1154
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/checklist/",
1155
+ path_params: { "case_uuid" => case_uuid },
1156
+ scope: :application,
1157
+ response: [:array, Types::CaseChecklistItem],
1158
+ request_options: request_options
1159
+ )
1160
+ end
1161
+
1162
+ # Toggle checklist item
1163
+ #
1164
+ # Mark a checklist item complete or incomplete. Resolution is blocked while any item is incomplete, unless the
1165
+ # blueprint marks the checklist optional.
1166
+ #
1167
+ # +PATCH /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/checklist/{item_uuid}/+
1168
+ #
1169
+ # @param case_uuid [String] Case UUID.
1170
+ # @param item_uuid [String] Checklist item UUID.
1171
+ # @param is_completed [Boolean]
1172
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1173
+ # @return [Didit::Types::CaseChecklistItem]
1174
+ def toggle_item(case_uuid, item_uuid, is_completed:, request_options: nil)
1175
+ @client.request(
1176
+ :patch,
1177
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/checklist/{item_uuid}/",
1178
+ path_params: { "case_uuid" => case_uuid, "item_uuid" => item_uuid },
1179
+ body: {
1180
+ "is_completed" => is_completed
1181
+ },
1182
+ scope: :application,
1183
+ response: Types::CaseChecklistItem,
1184
+ request_options: request_options
1185
+ )
1186
+ end
1187
+ end
1188
+
1189
+ # The +cases.links+ resource.
1190
+ class Links < Didit::Resource
1191
+ # Add case link
1192
+ #
1193
+ # Attach a session, business session, or transaction to the case. Rejected with 400 if the entity belongs to a
1194
+ # different subject than the case.
1195
+ #
1196
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/links/+
1197
+ #
1198
+ # @param case_uuid [String] Case UUID.
1199
+ # @param entity_type [String]
1200
+ # @param entity_uuid [String]
1201
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1202
+ # @return [Didit::Types::CaseLink]
1203
+ def create(case_uuid, entity_type:, entity_uuid:, request_options: nil)
1204
+ @client.request(
1205
+ :post,
1206
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/links/",
1207
+ path_params: { "case_uuid" => case_uuid },
1208
+ body: {
1209
+ "entity_type" => entity_type,
1210
+ "entity_uuid" => entity_uuid
1211
+ },
1212
+ scope: :application,
1213
+ response: Types::CaseLink,
1214
+ request_options: request_options
1215
+ )
1216
+ end
1217
+
1218
+ # Remove case link
1219
+ #
1220
+ # Detach a linked session, business session, or transaction from the case.
1221
+ #
1222
+ # +DELETE /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/links/{link_uuid}/+
1223
+ #
1224
+ # @param case_uuid [String] Case UUID.
1225
+ # @param link_uuid [String] Link UUID.
1226
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1227
+ # @return [nil]
1228
+ def delete(case_uuid, link_uuid, request_options: nil)
1229
+ @client.request(
1230
+ :delete,
1231
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/links/{link_uuid}/",
1232
+ path_params: { "case_uuid" => case_uuid, "link_uuid" => link_uuid },
1233
+ scope: :application,
1234
+ request_options: request_options
1235
+ )
1236
+ end
1237
+
1238
+ # List case links
1239
+ #
1240
+ # List sessions, business sessions, and transactions attached to the case.
1241
+ #
1242
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/links/+
1243
+ #
1244
+ # @param case_uuid [String] Case UUID.
1245
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1246
+ # @return [Array<Didit::Types::CaseLink>]
1247
+ def list(case_uuid, request_options: nil)
1248
+ @client.request(
1249
+ :get,
1250
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/links/",
1251
+ path_params: { "case_uuid" => case_uuid },
1252
+ scope: :application,
1253
+ response: [:array, Types::CaseLink],
1254
+ request_options: request_options
1255
+ )
1256
+ end
1257
+ end
1258
+
1259
+ # The +cases.notes+ resource.
1260
+ class Notes < Didit::Resource
1261
+ # Add a case-scoped note. An optional client_reference makes an unchanged retry return the same note without
1262
+ # duplicate activity or notifications. reply_to must identify a live note in this case. The response includes
1263
+ # a bounded parent excerpt without copying that excerpt into the saved reply.
1264
+ #
1265
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/+
1266
+ #
1267
+ # @param case_uuid [String]
1268
+ # @param comment [String]
1269
+ # @param reply_to [String, nil]
1270
+ # @param client_reference [String, nil]
1271
+ # @param mentioned_emails [Array<String>]
1272
+ # @param is_internal [Boolean]
1273
+ # @param attachments [Array<Hash>]
1274
+ # @param tags [Array<String>]
1275
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1276
+ # @return [Didit::Types::CaseCollaborationCaseNote]
1277
+ def create(
1278
+ case_uuid,
1279
+ comment:,
1280
+ reply_to: OMIT,
1281
+ client_reference: OMIT,
1282
+ mentioned_emails: OMIT,
1283
+ is_internal: OMIT,
1284
+ attachments: OMIT,
1285
+ tags: OMIT,
1286
+ request_options: nil
1287
+ )
1288
+ @client.request(
1289
+ :post,
1290
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/",
1291
+ path_params: { "case_uuid" => case_uuid },
1292
+ body: {
1293
+ "comment" => comment,
1294
+ "reply_to" => reply_to,
1295
+ "client_reference" => client_reference,
1296
+ "mentioned_emails" => mentioned_emails,
1297
+ "is_internal" => is_internal,
1298
+ "attachments" => attachments,
1299
+ "tags" => tags
1300
+ },
1301
+ scope: :application,
1302
+ response: Types::CaseCollaborationCaseNote,
1303
+ request_options: request_options
1304
+ )
1305
+ end
1306
+
1307
+ # Upload note attachment
1308
+ #
1309
+ # Upload a file (JPEG, PNG, WebP, PDF, plain text, or CSV; max 5 MB) to attach to a note. Returns the s3_key
1310
+ # to pass in the note's attachments array.
1311
+ #
1312
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/presign/+
1313
+ #
1314
+ # @param case_uuid [String] Case UUID.
1315
+ # @param file [Pathname, IO, String, Didit::FilePart]
1316
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1317
+ # @return [Didit::Types::CasesNotesCreateAttachmentUploadResponse]
1318
+ def create_attachment_upload(case_uuid, file:, request_options: nil)
1319
+ @client.request(
1320
+ :post,
1321
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/presign/",
1322
+ path_params: { "case_uuid" => case_uuid },
1323
+ body: {
1324
+ "file" => file
1325
+ },
1326
+ encoding: :multipart,
1327
+ file_fields: %w[file],
1328
+ scope: :application,
1329
+ response: Types::CasesNotesCreateAttachmentUploadResponse,
1330
+ request_options: request_options
1331
+ )
1332
+ end
1333
+
1334
+ # +DELETE /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/{note_uuid}/+
1335
+ #
1336
+ # @param case_uuid [String]
1337
+ # @param note_uuid [String]
1338
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1339
+ # @return [nil]
1340
+ def delete(case_uuid, note_uuid, request_options: nil)
1341
+ @client.request(
1342
+ :delete,
1343
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/{note_uuid}/",
1344
+ path_params: { "case_uuid" => case_uuid, "note_uuid" => note_uuid },
1345
+ scope: :application,
1346
+ request_options: request_options
1347
+ )
1348
+ end
1349
+
1350
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/+
1351
+ #
1352
+ # @param case_uuid [String]
1353
+ # @param ordering [String] Which field to use when ordering the results.
1354
+ # @param limit [Integer] Number of results to return per page.
1355
+ # @param offset [Integer] The initial index from which to return the results.
1356
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1357
+ # @return [Didit::Page<Didit::Types::CaseCollaborationCaseNote>]
1358
+ def list(case_uuid, ordering: OMIT, limit: OMIT, offset: OMIT, request_options: nil)
1359
+ @client.request(
1360
+ :get,
1361
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/",
1362
+ path_params: { "case_uuid" => case_uuid },
1363
+ query: {
1364
+ "ordering" => ordering,
1365
+ "limit" => limit,
1366
+ "offset" => offset
1367
+ },
1368
+ scope: :application,
1369
+ page: Types::CaseCollaborationCaseNote,
1370
+ request_options: request_options
1371
+ )
1372
+ end
1373
+
1374
+ # Get note attachment URL
1375
+ #
1376
+ # Mint a fresh presigned download URL for an attachment already stored on one of the case's notes.
1377
+ #
1378
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/presign/+
1379
+ #
1380
+ # @param case_uuid [String] Case UUID.
1381
+ # @param s3_key [String] The attachment's s3_key, as returned by upload or listed on the note.
1382
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1383
+ # @return [Didit::Types::CasesNotesRetrieveAttachmentUrlResponse]
1384
+ def retrieve_attachment_url(case_uuid, s3_key:, request_options: nil)
1385
+ @client.request(
1386
+ :get,
1387
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/presign/",
1388
+ path_params: { "case_uuid" => case_uuid },
1389
+ query: {
1390
+ "s3_key" => s3_key
1391
+ },
1392
+ scope: :application,
1393
+ response: Types::CasesNotesRetrieveAttachmentUrlResponse,
1394
+ request_options: request_options
1395
+ )
1396
+ end
1397
+
1398
+ # Pin or unpin an existing note. Pinned notes appear first. Pin changes are recorded in case activity and do
1399
+ # not change evidence or source decisions.
1400
+ #
1401
+ # +PATCH /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/{note_uuid}/+
1402
+ #
1403
+ # @param case_uuid [String]
1404
+ # @param note_uuid [String]
1405
+ # @param is_pinned [Boolean]
1406
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1407
+ # @return [Didit::Types::CaseCollaborationCaseNote]
1408
+ def update(case_uuid, note_uuid, is_pinned: OMIT, request_options: nil)
1409
+ @client.request(
1410
+ :patch,
1411
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/notes/{note_uuid}/",
1412
+ path_params: { "case_uuid" => case_uuid, "note_uuid" => note_uuid },
1413
+ body: {
1414
+ "is_pinned" => is_pinned
1415
+ },
1416
+ scope: :application,
1417
+ response: Types::CaseCollaborationCaseNote,
1418
+ request_options: request_options
1419
+ )
1420
+ end
1421
+ end
1422
+
1423
+ # The +cases.regulatory_reports+ resource.
1424
+ class RegulatoryReports < Didit::Resource
1425
+ # Create report from case
1426
+ #
1427
+ # Create a draft FIU report for the case: DRAFT status, auto-populated from the optional template plus the
1428
+ # case's subject, linked transactions, and narrative. Validate then finalize to produce the goAML XML and PDF.
1429
+ #
1430
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/regulatory-reports/+
1431
+ #
1432
+ # @param case_uuid [String] Case UUID.
1433
+ # @param report_type [String] Required unless a template is given; the template's report_type is used
1434
+ # otherwise.
1435
+ # @param jurisdiction [String] Required unless a template is given.
1436
+ # @param template [String, nil] Report template UUID; its field_config seeds the draft before case-derived
1437
+ # data is merged in.
1438
+ # @param transactions [Array<String>, nil] Transactions to attach; defaults to the case's linked transactions.
1439
+ # @param rentity_id [String, nil]
1440
+ # @param rentity_branch [String, nil]
1441
+ # @param submission_code [String]
1442
+ # @param entity_reference [String, nil]
1443
+ # @param fiu_ref_number [String, nil]
1444
+ # @param currency_code_local [String, nil]
1445
+ # @param submission_date [Time, String, nil]
1446
+ # @param reporting_person [Hash]
1447
+ # @param location [Hash]
1448
+ # @param reason [String, nil]
1449
+ # @param action [String, nil]
1450
+ # @param activity [String, nil]
1451
+ # @param narrative [Hash]
1452
+ # @param report_indicators [Array<String>]
1453
+ # @param included_fields [Array<String>]
1454
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1455
+ # @return [Didit::Types::RegulatoryReportDetail]
1456
+ def create(
1457
+ case_uuid,
1458
+ report_type: OMIT,
1459
+ jurisdiction: OMIT,
1460
+ template: OMIT,
1461
+ transactions: OMIT,
1462
+ rentity_id: OMIT,
1463
+ rentity_branch: OMIT,
1464
+ submission_code: OMIT,
1465
+ entity_reference: OMIT,
1466
+ fiu_ref_number: OMIT,
1467
+ currency_code_local: OMIT,
1468
+ submission_date: OMIT,
1469
+ reporting_person: OMIT,
1470
+ location: OMIT,
1471
+ reason: OMIT,
1472
+ action: OMIT,
1473
+ activity: OMIT,
1474
+ narrative: OMIT,
1475
+ report_indicators: OMIT,
1476
+ included_fields: OMIT,
1477
+ request_options: nil
1478
+ )
1479
+ @client.request(
1480
+ :post,
1481
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/regulatory-reports/",
1482
+ path_params: { "case_uuid" => case_uuid },
1483
+ body: {
1484
+ "report_type" => report_type,
1485
+ "jurisdiction" => jurisdiction,
1486
+ "template" => template,
1487
+ "transactions" => transactions,
1488
+ "rentity_id" => rentity_id,
1489
+ "rentity_branch" => rentity_branch,
1490
+ "submission_code" => submission_code,
1491
+ "entity_reference" => entity_reference,
1492
+ "fiu_ref_number" => fiu_ref_number,
1493
+ "currency_code_local" => currency_code_local,
1494
+ "submission_date" => submission_date,
1495
+ "reporting_person" => reporting_person,
1496
+ "location" => location,
1497
+ "reason" => reason,
1498
+ "action" => action,
1499
+ "activity" => activity,
1500
+ "narrative" => narrative,
1501
+ "report_indicators" => report_indicators,
1502
+ "included_fields" => included_fields
1503
+ },
1504
+ scope: :application,
1505
+ response: Types::RegulatoryReportDetail,
1506
+ request_options: request_options
1507
+ )
1508
+ end
1509
+
1510
+ # List reports for case
1511
+ #
1512
+ # List FIU reports generated for the case.
1513
+ #
1514
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/regulatory-reports/+
1515
+ #
1516
+ # @param case_uuid [String] Case UUID.
1517
+ # @param limit [Integer] Page size.
1518
+ # @param offset [Integer] Zero-based offset.
1519
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1520
+ # @return [Didit::Page<Didit::Types::RegulatoryReportDetail>]
1521
+ def list(case_uuid, limit: OMIT, offset: OMIT, request_options: nil)
1522
+ @client.request(
1523
+ :get,
1524
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/regulatory-reports/",
1525
+ path_params: { "case_uuid" => case_uuid },
1526
+ query: {
1527
+ "limit" => limit,
1528
+ "offset" => offset
1529
+ },
1530
+ scope: :application,
1531
+ page: Types::RegulatoryReportDetail,
1532
+ request_options: request_options
1533
+ )
1534
+ end
1535
+ end
1536
+
1537
+ # The +cases.requests+ resource.
1538
+ class Requests < Didit::Resource
1539
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/{request_uuid}/cancel/+
1540
+ #
1541
+ # @param case_uuid [String]
1542
+ # @param request_uuid [String]
1543
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1544
+ # @return [Didit::Types::CustomerMessagingCaseRequest]
1545
+ def cancel(case_uuid, request_uuid, request_options: nil)
1546
+ @client.request(
1547
+ :post,
1548
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/{request_uuid}/cancel/",
1549
+ path_params: { "case_uuid" => case_uuid, "request_uuid" => request_uuid },
1550
+ scope: :application,
1551
+ response: Types::CustomerMessagingCaseRequest,
1552
+ request_options: request_options
1553
+ )
1554
+ end
1555
+
1556
+ # Confirm the exact signed preview within 15 minutes. Only fixed templates and an OTP-verified contact
1557
+ # belonging to the case subject are accepted. The request ID makes retries idempotent. Delivery is queued;
1558
+ # SENT, SIMULATED and UNKNOWN are distinct outcomes. An actionable request sets the case to Awaiting user. A
1559
+ # review update leaves its status unchanged.
1560
+ #
1561
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/+
1562
+ #
1563
+ # @param case_uuid [String]
1564
+ # @param contact_id [String]
1565
+ # @param purpose [String] * `identity_document` - identity_document * `proof_of_address` - proof_of_address *
1566
+ # `business_document` - business_document * `confirm_details` - confirm_details * `review_in_progress` -
1567
+ # review_in_progress
1568
+ # @param request_id [String]
1569
+ # @param expires_at [Time, String]
1570
+ # @param preview_token [String]
1571
+ # @param language [String]
1572
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1573
+ # @return [Didit::Types::CustomerMessagingCaseRequest]
1574
+ def create(
1575
+ case_uuid,
1576
+ contact_id:,
1577
+ purpose:,
1578
+ request_id:,
1579
+ expires_at:,
1580
+ preview_token:,
1581
+ language: OMIT,
1582
+ request_options: nil
1583
+ )
1584
+ @client.request(
1585
+ :post,
1586
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/",
1587
+ path_params: { "case_uuid" => case_uuid },
1588
+ body: {
1589
+ "contact_id" => contact_id,
1590
+ "purpose" => purpose,
1591
+ "request_id" => request_id,
1592
+ "expires_at" => expires_at,
1593
+ "preview_token" => preview_token,
1594
+ "language" => language
1595
+ },
1596
+ scope: :application,
1597
+ response: Types::CustomerMessagingCaseRequest,
1598
+ request_options: request_options
1599
+ )
1600
+ end
1601
+
1602
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/+
1603
+ #
1604
+ # @param case_uuid [String]
1605
+ # @param ordering [String] Which field to use when ordering the results.
1606
+ # @param limit [Integer] Number of results to return per page.
1607
+ # @param offset [Integer] The initial index from which to return the results.
1608
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1609
+ # @return [Didit::Page<Didit::Types::CustomerMessagingCaseRequest>]
1610
+ def list(case_uuid, ordering: OMIT, limit: OMIT, offset: OMIT, request_options: nil)
1611
+ @client.request(
1612
+ :get,
1613
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/",
1614
+ path_params: { "case_uuid" => case_uuid },
1615
+ query: {
1616
+ "ordering" => ordering,
1617
+ "limit" => limit,
1618
+ "offset" => offset
1619
+ },
1620
+ scope: :application,
1621
+ page: Types::CustomerMessagingCaseRequest,
1622
+ request_options: request_options
1623
+ )
1624
+ end
1625
+
1626
+ # Render the production email without sending or changing the case. Returns the exact recipient, sender,
1627
+ # subject, body and a signed preview_token. Send the same contact_id, purpose, language, request_id,
1628
+ # expires_at and preview_token to confirm within 15 minutes.
1629
+ #
1630
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/preview/+
1631
+ #
1632
+ # @param case_uuid [String]
1633
+ # @param contact_id [String]
1634
+ # @param purpose [String] * `identity_document` - identity_document * `proof_of_address` - proof_of_address *
1635
+ # `business_document` - business_document * `confirm_details` - confirm_details * `review_in_progress` -
1636
+ # review_in_progress
1637
+ # @param language [String]
1638
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1639
+ # @return [Didit::Types::CustomerMessagingCaseRequestPreviewResponse]
1640
+ def preview(case_uuid, contact_id:, purpose:, language: OMIT, request_options: nil)
1641
+ @client.request(
1642
+ :post,
1643
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/preview/",
1644
+ path_params: { "case_uuid" => case_uuid },
1645
+ body: {
1646
+ "contact_id" => contact_id,
1647
+ "purpose" => purpose,
1648
+ "language" => language
1649
+ },
1650
+ scope: :application,
1651
+ response: Types::CustomerMessagingCaseRequestPreviewResponse,
1652
+ request_options: request_options
1653
+ )
1654
+ end
1655
+
1656
+ # Remind the customer of a request
1657
+ #
1658
+ # Send a waiting customer request's email again, to the same verified recipient, with the same content. You
1659
+ # can remind a request at most once every 24 hours. A reminder changes nothing else: the request keeps its
1660
+ # deadline and the case keeps its status. Each reminder is logged on the case as a CUSTOMER_REQUEST event with
1661
+ # action `reminded`. The response's `delivery_status` is how this reminder's delivery ended: SENT, SIMULATED
1662
+ # (the email was not sent), or UNKNOWN (the email might have been accepted; it is not sent again
1663
+ # automatically). `next_reminder_at` is when you can remind this request again. Returns 409 with a `reason`
1664
+ # when the customer no longer has the request to answer, and 429 with `retry_at` and a `Retry-After` header
1665
+ # when the request was reminded in the last 24 hours. Requires `write:cases`.
1666
+ #
1667
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/{request_uuid}/remind/+
1668
+ #
1669
+ # @param case_uuid [String] Case UUID.
1670
+ # @param request_uuid [String] Customer request UUID, from the case's request list.
1671
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1672
+ # @return [Didit::Types::CasesRequestsRemindResponse]
1673
+ def remind(case_uuid, request_uuid, request_options: nil)
1674
+ @client.request(
1675
+ :post,
1676
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/{request_uuid}/remind/",
1677
+ path_params: { "case_uuid" => case_uuid, "request_uuid" => request_uuid },
1678
+ scope: :application,
1679
+ response: Types::CasesRequestsRemindResponse,
1680
+ request_options: request_options
1681
+ )
1682
+ end
1683
+
1684
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/{request_uuid}/attachment/+
1685
+ #
1686
+ # @param case_uuid [String]
1687
+ # @param request_uuid [String]
1688
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1689
+ # @return [String, nil] the body bytes, or nil when a block receives the chunks
1690
+ def retrieve_attachment(case_uuid, request_uuid, request_options: nil, &block)
1691
+ @client.request(
1692
+ :get,
1693
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/{request_uuid}/attachment/",
1694
+ path_params: { "case_uuid" => case_uuid, "request_uuid" => request_uuid },
1695
+ scope: :application,
1696
+ response: :binary,
1697
+ accept: "image/jpeg, application/json",
1698
+ request_options: request_options, &block
1699
+ )
1700
+ end
1701
+
1702
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/options/+
1703
+ #
1704
+ # @param case_uuid [String]
1705
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1706
+ # @return [Didit::Types::CustomerMessagingCaseRequestOptions]
1707
+ def retrieve_options(case_uuid, request_options: nil)
1708
+ @client.request(
1709
+ :get,
1710
+ "/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/requests/options/",
1711
+ path_params: { "case_uuid" => case_uuid },
1712
+ scope: :application,
1713
+ response: Types::CustomerMessagingCaseRequestOptions,
1714
+ request_options: request_options
1715
+ )
1716
+ end
1717
+ end
1718
+
1719
+ # The +cases.routing_rules+ resource.
1720
+ class RoutingRules < Didit::Resource
1721
+ # Create routing rule
1722
+ #
1723
+ # Requires `write:cases` for the requested application. Set publish=false to create an unpublished draft;
1724
+ # Publish creates its first live version. Discarding a never-published draft deletes it.
1725
+ #
1726
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/+
1727
+ #
1728
+ # @param name [String]
1729
+ # @param conditions [Array<Hash>]
1730
+ # @param blueprint [String]
1731
+ # @param description [String]
1732
+ # @param priority [Integer]
1733
+ # @param required_skills [Array<String>]
1734
+ # @param team [String, nil]
1735
+ # @param is_active [Boolean]
1736
+ # @param publish [Boolean] Set false to save a never-published draft. The record remains inactive at version 0
1737
+ # until the draft is explicitly published. Omitting this field preserves immediate creation for existing
1738
+ # integrations.
1739
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1740
+ # @return [Didit::Types::CaseRoutingRule]
1741
+ def create(
1742
+ name:,
1743
+ conditions:,
1744
+ blueprint:,
1745
+ description: OMIT,
1746
+ priority: OMIT,
1747
+ required_skills: OMIT,
1748
+ team: OMIT,
1749
+ is_active: OMIT,
1750
+ publish: OMIT,
1751
+ request_options: nil
1752
+ )
1753
+ @client.request(
1754
+ :post,
1755
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/",
1756
+ body: {
1757
+ "name" => name,
1758
+ "conditions" => conditions,
1759
+ "blueprint" => blueprint,
1760
+ "description" => description,
1761
+ "priority" => priority,
1762
+ "required_skills" => required_skills,
1763
+ "team" => team,
1764
+ "is_active" => is_active,
1765
+ "publish" => publish
1766
+ },
1767
+ scope: :application,
1768
+ response: Types::CaseRoutingRule,
1769
+ request_options: request_options
1770
+ )
1771
+ end
1772
+
1773
+ # +DELETE /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/draft/+
1774
+ #
1775
+ # @param record_uuid [String]
1776
+ # @param expected_version [Integer]
1777
+ # @param expected_revision [String, nil]
1778
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1779
+ # @return [nil]
1780
+ def discard_draft(record_uuid, expected_version:, expected_revision:, request_options: nil)
1781
+ @client.request(
1782
+ :delete,
1783
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/draft/",
1784
+ path_params: { "record_uuid" => record_uuid },
1785
+ body: {
1786
+ "expected_version" => expected_version,
1787
+ "expected_revision" => expected_revision
1788
+ },
1789
+ scope: :application,
1790
+ request_options: request_options
1791
+ )
1792
+ end
1793
+
1794
+ # List routing rules
1795
+ #
1796
+ # Requires `list:cases` for the requested application.
1797
+ #
1798
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/+
1799
+ #
1800
+ # @param limit [Integer]
1801
+ # @param offset [Integer]
1802
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1803
+ # @return [Didit::Page<Didit::Types::CaseRoutingRule>]
1804
+ def list(limit: OMIT, offset: OMIT, request_options: nil)
1805
+ @client.request(
1806
+ :get,
1807
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/",
1808
+ query: {
1809
+ "limit" => limit,
1810
+ "offset" => offset
1811
+ },
1812
+ scope: :application,
1813
+ page: Types::CaseRoutingRule,
1814
+ request_options: request_options
1815
+ )
1816
+ end
1817
+
1818
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/history/+
1819
+ #
1820
+ # @param record_uuid [String]
1821
+ # @param ordering [String] Which field to use when ordering the results.
1822
+ # @param limit [Integer] Number of results to return per page.
1823
+ # @param offset [Integer] The initial index from which to return the results.
1824
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1825
+ # @return [Didit::Page<Didit::Types::RoutingPublicationPolicyRevision>]
1826
+ def list_history(record_uuid, ordering: OMIT, limit: OMIT, offset: OMIT, request_options: nil)
1827
+ @client.request(
1828
+ :get,
1829
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/history/",
1830
+ path_params: { "record_uuid" => record_uuid },
1831
+ query: {
1832
+ "ordering" => ordering,
1833
+ "limit" => limit,
1834
+ "offset" => offset
1835
+ },
1836
+ scope: :application,
1837
+ page: Types::RoutingPublicationPolicyRevision,
1838
+ request_options: request_options
1839
+ )
1840
+ end
1841
+
1842
+ # Test case routing
1843
+ #
1844
+ # Requires `read:cases` for the requested application. Evaluates current rules or a supplied draft against
1845
+ # current reviewer access, availability, skills and capacity. It does not save the draft or reserve reviewer
1846
+ # capacity.
1847
+ #
1848
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/preview/+
1849
+ #
1850
+ # @param source [String]
1851
+ # @param priority [String]
1852
+ # @param tags [Array<String>]
1853
+ # @param rule_uuid [String]
1854
+ # @param draft [Hash]
1855
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1856
+ # @return [Didit::Types::CaseRoutingPreview]
1857
+ def preview(source:, priority: OMIT, tags: OMIT, rule_uuid: OMIT, draft: OMIT, request_options: nil)
1858
+ @client.request(
1859
+ :post,
1860
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/preview/",
1861
+ body: {
1862
+ "source" => source,
1863
+ "priority" => priority,
1864
+ "tags" => tags,
1865
+ "rule_uuid" => rule_uuid,
1866
+ "draft" => draft
1867
+ },
1868
+ scope: :application,
1869
+ response: Types::CaseRoutingPreview,
1870
+ request_options: request_options
1871
+ )
1872
+ end
1873
+
1874
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/publish/+
1875
+ #
1876
+ # @param record_uuid [String]
1877
+ # @param expected_version [Integer]
1878
+ # @param expected_revision [String, nil]
1879
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1880
+ # @return [Didit::Types::RoutingPublicationCaseRoutingRule]
1881
+ def publish(record_uuid, expected_version:, expected_revision:, request_options: nil)
1882
+ @client.request(
1883
+ :post,
1884
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/publish/",
1885
+ path_params: { "record_uuid" => record_uuid },
1886
+ body: {
1887
+ "expected_version" => expected_version,
1888
+ "expected_revision" => expected_revision
1889
+ },
1890
+ scope: :application,
1891
+ response: Types::RoutingPublicationCaseRoutingRule,
1892
+ request_options: request_options
1893
+ )
1894
+ end
1895
+
1896
+ # Retrieve routing rule
1897
+ #
1898
+ # Requires `read:cases` for the requested application.
1899
+ #
1900
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/+
1901
+ #
1902
+ # @param record_uuid [String]
1903
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1904
+ # @return [Didit::Types::CaseRoutingRule]
1905
+ def retrieve(record_uuid, request_options: nil)
1906
+ @client.request(
1907
+ :get,
1908
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/",
1909
+ path_params: { "record_uuid" => record_uuid },
1910
+ scope: :application,
1911
+ response: Types::CaseRoutingRule,
1912
+ request_options: request_options
1913
+ )
1914
+ end
1915
+
1916
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/draft/+
1917
+ #
1918
+ # @param record_uuid [String]
1919
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1920
+ # @return [Didit::Types::RoutingPublicationPolicyDraftResponse]
1921
+ def retrieve_draft(record_uuid, request_options: nil)
1922
+ @client.request(
1923
+ :get,
1924
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/draft/",
1925
+ path_params: { "record_uuid" => record_uuid },
1926
+ scope: :application,
1927
+ response: Types::RoutingPublicationPolicyDraftResponse,
1928
+ request_options: request_options
1929
+ )
1930
+ end
1931
+
1932
+ # +PUT /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/draft/+
1933
+ #
1934
+ # @param record_uuid [String]
1935
+ # @param expected_version [Integer]
1936
+ # @param expected_revision [String, nil]
1937
+ # @param changes [Hash]
1938
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1939
+ # @return [Didit::Types::RoutingPublicationPolicyDraft]
1940
+ def save_draft(record_uuid, expected_version:, expected_revision:, changes:, request_options: nil)
1941
+ @client.request(
1942
+ :put,
1943
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/draft/",
1944
+ path_params: { "record_uuid" => record_uuid },
1945
+ body: {
1946
+ "expected_version" => expected_version,
1947
+ "expected_revision" => expected_revision,
1948
+ "changes" => changes
1949
+ },
1950
+ scope: :application,
1951
+ response: Types::RoutingPublicationPolicyDraft,
1952
+ request_options: request_options
1953
+ )
1954
+ end
1955
+
1956
+ # Update routing rule
1957
+ #
1958
+ # Requires `write:cases` for the requested application.
1959
+ #
1960
+ # +PATCH /v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/+
1961
+ #
1962
+ # @param record_uuid [String]
1963
+ # @param name [String]
1964
+ # @param description [String]
1965
+ # @param priority [Integer]
1966
+ # @param conditions [Array<Hash>]
1967
+ # @param required_skills [Array<String>]
1968
+ # @param blueprint [String]
1969
+ # @param team [String, nil]
1970
+ # @param is_active [Boolean]
1971
+ # @param expected_version [Integer] Version opened by the editor. When supplied, stale writes return 409
1972
+ # without changing the rule.
1973
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
1974
+ # @return [Didit::Types::CaseRoutingRule]
1975
+ def update(
1976
+ record_uuid,
1977
+ name: OMIT,
1978
+ description: OMIT,
1979
+ priority: OMIT,
1980
+ conditions: OMIT,
1981
+ required_skills: OMIT,
1982
+ blueprint: OMIT,
1983
+ team: OMIT,
1984
+ is_active: OMIT,
1985
+ expected_version: OMIT,
1986
+ request_options: nil
1987
+ )
1988
+ @client.request(
1989
+ :patch,
1990
+ "/v3/organization/{organization_id}/application/{application_id}/cases/routing-rules/{record_uuid}/",
1991
+ path_params: { "record_uuid" => record_uuid },
1992
+ body: {
1993
+ "name" => name,
1994
+ "description" => description,
1995
+ "priority" => priority,
1996
+ "conditions" => conditions,
1997
+ "required_skills" => required_skills,
1998
+ "blueprint" => blueprint,
1999
+ "team" => team,
2000
+ "is_active" => is_active,
2001
+ "expected_version" => expected_version
2002
+ },
2003
+ scope: :application,
2004
+ response: Types::CaseRoutingRule,
2005
+ request_options: request_options
2006
+ )
2007
+ end
2008
+ end
2009
+
2010
+ # The +cases.teams+ resource.
2011
+ class Teams < Didit::Resource
2012
+ # Create review team
2013
+ #
2014
+ # Requires `write:cases` for the requested application.
2015
+ #
2016
+ # +POST /v3/organization/{organization_id}/application/{application_id}/cases/teams/+
2017
+ #
2018
+ # @param name [String]
2019
+ # @param members [Array<Hash>]
2020
+ # @param description [String]
2021
+ # @param is_active [Boolean]
2022
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
2023
+ # @return [Didit::Types::CaseReviewTeam]
2024
+ def create(name:, members:, description: OMIT, is_active: OMIT, request_options: nil)
2025
+ @client.request(
2026
+ :post,
2027
+ "/v3/organization/{organization_id}/application/{application_id}/cases/teams/",
2028
+ body: {
2029
+ "name" => name,
2030
+ "members" => members,
2031
+ "description" => description,
2032
+ "is_active" => is_active
2033
+ },
2034
+ scope: :application,
2035
+ response: Types::CaseReviewTeam,
2036
+ request_options: request_options
2037
+ )
2038
+ end
2039
+
2040
+ # List review teams
2041
+ #
2042
+ # Requires `list:cases` for the requested application.
2043
+ #
2044
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/teams/+
2045
+ #
2046
+ # @param limit [Integer]
2047
+ # @param offset [Integer]
2048
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
2049
+ # @return [Didit::Page<Didit::Types::CaseReviewTeam>]
2050
+ def list(limit: OMIT, offset: OMIT, request_options: nil)
2051
+ @client.request(
2052
+ :get,
2053
+ "/v3/organization/{organization_id}/application/{application_id}/cases/teams/",
2054
+ query: {
2055
+ "limit" => limit,
2056
+ "offset" => offset
2057
+ },
2058
+ scope: :application,
2059
+ page: Types::CaseReviewTeam,
2060
+ request_options: request_options
2061
+ )
2062
+ end
2063
+
2064
+ # Retrieve review team
2065
+ #
2066
+ # Requires `read:cases` for the requested application.
2067
+ #
2068
+ # +GET /v3/organization/{organization_id}/application/{application_id}/cases/teams/{record_uuid}/+
2069
+ #
2070
+ # @param record_uuid [String]
2071
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
2072
+ # @return [Didit::Types::CaseReviewTeam]
2073
+ def retrieve(record_uuid, request_options: nil)
2074
+ @client.request(
2075
+ :get,
2076
+ "/v3/organization/{organization_id}/application/{application_id}/cases/teams/{record_uuid}/",
2077
+ path_params: { "record_uuid" => record_uuid },
2078
+ scope: :application,
2079
+ response: Types::CaseReviewTeam,
2080
+ request_options: request_options
2081
+ )
2082
+ end
2083
+
2084
+ # Update review team
2085
+ #
2086
+ # Requires `write:cases` for the requested application.
2087
+ #
2088
+ # +PATCH /v3/organization/{organization_id}/application/{application_id}/cases/teams/{record_uuid}/+
2089
+ #
2090
+ # @param record_uuid [String]
2091
+ # @param name [String]
2092
+ # @param description [String]
2093
+ # @param members [Array<Hash>]
2094
+ # @param is_active [Boolean]
2095
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
2096
+ # @return [Didit::Types::CaseReviewTeam]
2097
+ def update(record_uuid, name: OMIT, description: OMIT, members: OMIT, is_active: OMIT, request_options: nil)
2098
+ @client.request(
2099
+ :patch,
2100
+ "/v3/organization/{organization_id}/application/{application_id}/cases/teams/{record_uuid}/",
2101
+ path_params: { "record_uuid" => record_uuid },
2102
+ body: {
2103
+ "name" => name,
2104
+ "description" => description,
2105
+ "members" => members,
2106
+ "is_active" => is_active
2107
+ },
2108
+ scope: :application,
2109
+ response: Types::CaseReviewTeam,
2110
+ request_options: request_options
2111
+ )
2112
+ end
2113
+ end
2114
+ end
2115
+ end
2116
+ end