Skip to content

Commit 2812623

Browse files
fix(api): Sync templated rule features with authorizer external feature set
1 parent a087b3b commit 2812623

6 files changed

Lines changed: 1248 additions & 11 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 214
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-48e8284d7f1f51f36402cf5f22a23b27071af86110e2aeddb8da06f8c790fd3d.yml
3-
openapi_spec_hash: a64ba9e94686bce4f0a8c5b1b3c704da
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-47e9f78d22682623e313f1689f5fa7e3420575ff285a14a2f4704c49ffb6b72e.yml
3+
openapi_spec_hash: 4797fe46d942cb32e648a79015783d01
44
config_hash: 5bb913c05ebeb301ec925b16e75bb251

lib/lithic/models/auth_rules/rule_feature.rb

Lines changed: 291 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ module AuthRules
1919
# CARD_TRANSACTION_UPDATE event stream rules.
2020
# - `ACH_PAYMENT`: The ACH payment being evaluated. Only available for
2121
# ACH_PAYMENT_UPDATE event stream rules.
22+
# - `EXTERNAL_BANK_ACCOUNT`: The external bank account tied to the ACH payment
23+
# being evaluated. Only available for ACH_PAYMENT_UPDATE event stream rules.
2224
# - `CARD`: The card associated with the event. Available for AUTHORIZATION,
2325
# THREE_DS_AUTHENTICATION, and CARD_TRANSACTION_UPDATE event stream rules.
2426
# - `ACCOUNT_HOLDER`: The account holder associated with the event. Available for
@@ -28,7 +30,17 @@ module AuthRules
2830
# THREE_DS_AUTHENTICATION event stream rules.
2931
# - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires
3032
# `scope`, `period`, and optionally `filters` to configure the velocity
31-
# calculation. Available for AUTHORIZATION event stream rules.
33+
# calculation. Available for AUTHORIZATION and CARD_TRANSACTION_UPDATE event
34+
# stream rules.
35+
# - `PAYMENT_VELOCITY`: ACH payment velocity data, aggregated over the given
36+
# scope. Requires `scope`, `period`, and optionally `filters` to configure the
37+
# velocity calculation. Available for ACH_PAYMENT_UPDATE event stream rules.
38+
# - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions since
39+
# the last approval for the card or account. Requires `scope`. Available for
40+
# AUTHORIZATION and CARD_TRANSACTION_UPDATE event stream rules.
41+
# - `ACH_PAYMENT_HISTORY`: Windowed settled-amount statistics derived from the
42+
# financial account's ACH payment history. Requires `scope`. Available for
43+
# ACH_PAYMENT_UPDATE event stream rules.
3244
# - `TRANSACTION_HISTORY_SIGNALS`: Behavioral feature state derived from the
3345
# entity's transaction history. Requires `scope` to specify whether to load
3446
# card, account, or business account history. Available for AUTHORIZATION and
@@ -48,6 +60,8 @@ module RuleFeature
4860

4961
variant -> { Lithic::AuthRules::RuleFeature::ACHPaymentFeature }
5062

63+
variant -> { Lithic::AuthRules::RuleFeature::ExternalBankAccountFeature }
64+
5165
variant -> { Lithic::AuthRules::RuleFeature::CardFeature }
5266

5367
variant -> { Lithic::AuthRules::RuleFeature::AccountHolderFeature }
@@ -56,8 +70,14 @@ module RuleFeature
5670

5771
variant -> { Lithic::AuthRules::RuleFeature::SpendVelocityFeature }
5872

73+
variant -> { Lithic::AuthRules::RuleFeature::PaymentVelocityFeature }
74+
5975
variant -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature }
6076

77+
variant -> { Lithic::AuthRules::RuleFeature::ConsecutiveDeclinesFeature }
78+
79+
variant -> { Lithic::AuthRules::RuleFeature::ACHPaymentHistoryFeature }
80+
6181
class AuthorizationFeature < Lithic::Internal::Type::BaseModel
6282
# @!attribute type
6383
#
@@ -166,6 +186,24 @@ class ACHPaymentFeature < Lithic::Internal::Type::BaseModel
166186
# @param type [Symbol, :ACH_PAYMENT]
167187
end
168188

