lithic 0.1.0.pre.alpha.46 → 0.1.0.pre.alpha.48

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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/file_part.rb +10 -7
  5. data/lib/lithic/internal/type/file_input.rb +7 -4
  6. data/lib/lithic/models/auth_rules/v2_apply_response.rb +20 -1
  7. data/lib/lithic/models/auth_rules/v2_create_params.rb +5 -0
  8. data/lib/lithic/models/auth_rules/v2_create_response.rb +20 -1
  9. data/lib/lithic/models/auth_rules/v2_draft_params.rb +5 -0
  10. data/lib/lithic/models/auth_rules/v2_draft_response.rb +20 -1
  11. data/lib/lithic/models/auth_rules/v2_list_response.rb +20 -1
  12. data/lib/lithic/models/auth_rules/v2_promote_response.rb +20 -1
  13. data/lib/lithic/models/auth_rules/v2_retrieve_features_params.rb +28 -0
  14. data/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb +188 -0
  15. data/lib/lithic/models/auth_rules/v2_retrieve_response.rb +20 -1
  16. data/lib/lithic/models/auth_rules/v2_update_response.rb +20 -1
  17. data/lib/lithic/models/auth_rules/velocity_limit_params.rb +44 -3
  18. data/lib/lithic/models/auth_rules/velocity_limit_params_period_window.rb +10 -0
  19. data/lib/lithic/resources/auth_rules/v2.rb +34 -0
  20. data/lib/lithic/version.rb +1 -1
  21. data/lib/lithic.rb +2 -0
  22. data/rbi/lithic/file_part.rbi +1 -1
  23. data/rbi/lithic/models/auth_rules/v2_apply_response.rbi +32 -0
  24. data/rbi/lithic/models/auth_rules/v2_create_params.rbi +11 -0
  25. data/rbi/lithic/models/auth_rules/v2_create_response.rbi +32 -0
  26. data/rbi/lithic/models/auth_rules/v2_draft_params.rbi +11 -0
  27. data/rbi/lithic/models/auth_rules/v2_draft_response.rbi +32 -0
  28. data/rbi/lithic/models/auth_rules/v2_list_response.rbi +32 -0
  29. data/rbi/lithic/models/auth_rules/v2_promote_response.rbi +32 -0
  30. data/rbi/lithic/models/auth_rules/v2_retrieve_features_params.rbi +54 -0
  31. data/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi +443 -0
  32. data/rbi/lithic/models/auth_rules/v2_retrieve_response.rbi +32 -0
  33. data/rbi/lithic/models/auth_rules/v2_update_response.rbi +32 -0
  34. data/rbi/lithic/models/auth_rules/velocity_limit_params.rbi +137 -3
  35. data/rbi/lithic/models/auth_rules/velocity_limit_params_period_window.rbi +4 -0
  36. data/rbi/lithic/resources/auth_rules/v2.rbi +26 -0
  37. data/sig/lithic/file_part.rbs +1 -1
  38. data/sig/lithic/models/auth_rules/v2_apply_response.rbs +9 -0
  39. data/sig/lithic/models/auth_rules/v2_create_params.rbs +2 -0
  40. data/sig/lithic/models/auth_rules/v2_create_response.rbs +9 -0
  41. data/sig/lithic/models/auth_rules/v2_draft_params.rbs +2 -0
  42. data/sig/lithic/models/auth_rules/v2_draft_response.rbs +9 -0
  43. data/sig/lithic/models/auth_rules/v2_list_response.rbs +9 -0
  44. data/sig/lithic/models/auth_rules/v2_promote_response.rbs +9 -0
  45. data/sig/lithic/models/auth_rules/v2_retrieve_features_params.rbs +34 -0
  46. data/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs +158 -0
  47. data/sig/lithic/models/auth_rules/v2_retrieve_response.rbs +9 -0
  48. data/sig/lithic/models/auth_rules/v2_update_response.rbs +9 -0
  49. data/sig/lithic/models/auth_rules/velocity_limit_params.rbs +47 -3
  50. data/sig/lithic/resources/auth_rules/v2.rbs +7 -0
  51. metadata +8 -2
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lithic
4
+ module Models
5
+ module AuthRules
6
+ # @see Lithic::Resources::AuthRules::V2#retrieve_features
7
+ class V2RetrieveFeaturesResponse < Lithic::Internal::Type::BaseModel
8
+ # @!attribute evaluated
9
+ # Timestamp at which the Features were evaluated
10
+ #
11
+ # @return [Time]
12
+ required :evaluated, Time
13
+
14
+ # @!attribute features
15
+ # Calculated Features used for evaluation of the provided Auth Rule
16
+ #
17
+ # @return [Array<Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature>]
18
+ required :features,
19
+ -> { Lithic::Internal::Type::ArrayOf[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature] }
20
+
21
+ # @!method initialize(evaluated:, features:)
22
+ # @param evaluated [Time] Timestamp at which the Features were evaluated
23
+ #
24
+ # @param features [Array<Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature>] Calculated Features used for evaluation of the provided Auth Rule
25
+
26
+ class Feature < Lithic::Internal::Type::BaseModel
27
+ # @!attribute filters
28
+ #
29
+ # @return [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters]
30
+ required :filters, -> { Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters }
31
+
32
+ # @!attribute period
33
+ # DEPRECATED: This has been deprecated in favor of the Trailing Window Objects
34
+ #
35
+ # The size of the trailing window to calculate Spend Velocity over in seconds. The
36
+ # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days).
37
+ #
38
+ # @return [Integer, Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindow, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowYear]
39
+ required :period, union: -> { Lithic::AuthRules::VelocityLimitParamsPeriodWindow }
40
+
41
+ # @!attribute scope
42
+ # The scope the velocity is calculated for
43
+ #
44
+ # @return [Symbol, Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope]
45
+ required :scope, enum: -> { Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope }
46
+
47
+ # @!attribute value
48
+ #
49
+ # @return [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value]
50
+ required :value, -> { Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value }
51
+
52
+ # @!method initialize(filters:, period:, scope:, value:)
53
+ # Some parameter documentations has been truncated, see
54
+ # {Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature} for more
55
+ # details.
56
+ #
57
+ # @param filters [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters]
58
+ #
59
+ # @param period [Integer, Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindow, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowYear] DEPRECATED: This has been deprecated in favor of the Trailing Window Objects
60
+ #
61
+ # @param scope [Symbol, Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope] The scope the velocity is calculated for
62
+ #
63
+ # @param value [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value]
64
+
65
+ # @see Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature#filters
66
+ class Filters < Lithic::Internal::Type::BaseModel
67
+ # @!attribute exclude_countries
68
+ # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation.
69
+ # Transactions matching any of the provided will be excluded from the calculated
70
+ # velocity.
71
+ #
72
+ # @return [Array<String>, nil]
73
+ optional :exclude_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true
74
+
75
+ # @!attribute exclude_mccs
76
+ # Merchant Category Codes to exclude from the velocity calculation. Transactions
77
+ # matching this MCC will be excluded from the calculated velocity.
78
+ #
79
+ # @return [Array<String>, nil]
80
+ optional :exclude_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true
81
+
82
+ # @!attribute include_countries
83
+ # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation.
84
+ # Transactions not matching any of the provided will not be included in the
85
+ # calculated velocity.
86
+ #
87
+ # @return [Array<String>, nil]
88
+ optional :include_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true
89
+
90
+ # @!attribute include_mccs
91
+ # Merchant Category Codes to include in the velocity calculation. Transactions not
92
+ # matching this MCC will not be included in the calculated velocity.
93
+ #
94
+ # @return [Array<String>, nil]
95
+ optional :include_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true
96
+
97
+ # @!attribute include_pan_entry_modes
98
+ # PAN entry modes to include in the velocity calculation. Transactions not
99
+ # matching any of the provided will not be included in the calculated velocity.
100
+ #
101
+ # @return [Array<Symbol, Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode>, nil]
102
+ optional :include_pan_entry_modes,
103
+ -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode] },
104
+ nil?: true
105
+
106
+ # @!method initialize(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil, include_pan_entry_modes: nil)
107
+ # Some parameter documentations has been truncated, see
108
+ # {Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters} for
109
+ # more details.
110
+ #
111
+ # @param exclude_countries [Array<String>, nil] ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Trans
112
+ #
113
+ # @param exclude_mccs [Array<String>, nil] Merchant Category Codes to exclude from the velocity calculation. Transactions m
114
+ #
115
+ # @param include_countries [Array<String>, nil] ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transac
116
+ #
117
+ # @param include_mccs [Array<String>, nil] Merchant Category Codes to include in the velocity calculation. Transactions not
118
+ #
119
+ # @param include_pan_entry_modes [Array<Symbol, Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode>, nil] PAN entry modes to include in the velocity calculation. Transactions not matchin
120
+
121
+ module IncludePanEntryMode
122
+ extend Lithic::Internal::Type::Enum
123
+
124
+ AUTO_ENTRY = :AUTO_ENTRY
125
+ BAR_CODE = :BAR_CODE
126
+ CONTACTLESS = :CONTACTLESS
127
+ CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE
128
+ ECOMMERCE = :ECOMMERCE
129
+ ERROR_KEYED = :ERROR_KEYED
130
+ ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE
131
+ ICC = :ICC
132
+ KEY_ENTERED = :KEY_ENTERED
133
+ MAGNETIC_STRIPE = :MAGNETIC_STRIPE
134
+ MANUAL = :MANUAL
135
+ OCR = :OCR
136
+ SECURE_CARDLESS = :SECURE_CARDLESS
137
+ UNSPECIFIED = :UNSPECIFIED
138
+ UNKNOWN = :UNKNOWN
139
+
140
+ # @!method self.values
141
+ # @return [Array<Symbol>]
142
+ end
143
+ end
144
+
145
+ # The scope the velocity is calculated for
146
+ #
147
+ # @see Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature#scope
148
+ module Scope
149
+ extend Lithic::Internal::Type::Enum
150
+
151
+ CARD = :CARD
152
+ ACCOUNT = :ACCOUNT
153
+
154
+ # @!method self.values
155
+ # @return [Array<Symbol>]
156
+ end
157
+
158
+ # @see Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature#value
159
+ class Value < Lithic::Internal::Type::BaseModel
160
+ # @!attribute amount
161
+ # Amount (in cents) for the given Auth Rule that is used as input for calculating
162
+ # the rule. For Velocity Limit rules this would be the calculated Velocity. For
163
+ # Conditional Rules using CARD*TRANSACTION_COUNT*\* this will be 0
164
+ #
165
+ # @return [Integer]
166
+ required :amount, Integer
167
+
168
+ # @!attribute count
169
+ # Number of velocity impacting transactions matching the given scope, period and
170
+ # filters
171
+ #
172
+ # @return [Integer]
173
+ required :count, Integer
174
+
175
+ # @!method initialize(amount:, count:)
176
+ # Some parameter documentations has been truncated, see
177
+ # {Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value} for more
178
+ # details.
179
+ #
180
+ # @param amount [Integer] Amount (in cents) for the given Auth Rule that is used as input for calculating
181
+ #
182
+ # @param count [Integer] Number of velocity impacting transactions matching the given scope, period and f
183
+ end
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -47,6 +47,13 @@ module Lithic
47
47
  # @return [Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::EventStream]
