diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c412e9745..52b3e8341 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.29" + ".": "0.1.0-alpha.30" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index f57d811d6..43c250262 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 196 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-18c5248f747fed10c6251e99ce19ff8baf99aba8a660b97f3b2f0c956c3b68eb.yml -openapi_spec_hash: fee11521b46e6468507255ffead78f8e -config_hash: c4ca49f6bac6268578b0734a33a9d1fd +configured_endpoints: 197 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b9a610bb578b82c46d4222f4746d69c8e422f9cfad51a6d72d44c64f8746d709.yml +openapi_spec_hash: a63cc36300445b0201442108b6cc8530 +config_hash: 85850cd9055db4b9e43bcc4aa1a2dcea diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b0c3bd91..be1eb40ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.1.0-alpha.30 (2025-06-03) + +Full Changelog: [v0.1.0-alpha.29...v0.1.0-alpha.30](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.29...v0.1.0-alpha.30) + +### Features + +* **api:** api update ([bb7f9d3](https://github.com/Increase/increase-ruby/commit/bb7f9d31c20555ba9391376680a6efdbb667e81d)) +* **api:** api update ([6211a95](https://github.com/Increase/increase-ruby/commit/6211a959e8612d7974fcdbc0076f068bc1a90025)) +* **api:** api update ([39d9b4c](https://github.com/Increase/increase-ruby/commit/39d9b4c8731658a5568bb974cd9334f07c83bb4f)) +* **api:** api update ([4f9aad6](https://github.com/Increase/increase-ruby/commit/4f9aad6968a09f1549b32d98d19dddced537403f)) + + +### Bug Fixes + +* `to_sorbet_type` should not return branded types ([4dd5dff](https://github.com/Increase/increase-ruby/commit/4dd5dffdb9d333152cb5d759c763f4b0cfd15afd)) + ## 0.1.0-alpha.29 (2025-05-28) Full Changelog: [v0.1.0-alpha.28...v0.1.0-alpha.29](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.28...v0.1.0-alpha.29) diff --git a/Gemfile.lock b/Gemfile.lock index 665b4365a..b5d9da092 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - increase (0.1.0.pre.alpha.29) + increase (0.1.0.pre.alpha.30) connection_pool GEM diff --git a/README.md b/README.md index 7e5ca5606..d3963193c 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", "~> 0.1.0.pre.alpha.29" +gem "increase", "~> 0.1.0.pre.alpha.30" ``` diff --git a/lib/increase.rb b/lib/increase.rb index ebb9b0236..c4da7e2ae 100644 --- a/lib/increase.rb +++ b/lib/increase.rb @@ -137,6 +137,7 @@ require_relative "increase/models/digital_wallet_token_list_params" require_relative "increase/models/digital_wallet_token_retrieve_params" require_relative "increase/models/document" +require_relative "increase/models/document_create_params" require_relative "increase/models/document_list_params" require_relative "increase/models/document_retrieve_params" require_relative "increase/models/entity" diff --git a/lib/increase/internal/type/enum.rb b/lib/increase/internal/type/enum.rb index 962152e7c..073351bd6 100644 --- a/lib/increase/internal/type/enum.rb +++ b/lib/increase/internal/type/enum.rb @@ -91,11 +91,14 @@ def coerce(value, state:) # # @return [Object] def to_sorbet_type - case values + types = values.map { Increase::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq + case types in [] T.noreturn - in [value, *_] - T.all(Increase::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(value), self) + in [type] + type + else + T.any(*types) end end diff --git a/lib/increase/internal/type/union.rb b/lib/increase/internal/type/union.rb index 0e9dddf7c..27475fecf 100644 --- a/lib/increase/internal/type/union.rb +++ b/lib/increase/internal/type/union.rb @@ -195,11 +195,14 @@ def dump(value, state:) # # @return [Object] def to_sorbet_type - case (v = variants) + types = variants.map { Increase::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq + case types in [] T.noreturn + in [type] + type else - T.any(*v.map { Increase::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }) + T.any(*types) end end diff --git a/lib/increase/models.rb b/lib/increase/models.rb index 32c1b8828..63ac94ea1 100644 --- a/lib/increase/models.rb +++ b/lib/increase/models.rb @@ -11,16 +11,16 @@ module Increase mod.constants.each do |name| case mod.const_get(name) in true | false - mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, mod) } } + mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } } mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } } in Integer - mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, mod) } } + mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } } mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } } in Float - mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, mod) } } + mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } } mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } } in Symbol - mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, mod) } } + mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } } mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } } else end @@ -211,6 +211,8 @@ module Increase Document = Increase::Models::Document + DocumentCreateParams = Increase::Models::DocumentCreateParams + DocumentListParams = Increase::Models::DocumentListParams DocumentRetrieveParams = Increase::Models::DocumentRetrieveParams diff --git a/lib/increase/models/document.rb b/lib/increase/models/document.rb index 24fb30536..303e7f01c 100644 --- a/lib/increase/models/document.rb +++ b/lib/increase/models/document.rb @@ -2,7 +2,7 @@ module Increase module Models - # @see Increase::Resources::Documents#retrieve + # @see Increase::Resources::Documents#create class Document < Increase::Internal::Type::BaseModel # @!attribute id # The Document identifier. @@ -10,6 +10,12 @@ class Document < Increase::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute account_verification_letter + # Properties of an account verification letter document. + # + # @return [Increase::Models::Document::AccountVerificationLetter, nil] + required :account_verification_letter, -> { Increase::Document::AccountVerificationLetter }, nil?: true + # @!attribute category # The type of document. # @@ -35,6 +41,14 @@ class Document < Increase::Internal::Type::BaseModel # @return [String] required :file_id, 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 type # A constant representing the object's type. For this resource it will always be # `document`. @@ -42,7 +56,7 @@ class Document < Increase::Internal::Type::BaseModel # @return [Symbol, Increase::Models::Document::Type] required :type, enum: -> { Increase::Document::Type } - # @!method initialize(id:, category:, created_at:, entity_id:, file_id:, type:) + # @!method initialize(id:, account_verification_letter:, category:, created_at:, entity_id:, file_id:, idempotency_key:, type:) # Some parameter documentations has been truncated, see # {Increase::Models::Document} for more details. # @@ -51,6 +65,8 @@ class Document < Increase::Internal::Type::BaseModel # # @param id [String] The Document identifier. # + # @param account_verification_letter [Increase::Models::Document::AccountVerificationLetter, nil] Properties of an account verification letter document. + # # @param category [Symbol, Increase::Models::Document::Category] The type of document. # # @param created_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Documen @@ -59,8 +75,24 @@ class Document < Increase::Internal::Type::BaseModel # # @param file_id [String] The identifier of the File containing the Document's contents. # + # @param idempotency_key [String, nil] The idempotency key you chose for this object. This value is unique across Incre + # # @param type [Symbol, Increase::Models::Document::Type] A constant representing the object's type. For this resource it will always be ` + # @see Increase::Models::Document#account_verification_letter + class AccountVerificationLetter < Increase::Internal::Type::BaseModel + # @!attribute account_number_id + # The identifier of the Account Number the document was generated for. + # + # @return [String] + required :account_number_id, String + + # @!method initialize(account_number_id:) + # Properties of an account verification letter document. + # + # @param account_number_id [String] The identifier of the Account Number the document was generated for. + end + # The type of document. # # @see Increase::Models::Document#category @@ -79,6 +111,9 @@ module Category # Company information, such a policies or procedures, typically submitted during our due diligence process. COMPANY_INFORMATION = :company_information + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = :account_verification_letter + # @!method self.values # @return [Array] end diff --git a/lib/increase/models/document_create_params.rb b/lib/increase/models/document_create_params.rb new file mode 100644 index 000000000..29bc22bb5 --- /dev/null +++ b/lib/increase/models/document_create_params.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::Documents#create + class DocumentCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!attribute category + # The type of document to create. + # + # @return [Symbol, Increase::Models::DocumentCreateParams::Category] + required :category, enum: -> { Increase::DocumentCreateParams::Category } + + # @!attribute account_verification_letter + # An account verification letter. + # + # @return [Increase::Models::DocumentCreateParams::AccountVerificationLetter, nil] + optional :account_verification_letter, -> { Increase::DocumentCreateParams::AccountVerificationLetter } + + # @!method initialize(category:, account_verification_letter: nil, request_options: {}) + # @param category [Symbol, Increase::Models::DocumentCreateParams::Category] The type of document to create. + # + # @param account_verification_letter [Increase::Models::DocumentCreateParams::AccountVerificationLetter] An account verification letter. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + + # The type of document to create. + module Category + extend Increase::Internal::Type::Enum + + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = :account_verification_letter + + # @!method self.values + # @return [Array] + end + + class AccountVerificationLetter < Increase::Internal::Type::BaseModel + # @!attribute account_number_id + # The Account Number the bank letter should be generated for. + # + # @return [String] + required :account_number_id, String + + # @!attribute balance_date + # If provided, the letter will include the Account's balance as of the date. + # + # @return [Date, nil] + optional :balance_date, Date + + # @!method initialize(account_number_id:, balance_date: nil) + # An account verification letter. + # + # @param account_number_id [String] The Account Number the bank letter should be generated for. + # + # @param balance_date [Date] If provided, the letter will include the Account's balance as of the date. + end + end + end +end diff --git a/lib/increase/models/document_list_params.rb b/lib/increase/models/document_list_params.rb index 564925220..f50cd99b8 100644 --- a/lib/increase/models/document_list_params.rb +++ b/lib/increase/models/document_list_params.rb @@ -29,6 +29,15 @@ class DocumentListParams < Increase::Internal::Type::BaseModel # @return [String, nil] optional :entity_id, 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. @@ -36,7 +45,7 @@ class DocumentListParams < Increase::Internal::Type::BaseModel # @return [Integer, nil] optional :limit, Integer - # @!method initialize(category: nil, created_at: nil, cursor: nil, entity_id: nil, limit: nil, request_options: {}) + # @!method initialize(category: nil, created_at: nil, cursor: nil, entity_id: nil, idempotency_key: nil, limit: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Increase::Models::DocumentListParams} for more details. # @@ -48,6 +57,8 @@ class DocumentListParams < Increase::Internal::Type::BaseModel # # @param entity_id [String] Filter Documents to ones belonging to the specified Entity. # + # @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 request_options [Increase::RequestOptions, Hash{Symbol=>Object}] @@ -84,6 +95,9 @@ module In # Company information, such a policies or procedures, typically submitted during our due diligence process. COMPANY_INFORMATION = :company_information + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = :account_verification_letter + # @!method self.values # @return [Array] end diff --git a/lib/increase/models/file.rb b/lib/increase/models/file.rb index ffabe4d72..039061bd9 100644 --- a/lib/increase/models/file.rb +++ b/lib/increase/models/file.rb @@ -189,6 +189,9 @@ module Purpose # A file containing additional evidence for a Proof of Authorization Request Submission. PROOF_OF_AUTHORIZATION_REQUEST_SUBMISSION = :proof_of_authorization_request_submission + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = :account_verification_letter + # @!method self.values # @return [Array] end diff --git a/lib/increase/models/file_list_params.rb b/lib/increase/models/file_list_params.rb index 36dfe7d63..042f9cb1a 100644 --- a/lib/increase/models/file_list_params.rb +++ b/lib/increase/models/file_list_params.rb @@ -191,6 +191,9 @@ module In # A file containing additional evidence for a Proof of Authorization Request Submission. PROOF_OF_AUTHORIZATION_REQUEST_SUBMISSION = :proof_of_authorization_request_submission + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = :account_verification_letter + # @!method self.values # @return [Array] end diff --git a/lib/increase/resources/documents.rb b/lib/increase/resources/documents.rb index 61a7a0180..2251553b9 100644 --- a/lib/increase/resources/documents.rb +++ b/lib/increase/resources/documents.rb @@ -3,6 +3,30 @@ module Increase module Resources class Documents + # Create a Document + # + # @overload create(category:, account_verification_letter: nil, request_options: {}) + # + # @param category [Symbol, Increase::Models::DocumentCreateParams::Category] The type of document to create. + # + # @param account_verification_letter [Increase::Models::DocumentCreateParams::AccountVerificationLetter] An account verification letter. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Models::Document] + # + # @see Increase::Models::DocumentCreateParams + def create(params) + parsed, options = Increase::DocumentCreateParams.dump_request(params) + @client.request( + method: :post, + path: "documents", + body: parsed, + model: Increase::Document, + options: options + ) + end + # Retrieve a Document # # @overload retrieve(document_id, request_options: {}) @@ -28,7 +52,7 @@ def retrieve(document_id, params = {}) # # List Documents # - # @overload list(category: nil, created_at: nil, cursor: nil, entity_id: nil, limit: nil, request_options: {}) + # @overload list(category: nil, created_at: nil, cursor: nil, entity_id: nil, idempotency_key: nil, limit: nil, request_options: {}) # # @param category [Increase::Models::DocumentListParams::Category] # @@ -38,6 +62,8 @@ def retrieve(document_id, params = {}) # # @param entity_id [String] Filter Documents to ones belonging to the specified Entity. # + # @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 request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/increase/version.rb b/lib/increase/version.rb index d55f5443c..672b61ec1 100644 --- a/lib/increase/version.rb +++ b/lib/increase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Increase - VERSION = "0.1.0.pre.alpha.29" + VERSION = "0.1.0.pre.alpha.30" end diff --git a/rbi/increase/models.rbi b/rbi/increase/models.rbi index 29b5c44ea..04b2668ee 100644 --- a/rbi/increase/models.rbi +++ b/rbi/increase/models.rbi @@ -194,6 +194,8 @@ module Increase Document = Increase::Models::Document + DocumentCreateParams = Increase::Models::DocumentCreateParams + DocumentListParams = Increase::Models::DocumentListParams DocumentRetrieveParams = Increase::Models::DocumentRetrieveParams diff --git a/rbi/increase/models/document.rbi b/rbi/increase/models/document.rbi index 42d58b329..9e66132ef 100644 --- a/rbi/increase/models/document.rbi +++ b/rbi/increase/models/document.rbi @@ -10,6 +10,18 @@ module Increase sig { returns(String) } attr_accessor :id + # Properties of an account verification letter document. + sig { returns(T.nilable(Increase::Document::AccountVerificationLetter)) } + attr_reader :account_verification_letter + + sig do + params( + account_verification_letter: + T.nilable(Increase::Document::AccountVerificationLetter::OrHash) + ).void + end + attr_writer :account_verification_letter + # The type of document. sig { returns(Increase::Document::Category::TaggedSymbol) } attr_accessor :category @@ -27,6 +39,12 @@ module Increase sig { returns(String) } attr_accessor :file_id + # 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 + # A constant representing the object's type. For this resource it will always be # `document`. sig { returns(Increase::Document::Type::TaggedSymbol) } @@ -37,16 +55,21 @@ module Increase sig do params( id: String, + account_verification_letter: + T.nilable(Increase::Document::AccountVerificationLetter::OrHash), category: Increase::Document::Category::OrSymbol, created_at: Time, entity_id: T.nilable(String), file_id: String, + idempotency_key: T.nilable(String), type: Increase::Document::Type::OrSymbol ).returns(T.attached_class) end def self.new( # The Document identifier. id:, + # Properties of an account verification letter document. + account_verification_letter:, # The type of document. category:, # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the @@ -56,6 +79,10 @@ module Increase entity_id:, # The identifier of the File containing the Document's contents. file_id:, + # 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:, # A constant representing the object's type. For this resource it will always be # `document`. type: @@ -66,10 +93,13 @@ module Increase override.returns( { id: String, + account_verification_letter: + T.nilable(Increase::Document::AccountVerificationLetter), category: Increase::Document::Category::TaggedSymbol, created_at: Time, entity_id: T.nilable(String), file_id: String, + idempotency_key: T.nilable(String), type: Increase::Document::Type::TaggedSymbol } ) @@ -77,6 +107,32 @@ module Increase def to_hash end + class AccountVerificationLetter < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::Document::AccountVerificationLetter, + Increase::Internal::AnyHash + ) + end + + # The identifier of the Account Number the document was generated for. + sig { returns(String) } + attr_accessor :account_number_id + + # Properties of an account verification letter document. + sig { params(account_number_id: String).returns(T.attached_class) } + def self.new( + # The identifier of the Account Number the document was generated for. + account_number_id: + ) + end + + sig { override.returns({ account_number_id: String }) } + def to_hash + end + end + # The type of document. module Category extend Increase::Internal::Type::Enum @@ -107,6 +163,13 @@ module Increase Increase::Document::Category::TaggedSymbol ) + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = + T.let( + :account_verification_letter, + Increase::Document::Category::TaggedSymbol + ) + sig do override.returns(T::Array[Increase::Document::Category::TaggedSymbol]) end diff --git a/rbi/increase/models/document_create_params.rbi b/rbi/increase/models/document_create_params.rbi new file mode 100644 index 000000000..a4a9163b4 --- /dev/null +++ b/rbi/increase/models/document_create_params.rbi @@ -0,0 +1,132 @@ +# typed: strong + +module Increase + module Models + class DocumentCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Increase::DocumentCreateParams, Increase::Internal::AnyHash) + end + + # The type of document to create. + sig { returns(Increase::DocumentCreateParams::Category::OrSymbol) } + attr_accessor :category + + # An account verification letter. + sig do + returns( + T.nilable(Increase::DocumentCreateParams::AccountVerificationLetter) + ) + end + attr_reader :account_verification_letter + + sig do + params( + account_verification_letter: + Increase::DocumentCreateParams::AccountVerificationLetter::OrHash + ).void + end + attr_writer :account_verification_letter + + sig do + params( + category: Increase::DocumentCreateParams::Category::OrSymbol, + account_verification_letter: + Increase::DocumentCreateParams::AccountVerificationLetter::OrHash, + request_options: Increase::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The type of document to create. + category:, + # An account verification letter. + account_verification_letter: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + category: Increase::DocumentCreateParams::Category::OrSymbol, + account_verification_letter: + Increase::DocumentCreateParams::AccountVerificationLetter, + request_options: Increase::RequestOptions + } + ) + end + def to_hash + end + + # The type of document to create. + module Category + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Increase::DocumentCreateParams::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = + T.let( + :account_verification_letter, + Increase::DocumentCreateParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Increase::DocumentCreateParams::Category::TaggedSymbol] + ) + end + def self.values + end + end + + class AccountVerificationLetter < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Increase::DocumentCreateParams::AccountVerificationLetter, + Increase::Internal::AnyHash + ) + end + + # The Account Number the bank letter should be generated for. + sig { returns(String) } + attr_accessor :account_number_id + + # If provided, the letter will include the Account's balance as of the date. + sig { returns(T.nilable(Date)) } + attr_reader :balance_date + + sig { params(balance_date: Date).void } + attr_writer :balance_date + + # An account verification letter. + sig do + params(account_number_id: String, balance_date: Date).returns( + T.attached_class + ) + end + def self.new( + # The Account Number the bank letter should be generated for. + account_number_id:, + # If provided, the letter will include the Account's balance as of the date. + balance_date: nil + ) + end + + sig do + override.returns({ account_number_id: String, balance_date: Date }) + end + def to_hash + end + end + end + end +end diff --git a/rbi/increase/models/document_list_params.rbi b/rbi/increase/models/document_list_params.rbi index ebd7373b5..60c8a9ece 100644 --- a/rbi/increase/models/document_list_params.rbi +++ b/rbi/increase/models/document_list_params.rbi @@ -41,6 +41,16 @@ module Increase sig { params(entity_id: String).void } attr_writer :entity_id + # 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)) } @@ -55,6 +65,7 @@ module Increase created_at: Increase::DocumentListParams::CreatedAt::OrHash, cursor: String, entity_id: String, + idempotency_key: String, limit: Integer, request_options: Increase::RequestOptions::OrHash ).returns(T.attached_class) @@ -66,6 +77,11 @@ module Increase cursor: nil, # Filter Documents to ones belonging to the specified Entity. entity_id: 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, @@ -80,6 +96,7 @@ module Increase created_at: Increase::DocumentListParams::CreatedAt, cursor: String, entity_id: String, + idempotency_key: String, limit: Integer, request_options: Increase::RequestOptions } @@ -177,6 +194,13 @@ module Increase Increase::DocumentListParams::Category::In::TaggedSymbol ) + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = + T.let( + :account_verification_letter, + Increase::DocumentListParams::Category::In::TaggedSymbol + ) + sig do override.returns( T::Array[Increase::DocumentListParams::Category::In::TaggedSymbol] diff --git a/rbi/increase/models/file.rbi b/rbi/increase/models/file.rbi index f7dc62f18..e7025edc8 100644 --- a/rbi/increase/models/file.rbi +++ b/rbi/increase/models/file.rbi @@ -258,6 +258,13 @@ module Increase Increase::File::Purpose::TaggedSymbol ) + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = + T.let( + :account_verification_letter, + Increase::File::Purpose::TaggedSymbol + ) + sig do override.returns(T::Array[Increase::File::Purpose::TaggedSymbol]) end diff --git a/rbi/increase/models/file_list_params.rbi b/rbi/increase/models/file_list_params.rbi index f90787b30..d0564d6e5 100644 --- a/rbi/increase/models/file_list_params.rbi +++ b/rbi/increase/models/file_list_params.rbi @@ -389,6 +389,13 @@ module Increase Increase::FileListParams::Purpose::In::TaggedSymbol ) + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER = + T.let( + :account_verification_letter, + Increase::FileListParams::Purpose::In::TaggedSymbol + ) + sig do override.returns( T::Array[Increase::FileListParams::Purpose::In::TaggedSymbol] diff --git a/rbi/increase/resources/documents.rbi b/rbi/increase/resources/documents.rbi index 4c69d86f9..33ff7a77d 100644 --- a/rbi/increase/resources/documents.rbi +++ b/rbi/increase/resources/documents.rbi @@ -3,6 +3,24 @@ module Increase module Resources class Documents + # Create a Document + sig do + params( + category: Increase::DocumentCreateParams::Category::OrSymbol, + account_verification_letter: + Increase::DocumentCreateParams::AccountVerificationLetter::OrHash, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::Document) + end + def create( + # The type of document to create. + category:, + # An account verification letter. + account_verification_letter: nil, + request_options: {} + ) + end + # Retrieve a Document sig do params( @@ -24,6 +42,7 @@ module Increase created_at: Increase::DocumentListParams::CreatedAt::OrHash, cursor: String, entity_id: String, + idempotency_key: String, limit: Integer, request_options: Increase::RequestOptions::OrHash ).returns(Increase::Internal::Page[Increase::Document]) @@ -35,6 +54,11 @@ module Increase cursor: nil, # Filter Documents to ones belonging to the specified Entity. entity_id: 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, diff --git a/sig/increase/models.rbs b/sig/increase/models.rbs index 11f2f36ea..021c216a8 100644 --- a/sig/increase/models.rbs +++ b/sig/increase/models.rbs @@ -171,6 +171,8 @@ module Increase class Document = Increase::Models::Document + class DocumentCreateParams = Increase::Models::DocumentCreateParams + class DocumentListParams = Increase::Models::DocumentListParams class DocumentRetrieveParams = Increase::Models::DocumentRetrieveParams diff --git a/sig/increase/models/document.rbs b/sig/increase/models/document.rbs index 6a12ff556..bf45dd0ce 100644 --- a/sig/increase/models/document.rbs +++ b/sig/increase/models/document.rbs @@ -3,16 +3,20 @@ module Increase type document = { id: String, + account_verification_letter: Increase::Document::AccountVerificationLetter?, category: Increase::Models::Document::category, created_at: Time, entity_id: String?, file_id: String, + idempotency_key: String?, type: Increase::Models::Document::type_ } class Document < Increase::Internal::Type::BaseModel attr_accessor id: String + attr_accessor account_verification_letter: Increase::Document::AccountVerificationLetter? + attr_accessor category: Increase::Models::Document::category attr_accessor created_at: Time @@ -21,31 +25,48 @@ module Increase attr_accessor file_id: String + attr_accessor idempotency_key: String? + attr_accessor type: Increase::Models::Document::type_ def initialize: ( id: String, + account_verification_letter: Increase::Document::AccountVerificationLetter?, category: Increase::Models::Document::category, created_at: Time, entity_id: String?, file_id: String, + idempotency_key: String?, type: Increase::Models::Document::type_ ) -> void def to_hash: -> { id: String, + account_verification_letter: Increase::Document::AccountVerificationLetter?, category: Increase::Models::Document::category, created_at: Time, entity_id: String?, file_id: String, + idempotency_key: String?, type: Increase::Models::Document::type_ } + type account_verification_letter = { account_number_id: String } + + class AccountVerificationLetter < Increase::Internal::Type::BaseModel + attr_accessor account_number_id: String + + def initialize: (account_number_id: String) -> void + + def to_hash: -> { account_number_id: String } + end + type category = :form_1099_int | :form_1099_misc | :proof_of_authorization | :company_information + | :account_verification_letter module Category extend Increase::Internal::Type::Enum @@ -62,6 +83,9 @@ module Increase # Company information, such a policies or procedures, typically submitted during our due diligence process. COMPANY_INFORMATION: :company_information + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER: :account_verification_letter + def self?.values: -> ::Array[Increase::Models::Document::category] end diff --git a/sig/increase/models/document_create_params.rbs b/sig/increase/models/document_create_params.rbs new file mode 100644 index 000000000..d667ea47c --- /dev/null +++ b/sig/increase/models/document_create_params.rbs @@ -0,0 +1,61 @@ +module Increase + module Models + type document_create_params = + { + category: Increase::Models::DocumentCreateParams::category, + account_verification_letter: Increase::DocumentCreateParams::AccountVerificationLetter + } + & Increase::Internal::Type::request_parameters + + class DocumentCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + attr_accessor category: Increase::Models::DocumentCreateParams::category + + attr_reader account_verification_letter: Increase::DocumentCreateParams::AccountVerificationLetter? + + def account_verification_letter=: ( + Increase::DocumentCreateParams::AccountVerificationLetter + ) -> Increase::DocumentCreateParams::AccountVerificationLetter + + def initialize: ( + category: Increase::Models::DocumentCreateParams::category, + ?account_verification_letter: Increase::DocumentCreateParams::AccountVerificationLetter, + ?request_options: Increase::request_opts + ) -> void + + def to_hash: -> { + category: Increase::Models::DocumentCreateParams::category, + account_verification_letter: Increase::DocumentCreateParams::AccountVerificationLetter, + request_options: Increase::RequestOptions + } + + type category = :account_verification_letter + + module Category + extend Increase::Internal::Type::Enum + + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER: :account_verification_letter + + def self?.values: -> ::Array[Increase::Models::DocumentCreateParams::category] + end + + type account_verification_letter = + { account_number_id: String, balance_date: Date } + + class AccountVerificationLetter < Increase::Internal::Type::BaseModel + attr_accessor account_number_id: String + + attr_reader balance_date: Date? + + def balance_date=: (Date) -> Date + + def initialize: (account_number_id: String, ?balance_date: Date) -> void + + def to_hash: -> { account_number_id: String, balance_date: Date } + end + end + end +end diff --git a/sig/increase/models/document_list_params.rbs b/sig/increase/models/document_list_params.rbs index f14106db3..f22754ee3 100644 --- a/sig/increase/models/document_list_params.rbs +++ b/sig/increase/models/document_list_params.rbs @@ -6,6 +6,7 @@ module Increase created_at: Increase::DocumentListParams::CreatedAt, cursor: String, entity_id: String, + idempotency_key: String, limit: Integer } & Increase::Internal::Type::request_parameters @@ -34,6 +35,10 @@ module Increase def entity_id=: (String) -> String + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + attr_reader limit: Integer? def limit=: (Integer) -> Integer @@ -43,6 +48,7 @@ module Increase ?created_at: Increase::DocumentListParams::CreatedAt, ?cursor: String, ?entity_id: String, + ?idempotency_key: String, ?limit: Integer, ?request_options: Increase::request_opts ) -> void @@ -52,6 +58,7 @@ module Increase created_at: Increase::DocumentListParams::CreatedAt, cursor: String, entity_id: String, + idempotency_key: String, limit: Integer, request_options: Increase::RequestOptions } @@ -79,6 +86,7 @@ module Increase | :form_1099_misc | :proof_of_authorization | :company_information + | :account_verification_letter module In extend Increase::Internal::Type::Enum @@ -95,6 +103,9 @@ module Increase # Company information, such a policies or procedures, typically submitted during our due diligence process. COMPANY_INFORMATION: :company_information + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER: :account_verification_letter + def self?.values: -> ::Array[Increase::Models::DocumentListParams::Category::in_] end end diff --git a/sig/increase/models/file.rbs b/sig/increase/models/file.rbs index 3020ba96f..5705f19d0 100644 --- a/sig/increase/models/file.rbs +++ b/sig/increase/models/file.rbs @@ -96,6 +96,7 @@ module Increase | :unusual_activity_report_attachment | :deposit_account_control_agreement | :proof_of_authorization_request_submission + | :account_verification_letter module Purpose extend Increase::Internal::Type::Enum @@ -175,6 +176,9 @@ module Increase # A file containing additional evidence for a Proof of Authorization Request Submission. PROOF_OF_AUTHORIZATION_REQUEST_SUBMISSION: :proof_of_authorization_request_submission + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER: :account_verification_letter + def self?.values: -> ::Array[Increase::Models::File::purpose] end diff --git a/sig/increase/models/file_list_params.rbs b/sig/increase/models/file_list_params.rbs index 0beb92d4d..679c0975d 100644 --- a/sig/increase/models/file_list_params.rbs +++ b/sig/increase/models/file_list_params.rbs @@ -135,6 +135,7 @@ module Increase | :unusual_activity_report_attachment | :deposit_account_control_agreement | :proof_of_authorization_request_submission + | :account_verification_letter module In extend Increase::Internal::Type::Enum @@ -214,6 +215,9 @@ module Increase # A file containing additional evidence for a Proof of Authorization Request Submission. PROOF_OF_AUTHORIZATION_REQUEST_SUBMISSION: :proof_of_authorization_request_submission + # An account verification letter. + ACCOUNT_VERIFICATION_LETTER: :account_verification_letter + def self?.values: -> ::Array[Increase::Models::FileListParams::Purpose::in_] end end diff --git a/sig/increase/resources/documents.rbs b/sig/increase/resources/documents.rbs index cde2f6f82..868deeded 100644 --- a/sig/increase/resources/documents.rbs +++ b/sig/increase/resources/documents.rbs @@ -1,6 +1,12 @@ module Increase module Resources class Documents + def create: ( + category: Increase::Models::DocumentCreateParams::category, + ?account_verification_letter: Increase::DocumentCreateParams::AccountVerificationLetter, + ?request_options: Increase::request_opts + ) -> Increase::Document + def retrieve: ( String document_id, ?request_options: Increase::request_opts @@ -11,6 +17,7 @@ module Increase ?created_at: Increase::DocumentListParams::CreatedAt, ?cursor: String, ?entity_id: String, + ?idempotency_key: String, ?limit: Integer, ?request_options: Increase::request_opts ) -> Increase::Internal::Page[Increase::Document] diff --git a/test/increase/resources/documents_test.rb b/test/increase/resources/documents_test.rb index c26aeaa76..9742598ee 100644 --- a/test/increase/resources/documents_test.rb +++ b/test/increase/resources/documents_test.rb @@ -3,6 +3,27 @@ require_relative "../test_helper" class Increase::Test::Resources::DocumentsTest < Increase::Test::ResourceTest + def test_create_required_params + response = @increase.documents.create(category: :account_verification_letter) + + assert_pattern do + response => Increase::Document + end + + assert_pattern do + response => { + id: String, + account_verification_letter: Increase::Document::AccountVerificationLetter | nil, + category: Increase::Document::Category, + created_at: Time, + entity_id: String | nil, + file_id: String, + idempotency_key: String | nil, + type: Increase::Document::Type + } + end + end + def test_retrieve response = @increase.documents.retrieve("document_id") @@ -13,10 +34,12 @@ def test_retrieve assert_pattern do response => { id: String, + account_verification_letter: Increase::Document::AccountVerificationLetter | nil, category: Increase::Document::Category, created_at: Time, entity_id: String | nil, file_id: String, + idempotency_key: String | nil, type: Increase::Document::Type } end @@ -39,10 +62,12 @@ def test_list assert_pattern do row => { id: String, + account_verification_letter: Increase::Document::AccountVerificationLetter | nil, category: Increase::Document::Category, created_at: Time, entity_id: String | nil, file_id: String, + idempotency_key: String | nil, type: Increase::Document::Type } end diff --git a/test/increase/resources/simulations/documents_test.rb b/test/increase/resources/simulations/documents_test.rb index c6e9d1a85..c04de69d6 100644 --- a/test/increase/resources/simulations/documents_test.rb +++ b/test/increase/resources/simulations/documents_test.rb @@ -13,10 +13,12 @@ def test_create_required_params assert_pattern do response => { id: String, + account_verification_letter: Increase::Document::AccountVerificationLetter | nil, category: Increase::Document::Category, created_at: Time, entity_id: String | nil, file_id: String, + idempotency_key: String | nil, type: Increase::Document::Type } end