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.21"
".": "0.1.0-alpha.22"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a2c1aa029d1e72a5fc7d3c6cd431479888ebd9a379683a2c8630da48437baa4f.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6797b438a8e6a6856e28f4304a5a3c81bb67e74fa2d6fcc20e734880c725295a.yml
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.1.0-alpha.22 (2025-03-07)

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

### Features

* add jsonl support ([#109](https://github.com/orbcorp/orb-ruby/issues/109)) ([4ea2359](https://github.com/orbcorp/orb-ruby/commit/4ea235901520cd3474067b7269ba91dbac18a847))
* **api:** api update ([#111](https://github.com/orbcorp/orb-ruby/issues/111)) ([172e598](https://github.com/orbcorp/orb-ruby/commit/172e5983879cd507a2a31c9c903a1ab244e871dc))


### Chores

* **internal:** version bump ([#106](https://github.com/orbcorp/orb-ruby/issues/106)) ([c5992c6](https://github.com/orbcorp/orb-ruby/commit/c5992c62af1f5438f6845ce242209c69fae268b8))
* move examples into tests ([#108](https://github.com/orbcorp/orb-ruby/issues/108)) ([e6134d2](https://github.com/orbcorp/orb-ruby/commit/e6134d271d4e2949c0c314b79d195ae213dd7aef))
* support different EOLs in streaming ([#110](https://github.com/orbcorp/orb-ruby/issues/110)) ([f87af8c](https://github.com/orbcorp/orb-ruby/commit/f87af8cab1e87b87bb5adfe1cbfb51204f6ee23c))

## 0.1.0-alpha.21 (2025-03-06)

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

GEM
Expand Down
84 changes: 84 additions & 0 deletions lib/orb/base_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
in [-> { _1 <= Date || _1 <= Time }, String]
Kernel.then do
[true, target.parse(value), 1]
rescue ArgumentError, Date::Error

Check warning on line 158 in lib/orb/base_model.rb

View workflow job for this annotation

GitHub Actions / lint

Lint/ShadowedException: Do not shadow rescued Exceptions.
[false, false, 0]
end
in [_, ^target]
Expand Down Expand Up @@ -294,6 +294,31 @@
#
# We can therefore convert string values to Symbols, but can't convert other
# values safely.
#
# @example
# ```ruby
# # `billing_cycle_relative_date` is a `Orb::Models::BillingCycleRelativeDate`
# case billing_cycle_relative_date
# when Orb::Models::BillingCycleRelativeDate::START_OF_TERM
# # ...
# when Orb::Models::BillingCycleRelativeDate::END_OF_TERM
# # ...
# else
# # ...
# end
# ```
#
# @example
# ```ruby
# case billing_cycle_relative_date
# in :start_of_term
# # ...
# in :end_of_term
# # ...
# else
# # ...
# end
# ```
class Enum
extend Orb::Converter

Expand Down Expand Up @@ -369,6 +394,56 @@
#
# @abstract
#
# @example
# ```ruby
# # `discount` is a `Orb::Models::Discount`
# case discount
# when Orb::Models::PercentageDiscount
# # ...
# when Orb::Models::TrialDiscount
# # ...
# when Orb::Models::UsageDiscount
# # ...
# else
# # ...
# end
# ```
#
# @example
# ```ruby
# case discount
# in {
# discount_type: :percentage,
# applies_to_price_ids: applies_to_price_ids,
# percentage_discount: percentage_discount,
# reason: reason
# }
# # ...
# in {
# discount_type: :trial,
# applies_to_price_ids: applies_to_price_ids,
# reason: reason,
# trial_amount_discount: trial_amount_discount
# }
# # ...
# in {
# discount_type: :usage,
# applies_to_price_ids: applies_to_price_ids,
# usage_discount: usage_discount,
# reason: reason
# }
# # ...
# in {
# discount_type: :amount,
# amount_discount: amount_discount,
# applies_to_price_ids: applies_to_price_ids,
# reason: reason
# }
# # ...
# else
# # ...
# end
# ```
class Union
extend Orb::Converter

Expand Down Expand Up @@ -839,6 +914,15 @@
#
# @abstract
#
# @example
# ```ruby
# # `amount_discount` is a `Orb::Models::AmountDiscount`
# amount_discount => {
# amount_discount: amount_discount,
# applies_to_price_ids: applies_to_price_ids,
# discount_type: discount_type
# }
# ```
class BaseModel
extend Orb::Converter

Expand Down
20 changes: 2 additions & 18 deletions lib/orb/models/alert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,28 +200,12 @@ class Threshold < Orb::BaseModel
# @abstract
#
# The type of alert. This must be a valid alert type.
#
# @example
# ```ruby
# case type
# in :usage_exceeded
# # ...
# in :cost_exceeded
# # ...
# in :credit_balance_depleted
# # ...
# in :credit_balance_dropped
# # ...
# in :credit_balance_recovered
# # ...
# end
# ```
class Type < Orb::Enum
USAGE_EXCEEDED = :usage_exceeded
COST_EXCEEDED = :cost_exceeded
CREDIT_BALANCE_DEPLETED = :credit_balance_depleted
CREDIT_BALANCE_DROPPED = :credit_balance_dropped
CREDIT_BALANCE_RECOVERED = :credit_balance_recovered
USAGE_EXCEEDED = :usage_exceeded
COST_EXCEEDED = :cost_exceeded

finalize!

Expand Down
18 changes: 0 additions & 18 deletions lib/orb/models/alert_create_for_customer_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,7 @@ class AlertCreateForCustomerParams < Orb::BaseModel
# @abstract
#
# The type of alert to create. This must be a valid alert type.
#
# @example
# ```ruby
# case type
# in :usage_exceeded
# # ...
# in :cost_exceeded
# # ...
# in :credit_balance_depleted
# # ...
# in :credit_balance_dropped
# # ...
# in :credit_balance_recovered
# # ...
# end
# ```
class Type < Orb::Enum
USAGE_EXCEEDED = :usage_exceeded
COST_EXCEEDED = :cost_exceeded
CREDIT_BALANCE_DEPLETED = :credit_balance_depleted
CREDIT_BALANCE_DROPPED = :credit_balance_dropped
CREDIT_BALANCE_RECOVERED = :credit_balance_recovered
Expand Down
18 changes: 0 additions & 18 deletions lib/orb/models/alert_create_for_external_customer_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,7 @@ class AlertCreateForExternalCustomerParams < Orb::BaseModel
# @abstract
#
# The type of alert to create. This must be a valid alert type.
#
# @example
# ```ruby
# case type
# in :usage_exceeded
# # ...
# in :cost_exceeded
# # ...
# in :credit_balance_depleted
# # ...
# in :credit_balance_dropped
# # ...
# in :credit_balance_recovered
# # ...
# end
# ```
class Type < Orb::Enum
USAGE_EXCEEDED = :usage_exceeded
COST_EXCEEDED = :cost_exceeded
CREDIT_BALANCE_DEPLETED = :credit_balance_depleted
CREDIT_BALANCE_DROPPED = :credit_balance_dropped
CREDIT_BALANCE_RECOVERED = :credit_balance_recovered
Expand Down
19 changes: 0 additions & 19 deletions lib/orb/models/alert_create_for_subscription_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,9 @@ class Threshold < Orb::BaseModel
# @abstract
#
# The type of alert to create. This must be a valid alert type.
#
# @example
# ```ruby
# case type
# in :usage_exceeded
# # ...
# in :cost_exceeded
# # ...
# in :credit_balance_depleted
# # ...
# in :credit_balance_dropped
# # ...
# in :credit_balance_recovered
# # ...
# end
# ```
class Type < Orb::Enum
USAGE_EXCEEDED = :usage_exceeded
COST_EXCEEDED = :cost_exceeded
CREDIT_BALANCE_DEPLETED = :credit_balance_depleted
CREDIT_BALANCE_DROPPED = :credit_balance_dropped
CREDIT_BALANCE_RECOVERED = :credit_balance_recovered

finalize!

Expand Down
7 changes: 0 additions & 7 deletions lib/orb/models/amount_discount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ class AmountDiscount < Orb::BaseModel

# @abstract
#
# @example
# ```ruby
# case discount_type
# in :amount
# # ...
# end
# ```
class DiscountType < Orb::Enum
AMOUNT = :amount

Expand Down
11 changes: 0 additions & 11 deletions lib/orb/models/billable_metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@ class BillableMetric < Orb::BaseModel

# @abstract
#
# @example
# ```ruby
# case status
# in :active
# # ...
# in :draft
# # ...
# in :archived
# # ...
# end
# ```
class Status < Orb::Enum
ACTIVE = :active
DRAFT = :draft
Expand Down
9 changes: 0 additions & 9 deletions lib/orb/models/billing_cycle_relative_date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ module Orb
module Models
# @abstract
#
# @example
# ```ruby
# case billing_cycle_relative_date
# in :start_of_term
# # ...
# in :end_of_term
# # ...
# end
# ```
class BillingCycleRelativeDate < Orb::Enum
START_OF_TERM = :start_of_term
END_OF_TERM = :end_of_term
Expand Down
24 changes: 0 additions & 24 deletions lib/orb/models/coupon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,6 @@ class Coupon < Orb::BaseModel

# @abstract
#
# @example
# ```ruby
# case discount
# in {
# discount_type: "percentage",
# applies_to_price_ids: ^(Orb::ArrayOf[String]),
# percentage_discount: Float,
# reason: String
# }
# # Orb::Models::PercentageDiscount ...
# in {discount_type: "amount", amount_discount: String, applies_to_price_ids: ^(Orb::ArrayOf[String]), reason: String}
# # Orb::Models::AmountDiscount ...
# end
# ```
#
# @example
# ```ruby
# case discount
# in Orb::Models::PercentageDiscount
# # ...
# in Orb::Models::AmountDiscount
# # ...
# end
# ```
class Discount < Orb::Union
discriminator :discount_type

Expand Down
19 changes: 0 additions & 19 deletions lib/orb/models/coupon_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,6 @@ class CouponCreateParams < Orb::BaseModel

# @abstract
#
# @example
# ```ruby
# case discount
# in {discount_type: "percentage", percentage_discount: Float}
# # Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount ...
# in {discount_type: "amount", amount_discount: String}
# # Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount ...
# end
# ```
#
# @example
# ```ruby
# case discount
# in Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount
# # ...
# in Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount
# # ...
# end
# ```
class Discount < Orb::Union
discriminator :discount_type

Expand Down
Loading
Loading