lithic 0.1.0.pre.alpha.32 → 0.1.0.pre.alpha.34

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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/client.rb +4 -0
  5. data/lib/lithic/errors.rb +22 -0
  6. data/lib/lithic/internal/type/array_of.rb +6 -1
  7. data/lib/lithic/internal/type/base_model.rb +77 -25
  8. data/lib/lithic/internal/type/boolean.rb +7 -1
  9. data/lib/lithic/internal/type/converter.rb +42 -34
  10. data/lib/lithic/internal/type/enum.rb +10 -2
  11. data/lib/lithic/internal/type/file_input.rb +6 -1
  12. data/lib/lithic/internal/type/hash_of.rb +6 -1
  13. data/lib/lithic/internal/type/union.rb +12 -7
  14. data/lib/lithic/internal/type/unknown.rb +7 -1
  15. data/lib/lithic/models/auth_rules/rule_stats.rb +112 -0
  16. data/lib/lithic/models/auth_rules/v2/backtest_results.rb +6 -238
  17. data/lib/lithic/models/auth_rules/v2_retrieve_report_params.rb +32 -0
  18. data/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb +71 -0
  19. data/lib/lithic/models/card_convert_physical_params.rb +10 -6
  20. data/lib/lithic/models/card_create_params.rb +10 -6
  21. data/lib/lithic/models/card_reissue_params.rb +10 -6
  22. data/lib/lithic/models/card_renew_params.rb +10 -6
  23. data/lib/lithic/models/external_bank_account_create_params.rb +1 -1
  24. data/lib/lithic/models/financial_accounts/statements/statement_line_items.rb +1 -0
  25. data/lib/lithic/models/financial_transaction.rb +1 -0
  26. data/lib/lithic/models/fraud/transaction_report_params.rb +130 -0
  27. data/lib/lithic/models/fraud/transaction_report_response.rb +160 -0
  28. data/lib/lithic/models/fraud/transaction_retrieve_params.rb +16 -0
  29. data/lib/lithic/models/fraud/transaction_retrieve_response.rb +160 -0
  30. data/lib/lithic/models/payment.rb +7 -1
  31. data/lib/lithic/models/payment_create_params.rb +7 -1
  32. data/lib/lithic/models/three_ds/authentication_retrieve_response.rb +111 -79
  33. data/lib/lithic/models/three_ds/authentication_simulate_params.rb +8 -2
  34. data/lib/lithic/models/three_ds/authentication_simulate_response.rb +2 -6
  35. data/lib/lithic/models/three_ds/challenge_response.rb +7 -7
  36. data/lib/lithic/models/three_ds/challenge_result.rb +1 -1
  37. data/lib/lithic/models/transfer.rb +1 -0
  38. data/lib/lithic/models.rb +2 -0
  39. data/lib/lithic/resources/auth_rules/v2/backtests.rb +8 -7
  40. data/lib/lithic/resources/auth_rules/v2.rb +45 -4
  41. data/lib/lithic/resources/fraud/transactions.rb +69 -0
  42. data/lib/lithic/resources/fraud.rb +18 -0
  43. data/lib/lithic/resources/three_ds/authentication.rb +6 -6
  44. data/lib/lithic/resources/three_ds/decisioning.rb +8 -3
  45. data/lib/lithic/version.rb +1 -1
  46. data/lib/lithic.rb +9 -0
  47. data/rbi/lithic/client.rbi +3 -0
  48. data/rbi/lithic/errors.rbi +16 -0
  49. data/rbi/lithic/internal/type/boolean.rbi +2 -0
  50. data/rbi/lithic/internal/type/converter.rbi +15 -15
  51. data/rbi/lithic/internal/type/union.rbi +5 -0
  52. data/rbi/lithic/internal/type/unknown.rbi +2 -0
  53. data/rbi/lithic/models/auth_rules/rule_stats.rbi +229 -0
  54. data/rbi/lithic/models/auth_rules/v2/backtest_results.rbi +8 -523
  55. data/rbi/lithic/models/auth_rules/v2_retrieve_report_params.rbi +56 -0
  56. data/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi +149 -0
  57. data/rbi/lithic/models/card_convert_physical_params.rbi +15 -9
  58. data/rbi/lithic/models/card_create_params.rbi +15 -9
  59. data/rbi/lithic/models/card_reissue_params.rbi +15 -9
  60. data/rbi/lithic/models/card_renew_params.rbi +15 -9
  61. data/rbi/lithic/models/external_bank_account_create_params.rbi +2 -2
  62. data/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi +5 -0
  63. data/rbi/lithic/models/financial_transaction.rbi +5 -0
  64. data/rbi/lithic/models/fraud/transaction_report_params.rbi +263 -0
  65. data/rbi/lithic/models/fraud/transaction_report_response.rbi +309 -0
  66. data/rbi/lithic/models/fraud/transaction_retrieve_params.rbi +32 -0
  67. data/rbi/lithic/models/fraud/transaction_retrieve_response.rbi +309 -0
  68. data/rbi/lithic/models/payment.rbi +9 -3
  69. data/rbi/lithic/models/payment_create_params.rbi +8 -3
  70. data/rbi/lithic/models/three_ds/authentication_retrieve_response.rbi +171 -108
  71. data/rbi/lithic/models/three_ds/authentication_simulate_params.rbi +6 -0
  72. data/rbi/lithic/models/three_ds/authentication_simulate_response.rbi +2 -4
  73. data/rbi/lithic/models/three_ds/challenge_response.rbi +7 -10
  74. data/rbi/lithic/models/three_ds/challenge_result.rbi +1 -1
  75. data/rbi/lithic/models/transfer.rbi +2 -0
  76. data/rbi/lithic/models.rbi +2 -0
  77. data/rbi/lithic/resources/auth_rules/v2/backtests.rbi +8 -7
  78. data/rbi/lithic/resources/auth_rules/v2.rbi +37 -4
  79. data/rbi/lithic/resources/cards.rbi +20 -12
  80. data/rbi/lithic/resources/fraud/transactions.rbi +86 -0
  81. data/rbi/lithic/resources/fraud.rbi +15 -0
  82. data/rbi/lithic/resources/three_ds/authentication.rbi +6 -4
  83. data/rbi/lithic/resources/three_ds/decisioning.rbi +9 -6
  84. data/sig/lithic/client.rbs +2 -0
  85. data/sig/lithic/errors.rbs +9 -0
  86. data/sig/lithic/internal/type/converter.rbs +7 -1
  87. data/sig/lithic/models/auth_rules/rule_stats.rbs +108 -0
  88. data/sig/lithic/models/auth_rules/v2/backtest_results.rbs +8 -214
  89. data/sig/lithic/models/auth_rules/v2_retrieve_report_params.rbs +30 -0
  90. data/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs +64 -0
  91. data/sig/lithic/models/external_bank_account_create_params.rbs +2 -2
  92. data/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs +2 -0
  93. data/sig/lithic/models/financial_transaction.rbs +2 -0
  94. data/sig/lithic/models/fraud/transaction_report_params.rbs +75 -0
  95. data/sig/lithic/models/fraud/transaction_report_response.rbs +90 -0
  96. data/sig/lithic/models/fraud/transaction_retrieve_params.rbs +17 -0
  97. data/sig/lithic/models/fraud/transaction_retrieve_response.rbs +90 -0
  98. data/sig/lithic/models/payment.rbs +8 -3
  99. data/sig/lithic/models/payment_create_params.rbs +8 -3
  100. data/sig/lithic/models/three_ds/authentication_retrieve_response.rbs +19 -20
  101. data/sig/lithic/models/transfer.rbs +2 -0
  102. data/sig/lithic/models.rbs +2 -0
  103. data/sig/lithic/resources/auth_rules/v2.rbs +7 -0
  104. data/sig/lithic/resources/fraud/transactions.rbs +22 -0
  105. data/sig/lithic/resources/fraud.rbs +9 -0
  106. metadata +29 -2
