From c66d75ed7b10521d5f73efeafb9dbcd6ff7a7f0c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 15:17:42 +0000 Subject: [PATCH 1/7] feat(api): remove v1/aggregate_balances and related models --- .stats.yml | 8 +- lib/lithic.rb | 6 - lib/lithic/client.rb | 4 - lib/lithic/models.rb | 4 - lib/lithic/models/aggregate_balance.rb | 113 ------------ .../models/aggregate_balance_list_params.rb | 35 ---- .../cards/aggregate_balance_list_params.rb | 32 ---- .../cards/aggregate_balance_list_response.rb | 92 ---------- lib/lithic/resources/aggregate_balances.rb | 38 ---- lib/lithic/resources/cards.rb | 4 - .../resources/cards/aggregate_balances.rb | 41 ----- rbi/lithic/client.rbi | 3 - rbi/lithic/models.rbi | 4 - rbi/lithic/models/aggregate_balance.rbi | 164 ------------------ .../models/aggregate_balance_list_params.rbi | 104 ----------- .../cards/aggregate_balance_list_params.rbi | 62 ------- .../cards/aggregate_balance_list_response.rbi | 115 ------------ rbi/lithic/resources/aggregate_balances.rbi | 28 --- rbi/lithic/resources/cards.rbi | 3 - .../resources/cards/aggregate_balances.rbi | 35 ---- sig/lithic/client.rbs | 2 - sig/lithic/models.rbs | 4 - sig/lithic/models/aggregate_balance.rbs | 78 --------- .../models/aggregate_balance_list_params.rbs | 43 ----- .../cards/aggregate_balance_list_params.rbs | 34 ---- .../cards/aggregate_balance_list_response.rbs | 62 ------- sig/lithic/resources/aggregate_balances.rbs | 12 -- sig/lithic/resources/cards.rbs | 2 - .../resources/cards/aggregate_balances.rbs | 15 -- .../resources/aggregate_balances_test.rb | 35 ---- .../cards/aggregate_balances_test.rb | 34 ---- 31 files changed, 4 insertions(+), 1212 deletions(-) delete mode 100644 lib/lithic/models/aggregate_balance.rb delete mode 100644 lib/lithic/models/aggregate_balance_list_params.rb delete mode 100644 lib/lithic/models/cards/aggregate_balance_list_params.rb delete mode 100644 lib/lithic/models/cards/aggregate_balance_list_response.rb delete mode 100644 lib/lithic/resources/aggregate_balances.rb delete mode 100644 lib/lithic/resources/cards/aggregate_balances.rb delete mode 100644 rbi/lithic/models/aggregate_balance.rbi delete mode 100644 rbi/lithic/models/aggregate_balance_list_params.rbi delete mode 100644 rbi/lithic/models/cards/aggregate_balance_list_params.rbi delete mode 100644 rbi/lithic/models/cards/aggregate_balance_list_response.rbi delete mode 100644 rbi/lithic/resources/aggregate_balances.rbi delete mode 100644 rbi/lithic/resources/cards/aggregate_balances.rbi delete mode 100644 sig/lithic/models/aggregate_balance.rbs delete mode 100644 sig/lithic/models/aggregate_balance_list_params.rbs delete mode 100644 sig/lithic/models/cards/aggregate_balance_list_params.rbs delete mode 100644 sig/lithic/models/cards/aggregate_balance_list_response.rbs delete mode 100644 sig/lithic/resources/aggregate_balances.rbs delete mode 100644 sig/lithic/resources/cards/aggregate_balances.rbs delete mode 100644 test/lithic/resources/aggregate_balances_test.rb delete mode 100644 test/lithic/resources/cards/aggregate_balances_test.rb diff --git a/.stats.yml b/.stats.yml index 315b0f37..ca0f3ae4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml -openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f -config_hash: 2b2786c821f62db49cc630ba45329336 +configured_endpoints: 174 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4fd8048b287f409ad2b91f7d0f0b7fc13cc9bc4ccc7859666f21203bab3d2f01.yml +openapi_spec_hash: a554c54d96a7604a770b6a8b1df46395 +config_hash: df0af4ff639b8a6923a6244d2247910c diff --git a/lib/lithic.rb b/lib/lithic.rb index 9ef65dd5..1146bbfc 100644 --- a/lib/lithic.rb +++ b/lib/lithic.rb @@ -106,8 +106,6 @@ require_relative "lithic/models/account_update_params" require_relative "lithic/models/address" require_relative "lithic/models/address_update" -require_relative "lithic/models/aggregate_balance" -require_relative "lithic/models/aggregate_balance_list_params" require_relative "lithic/models/api_status" require_relative "lithic/models/asa_request_webhook_event" require_relative "lithic/models/auth_rules/auth_rule" @@ -177,8 +175,6 @@ require_relative "lithic/models/card_renew_params" require_relative "lithic/models/card_retrieve_params" require_relative "lithic/models/card_retrieve_spend_limits_params" -require_relative "lithic/models/cards/aggregate_balance_list_params" -require_relative "lithic/models/cards/aggregate_balance_list_response" require_relative "lithic/models/cards/balance_list_params" require_relative "lithic/models/cards/financial_transaction_list_params" require_relative "lithic/models/cards/financial_transaction_retrieve_params" @@ -431,7 +427,6 @@ require_relative "lithic/resources/account_activity" require_relative "lithic/resources/account_holders" require_relative "lithic/resources/accounts" -require_relative "lithic/resources/aggregate_balances" require_relative "lithic/resources/auth_rules" require_relative "lithic/resources/auth_rules/v2" require_relative "lithic/resources/auth_rules/v2/backtests" @@ -441,7 +436,6 @@ require_relative "lithic/resources/card_bulk_orders" require_relative "lithic/resources/card_programs" require_relative "lithic/resources/cards" -require_relative "lithic/resources/cards/aggregate_balances" require_relative "lithic/resources/cards/balances" require_relative "lithic/resources/cards/financial_transactions" require_relative "lithic/resources/credit_products" diff --git a/lib/lithic/client.rb b/lib/lithic/client.rb index b39ba831..2c887ab1 100644 --- a/lib/lithic/client.rb +++ b/lib/lithic/client.rb @@ -50,9 +50,6 @@ class Client < Lithic::Internal::Transport::BaseClient # @return [Lithic::Resources::Balances] attr_reader :balances - # @return [Lithic::Resources::AggregateBalances] - attr_reader :aggregate_balances - # @return [Lithic::Resources::Disputes] attr_reader :disputes @@ -205,7 +202,6 @@ def initialize( @cards = Lithic::Resources::Cards.new(client: self) @card_bulk_orders = Lithic::Resources::CardBulkOrders.new(client: self) @balances = Lithic::Resources::Balances.new(client: self) - @aggregate_balances = Lithic::Resources::AggregateBalances.new(client: self) @disputes = Lithic::Resources::Disputes.new(client: self) @disputes_v2 = Lithic::Resources::DisputesV2.new(client: self) @events = Lithic::Resources::Events.new(client: self) diff --git a/lib/lithic/models.rb b/lib/lithic/models.rb index fa2f704a..e9471545 100644 --- a/lib/lithic/models.rb +++ b/lib/lithic/models.rb @@ -90,10 +90,6 @@ module Lithic AddressUpdate = Lithic::Models::AddressUpdate - AggregateBalance = Lithic::Models::AggregateBalance - - AggregateBalanceListParams = Lithic::Models::AggregateBalanceListParams - APIStatus = Lithic::Models::APIStatus AsaRequestWebhookEvent = Lithic::Models::AsaRequestWebhookEvent diff --git a/lib/lithic/models/aggregate_balance.rb b/lib/lithic/models/aggregate_balance.rb deleted file mode 100644 index 4563cf4c..00000000 --- a/lib/lithic/models/aggregate_balance.rb +++ /dev/null @@ -1,113 +0,0 @@ -# frozen_string_literal: true - -module Lithic - module Models - # @see Lithic::Resources::AggregateBalances#list - class AggregateBalance < Lithic::Internal::Type::BaseModel - # @!attribute available_amount - # Funds available for spend in the currency's smallest unit (e.g., cents for USD) - # - # @return [Integer] - required :available_amount, Integer - - # @!attribute created - # Date and time for when the balance was first created. - # - # @return [Time] - required :created, Time - - # @!attribute currency - # 3-character alphabetic ISO 4217 code for the local currency of the balance. - # - # @return [String] - required :currency, String - - # @!attribute financial_account_type - # Type of financial account - # - # @return [Symbol, Lithic::Models::AggregateBalance::FinancialAccountType] - required :financial_account_type, enum: -> { Lithic::AggregateBalance::FinancialAccountType } - - # @!attribute last_financial_account_token - # Globally unique identifier for the financial account that had its balance - # updated most recently - # - # @return [String] - required :last_financial_account_token, String - - # @!attribute last_transaction_event_token - # Globally unique identifier for the last transaction event that impacted this - # balance - # - # @return [String] - required :last_transaction_event_token, String - - # @!attribute last_transaction_token - # Globally unique identifier for the last transaction that impacted this balance - # - # @return [String] - required :last_transaction_token, String - - # @!attribute pending_amount - # Funds not available for spend due to card authorizations or pending ACH release. - # Shown in the currency's smallest unit (e.g., cents for USD) - # - # @return [Integer] - required :pending_amount, Integer - - # @!attribute total_amount - # The sum of available and pending balance in the currency's smallest unit (e.g., - # cents for USD) - # - # @return [Integer] - required :total_amount, Integer - - # @!attribute updated - # Date and time for when the balance was last updated. - # - # @return [Time] - required :updated, Time - - # @!method initialize(available_amount:, created:, currency:, financial_account_type:, last_financial_account_token:, last_transaction_event_token:, last_transaction_token:, pending_amount:, total_amount:, updated:) - # Some parameter documentations has been truncated, see - # {Lithic::Models::AggregateBalance} for more details. - # - # Aggregate Balance across all end-user accounts - # - # @param available_amount [Integer] Funds available for spend in the currency's smallest unit (e.g., cents for USD) - # - # @param created [Time] Date and time for when the balance was first created. - # - # @param currency [String] 3-character alphabetic ISO 4217 code for the local currency of the balance. - # - # @param financial_account_type [Symbol, Lithic::Models::AggregateBalance::FinancialAccountType] Type of financial account - # - # @param last_financial_account_token [String] Globally unique identifier for the financial account that had its balance update - # - # @param last_transaction_event_token [String] Globally unique identifier for the last transaction event that impacted this bal - # - # @param last_transaction_token [String] Globally unique identifier for the last transaction that impacted this balance - # - # @param pending_amount [Integer] Funds not available for spend due to card authorizations or pending ACH release. - # - # @param total_amount [Integer] The sum of available and pending balance in the currency's smallest unit (e.g., - # - # @param updated [Time] Date and time for when the balance was last updated. - - # Type of financial account - # - # @see Lithic::Models::AggregateBalance#financial_account_type - module FinancialAccountType - extend Lithic::Internal::Type::Enum - - ISSUING = :ISSUING - OPERATING = :OPERATING - RESERVE = :RESERVE - SECURITY = :SECURITY - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/lithic/models/aggregate_balance_list_params.rb b/lib/lithic/models/aggregate_balance_list_params.rb deleted file mode 100644 index 9b0075a2..00000000 --- a/lib/lithic/models/aggregate_balance_list_params.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module Lithic - module Models - # @see Lithic::Resources::AggregateBalances#list - class AggregateBalanceListParams < Lithic::Internal::Type::BaseModel - extend Lithic::Internal::Type::RequestParameters::Converter - include Lithic::Internal::Type::RequestParameters - - # @!attribute financial_account_type - # Get the aggregate balance for a given Financial Account type. - # - # @return [Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType, nil] - optional :financial_account_type, enum: -> { Lithic::AggregateBalanceListParams::FinancialAccountType } - - # @!method initialize(financial_account_type: nil, request_options: {}) - # @param financial_account_type [Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType] Get the aggregate balance for a given Financial Account type. - # - # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] - - # Get the aggregate balance for a given Financial Account type. - module FinancialAccountType - extend Lithic::Internal::Type::Enum - - ISSUING = :ISSUING - OPERATING = :OPERATING - RESERVE = :RESERVE - SECURITY = :SECURITY - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/lithic/models/cards/aggregate_balance_list_params.rb b/lib/lithic/models/cards/aggregate_balance_list_params.rb deleted file mode 100644 index 2a1ef9d7..00000000 --- a/lib/lithic/models/cards/aggregate_balance_list_params.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -module Lithic - module Models - module Cards - # @see Lithic::Resources::Cards::AggregateBalances#list - class AggregateBalanceListParams < Lithic::Internal::Type::BaseModel - extend Lithic::Internal::Type::RequestParameters::Converter - include Lithic::Internal::Type::RequestParameters - - # @!attribute account_token - # Cardholder to retrieve aggregate balances for. - # - # @return [String, nil] - optional :account_token, String - - # @!attribute business_account_token - # Business to retrieve aggregate balances for. - # - # @return [String, nil] - optional :business_account_token, String - - # @!method initialize(account_token: nil, business_account_token: nil, request_options: {}) - # @param account_token [String] Cardholder to retrieve aggregate balances for. - # - # @param business_account_token [String] Business to retrieve aggregate balances for. - # - # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/lithic/models/cards/aggregate_balance_list_response.rb b/lib/lithic/models/cards/aggregate_balance_list_response.rb deleted file mode 100644 index fa51870a..00000000 --- a/lib/lithic/models/cards/aggregate_balance_list_response.rb +++ /dev/null @@ -1,92 +0,0 @@ -# frozen_string_literal: true - -module Lithic - module Models - module Cards - # @see Lithic::Resources::Cards::AggregateBalances#list - class AggregateBalanceListResponse < Lithic::Internal::Type::BaseModel - # @!attribute available_amount - # Funds available for spend in the currency's smallest unit (e.g., cents for USD) - # - # @return [Integer] - required :available_amount, Integer - - # @!attribute created - # Date and time for when the balance was first created. - # - # @return [Time] - required :created, Time - - # @!attribute currency - # 3-character alphabetic ISO 4217 code for the local currency of the balance. - # - # @return [String] - required :currency, String - - # @!attribute last_card_token - # Globally unique identifier for the card that had its balance updated most - # recently - # - # @return [String] - required :last_card_token, String - - # @!attribute last_transaction_event_token - # Globally unique identifier for the last transaction event that impacted this - # balance - # - # @return [String] - required :last_transaction_event_token, String - - # @!attribute last_transaction_token - # Globally unique identifier for the last transaction that impacted this balance - # - # @return [String] - required :last_transaction_token, String - - # @!attribute pending_amount - # Funds not available for spend due to card authorizations or pending ACH release. - # Shown in the currency's smallest unit (e.g., cents for USD) - # - # @return [Integer] - required :pending_amount, Integer - - # @!attribute total_amount - # The sum of available and pending balance in the currency's smallest unit (e.g., - # cents for USD) - # - # @return [Integer] - required :total_amount, Integer - - # @!attribute updated - # Date and time for when the balance was last updated. - # - # @return [Time] - required :updated, Time - - # @!method initialize(available_amount:, created:, currency:, last_card_token:, last_transaction_event_token:, last_transaction_token:, pending_amount:, total_amount:, updated:) - # Some parameter documentations has been truncated, see - # {Lithic::Models::Cards::AggregateBalanceListResponse} for more details. - # - # Card Aggregate Balance across all end-user accounts - # - # @param available_amount [Integer] Funds available for spend in the currency's smallest unit (e.g., cents for USD) - # - # @param created [Time] Date and time for when the balance was first created. - # - # @param currency [String] 3-character alphabetic ISO 4217 code for the local currency of the balance. - # - # @param last_card_token [String] Globally unique identifier for the card that had its balance updated most recent - # - # @param last_transaction_event_token [String] Globally unique identifier for the last transaction event that impacted this bal - # - # @param last_transaction_token [String] Globally unique identifier for the last transaction that impacted this balance - # - # @param pending_amount [Integer] Funds not available for spend due to card authorizations or pending ACH release. - # - # @param total_amount [Integer] The sum of available and pending balance in the currency's smallest unit (e.g., - # - # @param updated [Time] Date and time for when the balance was last updated. - end - end - end -end diff --git a/lib/lithic/resources/aggregate_balances.rb b/lib/lithic/resources/aggregate_balances.rb deleted file mode 100644 index 4430e910..00000000 --- a/lib/lithic/resources/aggregate_balances.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -module Lithic - module Resources - class AggregateBalances - # Get the aggregated balance across all end-user accounts by financial account - # type - # - # @overload list(financial_account_type: nil, request_options: {}) - # - # @param financial_account_type [Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType] Get the aggregate balance for a given Financial Account type. - # - # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Lithic::Internal::SinglePage] - # - # @see Lithic::Models::AggregateBalanceListParams - def list(params = {}) - parsed, options = Lithic::AggregateBalanceListParams.dump_request(params) - @client.request( - method: :get, - path: "v1/aggregate_balances", - query: parsed, - page: Lithic::Internal::SinglePage, - model: Lithic::AggregateBalance, - options: options - ) - end - - # @api private - # - # @param client [Lithic::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/lithic/resources/cards.rb b/lib/lithic/resources/cards.rb index c8276087..4d2957d7 100644 --- a/lib/lithic/resources/cards.rb +++ b/lib/lithic/resources/cards.rb @@ -3,9 +3,6 @@ module Lithic module Resources class Cards - # @return [Lithic::Resources::Cards::AggregateBalances] - attr_reader :aggregate_balances - # @return [Lithic::Resources::Cards::Balances] attr_reader :balances @@ -486,7 +483,6 @@ def web_provision(card_token, params = {}) # @param client [Lithic::Client] def initialize(client:) @client = client - @aggregate_balances = Lithic::Resources::Cards::AggregateBalances.new(client: client) @balances = Lithic::Resources::Cards::Balances.new(client: client) @financial_transactions = Lithic::Resources::Cards::FinancialTransactions.new(client: client) end diff --git a/lib/lithic/resources/cards/aggregate_balances.rb b/lib/lithic/resources/cards/aggregate_balances.rb deleted file mode 100644 index 8d7364ee..00000000 --- a/lib/lithic/resources/cards/aggregate_balances.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -module Lithic - module Resources - class Cards - class AggregateBalances - # Get the aggregated card balance across all end-user accounts. - # - # @overload list(account_token: nil, business_account_token: nil, request_options: {}) - # - # @param account_token [String] Cardholder to retrieve aggregate balances for. - # - # @param business_account_token [String] Business to retrieve aggregate balances for. - # - # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Lithic::Internal::SinglePage] - # - # @see Lithic::Models::Cards::AggregateBalanceListParams - def list(params = {}) - parsed, options = Lithic::Cards::AggregateBalanceListParams.dump_request(params) - @client.request( - method: :get, - path: "v1/cards/aggregate_balances", - query: parsed, - page: Lithic::Internal::SinglePage, - model: Lithic::Models::Cards::AggregateBalanceListResponse, - options: options - ) - end - - # @api private - # - # @param client [Lithic::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/rbi/lithic/client.rbi b/rbi/lithic/client.rbi index 2b400356..84b68550 100644 --- a/rbi/lithic/client.rbi +++ b/rbi/lithic/client.rbi @@ -49,9 +49,6 @@ module Lithic sig { returns(Lithic::Resources::Balances) } attr_reader :balances - sig { returns(Lithic::Resources::AggregateBalances) } - attr_reader :aggregate_balances - sig { returns(Lithic::Resources::Disputes) } attr_reader :disputes diff --git a/rbi/lithic/models.rbi b/rbi/lithic/models.rbi index 71191d59..05625430 100644 --- a/rbi/lithic/models.rbi +++ b/rbi/lithic/models.rbi @@ -62,10 +62,6 @@ module Lithic AddressUpdate = Lithic::Models::AddressUpdate - AggregateBalance = Lithic::Models::AggregateBalance - - AggregateBalanceListParams = Lithic::Models::AggregateBalanceListParams - APIStatus = Lithic::Models::APIStatus AsaRequestWebhookEvent = Lithic::Models::AsaRequestWebhookEvent diff --git a/rbi/lithic/models/aggregate_balance.rbi b/rbi/lithic/models/aggregate_balance.rbi deleted file mode 100644 index adf85f0b..00000000 --- a/rbi/lithic/models/aggregate_balance.rbi +++ /dev/null @@ -1,164 +0,0 @@ -# typed: strong - -module Lithic - module Models - class AggregateBalance < Lithic::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Lithic::AggregateBalance, Lithic::Internal::AnyHash) - end - - # Funds available for spend in the currency's smallest unit (e.g., cents for USD) - sig { returns(Integer) } - attr_accessor :available_amount - - # Date and time for when the balance was first created. - sig { returns(Time) } - attr_accessor :created - - # 3-character alphabetic ISO 4217 code for the local currency of the balance. - sig { returns(String) } - attr_accessor :currency - - # Type of financial account - sig do - returns(Lithic::AggregateBalance::FinancialAccountType::TaggedSymbol) - end - attr_accessor :financial_account_type - - # Globally unique identifier for the financial account that had its balance - # updated most recently - sig { returns(String) } - attr_accessor :last_financial_account_token - - # Globally unique identifier for the last transaction event that impacted this - # balance - sig { returns(String) } - attr_accessor :last_transaction_event_token - - # Globally unique identifier for the last transaction that impacted this balance - sig { returns(String) } - attr_accessor :last_transaction_token - - # Funds not available for spend due to card authorizations or pending ACH release. - # Shown in the currency's smallest unit (e.g., cents for USD) - sig { returns(Integer) } - attr_accessor :pending_amount - - # The sum of available and pending balance in the currency's smallest unit (e.g., - # cents for USD) - sig { returns(Integer) } - attr_accessor :total_amount - - # Date and time for when the balance was last updated. - sig { returns(Time) } - attr_accessor :updated - - # Aggregate Balance across all end-user accounts - sig do - params( - available_amount: Integer, - created: Time, - currency: String, - financial_account_type: - Lithic::AggregateBalance::FinancialAccountType::OrSymbol, - last_financial_account_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - ).returns(T.attached_class) - end - def self.new( - # Funds available for spend in the currency's smallest unit (e.g., cents for USD) - available_amount:, - # Date and time for when the balance was first created. - created:, - # 3-character alphabetic ISO 4217 code for the local currency of the balance. - currency:, - # Type of financial account - financial_account_type:, - # Globally unique identifier for the financial account that had its balance - # updated most recently - last_financial_account_token:, - # Globally unique identifier for the last transaction event that impacted this - # balance - last_transaction_event_token:, - # Globally unique identifier for the last transaction that impacted this balance - last_transaction_token:, - # Funds not available for spend due to card authorizations or pending ACH release. - # Shown in the currency's smallest unit (e.g., cents for USD) - pending_amount:, - # The sum of available and pending balance in the currency's smallest unit (e.g., - # cents for USD) - total_amount:, - # Date and time for when the balance was last updated. - updated: - ) - end - - sig do - override.returns( - { - available_amount: Integer, - created: Time, - currency: String, - financial_account_type: - Lithic::AggregateBalance::FinancialAccountType::TaggedSymbol, - last_financial_account_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - } - ) - end - def to_hash - end - - # Type of financial account - module FinancialAccountType - extend Lithic::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Lithic::AggregateBalance::FinancialAccountType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ISSUING = - T.let( - :ISSUING, - Lithic::AggregateBalance::FinancialAccountType::TaggedSymbol - ) - OPERATING = - T.let( - :OPERATING, - Lithic::AggregateBalance::FinancialAccountType::TaggedSymbol - ) - RESERVE = - T.let( - :RESERVE, - Lithic::AggregateBalance::FinancialAccountType::TaggedSymbol - ) - SECURITY = - T.let( - :SECURITY, - Lithic::AggregateBalance::FinancialAccountType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Lithic::AggregateBalance::FinancialAccountType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/lithic/models/aggregate_balance_list_params.rbi b/rbi/lithic/models/aggregate_balance_list_params.rbi deleted file mode 100644 index 89092a42..00000000 --- a/rbi/lithic/models/aggregate_balance_list_params.rbi +++ /dev/null @@ -1,104 +0,0 @@ -# typed: strong - -module Lithic - module Models - class AggregateBalanceListParams < Lithic::Internal::Type::BaseModel - extend Lithic::Internal::Type::RequestParameters::Converter - include Lithic::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any(Lithic::AggregateBalanceListParams, Lithic::Internal::AnyHash) - end - - # Get the aggregate balance for a given Financial Account type. - sig do - returns( - T.nilable( - Lithic::AggregateBalanceListParams::FinancialAccountType::OrSymbol - ) - ) - end - attr_reader :financial_account_type - - sig do - params( - financial_account_type: - Lithic::AggregateBalanceListParams::FinancialAccountType::OrSymbol - ).void - end - attr_writer :financial_account_type - - sig do - params( - financial_account_type: - Lithic::AggregateBalanceListParams::FinancialAccountType::OrSymbol, - request_options: Lithic::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Get the aggregate balance for a given Financial Account type. - financial_account_type: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - financial_account_type: - Lithic::AggregateBalanceListParams::FinancialAccountType::OrSymbol, - request_options: Lithic::RequestOptions - } - ) - end - def to_hash - end - - # Get the aggregate balance for a given Financial Account type. - module FinancialAccountType - extend Lithic::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - Lithic::AggregateBalanceListParams::FinancialAccountType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ISSUING = - T.let( - :ISSUING, - Lithic::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol - ) - OPERATING = - T.let( - :OPERATING, - Lithic::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol - ) - RESERVE = - T.let( - :RESERVE, - Lithic::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol - ) - SECURITY = - T.let( - :SECURITY, - Lithic::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Lithic::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/lithic/models/cards/aggregate_balance_list_params.rbi b/rbi/lithic/models/cards/aggregate_balance_list_params.rbi deleted file mode 100644 index a6603230..00000000 --- a/rbi/lithic/models/cards/aggregate_balance_list_params.rbi +++ /dev/null @@ -1,62 +0,0 @@ -# typed: strong - -module Lithic - module Models - module Cards - class AggregateBalanceListParams < Lithic::Internal::Type::BaseModel - extend Lithic::Internal::Type::RequestParameters::Converter - include Lithic::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - Lithic::Cards::AggregateBalanceListParams, - Lithic::Internal::AnyHash - ) - end - - # Cardholder to retrieve aggregate balances for. - sig { returns(T.nilable(String)) } - attr_reader :account_token - - sig { params(account_token: String).void } - attr_writer :account_token - - # Business to retrieve aggregate balances for. - sig { returns(T.nilable(String)) } - attr_reader :business_account_token - - sig { params(business_account_token: String).void } - attr_writer :business_account_token - - sig do - params( - account_token: String, - business_account_token: String, - request_options: Lithic::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Cardholder to retrieve aggregate balances for. - account_token: nil, - # Business to retrieve aggregate balances for. - business_account_token: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - account_token: String, - business_account_token: String, - request_options: Lithic::RequestOptions - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/lithic/models/cards/aggregate_balance_list_response.rbi b/rbi/lithic/models/cards/aggregate_balance_list_response.rbi deleted file mode 100644 index e3af3e15..00000000 --- a/rbi/lithic/models/cards/aggregate_balance_list_response.rbi +++ /dev/null @@ -1,115 +0,0 @@ -# typed: strong - -module Lithic - module Models - module Cards - class AggregateBalanceListResponse < Lithic::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Lithic::Models::Cards::AggregateBalanceListResponse, - Lithic::Internal::AnyHash - ) - end - - # Funds available for spend in the currency's smallest unit (e.g., cents for USD) - sig { returns(Integer) } - attr_accessor :available_amount - - # Date and time for when the balance was first created. - sig { returns(Time) } - attr_accessor :created - - # 3-character alphabetic ISO 4217 code for the local currency of the balance. - sig { returns(String) } - attr_accessor :currency - - # Globally unique identifier for the card that had its balance updated most - # recently - sig { returns(String) } - attr_accessor :last_card_token - - # Globally unique identifier for the last transaction event that impacted this - # balance - sig { returns(String) } - attr_accessor :last_transaction_event_token - - # Globally unique identifier for the last transaction that impacted this balance - sig { returns(String) } - attr_accessor :last_transaction_token - - # Funds not available for spend due to card authorizations or pending ACH release. - # Shown in the currency's smallest unit (e.g., cents for USD) - sig { returns(Integer) } - attr_accessor :pending_amount - - # The sum of available and pending balance in the currency's smallest unit (e.g., - # cents for USD) - sig { returns(Integer) } - attr_accessor :total_amount - - # Date and time for when the balance was last updated. - sig { returns(Time) } - attr_accessor :updated - - # Card Aggregate Balance across all end-user accounts - sig do - params( - available_amount: Integer, - created: Time, - currency: String, - last_card_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - ).returns(T.attached_class) - end - def self.new( - # Funds available for spend in the currency's smallest unit (e.g., cents for USD) - available_amount:, - # Date and time for when the balance was first created. - created:, - # 3-character alphabetic ISO 4217 code for the local currency of the balance. - currency:, - # Globally unique identifier for the card that had its balance updated most - # recently - last_card_token:, - # Globally unique identifier for the last transaction event that impacted this - # balance - last_transaction_event_token:, - # Globally unique identifier for the last transaction that impacted this balance - last_transaction_token:, - # Funds not available for spend due to card authorizations or pending ACH release. - # Shown in the currency's smallest unit (e.g., cents for USD) - pending_amount:, - # The sum of available and pending balance in the currency's smallest unit (e.g., - # cents for USD) - total_amount:, - # Date and time for when the balance was last updated. - updated: - ) - end - - sig do - override.returns( - { - available_amount: Integer, - created: Time, - currency: String, - last_card_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/lithic/resources/aggregate_balances.rbi b/rbi/lithic/resources/aggregate_balances.rbi deleted file mode 100644 index 3f3582d1..00000000 --- a/rbi/lithic/resources/aggregate_balances.rbi +++ /dev/null @@ -1,28 +0,0 @@ -# typed: strong - -module Lithic - module Resources - class AggregateBalances - # Get the aggregated balance across all end-user accounts by financial account - # type - sig do - params( - financial_account_type: - Lithic::AggregateBalanceListParams::FinancialAccountType::OrSymbol, - request_options: Lithic::RequestOptions::OrHash - ).returns(Lithic::Internal::SinglePage[Lithic::AggregateBalance]) - end - def list( - # Get the aggregate balance for a given Financial Account type. - financial_account_type: nil, - request_options: {} - ) - end - - # @api private - sig { params(client: Lithic::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/lithic/resources/cards.rbi b/rbi/lithic/resources/cards.rbi index 335c216d..6eb3239b 100644 --- a/rbi/lithic/resources/cards.rbi +++ b/rbi/lithic/resources/cards.rbi @@ -3,9 +3,6 @@ module Lithic module Resources class Cards - sig { returns(Lithic::Resources::Cards::AggregateBalances) } - attr_reader :aggregate_balances - sig { returns(Lithic::Resources::Cards::Balances) } attr_reader :balances diff --git a/rbi/lithic/resources/cards/aggregate_balances.rbi b/rbi/lithic/resources/cards/aggregate_balances.rbi deleted file mode 100644 index a82f6feb..00000000 --- a/rbi/lithic/resources/cards/aggregate_balances.rbi +++ /dev/null @@ -1,35 +0,0 @@ -# typed: strong - -module Lithic - module Resources - class Cards - class AggregateBalances - # Get the aggregated card balance across all end-user accounts. - sig do - params( - account_token: String, - business_account_token: String, - request_options: Lithic::RequestOptions::OrHash - ).returns( - Lithic::Internal::SinglePage[ - Lithic::Models::Cards::AggregateBalanceListResponse - ] - ) - end - def list( - # Cardholder to retrieve aggregate balances for. - account_token: nil, - # Business to retrieve aggregate balances for. - business_account_token: nil, - request_options: {} - ) - end - - # @api private - sig { params(client: Lithic::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end - end -end diff --git a/sig/lithic/client.rbs b/sig/lithic/client.rbs index 9cc1e433..208af84b 100644 --- a/sig/lithic/client.rbs +++ b/sig/lithic/client.rbs @@ -33,8 +33,6 @@ module Lithic attr_reader balances: Lithic::Resources::Balances - attr_reader aggregate_balances: Lithic::Resources::AggregateBalances - attr_reader disputes: Lithic::Resources::Disputes attr_reader disputes_v2: Lithic::Resources::DisputesV2 diff --git a/sig/lithic/models.rbs b/sig/lithic/models.rbs index 573c6180..0286675d 100644 --- a/sig/lithic/models.rbs +++ b/sig/lithic/models.rbs @@ -49,10 +49,6 @@ module Lithic class AddressUpdate = Lithic::Models::AddressUpdate - class AggregateBalance = Lithic::Models::AggregateBalance - - class AggregateBalanceListParams = Lithic::Models::AggregateBalanceListParams - class APIStatus = Lithic::Models::APIStatus class AsaRequestWebhookEvent = Lithic::Models::AsaRequestWebhookEvent diff --git a/sig/lithic/models/aggregate_balance.rbs b/sig/lithic/models/aggregate_balance.rbs deleted file mode 100644 index 0cac39a2..00000000 --- a/sig/lithic/models/aggregate_balance.rbs +++ /dev/null @@ -1,78 +0,0 @@ -module Lithic - module Models - type aggregate_balance = - { - available_amount: Integer, - created: Time, - currency: String, - financial_account_type: Lithic::Models::AggregateBalance::financial_account_type, - last_financial_account_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - } - - class AggregateBalance < Lithic::Internal::Type::BaseModel - attr_accessor available_amount: Integer - - attr_accessor created: Time - - attr_accessor currency: String - - attr_accessor financial_account_type: Lithic::Models::AggregateBalance::financial_account_type - - attr_accessor last_financial_account_token: String - - attr_accessor last_transaction_event_token: String - - attr_accessor last_transaction_token: String - - attr_accessor pending_amount: Integer - - attr_accessor total_amount: Integer - - attr_accessor updated: Time - - def initialize: ( - available_amount: Integer, - created: Time, - currency: String, - financial_account_type: Lithic::Models::AggregateBalance::financial_account_type, - last_financial_account_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - ) -> void - - def to_hash: -> { - available_amount: Integer, - created: Time, - currency: String, - financial_account_type: Lithic::Models::AggregateBalance::financial_account_type, - last_financial_account_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - } - - type financial_account_type = :ISSUING | :OPERATING | :RESERVE | :SECURITY - - module FinancialAccountType - extend Lithic::Internal::Type::Enum - - ISSUING: :ISSUING - OPERATING: :OPERATING - RESERVE: :RESERVE - SECURITY: :SECURITY - - def self?.values: -> ::Array[Lithic::Models::AggregateBalance::financial_account_type] - end - end - end -end diff --git a/sig/lithic/models/aggregate_balance_list_params.rbs b/sig/lithic/models/aggregate_balance_list_params.rbs deleted file mode 100644 index 69972670..00000000 --- a/sig/lithic/models/aggregate_balance_list_params.rbs +++ /dev/null @@ -1,43 +0,0 @@ -module Lithic - module Models - type aggregate_balance_list_params = - { - financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type - } - & Lithic::Internal::Type::request_parameters - - class AggregateBalanceListParams < Lithic::Internal::Type::BaseModel - extend Lithic::Internal::Type::RequestParameters::Converter - include Lithic::Internal::Type::RequestParameters - - attr_reader financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type? - - def financial_account_type=: ( - Lithic::Models::AggregateBalanceListParams::financial_account_type - ) -> Lithic::Models::AggregateBalanceListParams::financial_account_type - - def initialize: ( - ?financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type, - ?request_options: Lithic::request_opts - ) -> void - - def to_hash: -> { - financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type, - request_options: Lithic::RequestOptions - } - - type financial_account_type = :ISSUING | :OPERATING | :RESERVE | :SECURITY - - module FinancialAccountType - extend Lithic::Internal::Type::Enum - - ISSUING: :ISSUING - OPERATING: :OPERATING - RESERVE: :RESERVE - SECURITY: :SECURITY - - def self?.values: -> ::Array[Lithic::Models::AggregateBalanceListParams::financial_account_type] - end - end - end -end diff --git a/sig/lithic/models/cards/aggregate_balance_list_params.rbs b/sig/lithic/models/cards/aggregate_balance_list_params.rbs deleted file mode 100644 index 8ccdaa43..00000000 --- a/sig/lithic/models/cards/aggregate_balance_list_params.rbs +++ /dev/null @@ -1,34 +0,0 @@ -module Lithic - module Models - module Cards - type aggregate_balance_list_params = - { account_token: String, business_account_token: String } - & Lithic::Internal::Type::request_parameters - - class AggregateBalanceListParams < Lithic::Internal::Type::BaseModel - extend Lithic::Internal::Type::RequestParameters::Converter - include Lithic::Internal::Type::RequestParameters - - attr_reader account_token: String? - - def account_token=: (String) -> String - - attr_reader business_account_token: String? - - def business_account_token=: (String) -> String - - def initialize: ( - ?account_token: String, - ?business_account_token: String, - ?request_options: Lithic::request_opts - ) -> void - - def to_hash: -> { - account_token: String, - business_account_token: String, - request_options: Lithic::RequestOptions - } - end - end - end -end diff --git a/sig/lithic/models/cards/aggregate_balance_list_response.rbs b/sig/lithic/models/cards/aggregate_balance_list_response.rbs deleted file mode 100644 index 8d3aae08..00000000 --- a/sig/lithic/models/cards/aggregate_balance_list_response.rbs +++ /dev/null @@ -1,62 +0,0 @@ -module Lithic - module Models - module Cards - type aggregate_balance_list_response = - { - available_amount: Integer, - created: Time, - currency: String, - last_card_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - } - - class AggregateBalanceListResponse < Lithic::Internal::Type::BaseModel - attr_accessor available_amount: Integer - - attr_accessor created: Time - - attr_accessor currency: String - - attr_accessor last_card_token: String - - attr_accessor last_transaction_event_token: String - - attr_accessor last_transaction_token: String - - attr_accessor pending_amount: Integer - - attr_accessor total_amount: Integer - - attr_accessor updated: Time - - def initialize: ( - available_amount: Integer, - created: Time, - currency: String, - last_card_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - ) -> void - - def to_hash: -> { - available_amount: Integer, - created: Time, - currency: String, - last_card_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - } - end - end - end -end diff --git a/sig/lithic/resources/aggregate_balances.rbs b/sig/lithic/resources/aggregate_balances.rbs deleted file mode 100644 index 2860ab85..00000000 --- a/sig/lithic/resources/aggregate_balances.rbs +++ /dev/null @@ -1,12 +0,0 @@ -module Lithic - module Resources - class AggregateBalances - def list: ( - ?financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type, - ?request_options: Lithic::request_opts - ) -> Lithic::Internal::SinglePage[Lithic::AggregateBalance] - - def initialize: (client: Lithic::Client) -> void - end - end -end diff --git a/sig/lithic/resources/cards.rbs b/sig/lithic/resources/cards.rbs index ab54c670..ef8d2773 100644 --- a/sig/lithic/resources/cards.rbs +++ b/sig/lithic/resources/cards.rbs @@ -1,8 +1,6 @@ module Lithic module Resources class Cards - attr_reader aggregate_balances: Lithic::Resources::Cards::AggregateBalances - attr_reader balances: Lithic::Resources::Cards::Balances attr_reader financial_transactions: Lithic::Resources::Cards::FinancialTransactions diff --git a/sig/lithic/resources/cards/aggregate_balances.rbs b/sig/lithic/resources/cards/aggregate_balances.rbs deleted file mode 100644 index 680f8de0..00000000 --- a/sig/lithic/resources/cards/aggregate_balances.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module Lithic - module Resources - class Cards - class AggregateBalances - def list: ( - ?account_token: String, - ?business_account_token: String, - ?request_options: Lithic::request_opts - ) -> Lithic::Internal::SinglePage[Lithic::Models::Cards::AggregateBalanceListResponse] - - def initialize: (client: Lithic::Client) -> void - end - end - end -end diff --git a/test/lithic/resources/aggregate_balances_test.rb b/test/lithic/resources/aggregate_balances_test.rb deleted file mode 100644 index 531f4c0a..00000000 --- a/test/lithic/resources/aggregate_balances_test.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class Lithic::Test::Resources::AggregateBalancesTest < Lithic::Test::ResourceTest - def test_list - response = @lithic.aggregate_balances.list - - assert_pattern do - response => Lithic::Internal::SinglePage - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => Lithic::AggregateBalance - end - - assert_pattern do - row => { - available_amount: Integer, - created: Time, - currency: String, - financial_account_type: Lithic::AggregateBalance::FinancialAccountType, - last_financial_account_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - } - end - end -end diff --git a/test/lithic/resources/cards/aggregate_balances_test.rb b/test/lithic/resources/cards/aggregate_balances_test.rb deleted file mode 100644 index 999c13e8..00000000 --- a/test/lithic/resources/cards/aggregate_balances_test.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class Lithic::Test::Resources::Cards::AggregateBalancesTest < Lithic::Test::ResourceTest - def test_list - response = @lithic.cards.aggregate_balances.list - - assert_pattern do - response => Lithic::Internal::SinglePage - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => Lithic::Models::Cards::AggregateBalanceListResponse - end - - assert_pattern do - row => { - available_amount: Integer, - created: Time, - currency: String, - last_card_token: String, - last_transaction_event_token: String, - last_transaction_token: String, - pending_amount: Integer, - total_amount: Integer, - updated: Time - } - end - end -end From 86db080240382ba1cd73af9a01c89379cfb8e330 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 21:12:48 +0000 Subject: [PATCH 2/7] fix: calling `break` out of streams should be instantaneous --- .../transport/pooled_net_requester.rb | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/lithic/internal/transport/pooled_net_requester.rb b/lib/lithic/internal/transport/pooled_net_requester.rb index 1d151cc9..b24863bd 100644 --- a/lib/lithic/internal/transport/pooled_net_requester.rb +++ b/lib/lithic/internal/transport/pooled_net_requester.rb @@ -153,17 +153,19 @@ def execute(request) end self.class.calibrate_socket_timeout(conn, deadline) - conn.request(req) do |rsp| - y << [req, rsp] - break if finished - - rsp.read_body do |bytes| - y << bytes.force_encoding(Encoding::BINARY) - break if finished - - self.class.calibrate_socket_timeout(conn, deadline) + ::Kernel.catch(:jump) do + conn.request(req) do |rsp| + y << [req, rsp] + ::Kernel.throw(:jump) if finished + + rsp.read_body do |bytes| + y << bytes.force_encoding(Encoding::BINARY) + ::Kernel.throw(:jump) if finished + + self.class.calibrate_socket_timeout(conn, deadline) + end + eof = true end - eof = true end end ensure From 9c9d63b07badd9fdd107314ac0bd5c8c23ddd0c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 18:54:00 +0000 Subject: [PATCH 3/7] fix: issue where json.parse errors when receiving HTTP 204 with nobody --- lib/lithic/internal/util.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/lithic/internal/util.rb b/lib/lithic/internal/util.rb index 50b9f0a9..30350605 100644 --- a/lib/lithic/internal/util.rb +++ b/lib/lithic/internal/util.rb @@ -657,7 +657,8 @@ def force_charset!(content_type, text:) def decode_content(headers, stream:, suppress_error: false) case (content_type = headers["content-type"]) in Lithic::Internal::Util::JSON_CONTENT - json = stream.to_a.join + return nil if (json = stream.to_a.join).empty? + begin JSON.parse(json, symbolize_names: true) rescue JSON::ParserError => e @@ -667,7 +668,11 @@ def decode_content(headers, stream:, suppress_error: false) in Lithic::Internal::Util::JSONL_CONTENT lines = decode_lines(stream) chain_fused(lines) do |y| - lines.each { y << JSON.parse(_1, symbolize_names: true) } + lines.each do + next if _1.empty? + + y << JSON.parse(_1, symbolize_names: true) + end end in %r{^text/event-stream} lines = decode_lines(stream) From 0bad1d9ef7b439a1be19b68af67abb6e66e5c53f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 10:12:59 +0000 Subject: [PATCH 4/7] feat(api): add external_id to payment_event feat(api): add get /v1/transfer_limits endpoint feat(api): add post /v1/book_transfers/{book_transfer_token}/retry endpoint --- .stats.yml | 8 +- lib/lithic.rb | 4 + lib/lithic/client.rb | 4 + lib/lithic/models.rb | 6 + .../models/book_transfer_retry_params.rb | 22 + lib/lithic/models/payment.rb | 10 +- .../models/transfer_limit_list_params.rb | 22 + lib/lithic/models/transfer_limits_response.rb | 274 ++++++++ lib/lithic/resources/book_transfers.rb | 24 + lib/lithic/resources/transfer_limits.rb | 37 ++ rbi/lithic/client.rbi | 3 + rbi/lithic/models.rbi | 6 + .../models/book_transfer_retry_params.rbi | 40 ++ rbi/lithic/models/payment.rbi | 14 +- .../models/transfer_limit_list_params.rbi | 43 ++ .../models/transfer_limits_response.rbi | 604 ++++++++++++++++++ rbi/lithic/resources/book_transfers.rbi | 17 + rbi/lithic/resources/transfer_limits.rbi | 28 + sig/lithic/client.rbs | 2 + sig/lithic/models.rbs | 6 + .../models/book_transfer_retry_params.rbs | 23 + sig/lithic/models/payment.rbs | 11 +- .../models/transfer_limit_list_params.rbs | 22 + .../models/transfer_limits_response.rbs | 232 +++++++ sig/lithic/resources/book_transfers.rbs | 6 + sig/lithic/resources/transfer_limits.rbs | 12 + test/lithic/resources/book_transfers_test.rb | 33 + test/lithic/resources/transfer_limits_test.rb | 31 + 28 files changed, 1533 insertions(+), 11 deletions(-) create mode 100644 lib/lithic/models/book_transfer_retry_params.rb create mode 100644 lib/lithic/models/transfer_limit_list_params.rb create mode 100644 lib/lithic/models/transfer_limits_response.rb create mode 100644 lib/lithic/resources/transfer_limits.rb create mode 100644 rbi/lithic/models/book_transfer_retry_params.rbi create mode 100644 rbi/lithic/models/transfer_limit_list_params.rbi create mode 100644 rbi/lithic/models/transfer_limits_response.rbi create mode 100644 rbi/lithic/resources/transfer_limits.rbi create mode 100644 sig/lithic/models/book_transfer_retry_params.rbs create mode 100644 sig/lithic/models/transfer_limit_list_params.rbs create mode 100644 sig/lithic/models/transfer_limits_response.rbs create mode 100644 sig/lithic/resources/transfer_limits.rbs create mode 100644 test/lithic/resources/transfer_limits_test.rb diff --git a/.stats.yml b/.stats.yml index ca0f3ae4..15f16473 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 174 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4fd8048b287f409ad2b91f7d0f0b7fc13cc9bc4ccc7859666f21203bab3d2f01.yml -openapi_spec_hash: a554c54d96a7604a770b6a8b1df46395 -config_hash: df0af4ff639b8a6923a6244d2247910c +configured_endpoints: 176 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1916ba0e95ce59f0feeebd6f3d2130990c812be7eabcda6e23c5fa096db912c7.yml +openapi_spec_hash: b465e7cb5c2dee36b5bdc6d540b2a530 +config_hash: a8a802e2c916a5d36a025bf64ab55ee7 diff --git a/lib/lithic.rb b/lib/lithic.rb index 1146bbfc..f0bc9a3b 100644 --- a/lib/lithic.rb +++ b/lib/lithic.rb @@ -147,6 +147,7 @@ require_relative "lithic/models/book_transfer_create_params" require_relative "lithic/models/book_transfer_list_params" require_relative "lithic/models/book_transfer_retrieve_params" +require_relative "lithic/models/book_transfer_retry_params" require_relative "lithic/models/book_transfer_reverse_params" require_relative "lithic/models/book_transfer_transaction_created_webhook_event" require_relative "lithic/models/book_transfer_transaction_updated_webhook_event" @@ -419,6 +420,8 @@ require_relative "lithic/models/transaction_simulate_void_response" require_relative "lithic/models/transfer" require_relative "lithic/models/transfer_create_params" +require_relative "lithic/models/transfer_limit_list_params" +require_relative "lithic/models/transfer_limits_response" require_relative "lithic/models/verification_method" require_relative "lithic/models/wallet_decisioning_info" require_relative "lithic/models/webhook_parsed_params" @@ -477,5 +480,6 @@ require_relative "lithic/resources/transactions/enhanced_commercial_data" require_relative "lithic/resources/transactions/events" require_relative "lithic/resources/transactions/events/enhanced_commercial_data" +require_relative "lithic/resources/transfer_limits" require_relative "lithic/resources/transfers" require_relative "lithic/resources/webhooks" diff --git a/lib/lithic/client.rb b/lib/lithic/client.rb index 2c887ab1..2925a93e 100644 --- a/lib/lithic/client.rb +++ b/lib/lithic/client.rb @@ -116,6 +116,9 @@ class Client < Lithic::Internal::Transport::BaseClient # @return [Lithic::Resources::AccountActivity] attr_reader :account_activity + # @return [Lithic::Resources::TransferLimits] + attr_reader :transfer_limits + # @return [Lithic::Resources::Webhooks] attr_reader :webhooks @@ -224,6 +227,7 @@ def initialize( @fraud = Lithic::Resources::Fraud.new(client: self) @network_programs = Lithic::Resources::NetworkPrograms.new(client: self) @account_activity = Lithic::Resources::AccountActivity.new(client: self) + @transfer_limits = Lithic::Resources::TransferLimits.new(client: self) @webhooks = Lithic::Resources::Webhooks.new(client: self) end end diff --git a/lib/lithic/models.rb b/lib/lithic/models.rb index e9471545..9a31752d 100644 --- a/lib/lithic/models.rb +++ b/lib/lithic/models.rb @@ -118,6 +118,8 @@ module Lithic BookTransferRetrieveParams = Lithic::Models::BookTransferRetrieveParams + BookTransferRetryParams = Lithic::Models::BookTransferRetryParams + BookTransferReverseParams = Lithic::Models::BookTransferReverseParams BookTransferTransactionCreatedWebhookEvent = Lithic::Models::BookTransferTransactionCreatedWebhookEvent @@ -558,6 +560,10 @@ module Lithic TransferCreateParams = Lithic::Models::TransferCreateParams + TransferLimitListParams = Lithic::Models::TransferLimitListParams + + TransferLimitsResponse = Lithic::Models::TransferLimitsResponse + VerificationMethod = Lithic::Models::VerificationMethod WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo diff --git a/lib/lithic/models/book_transfer_retry_params.rb b/lib/lithic/models/book_transfer_retry_params.rb new file mode 100644 index 00000000..bae69adc --- /dev/null +++ b/lib/lithic/models/book_transfer_retry_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::BookTransfers#retry_ + class BookTransferRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute retry_token + # Globally unique identifier for the retry. + # + # @return [String] + required :retry_token, String + + # @!method initialize(retry_token:, request_options: {}) + # @param retry_token [String] Globally unique identifier for the retry. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb index 53af3a40..fe415823 100644 --- a/lib/lithic/models/payment.rb +++ b/lib/lithic/models/payment.rb @@ -289,7 +289,13 @@ class Event < Lithic::Internal::Type::BaseModel optional :detailed_results, -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Payment::Event::DetailedResult] } - # @!method initialize(token:, amount:, created:, result:, type:, detailed_results: nil) + # @!attribute external_id + # Payment event external ID, for example, ACH trace number. + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!method initialize(token:, amount:, created:, result:, type:, detailed_results: nil, external_id: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::Payment::Event} for more details. # @@ -306,6 +312,8 @@ class Event < Lithic::Internal::Type::BaseModel # @param type [Symbol, Lithic::Models::Payment::Event::Type] Event types: # # @param detailed_results [Array] More detailed reasons for the event + # + # @param external_id [String, nil] Payment event external ID, for example, ACH trace number. # APPROVED financial events were successful while DECLINED financial events were # declined by user, Lithic, or the network. diff --git a/lib/lithic/models/transfer_limit_list_params.rb b/lib/lithic/models/transfer_limit_list_params.rb new file mode 100644 index 00000000..b9685cfe --- /dev/null +++ b/lib/lithic/models/transfer_limit_list_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::TransferLimits#list + class TransferLimitListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute date + # Date for which to retrieve transfer limits (ISO 8601 format) + # + # @return [Date, nil] + optional :date, Date + + # @!method initialize(date: nil, request_options: {}) + # @param date [Date] Date for which to retrieve transfer limits (ISO 8601 format) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transfer_limits_response.rb b/lib/lithic/models/transfer_limits_response.rb new file mode 100644 index 00000000..a8899eaf --- /dev/null +++ b/lib/lithic/models/transfer_limits_response.rb @@ -0,0 +1,274 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransferLimitsResponse < Lithic::Internal::Type::BaseModel + # @!attribute data + # List of transfer limits + # + # @return [Array] + required :data, -> { Lithic::Internal::Type::ArrayOf[Lithic::TransferLimitsResponse::Data] } + + # @!attribute has_more + # Whether there are more transfer limits + # + # @return [Boolean] + required :has_more, Lithic::Internal::Type::Boolean + + # @!method initialize(data:, has_more:) + # @param data [Array] List of transfer limits + # + # @param has_more [Boolean] Whether there are more transfer limits + + class Data < Lithic::Internal::Type::BaseModel + # @!attribute company_id + # Company ID + # + # @return [String] + required :company_id, String + + # @!attribute daily_limit + # Daily limits with progress + # + # @return [Lithic::Models::TransferLimitsResponse::Data::DailyLimit] + required :daily_limit, -> { Lithic::TransferLimitsResponse::Data::DailyLimit } + + # @!attribute date + # The date for the limit view (ISO format) + # + # @return [Date] + required :date, Date + + # @!attribute is_fbo + # Whether the company is a FBO; based on the company ID prefix + # + # @return [Boolean] + required :is_fbo, Lithic::Internal::Type::Boolean + + # @!attribute monthly_limit + # Monthly limits with progress + # + # @return [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit] + required :monthly_limit, -> { Lithic::TransferLimitsResponse::Data::MonthlyLimit } + + # @!attribute program_limit_per_transaction + # Program transaction limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction] + required :program_limit_per_transaction, + -> { Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction } + + # @!method initialize(company_id:, daily_limit:, date:, is_fbo:, monthly_limit:, program_limit_per_transaction:) + # @param company_id [String] Company ID + # + # @param daily_limit [Lithic::Models::TransferLimitsResponse::Data::DailyLimit] Daily limits with progress + # + # @param date [Date] The date for the limit view (ISO format) + # + # @param is_fbo [Boolean] Whether the company is a FBO; based on the company ID prefix + # + # @param monthly_limit [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit] Monthly limits with progress + # + # @param program_limit_per_transaction [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction] Program transaction limits + + # @see Lithic::Models::TransferLimitsResponse::Data#daily_limit + class DailyLimit < Lithic::Internal::Type::BaseModel + # @!attribute credit + # Credit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::DailyLimit::Credit] + required :credit, -> { Lithic::TransferLimitsResponse::Data::DailyLimit::Credit } + + # @!attribute debit + # Debit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::DailyLimit::Debit] + required :debit, -> { Lithic::TransferLimitsResponse::Data::DailyLimit::Debit } + + # @!method initialize(credit:, debit:) + # Daily limits with progress + # + # @param credit [Lithic::Models::TransferLimitsResponse::Data::DailyLimit::Credit] Credit limits + # + # @param debit [Lithic::Models::TransferLimitsResponse::Data::DailyLimit::Debit] Debit limits + + # @see Lithic::Models::TransferLimitsResponse::Data::DailyLimit#credit + class Credit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer + + # @!method initialize(limit:, amount_originated: nil) + # Credit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer] Amount originated towards limit + end + + # @see Lithic::Models::TransferLimitsResponse::Data::DailyLimit#debit + class Debit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer + + # @!method initialize(limit:, amount_originated: nil) + # Debit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer] Amount originated towards limit + end + end + + # @see Lithic::Models::TransferLimitsResponse::Data#monthly_limit + class MonthlyLimit < Lithic::Internal::Type::BaseModel + # @!attribute credit + # Credit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit::Credit] + required :credit, -> { Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit } + + # @!attribute debit + # Debit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit::Debit] + required :debit, -> { Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit } + + # @!method initialize(credit:, debit:) + # Monthly limits with progress + # + # @param credit [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit::Credit] Credit limits + # + # @param debit [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit::Debit] Debit limits + + # @see Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit#credit + class Credit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer + + # @!method initialize(limit:, amount_originated: nil) + # Credit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer] Amount originated towards limit + end + + # @see Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit#debit + class Debit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer + + # @!method initialize(limit:, amount_originated: nil) + # Debit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer] Amount originated towards limit + end + end + + # @see Lithic::Models::TransferLimitsResponse::Data#program_limit_per_transaction + class ProgramLimitPerTransaction < Lithic::Internal::Type::BaseModel + # @!attribute credit + # Credit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit] + required :credit, -> { Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit } + + # @!attribute debit + # Debit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit] + required :debit, -> { Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit } + + # @!method initialize(credit:, debit:) + # Program transaction limits + # + # @param credit [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit] Credit limits + # + # @param debit [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit] Debit limits + + # @see Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction#credit + class Credit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer + + # @!method initialize(limit:, amount_originated: nil) + # Credit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer] Amount originated towards limit + end + + # @see Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction#debit + class Debit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer + + # @!method initialize(limit:, amount_originated: nil) + # Debit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer] Amount originated towards limit + end + end + end + end + end +end diff --git a/lib/lithic/resources/book_transfers.rb b/lib/lithic/resources/book_transfers.rb index fc39e345..8ca9d729 100644 --- a/lib/lithic/resources/book_transfers.rb +++ b/lib/lithic/resources/book_transfers.rb @@ -113,6 +113,30 @@ def list(params = {}) ) end + # Retry a book transfer that has been declined + # + # @overload retry_(book_transfer_token, retry_token:, request_options: {}) + # + # @param book_transfer_token [String] Token of the book transfer to retry + # + # @param retry_token [String] Globally unique identifier for the retry. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::BookTransferResponse] + # + # @see Lithic::Models::BookTransferRetryParams + def retry_(book_transfer_token, params) + parsed, options = Lithic::BookTransferRetryParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/book_transfers/%1$s/retry", book_transfer_token], + body: parsed, + model: Lithic::BookTransferResponse, + options: options + ) + end + # Reverse a book transfer # # @overload reverse(book_transfer_token, memo: nil, request_options: {}) diff --git a/lib/lithic/resources/transfer_limits.rb b/lib/lithic/resources/transfer_limits.rb new file mode 100644 index 00000000..8bb97464 --- /dev/null +++ b/lib/lithic/resources/transfer_limits.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TransferLimits + # Get transfer limits for a specified date + # + # @overload list(date: nil, request_options: {}) + # + # @param date [Date] Date for which to retrieve transfer limits (ISO 8601 format) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::TransferLimitListParams + def list(params = {}) + parsed, options = Lithic::TransferLimitListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/transfer_limits", + query: parsed, + page: Lithic::Internal::SinglePage, + model: Lithic::TransferLimitsResponse::Data, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/rbi/lithic/client.rbi b/rbi/lithic/client.rbi index 84b68550..61eb71d1 100644 --- a/rbi/lithic/client.rbi +++ b/rbi/lithic/client.rbi @@ -115,6 +115,9 @@ module Lithic sig { returns(Lithic::Resources::AccountActivity) } attr_reader :account_activity + sig { returns(Lithic::Resources::TransferLimits) } + attr_reader :transfer_limits + sig { returns(Lithic::Resources::Webhooks) } attr_reader :webhooks diff --git a/rbi/lithic/models.rbi b/rbi/lithic/models.rbi index 05625430..ad82e6de 100644 --- a/rbi/lithic/models.rbi +++ b/rbi/lithic/models.rbi @@ -93,6 +93,8 @@ module Lithic BookTransferRetrieveParams = Lithic::Models::BookTransferRetrieveParams + BookTransferRetryParams = Lithic::Models::BookTransferRetryParams + BookTransferReverseParams = Lithic::Models::BookTransferReverseParams BookTransferTransactionCreatedWebhookEvent = @@ -588,6 +590,10 @@ module Lithic TransferCreateParams = Lithic::Models::TransferCreateParams + TransferLimitListParams = Lithic::Models::TransferLimitListParams + + TransferLimitsResponse = Lithic::Models::TransferLimitsResponse + VerificationMethod = Lithic::Models::VerificationMethod WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo diff --git a/rbi/lithic/models/book_transfer_retry_params.rbi b/rbi/lithic/models/book_transfer_retry_params.rbi new file mode 100644 index 00000000..b4bc3f26 --- /dev/null +++ b/rbi/lithic/models/book_transfer_retry_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + class BookTransferRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::BookTransferRetryParams, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for the retry. + sig { returns(String) } + attr_accessor :retry_token + + sig do + params( + retry_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the retry. + retry_token:, + request_options: {} + ) + end + + sig do + override.returns( + { retry_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment.rbi b/rbi/lithic/models/payment.rbi index 0c7f33bf..50650cd9 100644 --- a/rbi/lithic/models/payment.rbi +++ b/rbi/lithic/models/payment.rbi @@ -357,6 +357,10 @@ module Lithic end attr_writer :detailed_results + # Payment event external ID, for example, ACH trace number. + sig { returns(T.nilable(String)) } + attr_accessor :external_id + # Payment Event sig do params( @@ -366,7 +370,8 @@ module Lithic result: Lithic::Payment::Event::Result::OrSymbol, type: Lithic::Payment::Event::Type::OrSymbol, detailed_results: - T::Array[Lithic::Payment::Event::DetailedResult::OrSymbol] + T::Array[Lithic::Payment::Event::DetailedResult::OrSymbol], + external_id: T.nilable(String) ).returns(T.attached_class) end def self.new( @@ -406,7 +411,9 @@ module Lithic # Financial Institution. type:, # More detailed reasons for the event - detailed_results: nil + detailed_results: nil, + # Payment event external ID, for example, ACH trace number. + external_id: nil ) end @@ -419,7 +426,8 @@ module Lithic result: Lithic::Payment::Event::Result::TaggedSymbol, type: Lithic::Payment::Event::Type::TaggedSymbol, detailed_results: - T::Array[Lithic::Payment::Event::DetailedResult::TaggedSymbol] + T::Array[Lithic::Payment::Event::DetailedResult::TaggedSymbol], + external_id: T.nilable(String) } ) end diff --git a/rbi/lithic/models/transfer_limit_list_params.rbi b/rbi/lithic/models/transfer_limit_list_params.rbi new file mode 100644 index 00000000..4d04f197 --- /dev/null +++ b/rbi/lithic/models/transfer_limit_list_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + class TransferLimitListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TransferLimitListParams, Lithic::Internal::AnyHash) + end + + # Date for which to retrieve transfer limits (ISO 8601 format) + sig { returns(T.nilable(Date)) } + attr_reader :date + + sig { params(date: Date).void } + attr_writer :date + + sig do + params( + date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date for which to retrieve transfer limits (ISO 8601 format) + date: nil, + request_options: {} + ) + end + + sig do + override.returns( + { date: Date, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transfer_limits_response.rbi b/rbi/lithic/models/transfer_limits_response.rbi new file mode 100644 index 00000000..53a2d402 --- /dev/null +++ b/rbi/lithic/models/transfer_limits_response.rbi @@ -0,0 +1,604 @@ +# typed: strong + +module Lithic + module Models + class TransferLimitsResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::TransferLimitsResponse, Lithic::Internal::AnyHash) + end + + # List of transfer limits + sig { returns(T::Array[Lithic::TransferLimitsResponse::Data]) } + attr_accessor :data + + # Whether there are more transfer limits + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig do + params( + data: T::Array[Lithic::TransferLimitsResponse::Data::OrHash], + has_more: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # List of transfer limits + data:, + # Whether there are more transfer limits + has_more: + ) + end + + sig do + override.returns( + { + data: T::Array[Lithic::TransferLimitsResponse::Data], + has_more: T::Boolean + } + ) + end + def to_hash + end + + class Data < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data, + Lithic::Internal::AnyHash + ) + end + + # Company ID + sig { returns(String) } + attr_accessor :company_id + + # Daily limits with progress + sig { returns(Lithic::TransferLimitsResponse::Data::DailyLimit) } + attr_reader :daily_limit + + sig do + params( + daily_limit: + Lithic::TransferLimitsResponse::Data::DailyLimit::OrHash + ).void + end + attr_writer :daily_limit + + # The date for the limit view (ISO format) + sig { returns(Date) } + attr_accessor :date + + # Whether the company is a FBO; based on the company ID prefix + sig { returns(T::Boolean) } + attr_accessor :is_fbo + + # Monthly limits with progress + sig { returns(Lithic::TransferLimitsResponse::Data::MonthlyLimit) } + attr_reader :monthly_limit + + sig do + params( + monthly_limit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::OrHash + ).void + end + attr_writer :monthly_limit + + # Program transaction limits + sig do + returns( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + ) + end + attr_reader :program_limit_per_transaction + + sig do + params( + program_limit_per_transaction: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::OrHash + ).void + end + attr_writer :program_limit_per_transaction + + sig do + params( + company_id: String, + daily_limit: + Lithic::TransferLimitsResponse::Data::DailyLimit::OrHash, + date: Date, + is_fbo: T::Boolean, + monthly_limit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::OrHash, + program_limit_per_transaction: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::OrHash + ).returns(T.attached_class) + end + def self.new( + # Company ID + company_id:, + # Daily limits with progress + daily_limit:, + # The date for the limit view (ISO format) + date:, + # Whether the company is a FBO; based on the company ID prefix + is_fbo:, + # Monthly limits with progress + monthly_limit:, + # Program transaction limits + program_limit_per_transaction: + ) + end + + sig do + override.returns( + { + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: T::Boolean, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + } + ) + end + def to_hash + end + + class DailyLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::DailyLimit, + Lithic::Internal::AnyHash + ) + end + + # Credit limits + sig do + returns(Lithic::TransferLimitsResponse::Data::DailyLimit::Credit) + end + attr_reader :credit + + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Credit::OrHash + ).void + end + attr_writer :credit + + # Debit limits + sig do + returns(Lithic::TransferLimitsResponse::Data::DailyLimit::Debit) + end + attr_reader :debit + + sig do + params( + debit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Debit::OrHash + ).void + end + attr_writer :debit + + # Daily limits with progress + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Credit::OrHash, + debit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Debit::OrHash + ).returns(T.attached_class) + end + def self.new( + # Credit limits + credit:, + # Debit limits + debit: + ) + end + + sig do + override.returns( + { + credit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + } + ) + end + def to_hash + end + + class Credit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_reader :amount_originated + + sig { params(amount_originated: Integer).void } + attr_writer :amount_originated + + # Credit limits + sig do + params(limit: Integer, amount_originated: Integer).returns( + T.attached_class + ) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns({ limit: Integer, amount_originated: Integer }) + end + def to_hash + end + end + + class Debit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::DailyLimit::Debit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_reader :amount_originated + + sig { params(amount_originated: Integer).void } + attr_writer :amount_originated + + # Debit limits + sig do + params(limit: Integer, amount_originated: Integer).returns( + T.attached_class + ) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns({ limit: Integer, amount_originated: Integer }) + end + def to_hash + end + end + end + + class MonthlyLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::MonthlyLimit, + Lithic::Internal::AnyHash + ) + end + + # Credit limits + sig do + returns(Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit) + end + attr_reader :credit + + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit::OrHash + ).void + end + attr_writer :credit + + # Debit limits + sig do + returns(Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit) + end + attr_reader :debit + + sig do + params( + debit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit::OrHash + ).void + end + attr_writer :debit + + # Monthly limits with progress + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit::OrHash, + debit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit::OrHash + ).returns(T.attached_class) + end + def self.new( + # Credit limits + credit:, + # Debit limits + debit: + ) + end + + sig do + override.returns( + { + credit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + } + ) + end + def to_hash + end + + class Credit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_reader :amount_originated + + sig { params(amount_originated: Integer).void } + attr_writer :amount_originated + + # Credit limits + sig do + params(limit: Integer, amount_originated: Integer).returns( + T.attached_class + ) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns({ limit: Integer, amount_originated: Integer }) + end + def to_hash + end + end + + class Debit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_reader :amount_originated + + sig { params(amount_originated: Integer).void } + attr_writer :amount_originated + + # Debit limits + sig do + params(limit: Integer, amount_originated: Integer).returns( + T.attached_class + ) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns({ limit: Integer, amount_originated: Integer }) + end + def to_hash + end + end + end + + class ProgramLimitPerTransaction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction, + Lithic::Internal::AnyHash + ) + end + + # Credit limits + sig do + returns( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit + ) + end + attr_reader :credit + + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit::OrHash + ).void + end + attr_writer :credit + + # Debit limits + sig do + returns( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + ) + end + attr_reader :debit + + sig do + params( + debit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit::OrHash + ).void + end + attr_writer :debit + + # Program transaction limits + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit::OrHash, + debit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit::OrHash + ).returns(T.attached_class) + end + def self.new( + # Credit limits + credit:, + # Debit limits + debit: + ) + end + + sig do + override.returns( + { + credit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + debit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + } + ) + end + def to_hash + end + + class Credit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_reader :amount_originated + + sig { params(amount_originated: Integer).void } + attr_writer :amount_originated + + # Credit limits + sig do + params(limit: Integer, amount_originated: Integer).returns( + T.attached_class + ) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns({ limit: Integer, amount_originated: Integer }) + end + def to_hash + end + end + + class Debit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_reader :amount_originated + + sig { params(amount_originated: Integer).void } + attr_writer :amount_originated + + # Debit limits + sig do + params(limit: Integer, amount_originated: Integer).returns( + T.attached_class + ) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns({ limit: Integer, amount_originated: Integer }) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lithic/resources/book_transfers.rbi b/rbi/lithic/resources/book_transfers.rbi index 0e43dbc8..024aa8fa 100644 --- a/rbi/lithic/resources/book_transfers.rbi +++ b/rbi/lithic/resources/book_transfers.rbi @@ -110,6 +110,23 @@ module Lithic ) end + # Retry a book transfer that has been declined + sig do + params( + book_transfer_token: String, + retry_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::BookTransferResponse) + end + def retry_( + # Token of the book transfer to retry + book_transfer_token, + # Globally unique identifier for the retry. + retry_token:, + request_options: {} + ) + end + # Reverse a book transfer sig do params( diff --git a/rbi/lithic/resources/transfer_limits.rbi b/rbi/lithic/resources/transfer_limits.rbi new file mode 100644 index 00000000..1cc8e669 --- /dev/null +++ b/rbi/lithic/resources/transfer_limits.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Resources + class TransferLimits + # Get transfer limits for a specified date + sig do + params( + date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::SinglePage[Lithic::TransferLimitsResponse::Data] + ) + end + def list( + # Date for which to retrieve transfer limits (ISO 8601 format) + date: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/sig/lithic/client.rbs b/sig/lithic/client.rbs index 208af84b..2f67db75 100644 --- a/sig/lithic/client.rbs +++ b/sig/lithic/client.rbs @@ -77,6 +77,8 @@ module Lithic attr_reader account_activity: Lithic::Resources::AccountActivity + attr_reader transfer_limits: Lithic::Resources::TransferLimits + attr_reader webhooks: Lithic::Resources::Webhooks def api_status: ( diff --git a/sig/lithic/models.rbs b/sig/lithic/models.rbs index 0286675d..6314bf2c 100644 --- a/sig/lithic/models.rbs +++ b/sig/lithic/models.rbs @@ -77,6 +77,8 @@ module Lithic class BookTransferRetrieveParams = Lithic::Models::BookTransferRetrieveParams + class BookTransferRetryParams = Lithic::Models::BookTransferRetryParams + class BookTransferReverseParams = Lithic::Models::BookTransferReverseParams class BookTransferTransactionCreatedWebhookEvent = Lithic::Models::BookTransferTransactionCreatedWebhookEvent @@ -507,6 +509,10 @@ module Lithic class TransferCreateParams = Lithic::Models::TransferCreateParams + class TransferLimitListParams = Lithic::Models::TransferLimitListParams + + class TransferLimitsResponse = Lithic::Models::TransferLimitsResponse + module VerificationMethod = Lithic::Models::VerificationMethod class WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo diff --git a/sig/lithic/models/book_transfer_retry_params.rbs b/sig/lithic/models/book_transfer_retry_params.rbs new file mode 100644 index 00000000..39b32cd1 --- /dev/null +++ b/sig/lithic/models/book_transfer_retry_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type book_transfer_retry_params = + { retry_token: String } & Lithic::Internal::Type::request_parameters + + class BookTransferRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor retry_token: String + + def initialize: ( + retry_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + retry_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs index e92b8e53..cc92de5e 100644 --- a/sig/lithic/models/payment.rbs +++ b/sig/lithic/models/payment.rbs @@ -194,7 +194,8 @@ module Lithic created: Time, result: Lithic::Models::Payment::Event::result, type: Lithic::Models::Payment::Event::type_, - detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result] + detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result], + external_id: String? } class Event < Lithic::Internal::Type::BaseModel @@ -214,13 +215,16 @@ module Lithic ::Array[Lithic::Models::Payment::Event::detailed_result] ) -> ::Array[Lithic::Models::Payment::Event::detailed_result] + attr_accessor external_id: String? + def initialize: ( token: String, amount: Integer, created: Time, result: Lithic::Models::Payment::Event::result, type: Lithic::Models::Payment::Event::type_, - ?detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result] + ?detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result], + ?external_id: String? ) -> void def to_hash: -> { @@ -229,7 +233,8 @@ module Lithic created: Time, result: Lithic::Models::Payment::Event::result, type: Lithic::Models::Payment::Event::type_, - detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result] + detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result], + external_id: String? } type result = :APPROVED | :DECLINED diff --git a/sig/lithic/models/transfer_limit_list_params.rbs b/sig/lithic/models/transfer_limit_list_params.rbs new file mode 100644 index 00000000..cedc1844 --- /dev/null +++ b/sig/lithic/models/transfer_limit_list_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type transfer_limit_list_params = + { date: Date } & Lithic::Internal::Type::request_parameters + + class TransferLimitListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader date: Date? + + def date=: (Date) -> Date + + def initialize: ( + ?date: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { date: Date, request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/transfer_limits_response.rbs b/sig/lithic/models/transfer_limits_response.rbs new file mode 100644 index 00000000..71eaca8c --- /dev/null +++ b/sig/lithic/models/transfer_limits_response.rbs @@ -0,0 +1,232 @@ +module Lithic + module Models + type transfer_limits_response = + { data: ::Array[Lithic::TransferLimitsResponse::Data], has_more: bool } + + class TransferLimitsResponse < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::TransferLimitsResponse::Data] + + attr_accessor has_more: bool + + def initialize: ( + data: ::Array[Lithic::TransferLimitsResponse::Data], + has_more: bool + ) -> void + + def to_hash: -> { + data: ::Array[Lithic::TransferLimitsResponse::Data], + has_more: bool + } + + type data = + { + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: bool, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + } + + class Data < Lithic::Internal::Type::BaseModel + attr_accessor company_id: String + + attr_accessor daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit + + attr_accessor date: Date + + attr_accessor is_fbo: bool + + attr_accessor monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit + + attr_accessor program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + + def initialize: ( + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: bool, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + ) -> void + + def to_hash: -> { + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: bool, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + } + + type daily_limit = + { + credit: Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + } + + class DailyLimit < Lithic::Internal::Type::BaseModel + attr_accessor credit: Lithic::TransferLimitsResponse::Data::DailyLimit::Credit + + attr_accessor debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + + def initialize: ( + credit: Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + ) -> void + + def to_hash: -> { + credit: Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + } + + type credit = { limit: Integer, amount_originated: Integer } + + class Credit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_reader amount_originated: Integer? + + def amount_originated=: (Integer) -> Integer + + def initialize: ( + limit: Integer, + ?amount_originated: Integer + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer } + end + + type debit = { limit: Integer, amount_originated: Integer } + + class Debit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_reader amount_originated: Integer? + + def amount_originated=: (Integer) -> Integer + + def initialize: ( + limit: Integer, + ?amount_originated: Integer + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer } + end + end + + type monthly_limit = + { + credit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + } + + class MonthlyLimit < Lithic::Internal::Type::BaseModel + attr_accessor credit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit + + attr_accessor debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + + def initialize: ( + credit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + ) -> void + + def to_hash: -> { + credit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + } + + type credit = { limit: Integer, amount_originated: Integer } + + class Credit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_reader amount_originated: Integer? + + def amount_originated=: (Integer) -> Integer + + def initialize: ( + limit: Integer, + ?amount_originated: Integer + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer } + end + + type debit = { limit: Integer, amount_originated: Integer } + + class Debit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_reader amount_originated: Integer? + + def amount_originated=: (Integer) -> Integer + + def initialize: ( + limit: Integer, + ?amount_originated: Integer + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer } + end + end + + type program_limit_per_transaction = + { + credit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + debit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + } + + class ProgramLimitPerTransaction < Lithic::Internal::Type::BaseModel + attr_accessor credit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit + + attr_accessor debit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + + def initialize: ( + credit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + debit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + ) -> void + + def to_hash: -> { + credit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + debit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + } + + type credit = { limit: Integer, amount_originated: Integer } + + class Credit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_reader amount_originated: Integer? + + def amount_originated=: (Integer) -> Integer + + def initialize: ( + limit: Integer, + ?amount_originated: Integer + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer } + end + + type debit = { limit: Integer, amount_originated: Integer } + + class Debit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_reader amount_originated: Integer? + + def amount_originated=: (Integer) -> Integer + + def initialize: ( + limit: Integer, + ?amount_originated: Integer + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer } + end + end + end + end + end +end diff --git a/sig/lithic/resources/book_transfers.rbs b/sig/lithic/resources/book_transfers.rbs index 54bf3f2b..0db8c87f 100644 --- a/sig/lithic/resources/book_transfers.rbs +++ b/sig/lithic/resources/book_transfers.rbs @@ -35,6 +35,12 @@ module Lithic ?request_options: Lithic::request_opts ) -> Lithic::Internal::CursorPage[Lithic::BookTransferResponse] + def retry_: ( + String book_transfer_token, + retry_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::BookTransferResponse + def reverse: ( String book_transfer_token, ?memo: String, diff --git a/sig/lithic/resources/transfer_limits.rbs b/sig/lithic/resources/transfer_limits.rbs new file mode 100644 index 00000000..a8c8c553 --- /dev/null +++ b/sig/lithic/resources/transfer_limits.rbs @@ -0,0 +1,12 @@ +module Lithic + module Resources + class TransferLimits + def list: ( + ?date: Date, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::TransferLimitsResponse::Data] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/test/lithic/resources/book_transfers_test.rb b/test/lithic/resources/book_transfers_test.rb index 272ef0c2..5d1294bb 100644 --- a/test/lithic/resources/book_transfers_test.rb +++ b/test/lithic/resources/book_transfers_test.rb @@ -105,6 +105,39 @@ def test_list end end + def test_retry__required_params + response = + @lithic.book_transfers.retry_( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + retry_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::BookTransferResponse + end + + assert_pattern do + response => { + token: String, + category: Lithic::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event]), + family: Symbol, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status, + to_financial_account_token: String, + updated: Time, + external_id: String | nil, + external_resource: Lithic::ExternalResource | nil, + transaction_series: Lithic::BookTransferResponse::TransactionSeries | nil + } + end + end + def test_reverse response = @lithic.book_transfers.reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/test/lithic/resources/transfer_limits_test.rb b/test/lithic/resources/transfer_limits_test.rb new file mode 100644 index 00000000..a4326c87 --- /dev/null +++ b/test/lithic/resources/transfer_limits_test.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TransferLimitsTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.transfer_limits.list + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::TransferLimitsResponse::Data + end + + assert_pattern do + row => { + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: Lithic::Internal::Type::Boolean, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + } + end + end +end From 832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 09:32:16 +0000 Subject: [PATCH 5/7] feat(api): add WIRE_DRAWDOWN_REQUEST transfer type docs(api): clarify description of token / retry_token when it serves as idempotency key feat(api): remove unnecessary X-Lithic-Pagination header --- .stats.yml | 6 +++--- lib/lithic/client.rb | 7 +------ lib/lithic/models/book_transfer_retry_params.rb | 8 ++++++-- .../models/external_payment_create_params.rb | 16 +++++++++++++++- .../models/management_operation_create_params.rb | 7 ++++++- lib/lithic/models/payment.rb | 1 + lib/lithic/resources/book_transfers.rb | 5 ++++- lib/lithic/resources/external_payments.rb | 14 +++++++++++++- lib/lithic/resources/management_operations.rb | 5 ++++- rbi/lithic/models/book_transfer_retry_params.rbi | 6 ++++-- .../models/external_payment_create_params.rbi | 4 ++++ .../management_operation_create_params.rbi | 4 ++++ rbi/lithic/models/payment.rbi | 2 ++ rbi/lithic/resources/book_transfers.rbi | 3 ++- rbi/lithic/resources/external_payments.rbi | 2 ++ rbi/lithic/resources/management_operations.rbi | 2 ++ sig/lithic/models/payment.rbs | 2 ++ 17 files changed, 75 insertions(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index 15f16473..f9404c37 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1916ba0e95ce59f0feeebd6f3d2130990c812be7eabcda6e23c5fa096db912c7.yml -openapi_spec_hash: b465e7cb5c2dee36b5bdc6d540b2a530 -config_hash: a8a802e2c916a5d36a025bf64ab55ee7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-854de7cc8f79e150ffe98f038ce9f39367010b2bdfffc9992be2738697dc4880.yml +openapi_spec_hash: fd471b20f3eda1e00cdebf028cbfe867 +config_hash: 9dddee5f7af579864599849cb28a0770 diff --git a/lib/lithic/client.rb b/lib/lithic/client.rb index 2925a93e..38a4fa92 100644 --- a/lib/lithic/client.rb +++ b/lib/lithic/client.rb @@ -181,10 +181,6 @@ def initialize( raise ArgumentError.new("api_key is required, and can be set via environ: \"LITHIC_API_KEY\"") end - headers = { - "x-lithic-pagination" => "cursor" - } - @api_key = api_key.to_s super( @@ -192,8 +188,7 @@ def initialize( timeout: timeout, max_retries: max_retries, initial_retry_delay: initial_retry_delay, - max_retry_delay: max_retry_delay, - headers: headers + max_retry_delay: max_retry_delay ) @accounts = Lithic::Resources::Accounts.new(client: self) diff --git a/lib/lithic/models/book_transfer_retry_params.rb b/lib/lithic/models/book_transfer_retry_params.rb index bae69adc..2cf400e4 100644 --- a/lib/lithic/models/book_transfer_retry_params.rb +++ b/lib/lithic/models/book_transfer_retry_params.rb @@ -8,13 +8,17 @@ class BookTransferRetryParams < Lithic::Internal::Type::BaseModel include Lithic::Internal::Type::RequestParameters # @!attribute retry_token - # Globally unique identifier for the retry. + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. # # @return [String] required :retry_token, String # @!method initialize(retry_token:, request_options: {}) - # @param retry_token [String] Globally unique identifier for the retry. + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferRetryParams} for more details. + # + # @param retry_token [String] Customer-provided token that will serve as an idempotency token. This token will # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/lithic/models/external_payment_create_params.rb b/lib/lithic/models/external_payment_create_params.rb index 5e8f1571..7adb232f 100644 --- a/lib/lithic/models/external_payment_create_params.rb +++ b/lib/lithic/models/external_payment_create_params.rb @@ -33,6 +33,8 @@ class ExternalPaymentCreateParams < Lithic::Internal::Type::BaseModel required :payment_type, enum: -> { Lithic::ExternalPaymentCreateParams::PaymentType } # @!attribute token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. # # @return [String, nil] optional :token, String @@ -53,15 +55,27 @@ class ExternalPaymentCreateParams < Lithic::Internal::Type::BaseModel optional :user_defined_id, String # @!method initialize(amount:, category:, effective_date:, financial_account_token:, payment_type:, token: nil, memo: nil, progress_to: nil, user_defined_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalPaymentCreateParams} for more details. + # # @param amount [Integer] + # # @param category [Symbol, Lithic::Models::ExternalPaymentCreateParams::Category] + # # @param effective_date [Date] + # # @param financial_account_token [String] + # # @param payment_type [Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType] - # @param token [String] + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # # @param memo [String] + # # @param progress_to [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo] + # # @param user_defined_id [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] module Category diff --git a/lib/lithic/models/management_operation_create_params.rb b/lib/lithic/models/management_operation_create_params.rb index c3720df5..7aff24b8 100644 --- a/lib/lithic/models/management_operation_create_params.rb +++ b/lib/lithic/models/management_operation_create_params.rb @@ -38,6 +38,8 @@ class ManagementOperationCreateParams < Lithic::Internal::Type::BaseModel required :financial_account_token, String # @!attribute token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. # # @return [String, nil] optional :token, String @@ -64,6 +66,9 @@ class ManagementOperationCreateParams < Lithic::Internal::Type::BaseModel optional :user_defined_id, String # @!method initialize(amount:, category:, direction:, effective_date:, event_type:, financial_account_token:, token: nil, memo: nil, on_closed_account: nil, subtype: nil, user_defined_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ManagementOperationCreateParams} for more details. + # # @param amount [Integer] # # @param category [Symbol, Lithic::Models::ManagementOperationCreateParams::Category] @@ -76,7 +81,7 @@ class ManagementOperationCreateParams < Lithic::Internal::Type::BaseModel # # @param financial_account_token [String] # - # @param token [String] + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will # # @param memo [String] # diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb index fe415823..68b8f367 100644 --- a/lib/lithic/models/payment.rb +++ b/lib/lithic/models/payment.rb @@ -650,6 +650,7 @@ module Type WIRE_INBOUND_ADMIN = :WIRE_INBOUND_ADMIN WIRE_OUTBOUND_PAYMENT = :WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN = :WIRE_OUTBOUND_ADMIN + WIRE_DRAWDOWN_REQUEST = :WIRE_DRAWDOWN_REQUEST # @!method self.values # @return [Array] diff --git a/lib/lithic/resources/book_transfers.rb b/lib/lithic/resources/book_transfers.rb index 8ca9d729..73d21624 100644 --- a/lib/lithic/resources/book_transfers.rb +++ b/lib/lithic/resources/book_transfers.rb @@ -113,13 +113,16 @@ def list(params = {}) ) end + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferRetryParams} for more details. + # # Retry a book transfer that has been declined # # @overload retry_(book_transfer_token, retry_token:, request_options: {}) # # @param book_transfer_token [String] Token of the book transfer to retry # - # @param retry_token [String] Globally unique identifier for the retry. + # @param retry_token [String] Customer-provided token that will serve as an idempotency token. This token will # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/lithic/resources/external_payments.rb b/lib/lithic/resources/external_payments.rb index f95197dd..75a572b3 100644 --- a/lib/lithic/resources/external_payments.rb +++ b/lib/lithic/resources/external_payments.rb @@ -3,19 +3,31 @@ module Lithic module Resources class ExternalPayments + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalPaymentCreateParams} for more details. + # # Create external payment # # @overload create(amount:, category:, effective_date:, financial_account_token:, payment_type:, token: nil, memo: nil, progress_to: nil, user_defined_id: nil, request_options: {}) # # @param amount [Integer] + # # @param category [Symbol, Lithic::Models::ExternalPaymentCreateParams::Category] + # # @param effective_date [Date] + # # @param financial_account_token [String] + # # @param payment_type [Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType] - # @param token [String] + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # # @param memo [String] + # # @param progress_to [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo] + # # @param user_defined_id [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [Lithic::Models::ExternalPayment] diff --git a/lib/lithic/resources/management_operations.rb b/lib/lithic/resources/management_operations.rb index aa4af9b5..6a0c4212 100644 --- a/lib/lithic/resources/management_operations.rb +++ b/lib/lithic/resources/management_operations.rb @@ -3,6 +3,9 @@ module Lithic module Resources class ManagementOperations + # Some parameter documentations has been truncated, see + # {Lithic::Models::ManagementOperationCreateParams} for more details. + # # Create management operation # # @overload create(amount:, category:, direction:, effective_date:, event_type:, financial_account_token:, token: nil, memo: nil, on_closed_account: nil, subtype: nil, user_defined_id: nil, request_options: {}) @@ -19,7 +22,7 @@ class ManagementOperations # # @param financial_account_token [String] # - # @param token [String] + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will # # @param memo [String] # diff --git a/rbi/lithic/models/book_transfer_retry_params.rbi b/rbi/lithic/models/book_transfer_retry_params.rbi index b4bc3f26..cae34f2c 100644 --- a/rbi/lithic/models/book_transfer_retry_params.rbi +++ b/rbi/lithic/models/book_transfer_retry_params.rbi @@ -11,7 +11,8 @@ module Lithic T.any(Lithic::BookTransferRetryParams, Lithic::Internal::AnyHash) end - # Globally unique identifier for the retry. + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. sig { returns(String) } attr_accessor :retry_token @@ -22,7 +23,8 @@ module Lithic ).returns(T.attached_class) end def self.new( - # Globally unique identifier for the retry. + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. retry_token:, request_options: {} ) diff --git a/rbi/lithic/models/external_payment_create_params.rbi b/rbi/lithic/models/external_payment_create_params.rbi index 74da87af..68333728 100644 --- a/rbi/lithic/models/external_payment_create_params.rbi +++ b/rbi/lithic/models/external_payment_create_params.rbi @@ -28,6 +28,8 @@ module Lithic end attr_accessor :payment_type + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. sig { returns(T.nilable(String)) } attr_reader :token @@ -82,6 +84,8 @@ module Lithic effective_date:, financial_account_token:, payment_type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. token: nil, memo: nil, progress_to: nil, diff --git a/rbi/lithic/models/management_operation_create_params.rbi b/rbi/lithic/models/management_operation_create_params.rbi index 20a3360b..4543f96f 100644 --- a/rbi/lithic/models/management_operation_create_params.rbi +++ b/rbi/lithic/models/management_operation_create_params.rbi @@ -38,6 +38,8 @@ module Lithic sig { returns(String) } attr_accessor :financial_account_token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. sig { returns(T.nilable(String)) } attr_reader :token @@ -106,6 +108,8 @@ module Lithic effective_date:, event_type:, financial_account_token:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. token: nil, memo: nil, # What to do if the financial account is closed when posting an operation diff --git a/rbi/lithic/models/payment.rbi b/rbi/lithic/models/payment.rbi index 50650cd9..523b96dc 100644 --- a/rbi/lithic/models/payment.rbi +++ b/rbi/lithic/models/payment.rbi @@ -1061,6 +1061,8 @@ module Lithic T.let(:WIRE_OUTBOUND_PAYMENT, Lithic::Payment::Type::TaggedSymbol) WIRE_OUTBOUND_ADMIN = T.let(:WIRE_OUTBOUND_ADMIN, Lithic::Payment::Type::TaggedSymbol) + WIRE_DRAWDOWN_REQUEST = + T.let(:WIRE_DRAWDOWN_REQUEST, Lithic::Payment::Type::TaggedSymbol) sig { override.returns(T::Array[Lithic::Payment::Type::TaggedSymbol]) } def self.values diff --git a/rbi/lithic/resources/book_transfers.rbi b/rbi/lithic/resources/book_transfers.rbi index 024aa8fa..d6526691 100644 --- a/rbi/lithic/resources/book_transfers.rbi +++ b/rbi/lithic/resources/book_transfers.rbi @@ -121,7 +121,8 @@ module Lithic def retry_( # Token of the book transfer to retry book_transfer_token, - # Globally unique identifier for the retry. + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. retry_token:, request_options: {} ) diff --git a/rbi/lithic/resources/external_payments.rbi b/rbi/lithic/resources/external_payments.rbi index 6fd50c8b..65b83005 100644 --- a/rbi/lithic/resources/external_payments.rbi +++ b/rbi/lithic/resources/external_payments.rbi @@ -26,6 +26,8 @@ module Lithic effective_date:, financial_account_token:, payment_type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. token: nil, memo: nil, progress_to: nil, diff --git a/rbi/lithic/resources/management_operations.rbi b/rbi/lithic/resources/management_operations.rbi index 3cc00fa7..528bdc7d 100644 --- a/rbi/lithic/resources/management_operations.rbi +++ b/rbi/lithic/resources/management_operations.rbi @@ -30,6 +30,8 @@ module Lithic effective_date:, event_type:, financial_account_token:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. token: nil, memo: nil, # What to do if the financial account is closed when posting an operation diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs index cc92de5e..3fbdbd5b 100644 --- a/sig/lithic/models/payment.rbs +++ b/sig/lithic/models/payment.rbs @@ -524,6 +524,7 @@ module Lithic | :WIRE_INBOUND_ADMIN | :WIRE_OUTBOUND_PAYMENT | :WIRE_OUTBOUND_ADMIN + | :WIRE_DRAWDOWN_REQUEST module Type extend Lithic::Internal::Type::Enum @@ -536,6 +537,7 @@ module Lithic WIRE_INBOUND_ADMIN: :WIRE_INBOUND_ADMIN WIRE_OUTBOUND_PAYMENT: :WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN: :WIRE_OUTBOUND_ADMIN + WIRE_DRAWDOWN_REQUEST: :WIRE_DRAWDOWN_REQUEST def self?.values: -> ::Array[Lithic::Models::Payment::type_] end From e736094a8bcf11007a6ea2666cfc6a646aca6972 Mon Sep 17 00:00:00 2001 From: Sam El-Borai Date: Fri, 26 Dec 2025 20:02:15 +0100 Subject: [PATCH 6/7] chore: formatting --- lib/lithic/resources/webhooks.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/lithic/resources/webhooks.rb b/lib/lithic/resources/webhooks.rb index ee7d93d7..c67cbcb2 100644 --- a/lib/lithic/resources/webhooks.rb +++ b/lib/lithic/resources/webhooks.rb @@ -60,7 +60,8 @@ def parse_unsafe(payload) def verify_signature(payload:, headers:, secret: nil) secret ||= ENV["LITHIC_WEBHOOK_SECRET"] if secret.nil? || secret.empty? - raise ArgumentError, "Webhook secret must be provided or set in LITHIC_WEBHOOK_SECRET environment variable" + raise ArgumentError, + "Webhook secret must be provided or set in LITHIC_WEBHOOK_SECRET environment variable" end begin From 7a86137e885113d8ef10492ca20ff5bcc5c8e307 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Dec 2025 19:02:49 +0000 Subject: [PATCH 7/7] release: 0.3.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/lithic/version.rb | 2 +- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 10f30916..6b7b74c5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.0" + ".": "0.3.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2468db0d..e8ec9b8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## 0.3.0 (2025-12-26) + +Full Changelog: [v0.2.0...v0.3.0](https://github.com/lithic-com/lithic-ruby/compare/v0.2.0...v0.3.0) + +### Features + +* **api:** add external_id to payment_event ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f)) +* **api:** add get /v1/transfer_limits endpoint ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f)) +* **api:** add post /v1/book_transfers/{book_transfer_token}/retry endpoint ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f)) +* **api:** add WIRE_DRAWDOWN_REQUEST transfer type ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14)) +* **api:** remove unnecessary X-Lithic-Pagination header ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14)) +* **api:** remove v1/aggregate_balances and related models ([c66d75e](https://github.com/lithic-com/lithic-ruby/commit/c66d75ed7b10521d5f73efeafb9dbcd6ff7a7f0c)) + + +### Bug Fixes + +* calling `break` out of streams should be instantaneous ([86db080](https://github.com/lithic-com/lithic-ruby/commit/86db080240382ba1cd73af9a01c89379cfb8e330)) +* issue where json.parse errors when receiving HTTP 204 with nobody ([9c9d63b](https://github.com/lithic-com/lithic-ruby/commit/9c9d63b07badd9fdd107314ac0bd5c8c23ddd0c3)) + + +### Chores + +* formatting ([e736094](https://github.com/lithic-com/lithic-ruby/commit/e736094a8bcf11007a6ea2666cfc6a646aca6972)) + + +### Documentation + +* **api:** clarify description of token / retry_token when it serves as idempotency key ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14)) + ## 0.2.0 (2025-12-10) Full Changelog: [v0.1.0...v0.2.0](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0...v0.2.0) diff --git a/Gemfile.lock b/Gemfile.lock index 1c2f037c..ec7d09db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GIT PATH remote: . specs: - lithic (0.2.0) + lithic (0.3.0) connection_pool GEM diff --git a/README.md b/README.md index e5d25e76..2333dd34 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.2.0" +gem "lithic", "~> 0.3.0" ``` diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index 11e5674a..5040b33e 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lithic - VERSION = "0.2.0" + VERSION = "0.3.0" end