48
48
  required :event_stream, enum: -> { Lithic::Models::AuthRules::V2RetrieveResponse::EventStream }
49
49
 
50
+ # @!attribute lithic_managed
51
+ # Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
52
+ # be modified or deleted by the user
53
+ #
54
+ # @return [Boolean]
55
+ required :lithic_managed, Lithic::Internal::Type::Boolean
56
+
50
57
  # @!attribute name
51
58
  # Auth Rule Name
52
59
  #
@@ -85,7 +92,7 @@ module Lithic
85
92
  # @return [Array<String>, nil]
86
93
  optional :excluded_card_tokens, Lithic::Internal::Type::ArrayOf[String]
87
94
 
88
- # @!method initialize(token:, account_tokens:, business_account_tokens:, card_tokens:, current_version:, draft_version:, event_stream:, name:, program_level:, state:, type:, excluded_card_tokens: nil)
95
+ # @!method initialize(token:, account_tokens:, business_account_tokens:, card_tokens:, current_version:, draft_version:, event_stream:, lithic_managed:, name:, program_level:, state:, type:, excluded_card_tokens: nil)
89
96
  # Some parameter documentations has been truncated, see
90
97
  # {Lithic::Models::AuthRules::V2RetrieveResponse} for more details.
91
98
  #
@@ -103,6 +110,8 @@ module Lithic
103
110
  #
