diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6992080f6..b2c0c8f79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,6 @@ jobs: lint: name: lint runs-on: ubuntu-latest - - steps: - uses: actions/checkout@v4 - name: Set up Ruby @@ -29,7 +27,6 @@ jobs: test: name: test runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Set up Ruby diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c373724dc..46b9b6b24 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.8" + ".": "0.1.0-alpha.9" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 31b1c0195..d33052a80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 199 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b21d5da00193c0adcbbc6bb89b6eba07c1b8720b9c383e2496d9c68a9426925e.yml -openapi_spec_hash: fb8ac77c8609e18634121b86b378f332 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-55c174581a08cabdf3fcf2fc66d480d497c5f77ab8f0f5e776cc7113b4960037.yml +openapi_spec_hash: 8f70d88f00c9c15ebd8e9049e9f65063 config_hash: 20a463ecd33bd32b7b9bc6f4990907ac diff --git a/CHANGELOG.md b/CHANGELOG.md index e1560e3e8..08e7c84d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## 0.1.0-alpha.9 (2025-04-12) + +Full Changelog: [v0.1.0-alpha.8...v0.1.0-alpha.9](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.8...v0.1.0-alpha.9) + +### Features + +* **api:** api update ([5a4e9ba](https://github.com/Increase/increase-ruby/commit/5a4e9bacb00277a52798301a3c9c5e38ceb6e5d9)) +* **api:** api update ([f79ff29](https://github.com/Increase/increase-ruby/commit/f79ff298e7be0c13803b9b2f4575f75f1550a286)) +* **api:** api update ([327f605](https://github.com/Increase/increase-ruby/commit/327f605b8456aa8b0761989c863839c83dc1482d)) +* **api:** api update ([55e7b4c](https://github.com/Increase/increase-ruby/commit/55e7b4c83502d2adf46d473b8d0bc7367ad5d0dc)) +* **api:** api update ([e53e9d7](https://github.com/Increase/increase-ruby/commit/e53e9d7a656b9c5de1a8b977282e09f7630b8faa)) + + +### Bug Fixes + +* inaccuracies in the README.md ([1c01f71](https://github.com/Increase/increase-ruby/commit/1c01f711875bb2ea64fede9350d916c2a942dbc7)) +* **internal:** update release-please to use ruby strategy for README.md ([#50](https://github.com/Increase/increase-ruby/issues/50)) ([3bd9441](https://github.com/Increase/increase-ruby/commit/3bd9441cafc861e86bed22b903f5a1d4ffa66d43)) + + +### Chores + +* ensure readme.md is bumped when release please updates versions ([#49](https://github.com/Increase/increase-ruby/issues/49)) ([b524b98](https://github.com/Increase/increase-ruby/commit/b524b987ed001e01ee3ca2a6cce4afa6521573f9)) +* fix readme typo ([#52](https://github.com/Increase/increase-ruby/issues/52)) ([b2d7d10](https://github.com/Increase/increase-ruby/commit/b2d7d1006be912f2009aab5da9f0121696b83485)) +* **internal:** expand CI branch coverage ([#51](https://github.com/Increase/increase-ruby/issues/51)) ([46c1641](https://github.com/Increase/increase-ruby/commit/46c1641d60271c5dd068704973db35446c6b1ae3)) +* **internal:** reduce CI branch coverage ([ebda740](https://github.com/Increase/increase-ruby/commit/ebda740837d8c68da8a5526178bf62b1ba059d7e)) +* **internal:** version bump ([ad35cfd](https://github.com/Increase/increase-ruby/commit/ad35cfd373e451b0c1d0b063229e731c139c4b3b)) +* loosen const and integer coercion rules ([#48](https://github.com/Increase/increase-ruby/issues/48)) ([ef3dc18](https://github.com/Increase/increase-ruby/commit/ef3dc18eac859aa3e37dd829c93ae2d337e2524c)) + ## 0.1.0-alpha.8 (2025-04-08) Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.7...v0.1.0-alpha.8) diff --git a/Gemfile.lock b/Gemfile.lock index 5d19d7f21..6d3f578d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - increase (0.1.0.pre.alpha.8) + increase (0.1.0.pre.alpha.9) connection_pool GEM diff --git a/README.md b/README.md index c52b055be..a46e885a8 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,11 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "increase", "~> 0.1.0.pre.alpha.7" +gem "increase", "~> 0.1.0.pre.alpha.9" ``` -To fetch an initial copy of the gem: - -```sh -bundle install -``` - ## Usage ```ruby @@ -37,12 +31,11 @@ increase = Increase::Client.new( environment: "sandbox" # defaults to "production" ) -account = - increase.accounts.create( - name: "New Account!", - entity_id: "entity_n8y8tnk2p9339ti393yi", - program_id: "program_i2v2os4mwza1oetokh9i" - ) +account = increase.accounts.create( + name: "New Account!", + entity_id: "entity_n8y8tnk2p9339ti393yi", + program_id: "program_i2v2os4mwza1oetokh9i" +) puts(account.id) ``` @@ -66,7 +59,7 @@ page.auto_paging_each do |account| end ``` -## File uploads +### File uploads Request parameters that correspond to file uploads can be passed as `StringIO`, or a [`Pathname`](https://rubyapi.org/3.1/o/pathname) instance. @@ -85,7 +78,7 @@ puts(file.id) ### Errors -When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Increase::Error` will be thrown: +When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Increase::Errors::APIError` will be thrown: ```ruby begin @@ -192,12 +185,11 @@ Due to limitations with the Sorbet type system, where a method otherwise can tak Please follow Sorbet's [setup guides](https://sorbet.org/docs/adopting) for best experience. ```ruby -params = - Increase::Models::AccountCreateParams.new( - name: "New Account!", - entity_id: "entity_n8y8tnk2p9339ti393yi", - program_id: "program_i2v2os4mwza1oetokh9i" - ) +params = Increase::Models::AccountCreateParams.new( + name: "New Account!", + entity_id: "entity_n8y8tnk2p9339ti393yi", + program_id: "program_i2v2os4mwza1oetokh9i" +) increase.accounts.create(**params) ``` @@ -225,8 +217,7 @@ If you want to explicitly send an extra param, you can do so with the `extra_que To make requests to undocumented endpoints, you can make requests using `client.request`. Options on the client will be respected (such as retries) when making this request. ```ruby -response = - client.request( +response = client.request( method: :post, path: '/undocumented/endpoint', query: {"dog": "woof"}, diff --git a/increase.gemspec b/increase.gemspec index 3d20892fd..70bfd43a2 100644 --- a/increase.gemspec +++ b/increase.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |s| s.summary = "Ruby library to access the Increase API" s.authors = ["Increase"] s.email = "dev-feedback@increase.com" - s.files = Dir["lib/**/*.rb", "rbi/**/*.rbi", "sig/**/*.rbs", "manifest.yaml"] + s.files = Dir["lib/**/*.rb", "rbi/**/*.rbi", "sig/**/*.rbs", "manifest.yaml", "CHANGELOG.md", "SECURITY.md"] s.extra_rdoc_files = ["README.md"] s.required_ruby_version = ">= 3.0.0" s.add_dependency "connection_pool" diff --git a/lib/increase/internal/type/converter.rb b/lib/increase/internal/type/converter.rb index 05dc28cde..debe97ddf 100644 --- a/lib/increase/internal/type/converter.rb +++ b/lib/increase/internal/type/converter.rb @@ -149,9 +149,9 @@ def coerce( if value.is_a?(Integer) exactness[:yes] += 1 return value - elsif strictness == :strong + elsif strictness == :strong && Integer(value, exception: false) != value message = "no implicit conversion of #{value.class} into #{target.inspect}" - raise TypeError.new(message) + raise value.is_a?(Numeric) ? ArgumentError.new(message) : TypeError.new(message) else Kernel.then do return Integer(value).tap { exactness[:maybe] += 1 } @@ -197,12 +197,20 @@ def coerce( else end in Symbol - if (value.is_a?(Symbol) || value.is_a?(String)) && value.to_sym == target - exactness[:yes] += 1 - return target - elsif strictness == :strong - message = "cannot convert non-matching #{value.class} into #{target.inspect}" - raise ArgumentError.new(message) + case value + in Symbol | String + if value.to_sym == target + exactness[:yes] += 1 + return target + else + exactness[:maybe] += 1 + return value + end + else + if strictness == :strong + message = "cannot convert non-matching #{value.class} into #{target.inspect}" + raise ArgumentError.new(message) + end end else end diff --git a/lib/increase/models/card_payment.rb b/lib/increase/models/card_payment.rb index 47c15ef4a..30b2af826 100644 --- a/lib/increase/models/card_payment.rb +++ b/lib/increase/models/card_payment.rb @@ -3100,9 +3100,10 @@ module Currency # @see Increase::Models::CardPayment::Element::CardRefund#interchange class Interchange < Increase::Internal::Type::BaseModel # @!attribute amount - # The interchange amount given as a string containing a decimal number. The amount - # is a positive number if it is credited to Increase (e.g., settlements) and a - # negative number if it is debited (e.g., refunds). + # The interchange amount given as a string containing a decimal number in major + # units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + # credited to Increase (e.g., settlements) and a negative number if it is debited + # (e.g., refunds). # # @return [String] required :amount, String @@ -4829,9 +4830,10 @@ module Currency # @see Increase::Models::CardPayment::Element::CardSettlement#interchange class Interchange < Increase::Internal::Type::BaseModel # @!attribute amount - # The interchange amount given as a string containing a decimal number. The amount - # is a positive number if it is credited to Increase (e.g., settlements) and a - # negative number if it is debited (e.g., refunds). + # The interchange amount given as a string containing a decimal number in major + # units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + # credited to Increase (e.g., settlements) and a negative number if it is debited + # (e.g., refunds). # # @return [String] required :amount, String diff --git a/lib/increase/models/check_transfer.rb b/lib/increase/models/check_transfer.rb index cf96a51ee..c469cf271 100644 --- a/lib/increase/models/check_transfer.rb +++ b/lib/increase/models/check_transfer.rb @@ -478,6 +478,12 @@ class Mailing < Increase::Internal::Type::BaseModel # @see Increase::Models::CheckTransfer#physical_check class PhysicalCheck < Increase::Internal::Type::BaseModel + # @!attribute attachment_file_id + # The ID of the file for the check attachment. + # + # @return [String, nil] + required :attachment_file_id, String, nil?: true + # @!attribute mailing_address # Details for where Increase will mail the check. # @@ -534,6 +540,7 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel # # Details relating to the physical check that Increase will print and mail. Will # # be present if and only if `fulfillment_method` is equal to `physical_check`. # # + # # @param attachment_file_id [String, nil] # # @param mailing_address [Increase::Models::CheckTransfer::PhysicalCheck::MailingAddress] # # @param memo [String, nil] # # @param note [String, nil] @@ -544,6 +551,7 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel # # @param tracking_updates [Array] # # # def initialize( + # attachment_file_id:, # mailing_address:, # memo:, # note:, @@ -986,12 +994,6 @@ class SubmittedAddress < Increase::Internal::Type::BaseModel # @see Increase::Models::CheckTransfer#third_party class ThirdParty < Increase::Internal::Type::BaseModel - # @!attribute check_number - # The check number that you will print on the check. - # - # @return [String, nil] - required :check_number, String, nil?: true - # @!attribute recipient_name # The name that you will print on the check. # @@ -1002,10 +1004,9 @@ class ThirdParty < Increase::Internal::Type::BaseModel # # Details relating to the custom fulfillment you will perform. Will be present if # # and only if `fulfillment_method` is equal to `third_party`. # # - # # @param check_number [String, nil] # # @param recipient_name [String, nil] # # - # def initialize(check_number:, recipient_name:, **) = super + # def initialize(recipient_name:, **) = super # def initialize: (Hash | Increase::Internal::Type::BaseModel) -> void end diff --git a/lib/increase/models/check_transfer_create_params.rb b/lib/increase/models/check_transfer_create_params.rb index b48015fdc..b8de2b49a 100644 --- a/lib/increase/models/check_transfer_create_params.rb +++ b/lib/increase/models/check_transfer_create_params.rb @@ -130,6 +130,18 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel # @return [String] required :recipient_name, String + # @!attribute [r] attachment_file_id + # The ID of a File to be attached to the check. This must have + # `purpose: check_attachment`. For details on pricing and restrictions, see + # https://increase.com/documentation/originating-checks#printing-checks . + # + # @return [String, nil] + optional :attachment_file_id, String + + # @!parse + # # @return [String] + # attr_writer :attachment_file_id + # @!attribute [r] check_number # The check number Increase should print on the check. This should not contain # leading zeroes and must be unique across the `source_account_number`. If this is @@ -164,6 +176,18 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel # # @return [Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress] # attr_writer :return_address + # @!attribute [r] shipping_method + # How to ship the check. For details on pricing, timing, and restrictions, see + # https://increase.com/documentation/originating-checks#printing-checks . + # + # @return [Symbol, Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod, nil] + optional :shipping_method, + enum: -> { Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod } + + # @!parse + # # @return [Symbol, Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod] + # attr_writer :shipping_method + # @!attribute [r] signature_text # The text that will appear as the signature on the check in cursive font. If not # provided, the check will be printed with 'No signature required'. @@ -183,18 +207,22 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel # # @param mailing_address [Increase::Models::CheckTransferCreateParams::PhysicalCheck::MailingAddress] # # @param memo [String] # # @param recipient_name [String] + # # @param attachment_file_id [String] # # @param check_number [String] # # @param note [String] # # @param return_address [Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress] + # # @param shipping_method [Symbol, Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod] # # @param signature_text [String] # # # def initialize( # mailing_address:, # memo:, # recipient_name:, + # attachment_file_id: nil, # check_number: nil, # note: nil, # return_address: nil, + # shipping_method: nil, # signature_text: nil, # ** # ) @@ -311,21 +339,29 @@ class ReturnAddress < Increase::Internal::Type::BaseModel # def initialize: (Hash | Increase::Internal::Type::BaseModel) -> void end - end - class ThirdParty < Increase::Internal::Type::BaseModel - # @!attribute [r] check_number - # The check number you will print on the check. This should not contain leading - # zeroes. If this is omitted, Increase will generate a check number for you; you - # should inspect the response and use that check number. + # How to ship the check. For details on pricing, timing, and restrictions, see + # https://increase.com/documentation/originating-checks#printing-checks . # - # @return [String, nil] - optional :check_number, String + # @see Increase::Models::CheckTransferCreateParams::PhysicalCheck#shipping_method + module ShippingMethod + extend Increase::Internal::Type::Enum - # @!parse - # # @return [String] - # attr_writer :check_number + # USPS First Class + USPS_FIRST_CLASS = :usps_first_class + + # FedEx Overnight + FEDEX_OVERNIGHT = :fedex_overnight + + finalize! + # @!parse + # # @return [Array] + # def self.values; end + end + end + + class ThirdParty < Increase::Internal::Type::BaseModel # @!attribute [r] recipient_name # The pay-to name you will print on the check. If provided, this is used for # [Positive Pay](/documentation/positive-pay). If this is omitted, Increase will @@ -343,10 +379,9 @@ class ThirdParty < Increase::Internal::Type::BaseModel # # `fulfillment_method` is equal to `third_party`. It must not be included if any # # other `fulfillment_method` is provided. # # - # # @param check_number [String] # # @param recipient_name [String] # # - # def initialize(check_number: nil, recipient_name: nil, **) = super + # def initialize(recipient_name: nil, **) = super # def initialize: (Hash | Increase::Internal::Type::BaseModel) -> void end diff --git a/lib/increase/models/physical_card_profile.rb b/lib/increase/models/physical_card_profile.rb index e020c1bdf..fa2db323f 100644 --- a/lib/increase/models/physical_card_profile.rb +++ b/lib/increase/models/physical_card_profile.rb @@ -68,6 +68,12 @@ class PhysicalCardProfile < Increase::Internal::Type::BaseModel # @return [Boolean] required :is_default, Increase::Internal::Type::Boolean + # @!attribute program_id + # The identifier for the Program this Physical Card Profile belongs to. + # + # @return [String] + required :program_id, String + # @!attribute status # The status of the Physical Card Profile. # @@ -96,6 +102,7 @@ class PhysicalCardProfile < Increase::Internal::Type::BaseModel # # @param front_image_file_id [String, nil] # # @param idempotency_key [String, nil] # # @param is_default [Boolean] + # # @param program_id [String] # # @param status [Symbol, Increase::Models::PhysicalCardProfile::Status] # # @param type [Symbol, Increase::Models::PhysicalCardProfile::Type] # # @@ -110,6 +117,7 @@ class PhysicalCardProfile < Increase::Internal::Type::BaseModel # front_image_file_id:, # idempotency_key:, # is_default:, + # program_id:, # status:, # type:, # ** diff --git a/lib/increase/models/transaction.rb b/lib/increase/models/transaction.rb index ee5ea884c..49e34936e 100644 --- a/lib/increase/models/transaction.rb +++ b/lib/increase/models/transaction.rb @@ -1365,9 +1365,10 @@ module Currency # @see Increase::Models::Transaction::Source::CardRefund#interchange class Interchange < Increase::Internal::Type::BaseModel # @!attribute amount - # The interchange amount given as a string containing a decimal number. The amount - # is a positive number if it is credited to Increase (e.g., settlements) and a - # negative number if it is debited (e.g., refunds). + # The interchange amount given as a string containing a decimal number in major + # units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + # credited to Increase (e.g., settlements) and a negative number if it is debited + # (e.g., refunds). # # @return [String] required :amount, String @@ -2878,9 +2879,10 @@ module Currency # @see Increase::Models::Transaction::Source::CardSettlement#interchange class Interchange < Increase::Internal::Type::BaseModel # @!attribute amount - # The interchange amount given as a string containing a decimal number. The amount - # is a positive number if it is credited to Increase (e.g., settlements) and a - # negative number if it is debited (e.g., refunds). + # The interchange amount given as a string containing a decimal number in major + # units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + # credited to Increase (e.g., settlements) and a negative number if it is debited + # (e.g., refunds). # # @return [String] required :amount, String diff --git a/lib/increase/version.rb b/lib/increase/version.rb index f59bf3756..e9f349fff 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.8" + VERSION = "0.1.0.pre.alpha.9" end diff --git a/rbi/lib/increase/models/card_payment.rbi b/rbi/lib/increase/models/card_payment.rbi index 88beed0ec..daa801334 100644 --- a/rbi/lib/increase/models/card_payment.rbi +++ b/rbi/lib/increase/models/card_payment.rbi @@ -4276,9 +4276,10 @@ module Increase end class Interchange < Increase::Internal::Type::BaseModel - # The interchange amount given as a string containing a decimal number. The amount - # is a positive number if it is credited to Increase (e.g., settlements) and a - # negative number if it is debited (e.g., refunds). + # The interchange amount given as a string containing a decimal number in major + # units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + # credited to Increase (e.g., settlements) and a negative number if it is debited + # (e.g., refunds). sig { returns(String) } attr_accessor :amount @@ -6655,9 +6656,10 @@ module Increase end class Interchange < Increase::Internal::Type::BaseModel - # The interchange amount given as a string containing a decimal number. The amount - # is a positive number if it is credited to Increase (e.g., settlements) and a - # negative number if it is debited (e.g., refunds). + # The interchange amount given as a string containing a decimal number in major + # units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + # credited to Increase (e.g., settlements) and a negative number if it is debited + # (e.g., refunds). sig { returns(String) } attr_accessor :amount diff --git a/rbi/lib/increase/models/check_transfer.rbi b/rbi/lib/increase/models/check_transfer.rbi index dd674557a..92f925e8b 100644 --- a/rbi/lib/increase/models/check_transfer.rbi +++ b/rbi/lib/increase/models/check_transfer.rbi @@ -509,6 +509,10 @@ module Increase end class PhysicalCheck < Increase::Internal::Type::BaseModel + # The ID of the file for the check attachment. + sig { returns(T.nilable(String)) } + attr_accessor :attachment_file_id + # Details for where Increase will mail the check. sig { returns(Increase::Models::CheckTransfer::PhysicalCheck::MailingAddress) } attr_reader :mailing_address @@ -564,6 +568,7 @@ module Increase # be present if and only if `fulfillment_method` is equal to `physical_check`. sig do params( + attachment_file_id: T.nilable(String), mailing_address: T.any(Increase::Models::CheckTransfer::PhysicalCheck::MailingAddress, Increase::Internal::AnyHash), memo: T.nilable(String), note: T.nilable(String), @@ -578,6 +583,7 @@ module Increase .returns(T.attached_class) end def self.new( + attachment_file_id:, mailing_address:, memo:, note:, @@ -591,6 +597,7 @@ module Increase override .returns( { + attachment_file_id: T.nilable(String), mailing_address: Increase::Models::CheckTransfer::PhysicalCheck::MailingAddress, memo: T.nilable(String), note: T.nilable(String), @@ -1095,22 +1102,16 @@ module Increase end class ThirdParty < Increase::Internal::Type::BaseModel - # The check number that you will print on the check. - sig { returns(T.nilable(String)) } - attr_accessor :check_number - # The name that you will print on the check. sig { returns(T.nilable(String)) } attr_accessor :recipient_name # Details relating to the custom fulfillment you will perform. Will be present if # and only if `fulfillment_method` is equal to `third_party`. - sig do - params(check_number: T.nilable(String), recipient_name: T.nilable(String)).returns(T.attached_class) - end - def self.new(check_number:, recipient_name:); end + sig { params(recipient_name: T.nilable(String)).returns(T.attached_class) } + def self.new(recipient_name:); end - sig { override.returns({check_number: T.nilable(String), recipient_name: T.nilable(String)}) } + sig { override.returns({recipient_name: T.nilable(String)}) } def to_hash; end end diff --git a/rbi/lib/increase/models/check_transfer_create_params.rbi b/rbi/lib/increase/models/check_transfer_create_params.rbi index 1872fb87b..ace4e9c36 100644 --- a/rbi/lib/increase/models/check_transfer_create_params.rbi +++ b/rbi/lib/increase/models/check_transfer_create_params.rbi @@ -143,6 +143,15 @@ module Increase sig { returns(String) } attr_accessor :recipient_name + # The ID of a File to be attached to the check. This must have + # `purpose: check_attachment`. For details on pricing and restrictions, see + # https://increase.com/documentation/originating-checks#printing-checks . + sig { returns(T.nilable(String)) } + attr_reader :attachment_file_id + + sig { params(attachment_file_id: String).void } + attr_writer :attachment_file_id + # The check number Increase should print on the check. This should not contain # leading zeroes and must be unique across the `source_account_number`. If this is # omitted, Increase will generate a check number for you. @@ -176,6 +185,19 @@ module Increase end attr_writer :return_address + # How to ship the check. For details on pricing, timing, and restrictions, see + # https://increase.com/documentation/originating-checks#printing-checks . + sig { returns(T.nilable(Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod::OrSymbol)) } + attr_reader :shipping_method + + sig do + params( + shipping_method: Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod::OrSymbol + ) + .void + end + attr_writer :shipping_method + # The text that will appear as the signature on the check in cursive font. If not # provided, the check will be printed with 'No signature required'. sig { returns(T.nilable(String)) } @@ -195,12 +217,14 @@ module Increase ), memo: String, recipient_name: String, + attachment_file_id: String, check_number: String, note: String, return_address: T.any( Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress, Increase::Internal::AnyHash ), + shipping_method: Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod::OrSymbol, signature_text: String ) .returns(T.attached_class) @@ -209,9 +233,11 @@ module Increase mailing_address:, memo:, recipient_name:, + attachment_file_id: nil, check_number: nil, note: nil, return_address: nil, + shipping_method: nil, signature_text: nil ); end sig do @@ -221,9 +247,11 @@ module Increase mailing_address: Increase::Models::CheckTransferCreateParams::PhysicalCheck::MailingAddress, memo: String, recipient_name: String, + attachment_file_id: String, check_number: String, note: String, return_address: Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress, + shipping_method: Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod::OrSymbol, signature_text: String } ) @@ -324,18 +352,48 @@ module Increase end def to_hash; end end - end - class ThirdParty < Increase::Internal::Type::BaseModel - # The check number you will print on the check. This should not contain leading - # zeroes. If this is omitted, Increase will generate a check number for you; you - # should inspect the response and use that check number. - sig { returns(T.nilable(String)) } - attr_reader :check_number + # How to ship the check. For details on pricing, timing, and restrictions, see + # https://increase.com/documentation/originating-checks#printing-checks . + module ShippingMethod + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + String, + Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod::TaggedSymbol + ) + end + + # USPS First Class + USPS_FIRST_CLASS = + T.let( + :usps_first_class, + Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod::TaggedSymbol + ) - sig { params(check_number: String).void } - attr_writer :check_number + # FedEx Overnight + FEDEX_OVERNIGHT = + T.let( + :fedex_overnight, + Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod::TaggedSymbol] + ) + end + def self.values; end + end + end + class ThirdParty < Increase::Internal::Type::BaseModel # The pay-to name you will print on the check. If provided, this is used for # [Positive Pay](/documentation/positive-pay). If this is omitted, Increase will # be unable to validate the payee name when the check is deposited. @@ -348,10 +406,10 @@ module Increase # Details relating to the custom fulfillment you will perform. This is required if # `fulfillment_method` is equal to `third_party`. It must not be included if any # other `fulfillment_method` is provided. - sig { params(check_number: String, recipient_name: String).returns(T.attached_class) } - def self.new(check_number: nil, recipient_name: nil); end + sig { params(recipient_name: String).returns(T.attached_class) } + def self.new(recipient_name: nil); end - sig { override.returns({check_number: String, recipient_name: String}) } + sig { override.returns({recipient_name: String}) } def to_hash; end end end diff --git a/rbi/lib/increase/models/physical_card_profile.rbi b/rbi/lib/increase/models/physical_card_profile.rbi index c0d527174..3ffa59ab6 100644 --- a/rbi/lib/increase/models/physical_card_profile.rbi +++ b/rbi/lib/increase/models/physical_card_profile.rbi @@ -47,6 +47,10 @@ module Increase sig { returns(T::Boolean) } attr_accessor :is_default + # The identifier for the Program this Physical Card Profile belongs to. + sig { returns(String) } + attr_accessor :program_id + # The status of the Physical Card Profile. sig { returns(Increase::Models::PhysicalCardProfile::Status::TaggedSymbol) } attr_accessor :status @@ -71,6 +75,7 @@ module Increase front_image_file_id: T.nilable(String), idempotency_key: T.nilable(String), is_default: T::Boolean, + program_id: String, status: Increase::Models::PhysicalCardProfile::Status::OrSymbol, type: Increase::Models::PhysicalCardProfile::Type::OrSymbol ) @@ -87,6 +92,7 @@ module Increase front_image_file_id:, idempotency_key:, is_default:, + program_id:, status:, type: ); end @@ -104,6 +110,7 @@ module Increase front_image_file_id: T.nilable(String), idempotency_key: T.nilable(String), is_default: T::Boolean, + program_id: String, status: Increase::Models::PhysicalCardProfile::Status::TaggedSymbol, type: Increase::Models::PhysicalCardProfile::Type::TaggedSymbol } diff --git a/rbi/lib/increase/models/transaction.rbi b/rbi/lib/increase/models/transaction.rbi index 8f0b78d22..eba75f7b2 100644 --- a/rbi/lib/increase/models/transaction.rbi +++ b/rbi/lib/increase/models/transaction.rbi @@ -1926,9 +1926,10 @@ module Increase end class Interchange < Increase::Internal::Type::BaseModel - # The interchange amount given as a string containing a decimal number. The amount - # is a positive number if it is credited to Increase (e.g., settlements) and a - # negative number if it is debited (e.g., refunds). + # The interchange amount given as a string containing a decimal number in major + # units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + # credited to Increase (e.g., settlements) and a negative number if it is debited + # (e.g., refunds). sig { returns(String) } attr_accessor :amount @@ -4055,9 +4056,10 @@ module Increase end class Interchange < Increase::Internal::Type::BaseModel - # The interchange amount given as a string containing a decimal number. The amount - # is a positive number if it is credited to Increase (e.g., settlements) and a - # negative number if it is debited (e.g., refunds). + # The interchange amount given as a string containing a decimal number in major + # units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + # credited to Increase (e.g., settlements) and a negative number if it is debited + # (e.g., refunds). sig { returns(String) } attr_accessor :amount diff --git a/release-please-config.json b/release-please-config.json index 474f49255..12caf77ae 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -60,5 +60,11 @@ } ], "release-type": "ruby", - "version-file": "lib/increase/version.rb" + "version-file": "lib/increase/version.rb", + "extra-files": [ + { + "type": "ruby-readme", + "path": "README.md" + } + ] } \ No newline at end of file diff --git a/sig/increase/models/check_transfer.rbs b/sig/increase/models/check_transfer.rbs index a4df05a2e..fb4690900 100644 --- a/sig/increase/models/check_transfer.rbs +++ b/sig/increase/models/check_transfer.rbs @@ -261,6 +261,7 @@ module Increase type physical_check = { + attachment_file_id: String?, mailing_address: Increase::Models::CheckTransfer::PhysicalCheck::MailingAddress, memo: String?, note: String?, @@ -272,6 +273,8 @@ module Increase } class PhysicalCheck < Increase::Internal::Type::BaseModel + attr_accessor attachment_file_id: String? + attr_accessor mailing_address: Increase::Models::CheckTransfer::PhysicalCheck::MailingAddress attr_accessor memo: String? @@ -289,6 +292,7 @@ module Increase attr_accessor tracking_updates: ::Array[Increase::Models::CheckTransfer::PhysicalCheck::TrackingUpdate] def initialize: ( + attachment_file_id: String?, mailing_address: Increase::Models::CheckTransfer::PhysicalCheck::MailingAddress, memo: String?, note: String?, @@ -624,14 +628,12 @@ module Increase end end - type third_party = { check_number: String?, recipient_name: String? } + type third_party = { recipient_name: String? } class ThirdParty < Increase::Internal::Type::BaseModel - attr_accessor check_number: String? - attr_accessor recipient_name: String? - def initialize: (check_number: String?, recipient_name: String?) -> void + def initialize: (recipient_name: String?) -> void def to_hash: -> Increase::Models::CheckTransfer::third_party end diff --git a/sig/increase/models/check_transfer_create_params.rbs b/sig/increase/models/check_transfer_create_params.rbs index 0f86eeaf7..2f81db72e 100644 --- a/sig/increase/models/check_transfer_create_params.rbs +++ b/sig/increase/models/check_transfer_create_params.rbs @@ -72,9 +72,11 @@ module Increase mailing_address: Increase::Models::CheckTransferCreateParams::PhysicalCheck::MailingAddress, memo: String, recipient_name: String, + attachment_file_id: String, check_number: String, note: String, return_address: Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress, + shipping_method: Increase::Models::CheckTransferCreateParams::PhysicalCheck::shipping_method, signature_text: String } @@ -85,6 +87,10 @@ module Increase attr_accessor recipient_name: String + attr_reader attachment_file_id: String? + + def attachment_file_id=: (String) -> String + attr_reader check_number: String? def check_number=: (String) -> String @@ -99,6 +105,12 @@ module Increase Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress ) -> Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress + attr_reader shipping_method: Increase::Models::CheckTransferCreateParams::PhysicalCheck::shipping_method? + + def shipping_method=: ( + Increase::Models::CheckTransferCreateParams::PhysicalCheck::shipping_method + ) -> Increase::Models::CheckTransferCreateParams::PhysicalCheck::shipping_method + attr_reader signature_text: String? def signature_text=: (String) -> String @@ -107,9 +119,11 @@ module Increase mailing_address: Increase::Models::CheckTransferCreateParams::PhysicalCheck::MailingAddress, memo: String, recipient_name: String, + ?attachment_file_id: String, ?check_number: String, ?note: String, ?return_address: Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress, + ?shipping_method: Increase::Models::CheckTransferCreateParams::PhysicalCheck::shipping_method, ?signature_text: String ) -> void @@ -184,20 +198,30 @@ module Increase def to_hash: -> Increase::Models::CheckTransferCreateParams::PhysicalCheck::return_address end - end - type third_party = { check_number: String, recipient_name: String } + type shipping_method = :usps_first_class | :fedex_overnight - class ThirdParty < Increase::Internal::Type::BaseModel - attr_reader check_number: String? + module ShippingMethod + extend Increase::Internal::Type::Enum - def check_number=: (String) -> String + # USPS First Class + USPS_FIRST_CLASS: :usps_first_class + + # FedEx Overnight + FEDEX_OVERNIGHT: :fedex_overnight + def self?.values: -> ::Array[Increase::Models::CheckTransferCreateParams::PhysicalCheck::shipping_method] + end + end + + type third_party = { recipient_name: String } + + class ThirdParty < Increase::Internal::Type::BaseModel attr_reader recipient_name: String? def recipient_name=: (String) -> String - def initialize: (?check_number: String, ?recipient_name: String) -> void + def initialize: (?recipient_name: String) -> void def to_hash: -> Increase::Models::CheckTransferCreateParams::third_party end diff --git a/sig/increase/models/physical_card_profile.rbs b/sig/increase/models/physical_card_profile.rbs index 25bee7ff1..e5d6f7a74 100644 --- a/sig/increase/models/physical_card_profile.rbs +++ b/sig/increase/models/physical_card_profile.rbs @@ -12,6 +12,7 @@ module Increase front_image_file_id: String?, idempotency_key: String?, is_default: bool, + program_id: String, status: Increase::Models::PhysicalCardProfile::status, type: Increase::Models::PhysicalCardProfile::type_ } @@ -37,6 +38,8 @@ module Increase attr_accessor is_default: bool + attr_accessor program_id: String + attr_accessor status: Increase::Models::PhysicalCardProfile::status attr_accessor type: Increase::Models::PhysicalCardProfile::type_ @@ -52,6 +55,7 @@ module Increase front_image_file_id: String?, idempotency_key: String?, is_default: bool, + program_id: String, status: Increase::Models::PhysicalCardProfile::status, type: Increase::Models::PhysicalCardProfile::type_ ) -> void diff --git a/test/increase/internal/type/base_model_test.rb b/test/increase/internal/type/base_model_test.rb index 13ac9881e..ab9bc43d0 100644 --- a/test/increase/internal/type/base_model_test.rb +++ b/test/increase/internal/type/base_model_test.rb @@ -111,7 +111,6 @@ def test_coerce_errors [Integer, "one"] => TypeError, [Float, "one"] => TypeError, [String, Time] => TypeError, - [:a, "one"] => ArgumentError, [Date, "one"] => ArgumentError, [Time, "one"] => ArgumentError } @@ -346,7 +345,7 @@ def test_coerce [M2, {a: "1990-09-19", c: nil}] => [{yes: 2, maybe: 2}, {a: "1990-09-19", c: nil}], [M3, {c: "c", d: "d"}] => [{yes: 3}, {c: :c, d: :d}], - [M3, {c: "d", d: "c"}] => [{yes: 1, no: 2}, {c: "d", d: "c"}], + [M3, {c: "d", d: "c"}] => [{yes: 1, maybe: 2}, {c: "d", d: "c"}], [M4, {c: 2}] => [{yes: 5}, {c: 2}], [M4, {a: "1", c: 2}] => [{yes: 4, maybe: 1}, {a: "1", c: 2}], @@ -404,7 +403,8 @@ def test_accessors cases = { M2.new({a: "1990-09-19", b: "1"}) => {a: Time.new(1990, 9, 19), b: TypeError}, M2.new(a: "one", b: "one") => {a: ArgumentError, b: TypeError}, - M2.new(a: nil, b: 2.0) => {a: TypeError, b: TypeError}, + M2.new(a: nil, b: 2.0) => {a: TypeError}, + M2.new(a: nil, b: 2.2) => {a: TypeError, b: ArgumentError}, M3.new => {d: :d}, M3.new(d: 1) => {d: ArgumentError}, @@ -520,8 +520,8 @@ def test_coerce [U0, :""] => [{no: 1}, 0, :""], [U1, "a"] => [{yes: 1}, 1, :a], - [U1, "2"] => [{maybe: 1}, 2, 2], - [U1, :b] => [{no: 1}, 2, :b], + [U1, "2"] => [{maybe: 1}, 2, "2"], + [U1, :b] => [{maybe: 1}, 2, :b], [U2, {type: :a}] => [{yes: 3}, 0, {t: :a}], [U2, {type: "b"}] => [{yes: 3}, 0, {type: :b}], diff --git a/test/increase/resources/physical_card_profiles_test.rb b/test/increase/resources/physical_card_profiles_test.rb index 064dc35ec..a76e16e25 100644 --- a/test/increase/resources/physical_card_profiles_test.rb +++ b/test/increase/resources/physical_card_profiles_test.rb @@ -29,6 +29,7 @@ def test_create_required_params front_image_file_id: String | nil, idempotency_key: String | nil, is_default: Increase::Internal::Type::Boolean, + program_id: String, status: Increase::Models::PhysicalCardProfile::Status, type: Increase::Models::PhysicalCardProfile::Type } @@ -54,6 +55,7 @@ def test_retrieve front_image_file_id: String | nil, idempotency_key: String | nil, is_default: Increase::Internal::Type::Boolean, + program_id: String, status: Increase::Models::PhysicalCardProfile::Status, type: Increase::Models::PhysicalCardProfile::Type } @@ -86,6 +88,7 @@ def test_list front_image_file_id: String | nil, idempotency_key: String | nil, is_default: Increase::Internal::Type::Boolean, + program_id: String, status: Increase::Models::PhysicalCardProfile::Status, type: Increase::Models::PhysicalCardProfile::Type } @@ -111,6 +114,7 @@ def test_archive front_image_file_id: String | nil, idempotency_key: String | nil, is_default: Increase::Internal::Type::Boolean, + program_id: String, status: Increase::Models::PhysicalCardProfile::Status, type: Increase::Models::PhysicalCardProfile::Type } @@ -136,6 +140,7 @@ def test_clone_ front_image_file_id: String | nil, idempotency_key: String | nil, is_default: Increase::Internal::Type::Boolean, + program_id: String, status: Increase::Models::PhysicalCardProfile::Status, type: Increase::Models::PhysicalCardProfile::Type }