189+
class ExternalBankAccountFeature < Lithic::Internal::Type::BaseModel
190+
# @!attribute type
191+
#
192+
# @return [Symbol, :EXTERNAL_BANK_ACCOUNT]
193+
required :type, const: :EXTERNAL_BANK_ACCOUNT
194+
195+
# @!attribute name
196+
# The variable name for this feature in the rule function signature
197+
#
198+
# @return [String, nil]
199+
optional :name, String
200+
201+
# @!method initialize(name: nil, type: :EXTERNAL_BANK_ACCOUNT)
202+
# @param name [String] The variable name for this feature in the rule function signature
203+
#
204+
# @param type [Symbol, :EXTERNAL_BANK_ACCOUNT]
205+
end
206+
169207
class CardFeature < Lithic::Internal::Type::BaseModel
170208
# @!attribute type
171209
#
@@ -274,6 +312,180 @@ module Scope
274312
end
275313
end
276314

315+
class PaymentVelocityFeature < Lithic::Internal::Type::BaseModel
316+
# @!attribute period
317+
# Velocity over the current day since 00:00 / 12 AM in Eastern Time
318+
#
319+
# @return [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear]
320+
required :period, union: -> { Lithic::AuthRules::VelocityLimitPeriod }
321+
322+
# @!attribute scope
323+
# The scope over which the ACH payment velocity is aggregated.
324+
#
325+
# @return [Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Scope]
326+
required :scope, enum: -> { Lithic::AuthRules::RuleFeature::PaymentVelocityFeature::Scope }
327+
328+
# @!attribute type
329+
#
330+
# @return [Symbol, :PAYMENT_VELOCITY]
331+
required :type, const: :PAYMENT_VELOCITY
332+
333+
# @!attribute filters
334+
# Optional filters applied when aggregating ACH payment velocity. Payments not
335+
# matching the provided filters are excluded from the calculated velocity.
336+
#
337+
# @return [Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters, nil]
338+
optional :filters, -> { Lithic::AuthRules::RuleFeature::PaymentVelocityFeature::Filters }
339+
340+
# @!attribute name
341+
# The variable name for this feature in the rule function signature
342+
#
343+
# @return [String, nil]
344+
optional :name, String
345+
346+
# @!method initialize(period:, scope:, filters: nil, name: nil, type: :PAYMENT_VELOCITY)
347+
# Some parameter documentations has been truncated, see
348+
# {Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature} for more
349+
# details.
350+
#
351+
# @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] Velocity over the current day since 00:00 / 12 AM in Eastern Time
352+
#
353+
# @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Scope] The scope over which the ACH payment velocity is aggregated.
354+
#
355+
# @param filters [Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters] Optional filters applied when aggregating ACH payment velocity. Payments not mat
356+
#
357+
# @param name [String] The variable name for this feature in the rule function signature
358+
#
359+
# @param type [Symbol, :PAYMENT_VELOCITY]
360+
361+
# The scope over which the ACH payment velocity is aggregated.
362+
#
363+
# @see Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature#scope
364+
module Scope
365+
extend Lithic::Internal::Type::Enum
366+
367+
FINANCIAL_ACCOUNT = :FINANCIAL_ACCOUNT
368+
GLOBAL = :GLOBAL
369+
370+
# @!method self.values
371+
# @return [Array<Symbol>]
372+
end
373+
374+
# @see Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature#filters
375+
class Filters < Lithic::Internal::Type::BaseModel
376+
# @!attribute exclude_tags
377+
# Exclude payments matching any of the provided tag key-value pairs.
378+
#
379+
# @return [Hash{Symbol=>String}, nil]
380+
optional :exclude_tags, Lithic::Internal::Type::HashOf[String], nil?: true
381+
382+
# @!attribute include_payment_types
383+
# Payment types to include in the velocity calculation.
384+
#
385+
# @return [Array<Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludePaymentType>, nil]
386+
optional :include_payment_types,
387+
-> {
388+
Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludePaymentType]
389+
},
390+
nil?: true
391+
392+
# @!attribute include_polarities
393+
# Payment polarities to include in the velocity calculation.
394+
#
395+
# @return [Array<Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludePolarity>, nil]
396+
optional :include_polarities,
397+
-> {
398+
Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludePolarity]
399+
},
400+
nil?: true
401+
402+
# @!attribute include_statuses
403+
# Payment statuses to include in the velocity calculation.
404+
#
405+
# @return [Array<Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludeStatus>, nil]
406+
optional :include_statuses,
407+
-> {
408+
Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludeStatus]
409+
},
410+
nil?: true
411+
412+
# @!attribute include_tags
413+
# Only include payments matching all of the provided tag key-value pairs.
414+
#
415+
# @return [Hash{Symbol=>String}, nil]
416+
optional :include_tags, Lithic::Internal::Type::HashOf[String], nil?: true
417+
418+
# @!attribute result
419+
# Only include payments with the given result.
420+
#
421+
# @return [Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::Result, nil]
422+
optional :result, enum: -> { Lithic::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::Result }
423+
424+
# @!method initialize(exclude_tags: nil, include_payment_types: nil, include_polarities: nil, include_statuses: nil, include_tags: nil, result: nil)
425+
# Optional filters applied when aggregating ACH payment velocity. Payments not
426+
# matching the provided filters are excluded from the calculated velocity.
427+
#
428+
# @param exclude_tags [Hash{Symbol=>String}, nil] Exclude payments matching any of the provided tag key-value pairs.
429+
#
430+
# @param include_payment_types [Array<Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludePaymentType>, nil] Payment types to include in the velocity calculation.
431+
#
432+
# @param include_polarities [Array<Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludePolarity>, nil] Payment polarities to include in the velocity calculation.
433+
#
434+
# @param include_statuses [Array<Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::IncludeStatus>, nil] Payment statuses to include in the velocity calculation.
435+
#
436+
# @param include_tags [Hash{Symbol=>String}, nil] Only include payments matching all of the provided tag key-value pairs.
437+
#
438+
# @param result [Symbol, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters::Result] Only include payments with the given result.
439+
440+
module IncludePaymentType
441+
extend Lithic::Internal::Type::Enum
442+
443+
ORIGINATION = :ORIGINATION
444+
RECEIPT = :RECEIPT
445+
446+
# @!method self.values
447+
# @return [Array<Symbol>]
448+
end
449+
450+
module IncludePolarity
451+
extend Lithic::Internal::Type::Enum
452+
453+
CREDIT = :CREDIT
454+
DEBIT = :DEBIT
455+
456+
# @!method self.values
457+
# @return [Array<Symbol>]
458+
end
459+
460+
module IncludeStatus
461+
extend Lithic::Internal::Type::Enum
462+
463+
PENDING = :PENDING
464+
SETTLED = :SETTLED
465+
DECLINED = :DECLINED
466+
REVERSED = :REVERSED
467+
CANCELED = :CANCELED
468+
RETURNED = :RETURNED
469+
470+
# @!method self.values
471+
# @return [Array<Symbol>]
472+
end
473+
474+
# Only include payments with the given result.
475+
#
476+
# @see Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature::Filters#result
477+
module Result
478+
extend Lithic::Internal::Type::Enum
479+
480+
APPROVED = :APPROVED
481+
DECLINED = :DECLINED
482+
483+
# @!method self.values
484+
# @return [Array<Symbol>]
485+
end
486+
end
487+
end
488+
277489
class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel
278490
# @!attribute scope
279491
# The entity scope to load transaction history signals for.
@@ -314,8 +526,85 @@ module Scope
314526
end
315527
end
316528

