Skip to content

Commit 3e09d4a

Browse files
feat(api): make filter optional for Spend Velocity Auth Rules
fix(api): rename WIRE_DRAWDOWN_REQUEST to WIRE_INBOUND_DRAWDOWN_REQUEST
1 parent 143a5ea commit 3e09d4a

File tree

8 files changed

+99
-99
lines changed

8 files changed

+99
-99
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 176
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4ecc06edca2cfad4eaf11573611e89823fda5f56370bac5cd02a498a6b277d09.yml
3-
openapi_spec_hash: 8f4a30bec4348cbde85b1e65bef9189a
4-
config_hash: 751a4cc75aa0276b40cc2c7879b24dea
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c06c4d54858775fef1de57e33d471e997cb28fe0c925fd7b08ba45fdd335e938.yml
3+
openapi_spec_hash: 23745357b2171bcdfb5d30bfef1df48d
4+
config_hash: 9dddee5f7af579864599849cb28a0770

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
The Lithic Ruby library provides convenient access to the Lithic REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/lithic-com/lithic-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
44

5-
## MCP Server
6-
7-
Use the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
8-
9-
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImxpdGhpYy1tY3AiXX0)
10-
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22lithic-mcp%22%5D%7D)
11-
12-
> Note: You may need to set environment variables in your MCP client.
13-
145
## Documentation
156

167
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/lithic).

lib/lithic/models/auth_rules/velocity_limit_params.rb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ module Lithic
44
module Models
55
module AuthRules
66
class VelocityLimitParams < Lithic::Internal::Type::BaseModel
7-
# @!attribute filters
8-
#
9-
# @return [Lithic::Models::AuthRules::VelocityLimitParams::Filters]
10-
required :filters, -> { Lithic::AuthRules::VelocityLimitParams::Filters }
11-
127
# @!attribute period
138
# Velocity over the current day since 00:00 / 12 AM in Eastern Time
149
#
@@ -21,6 +16,11 @@ class VelocityLimitParams < Lithic::Internal::Type::BaseModel
2116
# @return [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope]
2217
required :scope, enum: -> { Lithic::AuthRules::VelocityLimitParams::Scope }
2318

19+
# @!attribute filters
20+
#
21+
# @return [Lithic::Models::AuthRules::VelocityLimitParams::Filters, nil]
22+
optional :filters, -> { Lithic::AuthRules::VelocityLimitParams::Filters }
23+
2424
# @!attribute limit_amount
2525
# The maximum amount of spend velocity allowed in the period in minor units (the
2626
# smallest unit of a currency, e.g. cents for USD). Transactions exceeding this
@@ -39,20 +39,33 @@ class VelocityLimitParams < Lithic::Internal::Type::BaseModel
3939
# @return [Integer, nil]
4040
optional :limit_count, Integer, nil?: true
4141

42-
# @!method initialize(filters:, period:, scope:, limit_amount: nil, limit_count: nil)
42+
# @!method initialize(period:, scope:, filters: nil, limit_amount: nil, limit_count: nil)
4343
# Some parameter documentations has been truncated, see
4444
# {Lithic::Models::AuthRules::VelocityLimitParams} for more details.
4545
#
46-
# @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters]
47-
#
4846
# @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
4947
#
5048
# @param scope [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] The scope the velocity is calculated for
5149
#
50+
# @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters]
51+
#
5252
# @param limit_amount [Integer, nil] The maximum amount of spend velocity allowed in the period in minor units (the s
5353
#
5454
# @param limit_count [Integer, nil] The number of spend velocity impacting transactions may not exceed this limit in
5555

56+
# The scope the velocity is calculated for
57+
#
58+
# @see Lithic::Models::AuthRules::VelocityLimitParams#scope
59+
module Scope
60+
extend Lithic::Internal::Type::Enum
61+
62+
CARD = :CARD
63+
ACCOUNT = :ACCOUNT
64+
65+
# @!method self.values
66+
# @return [Array<Symbol>]
67+
end
68+
5669
# @see Lithic::Models::AuthRules::VelocityLimitParams#filters
5770
class Filters < Lithic::Internal::Type::BaseModel
5871
# @!attribute exclude_countries
@@ -133,19 +146,6 @@ module IncludePanEntryMode
133146
# @return [Array<Symbol>]
134147
end
135148
end
136-
137-
# The scope the velocity is calculated for
138-
#
139-
# @see Lithic::Models::AuthRules::VelocityLimitParams#scope
140-
module Scope
141-
extend Lithic::Internal::Type::Enum
142-
143-
CARD = :CARD
144-
ACCOUNT = :ACCOUNT
145-
146-
# @!method self.values
147-
# @return [Array<Symbol>]
148-
end
149149
end
150150
end
151151
end

