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.5.2"
".": "0.5.3"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.5.3 (2025-05-22)

Full Changelog: [v0.5.2...v0.5.3](https://github.com/orbcorp/orb-ruby/compare/v0.5.2...v0.5.3)

### Chores

* **docs:** grammar improvements ([3c1a4d4](https://github.com/orbcorp/orb-ruby/commit/3c1a4d421f276c01935659d401c8383470f2f10c))
* force utf-8 locale via `RUBYOPT` when formatting ([42a4919](https://github.com/orbcorp/orb-ruby/commit/42a49195c6ea42836d56e130113158c013f4d5d7))
* **internal:** version bump ([1decdd2](https://github.com/orbcorp/orb-ruby/commit/1decdd2778f75a19da2218937d4a4f6a44009b84))
* refine Yard and Sorbet types and ensure linting is turned on for examples ([8ec00ad](https://github.com/orbcorp/orb-ruby/commit/8ec00ad8007fa9ff78d8c479eb592f3083da8ad9))
* use fully qualified names for yard annotations and rbs aliases ([22efb17](https://github.com/orbcorp/orb-ruby/commit/22efb17c873701d2d583c9c517a128128b1bd4d5))

## 0.5.2 (2025-05-20)

Full Changelog: [v0.5.1...v0.5.2](https://github.com/orbcorp/orb-ruby/compare/v0.5.1...v0.5.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-billing (0.5.1)
orb-billing (0.5.2)
connection_pool

GEM
Expand Down
8 changes: 4 additions & 4 deletions 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 "orb-billing", "~> 0.5.2"
gem "orb-billing", "~> 0.5.3"
```

<!-- x-release-please-end -->
Expand Down Expand Up @@ -180,7 +180,7 @@ puts(customer[:my_undocumented_property])

#### Undocumented request params

If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request as seen in examples above.
If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.

#### Undocumented endpoints

Expand All @@ -198,7 +198,7 @@ response = client.request(

### Concurrency & connection pooling

The `Orb::Client` instances are threadsafe, but only are fork-safe when there are no in-flight HTTP requests.
The `Orb::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.

Each instance of `Orb::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.

Expand Down Expand Up @@ -248,7 +248,7 @@ orb.credit_notes.create(
# …
)

# Literal values is also permissible:
# Literal values are also permissible:
orb.credit_notes.create(
reason: :duplicate,
# …
Expand Down
19 changes: 11 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require "rake/clean"
require "rubocop/rake_task"

tapioca = "sorbet/tapioca"
examples = "examples"
ignore_file = ".ignore"

CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/], *FileList["*.gem"], ignore_file)
Expand All @@ -35,11 +36,11 @@ multitask(:test) do
end

xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
locale = {"LC_ALL" => "C.UTF-8"}
ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")}

desc("Lint `*.rb(i)`")
multitask(:"lint:rubocop") do
find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0]
find = %w[find ./lib ./test ./rbi ./examples -type f -and ( -name *.rb -or -name *.rbi ) -print0]

rubocop = %w[rubocop]
rubocop += %w[--format github] if ENV.key?("CI")
Expand All @@ -54,7 +55,7 @@ end
desc("Format `*.rb`")
multitask(:"format:rb") do
# while `syntax_tree` is much faster than `rubocop`, `rubocop` is the only formatter with full syntax support
find = %w[find ./lib ./test -type f -and -name *.rb -print0]
find = %w[find ./lib ./test ./examples -type f -and -name *.rb -print0]
fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --]
sh("#{find.shelljoin} | #{fmt.shelljoin}")
end
Expand All @@ -63,7 +64,7 @@ desc("Format `*.rbi`")
multitask(:"format:rbi") do
find = %w[find ./rbi -type f -and -name *.rbi -print0]
fmt = xargs + %w[stree write --]
sh(locale, "#{find.shelljoin} | #{fmt.shelljoin}")
sh(ruby_opt, "#{find.shelljoin} | #{fmt.shelljoin}")
end

desc("Format `*.rbs`")
Expand Down Expand Up @@ -99,7 +100,7 @@ multitask(:"format:rbs") do
# transform class aliases to type aliases, which syntax tree has no trouble with
sh("#{find.shelljoin} | #{pre.shelljoin}")
# run syntax tree to format `*.rbs` files
sh(locale, "#{find.shelljoin} | #{fmt.shelljoin}") do
sh(ruby_opt, "#{find.shelljoin} | #{fmt.shelljoin}") do
success = _1
end
# transform type aliases back to class aliases
Expand All @@ -117,12 +118,14 @@ multitask(:"typecheck:steep") do
sh(*%w[steep check])
end

directory(examples)

desc("Typecheck `*.rbi`")
multitask(:"typecheck:sorbet") do
sh(*%w[srb typecheck])
multitask("typecheck:sorbet": examples) do
sh(*%w[srb typecheck --dir], examples)
end

file(tapioca) do
directory(tapioca) do
sh(*%w[tapioca init])
end

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Orb please follow the respective company's security reporting guidelines.
or products provided by Orb, please follow the respective company's security reporting guidelines.

### Orb Terms and Policies

Please contact team@withorb.com for any questions or concerns regarding security of our services.
Please contact team@withorb.com for any questions or concerns regarding the security of our services.

---

Expand Down
3 changes: 3 additions & 0 deletions lib/orb/internal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ module Internal
define_sorbet_constant!(:AnyHash) do
T.type_alias { T::Hash[Symbol, T.anything] }
end
define_sorbet_constant!(:FileInput) do
T.type_alias { T.any(Pathname, StringIO, IO, String, Orb::FilePart) }
end
end
end
46 changes: 23 additions & 23 deletions lib/orb/models/alert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Alert < Orb::Internal::Type::BaseModel
# @!attribute customer
# The customer the alert applies to.
#
# @return [Orb::Alert::Customer, nil]
# @return [Orb::Models::Alert::Customer, nil]
required :customer, -> { Orb::Alert::Customer }, nil?: true

# @!attribute enabled
Expand All @@ -37,37 +37,37 @@ class Alert < Orb::Internal::Type::BaseModel
# @!attribute metric
# The metric the alert applies to.
#
# @return [Orb::Alert::Metric, nil]
# @return [Orb::Models::Alert::Metric, nil]
required :metric, -> { Orb::Alert::Metric }, nil?: true

# @!attribute plan
# The plan the alert applies to.
#
# @return [Orb::Alert::Plan, nil]
# @return [Orb::Models::Alert::Plan, nil]
required :plan, -> { Orb::Alert::Plan }, nil?: true

# @!attribute subscription
# The subscription the alert applies to.
#
# @return [Orb::Alert::Subscription, nil]
# @return [Orb::Models::Alert::Subscription, nil]
required :subscription, -> { Orb::Alert::Subscription }, nil?: true

# @!attribute thresholds
# The thresholds that define the conditions under which the alert will be
# triggered.
#
# @return [Array<Orb::Alert::Threshold>, nil]
# @return [Array<Orb::Models::Alert::Threshold>, nil]
required :thresholds, -> { Orb::Internal::Type::ArrayOf[Orb::Alert::Threshold] }, nil?: true

# @!attribute type
# The type of alert. This must be a valid alert type.
#
# @return [Symbol, Orb::Alert::Type]
# @return [Symbol, Orb::Models::Alert::Type]
required :type, enum: -> { Orb::Alert::Type }

# @!method initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:)
# Some parameter documentations has been truncated, see {Orb::Alert} for more
# details.
# Some parameter documentations has been truncated, see {Orb::Models::Alert} for
# more details.
#
# [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
# usage, or credit balance and trigger webhooks when a threshold is exceeded.
Expand All @@ -81,21 +81,21 @@ class Alert < Orb::Internal::Type::BaseModel
#
# @param currency [String, nil] The name of the currency the credit balance or invoice cost is denominated in.
#
# @param customer [Orb::Alert::Customer, nil] The customer the alert applies to.
# @param customer [Orb::Models::Alert::Customer, nil] The customer the alert applies to.
#
# @param enabled [Boolean] Whether the alert is enabled or disabled.
#
# @param metric [Orb::Alert::Metric, nil] The metric the alert applies to.
# @param metric [Orb::Models::Alert::Metric, nil] The metric the alert applies to.
#
# @param plan [Orb::Alert::Plan, nil] The plan the alert applies to.
# @param plan [Orb::Models::Alert::Plan, nil] The plan the alert applies to.
#
# @param subscription [Orb::Alert::Subscription, nil] The subscription the alert applies to.
# @param subscription [Orb::Models::Alert::Subscription, nil] The subscription the alert applies to.
#
# @param thresholds [Array<Orb::Alert::Threshold>, nil] The thresholds that define the conditions under which the alert will be triggere
# @param thresholds [Array<Orb::Models::Alert::Threshold>, nil] The thresholds that define the conditions under which the alert will be triggere
#
# @param type [Symbol, Orb::Alert::Type] The type of alert. This must be a valid alert type.
# @param type [Symbol, Orb::Models::Alert::Type] The type of alert. This must be a valid alert type.

# @see Orb::Alert#customer
# @see Orb::Models::Alert#customer
class Customer < Orb::Internal::Type::BaseModel
# @!attribute id
#
Expand All @@ -114,7 +114,7 @@ class Customer < Orb::Internal::Type::BaseModel
# @param external_customer_id [String, nil]
end

# @see Orb::Alert#metric
# @see Orb::Models::Alert#metric
class Metric < Orb::Internal::Type::BaseModel
# @!attribute id
#
Expand All @@ -127,7 +127,7 @@ class Metric < Orb::Internal::Type::BaseModel
# @param id [String]
end

# @see Orb::Alert#plan
# @see Orb::Models::Alert#plan
class Plan < Orb::Internal::Type::BaseModel
# @!attribute id
#
Expand All @@ -153,8 +153,8 @@ class Plan < Orb::Internal::Type::BaseModel
required :plan_version, String

# @!method initialize(id:, external_plan_id:, name:, plan_version:)
# Some parameter documentations has been truncated, see {Orb::Alert::Plan} for
# more details.
# Some parameter documentations has been truncated, see {Orb::Models::Alert::Plan}
# for more details.
#
# The plan the alert applies to.
#
Expand All @@ -167,7 +167,7 @@ class Plan < Orb::Internal::Type::BaseModel
# @param plan_version [String]
end

# @see Orb::Alert#subscription
# @see Orb::Models::Alert#subscription
class Subscription < Orb::Internal::Type::BaseModel
# @!attribute id
#
Expand All @@ -190,8 +190,8 @@ class Threshold < Orb::Internal::Type::BaseModel
required :value, Float

# @!method initialize(value:)
# Some parameter documentations has been truncated, see {Orb::Alert::Threshold}
# for more details.
# Some parameter documentations has been truncated, see
# {Orb::Models::Alert::Threshold} for more details.
#
# Thresholds are used to define the conditions under which an alert will be
# triggered.
Expand All @@ -201,7 +201,7 @@ class Threshold < Orb::Internal::Type::BaseModel

# The type of alert. This must be a valid alert type.
#
# @see Orb::Alert#type
# @see Orb::Models::Alert#type
module Type
extend Orb::Internal::Type::Enum

Expand Down
10 changes: 5 additions & 5 deletions lib/orb/models/alert_create_for_customer_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ class AlertCreateForCustomerParams < Orb::Internal::Type::BaseModel
# @!attribute type
# The type of alert to create. This must be a valid alert type.
#
# @return [Symbol, Orb::AlertCreateForCustomerParams::Type]
# @return [Symbol, Orb::Models::AlertCreateForCustomerParams::Type]
required :type, enum: -> { Orb::AlertCreateForCustomerParams::Type }

# @!attribute thresholds
# The thresholds that define the values at which the alert will be triggered.
#
# @return [Array<Orb::AlertCreateForCustomerParams::Threshold>, nil]
# @return [Array<Orb::Models::AlertCreateForCustomerParams::Threshold>, nil]
optional :thresholds,
-> { Orb::Internal::Type::ArrayOf[Orb::AlertCreateForCustomerParams::Threshold] },
nil?: true

# @!method initialize(currency:, type:, thresholds: nil, request_options: {})
# @param currency [String] The case sensitive currency or custom pricing unit to use for this alert.
#
# @param type [Symbol, Orb::AlertCreateForCustomerParams::Type] The type of alert to create. This must be a valid alert type.
# @param type [Symbol, Orb::Models::AlertCreateForCustomerParams::Type] The type of alert to create. This must be a valid alert type.
#
# @param thresholds [Array<Orb::AlertCreateForCustomerParams::Threshold>, nil] The thresholds that define the values at which the alert will be triggered.
# @param thresholds [Array<Orb::Models::AlertCreateForCustomerParams::Threshold>, nil] The thresholds that define the values at which the alert will be triggered.
#
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]

Expand All @@ -59,7 +59,7 @@ class Threshold < Orb::Internal::Type::BaseModel

# @!method initialize(value:)
# Some parameter documentations has been truncated, see
# {Orb::AlertCreateForCustomerParams::Threshold} for more details.
# {Orb::Models::AlertCreateForCustomerParams::Threshold} for more details.
#
# Thresholds are used to define the conditions under which an alert will be
# triggered.
Expand Down
10 changes: 5 additions & 5 deletions lib/orb/models/alert_create_for_external_customer_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ class AlertCreateForExternalCustomerParams < Orb::Internal::Type::BaseModel
# @!attribute type
# The type of alert to create. This must be a valid alert type.
#
# @return [Symbol, Orb::AlertCreateForExternalCustomerParams::Type]
# @return [Symbol, Orb::Models::AlertCreateForExternalCustomerParams::Type]
required :type, enum: -> { Orb::AlertCreateForExternalCustomerParams::Type }

# @!attribute thresholds
# The thresholds that define the values at which the alert will be triggered.
#
# @return [Array<Orb::AlertCreateForExternalCustomerParams::Threshold>, nil]
# @return [Array<Orb::Models::AlertCreateForExternalCustomerParams::Threshold>, nil]
optional :thresholds,
-> { Orb::Internal::Type::ArrayOf[Orb::AlertCreateForExternalCustomerParams::Threshold] },
nil?: true

# @!method initialize(currency:, type:, thresholds: nil, request_options: {})
# @param currency [String] The case sensitive currency or custom pricing unit to use for this alert.
#
# @param type [Symbol, Orb::AlertCreateForExternalCustomerParams::Type] The type of alert to create. This must be a valid alert type.
# @param type [Symbol, Orb::Models::AlertCreateForExternalCustomerParams::Type] The type of alert to create. This must be a valid alert type.
#
# @param thresholds [Array<Orb::AlertCreateForExternalCustomerParams::Threshold>, nil] The thresholds that define the values at which the alert will be triggered.
# @param thresholds [Array<Orb::Models::AlertCreateForExternalCustomerParams::Threshold>, nil] The thresholds that define the values at which the alert will be triggered.
#
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]

Expand All @@ -59,7 +59,7 @@ class Threshold < Orb::Internal::Type::BaseModel

# @!method initialize(value:)
# Some parameter documentations has been truncated, see
# {Orb::AlertCreateForExternalCustomerParams::Threshold} for more details.
# {Orb::Models::AlertCreateForExternalCustomerParams::Threshold} for more details.
#
# Thresholds are used to define the conditions under which an alert will be
# triggered.
Expand Down
Loading