Skip to content

Commit bd02001

Browse files
feat(api): add action_counts to rule performance reports and code to authorization actions
1 parent 8c7b917 commit bd02001

29 files changed

Lines changed: 4180 additions & 411 deletions

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 185
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a45946df228eec554b3cd2491f658bd5a45cb91509da0a9f92d50468ea88072f.yml
3-
openapi_spec_hash: 24c7c13e1e7385cab5442ca66091ffc6
4-
config_hash: 50031f78031362c2e4900222b9ce7ada
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-b29a4bd5ca21348ef426162cbd1fa21070f695572626e4e6faabfa14af38f0b0.yml
3+
openapi_spec_hash: e7c285d6b7006d040ecb50a9d0d2fc17
4+
config_hash: fb5070d41fcabdedbc084b83964b592a

lib/lithic.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
require_relative "lithic/models/api_status"
115115
require_relative "lithic/models/auth_rules/auth_rule"
116116
require_relative "lithic/models/auth_rules/auth_rule_condition"
117+
require_relative "lithic/models/auth_rules/backtest_stats"
117118
require_relative "lithic/models/auth_rules/conditional_3ds_action_parameters"
118119
require_relative "lithic/models/auth_rules/conditional_ach_action_parameters"
119120
require_relative "lithic/models/auth_rules/conditional_attribute"
@@ -124,7 +125,7 @@
124125
require_relative "lithic/models/auth_rules/conditional_value"
125126
require_relative "lithic/models/auth_rules/event_stream"
126127
require_relative "lithic/models/auth_rules/merchant_lock_parameters"
127-
require_relative "lithic/models/auth_rules/rule_stats"
128+
require_relative "lithic/models/auth_rules/report_stats"
128129
require_relative "lithic/models/auth_rules/v2/backtest_create_params"
129130
require_relative "lithic/models/auth_rules/v2/backtest_create_response"
130131
require_relative "lithic/models/auth_rules/v2/backtest_retrieve_params"

lib/lithic/models/auth_rules/rule_stats.rb renamed to lib/lithic/models/auth_rules/backtest_stats.rb

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
module Lithic
44
module Models
55
module AuthRules
6-
class RuleStats < Lithic::Internal::Type::BaseModel
6+
class BacktestStats < Lithic::Internal::Type::BaseModel
77
# @!attribute approved
88
# The total number of historical transactions approved by this rule during the
9-
# relevant period, or the number of transactions that would have been approved if
9+
# backtest period, or the number of transactions that would have been approved if
1010
# the rule was evaluated in shadow mode.
1111
#
1212
# @return [Integer, nil]
1313
optional :approved, Integer
1414

1515
# @!attribute challenged
1616
# The total number of historical transactions challenged by this rule during the
17-
# relevant period, or the number of transactions that would have been challenged
17+
# backtest period, or the number of transactions that would have been challenged
1818
# if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
1919
# Rules.
2020
#
@@ -23,7 +23,7 @@ class RuleStats < Lithic::Internal::Type::BaseModel
2323

2424
# @!attribute declined
2525
# The total number of historical transactions declined by this rule during the
26-
# relevant period, or the number of transactions that would have been declined if
26+
# backtest period, or the number of transactions that would have been declined if
2727
# the rule was evaluated in shadow mode.
2828
#
2929
# @return [Integer, nil]
@@ -32,8 +32,8 @@ class RuleStats < Lithic::Internal::Type::BaseModel
3232
# @!attribute examples
3333
# Example events and their outcomes.
3434
#
35-
# @return [Array<Lithic::Models::AuthRules::RuleStats::Example>, nil]
36-
optional :examples, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::RuleStats::Example] }
35+
# @return [Array<Lithic::Models::AuthRules::BacktestStats::Example>, nil]
36+
optional :examples, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::BacktestStats::Example] }
3737

3838
response_only do
3939
# @!attribute version
@@ -46,30 +46,24 @@ class RuleStats < Lithic::Internal::Type::BaseModel
4646