529+
class ConsecutiveDeclinesFeature < Lithic::Internal::Type::BaseModel
530+
# @!attribute scope
531+
# The entity scope to count consecutive declines for.
532+
#
533+
# @return [Symbol, Lithic::Models::AuthRules::RuleFeature::ConsecutiveDeclinesFeature::Scope]
534+
required :scope, enum: -> { Lithic::AuthRules::RuleFeature::ConsecutiveDeclinesFeature::Scope }
535+
536+
# @!attribute type
537+
#
538+
# @return [Symbol, :CONSECUTIVE_DECLINES]
539+
required :type, const: :CONSECUTIVE_DECLINES
540+
541+
# @!attribute name
542+
# The variable name for this feature in the rule function signature
543+
#
544+
# @return [String, nil]
545+
optional :name, String
546+
547+
# @!method initialize(scope:, name: nil, type: :CONSECUTIVE_DECLINES)
548+
# @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::ConsecutiveDeclinesFeature::Scope] The entity scope to count consecutive declines for.
549+
#
550+
# @param name [String] The variable name for this feature in the rule function signature
551+
#
552+
# @param type [Symbol, :CONSECUTIVE_DECLINES]
553+
554+
# The entity scope to count consecutive declines for.
555+
#
556+
# @see Lithic::Models::AuthRules::RuleFeature::ConsecutiveDeclinesFeature#scope
557+
module Scope
558+
extend Lithic::Internal::Type::Enum
559+
560+
CARD = :CARD
561+
ACCOUNT = :ACCOUNT
562+
563+
# @!method self.values
564+
# @return [Array<Symbol>]
565+
end
566+
end
567+
568+
class ACHPaymentHistoryFeature < Lithic::Internal::Type::BaseModel
569+
# @!attribute scope
570+
# The entity scope to load ACH payment history for.
571+
#
572+
# @return [Symbol, Lithic::Models::AuthRules::RuleFeature::ACHPaymentHistoryFeature::Scope]
573+
required :scope, enum: -> { Lithic::AuthRules::RuleFeature::ACHPaymentHistoryFeature::Scope }
574+
575+
# @!attribute type
576+
#
577+
# @return [Symbol, :ACH_PAYMENT_HISTORY]
578+
required :type, const: :ACH_PAYMENT_HISTORY
579+
580+
# @!attribute name
581+
# The variable name for this feature in the rule function signature
582+
#
583+
# @return [String, nil]
584+
optional :name, String
585+
586+
# @!method initialize(scope:, name: nil, type: :ACH_PAYMENT_HISTORY)
587+
# @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::ACHPaymentHistoryFeature::Scope] The entity scope to load ACH payment history for.
588+
#
589+
# @param name [String] The variable name for this feature in the rule function signature
590+
#
591+
# @param type [Symbol, :ACH_PAYMENT_HISTORY]
592+
593+
# The entity scope to load ACH payment history for.
594+
#
595+
# @see Lithic::Models::AuthRules::RuleFeature::ACHPaymentHistoryFeature#scope
596+
module Scope
597+
extend Lithic::Internal::Type::Enum
598+
599+
FINANCIAL_ACCOUNT = :FINANCIAL_ACCOUNT
600+
601+
# @!method self.values
602+
# @return [Array<Symbol>]
603+
end
604+
end
605+
317606
# @!method self.variants
318-
# @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardTransactionFeature, Lithic::Models::AuthRules::RuleFeature::ACHPaymentFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature)]
607+
# @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardTransactionFeature, Lithic::Models::AuthRules::RuleFeature::ACHPaymentFeature, Lithic::Models::AuthRules::RuleFeature::ExternalBankAccountFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature, Lithic::Models::AuthRules::RuleFeature::PaymentVelocityFeature, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature, Lithic::Models::AuthRules::RuleFeature::ConsecutiveDeclinesFeature, Lithic::Models::AuthRules::RuleFeature::ACHPaymentHistoryFeature)]
319608
end
320609
end
321610
end

0 commit comments

Comments
 (0)