lithic 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/README.md +3 -3
  4. data/lib/lithic/client.rb +11 -0
  5. data/lib/lithic/models/account_activity_list_params.rb +2 -0
  6. data/lib/lithic/models/account_activity_list_response.rb +8 -2
  7. data/lib/lithic/models/account_activity_retrieve_transaction_response.rb +8 -2
  8. data/lib/lithic/models/auth_rules/auth_rule.rb +84 -8
  9. data/lib/lithic/models/auth_rules/auth_rule_version.rb +92 -0
  10. data/lib/lithic/models/auth_rules/rule_feature.rb +231 -0
  11. data/lib/lithic/models/auth_rules/typescript_code_parameters.rb +33 -0
  12. data/lib/lithic/models/auth_rules/v2/backtest_results.rb +9 -17
  13. data/lib/lithic/models/auth_rules/v2_create_params.rb +50 -10
  14. data/lib/lithic/models/auth_rules/v2_draft_params.rb +6 -3
  15. data/lib/lithic/models/auth_rules/v2_list_versions_params.rb +22 -0
  16. data/lib/lithic/models/auth_rules/v2_list_versions_response.rb +18 -0
  17. data/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb +3 -83
  18. data/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb +525 -1
  19. data/lib/lithic/models/auth_rules/v2_update_params.rb +17 -1
  20. data/lib/lithic/models/auth_rules/velocity_limit_filters.rb +87 -0
  21. data/lib/lithic/models/auth_rules/velocity_limit_params.rb +3 -84
  22. data/lib/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rb +69 -59
  23. data/lib/lithic/models/dispute_create_params.rb +11 -11
  24. data/lib/lithic/models/dispute_list_params.rb +3 -3
  25. data/lib/lithic/models/dispute_update_params.rb +9 -9
  26. data/lib/lithic/models/event.rb +0 -7
  27. data/lib/lithic/models/event_list_params.rb +0 -4
  28. data/lib/lithic/models/event_subscription.rb +0 -4
  29. data/lib/lithic/models/events/subscription_create_params.rb +0 -4
  30. data/lib/lithic/models/events/subscription_send_simulated_example_params.rb +0 -1
  31. data/lib/lithic/models/events/subscription_update_params.rb +0 -4
  32. data/lib/lithic/models/financial_account.rb +1 -0
  33. data/lib/lithic/models/financial_account_list_params.rb +1 -0
  34. data/lib/lithic/models/financial_accounts/interest_tier_schedule.rb +9 -1
  35. data/lib/lithic/models/financial_accounts/interest_tier_schedule_update_params.rb +9 -1
  36. data/lib/lithic/models/financial_accounts/statements/statement_line_items.rb +27 -2
  37. data/lib/lithic/models/hold.rb +147 -0
  38. data/lib/lithic/models/hold_create_params.rb +61 -0
  39. data/lib/lithic/models/hold_event.rb +110 -0
  40. data/lib/lithic/models/hold_list_params.rb +89 -0
  41. data/lib/lithic/models/hold_retrieve_params.rb +20 -0
  42. data/lib/lithic/models/hold_void_params.rb +29 -0
  43. data/lib/lithic/models/instance_financial_account_type.rb +1 -0
  44. data/lib/lithic/models/parsed_webhook_event.rb +2 -4
  45. data/lib/lithic/models/payment.rb +76 -12
  46. data/lib/lithic/models/payment_simulate_action_params.rb +1 -0
  47. data/lib/lithic/models.rb +12 -2
  48. data/lib/lithic/resources/account_activity.rb +2 -2
  49. data/lib/lithic/resources/auth_rules/v2.rb +24 -4
  50. data/lib/lithic/resources/disputes.rb +21 -21
  51. data/lib/lithic/resources/financial_accounts/interest_tier_schedule.rb +6 -2
  52. data/lib/lithic/resources/holds.rb +132 -0
  53. data/lib/lithic/resources/webhooks.rb +2 -3
  54. data/lib/lithic/version.rb +1 -1
  55. data/lib/lithic.rb +14 -1
  56. data/rbi/lithic/client.rbi +9 -0
  57. data/rbi/lithic/models/account_activity_list_params.rbi +10 -0
  58. data/rbi/lithic/models/account_activity_list_response.rbi +14 -2
  59. data/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi +14 -2
  60. data/rbi/lithic/models/auth_rules/auth_rule.rbi +128 -4
  61. data/rbi/lithic/models/auth_rules/auth_rule_version.rbi +142 -0
  62. data/rbi/lithic/models/auth_rules/rule_feature.rbi +414 -0
  63. data/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi +94 -0
  64. data/rbi/lithic/models/auth_rules/v2/backtest_results.rbi +12 -35
  65. data/rbi/lithic/models/auth_rules/v2_create_params.rbi +81 -12
  66. data/rbi/lithic/models/auth_rules/v2_draft_params.rbi +8 -4
  67. data/rbi/lithic/models/auth_rules/v2_list_versions_params.rbi +40 -0
  68. data/rbi/lithic/models/auth_rules/v2_list_versions_response.rbi +36 -0
  69. data/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi +4 -209
  70. data/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi +1692 -3
  71. data/rbi/lithic/models/auth_rules/v2_update_params.rbi +24 -0
  72. data/rbi/lithic/models/auth_rules/velocity_limit_filters.rbi +205 -0
  73. data/rbi/lithic/models/auth_rules/velocity_limit_params.rbi +4 -206
  74. data/rbi/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbi +154 -142
  75. data/rbi/lithic/models/dispute_create_params.rbi +11 -11
  76. data/rbi/lithic/models/dispute_list_params.rbi +3 -3
  77. data/rbi/lithic/models/dispute_update_params.rbi +9 -9
  78. data/rbi/lithic/models/event.rbi +0 -14
  79. data/rbi/lithic/models/event_list_params.rbi +0 -8
  80. data/rbi/lithic/models/event_subscription.rbi +0 -8
  81. data/rbi/lithic/models/events/subscription_create_params.rbi +0 -8
  82. data/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi +0 -5
  83. data/rbi/lithic/models/events/subscription_update_params.rbi +0 -8
  84. data/rbi/lithic/models/financial_account.rbi +5 -0
  85. data/rbi/lithic/models/financial_account_list_params.rbi +5 -0
  86. data/rbi/lithic/models/financial_accounts/interest_tier_schedule.rbi +11 -0
  87. data/rbi/lithic/models/financial_accounts/interest_tier_schedule_update_params.rbi +11 -0
  88. data/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi +38 -3
  89. data/rbi/lithic/models/hold.rbi +183 -0
  90. data/rbi/lithic/models/hold_create_params.rbi +90 -0
  91. data/rbi/lithic/models/hold_event.rbi +148 -0
  92. data/rbi/lithic/models/hold_list_params.rbi +137 -0
  93. data/rbi/lithic/models/hold_retrieve_params.rbi +35 -0
  94. data/rbi/lithic/models/hold_void_params.rbi +49 -0
  95. data/rbi/lithic/models/instance_financial_account_type.rbi +5 -0
  96. data/rbi/lithic/models/parsed_webhook_event.rbi +0 -1
  97. data/rbi/lithic/models/payment.rbi +139 -13
  98. data/rbi/lithic/models/payment_simulate_action_params.rbi +5 -0
  99. data/rbi/lithic/models.rbi +12 -3
  100. data/rbi/lithic/resources/auth_rules/v2.rbi +16 -4
  101. data/rbi/lithic/resources/disputes.rbi +21 -21
  102. data/rbi/lithic/resources/financial_accounts/interest_tier_schedule.rbi +6 -0
  103. data/rbi/lithic/resources/holds.rbi +111 -0
  104. data/rbi/lithic/resources/webhooks.rbi +8 -2
  105. data/sig/lithic/client.rbs +5 -0
  106. data/sig/lithic/models/account_activity_list_params.rbs +4 -0
  107. data/sig/lithic/models/account_activity_list_response.rbs +5 -0
  108. data/sig/lithic/models/account_activity_retrieve_transaction_response.rbs +5 -0
  109. data/sig/lithic/models/auth_rules/auth_rule.rbs +42 -0
  110. data/sig/lithic/models/auth_rules/auth_rule_version.rbs +67 -0
  111. data/sig/lithic/models/auth_rules/rule_feature.rbs +173 -0
  112. data/sig/lithic/models/auth_rules/typescript_code_parameters.rbs +27 -0
  113. data/sig/lithic/models/auth_rules/v2/backtest_results.rbs +5 -18
  114. data/sig/lithic/models/auth_rules/v2_create_params.rbs +25 -0
  115. data/sig/lithic/models/auth_rules/v2_draft_params.rbs +1 -0
  116. data/sig/lithic/models/auth_rules/v2_list_versions_params.rbs +25 -0
  117. data/sig/lithic/models/auth_rules/v2_list_versions_response.rbs +18 -0
  118. data/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs +4 -80
  119. data/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs +658 -3
  120. data/sig/lithic/models/auth_rules/v2_update_params.rbs +16 -0
  121. data/sig/lithic/models/auth_rules/velocity_limit_filters.rbs +81 -0
  122. data/sig/lithic/models/auth_rules/velocity_limit_params.rbs +6 -82
  123. data/sig/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbs +38 -38
  124. data/sig/lithic/models/event.rbs +0 -2
  125. data/sig/lithic/models/event_list_params.rbs +0 -2
  126. data/sig/lithic/models/event_subscription.rbs +0 -2
  127. data/sig/lithic/models/events/subscription_create_params.rbs +0 -2
  128. data/sig/lithic/models/events/subscription_send_simulated_example_params.rbs +0 -2
  129. data/sig/lithic/models/events/subscription_update_params.rbs +0 -2
  130. data/sig/lithic/models/financial_account.rbs +2 -0
  131. data/sig/lithic/models/financial_account_list_params.rbs +7 -1
  132. data/sig/lithic/models/financial_accounts/interest_tier_schedule.rbs +7 -0
  133. data/sig/lithic/models/financial_accounts/interest_tier_schedule_update_params.rbs +7 -0
  134. data/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs +17 -3
  135. data/sig/lithic/models/hold.rbs +137 -0
  136. data/sig/lithic/models/hold_create_params.rbs +57 -0
  137. data/sig/lithic/models/hold_event.rbs +91 -0
  138. data/sig/lithic/models/hold_list_params.rbs +83 -0
  139. data/sig/lithic/models/hold_retrieve_params.rbs +23 -0
  140. data/sig/lithic/models/hold_void_params.rbs +28 -0
  141. data/sig/lithic/models/instance_financial_account_type.rbs +2 -0
  142. data/sig/lithic/models/parsed_webhook_event.rbs +0 -1
  143. data/sig/lithic/models/payment.rbs +23 -8
  144. data/sig/lithic/models/payment_simulate_action_params.rbs +2 -0
  145. data/sig/lithic/models.rbs +12 -2
  146. data/sig/lithic/resources/auth_rules/v2.rbs +5 -0
  147. data/sig/lithic/resources/financial_accounts/interest_tier_schedule.rbs +2 -0
  148. data/sig/lithic/resources/holds.rbs +39 -0
  149. data/sig/lithic/resources/webhooks.rbs +0 -1
  150. metadata +41 -5
  151. data/lib/lithic/models/tokenization_decisioning_request_webhook_event.rb +0 -159
  152. data/rbi/lithic/models/tokenization_decisioning_request_webhook_event.rbi +0 -331
  153. data/sig/lithic/models/tokenization_decisioning_request_webhook_event.rbs +0 -130
