From 3e0194f79f315f44b8bc95c7e18452c99d91ce81 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 18:41:25 +0000 Subject: [PATCH 1/9] feat(api): add EARLY_DIRECT_DEPOSIT_FLOAT to financial account types --- .stats.yml | 8 +- lib/lithic.rb | 7 + lib/lithic/client.rb | 4 + lib/lithic/models.rb | 12 ++ .../models/account_activity_list_params.rb | 1 + .../models/account_activity_list_response.rb | 9 +- ..._activity_retrieve_transaction_response.rb | 9 +- lib/lithic/models/financial_account.rb | 1 + .../models/financial_account_list_params.rb | 1 + .../statements/statement_line_items.rb | 1 + lib/lithic/models/hold.rb | 147 ++++++++++++++ lib/lithic/models/hold_create_params.rb | 61 ++++++ lib/lithic/models/hold_event.rb | 110 +++++++++++ lib/lithic/models/hold_list_params.rb | 89 +++++++++ lib/lithic/models/hold_retrieve_params.rb | 20 ++ lib/lithic/models/hold_void_params.rb | 29 +++ .../models/instance_financial_account_type.rb | 1 + lib/lithic/models/payment.rb | 1 + lib/lithic/resources/account_activity.rb | 4 +- lib/lithic/resources/holds.rb | 132 +++++++++++++ rbi/lithic/client.rbi | 3 + rbi/lithic/models.rbi | 12 ++ .../models/account_activity_list_params.rbi | 5 + .../models/account_activity_list_response.rbi | 11 +- ...activity_retrieve_transaction_response.rbi | 11 +- rbi/lithic/models/financial_account.rbi | 5 + .../models/financial_account_list_params.rbi | 5 + .../statements/statement_line_items.rbi | 5 + rbi/lithic/models/hold.rbi | 183 ++++++++++++++++++ rbi/lithic/models/hold_create_params.rbi | 90 +++++++++ rbi/lithic/models/hold_event.rbi | 148 ++++++++++++++ rbi/lithic/models/hold_list_params.rbi | 137 +++++++++++++ rbi/lithic/models/hold_retrieve_params.rbi | 35 ++++ rbi/lithic/models/hold_void_params.rbi | 49 +++++ .../instance_financial_account_type.rbi | 5 + rbi/lithic/models/payment.rbi | 1 + rbi/lithic/resources/holds.rbi | 111 +++++++++++ sig/lithic/client.rbs | 2 + sig/lithic/models.rbs | 12 ++ .../models/account_activity_list_params.rbs | 2 + .../models/account_activity_list_response.rbs | 3 + ...activity_retrieve_transaction_response.rbs | 3 + sig/lithic/models/financial_account.rbs | 2 + .../models/financial_account_list_params.rbs | 8 +- .../statements/statement_line_items.rbs | 2 + sig/lithic/models/hold.rbs | 137 +++++++++++++ sig/lithic/models/hold_create_params.rbs | 57 ++++++ sig/lithic/models/hold_event.rbs | 91 +++++++++ sig/lithic/models/hold_list_params.rbs | 83 ++++++++ sig/lithic/models/hold_retrieve_params.rbs | 23 +++ sig/lithic/models/hold_void_params.rbs | 28 +++ .../instance_financial_account_type.rbs | 2 + sig/lithic/models/payment.rbs | 2 + sig/lithic/resources/holds.rbs | 39 ++++ .../lithic/resources/account_activity_test.rb | 30 +++ test/lithic/resources/holds_test.rb | 112 +++++++++++ 56 files changed, 2086 insertions(+), 15 deletions(-) create mode 100644 lib/lithic/models/hold.rb create mode 100644 lib/lithic/models/hold_create_params.rb create mode 100644 lib/lithic/models/hold_event.rb create mode 100644 lib/lithic/models/hold_list_params.rb create mode 100644 lib/lithic/models/hold_retrieve_params.rb create mode 100644 lib/lithic/models/hold_void_params.rb create mode 100644 lib/lithic/resources/holds.rb create mode 100644 rbi/lithic/models/hold.rbi create mode 100644 rbi/lithic/models/hold_create_params.rbi create mode 100644 rbi/lithic/models/hold_event.rbi create mode 100644 rbi/lithic/models/hold_list_params.rbi create mode 100644 rbi/lithic/models/hold_retrieve_params.rbi create mode 100644 rbi/lithic/models/hold_void_params.rbi create mode 100644 rbi/lithic/resources/holds.rbi create mode 100644 sig/lithic/models/hold.rbs create mode 100644 sig/lithic/models/hold_create_params.rbs create mode 100644 sig/lithic/models/hold_event.rbs create mode 100644 sig/lithic/models/hold_list_params.rbs create mode 100644 sig/lithic/models/hold_retrieve_params.rbs create mode 100644 sig/lithic/models/hold_void_params.rbs create mode 100644 sig/lithic/resources/holds.rbs create mode 100644 test/lithic/resources/holds_test.rb diff --git a/.stats.yml b/.stats.yml index 4f6a4f90..b95d916a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 185 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ee8607f0a2cdcaee420935050334a439db8dd097be83023fccdaf1d6f9a7de14.yml -openapi_spec_hash: 0f21c68cdddb7c5bd99f42356d507393 -config_hash: fb5070d41fcabdedbc084b83964b592a +configured_endpoints: 189 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ee2b9f00d3a9e0000e25abc0774615d6ad3300ce17b2f094e71b0229a907760f.yml +openapi_spec_hash: 01d2cbf4ac692dba2f3831462db929e4 +config_hash: a45e6da4e7b46db4ff6819d1dba5d815 diff --git a/lib/lithic.rb b/lib/lithic.rb index 271c34ac..b1b0b3c1 100644 --- a/lib/lithic.rb +++ b/lib/lithic.rb @@ -320,6 +320,12 @@ require_relative "lithic/models/funding_event_retrieve_details_params" require_relative "lithic/models/funding_event_retrieve_details_response" require_relative "lithic/models/funding_event_retrieve_params" +require_relative "lithic/models/hold" +require_relative "lithic/models/hold_create_params" +require_relative "lithic/models/hold_event" +require_relative "lithic/models/hold_list_params" +require_relative "lithic/models/hold_retrieve_params" +require_relative "lithic/models/hold_void_params" require_relative "lithic/models/instance_financial_account_type" require_relative "lithic/models/internal_transaction_created_webhook_event" require_relative "lithic/models/internal_transaction_updated_webhook_event" @@ -485,6 +491,7 @@ require_relative "lithic/resources/fraud" require_relative "lithic/resources/fraud/transactions" require_relative "lithic/resources/funding_events" +require_relative "lithic/resources/holds" require_relative "lithic/resources/internal_transaction" require_relative "lithic/resources/management_operations" require_relative "lithic/resources/network_programs" diff --git a/lib/lithic/client.rb b/lib/lithic/client.rb index 38a4fa92..5b342eec 100644 --- a/lib/lithic/client.rb +++ b/lib/lithic/client.rb @@ -113,6 +113,9 @@ class Client < Lithic::Internal::Transport::BaseClient # @return [Lithic::Resources::NetworkPrograms] attr_reader :network_programs + # @return [Lithic::Resources::Holds] + attr_reader :holds + # @return [Lithic::Resources::AccountActivity] attr_reader :account_activity @@ -221,6 +224,7 @@ def initialize( @funding_events = Lithic::Resources::FundingEvents.new(client: self) @fraud = Lithic::Resources::Fraud.new(client: self) @network_programs = Lithic::Resources::NetworkPrograms.new(client: self) + @holds = Lithic::Resources::Holds.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) diff --git a/lib/lithic/models.rb b/lib/lithic/models.rb index 3489ad54..beecbf27 100644 --- a/lib/lithic/models.rb +++ b/lib/lithic/models.rb @@ -365,6 +365,18 @@ module Lithic FundingEventRetrieveParams = Lithic::Models::FundingEventRetrieveParams + Hold = Lithic::Models::Hold + + HoldCreateParams = Lithic::Models::HoldCreateParams + + HoldEvent = Lithic::Models::HoldEvent + + HoldListParams = Lithic::Models::HoldListParams + + HoldRetrieveParams = Lithic::Models::HoldRetrieveParams + + HoldVoidParams = Lithic::Models::HoldVoidParams + InstanceFinancialAccountType = Lithic::Models::InstanceFinancialAccountType InternalTransactionAPI = Lithic::Models::InternalTransactionAPI diff --git a/lib/lithic/models/account_activity_list_params.rb b/lib/lithic/models/account_activity_list_params.rb index 9598c497..33011b6d 100644 --- a/lib/lithic/models/account_activity_list_params.rb +++ b/lib/lithic/models/account_activity_list_params.rb @@ -128,6 +128,7 @@ module Category MANAGEMENT_FEE = :MANAGEMENT_FEE MANAGEMENT_REWARD = :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD PROGRAM_FUNDING = :PROGRAM_FUNDING # @!method self.values diff --git a/lib/lithic/models/account_activity_list_response.rb b/lib/lithic/models/account_activity_list_response.rb index 942e29e9..c52d0117 100644 --- a/lib/lithic/models/account_activity_list_response.rb +++ b/lib/lithic/models/account_activity_list_response.rb @@ -6,7 +6,8 @@ module Models # which transaction type is returned: INTERNAL returns FinancialTransaction, # TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT # returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, - # and MANAGEMENT_OPERATION returns ManagementOperationTransaction + # MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + # HoldTransaction # # @see Lithic::Resources::AccountActivity#list module AccountActivityListResponse @@ -30,6 +31,9 @@ module AccountActivityListResponse variant :MANAGEMENT_OPERATION, -> { Lithic::ManagementOperationTransaction } + # A hold transaction representing reserved funds on a financial account. Holds move funds from available to pending balance in anticipation of future payments. They can be resolved via settlement (linked to payment), manual release, or expiration. + variant :HOLD, -> { Lithic::Hold } + class Internal < Lithic::Internal::Type::BaseModel # @!attribute token # Unique identifier for the transaction @@ -163,6 +167,7 @@ module Category MANAGEMENT_FEE = :MANAGEMENT_FEE MANAGEMENT_REWARD = :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD PROGRAM_FUNDING = :PROGRAM_FUNDING # @!method self.values @@ -261,7 +266,7 @@ module Status end # @!method self.variants - # @return [Array(Lithic::Models::AccountActivityListResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityListResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction)] + # @return [Array(Lithic::Models::AccountActivityListResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityListResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction, Lithic::Models::Hold)] end end end diff --git a/lib/lithic/models/account_activity_retrieve_transaction_response.rb b/lib/lithic/models/account_activity_retrieve_transaction_response.rb index 6bd65c47..b26b1785 100644 --- a/lib/lithic/models/account_activity_retrieve_transaction_response.rb +++ b/lib/lithic/models/account_activity_retrieve_transaction_response.rb @@ -6,7 +6,8 @@ module Models # which transaction type is returned: INTERNAL returns FinancialTransaction, # TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT # returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, - # and MANAGEMENT_OPERATION returns ManagementOperationTransaction + # MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + # HoldTransaction # # @see Lithic::Resources::AccountActivity#retrieve_transaction module AccountActivityRetrieveTransactionResponse @@ -30,6 +31,9 @@ module AccountActivityRetrieveTransactionResponse variant :MANAGEMENT_OPERATION, -> { Lithic::ManagementOperationTransaction } + # A hold transaction representing reserved funds on a financial account. Holds move funds from available to pending balance in anticipation of future payments. They can be resolved via settlement (linked to payment), manual release, or expiration. + variant :HOLD, -> { Lithic::Hold } + class Internal < Lithic::Internal::Type::BaseModel # @!attribute token # Unique identifier for the transaction @@ -166,6 +170,7 @@ module Category MANAGEMENT_FEE = :MANAGEMENT_FEE MANAGEMENT_REWARD = :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD PROGRAM_FUNDING = :PROGRAM_FUNDING # @!method self.values @@ -264,7 +269,7 @@ module Status end # @!method self.variants - # @return [Array(Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction)] + # @return [Array(Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction, Lithic::Models::Hold)] end end end diff --git a/lib/lithic/models/financial_account.rb b/lib/lithic/models/financial_account.rb index 4a80cec9..5c290dec 100644 --- a/lib/lithic/models/financial_account.rb +++ b/lib/lithic/models/financial_account.rb @@ -202,6 +202,7 @@ module Type PROGRAM_RECEIVABLES = :PROGRAM_RECEIVABLES COLLECTION = :COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE = :PROGRAM_BANK_ACCOUNTS_PAYABLE + EARLY_DIRECT_DEPOSIT_FLOAT = :EARLY_DIRECT_DEPOSIT_FLOAT # @!method self.values # @return [Array] diff --git a/lib/lithic/models/financial_account_list_params.rb b/lib/lithic/models/financial_account_list_params.rb index c1ca7eac..7f7b451e 100644 --- a/lib/lithic/models/financial_account_list_params.rb +++ b/lib/lithic/models/financial_account_list_params.rb @@ -42,6 +42,7 @@ module Type OPERATING = :OPERATING RESERVE = :RESERVE SECURITY = :SECURITY + EARLY_DIRECT_DEPOSIT_FLOAT = :EARLY_DIRECT_DEPOSIT_FLOAT # @!method self.values # @return [Array] diff --git a/lib/lithic/models/financial_accounts/statements/statement_line_items.rb b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb index b7267763..0a5606f8 100644 --- a/lib/lithic/models/financial_accounts/statements/statement_line_items.rb +++ b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb @@ -144,6 +144,7 @@ module Category MANAGEMENT_FEE = :MANAGEMENT_FEE MANAGEMENT_REWARD = :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD PROGRAM_FUNDING = :PROGRAM_FUNDING # @!method self.values diff --git a/lib/lithic/models/hold.rb b/lib/lithic/models/hold.rb new file mode 100644 index 00000000..eadd9e29 --- /dev/null +++ b/lib/lithic/models/hold.rb @@ -0,0 +1,147 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#create + class Hold < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute status + # Status of a hold transaction + # + # @return [Symbol, Lithic::Models::Hold::Status] + required :status, enum: -> { Lithic::Hold::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute currency + # + # @return [String, nil] + optional :currency, String + + # @!attribute events + # + # @return [Array, nil] + optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent] } + + # @!attribute expiration_datetime + # When the hold will auto-expire if not resolved + # + # @return [Time, nil] + optional :expiration_datetime, Time, nil?: true + + # @!attribute family + # HOLD - Hold Transaction + # + # @return [Symbol, Lithic::Models::Hold::Family, nil] + optional :family, enum: -> { Lithic::Hold::Family } + + # @!attribute financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute pending_amount + # Current pending amount (0 when resolved) + # + # @return [Integer, nil] + optional :pending_amount, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::Hold::Result, nil] + optional :result, enum: -> { Lithic::Hold::Result } + + # @!attribute user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!method initialize(token:, created:, status:, updated:, currency: nil, events: nil, expiration_datetime: nil, family: nil, financial_account_token: nil, pending_amount: nil, result: nil, user_defined_id: nil) + # A hold transaction representing reserved funds on a financial account. Holds + # move funds from available to pending balance in anticipation of future payments. + # They can be resolved via settlement (linked to payment), manual release, or + # expiration. + # + # @param token [String] Unique identifier for the transaction + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param status [Symbol, Lithic::Models::Hold::Status] Status of a hold transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param currency [String] + # + # @param events [Array] + # + # @param expiration_datetime [Time, nil] When the hold will auto-expire if not resolved + # + # @param family [Symbol, Lithic::Models::Hold::Family] HOLD - Hold Transaction + # + # @param financial_account_token [String] + # + # @param pending_amount [Integer] Current pending amount (0 when resolved) + # + # @param result [Symbol, Lithic::Models::Hold::Result] + # + # @param user_defined_id [String, nil] + + # Status of a hold transaction + # + # @see Lithic::Models::Hold#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + EXPIRED = :EXPIRED + VOIDED = :VOIDED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + + # HOLD - Hold Transaction + # + # @see Lithic::Models::Hold#family + module Family + extend Lithic::Internal::Type::Enum + + HOLD = :HOLD + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Hold#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/hold_create_params.rb b/lib/lithic/models/hold_create_params.rb new file mode 100644 index 00000000..d3bf691a --- /dev/null +++ b/lib/lithic/models/hold_create_params.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#create + class HoldCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute amount + # Amount to hold in cents + # + # @return [Integer] + required :amount, Integer + + # @!attribute token + # Customer-provided token for idempotency. Becomes the hold token. + # + # @return [String, nil] + optional :token, String + + # @!attribute expiration_datetime + # When the hold should auto-expire + # + # @return [Time, nil] + optional :expiration_datetime, Time + + # @!attribute memo + # Reason for the hold + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute user_defined_id + # User-provided identifier for the hold + # + # @return [String, nil] + optional :user_defined_id, String + + # @!method initialize(financial_account_token:, amount:, token: nil, expiration_datetime: nil, memo: nil, user_defined_id: nil, request_options: {}) + # @param financial_account_token [String] + # + # @param amount [Integer] Amount to hold in cents + # + # @param token [String] Customer-provided token for idempotency. Becomes the hold token. + # + # @param expiration_datetime [Time] When the hold should auto-expire + # + # @param memo [String, nil] Reason for the hold + # + # @param user_defined_id [String] User-provided identifier for the hold + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/hold_event.rb b/lib/lithic/models/hold_event.rb new file mode 100644 index 00000000..73fd3d79 --- /dev/null +++ b/lib/lithic/models/hold_event.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +module Lithic + module Models + class HoldEvent < Lithic::Internal::Type::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount in cents + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::HoldEvent::DetailedResult] } + + # @!attribute memo + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute result + # + # @return [Symbol, Lithic::Models::HoldEvent::Result] + required :result, enum: -> { Lithic::HoldEvent::Result } + + # @!attribute settling_transaction_token + # Transaction token of the payment that settled this hold (only populated for + # HOLD_SETTLED events) + # + # @return [String, nil] + required :settling_transaction_token, String, nil?: true + + # @!attribute type + # Type of hold lifecycle event + # + # @return [Symbol, Lithic::Models::HoldEvent::Type] + required :type, enum: -> { Lithic::HoldEvent::Type } + + # @!method initialize(token:, amount:, created:, detailed_results:, memo:, result:, settling_transaction_token:, type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::HoldEvent} for more details. + # + # Event representing a lifecycle change to a hold + # + # @param token [String] + # + # @param amount [Integer] Amount in cents + # + # @param created [Time] + # + # @param detailed_results [Array] + # + # @param memo [String, nil] + # + # @param result [Symbol, Lithic::Models::HoldEvent::Result] + # + # @param settling_transaction_token [String, nil] Transaction token of the payment that settled this hold (only populated for HOLD + # + # @param type [Symbol, Lithic::Models::HoldEvent::Type] Type of hold lifecycle event + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::HoldEvent#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Type of hold lifecycle event + # + # @see Lithic::Models::HoldEvent#type + module Type + extend Lithic::Internal::Type::Enum + + HOLD_INITIATED = :HOLD_INITIATED + HOLD_VOIDED = :HOLD_VOIDED + HOLD_EXPIRED = :HOLD_EXPIRED + HOLD_SETTLED = :HOLD_SETTLED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/hold_list_params.rb b/lib/lithic/models/hold_list_params.rb new file mode 100644 index 00000000..07648f85 --- /dev/null +++ b/lib/lithic/models/hold_list_params.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#list + class HoldListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Hold status to filter by. + # + # @return [Symbol, Lithic::Models::HoldListParams::Status, nil] + optional :status, enum: -> { Lithic::HoldListParams::Status } + + # @!method initialize(financial_account_token:, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::HoldListParams} for more details. + # + # @param financial_account_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::HoldListParams::Status] Hold status to filter by. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Hold status to filter by. + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + EXPIRED = :EXPIRED + VOIDED = :VOIDED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/hold_retrieve_params.rb b/lib/lithic/models/hold_retrieve_params.rb new file mode 100644 index 00000000..9ad8e397 --- /dev/null +++ b/lib/lithic/models/hold_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#retrieve + class HoldRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute hold_token + # + # @return [String] + required :hold_token, String + + # @!method initialize(hold_token:, request_options: {}) + # @param hold_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/hold_void_params.rb b/lib/lithic/models/hold_void_params.rb new file mode 100644 index 00000000..846a5645 --- /dev/null +++ b/lib/lithic/models/hold_void_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#void + class HoldVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute hold_token + # + # @return [String] + required :hold_token, String + + # @!attribute memo + # Reason for voiding the hold + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!method initialize(hold_token:, memo: nil, request_options: {}) + # @param hold_token [String] + # + # @param memo [String, nil] Reason for voiding the hold + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/instance_financial_account_type.rb b/lib/lithic/models/instance_financial_account_type.rb index 75707f8d..5c92c5b4 100644 --- a/lib/lithic/models/instance_financial_account_type.rb +++ b/lib/lithic/models/instance_financial_account_type.rb @@ -16,6 +16,7 @@ module InstanceFinancialAccountType PROGRAM_RECEIVABLES = :PROGRAM_RECEIVABLES COLLECTION = :COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE = :PROGRAM_BANK_ACCOUNTS_PAYABLE + EARLY_DIRECT_DEPOSIT_FLOAT = :EARLY_DIRECT_DEPOSIT_FLOAT # @!method self.values # @return [Array] diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb index aa25ca3c..e9a488bb 100644 --- a/lib/lithic/models/payment.rb +++ b/lib/lithic/models/payment.rb @@ -207,6 +207,7 @@ module Category MANAGEMENT_FEE = :MANAGEMENT_FEE MANAGEMENT_REWARD = :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD PROGRAM_FUNDING = :PROGRAM_FUNDING # @!method self.values diff --git a/lib/lithic/resources/account_activity.rb b/lib/lithic/resources/account_activity.rb index 40e44bc0..c05686af 100644 --- a/lib/lithic/resources/account_activity.rb +++ b/lib/lithic/resources/account_activity.rb @@ -34,7 +34,7 @@ class AccountActivity # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Lithic::Internal::CursorPage] + # @return [Lithic::Internal::CursorPage] # # @see Lithic::Models::AccountActivityListParams def list(params = {}) @@ -58,7 +58,7 @@ def list(params = {}) # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction] + # @return [Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction, Lithic::Models::Hold] # # @see Lithic::Models::AccountActivityRetrieveTransactionParams def retrieve_transaction(transaction_token, params = {}) diff --git a/lib/lithic/resources/holds.rb b/lib/lithic/resources/holds.rb new file mode 100644 index 00000000..a7e47a1d --- /dev/null +++ b/lib/lithic/resources/holds.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Holds + # Create a hold on a financial account. Holds reserve funds by moving them from + # available to pending balance. They can be resolved via settlement (linked to a + # payment or book transfer), voiding, or expiration. + # + # @overload create(financial_account_token, amount:, token: nil, expiration_datetime: nil, memo: nil, user_defined_id: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for the financial account. + # + # @param amount [Integer] Amount to hold in cents + # + # @param token [String] Customer-provided token for idempotency. Becomes the hold token. + # + # @param expiration_datetime [Time] When the hold should auto-expire + # + # @param memo [String, nil] Reason for the hold + # + # @param user_defined_id [String] User-provided identifier for the hold + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Hold] + # + # @see Lithic::Models::HoldCreateParams + def create(financial_account_token, params) + parsed, options = Lithic::HoldCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/financial_accounts/%1$s/holds", financial_account_token], + body: parsed, + model: Lithic::Hold, + options: options + ) + end + + # Get hold by token. + # + # @overload retrieve(hold_token, request_options: {}) + # + # @param hold_token [String] Globally unique identifier for the hold. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Hold] + # + # @see Lithic::Models::HoldRetrieveParams + def retrieve(hold_token, params = {}) + @client.request( + method: :get, + path: ["v1/holds/%1$s", hold_token], + model: Lithic::Hold, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::HoldListParams} for more details. + # + # List holds for a financial account. + # + # @overload list(financial_account_token, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for the financial account. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::HoldListParams::Status] Hold status to filter by. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::HoldListParams + def list(financial_account_token, params = {}) + parsed, options = Lithic::HoldListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/holds", financial_account_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Hold, + options: options + ) + end + + # Void an active hold. This returns the held funds from pending back to available + # balance. Only holds in PENDING status can be voided. + # + # @overload void(hold_token, memo: nil, request_options: {}) + # + # @param hold_token [String] Globally unique identifier for the hold. + # + # @param memo [String, nil] Reason for voiding the hold + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Hold] + # + # @see Lithic::Models::HoldVoidParams + def void(hold_token, params = {}) + parsed, options = Lithic::HoldVoidParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/holds/%1$s/void", hold_token], + body: parsed, + model: Lithic::Hold, + 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 61eb71d1..ab1c5f7a 100644 --- a/rbi/lithic/client.rbi +++ b/rbi/lithic/client.rbi @@ -112,6 +112,9 @@ module Lithic sig { returns(Lithic::Resources::NetworkPrograms) } attr_reader :network_programs + sig { returns(Lithic::Resources::Holds) } + attr_reader :holds + sig { returns(Lithic::Resources::AccountActivity) } attr_reader :account_activity diff --git a/rbi/lithic/models.rbi b/rbi/lithic/models.rbi index a01624e9..1856cca3 100644 --- a/rbi/lithic/models.rbi +++ b/rbi/lithic/models.rbi @@ -365,6 +365,18 @@ module Lithic FundingEventRetrieveParams = Lithic::Models::FundingEventRetrieveParams + Hold = Lithic::Models::Hold + + HoldCreateParams = Lithic::Models::HoldCreateParams + + HoldEvent = Lithic::Models::HoldEvent + + HoldListParams = Lithic::Models::HoldListParams + + HoldRetrieveParams = Lithic::Models::HoldRetrieveParams + + HoldVoidParams = Lithic::Models::HoldVoidParams + InstanceFinancialAccountType = Lithic::Models::InstanceFinancialAccountType InternalTransactionAPI = Lithic::Models::InternalTransactionAPI diff --git a/rbi/lithic/models/account_activity_list_params.rbi b/rbi/lithic/models/account_activity_list_params.rbi index d60e4fb8..44d6809e 100644 --- a/rbi/lithic/models/account_activity_list_params.rbi +++ b/rbi/lithic/models/account_activity_list_params.rbi @@ -275,6 +275,11 @@ module Lithic :MANAGEMENT_DISBURSEMENT, Lithic::AccountActivityListParams::Category::TaggedSymbol ) + HOLD = + T.let( + :HOLD, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) PROGRAM_FUNDING = T.let( :PROGRAM_FUNDING, diff --git a/rbi/lithic/models/account_activity_list_response.rbi b/rbi/lithic/models/account_activity_list_response.rbi index ac3fcda6..dbf62e10 100644 --- a/rbi/lithic/models/account_activity_list_response.rbi +++ b/rbi/lithic/models/account_activity_list_response.rbi @@ -6,7 +6,8 @@ module Lithic # which transaction type is returned: INTERNAL returns FinancialTransaction, # TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT # returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, - # and MANAGEMENT_OPERATION returns ManagementOperationTransaction + # MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + # HoldTransaction module AccountActivityListResponse extend Lithic::Internal::Type::Union @@ -18,7 +19,8 @@ module Lithic Lithic::Models::AccountActivityListResponse::Card, Lithic::Payment, Lithic::ExternalPayment, - Lithic::ManagementOperationTransaction + Lithic::ManagementOperationTransaction, + Lithic::Hold ) end @@ -279,6 +281,11 @@ module Lithic :MANAGEMENT_DISBURSEMENT, Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol ) + HOLD = + T.let( + :HOLD, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) PROGRAM_FUNDING = T.let( :PROGRAM_FUNDING, diff --git a/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi b/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi index f36e42c4..1233f3ea 100644 --- a/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi +++ b/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi @@ -6,7 +6,8 @@ module Lithic # which transaction type is returned: INTERNAL returns FinancialTransaction, # TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT # returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, - # and MANAGEMENT_OPERATION returns ManagementOperationTransaction + # MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + # HoldTransaction module AccountActivityRetrieveTransactionResponse extend Lithic::Internal::Type::Union @@ -18,7 +19,8 @@ module Lithic Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, Lithic::Payment, Lithic::ExternalPayment, - Lithic::ManagementOperationTransaction + Lithic::ManagementOperationTransaction, + Lithic::Hold ) end @@ -279,6 +281,11 @@ module Lithic :MANAGEMENT_DISBURSEMENT, Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol ) + HOLD = + T.let( + :HOLD, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) PROGRAM_FUNDING = T.let( :PROGRAM_FUNDING, diff --git a/rbi/lithic/models/financial_account.rbi b/rbi/lithic/models/financial_account.rbi index 2b6211dd..ded0e243 100644 --- a/rbi/lithic/models/financial_account.rbi +++ b/rbi/lithic/models/financial_account.rbi @@ -344,6 +344,11 @@ module Lithic :PROGRAM_BANK_ACCOUNTS_PAYABLE, Lithic::FinancialAccount::Type::TaggedSymbol ) + EARLY_DIRECT_DEPOSIT_FLOAT = + T.let( + :EARLY_DIRECT_DEPOSIT_FLOAT, + Lithic::FinancialAccount::Type::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/lithic/models/financial_account_list_params.rbi b/rbi/lithic/models/financial_account_list_params.rbi index 3171b7e3..cdd7b3af 100644 --- a/rbi/lithic/models/financial_account_list_params.rbi +++ b/rbi/lithic/models/financial_account_list_params.rbi @@ -98,6 +98,11 @@ module Lithic :SECURITY, Lithic::FinancialAccountListParams::Type::TaggedSymbol ) + EARLY_DIRECT_DEPOSIT_FLOAT = + T.let( + :EARLY_DIRECT_DEPOSIT_FLOAT, + Lithic::FinancialAccountListParams::Type::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi b/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi index 424bd79b..6df9f6fd 100644 --- a/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi +++ b/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi @@ -296,6 +296,11 @@ module Lithic :MANAGEMENT_DISBURSEMENT, Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol ) + HOLD = + T.let( + :HOLD, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) PROGRAM_FUNDING = T.let( :PROGRAM_FUNDING, diff --git a/rbi/lithic/models/hold.rbi b/rbi/lithic/models/hold.rbi new file mode 100644 index 00000000..0a00f0ae --- /dev/null +++ b/rbi/lithic/models/hold.rbi @@ -0,0 +1,183 @@ +# typed: strong + +module Lithic + module Models + class Hold < Lithic::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Lithic::Hold, Lithic::Internal::AnyHash) } + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # Status of a hold transaction + sig { returns(Lithic::Hold::Status::TaggedSymbol) } + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + sig { returns(T.nilable(T::Array[Lithic::HoldEvent])) } + attr_reader :events + + sig { params(events: T::Array[Lithic::HoldEvent::OrHash]).void } + attr_writer :events + + # When the hold will auto-expire if not resolved + sig { returns(T.nilable(Time)) } + attr_accessor :expiration_datetime + + # HOLD - Hold Transaction + sig { returns(T.nilable(Lithic::Hold::Family::TaggedSymbol)) } + attr_reader :family + + sig { params(family: Lithic::Hold::Family::OrSymbol).void } + attr_writer :family + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Current pending amount (0 when resolved) + sig { returns(T.nilable(Integer)) } + attr_reader :pending_amount + + sig { params(pending_amount: Integer).void } + attr_writer :pending_amount + + sig { returns(T.nilable(Lithic::Hold::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Hold::Result::OrSymbol).void } + attr_writer :result + + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # A hold transaction representing reserved funds on a financial account. Holds + # move funds from available to pending balance in anticipation of future payments. + # They can be resolved via settlement (linked to payment), manual release, or + # expiration. + sig do + params( + token: String, + created: Time, + status: Lithic::Hold::Status::OrSymbol, + updated: Time, + currency: String, + events: T::Array[Lithic::HoldEvent::OrHash], + expiration_datetime: T.nilable(Time), + family: Lithic::Hold::Family::OrSymbol, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Hold::Result::OrSymbol, + user_defined_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # ISO 8601 timestamp of when the transaction was created + created:, + # Status of a hold transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + currency: nil, + events: nil, + # When the hold will auto-expire if not resolved + expiration_datetime: nil, + # HOLD - Hold Transaction + family: nil, + financial_account_token: nil, + # Current pending amount (0 when resolved) + pending_amount: nil, + result: nil, + user_defined_id: nil + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + status: Lithic::Hold::Status::TaggedSymbol, + updated: Time, + currency: String, + events: T::Array[Lithic::HoldEvent], + expiration_datetime: T.nilable(Time), + family: Lithic::Hold::Family::TaggedSymbol, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Hold::Result::TaggedSymbol, + user_defined_id: T.nilable(String) + } + ) + end + def to_hash + end + + # Status of a hold transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Hold::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:PENDING, Lithic::Hold::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Hold::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Hold::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Hold::Status::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Hold::Status::TaggedSymbol) + REVERSED = T.let(:REVERSED, Lithic::Hold::Status::TaggedSymbol) + CANCELED = T.let(:CANCELED, Lithic::Hold::Status::TaggedSymbol) + RETURNED = T.let(:RETURNED, Lithic::Hold::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Hold::Status::TaggedSymbol]) } + def self.values + end + end + + # HOLD - Hold Transaction + module Family + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Hold::Family) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOLD = T.let(:HOLD, Lithic::Hold::Family::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Hold::Family::TaggedSymbol]) } + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Hold::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = T.let(:APPROVED, Lithic::Hold::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Hold::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Hold::Result::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/hold_create_params.rbi b/rbi/lithic/models/hold_create_params.rbi new file mode 100644 index 00000000..4a1c6ba4 --- /dev/null +++ b/rbi/lithic/models/hold_create_params.rbi @@ -0,0 +1,90 @@ +# typed: strong + +module Lithic + module Models + class HoldCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::HoldCreateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + # Amount to hold in cents + sig { returns(Integer) } + attr_accessor :amount + + # Customer-provided token for idempotency. Becomes the hold token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # When the hold should auto-expire + sig { returns(T.nilable(Time)) } + attr_reader :expiration_datetime + + sig { params(expiration_datetime: Time).void } + attr_writer :expiration_datetime + + # Reason for the hold + sig { returns(T.nilable(String)) } + attr_accessor :memo + + # User-provided identifier for the hold + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: T.nilable(String), + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + # Amount to hold in cents + amount:, + # Customer-provided token for idempotency. Becomes the hold token. + token: nil, + # When the hold should auto-expire + expiration_datetime: nil, + # Reason for the hold + memo: nil, + # User-provided identifier for the hold + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: T.nilable(String), + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/hold_event.rbi b/rbi/lithic/models/hold_event.rbi new file mode 100644 index 00000000..326279d2 --- /dev/null +++ b/rbi/lithic/models/hold_event.rbi @@ -0,0 +1,148 @@ +# typed: strong + +module Lithic + module Models + class HoldEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::HoldEvent, Lithic::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :token + + # Amount in cents + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created + + sig { returns(T::Array[Lithic::HoldEvent::DetailedResult::TaggedSymbol]) } + attr_accessor :detailed_results + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(Lithic::HoldEvent::Result::TaggedSymbol) } + attr_accessor :result + + # Transaction token of the payment that settled this hold (only populated for + # HOLD_SETTLED events) + sig { returns(T.nilable(String)) } + attr_accessor :settling_transaction_token + + # Type of hold lifecycle event + sig { returns(Lithic::HoldEvent::Type::TaggedSymbol) } + attr_accessor :type + + # Event representing a lifecycle change to a hold + sig do + params( + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[Lithic::HoldEvent::DetailedResult::OrSymbol], + memo: T.nilable(String), + result: Lithic::HoldEvent::Result::OrSymbol, + settling_transaction_token: T.nilable(String), + type: Lithic::HoldEvent::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + token:, + # Amount in cents + amount:, + created:, + detailed_results:, + memo:, + result:, + # Transaction token of the payment that settled this hold (only populated for + # HOLD_SETTLED events) + settling_transaction_token:, + # Type of hold lifecycle event + type: + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[Lithic::HoldEvent::DetailedResult::TaggedSymbol], + memo: T.nilable(String), + result: Lithic::HoldEvent::Result::TaggedSymbol, + settling_transaction_token: T.nilable(String), + type: Lithic::HoldEvent::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::HoldEvent::DetailedResult) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::HoldEvent::DetailedResult::TaggedSymbol) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::HoldEvent::DetailedResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::HoldEvent::DetailedResult::TaggedSymbol] + ) + end + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::HoldEvent::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = T.let(:APPROVED, Lithic::HoldEvent::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::HoldEvent::Result::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::HoldEvent::Result::TaggedSymbol]) + end + def self.values + end + end + + # Type of hold lifecycle event + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::HoldEvent::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOLD_INITIATED = + T.let(:HOLD_INITIATED, Lithic::HoldEvent::Type::TaggedSymbol) + HOLD_VOIDED = T.let(:HOLD_VOIDED, Lithic::HoldEvent::Type::TaggedSymbol) + HOLD_EXPIRED = + T.let(:HOLD_EXPIRED, Lithic::HoldEvent::Type::TaggedSymbol) + HOLD_SETTLED = + T.let(:HOLD_SETTLED, Lithic::HoldEvent::Type::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::HoldEvent::Type::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/hold_list_params.rbi b/rbi/lithic/models/hold_list_params.rbi new file mode 100644 index 00000000..a4ef08ae --- /dev/null +++ b/rbi/lithic/models/hold_list_params.rbi @@ -0,0 +1,137 @@ +# typed: strong + +module Lithic + module Models + class HoldListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::HoldListParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Hold status to filter by. + sig { returns(T.nilable(Lithic::HoldListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::HoldListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::HoldListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Hold status to filter by. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::HoldListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Hold status to filter by. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::HoldListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:PENDING, Lithic::HoldListParams::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::HoldListParams::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::HoldListParams::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::HoldListParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::HoldListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/hold_retrieve_params.rbi b/rbi/lithic/models/hold_retrieve_params.rbi new file mode 100644 index 00000000..5f71341b --- /dev/null +++ b/rbi/lithic/models/hold_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class HoldRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::HoldRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :hold_token + + sig do + params( + hold_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(hold_token:, request_options: {}) + end + + sig do + override.returns( + { hold_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/hold_void_params.rbi b/rbi/lithic/models/hold_void_params.rbi new file mode 100644 index 00000000..6a7d0f6a --- /dev/null +++ b/rbi/lithic/models/hold_void_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Lithic + module Models + class HoldVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::HoldVoidParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :hold_token + + # Reason for voiding the hold + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig do + params( + hold_token: String, + memo: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + hold_token:, + # Reason for voiding the hold + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + hold_token: String, + memo: T.nilable(String), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/instance_financial_account_type.rbi b/rbi/lithic/models/instance_financial_account_type.rbi index b79ccf95..ca5a748d 100644 --- a/rbi/lithic/models/instance_financial_account_type.rbi +++ b/rbi/lithic/models/instance_financial_account_type.rbi @@ -45,6 +45,11 @@ module Lithic :PROGRAM_BANK_ACCOUNTS_PAYABLE, Lithic::InstanceFinancialAccountType::TaggedSymbol ) + EARLY_DIRECT_DEPOSIT_FLOAT = + T.let( + :EARLY_DIRECT_DEPOSIT_FLOAT, + Lithic::InstanceFinancialAccountType::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/lithic/models/payment.rbi b/rbi/lithic/models/payment.rbi index 28dd76eb..9d6acaa4 100644 --- a/rbi/lithic/models/payment.rbi +++ b/rbi/lithic/models/payment.rbi @@ -260,6 +260,7 @@ module Lithic :MANAGEMENT_DISBURSEMENT, Lithic::Payment::Category::TaggedSymbol ) + HOLD = T.let(:HOLD, Lithic::Payment::Category::TaggedSymbol) PROGRAM_FUNDING = T.let(:PROGRAM_FUNDING, Lithic::Payment::Category::TaggedSymbol) diff --git a/rbi/lithic/resources/holds.rbi b/rbi/lithic/resources/holds.rbi new file mode 100644 index 00000000..5e0d7556 --- /dev/null +++ b/rbi/lithic/resources/holds.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Lithic + module Resources + class Holds + # Create a hold on a financial account. Holds reserve funds by moving them from + # available to pending balance. They can be resolved via settlement (linked to a + # payment or book transfer), voiding, or expiration. + sig do + params( + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: T.nilable(String), + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Hold) + end + def create( + # Globally unique identifier for the financial account. + financial_account_token, + # Amount to hold in cents + amount:, + # Customer-provided token for idempotency. Becomes the hold token. + token: nil, + # When the hold should auto-expire + expiration_datetime: nil, + # Reason for the hold + memo: nil, + # User-provided identifier for the hold + user_defined_id: nil, + request_options: {} + ) + end + + # Get hold by token. + sig do + params( + hold_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Hold) + end + def retrieve( + # Globally unique identifier for the hold. + hold_token, + request_options: {} + ) + end + + # List holds for a financial account. + sig do + params( + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::HoldListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::Hold]) + end + def list( + # Globally unique identifier for the financial account. + financial_account_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Hold status to filter by. + status: nil, + request_options: {} + ) + end + + # Void an active hold. This returns the held funds from pending back to available + # balance. Only holds in PENDING status can be voided. + sig do + params( + hold_token: String, + memo: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Hold) + end + def void( + # Globally unique identifier for the hold. + hold_token, + # Reason for voiding the hold + memo: 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 2f67db75..aed961cf 100644 --- a/sig/lithic/client.rbs +++ b/sig/lithic/client.rbs @@ -75,6 +75,8 @@ module Lithic attr_reader network_programs: Lithic::Resources::NetworkPrograms + attr_reader holds: Lithic::Resources::Holds + attr_reader account_activity: Lithic::Resources::AccountActivity attr_reader transfer_limits: Lithic::Resources::TransferLimits diff --git a/sig/lithic/models.rbs b/sig/lithic/models.rbs index e6145869..bd674a55 100644 --- a/sig/lithic/models.rbs +++ b/sig/lithic/models.rbs @@ -317,6 +317,18 @@ module Lithic class FundingEventRetrieveParams = Lithic::Models::FundingEventRetrieveParams + class Hold = Lithic::Models::Hold + + class HoldCreateParams = Lithic::Models::HoldCreateParams + + class HoldEvent = Lithic::Models::HoldEvent + + class HoldListParams = Lithic::Models::HoldListParams + + class HoldRetrieveParams = Lithic::Models::HoldRetrieveParams + + class HoldVoidParams = Lithic::Models::HoldVoidParams + module InstanceFinancialAccountType = Lithic::Models::InstanceFinancialAccountType class InternalTransactionAPI = Lithic::Models::InternalTransactionAPI diff --git a/sig/lithic/models/account_activity_list_params.rbs b/sig/lithic/models/account_activity_list_params.rbs index a31eb799..3b80e4ae 100644 --- a/sig/lithic/models/account_activity_list_params.rbs +++ b/sig/lithic/models/account_activity_list_params.rbs @@ -120,6 +120,7 @@ module Lithic | :MANAGEMENT_FEE | :MANAGEMENT_REWARD | :MANAGEMENT_DISBURSEMENT + | :HOLD | :PROGRAM_FUNDING module Category @@ -144,6 +145,7 @@ module Lithic MANAGEMENT_FEE: :MANAGEMENT_FEE MANAGEMENT_REWARD: :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD PROGRAM_FUNDING: :PROGRAM_FUNDING def self?.values: -> ::Array[Lithic::Models::AccountActivityListParams::category] diff --git a/sig/lithic/models/account_activity_list_response.rbs b/sig/lithic/models/account_activity_list_response.rbs index ecae23ac..e22aa141 100644 --- a/sig/lithic/models/account_activity_list_response.rbs +++ b/sig/lithic/models/account_activity_list_response.rbs @@ -7,6 +7,7 @@ module Lithic | Lithic::Payment | Lithic::ExternalPayment | Lithic::ManagementOperationTransaction + | Lithic::Hold module AccountActivityListResponse extend Lithic::Internal::Type::Union @@ -107,6 +108,7 @@ module Lithic | :MANAGEMENT_FEE | :MANAGEMENT_REWARD | :MANAGEMENT_DISBURSEMENT + | :HOLD | :PROGRAM_FUNDING module Category @@ -131,6 +133,7 @@ module Lithic MANAGEMENT_FEE: :MANAGEMENT_FEE MANAGEMENT_REWARD: :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD PROGRAM_FUNDING: :PROGRAM_FUNDING def self?.values: -> ::Array[Lithic::Models::AccountActivityListResponse::Internal::category] diff --git a/sig/lithic/models/account_activity_retrieve_transaction_response.rbs b/sig/lithic/models/account_activity_retrieve_transaction_response.rbs index 2f67c0db..c94598cb 100644 --- a/sig/lithic/models/account_activity_retrieve_transaction_response.rbs +++ b/sig/lithic/models/account_activity_retrieve_transaction_response.rbs @@ -7,6 +7,7 @@ module Lithic | Lithic::Payment | Lithic::ExternalPayment | Lithic::ManagementOperationTransaction + | Lithic::Hold module AccountActivityRetrieveTransactionResponse extend Lithic::Internal::Type::Union @@ -107,6 +108,7 @@ module Lithic | :MANAGEMENT_FEE | :MANAGEMENT_REWARD | :MANAGEMENT_DISBURSEMENT + | :HOLD | :PROGRAM_FUNDING module Category @@ -131,6 +133,7 @@ module Lithic MANAGEMENT_FEE: :MANAGEMENT_FEE MANAGEMENT_REWARD: :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD PROGRAM_FUNDING: :PROGRAM_FUNDING def self?.values: -> ::Array[Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::category] diff --git a/sig/lithic/models/financial_account.rbs b/sig/lithic/models/financial_account.rbs index c2faa523..45ac5404 100644 --- a/sig/lithic/models/financial_account.rbs +++ b/sig/lithic/models/financial_account.rbs @@ -168,6 +168,7 @@ module Lithic | :PROGRAM_RECEIVABLES | :COLLECTION | :PROGRAM_BANK_ACCOUNTS_PAYABLE + | :EARLY_DIRECT_DEPOSIT_FLOAT module Type extend Lithic::Internal::Type::Enum @@ -182,6 +183,7 @@ module Lithic PROGRAM_RECEIVABLES: :PROGRAM_RECEIVABLES COLLECTION: :COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE: :PROGRAM_BANK_ACCOUNTS_PAYABLE + EARLY_DIRECT_DEPOSIT_FLOAT: :EARLY_DIRECT_DEPOSIT_FLOAT def self?.values: -> ::Array[Lithic::Models::FinancialAccount::type_] end diff --git a/sig/lithic/models/financial_account_list_params.rbs b/sig/lithic/models/financial_account_list_params.rbs index 6e8ea1fd..78f75425 100644 --- a/sig/lithic/models/financial_account_list_params.rbs +++ b/sig/lithic/models/financial_account_list_params.rbs @@ -40,7 +40,12 @@ module Lithic request_options: Lithic::RequestOptions } - type type_ = :ISSUING | :OPERATING | :RESERVE | :SECURITY + type type_ = + :ISSUING + | :OPERATING + | :RESERVE + | :SECURITY + | :EARLY_DIRECT_DEPOSIT_FLOAT module Type extend Lithic::Internal::Type::Enum @@ -49,6 +54,7 @@ module Lithic OPERATING: :OPERATING RESERVE: :RESERVE SECURITY: :SECURITY + EARLY_DIRECT_DEPOSIT_FLOAT: :EARLY_DIRECT_DEPOSIT_FLOAT def self?.values: -> ::Array[Lithic::Models::FinancialAccountListParams::type_] end diff --git a/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs index feb7696e..8cbfe501 100644 --- a/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs +++ b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs @@ -120,6 +120,7 @@ module Lithic | :MANAGEMENT_FEE | :MANAGEMENT_REWARD | :MANAGEMENT_DISBURSEMENT + | :HOLD | :PROGRAM_FUNDING module Category @@ -144,6 +145,7 @@ module Lithic MANAGEMENT_FEE: :MANAGEMENT_FEE MANAGEMENT_REWARD: :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD PROGRAM_FUNDING: :PROGRAM_FUNDING def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category] diff --git a/sig/lithic/models/hold.rbs b/sig/lithic/models/hold.rbs new file mode 100644 index 00000000..6cad69bc --- /dev/null +++ b/sig/lithic/models/hold.rbs @@ -0,0 +1,137 @@ +module Lithic + module Models + type hold = + { + token: String, + created: Time, + status: Lithic::Models::Hold::status, + updated: Time, + currency: String, + events: ::Array[Lithic::HoldEvent], + expiration_datetime: Time?, + family: Lithic::Models::Hold::family, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::Hold::result, + user_defined_id: String? + } + + class Hold < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor status: Lithic::Models::Hold::status + + attr_accessor updated: Time + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader events: ::Array[Lithic::HoldEvent]? + + def events=: (::Array[Lithic::HoldEvent]) -> ::Array[Lithic::HoldEvent] + + attr_accessor expiration_datetime: Time? + + attr_reader family: Lithic::Models::Hold::family? + + def family=: ( + Lithic::Models::Hold::family + ) -> Lithic::Models::Hold::family + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader pending_amount: Integer? + + def pending_amount=: (Integer) -> Integer + + attr_reader result: Lithic::Models::Hold::result? + + def result=: ( + Lithic::Models::Hold::result + ) -> Lithic::Models::Hold::result + + attr_accessor user_defined_id: String? + + def initialize: ( + token: String, + created: Time, + status: Lithic::Models::Hold::status, + updated: Time, + ?currency: String, + ?events: ::Array[Lithic::HoldEvent], + ?expiration_datetime: Time?, + ?family: Lithic::Models::Hold::family, + ?financial_account_token: String, + ?pending_amount: Integer, + ?result: Lithic::Models::Hold::result, + ?user_defined_id: String? + ) -> void + + def to_hash: -> { + token: String, + created: Time, + status: Lithic::Models::Hold::status, + updated: Time, + currency: String, + events: ::Array[Lithic::HoldEvent], + expiration_datetime: Time?, + family: Lithic::Models::Hold::family, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::Hold::result, + user_defined_id: String? + } + + type status = + :PENDING + | :SETTLED + | :EXPIRED + | :VOIDED + | :DECLINED + | :REVERSED + | :CANCELED + | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + EXPIRED: :EXPIRED + VOIDED: :VOIDED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::Hold::status] + end + + type family = :HOLD + + module Family + extend Lithic::Internal::Type::Enum + + HOLD: :HOLD + + def self?.values: -> ::Array[Lithic::Models::Hold::family] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Hold::result] + end + end + end +end diff --git a/sig/lithic/models/hold_create_params.rbs b/sig/lithic/models/hold_create_params.rbs new file mode 100644 index 00000000..829d7f61 --- /dev/null +++ b/sig/lithic/models/hold_create_params.rbs @@ -0,0 +1,57 @@ +module Lithic + module Models + type hold_create_params = + { + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: String?, + user_defined_id: String + } + & Lithic::Internal::Type::request_parameters + + class HoldCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor amount: Integer + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader expiration_datetime: Time? + + def expiration_datetime=: (Time) -> Time + + attr_accessor memo: String? + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + financial_account_token: String, + amount: Integer, + ?token: String, + ?expiration_datetime: Time, + ?memo: String?, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: String?, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/hold_event.rbs b/sig/lithic/models/hold_event.rbs new file mode 100644 index 00000000..46a50e0f --- /dev/null +++ b/sig/lithic/models/hold_event.rbs @@ -0,0 +1,91 @@ +module Lithic + module Models + type hold_event = + { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::HoldEvent::detailed_result], + memo: String?, + result: Lithic::Models::HoldEvent::result, + settling_transaction_token: String?, + type: Lithic::Models::HoldEvent::type_ + } + + class HoldEvent < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::HoldEvent::detailed_result] + + attr_accessor memo: String? + + attr_accessor result: Lithic::Models::HoldEvent::result + + attr_accessor settling_transaction_token: String? + + attr_accessor type: Lithic::Models::HoldEvent::type_ + + def initialize: ( + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::HoldEvent::detailed_result], + memo: String?, + result: Lithic::Models::HoldEvent::result, + settling_transaction_token: String?, + type: Lithic::Models::HoldEvent::type_ + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::HoldEvent::detailed_result], + memo: String?, + result: Lithic::Models::HoldEvent::result, + settling_transaction_token: String?, + type: Lithic::Models::HoldEvent::type_ + } + + type detailed_result = :APPROVED | :INSUFFICIENT_FUNDS + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::HoldEvent::detailed_result] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::HoldEvent::result] + end + + type type_ = + :HOLD_INITIATED | :HOLD_VOIDED | :HOLD_EXPIRED | :HOLD_SETTLED + + module Type + extend Lithic::Internal::Type::Enum + + HOLD_INITIATED: :HOLD_INITIATED + HOLD_VOIDED: :HOLD_VOIDED + HOLD_EXPIRED: :HOLD_EXPIRED + HOLD_SETTLED: :HOLD_SETTLED + + def self?.values: -> ::Array[Lithic::Models::HoldEvent::type_] + end + end + end +end diff --git a/sig/lithic/models/hold_list_params.rbs b/sig/lithic/models/hold_list_params.rbs new file mode 100644 index 00000000..b8f95641 --- /dev/null +++ b/sig/lithic/models/hold_list_params.rbs @@ -0,0 +1,83 @@ +module Lithic + module Models + type hold_list_params = + { + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::HoldListParams::status + } + & Lithic::Internal::Type::request_parameters + + class HoldListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::HoldListParams::status? + + def status=: ( + Lithic::Models::HoldListParams::status + ) -> Lithic::Models::HoldListParams::status + + def initialize: ( + financial_account_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::HoldListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::HoldListParams::status, + request_options: Lithic::RequestOptions + } + + type status = :PENDING | :SETTLED | :EXPIRED | :VOIDED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + EXPIRED: :EXPIRED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::HoldListParams::status] + end + end + end +end diff --git a/sig/lithic/models/hold_retrieve_params.rbs b/sig/lithic/models/hold_retrieve_params.rbs new file mode 100644 index 00000000..0792505e --- /dev/null +++ b/sig/lithic/models/hold_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type hold_retrieve_params = + { hold_token: String } & Lithic::Internal::Type::request_parameters + + class HoldRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor hold_token: String + + def initialize: ( + hold_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + hold_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/hold_void_params.rbs b/sig/lithic/models/hold_void_params.rbs new file mode 100644 index 00000000..c788a86f --- /dev/null +++ b/sig/lithic/models/hold_void_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type hold_void_params = + { hold_token: String, memo: String? } + & Lithic::Internal::Type::request_parameters + + class HoldVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor hold_token: String + + attr_accessor memo: String? + + def initialize: ( + hold_token: String, + ?memo: String?, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + hold_token: String, + memo: String?, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/instance_financial_account_type.rbs b/sig/lithic/models/instance_financial_account_type.rbs index 0948a7ed..b1a4a5ca 100644 --- a/sig/lithic/models/instance_financial_account_type.rbs +++ b/sig/lithic/models/instance_financial_account_type.rbs @@ -11,6 +11,7 @@ module Lithic | :PROGRAM_RECEIVABLES | :COLLECTION | :PROGRAM_BANK_ACCOUNTS_PAYABLE + | :EARLY_DIRECT_DEPOSIT_FLOAT module InstanceFinancialAccountType extend Lithic::Internal::Type::Enum @@ -25,6 +26,7 @@ module Lithic PROGRAM_RECEIVABLES: :PROGRAM_RECEIVABLES COLLECTION: :COLLECTION PROGRAM_BANK_ACCOUNTS_PAYABLE: :PROGRAM_BANK_ACCOUNTS_PAYABLE + EARLY_DIRECT_DEPOSIT_FLOAT: :EARLY_DIRECT_DEPOSIT_FLOAT def self?.values: -> ::Array[Lithic::Models::instance_financial_account_type] end diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs index e908b268..23f152da 100644 --- a/sig/lithic/models/payment.rbs +++ b/sig/lithic/models/payment.rbs @@ -147,6 +147,7 @@ module Lithic | :MANAGEMENT_FEE | :MANAGEMENT_REWARD | :MANAGEMENT_DISBURSEMENT + | :HOLD | :PROGRAM_FUNDING module Category @@ -171,6 +172,7 @@ module Lithic MANAGEMENT_FEE: :MANAGEMENT_FEE MANAGEMENT_REWARD: :MANAGEMENT_REWARD MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD PROGRAM_FUNDING: :PROGRAM_FUNDING def self?.values: -> ::Array[Lithic::Models::Payment::category] diff --git a/sig/lithic/resources/holds.rbs b/sig/lithic/resources/holds.rbs new file mode 100644 index 00000000..f4725933 --- /dev/null +++ b/sig/lithic/resources/holds.rbs @@ -0,0 +1,39 @@ +module Lithic + module Resources + class Holds + def create: ( + String financial_account_token, + amount: Integer, + ?token: String, + ?expiration_datetime: Time, + ?memo: String?, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Hold + + def retrieve: ( + String hold_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Hold + + def list: ( + String financial_account_token, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::HoldListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Hold] + + def `void`: ( + String hold_token, + ?memo: String?, + ?request_options: Lithic::request_opts + ) -> Lithic::Hold + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/test/lithic/resources/account_activity_test.rb b/test/lithic/resources/account_activity_test.rb index 44082a21..914ee944 100644 --- a/test/lithic/resources/account_activity_test.rb +++ b/test/lithic/resources/account_activity_test.rb @@ -25,6 +25,7 @@ def test_list in Lithic::Payment in Lithic::ExternalPayment in Lithic::ManagementOperationTransaction + in Lithic::Hold end end @@ -121,6 +122,20 @@ def test_list transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries | nil, user_defined_id: String | nil } + in { + family: :HOLD, + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } end end end @@ -140,6 +155,7 @@ def test_retrieve_transaction in Lithic::Payment in Lithic::ExternalPayment in Lithic::ManagementOperationTransaction + in Lithic::Hold end end @@ -236,6 +252,20 @@ def test_retrieve_transaction transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries | nil, user_defined_id: String | nil } + in { + family: :HOLD, + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } end end end diff --git a/test/lithic/resources/holds_test.rb b/test/lithic/resources/holds_test.rb new file mode 100644 index 00000000..eb7932b6 --- /dev/null +++ b/test/lithic/resources/holds_test.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::HoldsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.holds.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", amount: 1) + + assert_pattern do + response => Lithic::Hold + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + family: Lithic::Hold::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end + + def test_retrieve + response = @lithic.holds.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Hold + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + family: Lithic::Hold::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end + + def test_list + response = @lithic.holds.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Hold + end + + assert_pattern do + row => { + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + family: Lithic::Hold::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end + + def test_void + response = @lithic.holds.void("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Hold + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + family: Lithic::Hold::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end +end From 489f19b1c8c76d08aed0a313d45bed73406025b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 15:06:13 +0000 Subject: [PATCH 2/9] chore(internal): codegen related update --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f996785..f67548bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,14 +33,18 @@ jobs: bundle install - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/lithic-ruby' + if: |- + github.repository == 'stainless-sdks/lithic-ruby' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Build and upload gem artifacts - if: github.repository == 'stainless-sdks/lithic-ruby' + if: |- + github.repository == 'stainless-sdks/lithic-ruby' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} From 1dbdb688fffb5909af5c568bb16b2e3f899a6a42 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:10:54 +0000 Subject: [PATCH 3/9] feat(api): add TypeScript code rules, draft version state tracking to auth_rules --- .stats.yml | 6 +- lib/lithic.rb | 3 + lib/lithic/models/auth_rules/auth_rule.rb | 74 +++- lib/lithic/models/auth_rules/rule_feature.rb | 231 ++++++++++ .../auth_rules/typescript_code_parameters.rb | 33 ++ .../models/auth_rules/v2_create_params.rb | 42 +- .../models/auth_rules/v2_draft_params.rb | 9 +- .../v2_retrieve_features_response.rb | 86 +--- .../auth_rules/velocity_limit_filters.rb | 87 ++++ .../auth_rules/velocity_limit_params.rb | 87 +--- lib/lithic/resources/auth_rules/v2.rb | 2 +- rbi/lithic/models/auth_rules/auth_rule.rbi | 110 ++++- rbi/lithic/models/auth_rules/rule_feature.rbi | 414 ++++++++++++++++++ .../auth_rules/typescript_code_parameters.rbi | 94 ++++ .../models/auth_rules/v2_create_params.rbi | 69 ++- .../models/auth_rules/v2_draft_params.rbi | 12 +- .../v2_retrieve_features_response.rbi | 213 +-------- .../auth_rules/velocity_limit_filters.rbi | 205 +++++++++ .../auth_rules/velocity_limit_params.rbi | 210 +-------- rbi/lithic/resources/auth_rules/v2.rbi | 3 +- sig/lithic/models/auth_rules/auth_rule.rbs | 26 ++ sig/lithic/models/auth_rules/rule_feature.rbs | 173 ++++++++ .../auth_rules/typescript_code_parameters.rbs | 27 ++ .../models/auth_rules/v2_create_params.rbs | 9 + .../models/auth_rules/v2_draft_params.rbs | 1 + .../v2_retrieve_features_response.rbs | 84 +--- .../auth_rules/velocity_limit_filters.rbs | 81 ++++ .../auth_rules/velocity_limit_params.rbs | 88 +--- 28 files changed, 1691 insertions(+), 788 deletions(-) create mode 100644 lib/lithic/models/auth_rules/rule_feature.rb create mode 100644 lib/lithic/models/auth_rules/typescript_code_parameters.rb create mode 100644 lib/lithic/models/auth_rules/velocity_limit_filters.rb create mode 100644 rbi/lithic/models/auth_rules/rule_feature.rbi create mode 100644 rbi/lithic/models/auth_rules/typescript_code_parameters.rbi create mode 100644 rbi/lithic/models/auth_rules/velocity_limit_filters.rbi create mode 100644 sig/lithic/models/auth_rules/rule_feature.rbs create mode 100644 sig/lithic/models/auth_rules/typescript_code_parameters.rbs create mode 100644 sig/lithic/models/auth_rules/velocity_limit_filters.rbs diff --git a/.stats.yml b/.stats.yml index b95d916a..31c05d97 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 189 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ee2b9f00d3a9e0000e25abc0774615d6ad3300ce17b2f094e71b0229a907760f.yml -openapi_spec_hash: 01d2cbf4ac692dba2f3831462db929e4 -config_hash: a45e6da4e7b46db4ff6819d1dba5d815 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1e902917b2eae41d549957e790eb6b137969e451efe673815647deba330fe05a.yml +openapi_spec_hash: 82cab06ce65462e60316939db630460a +config_hash: 00b60697e692f86b5be297d939962921 diff --git a/lib/lithic.rb b/lib/lithic.rb index b1b0b3c1..82c1a78b 100644 --- a/lib/lithic.rb +++ b/lib/lithic.rb @@ -126,6 +126,8 @@ require_relative "lithic/models/auth_rules/event_stream" require_relative "lithic/models/auth_rules/merchant_lock_parameters" require_relative "lithic/models/auth_rules/report_stats" +require_relative "lithic/models/auth_rules/rule_feature" +require_relative "lithic/models/auth_rules/typescript_code_parameters" require_relative "lithic/models/auth_rules/v2/backtest_create_params" require_relative "lithic/models/auth_rules/v2/backtest_create_response" require_relative "lithic/models/auth_rules/v2/backtest_retrieve_params" @@ -142,6 +144,7 @@ require_relative "lithic/models/auth_rules/v2_retrieve_report_params" require_relative "lithic/models/auth_rules/v2_retrieve_report_response" require_relative "lithic/models/auth_rules/v2_update_params" +require_relative "lithic/models/auth_rules/velocity_limit_filters" require_relative "lithic/models/auth_rules/velocity_limit_params" require_relative "lithic/models/auth_rules/velocity_limit_period" require_relative "lithic/models/auth_rules_backtest_report_created_webhook_event" diff --git a/lib/lithic/models/auth_rules/auth_rule.rb b/lib/lithic/models/auth_rules/auth_rule.rb index 845b612d..c16bf226 100644 --- a/lib/lithic/models/auth_rules/auth_rule.rb +++ b/lib/lithic/models/auth_rules/auth_rule.rb @@ -82,6 +82,8 @@ class AuthRule < Lithic::Internal::Type::BaseModel # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. # # @return [Symbol, Lithic::Models::AuthRules::AuthRule::Type] required :type, enum: -> { Lithic::AuthRules::AuthRule::Type } @@ -127,7 +129,7 @@ class CurrentVersion < Lithic::Internal::Type::BaseModel # @!attribute parameters # Parameters for the Auth Rule # - # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] required :parameters, union: -> { Lithic::AuthRules::AuthRule::CurrentVersion::Parameters } response_only do @@ -143,7 +145,7 @@ class CurrentVersion < Lithic::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {Lithic::Models::AuthRules::AuthRule::CurrentVersion} for more details. # - # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] Parameters for the Auth Rule + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] Parameters for the Auth Rule # # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan @@ -168,19 +170,44 @@ module Parameters variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + # @!method self.variants - # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters)] + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters)] end end # @see Lithic::Models::AuthRules::AuthRule#draft_version class DraftVersion < Lithic::Internal::Type::BaseModel + # @!attribute error + # An error message if the draft version failed compilation. Populated when `state` + # is `ERROR`, `null` otherwise. + # + # @return [String, nil] + required :error, String, nil?: true + # @!attribute parameters # Parameters for the Auth Rule # - # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] required :parameters, union: -> { Lithic::AuthRules::AuthRule::DraftVersion::Parameters } + # @!attribute state + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + # + # @return [Symbol, Lithic::Models::AuthRules::AuthRule::DraftVersion::State] + required :state, enum: -> { Lithic::AuthRules::AuthRule::DraftVersion::State } + response_only do # @!attribute version # The version of the rule, this is incremented whenever the rule's parameters @@ -190,11 +217,15 @@ class DraftVersion < Lithic::Internal::Type::BaseModel required :version, Integer end - # @!method initialize(parameters:, version:) + # @!method initialize(error:, parameters:, state:, version:) # Some parameter documentations has been truncated, see # {Lithic::Models::AuthRules::AuthRule::DraftVersion} for more details. # - # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] Parameters for the Auth Rule + # @param error [String, nil] An error message if the draft version failed compilation. Populated when `state` + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] Parameters for the Auth Rule + # + # @param state [Symbol, Lithic::Models::AuthRules::AuthRule::DraftVersion::State] The state of the draft version. Most rules are created synchronously and the sta # # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan @@ -219,8 +250,34 @@ module Parameters variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + # @!method self.variants - # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters)] + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters)] + end + + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + # + # @see Lithic::Models::AuthRules::AuthRule::DraftVersion#state + module State + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SHADOWING = :SHADOWING + ERROR = :ERROR + + # @!method self.values + # @return [Array] end end @@ -248,6 +305,8 @@ module State # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. # # @see Lithic::Models::AuthRules::AuthRule#type module Type @@ -257,6 +316,7 @@ module Type VELOCITY_LIMIT = :VELOCITY_LIMIT MERCHANT_LOCK = :MERCHANT_LOCK CONDITIONAL_ACTION = :CONDITIONAL_ACTION + TYPESCRIPT_CODE = :TYPESCRIPT_CODE # @!method self.values # @return [Array] diff --git a/lib/lithic/models/auth_rules/rule_feature.rb b/lib/lithic/models/auth_rules/rule_feature.rb new file mode 100644 index 00000000..17fe22de --- /dev/null +++ b/lib/lithic/models/auth_rules/rule_feature.rb @@ -0,0 +1,231 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # A feature made available to the rule. The `name` field is the variable name used + # in the rule function signature. The `type` field determines which data the + # feature provides to the rule at evaluation time. + # + # - `AUTHORIZATION`: The authorization request being evaluated. Only available for + # AUTHORIZATION event stream rules. + # - `AUTHENTICATION`: The 3DS authentication request being evaluated. Only + # available for THREE_DS_AUTHENTICATION event stream rules. + # - `TOKENIZATION`: The tokenization request being evaluated. Only available for + # TOKENIZATION event stream rules. + # - `ACH_RECEIPT`: The ACH receipt being evaluated. Only available for + # ACH_CREDIT_RECEIPT and ACH_DEBIT_RECEIPT event stream rules. + # - `CARD`: The card associated with the event. Available for AUTHORIZATION and + # THREE_DS_AUTHENTICATION event stream rules. + # - `ACCOUNT_HOLDER`: The account holder associated with the card. Available for + # THREE_DS_AUTHENTICATION event stream rules. + # - `IP_METADATA`: IP address metadata for the request. Available for + # THREE_DS_AUTHENTICATION event stream rules. + # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires + # `scope`, `period`, and optionally `filters` to configure the velocity + # calculation. Available for AUTHORIZATION event stream rules. + module RuleFeature + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::RuleFeature::AuthorizationFeature } + + variant -> { Lithic::AuthRules::RuleFeature::AuthenticationFeature } + + variant -> { Lithic::AuthRules::RuleFeature::TokenizationFeature } + + variant -> { Lithic::AuthRules::RuleFeature::ACHReceiptFeature } + + variant -> { Lithic::AuthRules::RuleFeature::CardFeature } + + variant -> { Lithic::AuthRules::RuleFeature::AccountHolderFeature } + + variant -> { Lithic::AuthRules::RuleFeature::IPMetadataFeature } + + variant -> { Lithic::AuthRules::RuleFeature::SpendVelocityFeature } + + class AuthorizationFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :AUTHORIZATION] + required :type, const: :AUTHORIZATION + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :AUTHORIZATION) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :AUTHORIZATION] + end + + class AuthenticationFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :AUTHENTICATION] + required :type, const: :AUTHENTICATION + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :AUTHENTICATION) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :AUTHENTICATION] + end + + class TokenizationFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :TOKENIZATION] + required :type, const: :TOKENIZATION + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :TOKENIZATION) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :TOKENIZATION] + end + + class ACHReceiptFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :ACH_RECEIPT] + required :type, const: :ACH_RECEIPT + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :ACH_RECEIPT) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :ACH_RECEIPT] + end + + class CardFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :CARD] + required :type, const: :CARD + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :CARD) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :CARD] + end + + class AccountHolderFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :ACCOUNT_HOLDER] + required :type, const: :ACCOUNT_HOLDER + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :ACCOUNT_HOLDER) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :ACCOUNT_HOLDER] + end + + class IPMetadataFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :IP_METADATA] + required :type, const: :IP_METADATA + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :IP_METADATA) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :IP_METADATA] + end + + class SpendVelocityFeature < Lithic::Internal::Type::BaseModel + # @!attribute period + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @return [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] + required :period, union: -> { Lithic::AuthRules::VelocityLimitPeriod } + + # @!attribute scope + # The scope the velocity is calculated for + # + # @return [Symbol, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::Scope] + required :scope, enum: -> { Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope } + + # @!attribute type + # + # @return [Symbol, :SPEND_VELOCITY] + required :type, const: :SPEND_VELOCITY + + # @!attribute filters + # + # @return [Lithic::Models::AuthRules::VelocityLimitFilters, nil] + optional :filters, -> { Lithic::AuthRules::VelocityLimitFilters } + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(period:, scope:, filters: nil, name: nil, type: :SPEND_VELOCITY) + # @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::Scope] The scope the velocity is calculated for + # + # @param filters [Lithic::Models::AuthRules::VelocityLimitFilters] + # + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :SPEND_VELOCITY] + + # The scope the velocity is calculated for + # + # @see Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature)] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/typescript_code_parameters.rb b/lib/lithic/models/auth_rules/typescript_code_parameters.rb new file mode 100644 index 00000000..0eb2bd6a --- /dev/null +++ b/lib/lithic/models/auth_rules/typescript_code_parameters.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel + # @!attribute code + # The TypeScript source code of the rule. Must define a `rule()` function that + # accepts the declared features as positional arguments (in the same order as the + # `features` array) and returns an array of actions. + # + # @return [String] + required :code, String + + # @!attribute features + # Features available to the TypeScript code at evaluation time + # + # @return [Array] + required :features, -> { Lithic::Internal::Type::ArrayOf[union: Lithic::AuthRules::RuleFeature] } + + # @!method initialize(code:, features:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::TypescriptCodeParameters} for more details. + # + # Parameters for defining a TypeScript code rule + # + # @param code [String] The TypeScript source code of the rule. Must define a `rule()` function that acc + # + # @param features [Array] Features available to the TypeScript code at evaluation time + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_create_params.rb b/lib/lithic/models/auth_rules/v2_create_params.rb index 04f18cd5..cae88926 100644 --- a/lib/lithic/models/auth_rules/v2_create_params.rb +++ b/lib/lithic/models/auth_rules/v2_create_params.rb @@ -30,7 +30,7 @@ class AccountLevelRule < Lithic::Internal::Type::BaseModel # @!attribute parameters # Parameters for the Auth Rule # - # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] required :parameters, union: -> { Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Parameters } # @!attribute type @@ -45,6 +45,8 @@ class AccountLevelRule < Lithic::Internal::Type::BaseModel # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. # # @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::Type] required :type, enum: -> { Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type } @@ -78,7 +80,7 @@ class AccountLevelRule < Lithic::Internal::Type::BaseModel # {Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule} for more # details. # - # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] Parameters for the Auth Rule + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] Parameters for the Auth Rule # # @param type [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::Type] The type of Auth Rule. For certain rule types, this determines the event stream # @@ -111,8 +113,11 @@ module Parameters variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + # @!method self.variants - # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters)] + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters)] end # The type of Auth Rule. For certain rule types, this determines the event stream @@ -126,6 +131,8 @@ module Parameters # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. # # @see Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule#type module Type @@ -135,6 +142,7 @@ module Type VELOCITY_LIMIT = :VELOCITY_LIMIT MERCHANT_LOCK = :MERCHANT_LOCK CONDITIONAL_ACTION = :CONDITIONAL_ACTION + TYPESCRIPT_CODE = :TYPESCRIPT_CODE # @!method self.values # @return [Array] @@ -151,7 +159,7 @@ class CardLevelRule < Lithic::Internal::Type::BaseModel # @!attribute parameters # Parameters for the Auth Rule # - # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] required :parameters, union: -> { Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Parameters } # @!attribute type @@ -166,6 +174,8 @@ class CardLevelRule < Lithic::Internal::Type::BaseModel # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. # # @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::Type] required :type, enum: -> { Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type } @@ -189,7 +199,7 @@ class CardLevelRule < Lithic::Internal::Type::BaseModel # # @param card_tokens [Array] Card tokens to which the Auth Rule applies. # - # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] Parameters for the Auth Rule + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] Parameters for the Auth Rule # # @param type [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::Type] The type of Auth Rule. For certain rule types, this determines the event stream # @@ -218,8 +228,11 @@ module Parameters variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + # @!method self.variants - # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters)] + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters)] end # The type of Auth Rule. For certain rule types, this determines the event stream @@ -233,6 +246,8 @@ module Parameters # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. # # @see Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule#type module Type @@ -242,6 +257,7 @@ module Type VELOCITY_LIMIT = :VELOCITY_LIMIT MERCHANT_LOCK = :MERCHANT_LOCK CONDITIONAL_ACTION = :CONDITIONAL_ACTION + TYPESCRIPT_CODE = :TYPESCRIPT_CODE # @!method self.values # @return [Array] @@ -252,7 +268,7 @@ class ProgramLevelRule < Lithic::Internal::Type::BaseModel # @!attribute parameters # Parameters for the Auth Rule # - # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] required :parameters, union: -> { Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Parameters } # @!attribute program_level @@ -273,6 +289,8 @@ class ProgramLevelRule < Lithic::Internal::Type::BaseModel # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. # # @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type] required :type, enum: -> { Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type } @@ -300,7 +318,7 @@ class ProgramLevelRule < Lithic::Internal::Type::BaseModel # {Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule} for more # details. # - # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters] Parameters for the Auth Rule + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters] Parameters for the Auth Rule # # @param program_level [Boolean] Whether the Auth Rule applies to all authorizations on the card program. # @@ -333,8 +351,11 @@ module Parameters variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + # @!method self.variants - # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters)] + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters)] end # The type of Auth Rule. For certain rule types, this determines the event stream @@ -348,6 +369,8 @@ module Parameters # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. # # @see Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule#type module Type @@ -357,6 +380,7 @@ module Type VELOCITY_LIMIT = :VELOCITY_LIMIT MERCHANT_LOCK = :MERCHANT_LOCK CONDITIONAL_ACTION = :CONDITIONAL_ACTION + TYPESCRIPT_CODE = :TYPESCRIPT_CODE # @!method self.values # @return [Array] diff --git a/lib/lithic/models/auth_rules/v2_draft_params.rb b/lib/lithic/models/auth_rules/v2_draft_params.rb index 5f2da570..022e5927 100644 --- a/lib/lithic/models/auth_rules/v2_draft_params.rb +++ b/lib/lithic/models/auth_rules/v2_draft_params.rb @@ -16,13 +16,13 @@ class V2DraftParams < Lithic::Internal::Type::BaseModel # @!attribute parameters # Parameters for the Auth Rule # - # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, nil] + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, nil] optional :parameters, union: -> { Lithic::AuthRules::V2DraftParams::Parameters }, nil?: true # @!method initialize(auth_rule_token:, parameters: nil, request_options: {}) # @param auth_rule_token [String] # - # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, nil] Parameters for the Auth Rule + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, nil] Parameters for the Auth Rule # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] @@ -45,8 +45,11 @@ module Parameters variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + # @!method self.variants - # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters)] + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters)] end end end diff --git a/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb b/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb index 6940a8e2..0b651932 100644 --- a/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb +++ b/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb @@ -26,8 +26,8 @@ class V2RetrieveFeaturesResponse < Lithic::Internal::Type::BaseModel class Feature < Lithic::Internal::Type::BaseModel # @!attribute filters # - # @return [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters] - required :filters, -> { Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters } + # @return [Lithic::Models::AuthRules::VelocityLimitFilters] + required :filters, -> { Lithic::AuthRules::VelocityLimitFilters } # @!attribute period # Velocity over the current day since 00:00 / 12 AM in Eastern Time @@ -47,7 +47,7 @@ class Feature < Lithic::Internal::Type::BaseModel required :value, -> { Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value } # @!method initialize(filters:, period:, scope:, value:) - # @param filters [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters] + # @param filters [Lithic::Models::AuthRules::VelocityLimitFilters] # # @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] Velocity over the current day since 00:00 / 12 AM in Eastern Time # @@ -55,86 +55,6 @@ class Feature < Lithic::Internal::Type::BaseModel # # @param value [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value] - # @see Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature#filters - class Filters < Lithic::Internal::Type::BaseModel - # @!attribute exclude_countries - # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. - # Transactions matching any of the provided will be excluded from the calculated - # velocity. - # - # @return [Array, nil] - optional :exclude_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute exclude_mccs - # Merchant Category Codes to exclude from the velocity calculation. Transactions - # matching this MCC will be excluded from the calculated velocity. - # - # @return [Array, nil] - optional :exclude_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute include_countries - # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. - # Transactions not matching any of the provided will not be included in the - # calculated velocity. - # - # @return [Array, nil] - optional :include_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute include_mccs - # Merchant Category Codes to include in the velocity calculation. Transactions not - # matching this MCC will not be included in the calculated velocity. - # - # @return [Array, nil] - optional :include_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute include_pan_entry_modes - # PAN entry modes to include in the velocity calculation. Transactions not - # matching any of the provided will not be included in the calculated velocity. - # - # @return [Array, nil] - optional :include_pan_entry_modes, - -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode] }, - nil?: true - - # @!method initialize(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil, include_pan_entry_modes: nil) - # Some parameter documentations has been truncated, see - # {Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters} for - # more details. - # - # @param exclude_countries [Array, nil] ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Trans - # - # @param exclude_mccs [Array, nil] Merchant Category Codes to exclude from the velocity calculation. Transactions m - # - # @param include_countries [Array, nil] ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transac - # - # @param include_mccs [Array, nil] Merchant Category Codes to include in the velocity calculation. Transactions not - # - # @param include_pan_entry_modes [Array, nil] PAN entry modes to include in the velocity calculation. Transactions not matchin - - module IncludePanEntryMode - extend Lithic::Internal::Type::Enum - - AUTO_ENTRY = :AUTO_ENTRY - BAR_CODE = :BAR_CODE - CONTACTLESS = :CONTACTLESS - CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE - ECOMMERCE = :ECOMMERCE - ERROR_KEYED = :ERROR_KEYED - ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE - ICC = :ICC - KEY_ENTERED = :KEY_ENTERED - MAGNETIC_STRIPE = :MAGNETIC_STRIPE - MANUAL = :MANUAL - OCR = :OCR - SECURE_CARDLESS = :SECURE_CARDLESS - UNSPECIFIED = :UNSPECIFIED - UNKNOWN = :UNKNOWN - - # @!method self.values - # @return [Array] - end - end - # The scope the velocity is calculated for # # @see Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature#scope diff --git a/lib/lithic/models/auth_rules/velocity_limit_filters.rb b/lib/lithic/models/auth_rules/velocity_limit_filters.rb new file mode 100644 index 00000000..7966a44b --- /dev/null +++ b/lib/lithic/models/auth_rules/velocity_limit_filters.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class VelocityLimitFilters < Lithic::Internal::Type::BaseModel + # @!attribute exclude_countries + # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + # Transactions matching any of the provided will be excluded from the calculated + # velocity. + # + # @return [Array, nil] + optional :exclude_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute exclude_mccs + # Merchant Category Codes to exclude from the velocity calculation. Transactions + # matching this MCC will be excluded from the calculated velocity. + # + # @return [Array, nil] + optional :exclude_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute include_countries + # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + # Transactions not matching any of the provided will not be included in the + # calculated velocity. + # + # @return [Array, nil] + optional :include_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute include_mccs + # Merchant Category Codes to include in the velocity calculation. Transactions not + # matching this MCC will not be included in the calculated velocity. + # + # @return [Array, nil] + optional :include_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute include_pan_entry_modes + # PAN entry modes to include in the velocity calculation. Transactions not + # matching any of the provided will not be included in the calculated velocity. + # + # @return [Array, nil] + optional :include_pan_entry_modes, + -> { + Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode] + }, + nil?: true + + # @!method initialize(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil, include_pan_entry_modes: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::VelocityLimitFilters} for more details. + # + # @param exclude_countries [Array, nil] ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Trans + # + # @param exclude_mccs [Array, nil] Merchant Category Codes to exclude from the velocity calculation. Transactions m + # + # @param include_countries [Array, nil] ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transac + # + # @param include_mccs [Array, nil] Merchant Category Codes to include in the velocity calculation. Transactions not + # + # @param include_pan_entry_modes [Array, nil] PAN entry modes to include in the velocity calculation. Transactions not matchin + + module IncludePanEntryMode + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY = :AUTO_ENTRY + BAR_CODE = :BAR_CODE + CONTACTLESS = :CONTACTLESS + CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE + ECOMMERCE = :ECOMMERCE + ERROR_KEYED = :ERROR_KEYED + ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE + ICC = :ICC + KEY_ENTERED = :KEY_ENTERED + MAGNETIC_STRIPE = :MAGNETIC_STRIPE + MANUAL = :MANUAL + OCR = :OCR + SECURE_CARDLESS = :SECURE_CARDLESS + UNSPECIFIED = :UNSPECIFIED + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/velocity_limit_params.rb b/lib/lithic/models/auth_rules/velocity_limit_params.rb index 55b2d7a4..fab01fca 100644 --- a/lib/lithic/models/auth_rules/velocity_limit_params.rb +++ b/lib/lithic/models/auth_rules/velocity_limit_params.rb @@ -18,8 +18,8 @@ class VelocityLimitParams < Lithic::Internal::Type::BaseModel # @!attribute filters # - # @return [Lithic::Models::AuthRules::VelocityLimitParams::Filters, nil] - optional :filters, -> { Lithic::AuthRules::VelocityLimitParams::Filters } + # @return [Lithic::Models::AuthRules::VelocityLimitFilters, nil] + optional :filters, -> { Lithic::AuthRules::VelocityLimitFilters } # @!attribute limit_amount # The maximum amount of spend velocity allowed in the period in minor units (the @@ -47,7 +47,7 @@ class VelocityLimitParams < Lithic::Internal::Type::BaseModel # # @param scope [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] The scope the velocity is calculated for # - # @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters] + # @param filters [Lithic::Models::AuthRules::VelocityLimitFilters] # # @param limit_amount [Integer, nil] The maximum amount of spend velocity allowed in the period in minor units (the s # @@ -65,87 +65,6 @@ module Scope # @!method self.values # @return [Array] end - - # @see Lithic::Models::AuthRules::VelocityLimitParams#filters - class Filters < Lithic::Internal::Type::BaseModel - # @!attribute exclude_countries - # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. - # Transactions matching any of the provided will be excluded from the calculated - # velocity. - # - # @return [Array, nil] - optional :exclude_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute exclude_mccs - # Merchant Category Codes to exclude from the velocity calculation. Transactions - # matching this MCC will be excluded from the calculated velocity. - # - # @return [Array, nil] - optional :exclude_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute include_countries - # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. - # Transactions not matching any of the provided will not be included in the - # calculated velocity. - # - # @return [Array, nil] - optional :include_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute include_mccs - # Merchant Category Codes to include in the velocity calculation. Transactions not - # matching this MCC will not be included in the calculated velocity. - # - # @return [Array, nil] - optional :include_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true - - # @!attribute include_pan_entry_modes - # PAN entry modes to include in the velocity calculation. Transactions not - # matching any of the provided will not be included in the calculated velocity. - # - # @return [Array, nil] - optional :include_pan_entry_modes, - -> { - Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode] - }, - nil?: true - - # @!method initialize(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil, include_pan_entry_modes: nil) - # Some parameter documentations has been truncated, see - # {Lithic::Models::AuthRules::VelocityLimitParams::Filters} for more details. - # - # @param exclude_countries [Array, nil] ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Trans - # - # @param exclude_mccs [Array, nil] Merchant Category Codes to exclude from the velocity calculation. Transactions m - # - # @param include_countries [Array, nil] ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transac - # - # @param include_mccs [Array, nil] Merchant Category Codes to include in the velocity calculation. Transactions not - # - # @param include_pan_entry_modes [Array, nil] PAN entry modes to include in the velocity calculation. Transactions not matchin - - module IncludePanEntryMode - extend Lithic::Internal::Type::Enum - - AUTO_ENTRY = :AUTO_ENTRY - BAR_CODE = :BAR_CODE - CONTACTLESS = :CONTACTLESS - CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE - ECOMMERCE = :ECOMMERCE - ERROR_KEYED = :ERROR_KEYED - ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE - ICC = :ICC - KEY_ENTERED = :KEY_ENTERED - MAGNETIC_STRIPE = :MAGNETIC_STRIPE - MANUAL = :MANUAL - OCR = :OCR - SECURE_CARDLESS = :SECURE_CARDLESS - UNSPECIFIED = :UNSPECIFIED - UNKNOWN = :UNKNOWN - - # @!method self.values - # @return [Array] - end - end end end end diff --git a/lib/lithic/resources/auth_rules/v2.rb b/lib/lithic/resources/auth_rules/v2.rb index 89116b89..56f1cf90 100644 --- a/lib/lithic/resources/auth_rules/v2.rb +++ b/lib/lithic/resources/auth_rules/v2.rb @@ -144,7 +144,7 @@ def delete(auth_rule_token, params = {}) # # @param auth_rule_token [String] # - # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, nil] Parameters for the Auth Rule + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, nil] Parameters for the Auth Rule # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/rbi/lithic/models/auth_rules/auth_rule.rbi b/rbi/lithic/models/auth_rules/auth_rule.rbi index c3ab200e..98d60444 100644 --- a/rbi/lithic/models/auth_rules/auth_rule.rbi +++ b/rbi/lithic/models/auth_rules/auth_rule.rbi @@ -81,6 +81,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. sig { returns(Lithic::AuthRules::AuthRule::Type::TaggedSymbol) } attr_accessor :type @@ -143,6 +145,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. type:, # Card tokens to which the Auth Rule does not apply. excluded_card_tokens: nil @@ -205,7 +209,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters::OrHash, Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, Lithic::AuthRules::ConditionalACHActionParameters::OrHash, - Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash ), version: Integer ).returns(T.attached_class) @@ -244,7 +249,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) end @@ -269,6 +275,11 @@ module Lithic ) end + # An error message if the draft version failed compilation. Populated when `state` + # is `ERROR`, `null` otherwise. + sig { returns(T.nilable(String)) } + attr_accessor :error + # Parameters for the Auth Rule sig do returns( @@ -277,6 +288,23 @@ module Lithic end attr_accessor :parameters + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + sig do + returns( + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ) + end + attr_accessor :state + # The version of the rule, this is incremented whenever the rule's parameters # change. sig { returns(Integer) } @@ -284,6 +312,7 @@ module Lithic sig do params( + error: T.nilable(String), parameters: T.any( Lithic::AuthRules::ConditionalBlockParameters::OrHash, @@ -292,14 +321,30 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters::OrHash, Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, Lithic::AuthRules::ConditionalACHActionParameters::OrHash, - Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash ), + state: Lithic::AuthRules::AuthRule::DraftVersion::State::OrSymbol, version: Integer ).returns(T.attached_class) end def self.new( + # An error message if the draft version failed compilation. Populated when `state` + # is `ERROR`, `null` otherwise. + error:, # Parameters for the Auth Rule parameters:, + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + state:, # The version of the rule, this is incremented whenever the rule's parameters # change. version: @@ -309,8 +354,11 @@ module Lithic sig do override.returns( { + error: T.nilable(String), parameters: Lithic::AuthRules::AuthRule::DraftVersion::Parameters::Variants, + state: + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol, version: Integer } ) @@ -331,7 +379,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) end @@ -345,6 +394,52 @@ module Lithic def self.variants end end + + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::AuthRule::DraftVersion::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ) + SHADOWING = + T.let( + :SHADOWING, + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ] + ) + end + def self.values + end + end end # The state of the Auth Rule @@ -380,6 +475,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. module Type extend Lithic::Internal::Type::Enum @@ -407,6 +504,11 @@ module Lithic :CONDITIONAL_ACTION, Lithic::AuthRules::AuthRule::Type::TaggedSymbol ) + TYPESCRIPT_CODE = + T.let( + :TYPESCRIPT_CODE, + Lithic::AuthRules::AuthRule::Type::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/lithic/models/auth_rules/rule_feature.rbi b/rbi/lithic/models/auth_rules/rule_feature.rbi new file mode 100644 index 00000000..695ed9ae --- /dev/null +++ b/rbi/lithic/models/auth_rules/rule_feature.rbi @@ -0,0 +1,414 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # A feature made available to the rule. The `name` field is the variable name used + # in the rule function signature. The `type` field determines which data the + # feature provides to the rule at evaluation time. + # + # - `AUTHORIZATION`: The authorization request being evaluated. Only available for + # AUTHORIZATION event stream rules. + # - `AUTHENTICATION`: The 3DS authentication request being evaluated. Only + # available for THREE_DS_AUTHENTICATION event stream rules. + # - `TOKENIZATION`: The tokenization request being evaluated. Only available for + # TOKENIZATION event stream rules. + # - `ACH_RECEIPT`: The ACH receipt being evaluated. Only available for + # ACH_CREDIT_RECEIPT and ACH_DEBIT_RECEIPT event stream rules. + # - `CARD`: The card associated with the event. Available for AUTHORIZATION and + # THREE_DS_AUTHENTICATION event stream rules. + # - `ACCOUNT_HOLDER`: The account holder associated with the card. Available for + # THREE_DS_AUTHENTICATION event stream rules. + # - `IP_METADATA`: IP address metadata for the request. Available for + # THREE_DS_AUTHENTICATION event stream rules. + # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires + # `scope`, `period`, and optionally `filters` to configure the velocity + # calculation. Available for AUTHORIZATION event stream rules. + module RuleFeature + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature, + Lithic::AuthRules::RuleFeature::AuthenticationFeature, + Lithic::AuthRules::RuleFeature::TokenizationFeature, + Lithic::AuthRules::RuleFeature::ACHReceiptFeature, + Lithic::AuthRules::RuleFeature::CardFeature, + Lithic::AuthRules::RuleFeature::AccountHolderFeature, + Lithic::AuthRules::RuleFeature::IPMetadataFeature, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature + ) + end + + class AuthorizationFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :AUTHORIZATION + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class AuthenticationFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::AuthenticationFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :AUTHENTICATION + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class TokenizationFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::TokenizationFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :TOKENIZATION + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class ACHReceiptFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::ACHReceiptFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :ACH_RECEIPT + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class CardFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::CardFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :CARD + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class AccountHolderFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::AccountHolderFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :ACCOUNT_HOLDER + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class IPMetadataFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::IPMetadataFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :IP_METADATA + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class SpendVelocityFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::SpendVelocityFeature, + Lithic::Internal::AnyHash + ) + end + + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + sig do + returns( + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ) + ) + end + attr_accessor :period + + # The scope the velocity is calculated for + sig do + returns( + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol + ) + end + attr_accessor :scope + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(Lithic::AuthRules::VelocityLimitFilters)) } + attr_reader :filters + + sig do + params( + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash + ).void + end + attr_writer :filters + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig do + params( + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash + ), + scope: + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol, + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash, + name: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + period:, + # The scope the velocity is calculated for + scope:, + filters: nil, + # The variable name for this feature in the rule function signature + name: nil, + type: :SPEND_VELOCITY + ) + end + + sig do + override.returns( + { + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ), + scope: + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol, + type: Symbol, + filters: Lithic::AuthRules::VelocityLimitFilters, + name: String + } + ) + end + def to_hash + end + + # The scope the velocity is calculated for + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns(T::Array[Lithic::AuthRules::RuleFeature::Variants]) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi b/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi new file mode 100644 index 00000000..909c3759 --- /dev/null +++ b/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::Internal::AnyHash + ) + end + + # The TypeScript source code of the rule. Must define a `rule()` function that + # accepts the declared features as positional arguments (in the same order as the + # `features` array) and returns an array of actions. + sig { returns(String) } + attr_accessor :code + + # Features available to the TypeScript code at evaluation time + sig do + returns( + T::Array[ + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature, + Lithic::AuthRules::RuleFeature::AuthenticationFeature, + Lithic::AuthRules::RuleFeature::TokenizationFeature, + Lithic::AuthRules::RuleFeature::ACHReceiptFeature, + Lithic::AuthRules::RuleFeature::CardFeature, + Lithic::AuthRules::RuleFeature::AccountHolderFeature, + Lithic::AuthRules::RuleFeature::IPMetadataFeature, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature + ) + ] + ) + end + attr_accessor :features + + # Parameters for defining a TypeScript code rule + sig do + params( + code: String, + features: + T::Array[ + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature::OrHash, + Lithic::AuthRules::RuleFeature::AuthenticationFeature::OrHash, + Lithic::AuthRules::RuleFeature::TokenizationFeature::OrHash, + Lithic::AuthRules::RuleFeature::ACHReceiptFeature::OrHash, + Lithic::AuthRules::RuleFeature::CardFeature::OrHash, + Lithic::AuthRules::RuleFeature::AccountHolderFeature::OrHash, + Lithic::AuthRules::RuleFeature::IPMetadataFeature::OrHash, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new( + # The TypeScript source code of the rule. Must define a `rule()` function that + # accepts the declared features as positional arguments (in the same order as the + # `features` array) and returns an array of actions. + code:, + # Features available to the TypeScript code at evaluation time + features: + ) + end + + sig do + override.returns( + { + code: String, + features: + T::Array[ + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature, + Lithic::AuthRules::RuleFeature::AuthenticationFeature, + Lithic::AuthRules::RuleFeature::TokenizationFeature, + Lithic::AuthRules::RuleFeature::ACHReceiptFeature, + Lithic::AuthRules::RuleFeature::CardFeature, + Lithic::AuthRules::RuleFeature::AccountHolderFeature, + Lithic::AuthRules::RuleFeature::IPMetadataFeature, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature + ) + ] + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_create_params.rbi b/rbi/lithic/models/auth_rules/v2_create_params.rbi index 57803fb8..1ce9cf6e 100644 --- a/rbi/lithic/models/auth_rules/v2_create_params.rbi +++ b/rbi/lithic/models/auth_rules/v2_create_params.rbi @@ -84,7 +84,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) ) end @@ -101,6 +102,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. sig do returns( Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::OrSymbol @@ -147,7 +150,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters::OrHash, Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, Lithic::AuthRules::ConditionalACHActionParameters::OrHash, - Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash ), type: Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::OrSymbol, @@ -171,6 +175,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. type:, # Account tokens to which the Auth Rule applies. account_tokens: nil, @@ -194,7 +200,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ), type: Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::OrSymbol, @@ -221,7 +228,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) end @@ -247,6 +255,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. module Type extend Lithic::Internal::Type::Enum @@ -279,6 +289,11 @@ module Lithic :CONDITIONAL_ACTION, Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::TaggedSymbol ) + TYPESCRIPT_CODE = + T.let( + :TYPESCRIPT_CODE, + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::TaggedSymbol + ) sig do override.returns( @@ -315,7 +330,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) ) end @@ -332,6 +348,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. sig do returns( Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::OrSymbol @@ -365,7 +383,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters::OrHash, Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, Lithic::AuthRules::ConditionalACHActionParameters::OrHash, - Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash ), type: Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::OrSymbol, @@ -389,6 +408,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. type:, # The event stream during which the rule will be evaluated. event_stream: nil, @@ -409,7 +430,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ), type: Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::OrSymbol, @@ -434,7 +456,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) end @@ -460,6 +483,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. module Type extend Lithic::Internal::Type::Enum @@ -492,6 +517,11 @@ module Lithic :CONDITIONAL_ACTION, Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::TaggedSymbol ) + TYPESCRIPT_CODE = + T.let( + :TYPESCRIPT_CODE, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::TaggedSymbol + ) sig do override.returns( @@ -524,7 +554,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) ) end @@ -545,6 +576,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. sig do returns( Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::OrSymbol @@ -584,7 +617,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters::OrHash, Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, Lithic::AuthRules::ConditionalACHActionParameters::OrHash, - Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash ), program_level: T::Boolean, type: @@ -610,6 +644,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. type:, # The event stream during which the rule will be evaluated. event_stream: nil, @@ -631,7 +667,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ), program_level: T::Boolean, type: @@ -658,7 +695,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) end @@ -684,6 +722,8 @@ module Lithic # - `MERCHANT_LOCK`: AUTHORIZATION event stream. # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. module Type extend Lithic::Internal::Type::Enum @@ -716,6 +756,11 @@ module Lithic :CONDITIONAL_ACTION, Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::TaggedSymbol ) + TYPESCRIPT_CODE = + T.let( + :TYPESCRIPT_CODE, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/lithic/models/auth_rules/v2_draft_params.rbi b/rbi/lithic/models/auth_rules/v2_draft_params.rbi index c8a91b9c..7d72e691 100644 --- a/rbi/lithic/models/auth_rules/v2_draft_params.rbi +++ b/rbi/lithic/models/auth_rules/v2_draft_params.rbi @@ -26,7 +26,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) ) ) @@ -45,7 +46,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters::OrHash, Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, Lithic::AuthRules::ConditionalACHActionParameters::OrHash, - Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash ) ), request_options: Lithic::RequestOptions::OrHash @@ -72,7 +74,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) ), request_options: Lithic::RequestOptions @@ -95,7 +98,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters, Lithic::AuthRules::ConditionalAuthorizationActionParameters, Lithic::AuthRules::ConditionalACHActionParameters, - Lithic::AuthRules::ConditionalTokenizationActionParameters + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::TypescriptCodeParameters ) end diff --git a/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi b/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi index df6f8ec5..9e29a311 100644 --- a/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi +++ b/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi @@ -66,17 +66,12 @@ module Lithic ) end - sig do - returns( - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters - ) - end + sig { returns(Lithic::AuthRules::VelocityLimitFilters) } attr_reader :filters sig do params( - filters: - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::OrHash + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash ).void end attr_writer :filters @@ -110,8 +105,7 @@ module Lithic sig do params( - filters: - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::OrHash, + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash, period: T.any( Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, @@ -139,8 +133,7 @@ module Lithic sig do override.returns( { - filters: - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters, + filters: Lithic::AuthRules::VelocityLimitFilters, period: Lithic::AuthRules::VelocityLimitPeriod::Variants, scope: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope::TaggedSymbol, @@ -152,204 +145,6 @@ module Lithic def to_hash end - class Filters < Lithic::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters, - Lithic::Internal::AnyHash - ) - end - - # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. - # Transactions matching any of the provided will be excluded from the calculated - # velocity. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :exclude_countries - - # Merchant Category Codes to exclude from the velocity calculation. Transactions - # matching this MCC will be excluded from the calculated velocity. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :exclude_mccs - - # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. - # Transactions not matching any of the provided will not be included in the - # calculated velocity. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :include_countries - - # Merchant Category Codes to include in the velocity calculation. Transactions not - # matching this MCC will not be included in the calculated velocity. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :include_mccs - - # PAN entry modes to include in the velocity calculation. Transactions not - # matching any of the provided will not be included in the calculated velocity. - sig do - returns( - T.nilable( - T::Array[ - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ] - ) - ) - end - attr_accessor :include_pan_entry_modes - - sig do - params( - exclude_countries: T.nilable(T::Array[String]), - exclude_mccs: T.nilable(T::Array[String]), - include_countries: T.nilable(T::Array[String]), - include_mccs: T.nilable(T::Array[String]), - include_pan_entry_modes: - T.nilable( - T::Array[ - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::OrSymbol - ] - ) - ).returns(T.attached_class) - end - def self.new( - # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. - # Transactions matching any of the provided will be excluded from the calculated - # velocity. - exclude_countries: nil, - # Merchant Category Codes to exclude from the velocity calculation. Transactions - # matching this MCC will be excluded from the calculated velocity. - exclude_mccs: nil, - # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. - # Transactions not matching any of the provided will not be included in the - # calculated velocity. - include_countries: nil, - # Merchant Category Codes to include in the velocity calculation. Transactions not - # matching this MCC will not be included in the calculated velocity. - include_mccs: nil, - # PAN entry modes to include in the velocity calculation. Transactions not - # matching any of the provided will not be included in the calculated velocity. - include_pan_entry_modes: nil - ) - end - - sig do - override.returns( - { - exclude_countries: T.nilable(T::Array[String]), - exclude_mccs: T.nilable(T::Array[String]), - include_countries: T.nilable(T::Array[String]), - include_mccs: T.nilable(T::Array[String]), - include_pan_entry_modes: - T.nilable( - T::Array[ - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ] - ) - } - ) - end - def to_hash - end - - module IncludePanEntryMode - extend Lithic::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTO_ENTRY = - T.let( - :AUTO_ENTRY, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - BAR_CODE = - T.let( - :BAR_CODE, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - CONTACTLESS = - T.let( - :CONTACTLESS, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - CREDENTIAL_ON_FILE = - T.let( - :CREDENTIAL_ON_FILE, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - ECOMMERCE = - T.let( - :ECOMMERCE, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - ERROR_KEYED = - T.let( - :ERROR_KEYED, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - ERROR_MAGNETIC_STRIPE = - T.let( - :ERROR_MAGNETIC_STRIPE, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - ICC = - T.let( - :ICC, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - KEY_ENTERED = - T.let( - :KEY_ENTERED, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - MAGNETIC_STRIPE = - T.let( - :MAGNETIC_STRIPE, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - MANUAL = - T.let( - :MANUAL, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - OCR = - T.let( - :OCR, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - SECURE_CARDLESS = - T.let( - :SECURE_CARDLESS, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - UNSPECIFIED = - T.let( - :UNSPECIFIED, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - UNKNOWN = - T.let( - :UNKNOWN, - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::IncludePanEntryMode::TaggedSymbol - ] - ) - end - def self.values - end - end - end - # The scope the velocity is calculated for module Scope extend Lithic::Internal::Type::Enum diff --git a/rbi/lithic/models/auth_rules/velocity_limit_filters.rbi b/rbi/lithic/models/auth_rules/velocity_limit_filters.rbi new file mode 100644 index 00000000..36bdeb7c --- /dev/null +++ b/rbi/lithic/models/auth_rules/velocity_limit_filters.rbi @@ -0,0 +1,205 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class VelocityLimitFilters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitFilters, + Lithic::Internal::AnyHash + ) + end + + # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + # Transactions matching any of the provided will be excluded from the calculated + # velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_countries + + # Merchant Category Codes to exclude from the velocity calculation. Transactions + # matching this MCC will be excluded from the calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_mccs + + # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + # Transactions not matching any of the provided will not be included in the + # calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_countries + + # Merchant Category Codes to include in the velocity calculation. Transactions not + # matching this MCC will not be included in the calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_mccs + + # PAN entry modes to include in the velocity calculation. Transactions not + # matching any of the provided will not be included in the calculated velocity. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::OrSymbol + ] + ) + ) + end + attr_accessor :include_pan_entry_modes + + sig do + params( + exclude_countries: T.nilable(T::Array[String]), + exclude_mccs: T.nilable(T::Array[String]), + include_countries: T.nilable(T::Array[String]), + include_mccs: T.nilable(T::Array[String]), + include_pan_entry_modes: + T.nilable( + T::Array[ + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::OrSymbol + ] + ) + ).returns(T.attached_class) + end + def self.new( + # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + # Transactions matching any of the provided will be excluded from the calculated + # velocity. + exclude_countries: nil, + # Merchant Category Codes to exclude from the velocity calculation. Transactions + # matching this MCC will be excluded from the calculated velocity. + exclude_mccs: nil, + # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + # Transactions not matching any of the provided will not be included in the + # calculated velocity. + include_countries: nil, + # Merchant Category Codes to include in the velocity calculation. Transactions not + # matching this MCC will not be included in the calculated velocity. + include_mccs: nil, + # PAN entry modes to include in the velocity calculation. Transactions not + # matching any of the provided will not be included in the calculated velocity. + include_pan_entry_modes: nil + ) + end + + sig do + override.returns( + { + exclude_countries: T.nilable(T::Array[String]), + exclude_mccs: T.nilable(T::Array[String]), + include_countries: T.nilable(T::Array[String]), + include_mccs: T.nilable(T::Array[String]), + include_pan_entry_modes: + T.nilable( + T::Array[ + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::OrSymbol + ] + ) + } + ) + end + def to_hash + end + + module IncludePanEntryMode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTO_ENTRY = + T.let( + :AUTO_ENTRY, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + BAR_CODE = + T.let( + :BAR_CODE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + CONTACTLESS = + T.let( + :CONTACTLESS, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + CREDENTIAL_ON_FILE = + T.let( + :CREDENTIAL_ON_FILE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + ECOMMERCE = + T.let( + :ECOMMERCE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + ERROR_KEYED = + T.let( + :ERROR_KEYED, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + ERROR_MAGNETIC_STRIPE = + T.let( + :ERROR_MAGNETIC_STRIPE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + ICC = + T.let( + :ICC, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + KEY_ENTERED = + T.let( + :KEY_ENTERED, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + MAGNETIC_STRIPE = + T.let( + :MAGNETIC_STRIPE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + MANUAL = + T.let( + :MANUAL, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + OCR = + T.let( + :OCR, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + SECURE_CARDLESS = + T.let( + :SECURE_CARDLESS, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + UNSPECIFIED = + T.let( + :UNSPECIFIED, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/velocity_limit_params.rbi b/rbi/lithic/models/auth_rules/velocity_limit_params.rbi index c9026a50..d050b654 100644 --- a/rbi/lithic/models/auth_rules/velocity_limit_params.rbi +++ b/rbi/lithic/models/auth_rules/velocity_limit_params.rbi @@ -30,15 +30,11 @@ module Lithic sig { returns(Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol) } attr_accessor :scope - sig do - returns(T.nilable(Lithic::AuthRules::VelocityLimitParams::Filters)) - end + sig { returns(T.nilable(Lithic::AuthRules::VelocityLimitFilters)) } attr_reader :filters sig do - params( - filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash - ).void + params(filters: Lithic::AuthRules::VelocityLimitFilters::OrHash).void end attr_writer :filters @@ -67,7 +63,7 @@ module Lithic Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash ), scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol, - filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash, + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash, limit_amount: T.nilable(Integer), limit_count: T.nilable(Integer) ).returns(T.attached_class) @@ -103,7 +99,7 @@ module Lithic Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear ), scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol, - filters: Lithic::AuthRules::VelocityLimitParams::Filters, + filters: Lithic::AuthRules::VelocityLimitFilters, limit_amount: T.nilable(Integer), limit_count: T.nilable(Integer) } @@ -143,204 +139,6 @@ module Lithic def self.values end end - - class Filters < Lithic::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Lithic::AuthRules::VelocityLimitParams::Filters, - Lithic::Internal::AnyHash - ) - end - - # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. - # Transactions matching any of the provided will be excluded from the calculated - # velocity. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :exclude_countries - - # Merchant Category Codes to exclude from the velocity calculation. Transactions - # matching this MCC will be excluded from the calculated velocity. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :exclude_mccs - - # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. - # Transactions not matching any of the provided will not be included in the - # calculated velocity. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :include_countries - - # Merchant Category Codes to include in the velocity calculation. Transactions not - # matching this MCC will not be included in the calculated velocity. - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :include_mccs - - # PAN entry modes to include in the velocity calculation. Transactions not - # matching any of the provided will not be included in the calculated velocity. - sig do - returns( - T.nilable( - T::Array[ - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::OrSymbol - ] - ) - ) - end - attr_accessor :include_pan_entry_modes - - sig do - params( - exclude_countries: T.nilable(T::Array[String]), - exclude_mccs: T.nilable(T::Array[String]), - include_countries: T.nilable(T::Array[String]), - include_mccs: T.nilable(T::Array[String]), - include_pan_entry_modes: - T.nilable( - T::Array[ - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::OrSymbol - ] - ) - ).returns(T.attached_class) - end - def self.new( - # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. - # Transactions matching any of the provided will be excluded from the calculated - # velocity. - exclude_countries: nil, - # Merchant Category Codes to exclude from the velocity calculation. Transactions - # matching this MCC will be excluded from the calculated velocity. - exclude_mccs: nil, - # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. - # Transactions not matching any of the provided will not be included in the - # calculated velocity. - include_countries: nil, - # Merchant Category Codes to include in the velocity calculation. Transactions not - # matching this MCC will not be included in the calculated velocity. - include_mccs: nil, - # PAN entry modes to include in the velocity calculation. Transactions not - # matching any of the provided will not be included in the calculated velocity. - include_pan_entry_modes: nil - ) - end - - sig do - override.returns( - { - exclude_countries: T.nilable(T::Array[String]), - exclude_mccs: T.nilable(T::Array[String]), - include_countries: T.nilable(T::Array[String]), - include_mccs: T.nilable(T::Array[String]), - include_pan_entry_modes: - T.nilable( - T::Array[ - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::OrSymbol - ] - ) - } - ) - end - def to_hash - end - - module IncludePanEntryMode - extend Lithic::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTO_ENTRY = - T.let( - :AUTO_ENTRY, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - BAR_CODE = - T.let( - :BAR_CODE, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - CONTACTLESS = - T.let( - :CONTACTLESS, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - CREDENTIAL_ON_FILE = - T.let( - :CREDENTIAL_ON_FILE, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - ECOMMERCE = - T.let( - :ECOMMERCE, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - ERROR_KEYED = - T.let( - :ERROR_KEYED, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - ERROR_MAGNETIC_STRIPE = - T.let( - :ERROR_MAGNETIC_STRIPE, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - ICC = - T.let( - :ICC, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - KEY_ENTERED = - T.let( - :KEY_ENTERED, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - MAGNETIC_STRIPE = - T.let( - :MAGNETIC_STRIPE, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - MANUAL = - T.let( - :MANUAL, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - OCR = - T.let( - :OCR, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - SECURE_CARDLESS = - T.let( - :SECURE_CARDLESS, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - UNSPECIFIED = - T.let( - :UNSPECIFIED, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - UNKNOWN = - T.let( - :UNKNOWN, - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Lithic::AuthRules::VelocityLimitParams::Filters::IncludePanEntryMode::TaggedSymbol - ] - ) - end - def self.values - end - end - end end end end diff --git a/rbi/lithic/resources/auth_rules/v2.rbi b/rbi/lithic/resources/auth_rules/v2.rbi index 0f85dc45..adb6ec37 100644 --- a/rbi/lithic/resources/auth_rules/v2.rbi +++ b/rbi/lithic/resources/auth_rules/v2.rbi @@ -121,7 +121,8 @@ module Lithic Lithic::AuthRules::Conditional3DSActionParameters::OrHash, Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, Lithic::AuthRules::ConditionalACHActionParameters::OrHash, - Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash ) ), request_options: Lithic::RequestOptions::OrHash diff --git a/sig/lithic/models/auth_rules/auth_rule.rbs b/sig/lithic/models/auth_rules/auth_rule.rbs index a87603f1..f23ecc88 100644 --- a/sig/lithic/models/auth_rules/auth_rule.rbs +++ b/sig/lithic/models/auth_rules/auth_rule.rbs @@ -110,6 +110,7 @@ module Lithic | Lithic::AuthRules::ConditionalAuthorizationActionParameters | Lithic::AuthRules::ConditionalACHActionParameters | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::TypescriptCodeParameters module Parameters extend Lithic::Internal::Type::Union @@ -120,22 +121,32 @@ module Lithic type draft_version = { + error: String?, parameters: Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters, + state: Lithic::Models::AuthRules::AuthRule::DraftVersion::state, version: Integer } class DraftVersion < Lithic::Internal::Type::BaseModel + attr_accessor error: String? + attr_accessor parameters: Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters + attr_accessor state: Lithic::Models::AuthRules::AuthRule::DraftVersion::state + attr_accessor version: Integer def initialize: ( + error: String?, parameters: Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters, + state: Lithic::Models::AuthRules::AuthRule::DraftVersion::state, version: Integer ) -> void def to_hash: -> { + error: String?, parameters: Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters, + state: Lithic::Models::AuthRules::AuthRule::DraftVersion::state, version: Integer } @@ -147,12 +158,25 @@ module Lithic | Lithic::AuthRules::ConditionalAuthorizationActionParameters | Lithic::AuthRules::ConditionalACHActionParameters | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::TypescriptCodeParameters module Parameters extend Lithic::Internal::Type::Union def self?.variants: -> ::Array[Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters] end + + type state = :PENDING | :SHADOWING | :ERROR + + module State + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SHADOWING: :SHADOWING + ERROR: :ERROR + + def self?.values: -> ::Array[Lithic::Models::AuthRules::AuthRule::DraftVersion::state] + end end type state = :ACTIVE | :INACTIVE @@ -171,6 +195,7 @@ module Lithic | :VELOCITY_LIMIT | :MERCHANT_LOCK | :CONDITIONAL_ACTION + | :TYPESCRIPT_CODE module Type extend Lithic::Internal::Type::Enum @@ -179,6 +204,7 @@ module Lithic VELOCITY_LIMIT: :VELOCITY_LIMIT MERCHANT_LOCK: :MERCHANT_LOCK CONDITIONAL_ACTION: :CONDITIONAL_ACTION + TYPESCRIPT_CODE: :TYPESCRIPT_CODE def self?.values: -> ::Array[Lithic::Models::AuthRules::AuthRule::type_] end diff --git a/sig/lithic/models/auth_rules/rule_feature.rbs b/sig/lithic/models/auth_rules/rule_feature.rbs new file mode 100644 index 00000000..323d20a1 --- /dev/null +++ b/sig/lithic/models/auth_rules/rule_feature.rbs @@ -0,0 +1,173 @@ +module Lithic + module Models + module AuthRules + type rule_feature = + Lithic::AuthRules::RuleFeature::AuthorizationFeature + | Lithic::AuthRules::RuleFeature::AuthenticationFeature + | Lithic::AuthRules::RuleFeature::TokenizationFeature + | Lithic::AuthRules::RuleFeature::ACHReceiptFeature + | Lithic::AuthRules::RuleFeature::CardFeature + | Lithic::AuthRules::RuleFeature::AccountHolderFeature + | Lithic::AuthRules::RuleFeature::IPMetadataFeature + | Lithic::AuthRules::RuleFeature::SpendVelocityFeature + + module RuleFeature + extend Lithic::Internal::Type::Union + + type authorization_feature = { type: :AUTHORIZATION, name: String } + + class AuthorizationFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :AUTHORIZATION + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :AUTHORIZATION) -> void + + def to_hash: -> { type: :AUTHORIZATION, name: String } + end + + type authentication_feature = { type: :AUTHENTICATION, name: String } + + class AuthenticationFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :AUTHENTICATION + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :AUTHENTICATION) -> void + + def to_hash: -> { type: :AUTHENTICATION, name: String } + end + + type tokenization_feature = { type: :TOKENIZATION, name: String } + + class TokenizationFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :TOKENIZATION + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :TOKENIZATION) -> void + + def to_hash: -> { type: :TOKENIZATION, name: String } + end + + type ach_receipt_feature = { type: :ACH_RECEIPT, name: String } + + class ACHReceiptFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :ACH_RECEIPT + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :ACH_RECEIPT) -> void + + def to_hash: -> { type: :ACH_RECEIPT, name: String } + end + + type card_feature = { type: :CARD, name: String } + + class CardFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :CARD + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :CARD) -> void + + def to_hash: -> { type: :CARD, name: String } + end + + type account_holder_feature = { type: :ACCOUNT_HOLDER, name: String } + + class AccountHolderFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :ACCOUNT_HOLDER + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :ACCOUNT_HOLDER) -> void + + def to_hash: -> { type: :ACCOUNT_HOLDER, name: String } + end + + type ip_metadata_feature = { type: :IP_METADATA, name: String } + + class IPMetadataFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :IP_METADATA + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :IP_METADATA) -> void + + def to_hash: -> { type: :IP_METADATA, name: String } + end + + type spend_velocity_feature = + { + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope, + type: :SPEND_VELOCITY, + filters: Lithic::AuthRules::VelocityLimitFilters, + name: String + } + + class SpendVelocityFeature < Lithic::Internal::Type::BaseModel + attr_accessor period: Lithic::Models::AuthRules::velocity_limit_period + + attr_accessor scope: Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope + + attr_accessor type: :SPEND_VELOCITY + + attr_reader filters: Lithic::AuthRules::VelocityLimitFilters? + + def filters=: ( + Lithic::AuthRules::VelocityLimitFilters + ) -> Lithic::AuthRules::VelocityLimitFilters + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope, + ?filters: Lithic::AuthRules::VelocityLimitFilters, + ?name: String, + ?type: :SPEND_VELOCITY + ) -> void + + def to_hash: -> { + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope, + type: :SPEND_VELOCITY, + filters: Lithic::AuthRules::VelocityLimitFilters, + name: String + } + + type scope = :CARD | :ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::rule_feature] + end + end + end +end diff --git a/sig/lithic/models/auth_rules/typescript_code_parameters.rbs b/sig/lithic/models/auth_rules/typescript_code_parameters.rbs new file mode 100644 index 00000000..15e19926 --- /dev/null +++ b/sig/lithic/models/auth_rules/typescript_code_parameters.rbs @@ -0,0 +1,27 @@ +module Lithic + module Models + module AuthRules + type typescript_code_parameters = + { + code: String, + features: ::Array[Lithic::Models::AuthRules::rule_feature] + } + + class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor features: ::Array[Lithic::Models::AuthRules::rule_feature] + + def initialize: ( + code: String, + features: ::Array[Lithic::Models::AuthRules::rule_feature] + ) -> void + + def to_hash: -> { + code: String, + features: ::Array[Lithic::Models::AuthRules::rule_feature] + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_create_params.rbs b/sig/lithic/models/auth_rules/v2_create_params.rbs index fa436f3b..a22ed15c 100644 --- a/sig/lithic/models/auth_rules/v2_create_params.rbs +++ b/sig/lithic/models/auth_rules/v2_create_params.rbs @@ -86,6 +86,7 @@ module Lithic | Lithic::AuthRules::ConditionalAuthorizationActionParameters | Lithic::AuthRules::ConditionalACHActionParameters | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::TypescriptCodeParameters module Parameters extend Lithic::Internal::Type::Union @@ -98,6 +99,7 @@ module Lithic | :VELOCITY_LIMIT | :MERCHANT_LOCK | :CONDITIONAL_ACTION + | :TYPESCRIPT_CODE module Type extend Lithic::Internal::Type::Enum @@ -106,6 +108,7 @@ module Lithic VELOCITY_LIMIT: :VELOCITY_LIMIT MERCHANT_LOCK: :MERCHANT_LOCK CONDITIONAL_ACTION: :CONDITIONAL_ACTION + TYPESCRIPT_CODE: :TYPESCRIPT_CODE def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::type_] end @@ -159,6 +162,7 @@ module Lithic | Lithic::AuthRules::ConditionalAuthorizationActionParameters | Lithic::AuthRules::ConditionalACHActionParameters | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::TypescriptCodeParameters module Parameters extend Lithic::Internal::Type::Union @@ -171,6 +175,7 @@ module Lithic | :VELOCITY_LIMIT | :MERCHANT_LOCK | :CONDITIONAL_ACTION + | :TYPESCRIPT_CODE module Type extend Lithic::Internal::Type::Enum @@ -179,6 +184,7 @@ module Lithic VELOCITY_LIMIT: :VELOCITY_LIMIT MERCHANT_LOCK: :MERCHANT_LOCK CONDITIONAL_ACTION: :CONDITIONAL_ACTION + TYPESCRIPT_CODE: :TYPESCRIPT_CODE def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::type_] end @@ -239,6 +245,7 @@ module Lithic | Lithic::AuthRules::ConditionalAuthorizationActionParameters | Lithic::AuthRules::ConditionalACHActionParameters | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::TypescriptCodeParameters module Parameters extend Lithic::Internal::Type::Union @@ -251,6 +258,7 @@ module Lithic | :VELOCITY_LIMIT | :MERCHANT_LOCK | :CONDITIONAL_ACTION + | :TYPESCRIPT_CODE module Type extend Lithic::Internal::Type::Enum @@ -259,6 +267,7 @@ module Lithic VELOCITY_LIMIT: :VELOCITY_LIMIT MERCHANT_LOCK: :MERCHANT_LOCK CONDITIONAL_ACTION: :CONDITIONAL_ACTION + TYPESCRIPT_CODE: :TYPESCRIPT_CODE def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::type_] end diff --git a/sig/lithic/models/auth_rules/v2_draft_params.rbs b/sig/lithic/models/auth_rules/v2_draft_params.rbs index e212095b..005a0955 100644 --- a/sig/lithic/models/auth_rules/v2_draft_params.rbs +++ b/sig/lithic/models/auth_rules/v2_draft_params.rbs @@ -36,6 +36,7 @@ module Lithic | Lithic::AuthRules::ConditionalAuthorizationActionParameters | Lithic::AuthRules::ConditionalACHActionParameters | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::TypescriptCodeParameters module Parameters extend Lithic::Internal::Type::Union diff --git a/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs b/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs index b592437e..c6d6c903 100644 --- a/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs +++ b/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs @@ -24,14 +24,14 @@ module Lithic type feature = { - filters: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters, + filters: Lithic::AuthRules::VelocityLimitFilters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::scope, value: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value } class Feature < Lithic::Internal::Type::BaseModel - attr_accessor filters: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters + attr_accessor filters: Lithic::AuthRules::VelocityLimitFilters attr_accessor period: Lithic::Models::AuthRules::velocity_limit_period @@ -40,95 +40,19 @@ module Lithic attr_accessor value: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value def initialize: ( - filters: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters, + filters: Lithic::AuthRules::VelocityLimitFilters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::scope, value: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value ) -> void def to_hash: -> { - filters: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters, + filters: Lithic::AuthRules::VelocityLimitFilters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::scope, value: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value } - type filters = - { - exclude_countries: ::Array[String]?, - exclude_mccs: ::Array[String]?, - include_countries: ::Array[String]?, - include_mccs: ::Array[String]?, - include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::include_pan_entry_mode]? - } - - class Filters < Lithic::Internal::Type::BaseModel - attr_accessor exclude_countries: ::Array[String]? - - attr_accessor exclude_mccs: ::Array[String]? - - attr_accessor include_countries: ::Array[String]? - - attr_accessor include_mccs: ::Array[String]? - - attr_accessor include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::include_pan_entry_mode]? - - def initialize: ( - ?exclude_countries: ::Array[String]?, - ?exclude_mccs: ::Array[String]?, - ?include_countries: ::Array[String]?, - ?include_mccs: ::Array[String]?, - ?include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::include_pan_entry_mode]? - ) -> void - - def to_hash: -> { - exclude_countries: ::Array[String]?, - exclude_mccs: ::Array[String]?, - include_countries: ::Array[String]?, - include_mccs: ::Array[String]?, - include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::include_pan_entry_mode]? - } - - type include_pan_entry_mode = - :AUTO_ENTRY - | :BAR_CODE - | :CONTACTLESS - | :CREDENTIAL_ON_FILE - | :ECOMMERCE - | :ERROR_KEYED - | :ERROR_MAGNETIC_STRIPE - | :ICC - | :KEY_ENTERED - | :MAGNETIC_STRIPE - | :MANUAL - | :OCR - | :SECURE_CARDLESS - | :UNSPECIFIED - | :UNKNOWN - - module IncludePanEntryMode - extend Lithic::Internal::Type::Enum - - AUTO_ENTRY: :AUTO_ENTRY - BAR_CODE: :BAR_CODE - CONTACTLESS: :CONTACTLESS - CREDENTIAL_ON_FILE: :CREDENTIAL_ON_FILE - ECOMMERCE: :ECOMMERCE - ERROR_KEYED: :ERROR_KEYED - ERROR_MAGNETIC_STRIPE: :ERROR_MAGNETIC_STRIPE - ICC: :ICC - KEY_ENTERED: :KEY_ENTERED - MAGNETIC_STRIPE: :MAGNETIC_STRIPE - MANUAL: :MANUAL - OCR: :OCR - SECURE_CARDLESS: :SECURE_CARDLESS - UNSPECIFIED: :UNSPECIFIED - UNKNOWN: :UNKNOWN - - def self?.values: -> ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Filters::include_pan_entry_mode] - end - end - type scope = :CARD | :ACCOUNT module Scope diff --git a/sig/lithic/models/auth_rules/velocity_limit_filters.rbs b/sig/lithic/models/auth_rules/velocity_limit_filters.rbs new file mode 100644 index 00000000..844b5d5d --- /dev/null +++ b/sig/lithic/models/auth_rules/velocity_limit_filters.rbs @@ -0,0 +1,81 @@ +module Lithic + module Models + module AuthRules + type velocity_limit_filters = + { + exclude_countries: ::Array[String]?, + exclude_mccs: ::Array[String]?, + include_countries: ::Array[String]?, + include_mccs: ::Array[String]?, + include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode]? + } + + class VelocityLimitFilters < Lithic::Internal::Type::BaseModel + attr_accessor exclude_countries: ::Array[String]? + + attr_accessor exclude_mccs: ::Array[String]? + + attr_accessor include_countries: ::Array[String]? + + attr_accessor include_mccs: ::Array[String]? + + attr_accessor include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode]? + + def initialize: ( + ?exclude_countries: ::Array[String]?, + ?exclude_mccs: ::Array[String]?, + ?include_countries: ::Array[String]?, + ?include_mccs: ::Array[String]?, + ?include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode]? + ) -> void + + def to_hash: -> { + exclude_countries: ::Array[String]?, + exclude_mccs: ::Array[String]?, + include_countries: ::Array[String]?, + include_mccs: ::Array[String]?, + include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode]? + } + + type include_pan_entry_mode = + :AUTO_ENTRY + | :BAR_CODE + | :CONTACTLESS + | :CREDENTIAL_ON_FILE + | :ECOMMERCE + | :ERROR_KEYED + | :ERROR_MAGNETIC_STRIPE + | :ICC + | :KEY_ENTERED + | :MAGNETIC_STRIPE + | :MANUAL + | :OCR + | :SECURE_CARDLESS + | :UNSPECIFIED + | :UNKNOWN + + module IncludePanEntryMode + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY: :AUTO_ENTRY + BAR_CODE: :BAR_CODE + CONTACTLESS: :CONTACTLESS + CREDENTIAL_ON_FILE: :CREDENTIAL_ON_FILE + ECOMMERCE: :ECOMMERCE + ERROR_KEYED: :ERROR_KEYED + ERROR_MAGNETIC_STRIPE: :ERROR_MAGNETIC_STRIPE + ICC: :ICC + KEY_ENTERED: :KEY_ENTERED + MAGNETIC_STRIPE: :MAGNETIC_STRIPE + MANUAL: :MANUAL + OCR: :OCR + SECURE_CARDLESS: :SECURE_CARDLESS + UNSPECIFIED: :UNSPECIFIED + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/velocity_limit_params.rbs b/sig/lithic/models/auth_rules/velocity_limit_params.rbs index d85272ca..cd93489d 100644 --- a/sig/lithic/models/auth_rules/velocity_limit_params.rbs +++ b/sig/lithic/models/auth_rules/velocity_limit_params.rbs @@ -5,7 +5,7 @@ module Lithic { period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, - filters: Lithic::AuthRules::VelocityLimitParams::Filters, + filters: Lithic::AuthRules::VelocityLimitFilters, limit_amount: Integer?, limit_count: Integer? } @@ -15,11 +15,11 @@ module Lithic attr_accessor scope: Lithic::Models::AuthRules::VelocityLimitParams::scope - attr_reader filters: Lithic::AuthRules::VelocityLimitParams::Filters? + attr_reader filters: Lithic::AuthRules::VelocityLimitFilters? def filters=: ( - Lithic::AuthRules::VelocityLimitParams::Filters - ) -> Lithic::AuthRules::VelocityLimitParams::Filters + Lithic::AuthRules::VelocityLimitFilters + ) -> Lithic::AuthRules::VelocityLimitFilters attr_accessor limit_amount: Integer? @@ -28,7 +28,7 @@ module Lithic def initialize: ( period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, - ?filters: Lithic::AuthRules::VelocityLimitParams::Filters, + ?filters: Lithic::AuthRules::VelocityLimitFilters, ?limit_amount: Integer?, ?limit_count: Integer? ) -> void @@ -36,7 +36,7 @@ module Lithic def to_hash: -> { period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, - filters: Lithic::AuthRules::VelocityLimitParams::Filters, + filters: Lithic::AuthRules::VelocityLimitFilters, limit_amount: Integer?, limit_count: Integer? } @@ -51,82 +51,6 @@ module Lithic def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope] end - - type filters = - { - exclude_countries: ::Array[String]?, - exclude_mccs: ::Array[String]?, - include_countries: ::Array[String]?, - include_mccs: ::Array[String]?, - include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitParams::Filters::include_pan_entry_mode]? - } - - class Filters < Lithic::Internal::Type::BaseModel - attr_accessor exclude_countries: ::Array[String]? - - attr_accessor exclude_mccs: ::Array[String]? - - attr_accessor include_countries: ::Array[String]? - - attr_accessor include_mccs: ::Array[String]? - - attr_accessor include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitParams::Filters::include_pan_entry_mode]? - - def initialize: ( - ?exclude_countries: ::Array[String]?, - ?exclude_mccs: ::Array[String]?, - ?include_countries: ::Array[String]?, - ?include_mccs: ::Array[String]?, - ?include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitParams::Filters::include_pan_entry_mode]? - ) -> void - - def to_hash: -> { - exclude_countries: ::Array[String]?, - exclude_mccs: ::Array[String]?, - include_countries: ::Array[String]?, - include_mccs: ::Array[String]?, - include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitParams::Filters::include_pan_entry_mode]? - } - - type include_pan_entry_mode = - :AUTO_ENTRY - | :BAR_CODE - | :CONTACTLESS - | :CREDENTIAL_ON_FILE - | :ECOMMERCE - | :ERROR_KEYED - | :ERROR_MAGNETIC_STRIPE - | :ICC - | :KEY_ENTERED - | :MAGNETIC_STRIPE - | :MANUAL - | :OCR - | :SECURE_CARDLESS - | :UNSPECIFIED - | :UNKNOWN - - module IncludePanEntryMode - extend Lithic::Internal::Type::Enum - - AUTO_ENTRY: :AUTO_ENTRY - BAR_CODE: :BAR_CODE - CONTACTLESS: :CONTACTLESS - CREDENTIAL_ON_FILE: :CREDENTIAL_ON_FILE - ECOMMERCE: :ECOMMERCE - ERROR_KEYED: :ERROR_KEYED - ERROR_MAGNETIC_STRIPE: :ERROR_MAGNETIC_STRIPE - ICC: :ICC - KEY_ENTERED: :KEY_ENTERED - MAGNETIC_STRIPE: :MAGNETIC_STRIPE - MANUAL: :MANUAL - OCR: :OCR - SECURE_CARDLESS: :SECURE_CARDLESS - UNSPECIFIED: :UNSPECIFIED - UNKNOWN: :UNKNOWN - - def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::Filters::include_pan_entry_mode] - end - end end end end From b977c80b191364666f305fc9527d161c653a43f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 08:19:18 +0000 Subject: [PATCH 4/9] fix(api): Disable MCP server to fix TypeScript SDK package publishing --- .stats.yml | 2 +- README.md | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 31c05d97..4e2f0a05 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 189 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1e902917b2eae41d549957e790eb6b137969e451efe673815647deba330fe05a.yml openapi_spec_hash: 82cab06ce65462e60316939db630460a -config_hash: 00b60697e692f86b5be297d939962921 +config_hash: 8799cfd589579f105ef8696a6d664c71 diff --git a/README.md b/README.md index f71bfa9e..a8a4b62e 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,6 @@ The Lithic Ruby library provides convenient access to the Lithic REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/lithic-com/lithic-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem. -## MCP Server - -Use the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. - -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D) - -> Note: You may need to set environment variables in your MCP client. - ## Documentation Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/lithic). From 3e9c63ca2f2c3ddf7cfebef2bbf603646f0c6e7d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 15:18:01 +0000 Subject: [PATCH 5/9] feat(api): Add event_subtype to statement line items --- .stats.yml | 4 ++-- .../statements/statement_line_items.rb | 10 +++++++++- .../statements/statement_line_items.rbi | 14 +++++++++++--- .../statements/statement_line_items.rbs | 11 ++++++++--- .../statements/line_items_test.rb | 3 ++- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4e2f0a05..a098ed97 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 189 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1e902917b2eae41d549957e790eb6b137969e451efe673815647deba330fe05a.yml -openapi_spec_hash: 82cab06ce65462e60316939db630460a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-34cfbf6ee4a6903838da11a879bbbfe71b84e7585b3c8c6957bf524deb378b41.yml +openapi_spec_hash: f9e20ed9f3c5d78a185af18be0d7a199 config_hash: 8799cfd589579f105ef8696a6d664c71 diff --git a/lib/lithic/models/financial_accounts/statements/statement_line_items.rb b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb index 0a5606f8..dff462ef 100644 --- a/lib/lithic/models/financial_accounts/statements/statement_line_items.rb +++ b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb @@ -92,7 +92,13 @@ class Data < Lithic::Internal::Type::BaseModel # @return [String, nil] optional :descriptor, String - # @!method initialize(token:, amount:, category:, created:, currency:, effective_date:, event_type:, financial_account_token:, financial_transaction_event_token:, financial_transaction_token:, card_token: nil, descriptor: nil) + # @!attribute event_subtype + # Subtype of the event that generated the line items + # + # @return [String, nil] + optional :event_subtype, String, nil?: true + + # @!method initialize(token:, amount:, category:, created:, currency:, effective_date:, event_type:, financial_account_token:, financial_transaction_event_token:, financial_transaction_token:, card_token: nil, descriptor: nil, event_subtype: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data} for # more details. @@ -120,6 +126,8 @@ class Data < Lithic::Internal::Type::BaseModel # @param card_token [String] Globally unique identifier for a card # # @param descriptor [String] + # + # @param event_subtype [String, nil] Subtype of the event that generated the line items # @see Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data#category module Category diff --git a/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi b/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi index 6df9f6fd..7332b409 100644 --- a/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi +++ b/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi @@ -122,6 +122,10 @@ module Lithic sig { params(descriptor: String).void } attr_writer :descriptor + # Subtype of the event that generated the line items + sig { returns(T.nilable(String)) } + attr_accessor :event_subtype + sig do params( token: String, @@ -137,7 +141,8 @@ module Lithic financial_transaction_event_token: String, financial_transaction_token: String, card_token: String, - descriptor: String + descriptor: String, + event_subtype: T.nilable(String) ).returns(T.attached_class) end def self.new( @@ -162,7 +167,9 @@ module Lithic financial_transaction_token:, # Globally unique identifier for a card card_token: nil, - descriptor: nil + descriptor: nil, + # Subtype of the event that generated the line items + event_subtype: nil ) end @@ -182,7 +189,8 @@ module Lithic financial_transaction_event_token: String, financial_transaction_token: String, card_token: String, - descriptor: String + descriptor: String, + event_subtype: T.nilable(String) } ) end diff --git a/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs index 8cbfe501..2b8240d7 100644 --- a/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs +++ b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs @@ -38,7 +38,8 @@ module Lithic financial_transaction_event_token: String, financial_transaction_token: String, card_token: String, - descriptor: String + descriptor: String, + event_subtype: String? } class Data < Lithic::Internal::Type::BaseModel @@ -70,6 +71,8 @@ module Lithic def descriptor=: (String) -> String + attr_accessor event_subtype: String? + def initialize: ( token: String, amount: Integer, @@ -82,7 +85,8 @@ module Lithic financial_transaction_event_token: String, financial_transaction_token: String, ?card_token: String, - ?descriptor: String + ?descriptor: String, + ?event_subtype: String? ) -> void def to_hash: -> { @@ -97,7 +101,8 @@ module Lithic financial_transaction_event_token: String, financial_transaction_token: String, card_token: String, - descriptor: String + descriptor: String, + event_subtype: String? } type category = diff --git a/test/lithic/resources/financial_accounts/statements/line_items_test.rb b/test/lithic/resources/financial_accounts/statements/line_items_test.rb index 1f2b44c8..762f79ff 100644 --- a/test/lithic/resources/financial_accounts/statements/line_items_test.rb +++ b/test/lithic/resources/financial_accounts/statements/line_items_test.rb @@ -34,7 +34,8 @@ def test_list_required_params financial_transaction_event_token: String, financial_transaction_token: String, card_token: String | nil, - descriptor: String | nil + descriptor: String | nil, + event_subtype: String | nil } end end From 9dd0f14b35ebd87561dda0a11da9b440d9a4f1cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 17:01:21 +0000 Subject: [PATCH 6/9] feat(api): add loan_tape_date field to statement line items --- .stats.yml | 4 ++-- .../statements/statement_line_items.rb | 10 +++++++++- .../statements/statement_line_items.rbi | 14 +++++++++++--- .../statements/statement_line_items.rbs | 11 ++++++++--- .../statements/line_items_test.rb | 3 ++- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index a098ed97..2f0500f7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 189 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-34cfbf6ee4a6903838da11a879bbbfe71b84e7585b3c8c6957bf524deb378b41.yml -openapi_spec_hash: f9e20ed9f3c5d78a185af18be0d7a199 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fb9adae9eb94be3d04c66cc6c974cb0cc010d9d3a49e6fe23c32276e4317b568.yml +openapi_spec_hash: 8da1862112b00c8a0c9e19b2e83c89d8 config_hash: 8799cfd589579f105ef8696a6d664c71 diff --git a/lib/lithic/models/financial_accounts/statements/statement_line_items.rb b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb index dff462ef..c6ea7cf9 100644 --- a/lib/lithic/models/financial_accounts/statements/statement_line_items.rb +++ b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb @@ -98,7 +98,13 @@ class Data < Lithic::Internal::Type::BaseModel # @return [String, nil] optional :event_subtype, String, nil?: true - # @!method initialize(token:, amount:, category:, created:, currency:, effective_date:, event_type:, financial_account_token:, financial_transaction_event_token:, financial_transaction_token:, card_token: nil, descriptor: nil, event_subtype: nil) + # @!attribute loan_tape_date + # Date of the loan tape that generated this line item + # + # @return [Date, nil] + optional :loan_tape_date, Date, nil?: true + + # @!method initialize(token:, amount:, category:, created:, currency:, effective_date:, event_type:, financial_account_token:, financial_transaction_event_token:, financial_transaction_token:, card_token: nil, descriptor: nil, event_subtype: nil, loan_tape_date: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data} for # more details. @@ -128,6 +134,8 @@ class Data < Lithic::Internal::Type::BaseModel # @param descriptor [String] # # @param event_subtype [String, nil] Subtype of the event that generated the line items + # + # @param loan_tape_date [Date, nil] Date of the loan tape that generated this line item # @see Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data#category module Category diff --git a/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi b/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi index 7332b409..336facbf 100644 --- a/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi +++ b/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi @@ -126,6 +126,10 @@ module Lithic sig { returns(T.nilable(String)) } attr_accessor :event_subtype + # Date of the loan tape that generated this line item + sig { returns(T.nilable(Date)) } + attr_accessor :loan_tape_date + sig do params( token: String, @@ -142,7 +146,8 @@ module Lithic financial_transaction_token: String, card_token: String, descriptor: String, - event_subtype: T.nilable(String) + event_subtype: T.nilable(String), + loan_tape_date: T.nilable(Date) ).returns(T.attached_class) end def self.new( @@ -169,7 +174,9 @@ module Lithic card_token: nil, descriptor: nil, # Subtype of the event that generated the line items - event_subtype: nil + event_subtype: nil, + # Date of the loan tape that generated this line item + loan_tape_date: nil ) end @@ -190,7 +197,8 @@ module Lithic financial_transaction_token: String, card_token: String, descriptor: String, - event_subtype: T.nilable(String) + event_subtype: T.nilable(String), + loan_tape_date: T.nilable(Date) } ) end diff --git a/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs index 2b8240d7..2e4adcfb 100644 --- a/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs +++ b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs @@ -39,7 +39,8 @@ module Lithic financial_transaction_token: String, card_token: String, descriptor: String, - event_subtype: String? + event_subtype: String?, + loan_tape_date: Date? } class Data < Lithic::Internal::Type::BaseModel @@ -73,6 +74,8 @@ module Lithic attr_accessor event_subtype: String? + attr_accessor loan_tape_date: Date? + def initialize: ( token: String, amount: Integer, @@ -86,7 +89,8 @@ module Lithic financial_transaction_token: String, ?card_token: String, ?descriptor: String, - ?event_subtype: String? + ?event_subtype: String?, + ?loan_tape_date: Date? ) -> void def to_hash: -> { @@ -102,7 +106,8 @@ module Lithic financial_transaction_token: String, card_token: String, descriptor: String, - event_subtype: String? + event_subtype: String?, + loan_tape_date: Date? } type category = diff --git a/test/lithic/resources/financial_accounts/statements/line_items_test.rb b/test/lithic/resources/financial_accounts/statements/line_items_test.rb index 762f79ff..5a74a210 100644 --- a/test/lithic/resources/financial_accounts/statements/line_items_test.rb +++ b/test/lithic/resources/financial_accounts/statements/line_items_test.rb @@ -35,7 +35,8 @@ def test_list_required_params financial_transaction_token: String, card_token: String | nil, descriptor: String | nil, - event_subtype: String | nil + event_subtype: String | nil, + loan_tape_date: Date | nil } end end From ec63b562858eebabe2bafd15c5e375deedf22670 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 17:05:59 +0000 Subject: [PATCH 7/9] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2f0500f7..1cd7cb5c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 189 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fb9adae9eb94be3d04c66cc6c974cb0cc010d9d3a49e6fe23c32276e4317b568.yml openapi_spec_hash: 8da1862112b00c8a0c9e19b2e83c89d8 -config_hash: 8799cfd589579f105ef8696a6d664c71 +config_hash: 7daa8d0d03697920c0c1ca18ce6d4594 From 5b75c2fdb30131890b8ea83befd70c6f7cba804f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 17:34:01 +0000 Subject: [PATCH 8/9] feat(api): Add support for early direct deposit --- .stats.yml | 4 ++-- lib/lithic/models/payment.rb | 5 +++++ lib/lithic/models/payment_simulate_action_params.rb | 1 + rbi/lithic/models/payment.rbi | 11 +++++++++++ rbi/lithic/models/payment_simulate_action_params.rbi | 5 +++++ sig/lithic/models/payment.rbs | 2 ++ sig/lithic/models/payment_simulate_action_params.rbs | 2 ++ 7 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1cd7cb5c..cb037391 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 189 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fb9adae9eb94be3d04c66cc6c974cb0cc010d9d3a49e6fe23c32276e4317b568.yml -openapi_spec_hash: 8da1862112b00c8a0c9e19b2e83c89d8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-6eebc524f3f5b6499a79ef544e150cc49ea1dc1e1c76a5392079ca5a83e78100.yml +openapi_spec_hash: 500c46c1194a128c404e17f7a5bff676 config_hash: 7daa8d0d03697920c0c1ca18ce6d4594 diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb index e9a488bb..47b5fade 100644 --- a/lib/lithic/models/payment.rb +++ b/lib/lithic/models/payment.rb @@ -272,6 +272,8 @@ class Event < Lithic::Internal::Type::BaseModel # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository # Financial Institution. @@ -347,6 +349,8 @@ module Result # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository # Financial Institution. @@ -368,6 +372,7 @@ module Type ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED ACH_RECEIPT_PROCESSED = :ACH_RECEIPT_PROCESSED ACH_RECEIPT_RELEASED = :ACH_RECEIPT_RELEASED + ACH_RECEIPT_RELEASED_EARLY = :ACH_RECEIPT_RELEASED_EARLY ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED diff --git a/lib/lithic/models/payment_simulate_action_params.rb b/lib/lithic/models/payment_simulate_action_params.rb index f5ac57c8..defe97db 100644 --- a/lib/lithic/models/payment_simulate_action_params.rb +++ b/lib/lithic/models/payment_simulate_action_params.rb @@ -67,6 +67,7 @@ module EventType ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED ACH_RECEIPT_RELEASED = :ACH_RECEIPT_RELEASED + ACH_RECEIPT_RELEASED_EARLY = :ACH_RECEIPT_RELEASED_EARLY ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED diff --git a/rbi/lithic/models/payment.rbi b/rbi/lithic/models/payment.rbi index 9d6acaa4..2674082a 100644 --- a/rbi/lithic/models/payment.rbi +++ b/rbi/lithic/models/payment.rbi @@ -330,6 +330,8 @@ module Lithic # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository # Financial Institution. @@ -403,6 +405,8 @@ module Lithic # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository # Financial Institution. @@ -475,6 +479,8 @@ module Lithic # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository # Financial Institution. @@ -534,6 +540,11 @@ module Lithic :ACH_RECEIPT_RELEASED, Lithic::Payment::Event::Type::TaggedSymbol ) + ACH_RECEIPT_RELEASED_EARLY = + T.let( + :ACH_RECEIPT_RELEASED_EARLY, + Lithic::Payment::Event::Type::TaggedSymbol + ) ACH_RECEIPT_SETTLED = T.let( :ACH_RECEIPT_SETTLED, diff --git a/rbi/lithic/models/payment_simulate_action_params.rbi b/rbi/lithic/models/payment_simulate_action_params.rbi index 417a70bf..d3790ffc 100644 --- a/rbi/lithic/models/payment_simulate_action_params.rbi +++ b/rbi/lithic/models/payment_simulate_action_params.rbi @@ -143,6 +143,11 @@ module Lithic :ACH_RECEIPT_RELEASED, Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol ) + ACH_RECEIPT_RELEASED_EARLY = + T.let( + :ACH_RECEIPT_RELEASED_EARLY, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) ACH_RETURN_INITIATED = T.let( :ACH_RETURN_INITIATED, diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs index 23f152da..f56d16ca 100644 --- a/sig/lithic/models/payment.rbs +++ b/sig/lithic/models/payment.rbs @@ -260,6 +260,7 @@ module Lithic | :ACH_ORIGINATION_SETTLED | :ACH_RECEIPT_PROCESSED | :ACH_RECEIPT_RELEASED + | :ACH_RECEIPT_RELEASED_EARLY | :ACH_RECEIPT_SETTLED | :ACH_RETURN_INITIATED | :ACH_RETURN_PROCESSED @@ -278,6 +279,7 @@ module Lithic ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED ACH_RECEIPT_PROCESSED: :ACH_RECEIPT_PROCESSED ACH_RECEIPT_RELEASED: :ACH_RECEIPT_RELEASED + ACH_RECEIPT_RELEASED_EARLY: :ACH_RECEIPT_RELEASED_EARLY ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED diff --git a/sig/lithic/models/payment_simulate_action_params.rbs b/sig/lithic/models/payment_simulate_action_params.rbs index 62b44d9e..c1823c6d 100644 --- a/sig/lithic/models/payment_simulate_action_params.rbs +++ b/sig/lithic/models/payment_simulate_action_params.rbs @@ -64,6 +64,7 @@ module Lithic | :ACH_ORIGINATION_SETTLED | :ACH_RECEIPT_SETTLED | :ACH_RECEIPT_RELEASED + | :ACH_RECEIPT_RELEASED_EARLY | :ACH_RETURN_INITIATED | :ACH_RETURN_PROCESSED | :ACH_RETURN_SETTLED @@ -77,6 +78,7 @@ module Lithic ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED ACH_RECEIPT_RELEASED: :ACH_RECEIPT_RELEASED + ACH_RECEIPT_RELEASED_EARLY: :ACH_RECEIPT_RELEASED_EARLY ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED From f4da184219de474ae5c6ab5362152f55c388bccd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 17:34:35 +0000 Subject: [PATCH 9/9] release: 0.8.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 22 ++++++++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/lithic/version.rb | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1b77f506..6538ca91 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.7.0" + ".": "0.8.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c1585b2..57dc243e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 0.8.0 (2026-03-10) + +Full Changelog: [v0.7.0...v0.8.0](https://github.com/lithic-com/lithic-ruby/compare/v0.7.0...v0.8.0) + +### Features + +* **api:** add EARLY_DIRECT_DEPOSIT_FLOAT to financial account types ([3e0194f](https://github.com/lithic-com/lithic-ruby/commit/3e0194f79f315f44b8bc95c7e18452c99d91ce81)) +* **api:** Add event_subtype to statement line items ([3e9c63c](https://github.com/lithic-com/lithic-ruby/commit/3e9c63ca2f2c3ddf7cfebef2bbf603646f0c6e7d)) +* **api:** add loan_tape_date field to statement line items ([9dd0f14](https://github.com/lithic-com/lithic-ruby/commit/9dd0f14b35ebd87561dda0a11da9b440d9a4f1cb)) +* **api:** Add support for early direct deposit ([5b75c2f](https://github.com/lithic-com/lithic-ruby/commit/5b75c2fdb30131890b8ea83befd70c6f7cba804f)) +* **api:** add TypeScript code rules, draft version state tracking to auth_rules ([1dbdb68](https://github.com/lithic-com/lithic-ruby/commit/1dbdb688fffb5909af5c568bb16b2e3f899a6a42)) + + +### Bug Fixes + +* **api:** Disable MCP server to fix TypeScript SDK package publishing ([b977c80](https://github.com/lithic-com/lithic-ruby/commit/b977c80b191364666f305fc9527d161c653a43f7)) + + +### Chores + +* **internal:** codegen related update ([489f19b](https://github.com/lithic-com/lithic-ruby/commit/489f19b1c8c76d08aed0a313d45bed73406025b5)) + ## 0.7.0 (2026-03-05) Full Changelog: [v0.6.0...v0.7.0](https://github.com/lithic-com/lithic-ruby/compare/v0.6.0...v0.7.0) diff --git a/Gemfile.lock b/Gemfile.lock index c8b7721f..0678df94 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GIT PATH remote: . specs: - lithic (0.7.0) + lithic (0.8.0) cgi connection_pool diff --git a/README.md b/README.md index a8a4b62e..a4790e6b 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.7.0" +gem "lithic", "~> 0.8.0" ``` diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index bf8544e6..e8c3043e 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lithic - VERSION = "0.7.0" + VERSION = "0.8.0" end