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
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 @@
{
".": "1.14.0"
".": "1.15.0"
}
4 changes: 2 additions & 2 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-91a51960dab258d5435cc2a7f47760fd81e4b711b891a1fde3d98757e85e8add.yml
openapi_spec_hash: 192e4e94264db429260169f0b2e731ce
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb/orb-7f97a69f22372b818e8d24a72f6020bcf2f0c6d6b3ad07abb8395c87ec4a72ee.yml
openapi_spec_hash: a6261e730c54d08ad36f1b946e663fc3
config_hash: c01c1191b1cd696c7ca855ff6d28a8df
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 1.15.0 (2026-05-05)

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

### Features

* **api:** api update ([57f4509](https://github.com/orbcorp/orb-ruby/commit/57f4509e2c1e6e25913e713a33246805b8ae6474))
* **api:** api update ([745a900](https://github.com/orbcorp/orb-ruby/commit/745a900f984941c1c00951c020a74007639e18da))
* **api:** api update ([bd3d312](https://github.com/orbcorp/orb-ruby/commit/bd3d31208c279ea4d20a796494d307cad588f984))
* **api:** api update ([abb683a](https://github.com/orbcorp/orb-ruby/commit/abb683ad449e5f3c44d72e829ed8df261d5a8e62))
* **api:** api update ([bc1c5ce](https://github.com/orbcorp/orb-ruby/commit/bc1c5ceda19f8f2ee9a9459b9ac07f5cb1412b8b))
* **api:** api update ([160ea66](https://github.com/orbcorp/orb-ruby/commit/160ea66268e7608fec8a56defecb8629538e0291))
* support setting headers via env ([98a1cef](https://github.com/orbcorp/orb-ruby/commit/98a1cef742a7169b8b481020369e2dcd1f4c3493))


### Chores

* **internal:** more robust bootstrap script ([2430669](https://github.com/orbcorp/orb-ruby/commit/2430669ed45de80ddfc9f6bada96725a6de44463))
* **tests:** bump steady to v0.22.1 ([70eb623](https://github.com/orbcorp/orb-ruby/commit/70eb623e0694da153355a061b4bc059f3023f063))

## 1.14.0 (2026-04-13)

Full Changelog: [v1.13.0...v1.14.0](https://github.com/orbcorp/orb-ruby/compare/v1.13.0...v1.14.0)
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.14.0)
orb-billing (1.15.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.14.0"
gem "orb-billing", "~> 1.15.0"
```

<!-- x-release-please-end -->
Expand Down
14 changes: 14 additions & 0 deletions lib/orb/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,19 @@ def initialize(
raise ArgumentError.new("api_key is required, and can be set via environ: \"ORB_API_KEY\"")
end

headers = {}
custom_headers_env = ENV["ORB_CUSTOM_HEADERS"]
unless custom_headers_env.nil?
parsed = {}
custom_headers_env.split("\n").each do |line|
colon = line.index(":")
unless colon.nil?
parsed[line[0...colon].strip] = line[(colon + 1)..].strip
end
end
headers = parsed.merge(headers)
end

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

Expand All @@ -202,6 +215,7 @@ def initialize(
max_retries: max_retries,
initial_retry_delay: initial_retry_delay,
max_retry_delay: max_retry_delay,
headers: headers,
idempotency_header: idempotency_header
)

Expand Down
106 changes: 105 additions & 1 deletion lib/orb/models/alert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,23 @@ class Alert < Orb::Internal::Type::BaseModel
# @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, grouping_keys: nil, license_type: nil)
# @!attribute price_filters
# Filters scoping which prices are included in grouped cost alert evaluation.
#
# @return [Array<Orb::Models::Alert::PriceFilter>, nil]
optional :price_filters, -> { Orb::Internal::Type::ArrayOf[Orb::Alert::PriceFilter] }, nil?: true

# @!attribute threshold_overrides
# Per-group threshold overrides. Each override maps a specific combination of
# grouping_keys values to a replacement threshold list. Only present for grouped
# cost alerts that have at least one override.
#
# @return [Array<Orb::Models::Alert::ThresholdOverride>, nil]
optional :threshold_overrides,
-> { Orb::Internal::Type::ArrayOf[Orb::Alert::ThresholdOverride] },
nil?: true

# @!method initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:, balance_alert_status: nil, grouping_keys: nil, license_type: nil, price_filters: nil, threshold_overrides: nil)
# Some parameter documentations has been truncated, see {Orb::Models::Alert} for
# more details.
#
Expand Down Expand Up @@ -122,6 +138,10 @@ class Alert < Orb::Internal::Type::BaseModel
# @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.
#
# @param price_filters [Array<Orb::Models::Alert::PriceFilter>, nil] Filters scoping which prices are included in grouped cost alert evaluation.
#
# @param threshold_overrides [Array<Orb::Models::Alert::ThresholdOverride>, nil] Per-group threshold overrides. Each override maps a specific combination of grou

# @see Orb::Models::Alert#metric
class Metric < Orb::Internal::Type::BaseModel
Expand Down Expand Up @@ -226,6 +246,90 @@ class LicenseType < Orb::Internal::Type::BaseModel
#
# @param id [String]
end

class PriceFilter < Orb::Internal::Type::BaseModel
# @!attribute field
# The property of the price to filter on.
#
# @return [Symbol, Orb::Models::Alert::PriceFilter::Field]
required :field, enum: -> { Orb::Alert::PriceFilter::Field }

# @!attribute operator
# Should prices that match the filter be included or excluded.
#
# @return [Symbol, Orb::Models::Alert::PriceFilter::Operator]
required :operator, enum: -> { Orb::Alert::PriceFilter::Operator }

# @!attribute values
# The IDs or values that match this filter.
#
# @return [Array<String>]
required :values, Orb::Internal::Type::ArrayOf[String]

# @!method initialize(field:, operator:, values:)
# @param field [Symbol, Orb::Models::Alert::PriceFilter::Field] The property of the price to filter on.
#
# @param operator [Symbol, Orb::Models::Alert::PriceFilter::Operator] Should prices that match the filter be included or excluded.
#
# @param values [Array<String>] The IDs or values that match this filter.

# The property of the price to filter on.
#
# @see Orb::Models::Alert::PriceFilter#field
module Field
extend Orb::Internal::Type::Enum

PRICE_ID = :price_id
ITEM_ID = :item_id
PRICE_TYPE = :price_type
CURRENCY = :currency
PRICING_UNIT_ID = :pricing_unit_id

# @!method self.values
# @return [Array<Symbol>]
end

# Should prices that match the filter be included or excluded.
#
# @see Orb::Models::Alert::PriceFilter#operator
module Operator
extend Orb::Internal::Type::Enum

INCLUDES = :includes
EXCLUDES = :excludes

# @!method self.values
# @return [Array<Symbol>]
end
end

class ThresholdOverride < Orb::Internal::Type::BaseModel
# @!attribute group_values
# The values of the grouping keys that identify this group. The list length
# matches the alert's grouping_keys.
#
# @return [Array<String>]
required :group_values, Orb::Internal::Type::ArrayOf[String]

# @!attribute thresholds
# The thresholds applied to this group. An empty list means the group is silenced.
#
# @return [Array<Orb::Models::Threshold>]
required :thresholds, -> { Orb::Internal::Type::ArrayOf[Orb::Threshold] }

# @!method initialize(group_values:, thresholds:)
# Some parameter documentations has been truncated, see
# {Orb::Models::Alert::ThresholdOverride} for more details.
#
# A per-group threshold override on a grouped cost alert.
#
# An empty `thresholds` list means the group is silenced (never fires). A
# non-empty list fully replaces the default thresholds for that group.
#
# @param group_values [Array<String>] The values of the grouping keys that identify this group. The list length matche
#
# @param thresholds [Array<Orb::Models::Threshold>] The thresholds applied to this group. An empty list means the group is silenced.
end
end
end
end
115 changes: 114 additions & 1 deletion lib/orb/models/alert_create_for_subscription_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,36 @@ class AlertCreateForSubscriptionParams < Orb::Internal::Type::BaseModel
# @return [String, nil]
optional :metric_id, String, nil?: true

# @!attribute price_filters
# Filters to scope which prices are included in grouped cost alert evaluation.
# Supports filtering by price_id, item_id, or price_type with includes/excludes
# operators. Only applicable when grouping_keys is set.
#
# @return [Array<Orb::Models::AlertCreateForSubscriptionParams::PriceFilter>, nil]
optional :price_filters,
-> { Orb::Internal::Type::ArrayOf[Orb::AlertCreateForSubscriptionParams::PriceFilter] },
nil?: true

# @!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: {})
# @!attribute threshold_overrides
# Per-group threshold overrides. Each override maps a specific combination of
# grouping_keys values to a list of thresholds that fully replaces the default
# thresholds for that group. An empty thresholds list silences the group. Groups
# without an override use the default thresholds. Only applicable when
# grouping_keys is set.
#
# @return [Array<Orb::Models::AlertCreateForSubscriptionParams::ThresholdOverride>, nil]
optional :threshold_overrides,
-> { Orb::Internal::Type::ArrayOf[Orb::AlertCreateForSubscriptionParams::ThresholdOverride] },
nil?: true

# @!method initialize(subscription_id:, thresholds:, type:, grouping_keys: nil, metric_id: nil, price_filters: nil, pricing_unit_id: nil, threshold_overrides: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {Orb::Models::AlertCreateForSubscriptionParams} for more details.
#
Expand All @@ -58,8 +80,12 @@ class AlertCreateForSubscriptionParams < Orb::Internal::Type::BaseModel
#
# @param metric_id [String, nil] The metric to track usage for.
#
# @param price_filters [Array<Orb::Models::AlertCreateForSubscriptionParams::PriceFilter>, nil] Filters to scope which prices are included in grouped cost alert evaluation. Sup
#
# @param pricing_unit_id [String, nil] The pricing unit to use for grouped cost alerts. Required when grouping_keys is
#
# @param threshold_overrides [Array<Orb::Models::AlertCreateForSubscriptionParams::ThresholdOverride>, nil] Per-group threshold overrides. Each override maps a specific combination of grou
#
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]

# The type of alert to create. This must be a valid alert type.
Expand All @@ -72,6 +98,93 @@ module Type
# @!method self.values
# @return [Array<Symbol>]
end

class PriceFilter < Orb::Internal::Type::BaseModel
# @!attribute field
# The property of the price to filter on.
#
# @return [Symbol, Orb::Models::AlertCreateForSubscriptionParams::PriceFilter::Field]
required :field, enum: -> { Orb::AlertCreateForSubscriptionParams::PriceFilter::Field }

# @!attribute operator
# Should prices that match the filter be included or excluded.
#
# @return [Symbol, Orb::Models::AlertCreateForSubscriptionParams::PriceFilter::Operator]
required :operator, enum: -> { Orb::AlertCreateForSubscriptionParams::PriceFilter::Operator }

# @!attribute values
# The IDs or values that match this filter.
#
# @return [Array<String>]
required :values, Orb::Internal::Type::ArrayOf[String]

# @!method initialize(field:, operator:, values:)
# @param field [Symbol, Orb::Models::AlertCreateForSubscriptionParams::PriceFilter::Field] The property of the price to filter on.
#
# @param operator [Symbol, Orb::Models::AlertCreateForSubscriptionParams::PriceFilter::Operator] Should prices that match the filter be included or excluded.
#
# @param values [Array<String>] The IDs or values that match this filter.

# The property of the price to filter on.
#
# @see Orb::Models::AlertCreateForSubscriptionParams::PriceFilter#field
module Field
extend Orb::Internal::Type::Enum

PRICE_ID = :price_id
ITEM_ID = :item_id
PRICE_TYPE = :price_type
CURRENCY = :currency
PRICING_UNIT_ID = :pricing_unit_id

# @!method self.values
# @return [Array<Symbol>]
end

# Should prices that match the filter be included or excluded.
#
# @see Orb::Models::AlertCreateForSubscriptionParams::PriceFilter#operator
module Operator
extend Orb::Internal::Type::Enum

INCLUDES = :includes
EXCLUDES = :excludes

# @!method self.values
# @return [Array<Symbol>]
end
end

class ThresholdOverride < Orb::Internal::Type::BaseModel
# @!attribute group_values
# The values of the grouping keys that identify this group. The list length must
# match the alert's grouping_keys, and values appear in the same order as
# grouping_keys.
#
# @return [Array<String>]
required :group_values, Orb::Internal::Type::ArrayOf[String]

# @!attribute thresholds
# The thresholds to apply to this group. An empty list silences alerts for this
# group. A non-empty list fully replaces the default thresholds for this group.
#
# @return [Array<Orb::Models::Threshold>]
required :thresholds, -> { Orb::Internal::Type::ArrayOf[Orb::Threshold] }

# @!method initialize(group_values:, thresholds:)
# Some parameter documentations has been truncated, see
# {Orb::Models::AlertCreateForSubscriptionParams::ThresholdOverride} for more
# details.
#
# Per-group threshold override on a grouped cost alert.
#
# - An empty `thresholds` list silences alerts for this group (never fires).
# - A non-empty list fully replaces the default thresholds for this group.
#
# @param group_values [Array<String>] The values of the grouping keys that identify this group. The list length must m
#
# @param thresholds [Array<Orb::Models::Threshold>] The thresholds to apply to this group. An empty list silences alerts for this gr
end
end
end
end
Loading
Loading