104
111
  # @param event_stream [Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::EventStream] The event stream during which the rule will be evaluated.
105
112
  #
113
+ # @param lithic_managed [Boolean] Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
114
+ #
106
115
  # @param name [String, nil] Auth Rule Name
107
116
  #
108
117
  # @param program_level [Boolean] Whether the Auth Rule applies to all authorizations on the card program.
@@ -220,6 +229,8 @@ module Lithic
220
229
  # fee field in the settlement/cardholder billing currency. This is the amount
221
230
  # the issuer should authorize against unless the issuer is paying the acquirer
222
231
  # fee on behalf of the cardholder.
232
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
233
+ # represents the amount of cash being withdrawn or advanced.
223
234
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
224
235
  # given authorization. Scores are on a range of 0-999, with 0 representing the
225
236
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -299,6 +310,8 @@ module Lithic
299
310
  # fee field in the settlement/cardholder billing currency. This is the amount
300
311
  # the issuer should authorize against unless the issuer is paying the acquirer
301
312
  # fee on behalf of the cardholder.
313
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
314
+ # represents the amount of cash being withdrawn or advanced.
302
315
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
303
316
  # given authorization. Scores are on a range of 0-999, with 0 representing the
304
317
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -335,6 +348,7 @@ module Lithic
335
348
  LIABILITY_SHIFT = :LIABILITY_SHIFT