@@ -0,0 +1,414 @@
1
+ # typed: strong
2
+
3
+ module Lithic
4
+ module Models
5
+ module AuthRules
6
+ # A feature made available to the rule. The `name` field is the variable name used
7
+ # in the rule function signature. The `type` field determines which data the
8
+ # feature provides to the rule at evaluation time.
9
+ #
10
+ # - `AUTHORIZATION`: The authorization request being evaluated. Only available for
11
+ # AUTHORIZATION event stream rules.
12
+ # - `AUTHENTICATION`: The 3DS authentication request being evaluated. Only
13
+ # available for THREE_DS_AUTHENTICATION event stream rules.
14
+ # - `TOKENIZATION`: The tokenization request being evaluated. Only available for
15
+ # TOKENIZATION event stream rules.
16
+ # - `ACH_RECEIPT`: The ACH receipt being evaluated. Only available for
17
+ # ACH_CREDIT_RECEIPT and ACH_DEBIT_RECEIPT event stream rules.
18
+ # - `CARD`: The card associated with the event. Available for AUTHORIZATION and
19
+ # THREE_DS_AUTHENTICATION event stream rules.
20
+ # - `ACCOUNT_HOLDER`: The account holder associated with the card. Available for
21
+ # THREE_DS_AUTHENTICATION event stream rules.
22
+ # - `IP_METADATA`: IP address metadata for the request. Available for
23
+ # THREE_DS_AUTHENTICATION event stream rules.
24
+ # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires
25
+ # `scope`, `period`, and optionally `filters` to configure the velocity
26
+ # calculation. Available for AUTHORIZATION event stream rules.
27
+ module RuleFeature
28
+ extend Lithic::Internal::Type::Union
29
+
30
+ Variants =
31
+ T.type_alias do
32
+ T.any(
33
+ Lithic::AuthRules::RuleFeature::AuthorizationFeature,
34
+ Lithic::AuthRules::RuleFeature::AuthenticationFeature,
35
+ Lithic::AuthRules::RuleFeature::TokenizationFeature,
36
+ Lithic::AuthRules::RuleFeature::ACHReceiptFeature,
37
+ Lithic::AuthRules::RuleFeature::CardFeature,
38
+ Lithic::AuthRules::RuleFeature::AccountHolderFeature,
39
+ Lithic::AuthRules::RuleFeature::IPMetadataFeature,
40
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature
41
+ )
42
+ end
43
+
44
+ class AuthorizationFeature < Lithic::Internal::Type::BaseModel
45
+ OrHash =
46
+ T.type_alias do
47
+ T.any(
48
+ Lithic::AuthRules::RuleFeature::AuthorizationFeature,
49
+ Lithic::Internal::AnyHash
50
+ )
51
+ end
52
+
53
+ sig { returns(Symbol) }
54
+ attr_accessor :type
55
+
56
+ # The variable name for this feature in the rule function signature
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :name
59
+
60
+ sig { params(name: String).void }
61
+ attr_writer :name
62
+
63
+ sig { params(name: String, type: Symbol).returns(T.attached_class) }
64
+ def self.new(
65
+ # The variable name for this feature in the rule function signature
66
+ name: nil,
67
+ type: :AUTHORIZATION
68
+ )
69
+ end
70
+
71
+ sig { override.returns({ type: Symbol, name: String }) }
72
+ def to_hash
73
+ end
74
+ end
75
+
76
+ class AuthenticationFeature < Lithic::Internal::Type::BaseModel
77
+ OrHash =
78
+ T.type_alias do
79
+ T.any(
80
+ Lithic::AuthRules::RuleFeature::AuthenticationFeature,
81
+ Lithic::Internal::AnyHash
82
+ )
83
+ end
84
+
85
+ sig { returns(Symbol) }
86
+ attr_accessor :type
87
+
88
+ # The variable name for this feature in the rule function signature
89
+ sig { returns(T.nilable(String)) }
90
+ attr_reader :name
91
+
92
+ sig { params(name: String).void }
93
+ attr_writer :name
94
+
95
+ sig { params(name: String, type: Symbol).returns(T.attached_class) }
96
+ def self.new(
97
+ # The variable name for this feature in the rule function signature
98
+ name: nil,
99
+ type: :AUTHENTICATION
100
+ )
101
+ end
102
+
103
+ sig { override.returns({ type: Symbol, name: String }) }
104
+ def to_hash
105
+ end
106
+ end
107
+
108
+ class TokenizationFeature < Lithic::Internal::Type::BaseModel
109
+ OrHash =
110
+ T.type_alias do
111
+ T.any(
112
+ Lithic::AuthRules::RuleFeature::TokenizationFeature,
113
+ Lithic::Internal::AnyHash
114
+ )
115
+ end
116
+
117
+ sig { returns(Symbol) }
118
+ attr_accessor :type
119
+
120
+ # The variable name for this feature in the rule function signature
121
+ sig { returns(T.nilable(String)) }
122
+ attr_reader :name
123
+
124
+ sig { params(name: String).void }
125
+ attr_writer :name
126
+
127
+ sig { params(name: String, type: Symbol).returns(T.attached_class) }
128
+ def self.new(
129
+ # The variable name for this feature in the rule function signature
130
+ name: nil,
131
+ type: :TOKENIZATION
132
+ )
133
+ end
134
+
135
+ sig { override.returns({ type: Symbol, name: String }) }
136
+ def to_hash
137
+ end
138
+ end
139
+
140
+ class ACHReceiptFeature < Lithic::Internal::Type::BaseModel
141
+ OrHash =
142
+ T.type_alias do
143
+ T.any(
144
+ Lithic::AuthRules::RuleFeature::ACHReceiptFeature,
145
+ Lithic::Internal::AnyHash
146
+ )
147
+ end
148
+
149
+ sig { returns(Symbol) }
150
+ attr_accessor :type
151
+
152
+ # The variable name for this feature in the rule function signature
153
+ sig { returns(T.nilable(String)) }
154
+ attr_reader :name
155
+
156
+ sig { params(name: String).void }
157
+ attr_writer :name
158
+
159
+ sig { params(name: String, type: Symbol).returns(T.attached_class) }
160
+ def self.new(
161
+ # The variable name for this feature in the rule function signature
162
+ name: nil,
163
+ type: :ACH_RECEIPT
164
+ )
165
+ end
166
+
167
+ sig { override.returns({ type: Symbol, name: String }) }
168
+ def to_hash
169
+ end
170
+ end
171
+
172
+ class CardFeature < Lithic::Internal::Type::BaseModel
173
+ OrHash =
174
+ T.type_alias do
175
+ T.any(
176
+ Lithic::AuthRules::RuleFeature::CardFeature,
177
+ Lithic::Internal::AnyHash
178
+ )
179
+ end
180
+
181
+ sig { returns(Symbol) }
182
+ attr_accessor :type
183
+
184
+ # The variable name for this feature in the rule function signature
185
+ sig { returns(T.nilable(String)) }
186
+ attr_reader :name
187
+
188
+ sig { params(name: String).void }
189
+ attr_writer :name
190
+
191
+ sig { params(name: String, type: Symbol).returns(T.attached_class) }
192
+ def self.new(
193
+ # The variable name for this feature in the rule function signature
194
+ name: nil,
195
+ type: :CARD
196
+ )
197
+ end
198
+
199
+ sig { override.returns({ type: Symbol, name: String }) }
200
+ def to_hash
201
+ end
202
+ end
203
+
204
+ class AccountHolderFeature < Lithic::Internal::Type::BaseModel
205
+ OrHash =
206
+ T.type_alias do
207
+ T.any(
208
+ Lithic::AuthRules::RuleFeature::AccountHolderFeature,
209
+ Lithic::Internal::AnyHash
210
+ )
211
+ end
212
+
213
+ sig { returns(Symbol) }
214
+ attr_accessor :type
215
+
216
+ # The variable name for this feature in the rule function signature
217
+ sig { returns(T.nilable(String)) }
218
+ attr_reader :name
219
+
220
+ sig { params(name: String).void }
221
+ attr_writer :name
222
+
223
+ sig { params(name: String, type: Symbol).returns(T.attached_class) }
224
+ def self.new(
225
+ # The variable name for this feature in the rule function signature
226
+ name: nil,
227
+ type: :ACCOUNT_HOLDER
228
+ )
229
+ end
230
+
231
+ sig { override.returns({ type: Symbol, name: String }) }
232
+ def to_hash
233
+ end
234
+ end
235
+
236
+ class IPMetadataFeature < Lithic::Internal::Type::BaseModel
237
+ OrHash =
238
+ T.type_alias do
239
+ T.any(
240
+ Lithic::AuthRules::RuleFeature::IPMetadataFeature,
241
+ Lithic::Internal::AnyHash
242
+ )
243
+ end
244
+
245
+ sig { returns(Symbol) }
246
+ attr_accessor :type
247
+
248
+ # The variable name for this feature in the rule function signature
249
+ sig { returns(T.nilable(String)) }
250
+ attr_reader :name
251
+
252
+ sig { params(name: String).void }
253
+ attr_writer :name
254
+
255
+ sig { params(name: String, type: Symbol).returns(T.attached_class) }
256
+ def self.new(
257
+ # The variable name for this feature in the rule function signature
258
+ name: nil,
259
+ type: :IP_METADATA
260
+ )
261
+ end
262
+
263
+ sig { override.returns({ type: Symbol, name: String }) }
264
+ def to_hash
265
+ end
266
+ end
267
+
268
+ class SpendVelocityFeature < Lithic::Internal::Type::BaseModel
269
+ OrHash =
270
+ T.type_alias do
271
+ T.any(
272
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature,
273
+ Lithic::Internal::AnyHash
274
+ )
275
+ end
276
+
277
+ # Velocity over the current day since 00:00 / 12 AM in Eastern Time
278
+ sig do
279
+ returns(
280
+ T.any(
281
+ Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject,
282
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay,
283
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek,
284
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth,
285
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear
286
+ )
287
+ )
288
+ end
289
+ attr_accessor :period
290
+
291
+ # The scope the velocity is calculated for
292
+ sig do
293
+ returns(
294
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol
295
+ )
296
+ end
297
+ attr_accessor :scope
298
+
299
+ sig { returns(Symbol) }
300
+ attr_accessor :type
301
+
302
+ sig { returns(T.nilable(Lithic::AuthRules::VelocityLimitFilters)) }
303
+ attr_reader :filters
304
+
305
+ sig do
306
+ params(
307
+ filters: Lithic::AuthRules::VelocityLimitFilters::OrHash
308
+ ).void
309
+ end
310
+ attr_writer :filters
311
+
312
+ # The variable name for this feature in the rule function signature
313
+ sig { returns(T.nilable(String)) }
314
+ attr_reader :name
315
+
316
+ sig { params(name: String).void }
317
+ attr_writer :name
318
+
319
+ sig do
320
+ params(
321
+ period:
322
+ T.any(
323
+ Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash,
324
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay::OrHash,
325
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek::OrHash,
326
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth::OrHash,
327
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash
328
+ ),
329
+ scope:
330
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol,
331
+ filters: Lithic::AuthRules::VelocityLimitFilters::OrHash,
332
+ name: String,
333
+ type: Symbol
334
+ ).returns(T.attached_class)
335
+ end
336
+ def self.new(
337
+ # Velocity over the current day since 00:00 / 12 AM in Eastern Time
338
+ period:,
339
+ # The scope the velocity is calculated for
340
+ scope:,
341
+ filters: nil,
342
+ # The variable name for this feature in the rule function signature
343
+ name: nil,
344
+ type: :SPEND_VELOCITY
345
+ )
346
+ end
347
+
348
+ sig do
349
+ override.returns(
350
+ {
351
+ period:
352
+ T.any(
353
+ Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject,
354
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay,
355
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek,
356
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth,
357
+ Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear
358
+ ),
359
+ scope:
360
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol,
361
+ type: Symbol,
362
+ filters: Lithic::AuthRules::VelocityLimitFilters,
363
+ name: String
364
+ }
365
+ )
366
+ end
367
+ def to_hash
368
+ end
369
+
370
+ # The scope the velocity is calculated for
371
+ module Scope
372
+ extend Lithic::Internal::Type::Enum
373
+
374
+ TaggedSymbol =
375
+ T.type_alias do
376
+ T.all(
377
+ Symbol,
378
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope
379
+ )
380
+ end
381
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
382
+
383
+ CARD =
384
+ T.let(
385
+ :CARD,
386
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol
387
+ )
388
+ ACCOUNT =
389
+ T.let(
390
+ :ACCOUNT,
391
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol
392
+ )
393
+
394
+ sig do
395
+ override.returns(
396
+ T::Array[
397
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol
398
+ ]
399
+ )
400
+ end
401
+ def self.values
402
+ end
403
+ end
404
+ end
405
+
406
+ sig do
407
+ override.returns(T::Array[Lithic::AuthRules::RuleFeature::Variants])
408
+ end
409
+ def self.variants
410
+ end
411
+ end
412
+ end
413
+ end
414
+ end
@@ -0,0 +1,94 @@
1
+ # typed: strong
2
+
3
+ module Lithic
4
+ module Models
5
+ module AuthRules
6
+ class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Lithic::AuthRules::TypescriptCodeParameters,
11
+ Lithic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The TypeScript source code of the rule. Must define a `rule()` function that
16
+ # accepts the declared features as positional arguments (in the same order as the
17
+ # `features` array) and returns an array of actions.
18
+ sig { returns(String) }
19
+ attr_accessor :code
20
+
21
+ # Features available to the TypeScript code at evaluation time
22
+ sig do
23
+ returns(
24
+ T::Array[
25
+ T.any(
26
+ Lithic::AuthRules::RuleFeature::AuthorizationFeature,
27
+ Lithic::AuthRules::RuleFeature::AuthenticationFeature,
28
+ Lithic::AuthRules::RuleFeature::TokenizationFeature,
29
+ Lithic::AuthRules::RuleFeature::ACHReceiptFeature,
30
+ Lithic::AuthRules::RuleFeature::CardFeature,
31
+ Lithic::AuthRules::RuleFeature::AccountHolderFeature,
32
+ Lithic::AuthRules::RuleFeature::IPMetadataFeature,
33
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature
34
+ )
35
+ ]
36
+ )
37
+ end
38
+ attr_accessor :features
39
+
40
+ # Parameters for defining a TypeScript code rule
41
+ sig do
42
+ params(
43
+ code: String,
44
+ features:
45
+ T::Array[
46
+ T.any(
47
+ Lithic::AuthRules::RuleFeature::AuthorizationFeature::OrHash,
48
+ Lithic::AuthRules::RuleFeature::AuthenticationFeature::OrHash,
49
+ Lithic::AuthRules::RuleFeature::TokenizationFeature::OrHash,
50
+ Lithic::AuthRules::RuleFeature::ACHReceiptFeature::OrHash,
51
+ Lithic::AuthRules::RuleFeature::CardFeature::OrHash,
52
+ Lithic::AuthRules::RuleFeature::AccountHolderFeature::OrHash,
53
+ Lithic::AuthRules::RuleFeature::IPMetadataFeature::OrHash,
54
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature::OrHash
55
+ )
56
+ ]
57
+ ).returns(T.attached_class)
58
+ end
59
+ def self.new(
60
+ # The TypeScript source code of the rule. Must define a `rule()` function that
61
+ # accepts the declared features as positional arguments (in the same order as the
62
+ # `features` array) and returns an array of actions.
63
+ code:,
64
+ # Features available to the TypeScript code at evaluation time
65
+ features:
66
+ )
67
+ end
68
+
69
+ sig do
70
+ override.returns(
71
+ {
72
+ code: String,
73
+ features:
74
+ T::Array[
75
+ T.any(
76
+ Lithic::AuthRules::RuleFeature::AuthorizationFeature,
77
+ Lithic::AuthRules::RuleFeature::AuthenticationFeature,
78
+ Lithic::AuthRules::RuleFeature::TokenizationFeature,
79
+ Lithic::AuthRules::RuleFeature::ACHReceiptFeature,
80
+ Lithic::AuthRules::RuleFeature::CardFeature,
81
+ Lithic::AuthRules::RuleFeature::AccountHolderFeature,
82
+ Lithic::AuthRules::RuleFeature::IPMetadataFeature,
83
+ Lithic::AuthRules::RuleFeature::SpendVelocityFeature
84
+ )
85
+ ]
86
+ }
87
+ )
88
+ end
89
+ def to_hash
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
@@ -134,47 +134,24 @@ module Lithic
134
134
  )
