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: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/lithic-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
- uses: actions/checkout@v4
Expand All @@ -33,6 +34,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/lithic-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
Expand Down
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.36"
".": "0.1.0-alpha.37"
}
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-cf48017e61eb3ac8aeaaa9d933186532f476b2f3c7e12fa9c962d52e5a9a272b.yml
openapi_spec_hash: b58989fdc04768fc1eb758e180c5f128
config_hash: e4d87bd83b304f6ab3f032db994e0093
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bc4173417a899a1519326ae60cb481186c1a1c976f3d00b2b305278808db44cd.yml
openapi_spec_hash: 1c1dd981efeffb5276544baa34cf3d17
config_hash: 1a83dceb58f6f525b19a5775018db7e8
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.1.0-alpha.37 (2025-07-02)

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

### Features

* **api:** api update ([95e6f93](https://github.com/lithic-com/lithic-ruby/commit/95e6f93cf300b9b2b96adaacc238da151d76bf06))


### Chores

* **ci:** only run for pushes and fork pull requests ([5e19b24](https://github.com/lithic-com/lithic-ruby/commit/5e19b24fcad22d51f01f3c26c82da029af648a3e))
* **internal:** allow streams to also be unwrapped on a per-row basis ([99c6f00](https://github.com/lithic-com/lithic-ruby/commit/99c6f001da13f61889cd29108f5ac6f49d875263))
* **internal:** manual updates ([05f1d5c](https://github.com/lithic-com/lithic-ruby/commit/05f1d5ceec90714c132c664035d658492c806653))

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

Full Changelog: [v0.1.0-alpha.35...v0.1.0-alpha.36](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.35...v0.1.0-alpha.36)
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.36)
lithic (0.1.0.pre.alpha.37)
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.36"
gem "lithic", "~> 0.1.0.pre.alpha.37"
```

<!-- x-release-please-end -->
Expand Down
12 changes: 10 additions & 2 deletions lib/lithic/internal/transport/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def request(req)
self.class.validate!(req)
model = req.fetch(:model) { Lithic::Internal::Type::Unknown }
opts = req[:options].to_h
unwrap = req[:unwrap]
Lithic::RequestOptions.validate!(opts)
request = build_request(req.except(:options), opts)
url = request.fetch(:url)
Expand All @@ -487,11 +488,18 @@ def request(req)
decoded = Lithic::Internal::Util.decode_content(response, stream: stream)
case req
in {stream: Class => st}
st.new(model: model, url: url, status: status, response: response, stream: decoded)
st.new(
model: model,
url: url,
status: status,
response: response,
unwrap: unwrap,
stream: decoded
)
in {page: Class => page}
page.new(client: self, req: req, headers: response, page_data: decoded)
else
unwrapped = Lithic::Internal::Util.dig(decoded, req[:unwrap])
unwrapped = Lithic::Internal::Util.dig(decoded, unwrap)
Lithic::Internal::Type::Converter.coerce(model, unwrapped)
end
end
Expand Down
20 changes: 19 additions & 1 deletion lib/lithic/models/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1086,12 +1086,17 @@ class Event < Lithic::Internal::Type::BaseModel
# @return [Symbol, Lithic::Models::Transaction::Event::Type]
required :type, enum: -> { Lithic::Transaction::Event::Type }

# @!attribute account_type
#
# @return [Symbol, Lithic::Models::Transaction::Event::AccountType, nil]
optional :account_type, enum: -> { Lithic::Transaction::Event::AccountType }

# @!attribute network_specific_data
#
# @return [Lithic::Models::Transaction::Event::NetworkSpecificData, nil]
optional :network_specific_data, -> { Lithic::Transaction::Event::NetworkSpecificData }

# @!method initialize(token:, amount:, amounts:, created:, detailed_results:, effective_polarity:, network_info:, result:, rule_results:, type:, network_specific_data: nil)
# @!method initialize(token:, amount:, amounts:, created:, detailed_results:, effective_polarity:, network_info:, result:, rule_results:, type:, account_type: nil, network_specific_data: nil)
# Some parameter documentations has been truncated, see
# {Lithic::Models::Transaction::Event} for more details.
#
Expand All @@ -1115,6 +1120,8 @@ class Event < Lithic::Internal::Type::BaseModel
#
# @param type [Symbol, Lithic::Models::Transaction::Event::Type] Type of transaction event
#
# @param account_type [Symbol, Lithic::Models::Transaction::Event::AccountType]
#
# @param network_specific_data [Lithic::Models::Transaction::Event::NetworkSpecificData]

# @see Lithic::Models::Transaction::Event#amounts
Expand Down Expand Up @@ -1633,6 +1640,17 @@ module Type
# @return [Array<Symbol>]
end

# @see Lithic::Models::Transaction::Event#account_type
module AccountType
extend Lithic::Internal::Type::Enum

CHECKING = :CHECKING
SAVINGS = :SAVINGS

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

# @see Lithic::Models::Transaction::Event#network_specific_data
class NetworkSpecificData < Lithic::Internal::Type::BaseModel
# @!attribute mastercard
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.36"
VERSION = "0.1.0.pre.alpha.37"
end
47 changes: 47 additions & 0 deletions rbi/lithic/models/transaction.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -2087,6 +2087,20 @@ module Lithic
sig { returns(Lithic::Transaction::Event::Type::TaggedSymbol) }
attr_accessor :type

sig do
returns(
T.nilable(Lithic::Transaction::Event::AccountType::TaggedSymbol)
)
end
attr_reader :account_type

sig do
params(
account_type: Lithic::Transaction::Event::AccountType::OrSymbol
).void
end
attr_writer :account_type

sig do
returns(T.nilable(Lithic::Transaction::Event::NetworkSpecificData))
end
Expand Down Expand Up @@ -2116,6 +2130,7 @@ module Lithic
rule_results:
T::Array[Lithic::Transaction::Event::RuleResult::OrHash],
type: Lithic::Transaction::Event::Type::OrSymbol,
account_type: Lithic::Transaction::Event::AccountType::OrSymbol,
network_specific_data:
Lithic::Transaction::Event::NetworkSpecificData::OrHash
).returns(T.attached_class)
Expand Down Expand Up @@ -2145,6 +2160,7 @@ module Lithic
rule_results:,
# Type of transaction event
type:,
account_type: nil,
network_specific_data: nil
)
end
Expand All @@ -2166,6 +2182,8 @@ module Lithic
result: Lithic::Transaction::Event::Result::TaggedSymbol,
rule_results: T::Array[Lithic::Transaction::Event::RuleResult],
type: Lithic::Transaction::Event::Type::TaggedSymbol,
account_type:
Lithic::Transaction::Event::AccountType::TaggedSymbol,
network_specific_data:
Lithic::Transaction::Event::NetworkSpecificData
}
Expand Down Expand Up @@ -3612,6 +3630,35 @@ module Lithic
end
end

module AccountType
extend Lithic::Internal::Type::Enum

TaggedSymbol =
T.type_alias do
T.all(Symbol, Lithic::Transaction::Event::AccountType)
end
OrSymbol = T.type_alias { T.any(Symbol, String) }

CHECKING =
T.let(
:CHECKING,
Lithic::Transaction::Event::AccountType::TaggedSymbol
)
SAVINGS =
T.let(
:SAVINGS,
Lithic::Transaction::Event::AccountType::TaggedSymbol
)

sig do
override.returns(
T::Array[Lithic::Transaction::Event::AccountType::TaggedSymbol]
)
end
def self.values
end
end

class NetworkSpecificData < Lithic::Internal::Type::BaseModel
OrHash =
T.type_alias do
Expand Down
20 changes: 20 additions & 0 deletions sig/lithic/models/transaction.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ module Lithic
result: Lithic::Models::Transaction::Event::result,
rule_results: ::Array[Lithic::Transaction::Event::RuleResult],
type: Lithic::Models::Transaction::Event::type_,
account_type: Lithic::Models::Transaction::Event::account_type,
network_specific_data: Lithic::Transaction::Event::NetworkSpecificData
}

Expand All @@ -900,6 +901,12 @@ module Lithic

attr_accessor type: Lithic::Models::Transaction::Event::type_

attr_reader account_type: Lithic::Models::Transaction::Event::account_type?

def account_type=: (
Lithic::Models::Transaction::Event::account_type
) -> Lithic::Models::Transaction::Event::account_type

attr_reader network_specific_data: Lithic::Transaction::Event::NetworkSpecificData?

def network_specific_data=: (
Expand All @@ -917,6 +924,7 @@ module Lithic
result: Lithic::Models::Transaction::Event::result,
rule_results: ::Array[Lithic::Transaction::Event::RuleResult],
type: Lithic::Models::Transaction::Event::type_,
?account_type: Lithic::Models::Transaction::Event::account_type,
?network_specific_data: Lithic::Transaction::Event::NetworkSpecificData
) -> void

Expand All @@ -931,6 +939,7 @@ module Lithic
result: Lithic::Models::Transaction::Event::result,
rule_results: ::Array[Lithic::Transaction::Event::RuleResult],
type: Lithic::Models::Transaction::Event::type_,
account_type: Lithic::Models::Transaction::Event::account_type,
network_specific_data: Lithic::Transaction::Event::NetworkSpecificData
}

Expand Down Expand Up @@ -1504,6 +1513,17 @@ module Lithic
def self?.values: -> ::Array[Lithic::Models::Transaction::Event::type_]
end

type account_type = :CHECKING | :SAVINGS

module AccountType
extend Lithic::Internal::Type::Enum

CHECKING: :CHECKING
SAVINGS: :SAVINGS

def self?.values: -> ::Array[Lithic::Models::Transaction::Event::account_type]
end

type network_specific_data =
{
mastercard: Lithic::Transaction::Event::NetworkSpecificData::Mastercard,
Expand Down
2 changes: 1 addition & 1 deletion test/lithic/resources/account_holders_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def test_retrieve_document_required_params
def test_simulate_enrollment_document_review_required_params
response =
@lithic.account_holders.simulate_enrollment_document_review(
document_upload_token: "b11cd67b-0a52-4180-8365-314f3def5426",
document_upload_token: "document_upload_token",
status: :UPLOADED
)

Expand Down