336
349
  PAN_ENTRY_MODE = :PAN_ENTRY_MODE
337
350
  TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT
351
+ CASH_AMOUNT = :CASH_AMOUNT
338
352
  RISK_SCORE = :RISK_SCORE
339
353
  CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M
340
354
  CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H
@@ -505,6 +519,8 @@ module Lithic
505
519
  # fee field in the settlement/cardholder billing currency. This is the amount
506
520
  # the issuer should authorize against unless the issuer is paying the acquirer
507
521
  # fee on behalf of the cardholder.
522
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
523
+ # represents the amount of cash being withdrawn or advanced.
508
524
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
509
525
  # given authorization. Scores are on a range of 0-999, with 0 representing the
510
526
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -584,6 +600,8 @@ module Lithic
584
600
  # fee field in the settlement/cardholder billing currency. This is the amount
585
601
  # the issuer should authorize against unless the issuer is paying the acquirer
586
602
  # fee on behalf of the cardholder.
603
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
604
+ # represents the amount of cash being withdrawn or advanced.
587
605
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
588
606
  # given authorization. Scores are on a range of 0-999, with 0 representing the
589
607
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -620,6 +638,7 @@ module Lithic
620
638
  LIABILITY_SHIFT = :LIABILITY_SHIFT
621
639
  PAN_ENTRY_MODE = :PAN_ENTRY_MODE
622
640
  TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT
641
+ CASH_AMOUNT = :CASH_AMOUNT
623
642
  RISK_SCORE = :RISK_SCORE
624
643
  CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M
625
644
  CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H
@@ -45,6 +45,13 @@ module Lithic
45
45
  # @return [Symbol, Lithic::Models::AuthRules::V2UpdateResponse::EventStream]
46
46
  required :event_stream, enum: -> { Lithic::Models::AuthRules::V2UpdateResponse::EventStream }
47
47
 
48
+ # @!attribute lithic_managed
49
+ # Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
50
+ # be modified or deleted by the user
51
+ #
52
+ # @return [Boolean]
53
+ required :lithic_managed, Lithic::Internal::Type::Boolean
54
+
48
55
  # @!attribute name
49
56
  # Auth Rule Name
50
57
  #
@@ -83,7 +90,7 @@ module Lithic
83
90
  # @return [Array<String>, nil]
84
91
  optional :excluded_card_tokens, Lithic::Internal::Type::ArrayOf[String]
85
92
 
86
- # @!method initialize(token:, account_tokens:, business_account_tokens:, card_tokens:, current_version:, draft_version:, event_stream:, name:, program_level:, state:, type:, excluded_card_tokens: nil)
93
+ # @!method initialize(token:, account_tokens:, business_account_tokens:, card_tokens:, current_version:, draft_version:, event_stream:, lithic_managed:, name:, program_level:, state:, type:, excluded_card_tokens: nil)
87
94
  # Some parameter documentations has been truncated, see