135
135
  end
136
136
 
137
- # Auth Rule Token
138
- sig { returns(T.nilable(String)) }
139
- attr_reader :auth_rule_token
137
+ # The end time of the simulation
138
+ sig { returns(Time) }
139
+ attr_accessor :end_
140
140
 
141
- sig { params(auth_rule_token: String).void }
142
- attr_writer :auth_rule_token
141
+ # The start time of the simulation
142
+ sig { returns(Time) }
143
+ attr_accessor :start
143
144
 
144
- # The end time of the simulation.
145
- sig { returns(T.nilable(Time)) }
146
- attr_reader :end_
147
-
148
- sig { params(end_: Time).void }
149
- attr_writer :end_
150
-
151
- # The start time of the simulation.
152
- sig { returns(T.nilable(Time)) }
153
- attr_reader :start
154
-
155
- sig { params(start: Time).void }
156
- attr_writer :start
157
-
158
- sig do
159
- params(auth_rule_token: String, end_: Time, start: Time).returns(
160
- T.attached_class
161
- )
162
- end
145
+ sig { params(end_: Time, start: Time).returns(T.attached_class) }
163
146
  def self.new(
164
- # Auth Rule Token
165
- auth_rule_token: nil,
166
- # The end time of the simulation.
167
- end_: nil,
168
- # The start time of the simulation.
169
- start: nil
147
+ # The end time of the simulation
148
+ end_:,
149
+ # The start time of the simulation
150
+ start:
170
151
  )
171
152
  end
172
153
 
173
- sig do
174
- override.returns(
175
- { auth_rule_token: String, end_: Time, start: Time }
176
- )
177
- end
154
+ sig { override.returns({ end_: Time, start: Time }) }
178
155
  def to_hash
179
156
  end
180
157
  end