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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
doc/
sorbet/
Brewfile.lock.json
bin/tapioca
*.gem
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.7"
".": "0.1.0-alpha.8"
}
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ Style/Documentation:
# Stop RuboCop nagging about rubocop-rake.
# Ensure that RuboCop validates according to the lowest version of Ruby that we support.
AllCops:
Exclude:
- bin/*
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.0.0
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-25409f3b13e6d1d003e351fc18d248ecf3c5821cfde5f409a1d356e4fc917d8c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4dede72b827939939b5386cda07c3bc1fa2eea79901819792c1820e8531718d6.yml
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.1.0-alpha.8 (2025-02-15)

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

### Features

* **api:** api update ([#37](https://github.com/orbcorp/orb-ruby/issues/37)) ([2b667fc](https://github.com/orbcorp/orb-ruby/commit/2b667fc67c4b4cfa160e33a7c4dbcae69fc210f5))


### Chores

* **internal:** version bump ([#35](https://github.com/orbcorp/orb-ruby/issues/35)) ([9b1a8f4](https://github.com/orbcorp/orb-ruby/commit/9b1a8f4e71797f83a536ae7aae4ef4322422328d))
* switch away from `attr_accessor` annotations to better match tapioca's compilation ([#38](https://github.com/orbcorp/orb-ruby/issues/38)) ([9173dba](https://github.com/orbcorp/orb-ruby/commit/9173dba60188d34ac9f4f71a40bdb61c7f5705fe))

## 0.1.0-alpha.7 (2025-02-13)

Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ group :development do
gem "syntax_tree"
# TODO: using a fork for now, the prettier below has a bug
gem "syntax_tree-rbs", github: "stainless-api/syntax_tree-rbs", branch: "main"
gem "tapioca"
gem "webrick"
gem "yard"
end
42 changes: 37 additions & 5 deletions 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.7)
orb (0.1.0.pre.alpha.8)
connection_pool

GEM
Expand All @@ -36,6 +36,7 @@ GEM
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
csv (3.3.2)
diff-lcs (1.6.0)
drb (2.2.1)
ffi (1.17.1)
fileutils (1.7.3)
Expand All @@ -46,12 +47,13 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.5)
logger (1.6.6)
minitest (5.25.4)
minitest-focus (1.4.0)
minitest (>= 4, < 6)
minitest-hooks (1.5.2)
minitest (> 5.3)
netrc (0.11.0)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
Expand All @@ -63,6 +65,11 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbi (0.0.17)
ast
parser (>= 3.0.0)
sorbet-runtime (>= 0.5.9204)
unparser (>= 0.5.6)
rbs (3.8.1)
logger
regexp_parser (2.9.2)
Expand All @@ -80,9 +87,17 @@ GEM
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
sorbet (0.5.11823)
sorbet-static (= 0.5.11823)
sorbet-static (0.5.11823-x86_64-linux)
sorbet (0.5.11829)
sorbet-static (= 0.5.11829)
sorbet-runtime (0.5.11829)
sorbet-static (0.5.11829-x86_64-linux)
sorbet-static-and-runtime (0.5.11829)
sorbet (= 0.5.11829)
sorbet-runtime (= 0.5.11829)
spoom (1.1.16)
sorbet (>= 0.5.10187)
sorbet-runtime (>= 0.5.9204)
thor (>= 0.19.2)
steep (1.9.4)
activesupport (>= 5.1)
concurrent-ruby (>= 1.1.10)
Expand All @@ -102,14 +117,30 @@ GEM
strscan (3.1.2)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tapioca (0.11.2)
bundler (>= 1.17.3)
netrc (>= 0.11.0)
parallel (>= 1.21.0)
rbi (~> 0.0.0, >= 0.0.16)
sorbet-static-and-runtime (>= 0.5.10187)
spoom (~> 1.1.0, >= 1.1.11)
thor (>= 1.2.0)
yard-sorbet
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
unparser (0.6.15)
diff-lcs (~> 1.3)
parser (>= 3.3.0)
uri (1.0.2)
webrick (1.9.1)
yard (0.9.37)
yard-sorbet (0.9.0)
sorbet-runtime
yard

PLATFORMS
x86_64-linux
Expand All @@ -126,6 +157,7 @@ DEPENDENCIES
steep
syntax_tree
syntax_tree-rbs!
tapioca
webrick
yard

Expand Down
8 changes: 6 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ multitask(:format_rb) do
sh("#{find.shelljoin} | #{fmt.shelljoin}")
end

multitask(:format_rbs) do
multitask(:syntax_tree) do
find = %w[find ./sig -type f -name *.rbs -print0]
inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? %w[-i''] : %w[-i]
uuid = SecureRandom.uuid
Expand Down Expand Up @@ -63,7 +63,7 @@ multitask(:format_rbs) do
sh("#{find.shelljoin} | #{pst.shelljoin}")
end

multitask(format: [:format_rb, :format_rbs])
multitask(format: [:format_rb, :syntax_tree])

multitask(:steep) do
sh(*%w[steep check])
Expand All @@ -73,6 +73,10 @@ multitask(:sorbet) do
sh(*%w[srb typecheck -- .], chdir: "./rbi")
end

file("sorbet/tapioca") do
sh(*%w[tapioca init])
end

multitask(typecheck: [:steep, :sorbet])
multitask(lint: [:rubocop, :typecheck])

Expand Down
11 changes: 10 additions & 1 deletion lib/orb/models/subscription_cancel_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ class SubscriptionCancelParams < Orb::BaseModel
# @return [Symbol, Orb::Models::SubscriptionCancelParams::CancelOption]
required :cancel_option, enum: -> { Orb::Models::SubscriptionCancelParams::CancelOption }

# @!attribute allow_invoice_credit_or_void
# If false, this request will fail if it would void an issued invoice or create a
# credit note. Consider using this as a safety mechanism if you do not expect
# existing invoices to be changed.
#
# @return [Boolean, nil]
optional :allow_invoice_credit_or_void, Orb::BooleanModel, nil?: true

# @!attribute cancellation_date
# The date that the cancellation should take effect. This parameter can only be
# passed if the `cancel_option` is `requested_date`.
Expand All @@ -22,10 +30,11 @@ class SubscriptionCancelParams < Orb::BaseModel

# @!parse
# # @param cancel_option [Symbol, Orb::Models::SubscriptionCancelParams::CancelOption]
# # @param allow_invoice_credit_or_void [Boolean, nil]
# # @param cancellation_date [Time, nil]
# # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
# #
# def initialize(cancel_option:, cancellation_date: nil, request_options: {}, **) = super
# def initialize(cancel_option:, allow_invoice_credit_or_void: nil, cancellation_date: nil, request_options: {}, **) = super

# def initialize: (Hash | Orb::BaseModel) -> void

Expand Down
21 changes: 20 additions & 1 deletion lib/orb/models/subscription_price_intervals_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ class SubscriptionPriceIntervalsParams < Orb::BaseModel
# # @return [Array<Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment>]
# attr_writer :add_adjustments

# @!attribute allow_invoice_credit_or_void
# If false, this request will fail if it would void an issued invoice or create a
# credit note. Consider using this as a safety mechanism if you do not expect
# existing invoices to be changed.
#
# @return [Boolean, nil]
optional :allow_invoice_credit_or_void, Orb::BooleanModel, nil?: true

# @!attribute [r] edit
# A list of price intervals to edit on the subscription.
#
Expand All @@ -52,11 +60,22 @@ class SubscriptionPriceIntervalsParams < Orb::BaseModel
# @!parse
# # @param add [Array<Orb::Models::SubscriptionPriceIntervalsParams::Add>]
# # @param add_adjustments [Array<Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment>]
# # @param allow_invoice_credit_or_void [Boolean, nil]
# # @param edit [Array<Orb::Models::SubscriptionPriceIntervalsParams::Edit>]
# # @param edit_adjustments [Array<Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment>]
# # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
# #
# def initialize(add: nil, add_adjustments: nil, edit: nil, edit_adjustments: nil, request_options: {}, **) = super
# def initialize(
# add: nil,
# add_adjustments: nil,
# allow_invoice_credit_or_void: nil,
# edit: nil,
# edit_adjustments: nil,
# request_options: {},
# **
# )
# super
# end

# def initialize: (Hash | Orb::BaseModel) -> void

Expand Down
11 changes: 10 additions & 1 deletion lib/orb/models/subscription_trigger_phase_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ class SubscriptionTriggerPhaseParams < Orb::BaseModel
# extend Orb::RequestParameters::Converter
include Orb::RequestParameters

# @!attribute allow_invoice_credit_or_void
# If false, this request will fail if it would void an issued invoice or create a
# credit note. Consider using this as a safety mechanism if you do not expect
# existing invoices to be changed.
#
# @return [Boolean, nil]
optional :allow_invoice_credit_or_void, Orb::BooleanModel, nil?: true

# @!attribute effective_date
# The date on which the phase change should take effect. If not provided, defaults
# to today in the customer's timezone.
Expand All @@ -15,10 +23,11 @@ class SubscriptionTriggerPhaseParams < Orb::BaseModel
optional :effective_date, Date, nil?: true

# @!parse
# # @param allow_invoice_credit_or_void [Boolean, nil]
# # @param effective_date [Date, nil]
# # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
# #
# def initialize(effective_date: nil, request_options: {}, **) = super
# def initialize(allow_invoice_credit_or_void: nil, effective_date: nil, request_options: {}, **) = super

# def initialize: (Hash | Orb::BaseModel) -> void
end
Expand Down
21 changes: 20 additions & 1 deletion lib/orb/models/subscription_update_fixed_fee_quantity_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ class SubscriptionUpdateFixedFeeQuantityParams < Orb::BaseModel
# @return [Float]
required :quantity, Float

# @!attribute allow_invoice_credit_or_void
# If false, this request will fail if it would void an issued invoice or create a
# credit note. Consider using this as a safety mechanism if you do not expect
# existing invoices to be changed.
#
# @return [Boolean, nil]
optional :allow_invoice_credit_or_void, Orb::BooleanModel, nil?: true

# @!attribute [r] change_option
# Determines when the change takes effect. Note that if `effective_date` is
# specified, this defaults to `effective_date`. Otherwise, this defaults to
Expand All @@ -44,11 +52,22 @@ class SubscriptionUpdateFixedFeeQuantityParams < Orb::BaseModel
# @!parse
# # @param price_id [String]
# # @param quantity [Float]
# # @param allow_invoice_credit_or_void [Boolean, nil]
# # @param change_option [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::ChangeOption]
# # @param effective_date [Date, nil]
# # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
# #
# def initialize(price_id:, quantity:, change_option: nil, effective_date: nil, request_options: {}, **) = super
# def initialize(
# price_id:,
# quantity:,
# allow_invoice_credit_or_void: nil,
# change_option: nil,
# effective_date: nil,
# request_options: {},
# **
# )
# super
# end

# def initialize: (Hash | Orb::BaseModel) -> void

Expand Down
16 changes: 16 additions & 0 deletions lib/orb/resources/subscriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ def list(params = {})
#
# @option params [Symbol, Orb::Models::SubscriptionCancelParams::CancelOption] :cancel_option Determines the timing of subscription cancellation
#
# @option params [Boolean, nil] :allow_invoice_credit_or_void If false, this request will fail if it would void an issued invoice or create a
# credit note. Consider using this as a safety mechanism if you do not expect
# existing invoices to be changed.
#
# @option params [Time, nil] :cancellation_date The date that the cancellation should take effect. This parameter can only be
# passed if the `cancel_option` is `requested_date`.
#
Expand Down Expand Up @@ -958,6 +962,10 @@ def fetch_usage(subscription_id, params = {})
#
# @option params [Array<Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment>] :add_adjustments A list of adjustments to add to the subscription.
#
# @option params [Boolean, nil] :allow_invoice_credit_or_void If false, this request will fail if it would void an issued invoice or create a
# credit note. Consider using this as a safety mechanism if you do not expect
# existing invoices to be changed.
#
# @option params [Array<Orb::Models::SubscriptionPriceIntervalsParams::Edit>] :edit A list of price intervals to edit on the subscription.
#
# @option params [Array<Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment>] :edit_adjustments A list of adjustments to edit on the subscription.
Expand Down Expand Up @@ -1265,6 +1273,10 @@ def schedule_plan_change(subscription_id, params)
#
# @param params [Orb::Models::SubscriptionTriggerPhaseParams, Hash{Symbol=>Object}] .
#
# @option params [Boolean, nil] :allow_invoice_credit_or_void If false, this request will fail if it would void an issued invoice or create a
# credit note. Consider using this as a safety mechanism if you do not expect
# existing invoices to be changed.
#
# @option params [Date, nil] :effective_date The date on which the phase change should take effect. If not provided, defaults
# to today in the customer's timezone.
#
Expand Down Expand Up @@ -1377,6 +1389,10 @@ def unschedule_pending_plan_changes(subscription_id, params = {})
#
# @option params [Float] :quantity
#
# @option params [Boolean, nil] :allow_invoice_credit_or_void If false, this request will fail if it would void an issued invoice or create a
# credit note. Consider using this as a safety mechanism if you do not expect
# existing invoices to be changed.
#
# @option params [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::ChangeOption] :change_option Determines when the change takes effect. Note that if `effective_date` is
# specified, this defaults to `effective_date`. Otherwise, this defaults to
# `immediate` unless it's explicitly set to `upcoming_invoice.
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.7"
VERSION = "0.1.0-alpha.8"
end
9 changes: 6 additions & 3 deletions rbi/lib/orb/base_client.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ module Orb
def self.validate!(req)
end

# @private
#
sig { returns(T.anything) }
attr_accessor :requester
def requester
end

sig { params(_: T.anything).returns(T.anything) }
def requester=(_)
end

sig do
params(
Expand Down
Loading
Loading