88
95
  # {Lithic::Models::AuthRules::V2UpdateResponse} for more details.
89
96
  #
@@ -101,6 +108,8 @@ module Lithic
101
108
  #
102
109
  # @param event_stream [Symbol, Lithic::Models::AuthRules::V2UpdateResponse::EventStream] The event stream during which the rule will be evaluated.
103
110
  #
111
+ # @param lithic_managed [Boolean] Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
112
+ #
104
113
  # @param name [String, nil] Auth Rule Name
105
114
  #
106
115
  # @param program_level [Boolean] Whether the Auth Rule applies to all authorizations on the card program.
@@ -217,6 +226,8 @@ module Lithic
217
226
  # fee field in the settlement/cardholder billing currency. This is the amount
218
227
  # the issuer should authorize against unless the issuer is paying the acquirer
219
228
  # fee on behalf of the cardholder.
229
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
230
+ # represents the amount of cash being withdrawn or advanced.
220
231
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
221
232
  # given authorization. Scores are on a range of 0-999, with 0 representing the
222
233
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -296,6 +307,8 @@ module Lithic
296
307
  # fee field in the settlement/cardholder billing currency. This is the amount
297
308
  # the issuer should authorize against unless the issuer is paying the acquirer
298
309
  # fee on behalf of the cardholder.
310
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
311
+ # represents the amount of cash being withdrawn or advanced.
299
312
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
300
313
  # given authorization. Scores are on a range of 0-999, with 0 representing the
301
314
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -332,6 +345,7 @@ module Lithic
332
345
  LIABILITY_SHIFT = :LIABILITY_SHIFT
333
346
  PAN_ENTRY_MODE = :PAN_ENTRY_MODE
334
347
  TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT
348
+ CASH_AMOUNT = :CASH_AMOUNT
335
349
  RISK_SCORE = :RISK_SCORE
336
350
  CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M
337
351
  CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H
@@ -501,6 +515,8 @@ module Lithic
501
515
  # fee field in the settlement/cardholder billing currency. This is the amount
502
516
  # the issuer should authorize against unless the issuer is paying the acquirer
503
517
  # fee on behalf of the cardholder.
518
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
519
+ # represents the amount of cash being withdrawn or advanced.
504
520
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
505
521
  # given authorization. Scores are on a range of 0-999, with 0 representing the
506
522
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -580,6 +596,8 @@ module Lithic
580
596
  # fee field in the settlement/cardholder billing currency. This is the amount
581
597
  # the issuer should authorize against unless the issuer is paying the acquirer
582
598
  # fee on behalf of the cardholder.
599
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
600
+ # represents the amount of cash being withdrawn or advanced.
583
601
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
584
602
  # given authorization. Scores are on a range of 0-999, with 0 representing the
585
603
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -616,6 +634,7 @@ module Lithic
616
634
  LIABILITY_SHIFT = :LIABILITY_SHIFT
617
635
  PAN_ENTRY_MODE = :PAN_ENTRY_MODE
618
636
  TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT
637
+ CASH_AMOUNT = :CASH_AMOUNT
619
638
  RISK_SCORE = :RISK_SCORE
620
639
  CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M
621
640
  CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H
@@ -10,6 +10,8 @@ module Lithic
10
10
  required :filters, -> { Lithic::AuthRules::VelocityLimitParams::Filters }
11
11
 
12
12
  # @!attribute period
13
+ # DEPRECATED: This has been deprecated in favor of the Trailing Window Objects
14
+ #
13
15
  # The size of the trailing window to calculate Spend Velocity over in seconds. The
14
16
  # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days).
15
17
  #
@@ -17,6 +19,7 @@ module Lithic
17
19
  required :period, union: -> { Lithic::AuthRules::VelocityLimitParamsPeriodWindow }
18
20
 
19
21
  # @!attribute scope
22
+ # The scope the velocity is calculated for
20
23
  #
21
24
  # @return [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope]
22
25
  required :scope, enum: -> { Lithic::AuthRules::VelocityLimitParams::Scope }
@@ -45,9 +48,9 @@ module Lithic
45
48
  #
46
49
  # @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters]
47
50
  #
48
- # @param period [Integer, Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindow, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowYear] The size of the trailing window to calculate Spend Velocity over in seconds. The
51
+ # @param period [Integer, Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindow, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowYear] DEPRECATED: This has been deprecated in favor of the Trailing Window Objects
49
52
  #
