Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.34"
".": "0.1.0-alpha.35"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 165
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a0d3bcd9c54616729a7e43847e3134205e0695d78f357cc7a25c2775b588dbbd.yml
openapi_spec_hash: 36c423c286ca426f7510b27fadbdd66f
config_hash: 56632a1c934324aa46c1e5c610c2de85
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-cf48017e61eb3ac8aeaaa9d933186532f476b2f3c7e12fa9c962d52e5a9a272b.yml
openapi_spec_hash: b58989fdc04768fc1eb758e180c5f128
config_hash: e4d87bd83b304f6ab3f032db994e0093
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.35 (2025-06-27)

Full Changelog: [v0.1.0-alpha.34...v0.1.0-alpha.35](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.34...v0.1.0-alpha.35)

### Features

* **api:** introduce dedicated model for SpendLimitDuration ([47e4f42](https://github.com/lithic-com/lithic-ruby/commit/47e4f42231c996fe56ff2f681baaae2ac1c6c588))

## 0.1.0-alpha.34 (2025-06-26)

Full Changelog: [v0.1.0-alpha.33...v0.1.0-alpha.34](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.33...v0.1.0-alpha.34)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
lithic (0.1.0.pre.alpha.34)
lithic (0.1.0.pre.alpha.35)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "lithic", "~> 0.1.0.pre.alpha.34"
gem "lithic", "~> 0.1.0.pre.alpha.35"
```

<!-- x-release-please-end -->
Expand Down
37 changes: 16 additions & 21 deletions lib/lithic/models/non_pci_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,21 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
required :spend_limit, Integer

# @!attribute spend_limit_duration
# Spend limit duration
#
# @return [Symbol, Lithic::Models::NonPCICard::SpendLimitDuration]
required :spend_limit_duration, enum: -> { Lithic::NonPCICard::SpendLimitDuration }
# Spend limit duration values:
#
# - `ANNUALLY` - Card will authorize transactions up to spend limit for the
# trailing year.
# - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
# of the card.
# - `MONTHLY` - Card will authorize transactions up to spend limit for the
# trailing month. To support recurring monthly payments, which can occur on
# different day every month, the time window we consider for monthly velocity
# starts 6 days after the current calendar date one month prior.
# - `TRANSACTION` - Card will authorize multiple transactions if each individual
# transaction is under the spend limit.
#
# @return [Symbol, Lithic::Models::SpendLimitDuration]
required :spend_limit_duration, enum: -> { Lithic::SpendLimitDuration }

# @!attribute state
# Card state values: _ `CLOSED` - Card will no longer approve authorizations.
Expand Down Expand Up @@ -189,7 +200,7 @@ class NonPCICard < Lithic::Internal::Type::BaseModel
#
# @param spend_limit [Integer] Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,00
#
# @param spend_limit_duration [Symbol, Lithic::Models::NonPCICard::SpendLimitDuration] Spend limit duration
# @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Spend limit duration values:
#
# @param state [Symbol, Lithic::Models::NonPCICard::State] Card state values: \* `CLOSED` - Card will no longer approve authorizations.
# Clos
Expand Down Expand Up @@ -335,22 +346,6 @@ module PinStatus
# @return [Array<Symbol>]
end

# Spend limit duration
#
# @see Lithic::Models::NonPCICard#spend_limit_duration
module SpendLimitDuration
extend Lithic::Internal::Type::Enum

ANNUALLY = :ANNUALLY
FOREVER = :FOREVER
MONTHLY = :MONTHLY
TRANSACTION = :TRANSACTION
DAILY = :DAILY

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

# Card state values: _ `CLOSED` - Card will no longer approve authorizations.
# Closing a card cannot be undone. _ `OPEN` - Card will approve authorizations (if
# they match card and account parameters). _ `PAUSED` - Card will decline
Expand Down
2 changes: 1 addition & 1 deletion lib/lithic/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Lithic
VERSION = "0.1.0.pre.alpha.34"
VERSION = "0.1.0.pre.alpha.35"
end
65 changes: 27 additions & 38 deletions rbi/lithic/models/non_pci_card.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,19 @@ module Lithic
sig { returns(Integer) }
attr_accessor :spend_limit

# Spend limit duration
sig { returns(Lithic::NonPCICard::SpendLimitDuration::TaggedSymbol) }
# Spend limit duration values:
#
# - `ANNUALLY` - Card will authorize transactions up to spend limit for the
# trailing year.
# - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
# of the card.
# - `MONTHLY` - Card will authorize transactions up to spend limit for the
# trailing month. To support recurring monthly payments, which can occur on
# different day every month, the time window we consider for monthly velocity
# starts 6 days after the current calendar date one month prior.
# - `TRANSACTION` - Card will authorize multiple transactions if each individual
# transaction is under the spend limit.
sig { returns(Lithic::SpendLimitDuration::TaggedSymbol) }
attr_accessor :spend_limit_duration

# Card state values: _ `CLOSED` - Card will no longer approve authorizations.
Expand Down Expand Up @@ -166,8 +177,7 @@ module Lithic
last_four: String,
pin_status: Lithic::NonPCICard::PinStatus::OrSymbol,
spend_limit: Integer,
spend_limit_duration:
Lithic::NonPCICard::SpendLimitDuration::OrSymbol,
spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol,
state: Lithic::NonPCICard::State::OrSymbol,
type: Lithic::NonPCICard::Type::OrSymbol,
auth_rule_tokens: T::Array[String],
Expand Down Expand Up @@ -201,7 +211,18 @@ module Lithic
# Amount (in cents) to limit approved authorizations (e.g. 100000 would be a
# $1,000 limit). Transaction requests above the spend limit will be declined.
spend_limit:,
# Spend limit duration
# Spend limit duration values:
#
# - `ANNUALLY` - Card will authorize transactions up to spend limit for the
# trailing year.
# - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
# of the card.
# - `MONTHLY` - Card will authorize transactions up to spend limit for the
# trailing month. To support recurring monthly payments, which can occur on
# different day every month, the time window we consider for monthly velocity
# starts 6 days after the current calendar date one month prior.
# - `TRANSACTION` - Card will authorize multiple transactions if each individual
# transaction is under the spend limit.
spend_limit_duration:,
# Card state values: _ `CLOSED` - Card will no longer approve authorizations.
# Closing a card cannot be undone. _ `OPEN` - Card will approve authorizations (if
Expand Down Expand Up @@ -274,8 +295,7 @@ module Lithic
last_four: String,
pin_status: Lithic::NonPCICard::PinStatus::TaggedSymbol,
spend_limit: Integer,
spend_limit_duration:
Lithic::NonPCICard::SpendLimitDuration::TaggedSymbol,
spend_limit_duration: Lithic::SpendLimitDuration::TaggedSymbol,
state: Lithic::NonPCICard::State::TaggedSymbol,
type: Lithic::NonPCICard::Type::TaggedSymbol,
auth_rule_tokens: T::Array[String],
Expand Down Expand Up @@ -471,37 +491,6 @@ module Lithic
end
end

# Spend limit duration
module SpendLimitDuration
extend Lithic::Internal::Type::Enum

TaggedSymbol =
T.type_alias { T.all(Symbol, Lithic::NonPCICard::SpendLimitDuration) }
OrSymbol = T.type_alias { T.any(Symbol, String) }

ANNUALLY =
T.let(:ANNUALLY, Lithic::NonPCICard::SpendLimitDuration::TaggedSymbol)
FOREVER =
T.let(:FOREVER, Lithic::NonPCICard::SpendLimitDuration::TaggedSymbol)
MONTHLY =
T.let(:MONTHLY, Lithic::NonPCICard::SpendLimitDuration::TaggedSymbol)
TRANSACTION =
T.let(
:TRANSACTION,
Lithic::NonPCICard::SpendLimitDuration::TaggedSymbol
)
DAILY =
T.let(:DAILY, Lithic::NonPCICard::SpendLimitDuration::TaggedSymbol)

sig do
override.returns(
T::Array[Lithic::NonPCICard::SpendLimitDuration::TaggedSymbol]
)
end
def self.values
end
end

# Card state values: _ `CLOSED` - Card will no longer approve authorizations.
# Closing a card cannot be undone. _ `OPEN` - Card will approve authorizations (if
# they match card and account parameters). _ `PAUSED` - Card will decline
Expand Down
23 changes: 4 additions & 19 deletions sig/lithic/models/non_pci_card.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Lithic
last_four: String,
pin_status: Lithic::Models::NonPCICard::pin_status,
spend_limit: Integer,
spend_limit_duration: Lithic::Models::NonPCICard::spend_limit_duration,
spend_limit_duration: Lithic::Models::spend_limit_duration,
state: Lithic::Models::NonPCICard::state,
type: Lithic::Models::NonPCICard::type_,
auth_rule_tokens: ::Array[String],
Expand Down Expand Up @@ -42,7 +42,7 @@ module Lithic

attr_accessor spend_limit: Integer

attr_accessor spend_limit_duration: Lithic::Models::NonPCICard::spend_limit_duration
attr_accessor spend_limit_duration: Lithic::Models::spend_limit_duration

attr_accessor state: Lithic::Models::NonPCICard::state

Expand Down Expand Up @@ -95,7 +95,7 @@ module Lithic
last_four: String,
pin_status: Lithic::Models::NonPCICard::pin_status,
spend_limit: Integer,
spend_limit_duration: Lithic::Models::NonPCICard::spend_limit_duration,
spend_limit_duration: Lithic::Models::spend_limit_duration,
state: Lithic::Models::NonPCICard::state,
type: Lithic::Models::NonPCICard::type_,
?auth_rule_tokens: ::Array[String],
Expand All @@ -119,7 +119,7 @@ module Lithic
last_four: String,
pin_status: Lithic::Models::NonPCICard::pin_status,
spend_limit: Integer,
spend_limit_duration: Lithic::Models::NonPCICard::spend_limit_duration,
spend_limit_duration: Lithic::Models::spend_limit_duration,
state: Lithic::Models::NonPCICard::state,
type: Lithic::Models::NonPCICard::type_,
auth_rule_tokens: ::Array[String],
Expand Down Expand Up @@ -220,21 +220,6 @@ module Lithic
def self?.values: -> ::Array[Lithic::Models::NonPCICard::pin_status]
end

type spend_limit_duration =
:ANNUALLY | :FOREVER | :MONTHLY | :TRANSACTION | :DAILY

module SpendLimitDuration
extend Lithic::Internal::Type::Enum

ANNUALLY: :ANNUALLY
FOREVER: :FOREVER
MONTHLY: :MONTHLY
TRANSACTION: :TRANSACTION
DAILY: :DAILY

def self?.values: -> ::Array[Lithic::Models::NonPCICard::spend_limit_duration]
end

type state =
:CLOSED | :OPEN | :PAUSED | :PENDING_ACTIVATION | :PENDING_FULFILLMENT

Expand Down
2 changes: 1 addition & 1 deletion test/lithic/resources/cards_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_list
last_four: String,
pin_status: Lithic::NonPCICard::PinStatus,
spend_limit: Integer,
spend_limit_duration: Lithic::NonPCICard::SpendLimitDuration,
spend_limit_duration: Lithic::SpendLimitDuration,
state: Lithic::NonPCICard::State,
type: Lithic::NonPCICard::Type,
auth_rule_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil,
Expand Down
Loading