4747
# @!method initialize(approved: nil, challenged: nil, declined: nil, examples: nil, version: nil)
4848
# Some parameter documentations has been truncated, see
49-
# {Lithic::Models::AuthRules::RuleStats} for more details.
49+
# {Lithic::Models::AuthRules::BacktestStats} for more details.
5050
#
51-
# @param approved [Integer] The total number of historical transactions approved by this rule during the rel
51+
# @param approved [Integer] The total number of historical transactions approved by this rule during the bac
5252
#
53-
# @param challenged [Integer] The total number of historical transactions challenged by this rule during the r
53+
# @param challenged [Integer] The total number of historical transactions challenged by this rule during the b
5454
#
55-
# @param declined [Integer] The total number of historical transactions declined by this rule during the rel
55+
# @param declined [Integer] The total number of historical transactions declined by this rule during the bac
5656
#
57-
# @param examples [Array<Lithic::Models::AuthRules::RuleStats::Example>] Example events and their outcomes.
57+
# @param examples [Array<Lithic::Models::AuthRules::BacktestStats::Example>] Example events and their outcomes.
5858
#
5959
# @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan
6060

6161
class Example < Lithic::Internal::Type::BaseModel
62-
# @!attribute approved
63-
# Whether the rule would have approved the request.
64-
#
65-
# @return [Boolean, nil]
66-
optional :approved, Lithic::Internal::Type::Boolean
67-
6862
# @!attribute decision
6963
# The decision made by the rule for this event.
7064
#
71-
# @return [Symbol, Lithic::Models::AuthRules::RuleStats::Example::Decision, nil]
72-
optional :decision, enum: -> { Lithic::AuthRules::RuleStats::Example::Decision }
65+
# @return [Symbol, Lithic::Models::AuthRules::BacktestStats::Example::Decision, nil]
66+
optional :decision, enum: -> { Lithic::AuthRules::BacktestStats::Example::Decision }
7367

7468
# @!attribute event_token
7569
# The event token.
@@ -83,18 +77,16 @@ class Example < Lithic::Internal::Type::BaseModel
8377
# @return [Time, nil]
8478
optional :timestamp, Time
8579

86-
# @!method initialize(approved: nil, decision: nil, event_token: nil, timestamp: nil)
87-
# @param approved [Boolean] Whether the rule would have approved the request.
88-
#
89-
# @param decision [Symbol, Lithic::Models::AuthRules::RuleStats::Example::Decision] The decision made by the rule for this event.
80+
# @!method initialize(decision: nil, event_token: nil, timestamp: nil)
81+
# @param decision [Symbol, Lithic::Models::AuthRules::BacktestStats::Example::Decision] The decision made by the rule for this event.
9082
#
9183
# @param event_token [String] The event token.
9284
#
9385
# @param timestamp [Time] The timestamp of the event.
9486

9587
# The decision made by the rule for this event.
9688
#
97-
# @see Lithic::Models::AuthRules::RuleStats::Example#decision
89+
# @see Lithic::Models::AuthRules::BacktestStats::Example#decision
9890
module Decision
9991
extend Lithic::Internal::Type::Enum
10092

lib/lithic/models/auth_rules/conditional_ach_action_parameters.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class ConditionalACHActionParameters < Lithic::Internal::Type::BaseModel
77
# @!attribute action
88
# The action to take if the conditions are met.
99
#
10-
# @return [Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveAction, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction]
10+
# @return [Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction]
1111
required :action, union: -> { Lithic::AuthRules::ConditionalACHActionParameters::Action }
1212

1313
# @!attribute conditions
@@ -17,7 +17,7 @@ class ConditionalACHActionParameters < Lithic::Internal::Type::BaseModel
1717
-> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ConditionalACHActionParameters::Condition] }
1818

1919
# @!method initialize(action:, conditions:)
20-
# @param action [Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveAction, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction] The action to take if the conditions are met.
20+
# @param action [Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction] The action to take if the conditions are met.
2121
#
2222
# @param conditions [Array<Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition>]
2323

