Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.28.0"
".": "1.29.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 202
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-244805b184601a0639e868cb601337a5ebe0f259576a7e22d46c881ee22e17d3.yml
openapi_spec_hash: a667a8fca7bc57f82f22ddc2a9829e19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-65d55098340df71e6f5c251c62e6853ad5184102c603d9f74622e8b33581c800.yml
openapi_spec_hash: 9f772e02b53a65c6e8ada7ac684117fb
config_hash: a185e9a72778cc4658ea73fb3a7f1354
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.29.0 (2025-08-11)

Full Changelog: [v1.28.0...v1.29.0](https://github.com/Increase/increase-ruby/compare/v1.28.0...v1.29.0)

### Features

* **api:** api update ([8067d85](https://github.com/Increase/increase-ruby/commit/8067d8591d4f0a2f5a33b796a3f50fe6b5fb6c48))


### Chores

* collect metadata from type DSL ([175f631](https://github.com/Increase/increase-ruby/commit/175f6319788a5ddb8576871ce2e7db5f87474c57))
* **internal:** update comment in script ([a4ab2aa](https://github.com/Increase/increase-ruby/commit/a4ab2aa028a24748cde9280d83e4457e966b6aac))
* update @stainless-api/prism-cli to v5.15.0 ([663a03e](https://github.com/Increase/increase-ruby/commit/663a03e20f29203afbb2b8ff06aa63a0391b3afc))

## 1.28.0 (2025-08-07)

Full Changelog: [v1.27.0...v1.28.0](https://github.com/Increase/increase-ruby/compare/v1.27.0...v1.28.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
increase (1.28.0)
increase (1.29.0)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "increase", "~> 1.28.0"
gem "increase", "~> 1.29.0"
```

<!-- x-release-please-end -->
Expand Down
1 change: 1 addition & 0 deletions lib/increase/internal/type/array_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def to_sorbet_type
# @option spec [Boolean] :"nil?"
def initialize(type_info, spec = {})
@item_type_fn = Increase::Internal::Type::Converter.type_info(type_info || spec)
@meta = Increase::Internal::Type::Converter.meta_info(type_info, spec)
@nilable = spec.fetch(:nil?, false)
end

Expand Down
4 changes: 3 additions & 1 deletion lib/increase/internal/type/base_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def fields
#
# @option spec [Boolean] :"nil?"
private def add_field(name_sym, required:, type_info:, spec:)
meta = Increase::Internal::Type::Converter.meta_info(type_info, spec)
type_fn, info =
case type_info
in Proc | Increase::Internal::Type::Converter | Class
Expand Down Expand Up @@ -81,7 +82,8 @@ def fields
required: required,
nilable: nilable,
const: const,
type_fn: type_fn
type_fn: type_fn,
meta: meta
}

define_method(setter) do |value|
Expand Down
27 changes: 27 additions & 0 deletions lib/increase/internal/type/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,33 @@ def type_info(spec)
end
end

# @api private
#
# @param type_info [Hash{Symbol=>Object}, Proc, Increase::Internal::Type::Converter, Class] .
#
# @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
#
# @option type_info [Proc] :enum
#
# @option type_info [Proc] :union
#
# @option type_info [Boolean] :"nil?"
#
# @param spec [Hash{Symbol=>Object}, Proc, Increase::Internal::Type::Converter, Class] .
#
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
#
# @option spec [Proc] :enum
#
# @option spec [Proc] :union
#
# @option spec [Boolean] :"nil?"
#
# @return [Hash{Symbol=>Object}]
def meta_info(type_info, spec)
[spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?)
end

# @api private
#
# @param translate_names [Boolean]
Expand Down
1 change: 1 addition & 0 deletions lib/increase/internal/type/hash_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def to_sorbet_type
# @option spec [Boolean] :"nil?"
def initialize(type_info, spec = {})
@item_type_fn = Increase::Internal::Type::Converter.type_info(type_info || spec)
@meta = Increase::Internal::Type::Converter.meta_info(type_info, spec)
@nilable = spec.fetch(:nil?, false)
end

Expand Down
16 changes: 9 additions & 7 deletions lib/increase/internal/type/union.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ module Union
#
# All of the specified variant info for this union.
#
# @return [Array<Array(Symbol, Proc)>]
# @return [Array<Array(Symbol, Proc, Hash{Symbol=>Object})>]
private def known_variants = (@known_variants ||= [])

# @api private
#
# @return [Array<Array(Symbol, Object)>]
# @return [Array<Array(Symbol, Object, Hash{Symbol=>Object})>]
protected def derefed_variants
known_variants.map { |key, variant_fn| [key, variant_fn.call] }
known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] }
end

# All of the specified variants for this union.
#
# @return [Array<Object>]
def variants = derefed_variants.map(&:last)
def variants = derefed_variants.map { _2 }

# @api private
#
Expand All @@ -51,12 +51,13 @@ def variants = derefed_variants.map(&:last)
#
# @option spec [Boolean] :"nil?"
private def variant(key, spec = nil)
meta = Increase::Internal::Type::Converter.meta_info(nil, spec)
variant_info =
case key
in Symbol
[key, Increase::Internal::Type::Converter.type_info(spec)]
[key, Increase::Internal::Type::Converter.type_info(spec), meta]
in Proc | Increase::Internal::Type::Converter | Class | Hash
[nil, Increase::Internal::Type::Converter.type_info(key)]
[nil, Increase::Internal::Type::Converter.type_info(key), meta]
end

known_variants << variant_info
Expand All @@ -79,7 +80,8 @@ def variants = derefed_variants.map(&:last)
return nil if key == Increase::Internal::OMIT

key = key.to_sym if key.is_a?(String)
known_variants.find { |k,| k == key }&.last&.call
_, found = known_variants.find { |k,| k == key }
found&.call
else
nil
end
Expand Down
10 changes: 9 additions & 1 deletion lib/increase/models/inbound_wire_transfer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ class InboundWireTransfer < Increase::Internal::Type::BaseModel
# @return [Symbol, Increase::Models::InboundWireTransfer::Type]
required :type, enum: -> { Increase::InboundWireTransfer::Type }

# @!method initialize(id:, account_id:, account_number_id:, amount:, beneficiary_address_line1:, beneficiary_address_line2:, beneficiary_address_line3:, beneficiary_name:, beneficiary_reference:, created_at:, description:, input_message_accountability_data:, originator_address_line1:, originator_address_line2:, originator_address_line3:, originator_name:, originator_routing_number:, originator_to_beneficiary_information:, originator_to_beneficiary_information_line1:, originator_to_beneficiary_information_line2:, originator_to_beneficiary_information_line3:, originator_to_beneficiary_information_line4:, reversal:, sender_reference:, status:, type:)
# @!attribute wire_drawdown_request_id
# The wire drawdown request the inbound wire transfer is fulfilling.
#
# @return [String, nil]
required :wire_drawdown_request_id, String, nil?: true

# @!method initialize(id:, account_id:, account_number_id:, amount:, beneficiary_address_line1:, beneficiary_address_line2:, beneficiary_address_line3:, beneficiary_name:, beneficiary_reference:, created_at:, description:, input_message_accountability_data:, originator_address_line1:, originator_address_line2:, originator_address_line3:, originator_name:, originator_routing_number:, originator_to_beneficiary_information:, originator_to_beneficiary_information_line1:, originator_to_beneficiary_information_line2:, originator_to_beneficiary_information_line3:, originator_to_beneficiary_information_line4:, reversal:, sender_reference:, status:, type:, wire_drawdown_request_id:)
# Some parameter documentations has been truncated, see
# {Increase::Models::InboundWireTransfer} for more details.
#
Expand Down Expand Up @@ -224,6 +230,8 @@ class InboundWireTransfer < Increase::Internal::Type::BaseModel
# @param status [Symbol, Increase::Models::InboundWireTransfer::Status] The status of the transfer.
#
# @param type [Symbol, Increase::Models::InboundWireTransfer::Type] A constant representing the object's type. For this resource it will always be `
#
# @param wire_drawdown_request_id [String, nil] The wire drawdown request the inbound wire transfer is fulfilling.

# @see Increase::Models::InboundWireTransfer#reversal
class Reversal < Increase::Internal::Type::BaseModel
Expand Down
2 changes: 1 addition & 1 deletion lib/increase/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Increase
VERSION = "1.28.0"
VERSION = "1.29.0"
end
54 changes: 54 additions & 0 deletions rbi/increase/internal/type/converter.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,60 @@ module Increase
def self.type_info(spec)
end

# @api private
sig do
params(
type_info:
T.any(
{
const:
T.nilable(
T.any(NilClass, T::Boolean, Integer, Float, Symbol)
),
enum:
T.nilable(
T.proc.returns(
Increase::Internal::Type::Converter::Input
)
),
union:
T.nilable(
T.proc.returns(
Increase::Internal::Type::Converter::Input
)
)
},
T.proc.returns(Increase::Internal::Type::Converter::Input),
Increase::Internal::Type::Converter::Input
),
spec:
T.any(
{
const:
T.nilable(
T.any(NilClass, T::Boolean, Integer, Float, Symbol)
),
enum:
T.nilable(
T.proc.returns(
Increase::Internal::Type::Converter::Input
)
),
union:
T.nilable(
T.proc.returns(
Increase::Internal::Type::Converter::Input
)
)
},
T.proc.returns(Increase::Internal::Type::Converter::Input),
Increase::Internal::Type::Converter::Input
)
).returns(Increase::Internal::AnyHash)
end
def self.meta_info(type_info, spec)
end

# @api private
sig do
params(translate_names: T::Boolean).returns(
Expand Down
11 changes: 9 additions & 2 deletions rbi/increase/internal/type/union.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module Increase
T::Array[
[
T.nilable(Symbol),
T.proc.returns(Increase::Internal::Type::Converter::Input)
T.proc.returns(Increase::Internal::Type::Converter::Input),
Increase::Internal::AnyHash
]
]
)
Expand All @@ -25,7 +26,13 @@ module Increase
end

# @api private
sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) }
sig do
returns(
T::Array[
[T.nilable(Symbol), T.anything, Increase::Internal::AnyHash]
]
)
end
protected def derefed_variants
end

Expand Down
14 changes: 11 additions & 3 deletions rbi/increase/models/inbound_wire_transfer.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ module Increase
sig { returns(Increase::InboundWireTransfer::Type::TaggedSymbol) }
attr_accessor :type

# The wire drawdown request the inbound wire transfer is fulfilling.
sig { returns(T.nilable(String)) }
attr_accessor :wire_drawdown_request_id

# An Inbound Wire Transfer is a wire transfer initiated outside of Increase to
# your account.
sig do
Expand Down Expand Up @@ -154,7 +158,8 @@ module Increase
reversal: T.nilable(Increase::InboundWireTransfer::Reversal::OrHash),
sender_reference: T.nilable(String),
status: Increase::InboundWireTransfer::Status::OrSymbol,
type: Increase::InboundWireTransfer::Type::OrSymbol
type: Increase::InboundWireTransfer::Type::OrSymbol,
wire_drawdown_request_id: T.nilable(String)
).returns(T.attached_class)
end
def self.new(
Expand Down Expand Up @@ -215,7 +220,9 @@ module Increase
status:,
# A constant representing the object's type. For this resource it will always be
# `inbound_wire_transfer`.
type:
type:,
# The wire drawdown request the inbound wire transfer is fulfilling.
wire_drawdown_request_id:
)
end

Expand Down Expand Up @@ -247,7 +254,8 @@ module Increase
reversal: T.nilable(Increase::InboundWireTransfer::Reversal),
sender_reference: T.nilable(String),
status: Increase::InboundWireTransfer::Status::TaggedSymbol,
type: Increase::InboundWireTransfer::Type::TaggedSymbol
type: Increase::InboundWireTransfer::Type::TaggedSymbol,
wire_drawdown_request_id: T.nilable(String)
}
)
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log &
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &

# Wait for server to come online
echo -n "Waiting for server"
Expand All @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then

echo
else
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL"
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
fi
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ elif ! prism_is_running ; then
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}"
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
Expand Down
17 changes: 17 additions & 0 deletions sig/increase/internal/type/converter.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ module Increase
| Increase::Internal::Type::Converter::input spec
) -> (^-> top)

def self.meta_info: (
{
const: (nil | bool | Integer | Float | Symbol)?,
enum: ^-> Increase::Internal::Type::Converter::input?,
union: ^-> Increase::Internal::Type::Converter::input?
}
| ^-> Increase::Internal::Type::Converter::input
| Increase::Internal::Type::Converter::input type_info,
{
const: (nil | bool | Integer | Float | Symbol)?,
enum: ^-> Increase::Internal::Type::Converter::input?,
union: ^-> Increase::Internal::Type::Converter::input?
}
| ^-> Increase::Internal::Type::Converter::input
| Increase::Internal::Type::Converter::input spec
) -> ::Hash[Symbol, top]

def self.new_coerce_state: (
?translate_names: bool
) -> Increase::Internal::Type::Converter::coerce_state
Expand Down
4 changes: 2 additions & 2 deletions sig/increase/internal/type/union.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ module Increase
include Increase::Internal::Type::Converter
include Increase::Internal::Util::SorbetRuntimeSupport

private def self.known_variants: -> ::Array[[Symbol?, (^-> Increase::Internal::Type::Converter::input)]]
private def self.known_variants: -> ::Array[[Symbol?, (^-> Increase::Internal::Type::Converter::input), ::Hash[Symbol, top]]]

def self.derefed_variants: -> ::Array[[Symbol?, top]]
def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]]

def self.variants: -> ::Array[top]

Expand Down
Loading