50
- # @param scope [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope]
53
+ # @param scope [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] The scope the velocity is calculated for
51
54
  #
52
55
  # @param limit_amount [Integer, nil] The maximum amount of spend velocity allowed in the period in minor units (the s
53
56
  #
@@ -85,7 +88,18 @@ module Lithic
85
88
  # @return [Array<String>, nil]
86
89
  optional :include_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true
87
90
 
88
- # @!method initialize(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil)
91
+ # @!attribute include_pan_entry_modes
92
+ # PAN entry modes to include in the velocity calculation. Transactions not
93
+ # matching any of the provided will not be included in the calculated velocity.
94
+ #
95
+ # @return [Array<Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode>, nil]
96
+ optional :include_pan_entry_modes,
97
+ -> {
98
+ Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode]
99
+ },
100
+ nil?: true
101
+
102
+ # @!method initialize(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil, include_pan_entry_modes: nil)
89
103
  # Some parameter documentations has been truncated, see
90
104
  # {Lithic::Models::AuthRules::VelocityLimitParams::Filters} for more details.
91
105
  #
@@ -96,8 +110,35 @@ module Lithic
96
110
  # @param include_countries [Array<String>, nil] ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transac
97
111
  #
98
112
  # @param include_mccs [Array<String>, nil] Merchant Category Codes to include in the velocity calculation. Transactions not
113
+ #
114
+ # @param include_pan_entry_modes [Array<Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode>, nil] PAN entry modes to include in the velocity calculation. Transactions not matchin
115
+
116
+ module IncludePanEntryMode
117
+ extend Lithic::Internal::Type::Enum
118
+
119
+ AUTO_ENTRY = :AUTO_ENTRY
120
+ BAR_CODE = :BAR_CODE
121
+ CONTACTLESS = :CONTACTLESS
122
+ CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE
123
+ ECOMMERCE = :ECOMMERCE
124
+ ERROR_KEYED = :ERROR_KEYED
125
+ ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE
126
+ ICC = :ICC
127
+ KEY_ENTERED = :KEY_ENTERED
128
+ MAGNETIC_STRIPE = :MAGNETIC_STRIPE
129
+ MANUAL = :MANUAL
130
+ OCR = :OCR
131
+ SECURE_CARDLESS = :SECURE_CARDLESS
132
+ UNSPECIFIED = :UNSPECIFIED
133
+ UNKNOWN = :UNKNOWN
134
+
135
+ # @!method self.values
136
+ # @return [Array<Symbol>]
137
+ end
99
138
  end
100
139
 
140
+ # The scope the velocity is calculated for
141
+ #
101
142
  # @see Lithic::Models::AuthRules::VelocityLimitParams#scope
102
143
  module Scope
103
144
  extend Lithic::Internal::Type::Enum
@@ -3,14 +3,20 @@
3
3
  module Lithic
4
4
  module Models
5
5
  module AuthRules
6
+ # DEPRECATED: This has been deprecated in favor of the Trailing Window Objects
7
+ #
6
8
  # The size of the trailing window to calculate Spend Velocity over in seconds. The
7
9
  # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days).
8
10
  module VelocityLimitParamsPeriodWindow
9
11
  extend Lithic::Internal::Type::Union
10
12
 
13
+ # DEPRECATED: This has been deprecated in favor of the Trailing Window Objects
14
+ #
11
15
  # The size of the trailing window to calculate Spend Velocity over in seconds. The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days).
12
16
  variant Integer
13
17
 
18
+ # DEPRECATED: This has been deprecated in favor of the other Fixed Window Objects
19
+ #
14
20
  # The window of time to calculate Spend Velocity over.
15
21
  #
16
22
  # * `DAY`: Velocity over the current day since midnight Eastern Time.
@@ -33,6 +39,10 @@ module Lithic
33
39
  # Velocity over the current year since 00:00 / 12 AM in Eastern Time on specified `month` and `day_of_month`. This validates the month and day of the year to start from is a real date. In the event that February 29th is selected, in non-leap years, the window will start from February 28th.
34
40
  variant -> { Lithic::AuthRules::VelocityLimitParamsPeriodWindow::FixedWindowYear }
35
41
 