@@ -27,24 +27,24 @@ class ConditionalACHActionParameters < Lithic::Internal::Type::BaseModel
2727
module Action
2828
extend Lithic::Internal::Type::Union
2929

30-
variant -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveAction }
30+
variant -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH }
3131

3232
variant -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction }
3333

34-
class ApproveAction < Lithic::Internal::Type::BaseModel
34+
class ApproveActionACH < Lithic::Internal::Type::BaseModel
3535
# @!attribute type
3636
# Approve the ACH transaction
3737
#
38-
# @return [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveAction::Type]
38+
# @return [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type]
3939
required :type,
40-
enum: -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveAction::Type }
40+
enum: -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type }
4141

4242
# @!method initialize(type:)
43-
# @param type [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveAction::Type] Approve the ACH transaction
43+
# @param type [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type] Approve the ACH transaction
4444

4545
# Approve the ACH transaction
4646
#
47-
# @see Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveAction#type
47+
# @see Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH#type
4848
module Type
4949
extend Lithic::Internal::Type::Enum
5050

@@ -176,7 +176,7 @@ module Type
176176
end
177177

178178
# @!method self.variants
179-
# @return [Array(Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveAction, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction)]
179+
# @return [Array(Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction)]
180180
end
181181

182182
class Condition < Lithic::Internal::Type::BaseModel

lib/lithic/models/auth_rules/conditional_tokenization_action_parameters.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class ConditionalTokenizationActionParameters < Lithic::Internal::Type::BaseMode
77
# @!attribute action
88
# The action to take if the conditions are met.
99
#
10-
# @return [Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction]
10+
# @return [Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction]
1111
required :action, union: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action }
1212

1313
# @!attribute conditions
@@ -17,7 +17,7 @@ class ConditionalTokenizationActionParameters < Lithic::Internal::Type::BaseMode
1717
-> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition] }
1818

1919
# @!method initialize(action:, conditions:)
20-
# @param action [Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction] The action to take if the conditions are met.
20+
# @param action [Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction] The action to take if the conditions are met.
2121
#
2222
# @param conditions [Array<Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition>]
2323

@@ -27,33 +27,33 @@ class ConditionalTokenizationActionParameters < Lithic::Internal::Type::BaseMode
2727
module Action
2828
extend Lithic::Internal::Type::Union
2929

30-
variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction }
30+
variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization }
3131

3232
variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction }
3333

34-
class DeclineAction < Lithic::Internal::Type::BaseModel
34+
class DeclineActionTokenization < Lithic::Internal::Type::BaseModel
3535
# @!attribute type
3636
# Decline the tokenization request
3737
#
38-
# @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction::Type]
38+
# @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type]
3939
required :type,
40-
enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction::Type }
40+
enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type }
4141

4242
# @!attribute reason
4343
# Reason code for declining the tokenization request
4444
#
45-
# @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction::Reason, nil]
45+
# @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason, nil]
4646
optional :reason,
47-
enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction::Reason }
47+
enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason }
4848

4949
# @!method initialize(type:, reason: nil)
50-
# @param type [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction::Type] Decline the tokenization request
50+
# @param type [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type] Decline the tokenization request
5151
#
52-
# @param reason [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction::Reason] Reason code for declining the tokenization request
52+
# @param reason [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason] Reason code for declining the tokenization request
5353

5454
# Decline the tokenization request
5555
#
56-
# @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction#type
56+
# @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization#type
5757
module Type
5858
extend Lithic::Internal::Type::Enum
5959

@@ -65,7 +65,7 @@ module Type
6565

6666
# Reason code for declining the tokenization request
6767
#
68-
# @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction#reason
68+
# @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization#reason
6969
module Reason
7070
extend Lithic::Internal::Type::Enum
7171

@@ -148,7 +148,7 @@ module Reason
148148
end
149149

150150
# @!method self.variants
151-
# @return [Array(Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineAction, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction)]
151+
# @return [Array(Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction)]
152152
end
153153

154154
class Condition < Lithic::Internal::Type::BaseModel

0 commit comments

Comments
 (0)