Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 14 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -33,14 +35,18 @@ jobs:
bundle install

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/orb-ruby'
if: |-
github.repository == 'stainless-sdks/orb-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Build and upload gem artifacts
if: github.repository == 'stainless-sdks/orb-ruby'
if: |-
github.repository == 'stainless-sdks/orb-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand Down
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.13.0"
".": "1.14.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 139
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-5bb582f84f0b4cf7bef84833fefd48a5f2734dc25805da2028fd8a6f1198da07.yml
openapi_spec_hash: ced0e30dc67faa2414df511819408f12
config_hash: 3279841440b02d4e8303c961d6983492
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6b1440d47f0b1b1b92f2e40f9ad5efd301d90f66e2e05c5a932902608935aa64.yml
openapi_spec_hash: 14f386604d0d87d9459352b8a7b84eff
config_hash: c01c1191b1cd696c7ca855ff6d28a8df
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 1.14.0 (2026-03-16)

Full Changelog: [v1.13.0...v1.14.0](https://github.com/orbcorp/orb-ruby/compare/v1.13.0...v1.14.0)

### Features

* **api:** api update ([337be04](https://github.com/orbcorp/orb-ruby/commit/337be04c7a4f8abe058b0ca27becf8124badc168))
* **api:** api update ([751628a](https://github.com/orbcorp/orb-ruby/commit/751628a1843a653fdd0a8e718ed431d8ce518c24))
* **api:** api update ([eb40fda](https://github.com/orbcorp/orb-ruby/commit/eb40fdad4ce17f70dc2f315c000f0bd8c0118055))
* **api:** api update ([a865cea](https://github.com/orbcorp/orb-ruby/commit/a865cea3435365ca97c336a991cdf2c632604b24))
* **client:** add webhook support ([f434716](https://github.com/orbcorp/orb-ruby/commit/f434716cc961eae629f626c95be963e89b712c90))


### Bug Fixes

* **client:** add types for path params, and update structure of unions nested in params ([8a52368](https://github.com/orbcorp/orb-ruby/commit/8a523686305ffbee12c8f2643a37d3cab4edb5d5))


### Chores

* **ci:** skip uploading artifacts on stainless-internal branches ([21805c5](https://github.com/orbcorp/orb-ruby/commit/21805c52bfa86ecf544fdc3c5828003638d5938d))
* **internal:** tweak CI branches ([6692611](https://github.com/orbcorp/orb-ruby/commit/6692611801c9e7402ec21d5e7eb07f46d0b61951))
* **test:** do not count install time for mock server timeout ([b7ef3b3](https://github.com/orbcorp/orb-ruby/commit/b7ef3b3c4e1054a2a5db603476b57c9d3a64b860))
* **tests:** update mock server to steady ([2e5e97f](https://github.com/orbcorp/orb-ruby/commit/2e5e97f7a3cf18ad23ecef601edde222bfc62bbd))

## 1.13.0 (2026-03-03)

Full Changelog: [v1.12.0...v1.13.0](https://github.com/orbcorp/orb-ruby/compare/v1.12.0...v1.13.0)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $ bundle exec rake

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests.

```sh
$ ./scripts/mock
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 (1.13.0)
orb-billing (1.14.0)
cgi
connection_pool

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 "orb-billing", "~> 1.13.0"
gem "orb-billing", "~> 1.14.0"
```

<!-- x-release-please-end -->
Expand Down
7 changes: 7 additions & 0 deletions lib/orb/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class Client < Orb::Internal::Transport::BaseClient
# @return [String]
attr_reader :api_key

# @return [String, nil]
attr_reader :webhook_secret

# @return [Orb::Resources::TopLevel]
attr_reader :top_level

Expand Down Expand Up @@ -160,6 +163,8 @@ class Client < Orb::Internal::Transport::BaseClient
#
# @param api_key [String, nil] Defaults to `ENV["ORB_API_KEY"]`
#
# @param webhook_secret [String, nil] Defaults to `ENV["ORB_WEBHOOK_SECRET"]`
#
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
# `"https://api.example.com/v2/"`. Defaults to `ENV["ORB_BASE_URL"]`
#
Expand All @@ -174,6 +179,7 @@ class Client < Orb::Internal::Transport::BaseClient
# @param idempotency_header [String]
def initialize(
api_key: ENV["ORB_API_KEY"],
webhook_secret: ENV["ORB_WEBHOOK_SECRET"],
base_url: ENV["ORB_BASE_URL"],
max_retries: self.class::DEFAULT_MAX_RETRIES,
timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
Expand All @@ -188,6 +194,7 @@ def initialize(
end

@api_key = api_key.to_s
@webhook_secret = webhook_secret&.to_s

super(
base_url: base_url,
Expand Down
11 changes: 10 additions & 1 deletion lib/orb/models/alert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,20 @@ class Alert < Orb::Internal::Type::BaseModel
-> { Orb::Internal::Type::ArrayOf[Orb::Alert::BalanceAlertStatus] },
nil?: true

# @!attribute grouping_keys
# The property keys to group cost alerts by. Only present for cost alerts with
# grouping enabled.
#
# @return [Array<String>, nil]
optional :grouping_keys, Orb::Internal::Type::ArrayOf[String], nil?: true

# @!attribute license_type
# Minified license type for alert serialization.
#
# @return [Orb::Models::Alert::LicenseType, nil]
optional :license_type, -> { Orb::Alert::LicenseType }, nil?: true

# @!method initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:, balance_alert_status: nil, license_type: nil)
# @!method initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:, balance_alert_status: nil, grouping_keys: nil, license_type: nil)
# Some parameter documentations has been truncated, see {Orb::Models::Alert} for
# more details.
#
Expand Down Expand Up @@ -112,6 +119,8 @@ class Alert < Orb::Internal::Type::BaseModel
#
# @param balance_alert_status [Array<Orb::Models::Alert::BalanceAlertStatus>, nil] The current status of the alert. This field is only present for credit balance a
#
# @param grouping_keys [Array<String>, nil] The property keys to group cost alerts by. Only present for cost alerts with gro
#
# @param license_type [Orb::Models::Alert::LicenseType, nil] Minified license type for alert serialization.

# @see Orb::Models::Alert#metric
Expand Down
9 changes: 8 additions & 1 deletion lib/orb/models/alert_create_for_customer_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class AlertCreateForCustomerParams < Orb::Internal::Type::BaseModel
extend Orb::Internal::Type::RequestParameters::Converter
include Orb::Internal::Type::RequestParameters

# @!attribute customer_id
#
# @return [String]
required :customer_id, String

# @!attribute currency
# The case sensitive currency or custom pricing unit to use for this alert.
#
Expand All @@ -25,7 +30,9 @@ class AlertCreateForCustomerParams < Orb::Internal::Type::BaseModel
# @return [Array<Orb::Models::Threshold>, nil]
optional :thresholds, -> { Orb::Internal::Type::ArrayOf[Orb::Threshold] }, nil?: true

# @!method initialize(currency:, type:, thresholds: nil, request_options: {})
# @!method initialize(customer_id:, currency:, type:, thresholds: nil, request_options: {})
# @param customer_id [String]
#
# @param currency [String] The case sensitive currency or custom pricing unit to use for this alert.
#
# @param type [Symbol, Orb::Models::AlertCreateForCustomerParams::Type] The type of alert to create. This must be a valid alert type.
Expand Down
9 changes: 8 additions & 1 deletion lib/orb/models/alert_create_for_external_customer_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class AlertCreateForExternalCustomerParams < Orb::Internal::Type::BaseModel
extend Orb::Internal::Type::RequestParameters::Converter
include Orb::Internal::Type::RequestParameters

# @!attribute external_customer_id
#
# @return [String]
required :external_customer_id, String

# @!attribute currency
# The case sensitive currency or custom pricing unit to use for this alert.
#
Expand All @@ -25,7 +30,9 @@ class AlertCreateForExternalCustomerParams < Orb::Internal::Type::BaseModel
# @return [Array<Orb::Models::Threshold>, nil]
optional :thresholds, -> { Orb::Internal::Type::ArrayOf[Orb::Threshold] }, nil?: true

# @!method initialize(currency:, type:, thresholds: nil, request_options: {})
# @!method initialize(external_customer_id:, currency:, type:, thresholds: nil, request_options: {})
# @param external_customer_id [String]
#
# @param currency [String] The case sensitive currency or custom pricing unit to use for this alert.
#
# @param type [Symbol, Orb::Models::AlertCreateForExternalCustomerParams::Type] The type of alert to create. This must be a valid alert type.
Expand Down
30 changes: 29 additions & 1 deletion lib/orb/models/alert_create_for_subscription_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class AlertCreateForSubscriptionParams < Orb::Internal::Type::BaseModel
extend Orb::Internal::Type::RequestParameters::Converter
include Orb::Internal::Type::RequestParameters

# @!attribute subscription_id
#
# @return [String]
required :subscription_id, String

# @!attribute thresholds
# The thresholds that define the values at which the alert will be triggered.
#
Expand All @@ -19,19 +24,42 @@ class AlertCreateForSubscriptionParams < Orb::Internal::Type::BaseModel
# @return [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type]
required :type, enum: -> { Orb::AlertCreateForSubscriptionParams::Type }

# @!attribute grouping_keys
# The property keys to group cost alerts by. Only applicable for cost_exceeded
# alerts.
#
# @return [Array<String>, nil]
optional :grouping_keys, Orb::Internal::Type::ArrayOf[String], nil?: true

# @!attribute metric_id
# The metric to track usage for.
#
# @return [String, nil]
optional :metric_id, String, nil?: true

# @!method initialize(thresholds:, type:, metric_id: nil, request_options: {})
# @!attribute pricing_unit_id
# The pricing unit to use for grouped cost alerts. Required when grouping_keys is
# set.
#
# @return [String, nil]
optional :pricing_unit_id, String, nil?: true

# @!method initialize(subscription_id:, thresholds:, type:, grouping_keys: nil, metric_id: nil, pricing_unit_id: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {Orb::Models::AlertCreateForSubscriptionParams} for more details.
#
# @param subscription_id [String]
#
# @param thresholds [Array<Orb::Models::Threshold>] The thresholds that define the values at which the alert will be triggered.
#
# @param type [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] The type of alert to create. This must be a valid alert type.
#
# @param grouping_keys [Array<String>, nil] The property keys to group cost alerts by. Only applicable for cost_exceeded ale
#
# @param metric_id [String, nil] The metric to track usage for.
#
# @param pricing_unit_id [String, nil] The pricing unit to use for grouped cost alerts. Required when grouping_keys is
#
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]

# The type of alert to create. This must be a valid alert type.
Expand Down
9 changes: 8 additions & 1 deletion lib/orb/models/alert_disable_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ class AlertDisableParams < Orb::Internal::Type::BaseModel
extend Orb::Internal::Type::RequestParameters::Converter
include Orb::Internal::Type::RequestParameters

# @!attribute alert_configuration_id
#
# @return [String]
required :alert_configuration_id, String

# @!attribute subscription_id
# Used to update the status of a plan alert scoped to this subscription_id
#
# @return [String, nil]
optional :subscription_id, String, nil?: true

# @!method initialize(subscription_id: nil, request_options: {})
# @!method initialize(alert_configuration_id:, subscription_id: nil, request_options: {})
# @param alert_configuration_id [String]
#
# @param subscription_id [String, nil] Used to update the status of a plan alert scoped to this subscription_id
#
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
Expand Down
9 changes: 8 additions & 1 deletion lib/orb/models/alert_enable_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ class AlertEnableParams < Orb::Internal::Type::BaseModel
extend Orb::Internal::Type::RequestParameters::Converter
include Orb::Internal::Type::RequestParameters

# @!attribute alert_configuration_id
#
# @return [String]
required :alert_configuration_id, String

# @!attribute subscription_id
# Used to update the status of a plan alert scoped to this subscription_id
#
# @return [String, nil]
optional :subscription_id, String, nil?: true

# @!method initialize(subscription_id: nil, request_options: {})
# @!method initialize(alert_configuration_id:, subscription_id: nil, request_options: {})
# @param alert_configuration_id [String]
#
# @param subscription_id [String, nil] Used to update the status of a plan alert scoped to this subscription_id
#
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
Expand Down
8 changes: 7 additions & 1 deletion lib/orb/models/alert_retrieve_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class AlertRetrieveParams < Orb::Internal::Type::BaseModel
extend Orb::Internal::Type::RequestParameters::Converter
include Orb::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute alert_id
#
# @return [String]
required :alert_id, String

# @!method initialize(alert_id:, request_options: {})
# @param alert_id [String]
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
9 changes: 8 additions & 1 deletion lib/orb/models/alert_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ class AlertUpdateParams < Orb::Internal::Type::BaseModel
extend Orb::Internal::Type::RequestParameters::Converter
include Orb::Internal::Type::RequestParameters

# @!attribute alert_configuration_id
#
# @return [String]
required :alert_configuration_id, String

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

# @!method initialize(thresholds:, request_options: {})
# @!method initialize(alert_configuration_id:, thresholds:, request_options: {})
# @param alert_configuration_id [String]
#
# @param thresholds [Array<Orb::Models::Threshold>] The thresholds that define the values at which the alert will be triggered.
#
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
Expand Down
Loading
Loading