42
+ # @deprecated
43
+ #
44
+ # DEPRECATED: This has been deprecated in favor of the other Fixed Window Objects
45
+ #
36
46
  # The window of time to calculate Spend Velocity over.
37
47
  #
38
48
  # - `DAY`: Velocity over the current day since midnight Eastern Time.
@@ -324,6 +324,40 @@ module Lithic
324
324
  )
325
325
  end
326
326
 
327
+ # Fetches the current calculated Feature values for the given Auth Rule
328
+ #
329
+ # This only calculates the features for the active version.
330
+ #
331
+ # - VelocityLimit Rules calculates the current Velocity Feature data. This
332
+ # requires a `card_token` or `account_token` matching what the rule is Scoped
333
+ # to.
334
+ # - ConditionalBlock Rules calculates the CARD*TRANSACTION_COUNT*\* attributes on
335
+ # the rule. This requires a `card_token`
336
+ #
337
+ # @overload retrieve_features(auth_rule_token, account_token: nil, card_token: nil, request_options: {})
338
+ #
339
+ # @param auth_rule_token [String] Globally unique identifier for the Auth Rule.
340
+ #
341
+ # @param account_token [String]
342
+ #
343
+ # @param card_token [String]
344
+ #
345
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
346
+ #
347
+ # @return [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse]
348
+ #
349
+ # @see Lithic::Models::AuthRules::V2RetrieveFeaturesParams
350
+ def retrieve_features(auth_rule_token, params = {})
351
+ parsed, options = Lithic::AuthRules::V2RetrieveFeaturesParams.dump_request(params)
352
+ @client.request(
353
+ method: :get,
354
+ path: ["v2/auth_rules/%1$s/features", auth_rule_token],
355
+ query: parsed,
356
+ model: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse,
357
+ options: options
358
+ )
359
+ end
360
+
327
361
  # Retrieves a performance report for an Auth rule containing daily statistics and
328
362
  # evaluation outcomes.
329
363
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lithic
4
- VERSION = "0.1.0.pre.alpha.46"
4
+ VERSION = "0.1.0.pre.alpha.48"
5
5
  end
data/lib/lithic.rb CHANGED
@@ -110,6 +110,8 @@ require_relative "lithic/models/auth_rules/v2_promote_params"
110
110
  require_relative "lithic/models/auth_rules/v2_promote_response"
111
111
  require_relative "lithic/models/auth_rules/v2_report_params"
112
112
  require_relative "lithic/models/auth_rules/v2_report_response"
113
+ require_relative "lithic/models/auth_rules/v2_retrieve_features_params"
114
+ require_relative "lithic/models/auth_rules/v2_retrieve_features_response"
113
115
  require_relative "lithic/models/auth_rules/v2_retrieve_params"
114
116
  require_relative "lithic/models/auth_rules/v2_retrieve_report_params"
115
117
  require_relative "lithic/models/auth_rules/v2_retrieve_report_response"
@@ -27,7 +27,7 @@ module Lithic
27
27
  sig do
28
28
  params(
29
29
  content: T.any(Pathname, StringIO, IO, String),
30
- filename: T.nilable(String),
30
+ filename: T.nilable(T.any(Pathname, String)),
31
31
  content_type: T.nilable(String)
32
32
  ).returns(T.attached_class)
33
33
  end
@@ -72,6 +72,11 @@ module Lithic
72
72
  end
73
73
  attr_accessor :event_stream
74
74
 
75
+ # Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
76
+ # be modified or deleted by the user
77
+ sig { returns(T::Boolean) }
78
+ attr_accessor :lithic_managed
79
+
75
80
  # Auth Rule Name
76
81
  sig { returns(T.nilable(String)) }
77
82
  attr_accessor :name
@@ -127,6 +132,7 @@ module Lithic
127
132
  ),
128
133
  event_stream:
129
134
  Lithic::Models::AuthRules::V2ApplyResponse::EventStream::OrSymbol,
135
+ lithic_managed: T::Boolean,
130
136
  name: T.nilable(String),
131
137
  program_level: T::Boolean,
132
138
  state: Lithic::Models::AuthRules::V2ApplyResponse::State::OrSymbol,
@@ -147,6 +153,9 @@ module Lithic
147
153
  draft_version:,
148
154
  # The event stream during which the rule will be evaluated.