@@ -0,0 +1,229 @@
1
+ # typed: strong
2
+
3
+ module Lithic
4
+ module Models
5
+ module AuthRules
6
+ class RuleStats < Lithic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(Lithic::AuthRules::RuleStats, Lithic::Internal::AnyHash)
10
+ end
11
+
12
+ # The total number of historical transactions approved by this rule during the
13
+ # relevant period, or the number of transactions that would have been approved if
14
+ # the rule was evaluated in shadow mode.
15
+ sig { returns(T.nilable(Integer)) }
16
+ attr_reader :approved
17
+
18
+ sig { params(approved: Integer).void }
19
+ attr_writer :approved
20
+
21
+ # The total number of historical transactions challenged by this rule during the
22
+ # relevant period, or the number of transactions that would have been challenged
23
+ # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
24
+ # Rules.
25
+ sig { returns(T.nilable(Integer)) }
26
+ attr_reader :challenged
27
+
28
+ sig { params(challenged: Integer).void }
29
+ attr_writer :challenged
30
+
31
+ # The total number of historical transactions declined by this rule during the
32
+ # relevant period, or the number of transactions that would have been declined if
33
+ # the rule was evaluated in shadow mode.
34
+ sig { returns(T.nilable(Integer)) }
35
+ attr_reader :declined
36
+
37
+ sig { params(declined: Integer).void }
38
+ attr_writer :declined
39
+
40
+ # Example events and their outcomes.
41
+ sig do
42
+ returns(T.nilable(T::Array[Lithic::AuthRules::RuleStats::Example]))
43
+ end
44
+ attr_reader :examples
45
+
46
+ sig do
47
+ params(
48
+ examples: T::Array[Lithic::AuthRules::RuleStats::Example::OrHash]
49
+ ).void
50
+ end
51
+ attr_writer :examples
52
+
53
+ # The version of the rule, this is incremented whenever the rule's parameters
54
+ # change.
55
+ sig { returns(T.nilable(Integer)) }
56
+ attr_reader :version
57
+
58
+ sig { params(version: Integer).void }
59
+ attr_writer :version
60
+
61
+ sig do
62
+ params(
63
+ approved: Integer,
64
+ challenged: Integer,
65
+ declined: Integer,
66
+ examples: T::Array[Lithic::AuthRules::RuleStats::Example::OrHash],
67
+ version: Integer
68
+ ).returns(T.attached_class)
69
+ end
70
+ def self.new(
71
+ # The total number of historical transactions approved by this rule during the
72
+ # relevant period, or the number of transactions that would have been approved if
73
+ # the rule was evaluated in shadow mode.
74
+ approved: nil,
75
+ # The total number of historical transactions challenged by this rule during the
76
+ # relevant period, or the number of transactions that would have been challenged
77
+ # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
78
+ # Rules.
79
+ challenged: nil,
80
+ # The total number of historical transactions declined by this rule during the
81
+ # relevant period, or the number of transactions that would have been declined if
82
+ # the rule was evaluated in shadow mode.
83
+ declined: nil,
84
+ # Example events and their outcomes.
85
+ examples: nil,
86
+ # The version of the rule, this is incremented whenever the rule's parameters
87
+ # change.
88
+ version: nil
89
+ )
90
+ end
91
+
92
+ sig do
93
+ override.returns(
94
+ {
95
+ approved: Integer,
96
+ challenged: Integer,
97
+ declined: Integer,
98
+ examples: T::Array[Lithic::AuthRules::RuleStats::Example],
99
+ version: Integer
100
+ }
101
+ )
102
+ end
103
+ def to_hash
104
+ end
105
+
106
+ class Example < Lithic::Internal::Type::BaseModel
107
+ OrHash =
108
+ T.type_alias do
109
+ T.any(
110
+ Lithic::AuthRules::RuleStats::Example,
111
+ Lithic::Internal::AnyHash
112
+ )
113
+ end
114
+
115
+ # Whether the rule would have approved the request.
116
+ sig { returns(T.nilable(T::Boolean)) }
117
+ attr_reader :approved
118
+
119
+ sig { params(approved: T::Boolean).void }
120
+ attr_writer :approved
121
+
122
+ # The decision made by the rule for this event.
123
+ sig do
124
+ returns(
125
+ T.nilable(
126
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
127
+ )
128
+ )
129
+ end
130
+ attr_reader :decision
131
+
132
+ sig do
133
+ params(
134
+ decision:
135
+ Lithic::AuthRules::RuleStats::Example::Decision::OrSymbol
136
+ ).void
137
+ end
138
+ attr_writer :decision
139
+
140
+ # The event token.
141
+ sig { returns(T.nilable(String)) }
142
+ attr_reader :event_token
143
+
144
+ sig { params(event_token: String).void }
145
+ attr_writer :event_token
146
+
147
+ # The timestamp of the event.
148
+ sig { returns(T.nilable(Time)) }
149
+ attr_reader :timestamp
150
+
151
+ sig { params(timestamp: Time).void }
152
+ attr_writer :timestamp
153
+
154
+ sig do
155
+ params(
156
+ approved: T::Boolean,
157
+ decision:
158
+ Lithic::AuthRules::RuleStats::Example::Decision::OrSymbol,
159
+ event_token: String,
160
+ timestamp: Time
161
+ ).returns(T.attached_class)
162
+ end
163
+ def self.new(
164
+ # Whether the rule would have approved the request.
165
+ approved: nil,
166
+ # The decision made by the rule for this event.
167
+ decision: nil,
168
+ # The event token.
169
+ event_token: nil,
170
+ # The timestamp of the event.
171
+ timestamp: nil
172
+ )
173
+ end
174
+
175
+ sig do
176
+ override.returns(
177
+ {
178
+ approved: T::Boolean,
179
+ decision:
180
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol,
181
+ event_token: String,
182
+ timestamp: Time
183
+ }
184
+ )
185
+ end
186
+ def to_hash
187
+ end
188
+
189
+ # The decision made by the rule for this event.
190
+ module Decision
191
+ extend Lithic::Internal::Type::Enum
192
+
193
+ TaggedSymbol =
194
+ T.type_alias do
195
+ T.all(Symbol, Lithic::AuthRules::RuleStats::Example::Decision)
196
+ end
197
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
198
+
199
+ APPROVED =
200
+ T.let(
201
+ :APPROVED,
202
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
203
+ )
204
+ DECLINED =
205
+ T.let(
206
+ :DECLINED,
207
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
208
+ )
209
+ CHALLENGED =
210
+ T.let(
211
+ :CHALLENGED,
212
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
213
+ )
214
+
215
+ sig do
216
+ override.returns(
217
+ T::Array[
218
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
219
+ ]
220
+ )
221
+ end
222
+ def self.values
223
+ end
224
+ end
225
+ end
226
+ end
227
+ end
228
+ end
229
+ end