From 47e4f42231c996fe56ff2f681baaae2ac1c6c588 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 14:24:45 +0000 Subject: [PATCH 1/2] feat(api): introduce dedicated model for SpendLimitDuration --- .stats.yml | 6 +-- lib/lithic/models/non_pci_card.rb | 37 +++++++--------- rbi/lithic/models/non_pci_card.rbi | 65 ++++++++++++----------------- sig/lithic/models/non_pci_card.rbs | 23 ++-------- test/lithic/resources/cards_test.rb | 2 +- 5 files changed, 51 insertions(+), 82 deletions(-) diff --git a/.stats.yml b/.stats.yml index 234e8136..9d2eb250 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/lib/lithic/models/non_pci_card.rb b/lib/lithic/models/non_pci_card.rb index 26d3dbea..29472ae2 100644 --- a/lib/lithic/models/non_pci_card.rb +++ b/lib/lithic/models/non_pci_card.rb @@ -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. @@ -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 @@ -335,22 +346,6 @@ module PinStatus # @return [Array] 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] - 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 diff --git a/rbi/lithic/models/non_pci_card.rbi b/rbi/lithic/models/non_pci_card.rbi index 2eb39e0c..68f4ee5f 100644 --- a/rbi/lithic/models/non_pci_card.rbi +++ b/rbi/lithic/models/non_pci_card.rbi @@ -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. @@ -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], @@ -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 @@ -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], @@ -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 diff --git a/sig/lithic/models/non_pci_card.rbs b/sig/lithic/models/non_pci_card.rbs index 41acb18c..d3d2e201 100644 --- a/sig/lithic/models/non_pci_card.rbs +++ b/sig/lithic/models/non_pci_card.rbs @@ -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], @@ -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 @@ -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], @@ -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], @@ -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 diff --git a/test/lithic/resources/cards_test.rb b/test/lithic/resources/cards_test.rb index 565c96d3..f90916fe 100644 --- a/test/lithic/resources/cards_test.rb +++ b/test/lithic/resources/cards_test.rb @@ -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, From 22540ce5db49867ac18ebcdef483d298421c55fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 14:25:04 +0000 Subject: [PATCH 2/2] release: 0.1.0-alpha.35 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/lithic/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 36b2affb..f9963500 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.34" + ".": "0.1.0-alpha.35" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 77129ee5..c6519e8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Gemfile.lock b/Gemfile.lock index 2ad0c2a6..2344948f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/README.md b/README.md index c59b225c..c29e3b54 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "lithic", "~> 0.1.0.pre.alpha.34" +gem "lithic", "~> 0.1.0.pre.alpha.35" ``` diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index cbd1fa7a..8c5298ef 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -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