lib/lithic/models/payment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ module Type
650650
WIRE_INBOUND_ADMIN = :WIRE_INBOUND_ADMIN
651651
WIRE_OUTBOUND_PAYMENT = :WIRE_OUTBOUND_PAYMENT
652652
WIRE_OUTBOUND_ADMIN = :WIRE_OUTBOUND_ADMIN
653-
WIRE_DRAWDOWN_REQUEST = :WIRE_DRAWDOWN_REQUEST
653+
WIRE_INBOUND_DRAWDOWN_REQUEST = :WIRE_INBOUND_DRAWDOWN_REQUEST
654654

655655
# @!method self.values
656656
# @return [Array<Symbol>]

rbi/lithic/models/auth_rules/velocity_limit_params.rbi

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ module Lithic
1212
)
1313
end
1414

15-
sig { returns(Lithic::AuthRules::VelocityLimitParams::Filters) }
16-
attr_reader :filters
17-
18-
sig do
19-
params(
20-
filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash
21-
).void
22-
end
23-
attr_writer :filters
24-
2515
# Velocity over the current day since 00:00 / 12 AM in Eastern Time
2616
sig do
2717
returns(
@@ -40,6 +30,18 @@ module Lithic
4030
sig { returns(Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol) }
4131
attr_accessor :scope
4232

33+
sig do
34+
returns(T.nilable(Lithic::AuthRules::VelocityLimitParams::Filters))
35+
end
36+
attr_reader :filters
37+
38+
sig do
39+
params(
40+
filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash
41+
).void
42+
end
43+
attr_writer :filters
44+
4345
# The maximum amount of spend velocity allowed in the period in minor units (the
4446
# smallest unit of a currency, e.g. cents for USD). Transactions exceeding this
4547
# limit will be declined.
@@ -56,7 +58,6 @@ module Lithic
5658

5759
sig do
5860
params(
59-
filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash,
6061
period:
6162
T.any(
6263
Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash,
@@ -66,16 +67,17 @@ module Lithic
6667
Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash
6768
),
6869
scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol,
70+
filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash,
6971
limit_amount: T.nilable(Integer),
7072
limit_count: T.nilable(Integer)
7173
).returns(T.attached_class)
7274
end
7375
def self.new(
74-
filters:,
7576
# Velocity over the current day since 00:00 / 12 AM in Eastern Time
7677
period:,
7778
# The scope the velocity is calculated for
7879
scope:,
80+
filters: nil,
7981
# The maximum amount of spend velocity allowed in the period in minor units (the
8082
# smallest unit of a currency, e.g. cents for USD). Transactions exceeding this
8183
# limit will be declined.
@@ -92,7 +94,6 @@ module Lithic
9294
sig do
9395
override.returns(
9496
{
95-
filters: Lithic::AuthRules::VelocityLimitParams::Filters,
9697
period:
9798
T.any(
9899
Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject,
@@ -102,6 +103,7 @@ module Lithic
102103
Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear
103104
),
104105
scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol,
106+
filters: Lithic::AuthRules::VelocityLimitParams::Filters,
105107
limit_amount: T.nilable(Integer),
106108
limit_count: T.nilable(Integer)
107109
}
@@ -110,6 +112,38 @@ module Lithic
110112
def to_hash
111113
end
112114

115+
# The scope the velocity is calculated for
116+
module Scope
117+
extend Lithic::Internal::Type::Enum
118+
119+
TaggedSymbol =
120+
T.type_alias do
121+
T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope)
122+
end
123+
OrSymbol = T.type_alias { T.any(Symbol, String) }
124+
125+
CARD =
126+
T.let(
127+
:CARD,
128+
Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
129+
)
130+
ACCOUNT =
131+
T.let(
132+
:ACCOUNT,
133+
Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
134+
)
135+
136+
sig do
137+
override.returns(
138+
T::Array[
139+
Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
140+
]
141+
)
142+
end
143+
def self.values
144+
end
145+
end
146+
113147
class Filters < Lithic::Internal::Type::BaseModel
114148
OrHash =
115149
T.type_alias do
@@ -307,38 +341,6 @@ module Lithic
307341
end
308342
end
309343
end
310-
311-
# The scope the velocity is calculated for
312-
module Scope
313-
extend Lithic::Internal::Type::Enum
314-
315-
TaggedSymbol =
316-
T.type_alias do
317-
T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope)
318-
end
319-
OrSymbol = T.type_alias { T.any(Symbol, String) }
320-
321-
CARD =
322-
T.let(
323-
:CARD,
324-
Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
325-
)
326-
ACCOUNT =
327-
T.let(
328-
:ACCOUNT,
329-
Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
330-
)
331-
332-
sig do
333-
override.returns(
334-
T::Array[
335-
Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
336-
]
337-
)
338-
end
339-
def self.values
340-
end
341-
end
342344
end
343345
end
344346
end

rbi/lithic/models/payment.rbi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,8 +1061,11 @@ module Lithic
10611061
T.let(:WIRE_OUTBOUND_PAYMENT, Lithic::Payment::Type::TaggedSymbol)
10621062
WIRE_OUTBOUND_ADMIN =
10631063
T.let(:WIRE_OUTBOUND_ADMIN, Lithic::Payment::Type::TaggedSymbol)
1064-
WIRE_DRAWDOWN_REQUEST =
1065-
T.let(:WIRE_DRAWDOWN_REQUEST, Lithic::Payment::Type::TaggedSymbol)
1064+
WIRE_INBOUND_DRAWDOWN_REQUEST =
1065+
T.let(
1066+
:WIRE_INBOUND_DRAWDOWN_REQUEST,
1067+
Lithic::Payment::Type::TaggedSymbol
1068+
)
10661069

10671070
sig { override.returns(T::Array[Lithic::Payment::Type::TaggedSymbol]) }
10681071
def self.values

sig/lithic/models/auth_rules/velocity_limit_params.rbs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,55 @@ module Lithic
33
module AuthRules
44
type velocity_limit_params =
55
{
6-
filters: Lithic::AuthRules::VelocityLimitParams::Filters,
76
period: Lithic::Models::AuthRules::velocity_limit_period,
87
scope: Lithic::Models::AuthRules::VelocityLimitParams::scope,
8+
filters: Lithic::AuthRules::VelocityLimitParams::Filters,
99
limit_amount: Integer?,
1010
limit_count: Integer?
1111
}
1212

1313
class VelocityLimitParams < Lithic::Internal::Type::BaseModel
14-
attr_accessor filters: Lithic::AuthRules::VelocityLimitParams::Filters
15-
1614
attr_accessor period: Lithic::Models::AuthRules::velocity_limit_period
1715

1816
attr_accessor scope: Lithic::Models::AuthRules::VelocityLimitParams::scope
1917

18+
attr_reader filters: Lithic::AuthRules::VelocityLimitParams::Filters?
19+
20+
def filters=: (
21+
Lithic::AuthRules::VelocityLimitParams::Filters
22+
) -> Lithic::AuthRules::VelocityLimitParams::Filters
23+
2024
attr_accessor limit_amount: Integer?
2125

2226
attr_accessor limit_count: Integer?
2327

2428
def initialize: (
25-
filters: Lithic::AuthRules::VelocityLimitParams::Filters,
2629
period: Lithic::Models::AuthRules::velocity_limit_period,
2730
scope: Lithic::Models::AuthRules::VelocityLimitParams::scope,
31+
?filters: Lithic::AuthRules::VelocityLimitParams::Filters,
2832
?limit_amount: Integer?,
2933
?limit_count: Integer?
3034
) -> void
3135

3236
def to_hash: -> {
33-
filters: Lithic::AuthRules::VelocityLimitParams::Filters,
3437
period: Lithic::Models::AuthRules::velocity_limit_period,
3538
scope: Lithic::Models::AuthRules::VelocityLimitParams::scope,
39+
filters: Lithic::AuthRules::VelocityLimitParams::Filters,
3640
limit_amount: Integer?,
3741
limit_count: Integer?
3842
}
3943

44+
type scope = :CARD | :ACCOUNT
45+
46+
module Scope
47+
extend Lithic::Internal::Type::Enum
48+
49+
CARD: :CARD
50+
ACCOUNT: :ACCOUNT
51+
52+
def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope]
53+
end
54+
4055
type filters =
4156
{
4257
exclude_countries: ::Array[String]?,
@@ -112,17 +127,6 @@ module Lithic
112127
def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::Filters::include_pan_entry_mode]
113128
end
114129
end
115-
116-
type scope = :CARD | :ACCOUNT
117-
118-
module Scope
119-
extend Lithic::Internal::Type::Enum
120-
121-
CARD: :CARD
122-
ACCOUNT: :ACCOUNT
123-
124-
def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope]
125-
end
126130
end
127131
end
128132
end

sig/lithic/models/payment.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ module Lithic
524524
| :WIRE_INBOUND_ADMIN
525525
| :WIRE_OUTBOUND_PAYMENT
526526
| :WIRE_OUTBOUND_ADMIN
527-
| :WIRE_DRAWDOWN_REQUEST
527+
| :WIRE_INBOUND_DRAWDOWN_REQUEST
528528

529529
module Type
530530
extend Lithic::Internal::Type::Enum
@@ -537,7 +537,7 @@ module Lithic
537537
WIRE_INBOUND_ADMIN: :WIRE_INBOUND_ADMIN
538538
WIRE_OUTBOUND_PAYMENT: :WIRE_OUTBOUND_PAYMENT
539539
WIRE_OUTBOUND_ADMIN: :WIRE_OUTBOUND_ADMIN
540-
WIRE_DRAWDOWN_REQUEST: :WIRE_DRAWDOWN_REQUEST
540+
WIRE_INBOUND_DRAWDOWN_REQUEST: :WIRE_INBOUND_DRAWDOWN_REQUEST
541541

542542
def self?.values: -> ::Array[Lithic::Models::Payment::type_]
543543
end

0 commit comments

Comments
 (0)