149
155
  event_stream:,
156
+ # Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
157
+ # be modified or deleted by the user
158
+ lithic_managed:,
150
159
  # Auth Rule Name
151
160
  name:,
152
161
  # Whether the Auth Rule applies to all authorizations on the card program.
@@ -185,6 +194,7 @@ module Lithic
185
194
  ),
186
195
  event_stream:
187
196
  Lithic::Models::AuthRules::V2ApplyResponse::EventStream::TaggedSymbol,
197
+ lithic_managed: T::Boolean,
188
198
  name: T.nilable(String),
189
199
  program_level: T::Boolean,
190
200
  state:
@@ -397,6 +407,8 @@ module Lithic
397
407
  # fee field in the settlement/cardholder billing currency. This is the amount
398
408
  # the issuer should authorize against unless the issuer is paying the acquirer
399
409
  # fee on behalf of the cardholder.
410
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
411
+ # represents the amount of cash being withdrawn or advanced.
400
412
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
401
413
  # given authorization. Scores are on a range of 0-999, with 0 representing the
402
414
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -510,6 +522,8 @@ module Lithic
510
522
  # fee field in the settlement/cardholder billing currency. This is the amount
511
523
  # the issuer should authorize against unless the issuer is paying the acquirer
512
524
  # fee on behalf of the cardholder.
525
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
526
+ # represents the amount of cash being withdrawn or advanced.
513
527
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
514
528
  # given authorization. Scores are on a range of 0-999, with 0 representing the
515
529
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -582,6 +596,8 @@ module Lithic
582
596
  # fee field in the settlement/cardholder billing currency. This is the amount
583
597
  # the issuer should authorize against unless the issuer is paying the acquirer
584
598
  # fee on behalf of the cardholder.
599
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
600
+ # represents the amount of cash being withdrawn or advanced.
585
601
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
586
602
  # given authorization. Scores are on a range of 0-999, with 0 representing the
587
603
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -657,6 +673,11 @@ module Lithic
657
673
  :TRANSACTION_AMOUNT,
658
674
  Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::Parameters::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
659
675
  )
676
+ CASH_AMOUNT =
677
+ T.let(
678
+ :CASH_AMOUNT,
679
+ Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::Parameters::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
680
+ )
660
681
  RISK_SCORE =
661
682
  T.let(
662
683
  :RISK_SCORE,
@@ -1026,6 +1047,8 @@ module Lithic
1026
1047
  # fee field in the settlement/cardholder billing currency. This is the amount
1027
1048
  # the issuer should authorize against unless the issuer is paying the acquirer
1028
1049
  # fee on behalf of the cardholder.
1050
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
1051
+ # represents the amount of cash being withdrawn or advanced.
1029
1052
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
1030
1053
  # given authorization. Scores are on a range of 0-999, with 0 representing the
1031
1054
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -1139,6 +1162,8 @@ module Lithic
1139
1162
  # fee field in the settlement/cardholder billing currency. This is the amount
1140
1163
  # the issuer should authorize against unless the issuer is paying the acquirer
1141
1164
  # fee on behalf of the cardholder.
1165
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
1166
+ # represents the amount of cash being withdrawn or advanced.
1142
1167
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
1143
1168
  # given authorization. Scores are on a range of 0-999, with 0 representing the
1144
1169
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -1211,6 +1236,8 @@ module Lithic
1211
1236
  # fee field in the settlement/cardholder billing currency. This is the amount
1212
1237
  # the issuer should authorize against unless the issuer is paying the acquirer
1213
1238
  # fee on behalf of the cardholder.
1239
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
1240
+ # represents the amount of cash being withdrawn or advanced.
1214
1241
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
1215
1242
  # given authorization. Scores are on a range of 0-999, with 0 representing the
1216
1243
  # lowest risk and 999 representing the highest risk. For Visa transactions,
@@ -1286,6 +1313,11 @@ module Lithic
1286
1313
  :TRANSACTION_AMOUNT,
1287
1314
  Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::Parameters::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
1288
1315
  )
1316
+ CASH_AMOUNT =
1317
+ T.let(
1318
+ :CASH_AMOUNT,
1319
+ Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::Parameters::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
1320
+ )
1289
1321
  RISK_SCORE =
1290
1322
  T.let(
1291
1323
  :RISK_SCORE,