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 @@
{
".": "0.1.0-alpha.2"
".": "0.1.0-alpha.3"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.3 (2025-02-06)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)

### Bug Fixes

* sorbet request method signatures should support default values ([#8](https://github.com/orbcorp/orb-ruby/issues/8)) ([8c16b32](https://github.com/orbcorp/orb-ruby/commit/8c16b3236ef57d2dfec07abc397460a0f8a4abb9))


### Chores

* **internal:** version bump ([#6](https://github.com/orbcorp/orb-ruby/issues/6)) ([c9eff92](https://github.com/orbcorp/orb-ruby/commit/c9eff92e7d797af0922215f92007a5eeefc4219f))

## 0.1.0-alpha.2 (2025-02-06)

Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
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:
orb (0.1.0.pre.alpha.1)
orb (0.1.0.pre.alpha.2)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion lib/orb/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def initialize(
end

timeout = opts.fetch(:timeout, @timeout).to_f.clamp((0..))
unless headers.key?("x-stainless-read-timeout") or timeout.zero?
unless headers.key?("x-stainless-read-timeout") || timeout.zero?
headers["x-stainless-read-timeout"] = timeout.to_s
end

Expand Down
32 changes: 16 additions & 16 deletions lib/orb/resources/customers/credits/ledger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ def list(customer_id, params = {})
#
# @option params [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::EntryType] :entry_type
#
# @option params [Time, nil] :expiry_date An ISO 8601 format date that identifies the origination credit block to expire
#
# @option params [Date] :target_expiry_date A future date (specified in YYYY-MM-DD format) used for expiration change,
# denoting when credits transferred (as part of a partial block expiration) should
# expire.
#
# @option params [String] :block_id The ID of the block to reverse a decrement from.
#
# @option params [String, nil] :currency The currency or custom pricing unit to use for this ledger entry. If this is a
# real-world currency, it must match the customer's invoicing currency.
#
Expand All @@ -258,8 +266,6 @@ def list(customer_id, params = {})
# @option params [Time, nil] :effective_date An ISO 8601 format date that denotes when this credit balance should become
# available for use.
#
# @option params [Time, nil] :expiry_date An ISO 8601 format date that identifies the origination credit block to expire
#
# @option params [Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, nil] :invoice_settings Passing `invoice_settings` automatically generates an invoice for the newly
# added credits. If `invoice_settings` is passed, you must specify
# per_unit_cost_basis, as the calculation of the invoice total is done on that
Expand All @@ -272,12 +278,6 @@ def list(customer_id, params = {})
# @option params [String, nil] :per_unit_cost_basis Can only be specified when entry_type=increment. How much, in the customer's
# currency, a customer paid for a single credit in this block
#
# @option params [Date] :target_expiry_date A future date (specified in YYYY-MM-DD format) used for expiration change,
# denoting when credits transferred (as part of a partial block expiration) should
# expire.
#
# @option params [String] :block_id The ID of the block to reverse a decrement from.
#
# @option params [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::VoidReason, nil] :void_reason Can only be specified when `entry_type=void`. The reason for the void.
#
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options
Expand Down Expand Up @@ -415,6 +415,14 @@ def create_entry(customer_id, params)
#
# @option params [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::EntryType] :entry_type
#
# @option params [Time, nil] :expiry_date An ISO 8601 format date that identifies the origination credit block to expire
#
# @option params [Date] :target_expiry_date A future date (specified in YYYY-MM-DD format) used for expiration change,
# denoting when credits transferred (as part of a partial block expiration) should
# expire.
#
# @option params [String] :block_id The ID of the block to reverse a decrement from.
#
# @option params [String, nil] :currency The currency or custom pricing unit to use for this ledger entry. If this is a
# real-world currency, it must match the customer's invoicing currency.
#
Expand All @@ -425,8 +433,6 @@ def create_entry(customer_id, params)
# @option params [Time, nil] :effective_date An ISO 8601 format date that denotes when this credit balance should become
# available for use.
#
# @option params [Time, nil] :expiry_date An ISO 8601 format date that identifies the origination credit block to expire
#
# @option params [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings, nil] :invoice_settings Passing `invoice_settings` automatically generates an invoice for the newly
# added credits. If `invoice_settings` is passed, you must specify
# per_unit_cost_basis, as the calculation of the invoice total is done on that
Expand All @@ -439,12 +445,6 @@ def create_entry(customer_id, params)
# @option params [String, nil] :per_unit_cost_basis Can only be specified when entry_type=increment. How much, in the customer's
# currency, a customer paid for a single credit in this block
#
# @option params [Date] :target_expiry_date A future date (specified in YYYY-MM-DD format) used for expiration change,
# denoting when credits transferred (as part of a partial block expiration) should
# expire.
#
# @option params [String] :block_id The ID of the block to reverse a decrement from.
#
# @option params [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::VoidReason, nil] :void_reason Can only be specified when `entry_type=void`. The reason for the void.
#
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options
Expand Down
50 changes: 25 additions & 25 deletions lib/orb/resources/prices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,6 @@ class Prices
#
# @option params [Orb::Models::PriceCreateParams::UnitConfig] :unit_config
#
# @option params [String, nil] :billable_metric_id The id of the billable metric for the price. Only needed if the price is
# usage-based.
#
# @option params [Boolean, nil] :billed_in_advance If the Price represents a fixed cost, the price will be billed in-advance if
# this is true, and in-arrears if this is false.
#
# @option params [Orb::Models::PriceCreateParams::BillingCycleConfiguration, nil] :billing_cycle_configuration For custom cadence: specifies the duration of the billing period in days or
# months.
#
# @option params [Float, nil] :conversion_rate The per unit conversion rate of the price currency to the invoicing currency.
#
# @option params [String, nil] :external_price_id An alias for the price.
#
# @option params [Float, nil] :fixed_price_quantity If the Price represents a fixed cost, this represents the quantity of units
# applied.
#
# @option params [String, nil] :invoice_grouping_key The property used to group this price on an invoice
#
# @option params [Orb::Models::PriceCreateParams::InvoicingCycleConfiguration, nil] :invoicing_cycle_configuration Within each billing cycle, specifies the cadence at which invoices are produced.
# If unspecified, a single invoice is produced per billing cycle.
#
# @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed
# by setting the value to `null`, and the entire metadata mapping can be cleared
# by setting `metadata` to `null`.
#
# @option params [Orb::Models::PriceCreateParams::PackageConfig] :package_config
#
# @option params [Orb::Models::PriceCreateParams::MatrixConfig] :matrix_config
Expand Down Expand Up @@ -108,6 +83,31 @@ class Prices
#
# @option params [Hash{Symbol=>Object}] :scalable_matrix_with_tiered_pricing_config
#
# @option params [String, nil] :billable_metric_id The id of the billable metric for the price. Only needed if the price is
# usage-based.
#
# @option params [Boolean, nil] :billed_in_advance If the Price represents a fixed cost, the price will be billed in-advance if
# this is true, and in-arrears if this is false.
#
# @option params [Orb::Models::PriceCreateParams::BillingCycleConfiguration, nil] :billing_cycle_configuration For custom cadence: specifies the duration of the billing period in days or
# months.
#
# @option params [Float, nil] :conversion_rate The per unit conversion rate of the price currency to the invoicing currency.
#
# @option params [String, nil] :external_price_id An alias for the price.
#
# @option params [Float, nil] :fixed_price_quantity If the Price represents a fixed cost, this represents the quantity of units
# applied.
#
# @option params [String, nil] :invoice_grouping_key The property used to group this price on an invoice
#
# @option params [Orb::Models::PriceCreateParams::InvoicingCycleConfiguration, nil] :invoicing_cycle_configuration Within each billing cycle, specifies the cadence at which invoices are produced.
# If unspecified, a single invoice is produced per billing cycle.
#
# @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed
# by setting the value to `null`, and the entire metadata mapping can be cleared
# by setting `metadata` to `null`.
#
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options
#
# @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice]
Expand Down
2 changes: 1 addition & 1 deletion lib/orb/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Orb
VERSION = "0.1.0-alpha.2"
VERSION = "0.1.0-alpha.3"
end
29 changes: 15 additions & 14 deletions rbi/lib/orb/resources/alerts.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ module Orb
).returns(Orb::Page[Orb::Models::Alert])
end
def list(
created_at_gt:,
created_at_gte:,
created_at_lt:,
created_at_lte:,
cursor:,
customer_id:,
external_customer_id:,
limit:,
subscription_id:,
created_at_gt: nil,
created_at_gte: nil,
created_at_lt: nil,
created_at_lte: nil,
cursor: nil,
customer_id: nil,
external_customer_id: nil,
limit: nil,
subscription_id: nil,
request_options: {}
); end

Expand All @@ -51,7 +51,7 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Models::Alert)
end
def create_for_customer(customer_id, currency:, type:, thresholds:, request_options: {}); end
def create_for_customer(customer_id, currency:, type:, thresholds: nil, request_options: {}); end

sig do
params(
Expand All @@ -66,7 +66,7 @@ module Orb
external_customer_id,
currency:,
type:,
thresholds:,
thresholds: nil,
request_options: {}
)
end
Expand All @@ -80,7 +80,8 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Models::Alert)
end
def create_for_subscription(subscription_id, thresholds:, type:, metric_id:, request_options: {}); end
def create_for_subscription(subscription_id, thresholds:, type:, metric_id: nil, request_options: {})
end

sig do
params(
Expand All @@ -89,7 +90,7 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Models::Alert)
end
def disable(alert_configuration_id, subscription_id:, request_options: {}); end
def disable(alert_configuration_id, subscription_id: nil, request_options: {}); end

sig do
params(
Expand All @@ -98,7 +99,7 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Models::Alert)
end
def enable(alert_configuration_id, subscription_id:, request_options: {}); end
def enable(alert_configuration_id, subscription_id: nil, request_options: {}); end

sig { params(client: Orb::Client).void }
def initialize(client:); end
Expand Down
11 changes: 9 additions & 2 deletions rbi/lib/orb/resources/coupons.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Models::Coupon)
end
def create(discount:, redemption_code:, duration_in_months:, max_redemptions:, request_options: {}); end
def create(
discount:,
redemption_code:,
duration_in_months: nil,
max_redemptions: nil,
request_options: {}
)
end

sig do
params(
Expand All @@ -26,7 +33,7 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Page[Orb::Models::Coupon])
end
def list(cursor:, limit:, redemption_code:, show_archived:, request_options: {}); end
def list(cursor: nil, limit: nil, redemption_code: nil, show_archived: nil, request_options: {}); end

sig { params(coupon_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Coupon) }
def archive(coupon_id, request_options: {}); end
Expand Down
2 changes: 1 addition & 1 deletion rbi/lib/orb/resources/coupons/subscriptions.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Page[Orb::Models::Subscription])
end
def list(coupon_id, cursor:, limit:, request_options: {}); end
def list(coupon_id, cursor: nil, limit: nil, request_options: {}); end

sig { params(client: Orb::Client).void }
def initialize(client:); end
Expand Down
4 changes: 2 additions & 2 deletions rbi/lib/orb/resources/credit_notes.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Models::CreditNote)
end
def create(line_items:, memo:, reason:, request_options: {}); end
def create(line_items:, memo: nil, reason: nil, request_options: {}); end

sig do
params(
Expand All @@ -20,7 +20,7 @@ module Orb
request_options: Orb::RequestOpts
).returns(Orb::Page[Orb::Models::CreditNote])
end
def list(cursor:, limit:, request_options: {}); end
def list(cursor: nil, limit: nil, request_options: {}); end

sig do
params(credit_note_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::CreditNote)
Expand Down
Loading
Loading