Skip to content

Commit 54fcb64

Browse files
feat(client): adds support for on-demand Auth Rule Performance Reports
1 parent 9148d59 commit 54fcb64

91 files changed

Lines changed: 3513 additions & 1351 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 162
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-67859c948e3b903a317f4bd14135c7ee44254d2760068117bab34b7c4058be71.yml
3-
openapi_spec_hash: 23a4716c6168e96f040ac8575582d075
4-
config_hash: 227ad54062905d4ae964b24cef0505b0
1+
configured_endpoints: 165
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a0d3bcd9c54616729a7e43847e3134205e0695d78f357cc7a25c2775b588dbbd.yml
3+
openapi_spec_hash: 36c423c286ca426f7510b27fadbdd66f
4+
config_hash: 56632a1c934324aa46c1e5c610c2de85

lib/lithic.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
require_relative "lithic/models/auth_rules/auth_rule_condition"
8686
require_relative "lithic/models/auth_rules/conditional_attribute"
8787
require_relative "lithic/models/auth_rules/conditional_block_parameters"
88+
require_relative "lithic/models/auth_rules/rule_stats"
8889
require_relative "lithic/models/auth_rules/v2/backtest_create_params"
8990
require_relative "lithic/models/auth_rules/v2/backtest_create_response"
9091
require_relative "lithic/models/auth_rules/v2/backtest_results"
@@ -103,6 +104,8 @@
103104
require_relative "lithic/models/auth_rules/v2_report_params"
104105
require_relative "lithic/models/auth_rules/v2_report_response"
105106
require_relative "lithic/models/auth_rules/v2_retrieve_params"
107+
require_relative "lithic/models/auth_rules/v2_retrieve_report_params"
108+
require_relative "lithic/models/auth_rules/v2_retrieve_report_response"
106109
require_relative "lithic/models/auth_rules/v2_retrieve_response"
107110
require_relative "lithic/models/auth_rules/v2_update_params"
108111
require_relative "lithic/models/auth_rules/v2_update_response"
@@ -232,6 +235,10 @@
232235
require_relative "lithic/models/financial_account_update_params"
233236
require_relative "lithic/models/financial_account_update_status_params"
234237
require_relative "lithic/models/financial_transaction"
238+
require_relative "lithic/models/fraud/transaction_report_params"
239+
require_relative "lithic/models/fraud/transaction_report_response"
240+
require_relative "lithic/models/fraud/transaction_retrieve_params"
241+
require_relative "lithic/models/fraud/transaction_retrieve_response"
235242
require_relative "lithic/models/funding_event_list_params"
236243
require_relative "lithic/models/funding_event_list_response"
237244
require_relative "lithic/models/funding_event_retrieve_details_params"
@@ -366,6 +373,8 @@
366373
require_relative "lithic/resources/financial_accounts/loan_tapes"
367374
require_relative "lithic/resources/financial_accounts/statements"
368375
require_relative "lithic/resources/financial_accounts/statements/line_items"
376+
require_relative "lithic/resources/fraud"
377+
require_relative "lithic/resources/fraud/transactions"
369378
require_relative "lithic/resources/funding_events"
370379
require_relative "lithic/resources/management_operations"
371380
require_relative "lithic/resources/payments"

lib/lithic/client.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ class Client < Lithic::Internal::Transport::BaseClient
101101
# @return [Lithic::Resources::FundingEvents]
102102
attr_reader :funding_events
103103

104+
# @return [Lithic::Resources::Fraud]
105+
attr_reader :fraud
106+
104107
# Status of api
105108
#
106109
# @overload api_status(request_options: {})
@@ -201,6 +204,7 @@ def initialize(
201204
@external_payments = Lithic::Resources::ExternalPayments.new(client: self)
202205
@management_operations = Lithic::Resources::ManagementOperations.new(client: self)
203206
@funding_events = Lithic::Resources::FundingEvents.new(client: self)
207+
@fraud = Lithic::Resources::Fraud.new(client: self)
204208
end
205209
end
206210
end

lib/lithic/models.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ module Lithic
242242

243243
FinancialTransaction = Lithic::Models::FinancialTransaction
244244

245+
Fraud = Lithic::Models::Fraud
246+
245247
FundingEventListParams = Lithic::Models::FundingEventListParams
246248

247249
FundingEventRetrieveDetailsParams = Lithic::Models::FundingEventRetrieveDetailsParams
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# frozen_string_literal: true
2+
3+
module Lithic
4+
module Models
5+
module AuthRules
6+
class RuleStats < Lithic::Internal::Type::BaseModel
7+
# @!attribute approved
8+
# 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
10+
# the rule was evaluated in shadow mode.
11+
#
12+
# @return [Integer, nil]
13+
optional :approved, Integer
14+
15+
# @!attribute challenged
16+
# 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
18+
# if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
19+
# Rules.
20+
#
21+
# @return [Integer, nil]
22+
optional :challenged, Integer
23+
24+
# @!attribute declined
25+
# 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
27+
# the rule was evaluated in shadow mode.
28+
#
29+
# @return [Integer, nil]
30+
optional :declined, Integer
31+
32+
# @!attribute examples
33+
# Example events and their outcomes.
34+
#
35+
# @return [Array<Lithic::Models::AuthRules::RuleStats::Example>, nil]
36+
optional :examples, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::RuleStats::Example] }
37+
38+
response_only do
39+
# @!attribute version
40+
# The version of the rule, this is incremented whenever the rule's parameters
41+
# change.
42+
#
43+
# @return [Integer, nil]
44+
optional :version, Integer
45+
end
46+
47+
# @!method initialize(approved: nil, challenged: nil, declined: nil, examples: nil, version: nil)
48+
# Some parameter documentations has been truncated, see
49+
# {Lithic::Models::AuthRules::RuleStats} for more details.
50+
#
51+
# @param approved [Integer] The total number of historical transactions approved by this rule during the rel
52+
#
53+
# @param challenged [Integer] The total number of historical transactions challenged by this rule during the r
54+
#
55+
# @param declined [Integer] The total number of historical transactions declined by this rule during the rel
56+
#
57+
# @param examples [Array<Lithic::Models::AuthRules::RuleStats::Example>] Example events and their outcomes.
58+
#
59+
# @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan
60+
61+
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+
68+
# @!attribute decision
69+
# The decision made by the rule for this event.
70+
#
71+
# @return [Symbol, Lithic::Models::AuthRules::RuleStats::Example::Decision, nil]
72+
optional :decision, enum: -> { Lithic::AuthRules::RuleStats::Example::Decision }
73+
74+
# @!attribute event_token
75+
# The event token.
76+
#
77+
# @return [String, nil]
78+
optional :event_token, String
79+
80+
# @!attribute timestamp
81+
# The timestamp of the event.
82+
#
83+
# @return [Time, nil]
84+
optional :timestamp, Time
85+
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.
90+
#
91+
# @param event_token [String] The event token.
92+
#
93+
# @param timestamp [Time] The timestamp of the event.
94+
95+
# The decision made by the rule for this event.
96+
#
97+
# @see Lithic::Models::AuthRules::RuleStats::Example#decision
98+
module Decision
99+
extend Lithic::Internal::Type::Enum
100+
101+
APPROVED = :APPROVED
102+
DECLINED = :DECLINED
103+
CHALLENGED = :CHALLENGED
104+
105+
# @!method self.values
106+
# @return [Array<Symbol>]
107+
end
108+
end
109+
end
110+
end
111+
end
112+
end

0 commit comments

Comments
 (0)