diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f4ef5ee2..4ce0bc75 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.174.0" + ".": "1.175.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 6f42a9fe..af0e17b5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 227 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-0281c1d774b1853b7b09bbce88b8d6e0301179b68d53627c5940edd7d2f8b180.yml -openapi_spec_hash: e22a9d6a4f0f32976d0ac9dd7e6d7dd0 -config_hash: ca52ca9a2968f330339fd50c1a386e05 +configured_endpoints: 232 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-7a47821c7d33caac95ba05890682dde6da257dbe86033e4f119aa626c11ae387.yml +openapi_spec_hash: 0ccabc90834936bc2fcdeeee01e77a64 +config_hash: 8a9bb9e2d5dd0ccc3e78ad59f924fd3c diff --git a/CHANGELOG.md b/CHANGELOG.md index c09bd013..bc8c047c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.175.0 (2026-01-08) + +Full Changelog: [v1.174.0...v1.175.0](https://github.com/Increase/increase-ruby/compare/v1.174.0...v1.175.0) + +### Features + +* **api:** api update ([ed14e6f](https://github.com/Increase/increase-ruby/commit/ed14e6fa7f59dd24228c316142c864b602d67bf6)) + ## 1.174.0 (2026-01-07) Full Changelog: [v1.173.0...v1.174.0](https://github.com/Increase/increase-ruby/compare/v1.173.0...v1.174.0) diff --git a/Gemfile.lock b/Gemfile.lock index eef8e69b..d4f3d0ff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - increase (1.174.0) + increase (1.175.0) connection_pool GEM diff --git a/README.md b/README.md index b3dc7b9b..9e002e19 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 "increase", "~> 1.174.0" +gem "increase", "~> 1.175.0" ``` diff --git a/lib/increase.rb b/lib/increase.rb index d4b29f3f..15fbd4de 100644 --- a/lib/increase.rb +++ b/lib/increase.rb @@ -329,6 +329,12 @@ require_relative "increase/models/simulations/wire_transfer_submit_params" require_relative "increase/models/supplemental_document_create_params" require_relative "increase/models/supplemental_document_list_params" +require_relative "increase/models/swift_transfer" +require_relative "increase/models/swift_transfer_approve_params" +require_relative "increase/models/swift_transfer_cancel_params" +require_relative "increase/models/swift_transfer_create_params" +require_relative "increase/models/swift_transfer_list_params" +require_relative "increase/models/swift_transfer_retrieve_params" require_relative "increase/models/transaction" require_relative "increase/models/transaction_list_params" require_relative "increase/models/transaction_retrieve_params" @@ -427,6 +433,7 @@ require_relative "increase/resources/simulations/wire_drawdown_requests" require_relative "increase/resources/simulations/wire_transfers" require_relative "increase/resources/supplemental_documents" +require_relative "increase/resources/swift_transfers" require_relative "increase/resources/transactions" require_relative "increase/resources/wire_drawdown_requests" require_relative "increase/resources/wire_transfers" diff --git a/lib/increase/client.rb b/lib/increase/client.rb index 2eea37d6..a3412592 100644 --- a/lib/increase/client.rb +++ b/lib/increase/client.rb @@ -104,6 +104,9 @@ class Client < Increase::Internal::Transport::BaseClient # @return [Increase::Resources::InboundFednowTransfers] attr_reader :inbound_fednow_transfers + # @return [Increase::Resources::SwiftTransfers] + attr_reader :swift_transfers + # @return [Increase::Resources::CheckDeposits] attr_reader :check_deposits @@ -281,6 +284,7 @@ def initialize( Increase::Resources::InboundRealTimePaymentsTransfers.new(client: self) @fednow_transfers = Increase::Resources::FednowTransfers.new(client: self) @inbound_fednow_transfers = Increase::Resources::InboundFednowTransfers.new(client: self) + @swift_transfers = Increase::Resources::SwiftTransfers.new(client: self) @check_deposits = Increase::Resources::CheckDeposits.new(client: self) @lockboxes = Increase::Resources::Lockboxes.new(client: self) @inbound_mail_items = Increase::Resources::InboundMailItems.new(client: self) diff --git a/lib/increase/models.rb b/lib/increase/models.rb index 3daab376..5d4cce57 100644 --- a/lib/increase/models.rb +++ b/lib/increase/models.rb @@ -509,6 +509,18 @@ module Increase SupplementalDocumentListParams = Increase::Models::SupplementalDocumentListParams + SwiftTransfer = Increase::Models::SwiftTransfer + + SwiftTransferApproveParams = Increase::Models::SwiftTransferApproveParams + + SwiftTransferCancelParams = Increase::Models::SwiftTransferCancelParams + + SwiftTransferCreateParams = Increase::Models::SwiftTransferCreateParams + + SwiftTransferListParams = Increase::Models::SwiftTransferListParams + + SwiftTransferRetrieveParams = Increase::Models::SwiftTransferRetrieveParams + Transaction = Increase::Models::Transaction TransactionListParams = Increase::Models::TransactionListParams diff --git a/lib/increase/models/swift_transfer.rb b/lib/increase/models/swift_transfer.rb new file mode 100644 index 00000000..1065ba93 --- /dev/null +++ b/lib/increase/models/swift_transfer.rb @@ -0,0 +1,478 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::SwiftTransfers#create + class SwiftTransfer < Increase::Internal::Type::BaseModel + # @!attribute id + # The Swift transfer's identifier. + # + # @return [String] + required :id, String + + # @!attribute account_id + # The Account to which the transfer belongs. + # + # @return [String] + required :account_id, String + + # @!attribute account_number + # The creditor's account number. + # + # @return [String] + required :account_number, String + + # @!attribute amount + # The transfer amount in USD cents. + # + # @return [Integer] + required :amount, Integer + + # @!attribute bank_identification_code + # The bank identification code (BIC) of the creditor. + # + # @return [String] + required :bank_identification_code, String + + # @!attribute created_at + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + # the transfer was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute created_by + # What object created the transfer, either via the API or the dashboard. + # + # @return [Increase::Models::SwiftTransfer::CreatedBy] + required :created_by, -> { Increase::SwiftTransfer::CreatedBy } + + # @!attribute creditor_address + # The creditor's address. + # + # @return [Increase::Models::SwiftTransfer::CreditorAddress] + required :creditor_address, -> { Increase::SwiftTransfer::CreditorAddress } + + # @!attribute creditor_name + # The creditor's name. + # + # @return [String] + required :creditor_name, String + + # @!attribute debtor_address + # The debtor's address. + # + # @return [Increase::Models::SwiftTransfer::DebtorAddress] + required :debtor_address, -> { Increase::SwiftTransfer::DebtorAddress } + + # @!attribute debtor_name + # The debtor's name. + # + # @return [String] + required :debtor_name, String + + # @!attribute idempotency_key + # The idempotency key you chose for this object. This value is unique across + # Increase and is used to ensure that a request is only processed once. Learn more + # about [idempotency](https://increase.com/documentation/idempotency-keys). + # + # @return [String, nil] + required :idempotency_key, String, nil?: true + + # @!attribute instructed_amount + # The amount that was instructed to be transferred in minor units of the + # `instructed_currency`. + # + # @return [Integer] + required :instructed_amount, Integer + + # @!attribute instructed_currency + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + # + # @return [Symbol, Increase::Models::SwiftTransfer::InstructedCurrency] + required :instructed_currency, enum: -> { Increase::SwiftTransfer::InstructedCurrency } + + # @!attribute pending_transaction_id + # The ID for the pending transaction representing the transfer. + # + # @return [String, nil] + required :pending_transaction_id, String, nil?: true + + # @!attribute routing_number + # The creditor's bank account routing or transit number. Required in certain + # countries. + # + # @return [String, nil] + required :routing_number, String, nil?: true + + # @!attribute source_account_number_id + # The Account Number included in the transfer as the debtor's account number. + # + # @return [String] + required :source_account_number_id, String + + # @!attribute status + # The lifecycle status of the transfer. + # + # @return [Symbol, Increase::Models::SwiftTransfer::Status] + required :status, enum: -> { Increase::SwiftTransfer::Status } + + # @!attribute transaction_id + # The ID for the transaction funding the transfer. This will be populated after + # the transfer is initiated. + # + # @return [String, nil] + required :transaction_id, String, nil?: true + + # @!attribute type + # A constant representing the object's type. For this resource it will always be + # `swift_transfer`. + # + # @return [Symbol, Increase::Models::SwiftTransfer::Type] + required :type, enum: -> { Increase::SwiftTransfer::Type } + + # @!attribute unique_end_to_end_transaction_reference + # The Unique End-to-end Transaction Reference + # ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr)) + # for the transfer. + # + # @return [String] + required :unique_end_to_end_transaction_reference, String + + # @!attribute unstructured_remittance_information + # The unstructured remittance information that was included with the transfer. + # + # @return [String] + required :unstructured_remittance_information, String + + # @!method initialize(id:, account_id:, account_number:, amount:, bank_identification_code:, created_at:, created_by:, creditor_address:, creditor_name:, debtor_address:, debtor_name:, idempotency_key:, instructed_amount:, instructed_currency:, pending_transaction_id:, routing_number:, source_account_number_id:, status:, transaction_id:, type:, unique_end_to_end_transaction_reference:, unstructured_remittance_information:) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransfer} for more details. + # + # Swift Transfers send funds internationally. + # + # @param id [String] The Swift transfer's identifier. + # + # @param account_id [String] The Account to which the transfer belongs. + # + # @param account_number [String] The creditor's account number. + # + # @param amount [Integer] The transfer amount in USD cents. + # + # @param bank_identification_code [String] The bank identification code (BIC) of the creditor. + # + # @param created_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which th + # + # @param created_by [Increase::Models::SwiftTransfer::CreatedBy] What object created the transfer, either via the API or the dashboard. + # + # @param creditor_address [Increase::Models::SwiftTransfer::CreditorAddress] The creditor's address. + # + # @param creditor_name [String] The creditor's name. + # + # @param debtor_address [Increase::Models::SwiftTransfer::DebtorAddress] The debtor's address. + # + # @param debtor_name [String] The debtor's name. + # + # @param idempotency_key [String, nil] The idempotency key you chose for this object. This value is unique across Incre + # + # @param instructed_amount [Integer] The amount that was instructed to be transferred in minor units of the `instruct + # + # @param instructed_currency [Symbol, Increase::Models::SwiftTransfer::InstructedCurrency] The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the inst + # + # @param pending_transaction_id [String, nil] The ID for the pending transaction representing the transfer. + # + # @param routing_number [String, nil] The creditor's bank account routing or transit number. Required in certain count + # + # @param source_account_number_id [String] The Account Number included in the transfer as the debtor's account number. + # + # @param status [Symbol, Increase::Models::SwiftTransfer::Status] The lifecycle status of the transfer. + # + # @param transaction_id [String, nil] The ID for the transaction funding the transfer. This will be populated after th + # + # @param type [Symbol, Increase::Models::SwiftTransfer::Type] A constant representing the object's type. For this resource it will always be ` + # + # @param unique_end_to_end_transaction_reference [String] The Unique End-to-end Transaction Reference ([UETR](https://www.swift.com/paymen + # + # @param unstructured_remittance_information [String] The unstructured remittance information that was included with the transfer. + + # @see Increase::Models::SwiftTransfer#created_by + class CreatedBy < Increase::Internal::Type::BaseModel + # @!attribute api_key + # If present, details about the API key that created the transfer. + # + # @return [Increase::Models::SwiftTransfer::CreatedBy::APIKey, nil] + required :api_key, -> { Increase::SwiftTransfer::CreatedBy::APIKey }, nil?: true + + # @!attribute category + # The type of object that created this transfer. + # + # @return [Symbol, Increase::Models::SwiftTransfer::CreatedBy::Category] + required :category, enum: -> { Increase::SwiftTransfer::CreatedBy::Category } + + # @!attribute oauth_application + # If present, details about the OAuth Application that created the transfer. + # + # @return [Increase::Models::SwiftTransfer::CreatedBy::OAuthApplication, nil] + required :oauth_application, -> { Increase::SwiftTransfer::CreatedBy::OAuthApplication }, nil?: true + + # @!attribute user + # If present, details about the User that created the transfer. + # + # @return [Increase::Models::SwiftTransfer::CreatedBy::User, nil] + required :user, -> { Increase::SwiftTransfer::CreatedBy::User }, nil?: true + + # @!method initialize(api_key:, category:, oauth_application:, user:) + # What object created the transfer, either via the API or the dashboard. + # + # @param api_key [Increase::Models::SwiftTransfer::CreatedBy::APIKey, nil] If present, details about the API key that created the transfer. + # + # @param category [Symbol, Increase::Models::SwiftTransfer::CreatedBy::Category] The type of object that created this transfer. + # + # @param oauth_application [Increase::Models::SwiftTransfer::CreatedBy::OAuthApplication, nil] If present, details about the OAuth Application that created the transfer. + # + # @param user [Increase::Models::SwiftTransfer::CreatedBy::User, nil] If present, details about the User that created the transfer. + + # @see Increase::Models::SwiftTransfer::CreatedBy#api_key + class APIKey < Increase::Internal::Type::BaseModel + # @!attribute description + # The description set for the API key when it was created. + # + # @return [String, nil] + required :description, String, nil?: true + + # @!method initialize(description:) + # If present, details about the API key that created the transfer. + # + # @param description [String, nil] The description set for the API key when it was created. + end + + # The type of object that created this transfer. + # + # @see Increase::Models::SwiftTransfer::CreatedBy#category + module Category + extend Increase::Internal::Type::Enum + + # An API key. Details will be under the `api_key` object. + API_KEY = :api_key + + # An OAuth application you connected to Increase. Details will be under the `oauth_application` object. + OAUTH_APPLICATION = :oauth_application + + # A User in the Increase dashboard. Details will be under the `user` object. + USER = :user + + # @!method self.values + # @return [Array] + end + + # @see Increase::Models::SwiftTransfer::CreatedBy#oauth_application + class OAuthApplication < Increase::Internal::Type::BaseModel + # @!attribute name + # The name of the OAuth Application. + # + # @return [String] + required :name, String + + # @!method initialize(name:) + # If present, details about the OAuth Application that created the transfer. + # + # @param name [String] The name of the OAuth Application. + end + + # @see Increase::Models::SwiftTransfer::CreatedBy#user + class User < Increase::Internal::Type::BaseModel + # @!attribute email + # The email address of the User. + # + # @return [String] + required :email, String + + # @!method initialize(email:) + # If present, details about the User that created the transfer. + # + # @param email [String] The email address of the User. + end + end + + # @see Increase::Models::SwiftTransfer#creditor_address + class CreditorAddress < Increase::Internal::Type::BaseModel + # @!attribute city + # The city, district, town, or village of the address. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + # + # @return [String] + required :country, String + + # @!attribute line1 + # The first line of the address. + # + # @return [String] + required :line1, String + + # @!attribute line2 + # The second line of the address. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # The ZIP or postal code of the address. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # The state, province, or region of the address. Required in certain countries. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!method initialize(city:, country:, line1:, line2:, postal_code:, state:) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransfer::CreditorAddress} for more details. + # + # The creditor's address. + # + # @param city [String, nil] The city, district, town, or village of the address. + # + # @param country [String] The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alp + # + # @param line1 [String] The first line of the address. + # + # @param line2 [String, nil] The second line of the address. + # + # @param postal_code [String, nil] The ZIP or postal code of the address. + # + # @param state [String, nil] The state, province, or region of the address. Required in certain countries. + end + + # @see Increase::Models::SwiftTransfer#debtor_address + class DebtorAddress < Increase::Internal::Type::BaseModel + # @!attribute city + # The city, district, town, or village of the address. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + # + # @return [String] + required :country, String + + # @!attribute line1 + # The first line of the address. + # + # @return [String] + required :line1, String + + # @!attribute line2 + # The second line of the address. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # The ZIP or postal code of the address. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # The state, province, or region of the address. Required in certain countries. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!method initialize(city:, country:, line1:, line2:, postal_code:, state:) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransfer::DebtorAddress} for more details. + # + # The debtor's address. + # + # @param city [String, nil] The city, district, town, or village of the address. + # + # @param country [String] The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alp + # + # @param line1 [String] The first line of the address. + # + # @param line2 [String, nil] The second line of the address. + # + # @param postal_code [String, nil] The ZIP or postal code of the address. + # + # @param state [String, nil] The state, province, or region of the address. Required in certain countries. + end + + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + # + # @see Increase::Models::SwiftTransfer#instructed_currency + module InstructedCurrency + extend Increase::Internal::Type::Enum + + # United States Dollar + USD = :USD + + # @!method self.values + # @return [Array] + end + + # The lifecycle status of the transfer. + # + # @see Increase::Models::SwiftTransfer#status + module Status + extend Increase::Internal::Type::Enum + + # The transfer is pending approval. + PENDING_APPROVAL = :pending_approval + + # The transfer has been canceled. + CANCELED = :canceled + + # The transfer is pending review by Increase. + PENDING_REVIEWING = :pending_reviewing + + # The transfer requires attention from an Increase operator. + REQUIRES_ATTENTION = :requires_attention + + # The transfer is pending initiation. + PENDING_INITIATING = :pending_initiating + + # The transfer has been initiated. + INITIATED = :initiated + + # The transfer has been rejected by Increase. + REJECTED = :rejected + + # The transfer has been returned. + RETURNED = :returned + + # @!method self.values + # @return [Array] + end + + # A constant representing the object's type. For this resource it will always be + # `swift_transfer`. + # + # @see Increase::Models::SwiftTransfer#type + module Type + extend Increase::Internal::Type::Enum + + SWIFT_TRANSFER = :swift_transfer + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/increase/models/swift_transfer_approve_params.rb b/lib/increase/models/swift_transfer_approve_params.rb new file mode 100644 index 00000000..bb8127fa --- /dev/null +++ b/lib/increase/models/swift_transfer_approve_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::SwiftTransfers#approve + class SwiftTransferApproveParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/increase/models/swift_transfer_cancel_params.rb b/lib/increase/models/swift_transfer_cancel_params.rb new file mode 100644 index 00000000..ddbe484f --- /dev/null +++ b/lib/increase/models/swift_transfer_cancel_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::SwiftTransfers#cancel + class SwiftTransferCancelParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/increase/models/swift_transfer_create_params.rb b/lib/increase/models/swift_transfer_create_params.rb new file mode 100644 index 00000000..492e25b8 --- /dev/null +++ b/lib/increase/models/swift_transfer_create_params.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::SwiftTransfers#create + class SwiftTransferCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!attribute account_id + # The identifier for the account that will send the transfer. + # + # @return [String] + required :account_id, String + + # @!attribute account_number + # The creditor's account number. + # + # @return [String] + required :account_number, String + + # @!attribute bank_identification_code + # The bank identification code (BIC) of the creditor. If it ends with the + # three-character branch code, this must be 11 characters long. Otherwise this + # must be 8 characters and the branch code will be assumed to be `XXX`. + # + # @return [String] + required :bank_identification_code, String + + # @!attribute creditor_address + # The creditor's address. + # + # @return [Increase::Models::SwiftTransferCreateParams::CreditorAddress] + required :creditor_address, -> { Increase::SwiftTransferCreateParams::CreditorAddress } + + # @!attribute creditor_name + # The creditor's name. + # + # @return [String] + required :creditor_name, String + + # @!attribute debtor_address + # The debtor's address. + # + # @return [Increase::Models::SwiftTransferCreateParams::DebtorAddress] + required :debtor_address, -> { Increase::SwiftTransferCreateParams::DebtorAddress } + + # @!attribute debtor_name + # The debtor's name. + # + # @return [String] + required :debtor_name, String + + # @!attribute instructed_amount + # The amount, in minor units of `instructed_currency`, to send to the creditor. + # + # @return [Integer] + required :instructed_amount, Integer + + # @!attribute instructed_currency + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + # + # @return [Symbol, Increase::Models::SwiftTransferCreateParams::InstructedCurrency] + required :instructed_currency, enum: -> { Increase::SwiftTransferCreateParams::InstructedCurrency } + + # @!attribute source_account_number_id + # The Account Number to include in the transfer as the debtor's account number. + # + # @return [String] + required :source_account_number_id, String + + # @!attribute unstructured_remittance_information + # Unstructured remittance information to include in the transfer. + # + # @return [String] + required :unstructured_remittance_information, String + + # @!attribute require_approval + # Whether the transfer requires explicit approval via the dashboard or API. + # + # @return [Boolean, nil] + optional :require_approval, Increase::Internal::Type::Boolean + + # @!attribute routing_number + # The creditor's bank account routing or transit number. Required in certain + # countries. + # + # @return [String, nil] + optional :routing_number, String + + # @!method initialize(account_id:, account_number:, bank_identification_code:, creditor_address:, creditor_name:, debtor_address:, debtor_name:, instructed_amount:, instructed_currency:, source_account_number_id:, unstructured_remittance_information:, require_approval: nil, routing_number: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransferCreateParams} for more details. + # + # @param account_id [String] The identifier for the account that will send the transfer. + # + # @param account_number [String] The creditor's account number. + # + # @param bank_identification_code [String] The bank identification code (BIC) of the creditor. If it ends with the three-ch + # + # @param creditor_address [Increase::Models::SwiftTransferCreateParams::CreditorAddress] The creditor's address. + # + # @param creditor_name [String] The creditor's name. + # + # @param debtor_address [Increase::Models::SwiftTransferCreateParams::DebtorAddress] The debtor's address. + # + # @param debtor_name [String] The debtor's name. + # + # @param instructed_amount [Integer] The amount, in minor units of `instructed_currency`, to send to the creditor. + # + # @param instructed_currency [Symbol, Increase::Models::SwiftTransferCreateParams::InstructedCurrency] The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the inst + # + # @param source_account_number_id [String] The Account Number to include in the transfer as the debtor's account number. + # + # @param unstructured_remittance_information [String] Unstructured remittance information to include in the transfer. + # + # @param require_approval [Boolean] Whether the transfer requires explicit approval via the dashboard or API. + # + # @param routing_number [String] The creditor's bank account routing or transit number. Required in certain count + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + + class CreditorAddress < Increase::Internal::Type::BaseModel + # @!attribute city + # The city, district, town, or village of the address. + # + # @return [String] + required :city, String + + # @!attribute country + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + # + # @return [String] + required :country, String + + # @!attribute line1 + # The first line of the address. This is usually the street number and street. + # + # @return [String] + required :line1, String + + # @!attribute line2 + # The second line of the address. This might be the floor or room number. + # + # @return [String, nil] + optional :line2, String + + # @!attribute postal_code + # The ZIP or postal code of the address. Required in certain countries. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # The state, province, or region of the address. Required in certain countries. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(city:, country:, line1:, line2: nil, postal_code: nil, state: nil) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransferCreateParams::CreditorAddress} for more details. + # + # The creditor's address. + # + # @param city [String] The city, district, town, or village of the address. + # + # @param country [String] The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alp + # + # @param line1 [String] The first line of the address. This is usually the street number and street. + # + # @param line2 [String] The second line of the address. This might be the floor or room number. + # + # @param postal_code [String] The ZIP or postal code of the address. Required in certain countries. + # + # @param state [String] The state, province, or region of the address. Required in certain countries. + end + + class DebtorAddress < Increase::Internal::Type::BaseModel + # @!attribute city + # The city, district, town, or village of the address. + # + # @return [String] + required :city, String + + # @!attribute country + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + # + # @return [String] + required :country, String + + # @!attribute line1 + # The first line of the address. This is usually the street number and street. + # + # @return [String] + required :line1, String + + # @!attribute line2 + # The second line of the address. This might be the floor or room number. + # + # @return [String, nil] + optional :line2, String + + # @!attribute postal_code + # The ZIP or postal code of the address. Required in certain countries. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # The state, province, or region of the address. Required in certain countries. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(city:, country:, line1:, line2: nil, postal_code: nil, state: nil) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransferCreateParams::DebtorAddress} for more details. + # + # The debtor's address. + # + # @param city [String] The city, district, town, or village of the address. + # + # @param country [String] The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alp + # + # @param line1 [String] The first line of the address. This is usually the street number and street. + # + # @param line2 [String] The second line of the address. This might be the floor or room number. + # + # @param postal_code [String] The ZIP or postal code of the address. Required in certain countries. + # + # @param state [String] The state, province, or region of the address. Required in certain countries. + end + + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + module InstructedCurrency + extend Increase::Internal::Type::Enum + + # United States Dollar + USD = :USD + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/increase/models/swift_transfer_list_params.rb b/lib/increase/models/swift_transfer_list_params.rb new file mode 100644 index 00000000..01972269 --- /dev/null +++ b/lib/increase/models/swift_transfer_list_params.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::SwiftTransfers#list + class SwiftTransferListParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!attribute account_id + # Filter Swift Transfers to those that originated from the specified Account. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute created_at + # + # @return [Increase::Models::SwiftTransferListParams::CreatedAt, nil] + optional :created_at, -> { Increase::SwiftTransferListParams::CreatedAt } + + # @!attribute cursor + # Return the page of entries after this one. + # + # @return [String, nil] + optional :cursor, String + + # @!attribute idempotency_key + # Filter records to the one with the specified `idempotency_key` you chose for + # that object. This value is unique across Increase and is used to ensure that a + # request is only processed once. Learn more about + # [idempotency](https://increase.com/documentation/idempotency-keys). + # + # @return [String, nil] + optional :idempotency_key, String + + # @!attribute limit + # Limit the size of the list that is returned. The default (and maximum) is 100 + # objects. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute status + # + # @return [Increase::Models::SwiftTransferListParams::Status, nil] + optional :status, -> { Increase::SwiftTransferListParams::Status } + + # @!method initialize(account_id: nil, created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransferListParams} for more details. + # + # @param account_id [String] Filter Swift Transfers to those that originated from the specified Account. + # + # @param created_at [Increase::Models::SwiftTransferListParams::CreatedAt] + # + # @param cursor [String] Return the page of entries after this one. + # + # @param idempotency_key [String] Filter records to the one with the specified `idempotency_key` you chose for tha + # + # @param limit [Integer] Limit the size of the list that is returned. The default (and maximum) is 100 ob + # + # @param status [Increase::Models::SwiftTransferListParams::Status] + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + + class CreatedAt < Increase::Internal::Type::BaseModel + # @!attribute after + # Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + # timestamp. + # + # @return [Time, nil] + optional :after, Time + + # @!attribute before + # Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + # timestamp. + # + # @return [Time, nil] + optional :before, Time + + # @!attribute on_or_after + # Return results on or after this + # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + # + # @return [Time, nil] + optional :on_or_after, Time + + # @!attribute on_or_before + # Return results on or before this + # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + # + # @return [Time, nil] + optional :on_or_before, Time + + # @!method initialize(after: nil, before: nil, on_or_after: nil, on_or_before: nil) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransferListParams::CreatedAt} for more details. + # + # @param after [Time] Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) tim + # + # @param before [Time] Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ti + # + # @param on_or_after [Time] Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_860 + # + # @param on_or_before [Time] Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_86 + end + + class Status < Increase::Internal::Type::BaseModel + # @!attribute in_ + # Return results whose value is in the provided list. For GET requests, this + # should be encoded as a comma-delimited string, such as `?in=one,two,three`. + # + # @return [Array, nil] + optional :in_, + -> { + Increase::Internal::Type::ArrayOf[enum: Increase::SwiftTransferListParams::Status::In] + }, + api_name: :in + + # @!method initialize(in_: nil) + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransferListParams::Status} for more details. + # + # @param in_ [Array] Return results whose value is in the provided list. For GET requests, this shoul + + module In + extend Increase::Internal::Type::Enum + + # The transfer is pending approval. + PENDING_APPROVAL = :pending_approval + + # The transfer has been canceled. + CANCELED = :canceled + + # The transfer is pending review by Increase. + PENDING_REVIEWING = :pending_reviewing + + # The transfer requires attention from an Increase operator. + REQUIRES_ATTENTION = :requires_attention + + # The transfer is pending initiation. + PENDING_INITIATING = :pending_initiating + + # The transfer has been initiated. + INITIATED = :initiated + + # The transfer has been rejected by Increase. + REJECTED = :rejected + + # The transfer has been returned. + RETURNED = :returned + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/increase/models/swift_transfer_retrieve_params.rb b/lib/increase/models/swift_transfer_retrieve_params.rb new file mode 100644 index 00000000..174a8f1d --- /dev/null +++ b/lib/increase/models/swift_transfer_retrieve_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::SwiftTransfers#retrieve + class SwiftTransferRetrieveParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/increase/resources/swift_transfers.rb b/lib/increase/resources/swift_transfers.rb new file mode 100644 index 00000000..9355db35 --- /dev/null +++ b/lib/increase/resources/swift_transfers.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +module Increase + module Resources + class SwiftTransfers + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransferCreateParams} for more details. + # + # Create a Swift Transfer + # + # @overload create(account_id:, account_number:, bank_identification_code:, creditor_address:, creditor_name:, debtor_address:, debtor_name:, instructed_amount:, instructed_currency:, source_account_number_id:, unstructured_remittance_information:, require_approval: nil, routing_number: nil, request_options: {}) + # + # @param account_id [String] The identifier for the account that will send the transfer. + # + # @param account_number [String] The creditor's account number. + # + # @param bank_identification_code [String] The bank identification code (BIC) of the creditor. If it ends with the three-ch + # + # @param creditor_address [Increase::Models::SwiftTransferCreateParams::CreditorAddress] The creditor's address. + # + # @param creditor_name [String] The creditor's name. + # + # @param debtor_address [Increase::Models::SwiftTransferCreateParams::DebtorAddress] The debtor's address. + # + # @param debtor_name [String] The debtor's name. + # + # @param instructed_amount [Integer] The amount, in minor units of `instructed_currency`, to send to the creditor. + # + # @param instructed_currency [Symbol, Increase::Models::SwiftTransferCreateParams::InstructedCurrency] The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the inst + # + # @param source_account_number_id [String] The Account Number to include in the transfer as the debtor's account number. + # + # @param unstructured_remittance_information [String] Unstructured remittance information to include in the transfer. + # + # @param require_approval [Boolean] Whether the transfer requires explicit approval via the dashboard or API. + # + # @param routing_number [String] The creditor's bank account routing or transit number. Required in certain count + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Models::SwiftTransfer] + # + # @see Increase::Models::SwiftTransferCreateParams + def create(params) + parsed, options = Increase::SwiftTransferCreateParams.dump_request(params) + @client.request( + method: :post, + path: "swift_transfers", + body: parsed, + model: Increase::SwiftTransfer, + options: options + ) + end + + # Retrieve a Swift Transfer + # + # @overload retrieve(swift_transfer_id, request_options: {}) + # + # @param swift_transfer_id [String] The identifier of the Swift Transfer. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Models::SwiftTransfer] + # + # @see Increase::Models::SwiftTransferRetrieveParams + def retrieve(swift_transfer_id, params = {}) + @client.request( + method: :get, + path: ["swift_transfers/%1$s", swift_transfer_id], + model: Increase::SwiftTransfer, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Increase::Models::SwiftTransferListParams} for more details. + # + # List Swift Transfers + # + # @overload list(account_id: nil, created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, status: nil, request_options: {}) + # + # @param account_id [String] Filter Swift Transfers to those that originated from the specified Account. + # + # @param created_at [Increase::Models::SwiftTransferListParams::CreatedAt] + # + # @param cursor [String] Return the page of entries after this one. + # + # @param idempotency_key [String] Filter records to the one with the specified `idempotency_key` you chose for tha + # + # @param limit [Integer] Limit the size of the list that is returned. The default (and maximum) is 100 ob + # + # @param status [Increase::Models::SwiftTransferListParams::Status] + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Internal::Page] + # + # @see Increase::Models::SwiftTransferListParams + def list(params = {}) + parsed, options = Increase::SwiftTransferListParams.dump_request(params) + @client.request( + method: :get, + path: "swift_transfers", + query: parsed, + page: Increase::Internal::Page, + model: Increase::SwiftTransfer, + options: options + ) + end + + # Approve a Swift Transfer + # + # @overload approve(swift_transfer_id, request_options: {}) + # + # @param swift_transfer_id [String] The identifier of the Swift Transfer to approve. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Models::SwiftTransfer] + # + # @see Increase::Models::SwiftTransferApproveParams + def approve(swift_transfer_id, params = {}) + @client.request( + method: :post, + path: ["swift_transfers/%1$s/approve", swift_transfer_id], + model: Increase::SwiftTransfer, + options: params[:request_options] + ) + end + + # Cancel a pending Swift Transfer + # + # @overload cancel(swift_transfer_id, request_options: {}) + # + # @param swift_transfer_id [String] The identifier of the pending Swift Transfer to cancel. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Models::SwiftTransfer] + # + # @see Increase::Models::SwiftTransferCancelParams + def cancel(swift_transfer_id, params = {}) + @client.request( + method: :post, + path: ["swift_transfers/%1$s/cancel", swift_transfer_id], + model: Increase::SwiftTransfer, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Increase::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/increase/version.rb b/lib/increase/version.rb index 377ab205..ce290561 100644 --- a/lib/increase/version.rb +++ b/lib/increase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Increase - VERSION = "1.174.0" + VERSION = "1.175.0" end diff --git a/rbi/increase/client.rbi b/rbi/increase/client.rbi index b283376d..596115e1 100644 --- a/rbi/increase/client.rbi +++ b/rbi/increase/client.rbi @@ -103,6 +103,9 @@ module Increase sig { returns(Increase::Resources::InboundFednowTransfers) } attr_reader :inbound_fednow_transfers + sig { returns(Increase::Resources::SwiftTransfers) } + attr_reader :swift_transfers + sig { returns(Increase::Resources::CheckDeposits) } attr_reader :check_deposits diff --git a/rbi/increase/models.rbi b/rbi/increase/models.rbi index 0ffd8d52..23c3861a 100644 --- a/rbi/increase/models.rbi +++ b/rbi/increase/models.rbi @@ -546,6 +546,18 @@ module Increase SupplementalDocumentListParams = Increase::Models::SupplementalDocumentListParams + SwiftTransfer = Increase::Models::SwiftTransfer + + SwiftTransferApproveParams = Increase::Models::SwiftTransferApproveParams + + SwiftTransferCancelParams = Increase::Models::SwiftTransferCancelParams + + SwiftTransferCreateParams = Increase::Models::SwiftTransferCreateParams + + SwiftTransferListParams = Increase::Models::SwiftTransferListParams + + SwiftTransferRetrieveParams = Increase::Models::SwiftTransferRetrieveParams + Transaction = Increase::Models::Transaction TransactionListParams = Increase::Models::TransactionListParams diff --git a/rbi/increase/models/swift_transfer.rbi b/rbi/increase/models/swift_transfer.rbi new file mode 100644 index 00000000..11f1a0e7 --- /dev/null +++ b/rbi/increase/models/swift_transfer.rbi @@ -0,0 +1,732 @@ +# typed: strong + +module Increase + module Models + class SwiftTransfer < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Increase::SwiftTransfer, Increase::Internal::AnyHash) + end + + # The Swift transfer's identifier. + sig { returns(String) } + attr_accessor :id + + # The Account to which the transfer belongs. + sig { returns(String) } + attr_accessor :account_id + + # The creditor's account number. + sig { returns(String) } + attr_accessor :account_number + + # The transfer amount in USD cents. + sig { returns(Integer) } + attr_accessor :amount + + # The bank identification code (BIC) of the creditor. + sig { returns(String) } + attr_accessor :bank_identification_code + + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + # the transfer was created. + sig { returns(Time) } + attr_accessor :created_at + + # What object created the transfer, either via the API or the dashboard. + sig { returns(Increase::SwiftTransfer::CreatedBy) } + attr_reader :created_by + + sig do + params(created_by: Increase::SwiftTransfer::CreatedBy::OrHash).void + end + attr_writer :created_by + + # The creditor's address. + sig { returns(Increase::SwiftTransfer::CreditorAddress) } + attr_reader :creditor_address + + sig do + params( + creditor_address: Increase::SwiftTransfer::CreditorAddress::OrHash + ).void + end + attr_writer :creditor_address + + # The creditor's name. + sig { returns(String) } + attr_accessor :creditor_name + + # The debtor's address. + sig { returns(Increase::SwiftTransfer::DebtorAddress) } + attr_reader :debtor_address + + sig do + params( + debtor_address: Increase::SwiftTransfer::DebtorAddress::OrHash + ).void + end + attr_writer :debtor_address + + # The debtor's name. + sig { returns(String) } + attr_accessor :debtor_name + + # The idempotency key you chose for this object. This value is unique across + # Increase and is used to ensure that a request is only processed once. Learn more + # about [idempotency](https://increase.com/documentation/idempotency-keys). + sig { returns(T.nilable(String)) } + attr_accessor :idempotency_key + + # The amount that was instructed to be transferred in minor units of the + # `instructed_currency`. + sig { returns(Integer) } + attr_accessor :instructed_amount + + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + sig { returns(Increase::SwiftTransfer::InstructedCurrency::TaggedSymbol) } + attr_accessor :instructed_currency + + # The ID for the pending transaction representing the transfer. + sig { returns(T.nilable(String)) } + attr_accessor :pending_transaction_id + + # The creditor's bank account routing or transit number. Required in certain + # countries. + sig { returns(T.nilable(String)) } + attr_accessor :routing_number + + # The Account Number included in the transfer as the debtor's account number. + sig { returns(String) } + attr_accessor :source_account_number_id + + # The lifecycle status of the transfer. + sig { returns(Increase::SwiftTransfer::Status::TaggedSymbol) } + attr_accessor :status + + # The ID for the transaction funding the transfer. This will be populated after + # the transfer is initiated. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_id + + # A constant representing the object's type. For this resource it will always be + # `swift_transfer`. + sig { returns(Increase::SwiftTransfer::Type::TaggedSymbol) } + attr_accessor :type + + # The Unique End-to-end Transaction Reference + # ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr)) + # for the transfer. + sig { returns(String) } + attr_accessor :unique_end_to_end_transaction_reference + + # The unstructured remittance information that was included with the transfer. + sig { returns(String) } + attr_accessor :unstructured_remittance_information + + # Swift Transfers send funds internationally. + sig do + params( + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy::OrHash, + creditor_address: Increase::SwiftTransfer::CreditorAddress::OrHash, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress::OrHash, + debtor_name: String, + idempotency_key: T.nilable(String), + instructed_amount: Integer, + instructed_currency: + Increase::SwiftTransfer::InstructedCurrency::OrSymbol, + pending_transaction_id: T.nilable(String), + routing_number: T.nilable(String), + source_account_number_id: String, + status: Increase::SwiftTransfer::Status::OrSymbol, + transaction_id: T.nilable(String), + type: Increase::SwiftTransfer::Type::OrSymbol, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + ).returns(T.attached_class) + end + def self.new( + # The Swift transfer's identifier. + id:, + # The Account to which the transfer belongs. + account_id:, + # The creditor's account number. + account_number:, + # The transfer amount in USD cents. + amount:, + # The bank identification code (BIC) of the creditor. + bank_identification_code:, + # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + # the transfer was created. + created_at:, + # What object created the transfer, either via the API or the dashboard. + created_by:, + # The creditor's address. + creditor_address:, + # The creditor's name. + creditor_name:, + # The debtor's address. + debtor_address:, + # The debtor's name. + debtor_name:, + # The idempotency key you chose for this object. This value is unique across + # Increase and is used to ensure that a request is only processed once. Learn more + # about [idempotency](https://increase.com/documentation/idempotency-keys). + idempotency_key:, + # The amount that was instructed to be transferred in minor units of the + # `instructed_currency`. + instructed_amount:, + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + instructed_currency:, + # The ID for the pending transaction representing the transfer. + pending_transaction_id:, + # The creditor's bank account routing or transit number. Required in certain + # countries. + routing_number:, + # The Account Number included in the transfer as the debtor's account number. + source_account_number_id:, + # The lifecycle status of the transfer. + status:, + # The ID for the transaction funding the transfer. This will be populated after + # the transfer is initiated. + transaction_id:, + # A constant representing the object's type. For this resource it will always be + # `swift_transfer`. + type:, + # The Unique End-to-end Transaction Reference + # ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr)) + # for the transfer. + unique_end_to_end_transaction_reference:, + # The unstructured remittance information that was included with the transfer. + unstructured_remittance_information: + ) + end + + sig do + override.returns( + { + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: T.nilable(String), + instructed_amount: Integer, + instructed_currency: + Increase::SwiftTransfer::InstructedCurrency::TaggedSymbol, + pending_transaction_id: T.nilable(String), + routing_number: T.nilable(String), + source_account_number_id: String, + status: Increase::SwiftTransfer::Status::TaggedSymbol, + transaction_id: T.nilable(String), + type: Increase::SwiftTransfer::Type::TaggedSymbol, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + } + ) + end + def to_hash + end + + class CreatedBy < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransfer::CreatedBy, + Increase::Internal::AnyHash + ) + end + + # If present, details about the API key that created the transfer. + sig { returns(T.nilable(Increase::SwiftTransfer::CreatedBy::APIKey)) } + attr_reader :api_key + + sig do + params( + api_key: + T.nilable(Increase::SwiftTransfer::CreatedBy::APIKey::OrHash) + ).void + end + attr_writer :api_key + + # The type of object that created this transfer. + sig do + returns(Increase::SwiftTransfer::CreatedBy::Category::TaggedSymbol) + end + attr_accessor :category + + # If present, details about the OAuth Application that created the transfer. + sig do + returns( + T.nilable(Increase::SwiftTransfer::CreatedBy::OAuthApplication) + ) + end + attr_reader :oauth_application + + sig do + params( + oauth_application: + T.nilable( + Increase::SwiftTransfer::CreatedBy::OAuthApplication::OrHash + ) + ).void + end + attr_writer :oauth_application + + # If present, details about the User that created the transfer. + sig { returns(T.nilable(Increase::SwiftTransfer::CreatedBy::User)) } + attr_reader :user + + sig do + params( + user: T.nilable(Increase::SwiftTransfer::CreatedBy::User::OrHash) + ).void + end + attr_writer :user + + # What object created the transfer, either via the API or the dashboard. + sig do + params( + api_key: + T.nilable(Increase::SwiftTransfer::CreatedBy::APIKey::OrHash), + category: Increase::SwiftTransfer::CreatedBy::Category::OrSymbol, + oauth_application: + T.nilable( + Increase::SwiftTransfer::CreatedBy::OAuthApplication::OrHash + ), + user: T.nilable(Increase::SwiftTransfer::CreatedBy::User::OrHash) + ).returns(T.attached_class) + end + def self.new( + # If present, details about the API key that created the transfer. + api_key:, + # The type of object that created this transfer. + category:, + # If present, details about the OAuth Application that created the transfer. + oauth_application:, + # If present, details about the User that created the transfer. + user: + ) + end + + sig do + override.returns( + { + api_key: T.nilable(Increase::SwiftTransfer::CreatedBy::APIKey), + category: + Increase::SwiftTransfer::CreatedBy::Category::TaggedSymbol, + oauth_application: + T.nilable(Increase::SwiftTransfer::CreatedBy::OAuthApplication), + user: T.nilable(Increase::SwiftTransfer::CreatedBy::User) + } + ) + end + def to_hash + end + + class APIKey < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransfer::CreatedBy::APIKey, + Increase::Internal::AnyHash + ) + end + + # The description set for the API key when it was created. + sig { returns(T.nilable(String)) } + attr_accessor :description + + # If present, details about the API key that created the transfer. + sig do + params(description: T.nilable(String)).returns(T.attached_class) + end + def self.new( + # The description set for the API key when it was created. + description: + ) + end + + sig { override.returns({ description: T.nilable(String) }) } + def to_hash + end + end + + # The type of object that created this transfer. + module Category + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Increase::SwiftTransfer::CreatedBy::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # An API key. Details will be under the `api_key` object. + API_KEY = + T.let( + :api_key, + Increase::SwiftTransfer::CreatedBy::Category::TaggedSymbol + ) + + # An OAuth application you connected to Increase. Details will be under the `oauth_application` object. + OAUTH_APPLICATION = + T.let( + :oauth_application, + Increase::SwiftTransfer::CreatedBy::Category::TaggedSymbol + ) + + # A User in the Increase dashboard. Details will be under the `user` object. + USER = + T.let( + :user, + Increase::SwiftTransfer::CreatedBy::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Increase::SwiftTransfer::CreatedBy::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + class OAuthApplication < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransfer::CreatedBy::OAuthApplication, + Increase::Internal::AnyHash + ) + end + + # The name of the OAuth Application. + sig { returns(String) } + attr_accessor :name + + # If present, details about the OAuth Application that created the transfer. + sig { params(name: String).returns(T.attached_class) } + def self.new( + # The name of the OAuth Application. + name: + ) + end + + sig { override.returns({ name: String }) } + def to_hash + end + end + + class User < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransfer::CreatedBy::User, + Increase::Internal::AnyHash + ) + end + + # The email address of the User. + sig { returns(String) } + attr_accessor :email + + # If present, details about the User that created the transfer. + sig { params(email: String).returns(T.attached_class) } + def self.new( + # The email address of the User. + email: + ) + end + + sig { override.returns({ email: String }) } + def to_hash + end + end + end + + class CreditorAddress < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransfer::CreditorAddress, + Increase::Internal::AnyHash + ) + end + + # The city, district, town, or village of the address. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + sig { returns(String) } + attr_accessor :country + + # The first line of the address. + sig { returns(String) } + attr_accessor :line1 + + # The second line of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # The ZIP or postal code of the address. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # The state, province, or region of the address. Required in certain countries. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # The creditor's address. + sig do + params( + city: T.nilable(String), + country: String, + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The city, district, town, or village of the address. + city:, + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + country:, + # The first line of the address. + line1:, + # The second line of the address. + line2:, + # The ZIP or postal code of the address. + postal_code:, + # The state, province, or region of the address. Required in certain countries. + state: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: String, + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + class DebtorAddress < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransfer::DebtorAddress, + Increase::Internal::AnyHash + ) + end + + # The city, district, town, or village of the address. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + sig { returns(String) } + attr_accessor :country + + # The first line of the address. + sig { returns(String) } + attr_accessor :line1 + + # The second line of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # The ZIP or postal code of the address. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # The state, province, or region of the address. Required in certain countries. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # The debtor's address. + sig do + params( + city: T.nilable(String), + country: String, + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The city, district, town, or village of the address. + city:, + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + country:, + # The first line of the address. + line1:, + # The second line of the address. + line2:, + # The ZIP or postal code of the address. + postal_code:, + # The state, province, or region of the address. Required in certain countries. + state: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: String, + line1: String, + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + module InstructedCurrency + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Increase::SwiftTransfer::InstructedCurrency) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # United States Dollar + USD = + T.let(:USD, Increase::SwiftTransfer::InstructedCurrency::TaggedSymbol) + + sig do + override.returns( + T::Array[Increase::SwiftTransfer::InstructedCurrency::TaggedSymbol] + ) + end + def self.values + end + end + + # The lifecycle status of the transfer. + module Status + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Increase::SwiftTransfer::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # The transfer is pending approval. + PENDING_APPROVAL = + T.let( + :pending_approval, + Increase::SwiftTransfer::Status::TaggedSymbol + ) + + # The transfer has been canceled. + CANCELED = + T.let(:canceled, Increase::SwiftTransfer::Status::TaggedSymbol) + + # The transfer is pending review by Increase. + PENDING_REVIEWING = + T.let( + :pending_reviewing, + Increase::SwiftTransfer::Status::TaggedSymbol + ) + + # The transfer requires attention from an Increase operator. + REQUIRES_ATTENTION = + T.let( + :requires_attention, + Increase::SwiftTransfer::Status::TaggedSymbol + ) + + # The transfer is pending initiation. + PENDING_INITIATING = + T.let( + :pending_initiating, + Increase::SwiftTransfer::Status::TaggedSymbol + ) + + # The transfer has been initiated. + INITIATED = + T.let(:initiated, Increase::SwiftTransfer::Status::TaggedSymbol) + + # The transfer has been rejected by Increase. + REJECTED = + T.let(:rejected, Increase::SwiftTransfer::Status::TaggedSymbol) + + # The transfer has been returned. + RETURNED = + T.let(:returned, Increase::SwiftTransfer::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Increase::SwiftTransfer::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # A constant representing the object's type. For this resource it will always be + # `swift_transfer`. + module Type + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Increase::SwiftTransfer::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SWIFT_TRANSFER = + T.let(:swift_transfer, Increase::SwiftTransfer::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Increase::SwiftTransfer::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/increase/models/swift_transfer_approve_params.rbi b/rbi/increase/models/swift_transfer_approve_params.rbi new file mode 100644 index 00000000..b8baadc0 --- /dev/null +++ b/rbi/increase/models/swift_transfer_approve_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Increase + module Models + class SwiftTransferApproveParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransferApproveParams, + Increase::Internal::AnyHash + ) + end + + sig do + params(request_options: Increase::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Increase::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/increase/models/swift_transfer_cancel_params.rbi b/rbi/increase/models/swift_transfer_cancel_params.rbi new file mode 100644 index 00000000..926049b3 --- /dev/null +++ b/rbi/increase/models/swift_transfer_cancel_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Increase + module Models + class SwiftTransferCancelParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransferCancelParams, + Increase::Internal::AnyHash + ) + end + + sig do + params(request_options: Increase::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Increase::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/increase/models/swift_transfer_create_params.rbi b/rbi/increase/models/swift_transfer_create_params.rbi new file mode 100644 index 00000000..e8482a2d --- /dev/null +++ b/rbi/increase/models/swift_transfer_create_params.rbi @@ -0,0 +1,391 @@ +# typed: strong + +module Increase + module Models + class SwiftTransferCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransferCreateParams, + Increase::Internal::AnyHash + ) + end + + # The identifier for the account that will send the transfer. + sig { returns(String) } + attr_accessor :account_id + + # The creditor's account number. + sig { returns(String) } + attr_accessor :account_number + + # The bank identification code (BIC) of the creditor. If it ends with the + # three-character branch code, this must be 11 characters long. Otherwise this + # must be 8 characters and the branch code will be assumed to be `XXX`. + sig { returns(String) } + attr_accessor :bank_identification_code + + # The creditor's address. + sig { returns(Increase::SwiftTransferCreateParams::CreditorAddress) } + attr_reader :creditor_address + + sig do + params( + creditor_address: + Increase::SwiftTransferCreateParams::CreditorAddress::OrHash + ).void + end + attr_writer :creditor_address + + # The creditor's name. + sig { returns(String) } + attr_accessor :creditor_name + + # The debtor's address. + sig { returns(Increase::SwiftTransferCreateParams::DebtorAddress) } + attr_reader :debtor_address + + sig do + params( + debtor_address: + Increase::SwiftTransferCreateParams::DebtorAddress::OrHash + ).void + end + attr_writer :debtor_address + + # The debtor's name. + sig { returns(String) } + attr_accessor :debtor_name + + # The amount, in minor units of `instructed_currency`, to send to the creditor. + sig { returns(Integer) } + attr_accessor :instructed_amount + + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + sig do + returns( + Increase::SwiftTransferCreateParams::InstructedCurrency::OrSymbol + ) + end + attr_accessor :instructed_currency + + # The Account Number to include in the transfer as the debtor's account number. + sig { returns(String) } + attr_accessor :source_account_number_id + + # Unstructured remittance information to include in the transfer. + sig { returns(String) } + attr_accessor :unstructured_remittance_information + + # Whether the transfer requires explicit approval via the dashboard or API. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_approval + + sig { params(require_approval: T::Boolean).void } + attr_writer :require_approval + + # The creditor's bank account routing or transit number. Required in certain + # countries. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + + sig { params(routing_number: String).void } + attr_writer :routing_number + + sig do + params( + account_id: String, + account_number: String, + bank_identification_code: String, + creditor_address: + Increase::SwiftTransferCreateParams::CreditorAddress::OrHash, + creditor_name: String, + debtor_address: + Increase::SwiftTransferCreateParams::DebtorAddress::OrHash, + debtor_name: String, + instructed_amount: Integer, + instructed_currency: + Increase::SwiftTransferCreateParams::InstructedCurrency::OrSymbol, + source_account_number_id: String, + unstructured_remittance_information: String, + require_approval: T::Boolean, + routing_number: String, + request_options: Increase::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The identifier for the account that will send the transfer. + account_id:, + # The creditor's account number. + account_number:, + # The bank identification code (BIC) of the creditor. If it ends with the + # three-character branch code, this must be 11 characters long. Otherwise this + # must be 8 characters and the branch code will be assumed to be `XXX`. + bank_identification_code:, + # The creditor's address. + creditor_address:, + # The creditor's name. + creditor_name:, + # The debtor's address. + debtor_address:, + # The debtor's name. + debtor_name:, + # The amount, in minor units of `instructed_currency`, to send to the creditor. + instructed_amount:, + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + instructed_currency:, + # The Account Number to include in the transfer as the debtor's account number. + source_account_number_id:, + # Unstructured remittance information to include in the transfer. + unstructured_remittance_information:, + # Whether the transfer requires explicit approval via the dashboard or API. + require_approval: nil, + # The creditor's bank account routing or transit number. Required in certain + # countries. + routing_number: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + account_number: String, + bank_identification_code: String, + creditor_address: + Increase::SwiftTransferCreateParams::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransferCreateParams::DebtorAddress, + debtor_name: String, + instructed_amount: Integer, + instructed_currency: + Increase::SwiftTransferCreateParams::InstructedCurrency::OrSymbol, + source_account_number_id: String, + unstructured_remittance_information: String, + require_approval: T::Boolean, + routing_number: String, + request_options: Increase::RequestOptions + } + ) + end + def to_hash + end + + class CreditorAddress < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransferCreateParams::CreditorAddress, + Increase::Internal::AnyHash + ) + end + + # The city, district, town, or village of the address. + sig { returns(String) } + attr_accessor :city + + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + sig { returns(String) } + attr_accessor :country + + # The first line of the address. This is usually the street number and street. + sig { returns(String) } + attr_accessor :line1 + + # The second line of the address. This might be the floor or room number. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # The ZIP or postal code of the address. Required in certain countries. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # The state, province, or region of the address. Required in certain countries. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + # The creditor's address. + sig do + params( + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + # The city, district, town, or village of the address. + city:, + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + country:, + # The first line of the address. This is usually the street number and street. + line1:, + # The second line of the address. This might be the floor or room number. + line2: nil, + # The ZIP or postal code of the address. Required in certain countries. + postal_code: nil, + # The state, province, or region of the address. Required in certain countries. + state: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + + class DebtorAddress < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransferCreateParams::DebtorAddress, + Increase::Internal::AnyHash + ) + end + + # The city, district, town, or village of the address. + sig { returns(String) } + attr_accessor :city + + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + sig { returns(String) } + attr_accessor :country + + # The first line of the address. This is usually the street number and street. + sig { returns(String) } + attr_accessor :line1 + + # The second line of the address. This might be the floor or room number. + sig { returns(T.nilable(String)) } + attr_reader :line2 + + sig { params(line2: String).void } + attr_writer :line2 + + # The ZIP or postal code of the address. Required in certain countries. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # The state, province, or region of the address. Required in certain countries. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + # The debtor's address. + sig do + params( + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + # The city, district, town, or village of the address. + city:, + # The two-letter + # [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for + # the country of the address. + country:, + # The first line of the address. This is usually the street number and street. + line1:, + # The second line of the address. This might be the floor or room number. + line2: nil, + # The ZIP or postal code of the address. Required in certain countries. + postal_code: nil, + # The state, province, or region of the address. Required in certain countries. + state: nil + ) + end + + sig do + override.returns( + { + city: String, + country: String, + line1: String, + line2: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + module InstructedCurrency + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Increase::SwiftTransferCreateParams::InstructedCurrency + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # United States Dollar + USD = + T.let( + :USD, + Increase::SwiftTransferCreateParams::InstructedCurrency::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Increase::SwiftTransferCreateParams::InstructedCurrency::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/increase/models/swift_transfer_list_params.rbi b/rbi/increase/models/swift_transfer_list_params.rbi new file mode 100644 index 00000000..cf213e88 --- /dev/null +++ b/rbi/increase/models/swift_transfer_list_params.rbi @@ -0,0 +1,316 @@ +# typed: strong + +module Increase + module Models + class SwiftTransferListParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Increase::SwiftTransferListParams, Increase::Internal::AnyHash) + end + + # Filter Swift Transfers to those that originated from the specified Account. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + sig { returns(T.nilable(Increase::SwiftTransferListParams::CreatedAt)) } + attr_reader :created_at + + sig do + params( + created_at: Increase::SwiftTransferListParams::CreatedAt::OrHash + ).void + end + attr_writer :created_at + + # Return the page of entries after this one. + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + # Filter records to the one with the specified `idempotency_key` you chose for + # that object. This value is unique across Increase and is used to ensure that a + # request is only processed once. Learn more about + # [idempotency](https://increase.com/documentation/idempotency-keys). + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + + # Limit the size of the list that is returned. The default (and maximum) is 100 + # objects. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(Increase::SwiftTransferListParams::Status)) } + attr_reader :status + + sig do + params(status: Increase::SwiftTransferListParams::Status::OrHash).void + end + attr_writer :status + + sig do + params( + account_id: String, + created_at: Increase::SwiftTransferListParams::CreatedAt::OrHash, + cursor: String, + idempotency_key: String, + limit: Integer, + status: Increase::SwiftTransferListParams::Status::OrHash, + request_options: Increase::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Filter Swift Transfers to those that originated from the specified Account. + account_id: nil, + created_at: nil, + # Return the page of entries after this one. + cursor: nil, + # Filter records to the one with the specified `idempotency_key` you chose for + # that object. This value is unique across Increase and is used to ensure that a + # request is only processed once. Learn more about + # [idempotency](https://increase.com/documentation/idempotency-keys). + idempotency_key: nil, + # Limit the size of the list that is returned. The default (and maximum) is 100 + # objects. + limit: nil, + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + created_at: Increase::SwiftTransferListParams::CreatedAt, + cursor: String, + idempotency_key: String, + limit: Integer, + status: Increase::SwiftTransferListParams::Status, + request_options: Increase::RequestOptions + } + ) + end + def to_hash + end + + class CreatedAt < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransferListParams::CreatedAt, + Increase::Internal::AnyHash + ) + end + + # Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + # timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :after + + sig { params(after: Time).void } + attr_writer :after + + # Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + # timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :before + + sig { params(before: Time).void } + attr_writer :before + + # Return results on or after this + # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :on_or_after + + sig { params(on_or_after: Time).void } + attr_writer :on_or_after + + # Return results on or before this + # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :on_or_before + + sig { params(on_or_before: Time).void } + attr_writer :on_or_before + + sig do + params( + after: Time, + before: Time, + on_or_after: Time, + on_or_before: Time + ).returns(T.attached_class) + end + def self.new( + # Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + # timestamp. + after: nil, + # Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + # timestamp. + before: nil, + # Return results on or after this + # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + on_or_after: nil, + # Return results on or before this + # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + on_or_before: nil + ) + end + + sig do + override.returns( + { after: Time, before: Time, on_or_after: Time, on_or_before: Time } + ) + end + def to_hash + end + end + + class Status < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransferListParams::Status, + Increase::Internal::AnyHash + ) + end + + # Return results whose value is in the provided list. For GET requests, this + # should be encoded as a comma-delimited string, such as `?in=one,two,three`. + sig do + returns( + T.nilable( + T::Array[Increase::SwiftTransferListParams::Status::In::OrSymbol] + ) + ) + end + attr_reader :in_ + + sig do + params( + in_: + T::Array[Increase::SwiftTransferListParams::Status::In::OrSymbol] + ).void + end + attr_writer :in_ + + sig do + params( + in_: + T::Array[Increase::SwiftTransferListParams::Status::In::OrSymbol] + ).returns(T.attached_class) + end + def self.new( + # Return results whose value is in the provided list. For GET requests, this + # should be encoded as a comma-delimited string, such as `?in=one,two,three`. + in_: nil + ) + end + + sig do + override.returns( + { + in_: + T::Array[ + Increase::SwiftTransferListParams::Status::In::OrSymbol + ] + } + ) + end + def to_hash + end + + module In + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Increase::SwiftTransferListParams::Status::In) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # The transfer is pending approval. + PENDING_APPROVAL = + T.let( + :pending_approval, + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ) + + # The transfer has been canceled. + CANCELED = + T.let( + :canceled, + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ) + + # The transfer is pending review by Increase. + PENDING_REVIEWING = + T.let( + :pending_reviewing, + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ) + + # The transfer requires attention from an Increase operator. + REQUIRES_ATTENTION = + T.let( + :requires_attention, + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ) + + # The transfer is pending initiation. + PENDING_INITIATING = + T.let( + :pending_initiating, + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ) + + # The transfer has been initiated. + INITIATED = + T.let( + :initiated, + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ) + + # The transfer has been rejected by Increase. + REJECTED = + T.let( + :rejected, + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ) + + # The transfer has been returned. + RETURNED = + T.let( + :returned, + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Increase::SwiftTransferListParams::Status::In::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/increase/models/swift_transfer_retrieve_params.rbi b/rbi/increase/models/swift_transfer_retrieve_params.rbi new file mode 100644 index 00000000..ffdff299 --- /dev/null +++ b/rbi/increase/models/swift_transfer_retrieve_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Increase + module Models + class SwiftTransferRetrieveParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Increase::SwiftTransferRetrieveParams, + Increase::Internal::AnyHash + ) + end + + sig do + params(request_options: Increase::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Increase::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/increase/resources/swift_transfers.rbi b/rbi/increase/resources/swift_transfers.rbi new file mode 100644 index 00000000..d0629d01 --- /dev/null +++ b/rbi/increase/resources/swift_transfers.rbi @@ -0,0 +1,142 @@ +# typed: strong + +module Increase + module Resources + class SwiftTransfers + # Create a Swift Transfer + sig do + params( + account_id: String, + account_number: String, + bank_identification_code: String, + creditor_address: + Increase::SwiftTransferCreateParams::CreditorAddress::OrHash, + creditor_name: String, + debtor_address: + Increase::SwiftTransferCreateParams::DebtorAddress::OrHash, + debtor_name: String, + instructed_amount: Integer, + instructed_currency: + Increase::SwiftTransferCreateParams::InstructedCurrency::OrSymbol, + source_account_number_id: String, + unstructured_remittance_information: String, + require_approval: T::Boolean, + routing_number: String, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::SwiftTransfer) + end + def create( + # The identifier for the account that will send the transfer. + account_id:, + # The creditor's account number. + account_number:, + # The bank identification code (BIC) of the creditor. If it ends with the + # three-character branch code, this must be 11 characters long. Otherwise this + # must be 8 characters and the branch code will be assumed to be `XXX`. + bank_identification_code:, + # The creditor's address. + creditor_address:, + # The creditor's name. + creditor_name:, + # The debtor's address. + debtor_address:, + # The debtor's name. + debtor_name:, + # The amount, in minor units of `instructed_currency`, to send to the creditor. + instructed_amount:, + # The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the + # instructed amount. + instructed_currency:, + # The Account Number to include in the transfer as the debtor's account number. + source_account_number_id:, + # Unstructured remittance information to include in the transfer. + unstructured_remittance_information:, + # Whether the transfer requires explicit approval via the dashboard or API. + require_approval: nil, + # The creditor's bank account routing or transit number. Required in certain + # countries. + routing_number: nil, + request_options: {} + ) + end + + # Retrieve a Swift Transfer + sig do + params( + swift_transfer_id: String, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::SwiftTransfer) + end + def retrieve( + # The identifier of the Swift Transfer. + swift_transfer_id, + request_options: {} + ) + end + + # List Swift Transfers + sig do + params( + account_id: String, + created_at: Increase::SwiftTransferListParams::CreatedAt::OrHash, + cursor: String, + idempotency_key: String, + limit: Integer, + status: Increase::SwiftTransferListParams::Status::OrHash, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::Internal::Page[Increase::SwiftTransfer]) + end + def list( + # Filter Swift Transfers to those that originated from the specified Account. + account_id: nil, + created_at: nil, + # Return the page of entries after this one. + cursor: nil, + # Filter records to the one with the specified `idempotency_key` you chose for + # that object. This value is unique across Increase and is used to ensure that a + # request is only processed once. Learn more about + # [idempotency](https://increase.com/documentation/idempotency-keys). + idempotency_key: nil, + # Limit the size of the list that is returned. The default (and maximum) is 100 + # objects. + limit: nil, + status: nil, + request_options: {} + ) + end + + # Approve a Swift Transfer + sig do + params( + swift_transfer_id: String, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::SwiftTransfer) + end + def approve( + # The identifier of the Swift Transfer to approve. + swift_transfer_id, + request_options: {} + ) + end + + # Cancel a pending Swift Transfer + sig do + params( + swift_transfer_id: String, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::SwiftTransfer) + end + def cancel( + # The identifier of the pending Swift Transfer to cancel. + swift_transfer_id, + request_options: {} + ) + end + + # @api private + sig { params(client: Increase::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/sig/increase/client.rbs b/sig/increase/client.rbs index 39316192..2697d643 100644 --- a/sig/increase/client.rbs +++ b/sig/increase/client.rbs @@ -69,6 +69,8 @@ module Increase attr_reader inbound_fednow_transfers: Increase::Resources::InboundFednowTransfers + attr_reader swift_transfers: Increase::Resources::SwiftTransfers + attr_reader check_deposits: Increase::Resources::CheckDeposits attr_reader lockboxes: Increase::Resources::Lockboxes diff --git a/sig/increase/models.rbs b/sig/increase/models.rbs index 7b0f5d3d..4ddc704c 100644 --- a/sig/increase/models.rbs +++ b/sig/increase/models.rbs @@ -467,6 +467,18 @@ module Increase class SupplementalDocumentListParams = Increase::Models::SupplementalDocumentListParams + class SwiftTransfer = Increase::Models::SwiftTransfer + + class SwiftTransferApproveParams = Increase::Models::SwiftTransferApproveParams + + class SwiftTransferCancelParams = Increase::Models::SwiftTransferCancelParams + + class SwiftTransferCreateParams = Increase::Models::SwiftTransferCreateParams + + class SwiftTransferListParams = Increase::Models::SwiftTransferListParams + + class SwiftTransferRetrieveParams = Increase::Models::SwiftTransferRetrieveParams + class Transaction = Increase::Models::Transaction class TransactionListParams = Increase::Models::TransactionListParams diff --git a/sig/increase/models/swift_transfer.rbs b/sig/increase/models/swift_transfer.rbs new file mode 100644 index 00000000..02193705 --- /dev/null +++ b/sig/increase/models/swift_transfer.rbs @@ -0,0 +1,349 @@ +module Increase + module Models + type swift_transfer = + { + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: String?, + instructed_amount: Integer, + instructed_currency: Increase::Models::SwiftTransfer::instructed_currency, + pending_transaction_id: String?, + routing_number: String?, + source_account_number_id: String, + status: Increase::Models::SwiftTransfer::status, + transaction_id: String?, + type: Increase::Models::SwiftTransfer::type_, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + } + + class SwiftTransfer < Increase::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account_id: String + + attr_accessor account_number: String + + attr_accessor amount: Integer + + attr_accessor bank_identification_code: String + + attr_accessor created_at: Time + + attr_accessor created_by: Increase::SwiftTransfer::CreatedBy + + attr_accessor creditor_address: Increase::SwiftTransfer::CreditorAddress + + attr_accessor creditor_name: String + + attr_accessor debtor_address: Increase::SwiftTransfer::DebtorAddress + + attr_accessor debtor_name: String + + attr_accessor idempotency_key: String? + + attr_accessor instructed_amount: Integer + + attr_accessor instructed_currency: Increase::Models::SwiftTransfer::instructed_currency + + attr_accessor pending_transaction_id: String? + + attr_accessor routing_number: String? + + attr_accessor source_account_number_id: String + + attr_accessor status: Increase::Models::SwiftTransfer::status + + attr_accessor transaction_id: String? + + attr_accessor type: Increase::Models::SwiftTransfer::type_ + + attr_accessor unique_end_to_end_transaction_reference: String + + attr_accessor unstructured_remittance_information: String + + def initialize: ( + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: String?, + instructed_amount: Integer, + instructed_currency: Increase::Models::SwiftTransfer::instructed_currency, + pending_transaction_id: String?, + routing_number: String?, + source_account_number_id: String, + status: Increase::Models::SwiftTransfer::status, + transaction_id: String?, + type: Increase::Models::SwiftTransfer::type_, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + ) -> void + + def to_hash: -> { + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: String?, + instructed_amount: Integer, + instructed_currency: Increase::Models::SwiftTransfer::instructed_currency, + pending_transaction_id: String?, + routing_number: String?, + source_account_number_id: String, + status: Increase::Models::SwiftTransfer::status, + transaction_id: String?, + type: Increase::Models::SwiftTransfer::type_, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + } + + type created_by = + { + api_key: Increase::SwiftTransfer::CreatedBy::APIKey?, + category: Increase::Models::SwiftTransfer::CreatedBy::category, + oauth_application: Increase::SwiftTransfer::CreatedBy::OAuthApplication?, + user: Increase::SwiftTransfer::CreatedBy::User? + } + + class CreatedBy < Increase::Internal::Type::BaseModel + attr_accessor api_key: Increase::SwiftTransfer::CreatedBy::APIKey? + + attr_accessor category: Increase::Models::SwiftTransfer::CreatedBy::category + + attr_accessor oauth_application: Increase::SwiftTransfer::CreatedBy::OAuthApplication? + + attr_accessor user: Increase::SwiftTransfer::CreatedBy::User? + + def initialize: ( + api_key: Increase::SwiftTransfer::CreatedBy::APIKey?, + category: Increase::Models::SwiftTransfer::CreatedBy::category, + oauth_application: Increase::SwiftTransfer::CreatedBy::OAuthApplication?, + user: Increase::SwiftTransfer::CreatedBy::User? + ) -> void + + def to_hash: -> { + api_key: Increase::SwiftTransfer::CreatedBy::APIKey?, + category: Increase::Models::SwiftTransfer::CreatedBy::category, + oauth_application: Increase::SwiftTransfer::CreatedBy::OAuthApplication?, + user: Increase::SwiftTransfer::CreatedBy::User? + } + + type api_key = { description: String? } + + class APIKey < Increase::Internal::Type::BaseModel + attr_accessor description: String? + + def initialize: (description: String?) -> void + + def to_hash: -> { description: String? } + end + + type category = :api_key | :oauth_application | :user + + module Category + extend Increase::Internal::Type::Enum + + # An API key. Details will be under the `api_key` object. + API_KEY: :api_key + + # An OAuth application you connected to Increase. Details will be under the `oauth_application` object. + OAUTH_APPLICATION: :oauth_application + + # A User in the Increase dashboard. Details will be under the `user` object. + USER: :user + + def self?.values: -> ::Array[Increase::Models::SwiftTransfer::CreatedBy::category] + end + + type oauth_application = { name: String } + + class OAuthApplication < Increase::Internal::Type::BaseModel + attr_accessor name: String + + def initialize: (name: String) -> void + + def to_hash: -> { name: String } + end + + type user = { email: String } + + class User < Increase::Internal::Type::BaseModel + attr_accessor email: String + + def initialize: (email: String) -> void + + def to_hash: -> { email: String } + end + end + + type creditor_address = + { + city: String?, + country: String, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + + class CreditorAddress < Increase::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String + + attr_accessor line1: String + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + city: String?, + country: String, + line1: String, + line2: String?, + postal_code: String?, + state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type debtor_address = + { + city: String?, + country: String, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + + class DebtorAddress < Increase::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String + + attr_accessor line1: String + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + city: String?, + country: String, + line1: String, + line2: String?, + postal_code: String?, + state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String, + :line1 => String, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type instructed_currency = :USD + + module InstructedCurrency + extend Increase::Internal::Type::Enum + + # United States Dollar + USD: :USD + + def self?.values: -> ::Array[Increase::Models::SwiftTransfer::instructed_currency] + end + + type status = + :pending_approval + | :canceled + | :pending_reviewing + | :requires_attention + | :pending_initiating + | :initiated + | :rejected + | :returned + + module Status + extend Increase::Internal::Type::Enum + + # The transfer is pending approval. + PENDING_APPROVAL: :pending_approval + + # The transfer has been canceled. + CANCELED: :canceled + + # The transfer is pending review by Increase. + PENDING_REVIEWING: :pending_reviewing + + # The transfer requires attention from an Increase operator. + REQUIRES_ATTENTION: :requires_attention + + # The transfer is pending initiation. + PENDING_INITIATING: :pending_initiating + + # The transfer has been initiated. + INITIATED: :initiated + + # The transfer has been rejected by Increase. + REJECTED: :rejected + + # The transfer has been returned. + RETURNED: :returned + + def self?.values: -> ::Array[Increase::Models::SwiftTransfer::status] + end + + type type_ = :swift_transfer + + module Type + extend Increase::Internal::Type::Enum + + SWIFT_TRANSFER: :swift_transfer + + def self?.values: -> ::Array[Increase::Models::SwiftTransfer::type_] + end + end + end +end diff --git a/sig/increase/models/swift_transfer_approve_params.rbs b/sig/increase/models/swift_transfer_approve_params.rbs new file mode 100644 index 00000000..2252d389 --- /dev/null +++ b/sig/increase/models/swift_transfer_approve_params.rbs @@ -0,0 +1,15 @@ +module Increase + module Models + type swift_transfer_approve_params = + { } & Increase::Internal::Type::request_parameters + + class SwiftTransferApproveParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + def initialize: (?request_options: Increase::request_opts) -> void + + def to_hash: -> { request_options: Increase::RequestOptions } + end + end +end diff --git a/sig/increase/models/swift_transfer_cancel_params.rbs b/sig/increase/models/swift_transfer_cancel_params.rbs new file mode 100644 index 00000000..5d6af573 --- /dev/null +++ b/sig/increase/models/swift_transfer_cancel_params.rbs @@ -0,0 +1,15 @@ +module Increase + module Models + type swift_transfer_cancel_params = + { } & Increase::Internal::Type::request_parameters + + class SwiftTransferCancelParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + def initialize: (?request_options: Increase::request_opts) -> void + + def to_hash: -> { request_options: Increase::RequestOptions } + end + end +end diff --git a/sig/increase/models/swift_transfer_create_params.rbs b/sig/increase/models/swift_transfer_create_params.rbs new file mode 100644 index 00000000..8cfa9e52 --- /dev/null +++ b/sig/increase/models/swift_transfer_create_params.rbs @@ -0,0 +1,197 @@ +module Increase + module Models + type swift_transfer_create_params = + { + account_id: String, + account_number: String, + bank_identification_code: String, + creditor_address: Increase::SwiftTransferCreateParams::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransferCreateParams::DebtorAddress, + debtor_name: String, + instructed_amount: Integer, + instructed_currency: Increase::Models::SwiftTransferCreateParams::instructed_currency, + source_account_number_id: String, + unstructured_remittance_information: String, + require_approval: bool, + routing_number: String + } + & Increase::Internal::Type::request_parameters + + class SwiftTransferCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_accessor account_number: String + + attr_accessor bank_identification_code: String + + attr_accessor creditor_address: Increase::SwiftTransferCreateParams::CreditorAddress + + attr_accessor creditor_name: String + + attr_accessor debtor_address: Increase::SwiftTransferCreateParams::DebtorAddress + + attr_accessor debtor_name: String + + attr_accessor instructed_amount: Integer + + attr_accessor instructed_currency: Increase::Models::SwiftTransferCreateParams::instructed_currency + + attr_accessor source_account_number_id: String + + attr_accessor unstructured_remittance_information: String + + attr_reader require_approval: bool? + + def require_approval=: (bool) -> bool + + attr_reader routing_number: String? + + def routing_number=: (String) -> String + + def initialize: ( + account_id: String, + account_number: String, + bank_identification_code: String, + creditor_address: Increase::SwiftTransferCreateParams::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransferCreateParams::DebtorAddress, + debtor_name: String, + instructed_amount: Integer, + instructed_currency: Increase::Models::SwiftTransferCreateParams::instructed_currency, + source_account_number_id: String, + unstructured_remittance_information: String, + ?require_approval: bool, + ?routing_number: String, + ?request_options: Increase::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + account_number: String, + bank_identification_code: String, + creditor_address: Increase::SwiftTransferCreateParams::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransferCreateParams::DebtorAddress, + debtor_name: String, + instructed_amount: Integer, + instructed_currency: Increase::Models::SwiftTransferCreateParams::instructed_currency, + source_account_number_id: String, + unstructured_remittance_information: String, + require_approval: bool, + routing_number: String, + request_options: Increase::RequestOptions + } + + type creditor_address = + { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + + class CreditorAddress < Increase::Internal::Type::BaseModel + attr_accessor city: String + + attr_accessor country: String + + attr_accessor line1: String + + attr_reader line2: String? + + def line2=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + city: String, + country: String, + line1: String, + ?line2: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + end + + type debtor_address = + { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + + class DebtorAddress < Increase::Internal::Type::BaseModel + attr_accessor city: String + + attr_accessor country: String + + attr_accessor line1: String + + attr_reader line2: String? + + def line2=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + city: String, + country: String, + line1: String, + ?line2: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + city: String, + country: String, + :line1 => String, + :line2 => String, + postal_code: String, + state: String + } + end + + type instructed_currency = :USD + + module InstructedCurrency + extend Increase::Internal::Type::Enum + + # United States Dollar + USD: :USD + + def self?.values: -> ::Array[Increase::Models::SwiftTransferCreateParams::instructed_currency] + end + end + end +end diff --git a/sig/increase/models/swift_transfer_list_params.rbs b/sig/increase/models/swift_transfer_list_params.rbs new file mode 100644 index 00000000..afb92890 --- /dev/null +++ b/sig/increase/models/swift_transfer_list_params.rbs @@ -0,0 +1,161 @@ +module Increase + module Models + type swift_transfer_list_params = + { + account_id: String, + created_at: Increase::SwiftTransferListParams::CreatedAt, + cursor: String, + idempotency_key: String, + limit: Integer, + status: Increase::SwiftTransferListParams::Status + } + & Increase::Internal::Type::request_parameters + + class SwiftTransferListParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader created_at: Increase::SwiftTransferListParams::CreatedAt? + + def created_at=: ( + Increase::SwiftTransferListParams::CreatedAt + ) -> Increase::SwiftTransferListParams::CreatedAt + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader status: Increase::SwiftTransferListParams::Status? + + def status=: ( + Increase::SwiftTransferListParams::Status + ) -> Increase::SwiftTransferListParams::Status + + def initialize: ( + ?account_id: String, + ?created_at: Increase::SwiftTransferListParams::CreatedAt, + ?cursor: String, + ?idempotency_key: String, + ?limit: Integer, + ?status: Increase::SwiftTransferListParams::Status, + ?request_options: Increase::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + created_at: Increase::SwiftTransferListParams::CreatedAt, + cursor: String, + idempotency_key: String, + limit: Integer, + status: Increase::SwiftTransferListParams::Status, + request_options: Increase::RequestOptions + } + + type created_at = + { after: Time, before: Time, on_or_after: Time, on_or_before: Time } + + class CreatedAt < Increase::Internal::Type::BaseModel + attr_reader after: Time? + + def after=: (Time) -> Time + + attr_reader before: Time? + + def before=: (Time) -> Time + + attr_reader on_or_after: Time? + + def on_or_after=: (Time) -> Time + + attr_reader on_or_before: Time? + + def on_or_before=: (Time) -> Time + + def initialize: ( + ?after: Time, + ?before: Time, + ?on_or_after: Time, + ?on_or_before: Time + ) -> void + + def to_hash: -> { + after: Time, + before: Time, + on_or_after: Time, + on_or_before: Time + } + end + + type status = + { in_: ::Array[Increase::Models::SwiftTransferListParams::Status::in_] } + + class Status < Increase::Internal::Type::BaseModel + attr_reader in_: ::Array[Increase::Models::SwiftTransferListParams::Status::in_]? + + def in_=: ( + ::Array[Increase::Models::SwiftTransferListParams::Status::in_] + ) -> ::Array[Increase::Models::SwiftTransferListParams::Status::in_] + + def initialize: ( + ?in_: ::Array[Increase::Models::SwiftTransferListParams::Status::in_] + ) -> void + + def to_hash: -> { + in_: ::Array[Increase::Models::SwiftTransferListParams::Status::in_] + } + + type in_ = + :pending_approval + | :canceled + | :pending_reviewing + | :requires_attention + | :pending_initiating + | :initiated + | :rejected + | :returned + + module In + extend Increase::Internal::Type::Enum + + # The transfer is pending approval. + PENDING_APPROVAL: :pending_approval + + # The transfer has been canceled. + CANCELED: :canceled + + # The transfer is pending review by Increase. + PENDING_REVIEWING: :pending_reviewing + + # The transfer requires attention from an Increase operator. + REQUIRES_ATTENTION: :requires_attention + + # The transfer is pending initiation. + PENDING_INITIATING: :pending_initiating + + # The transfer has been initiated. + INITIATED: :initiated + + # The transfer has been rejected by Increase. + REJECTED: :rejected + + # The transfer has been returned. + RETURNED: :returned + + def self?.values: -> ::Array[Increase::Models::SwiftTransferListParams::Status::in_] + end + end + end + end +end diff --git a/sig/increase/models/swift_transfer_retrieve_params.rbs b/sig/increase/models/swift_transfer_retrieve_params.rbs new file mode 100644 index 00000000..2fa51cec --- /dev/null +++ b/sig/increase/models/swift_transfer_retrieve_params.rbs @@ -0,0 +1,15 @@ +module Increase + module Models + type swift_transfer_retrieve_params = + { } & Increase::Internal::Type::request_parameters + + class SwiftTransferRetrieveParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + def initialize: (?request_options: Increase::request_opts) -> void + + def to_hash: -> { request_options: Increase::RequestOptions } + end + end +end diff --git a/sig/increase/resources/swift_transfers.rbs b/sig/increase/resources/swift_transfers.rbs new file mode 100644 index 00000000..c80da3bc --- /dev/null +++ b/sig/increase/resources/swift_transfers.rbs @@ -0,0 +1,49 @@ +module Increase + module Resources + class SwiftTransfers + def create: ( + account_id: String, + account_number: String, + bank_identification_code: String, + creditor_address: Increase::SwiftTransferCreateParams::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransferCreateParams::DebtorAddress, + debtor_name: String, + instructed_amount: Integer, + instructed_currency: Increase::Models::SwiftTransferCreateParams::instructed_currency, + source_account_number_id: String, + unstructured_remittance_information: String, + ?require_approval: bool, + ?routing_number: String, + ?request_options: Increase::request_opts + ) -> Increase::SwiftTransfer + + def retrieve: ( + String swift_transfer_id, + ?request_options: Increase::request_opts + ) -> Increase::SwiftTransfer + + def list: ( + ?account_id: String, + ?created_at: Increase::SwiftTransferListParams::CreatedAt, + ?cursor: String, + ?idempotency_key: String, + ?limit: Integer, + ?status: Increase::SwiftTransferListParams::Status, + ?request_options: Increase::request_opts + ) -> Increase::Internal::Page[Increase::SwiftTransfer] + + def approve: ( + String swift_transfer_id, + ?request_options: Increase::request_opts + ) -> Increase::SwiftTransfer + + def cancel: ( + String swift_transfer_id, + ?request_options: Increase::request_opts + ) -> Increase::SwiftTransfer + + def initialize: (client: Increase::Client) -> void + end + end +end diff --git a/test/increase/resources/swift_transfers_test.rb b/test/increase/resources/swift_transfers_test.rb new file mode 100644 index 00000000..a2c08284 --- /dev/null +++ b/test/increase/resources/swift_transfers_test.rb @@ -0,0 +1,200 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Increase::Test::Resources::SwiftTransfersTest < Increase::Test::ResourceTest + def test_create_required_params + response = + @increase.swift_transfers.create( + account_id: "account_in71c4amph0vgo2qllky", + account_number: "987654321", + bank_identification_code: "ECBFDEFFTPP", + creditor_address: {city: "Frankfurt", country: "DE", line1: "Sonnemannstrasse 20"}, + creditor_name: "Ian Crease", + debtor_address: {city: "New York", country: "US", line1: "33 Liberty Street"}, + debtor_name: "National Phonograph Company", + instructed_amount: 100, + instructed_currency: :USD, + source_account_number_id: "account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information: "New Swift transfer" + ) + + assert_pattern do + response => Increase::SwiftTransfer + end + + assert_pattern do + response => { + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: String | nil, + instructed_amount: Integer, + instructed_currency: Increase::SwiftTransfer::InstructedCurrency, + pending_transaction_id: String | nil, + routing_number: String | nil, + source_account_number_id: String, + status: Increase::SwiftTransfer::Status, + transaction_id: String | nil, + type: Increase::SwiftTransfer::Type, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + } + end + end + + def test_retrieve + response = @increase.swift_transfers.retrieve("swift_transfer_29h21xkng03788zwd3fh") + + assert_pattern do + response => Increase::SwiftTransfer + end + + assert_pattern do + response => { + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: String | nil, + instructed_amount: Integer, + instructed_currency: Increase::SwiftTransfer::InstructedCurrency, + pending_transaction_id: String | nil, + routing_number: String | nil, + source_account_number_id: String, + status: Increase::SwiftTransfer::Status, + transaction_id: String | nil, + type: Increase::SwiftTransfer::Type, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + } + end + end + + def test_list + response = @increase.swift_transfers.list + + assert_pattern do + response => Increase::Internal::Page + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Increase::SwiftTransfer + end + + assert_pattern do + row => { + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: String | nil, + instructed_amount: Integer, + instructed_currency: Increase::SwiftTransfer::InstructedCurrency, + pending_transaction_id: String | nil, + routing_number: String | nil, + source_account_number_id: String, + status: Increase::SwiftTransfer::Status, + transaction_id: String | nil, + type: Increase::SwiftTransfer::Type, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + } + end + end + + def test_approve + response = @increase.swift_transfers.approve("swift_transfer_29h21xkng03788zwd3fh") + + assert_pattern do + response => Increase::SwiftTransfer + end + + assert_pattern do + response => { + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: String | nil, + instructed_amount: Integer, + instructed_currency: Increase::SwiftTransfer::InstructedCurrency, + pending_transaction_id: String | nil, + routing_number: String | nil, + source_account_number_id: String, + status: Increase::SwiftTransfer::Status, + transaction_id: String | nil, + type: Increase::SwiftTransfer::Type, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + } + end + end + + def test_cancel + response = @increase.swift_transfers.cancel("swift_transfer_29h21xkng03788zwd3fh") + + assert_pattern do + response => Increase::SwiftTransfer + end + + assert_pattern do + response => { + id: String, + account_id: String, + account_number: String, + amount: Integer, + bank_identification_code: String, + created_at: Time, + created_by: Increase::SwiftTransfer::CreatedBy, + creditor_address: Increase::SwiftTransfer::CreditorAddress, + creditor_name: String, + debtor_address: Increase::SwiftTransfer::DebtorAddress, + debtor_name: String, + idempotency_key: String | nil, + instructed_amount: Integer, + instructed_currency: Increase::SwiftTransfer::InstructedCurrency, + pending_transaction_id: String | nil, + routing_number: String | nil, + source_account_number_id: String, + status: Increase::SwiftTransfer::Status, + transaction_id: String | nil, + type: Increase::SwiftTransfer::Type, + unique_end_to_end_transaction_reference: String, + unstructured_remittance_information: String + } + end + end +end