orb-billing 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8881d5c5ce3ce2170690cbd58bf18eb722b2cee0947b4678045716d63e8a0e9
4
- data.tar.gz: 6d9b9c876db25a171ade9ec9631384299cece32bc5a505e24187df19b4621b4b
3
+ metadata.gz: 19227e347dfaaa00a58f6ad54abae076fe861aee72c03197b0270a9e17423ed1
4
+ data.tar.gz: 129c2a00adaad2e94eec77ad9901c9bb18668218babfe5047c92e424a460cbdc
5
5
  SHA512:
6
- metadata.gz: cbc021724838465722a00f5148f8296de933ef9ea525172aa26a093c9ce2bb148dd3a85a6649e8030490721182c2c2b476b00f5739e50bfd6cfcda7c950807ef
7
- data.tar.gz: b37b6815005f069aa35c06559e812669260bd3676ca12f33a92ca6e793178459851ad971c41e9d1a48a200404c4587df6ff38f183eda80ad572c7648b0203a9a
6
+ metadata.gz: '07380ab667d49def185a414eb23da60ddc3f347cbda0e932887779666c10da8bc0d14387fc14b70ea2dda4fa6e1e7c16a40364dfc71ca40667a6c1c51364930c'
7
+ data.tar.gz: 14dd81c7cda0f7c9316e24cbc4a20de7c82430b061ae8a187d6f7b6cd73a9c64caea83dbad0b45d6bcc3674da17fbcb64b4346fa1a3b1212fc963e889a1d3087
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.23.0](https://github.com/orbcorp/orb-ruby/compare/v1.22.0...v1.23.0) (2026-07-26)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add `spend_exceeded` alert type for subscription-level alerts ([4a1374f](https://github.com/orbcorp/orb-ruby/commit/4a1374f023cc38e9d419406d91d2df5fb7a81542))
9
+
3
10
  ## [1.22.0](https://github.com/orbcorp/orb-ruby/compare/v1.21.0...v1.22.0) (2026-07-25)
4
11
 
5
12
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "orb-billing", "~> 1.22.0"
18
+ gem "orb-billing", "~> 1.23.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -207,6 +207,7 @@ module Orb
207
207
  CREDIT_BALANCE_RECOVERED = :credit_balance_recovered
208
208
  USAGE_EXCEEDED = :usage_exceeded
209
209
  COST_EXCEEDED = :cost_exceeded
210
+ SPEND_EXCEEDED = :spend_exceeded
210
211
  LICENSE_BALANCE_THRESHOLD_REACHED = :license_balance_threshold_reached
211
212
 
212
213
  # @!method self.values
@@ -25,8 +25,8 @@ module Orb
25
25
  required :type, enum: -> { Orb::AlertCreateForSubscriptionParams::Type }
26
26
 
27
27
  # @!attribute currency
28
- # The case sensitive currency or custom pricing unit to use for grouped cost
29
- # alerts. Required when grouping_keys is set.
28
+ # The case sensitive currency or custom pricing unit the alert is denominated in.
29
+ # Required for spend_exceeded alerts and when grouping_keys is set.
30
30
  #
31
31
  # @return [String, nil]
32
32
  optional :currency, String, nil?: true
@@ -45,9 +45,10 @@ module Orb
45
45
  optional :metric_id, String, nil?: true
46
46
 
47
47
  # @!attribute price_filters
48
- # Filters to scope which prices are included in grouped cost alert evaluation.
49
- # Supports filtering by price_id, item_id, or price_type with includes/excludes
50
- # operators. Only applicable when grouping_keys is set.
48
+ # Filters to scope which prices are included in alert evaluation. Supports
49
+ # filtering by price_id, item_id, or price_type with includes/excludes operators.
50
+ # Only applicable to spend_exceeded alerts and to cost_exceeded alerts with
51
+ # grouping_keys set.
51
52
  #
52
53
  # @return [Array<Orb::Models::AlertCreateForSubscriptionParams::PriceFilter>, nil]
53
54
  optional :price_filters,
@@ -76,13 +77,13 @@ module Orb
76
77
  #
77
78
  # @param type [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] The type of alert to create. This must be a valid alert type.
78
79
  #
79
- # @param currency [String, nil] The case sensitive currency or custom pricing unit to use for grouped cost alert
80
+ # @param currency [String, nil] The case sensitive currency or custom pricing unit the alert is denominated in.
80
81
  #
81
82
  # @param grouping_keys [Array<String>, nil] The property keys to group cost alerts by. Only applicable for cost_exceeded ale
82
83
  #
83
84
  # @param metric_id [String, nil] The metric to track usage for.
84
85
  #
85
- # @param price_filters [Array<Orb::Models::AlertCreateForSubscriptionParams::PriceFilter>, nil] Filters to scope which prices are included in grouped cost alert evaluation. Sup
86
+ # @param price_filters [Array<Orb::Models::AlertCreateForSubscriptionParams::PriceFilter>, nil] Filters to scope which prices are included in alert evaluation. Supports filteri
86
87
  #
87
88
  # @param threshold_overrides [Array<Orb::Models::AlertCreateForSubscriptionParams::ThresholdOverride>, nil] Per-group threshold overrides. Each override maps a specific combination of grou
88
89
  #
@@ -94,6 +95,7 @@ module Orb
94
95
 
95
96
  USAGE_EXCEEDED = :usage_exceeded
96
97
  COST_EXCEEDED = :cost_exceeded
98
+ SPEND_EXCEEDED = :spend_exceeded
97
99
 
98
100
  # @!method self.values
99
101
  # @return [Array<Symbol>]
@@ -217,15 +217,18 @@ module Orb
217
217
  #
218
218
  # This endpoint is used to create alerts at the subscription level.
219
219
  #
220
- # Subscription level alerts can be one of two types: `usage_exceeded` or
221
- # `cost_exceeded`. A `usage_exceeded` alert is scoped to a particular metric and
222
- # is triggered when the usage of that metric exceeds predefined thresholds during
223
- # the current billing cycle. A `cost_exceeded` alert is triggered when the total
224
- # amount due during the current billing cycle surpasses predefined thresholds.
225
- # `cost_exceeded` alerts do not include burndown of pre-purchase credits. Each
220
+ # Subscription level alerts can be one of three types: `usage_exceeded`,
221
+ # `cost_exceeded`, or `spend_exceeded`. A `usage_exceeded` alert is scoped to a
222
+ # particular metric and is triggered when the usage of that metric exceeds
223
+ # predefined thresholds during the current billing cycle. A `cost_exceeded` alert
224
+ # is triggered when the total amount due during the current billing cycle
225
+ # surpasses predefined thresholds. `cost_exceeded` alerts do not include burndown
226
+ # of pre-purchase credits. A `spend_exceeded` alert is triggered when the rated
227
+ # spend (the pricing subtotal, before invoice-level adjustments and credits)
228
+ # denominated in the alert's currency exceeds predefined thresholds during the
229
+ # current billing cycle; `price_filters` can scope which prices contribute. Each
226
230
  # subscription can have one `cost_exceeded` alert and one `usage_exceeded` alert
227
- # per metric that is a part of the subscription. Alerts are triggered based on
228
- # usage or cost conditions met during the current billing cycle.
231
+ # per metric that is a part of the subscription.
229
232
  #
230
233
  # @overload create_for_subscription(subscription_id, thresholds:, type:, currency: nil, grouping_keys: nil, metric_id: nil, price_filters: nil, threshold_overrides: nil, request_options: {})
231
234
  #
@@ -235,13 +238,13 @@ module Orb
235
238
  #
236
239
  # @param type [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] The type of alert to create. This must be a valid alert type.
237
240
  #
238
- # @param currency [String, nil] The case sensitive currency or custom pricing unit to use for grouped cost alert
241
+ # @param currency [String, nil] The case sensitive currency or custom pricing unit the alert is denominated in.
239
242
  #
240
243
  # @param grouping_keys [Array<String>, nil] The property keys to group cost alerts by. Only applicable for cost_exceeded ale
241
244
  #
242
245
  # @param metric_id [String, nil] The metric to track usage for.
243
246
  #
244
- # @param price_filters [Array<Orb::Models::AlertCreateForSubscriptionParams::PriceFilter>, nil] Filters to scope which prices are included in grouped cost alert evaluation. Sup
247
+ # @param price_filters [Array<Orb::Models::AlertCreateForSubscriptionParams::PriceFilter>, nil] Filters to scope which prices are included in alert evaluation. Supports filteri
245
248
  #
246
249
  # @param threshold_overrides [Array<Orb::Models::AlertCreateForSubscriptionParams::ThresholdOverride>, nil] Per-group threshold overrides. Each override maps a specific combination of grou
247
250
  #
data/lib/orb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orb
4
- VERSION = "1.22.0"
4
+ VERSION = "1.23.0"
5
5
  end
@@ -265,6 +265,7 @@ module Orb
265
265
  T.let(:credit_balance_recovered, Orb::Alert::Type::TaggedSymbol)
266
266
  USAGE_EXCEEDED = T.let(:usage_exceeded, Orb::Alert::Type::TaggedSymbol)
267
267
  COST_EXCEEDED = T.let(:cost_exceeded, Orb::Alert::Type::TaggedSymbol)
268
+ SPEND_EXCEEDED = T.let(:spend_exceeded, Orb::Alert::Type::TaggedSymbol)
268
269
  LICENSE_BALANCE_THRESHOLD_REACHED =
269
270
  T.let(
270
271
  :license_balance_threshold_reached,
@@ -22,8 +22,8 @@ module Orb
22
22
  sig { returns(Orb::AlertCreateForSubscriptionParams::Type::OrSymbol) }
23
23
  attr_accessor :type
24
24
 
25
- # The case sensitive currency or custom pricing unit to use for grouped cost
26
- # alerts. Required when grouping_keys is set.
25
+ # The case sensitive currency or custom pricing unit the alert is denominated in.
26
+ # Required for spend_exceeded alerts and when grouping_keys is set.
27
27
  sig { returns(T.nilable(String)) }
28
28
  attr_accessor :currency
29
29
 
@@ -36,9 +36,10 @@ module Orb
36
36
  sig { returns(T.nilable(String)) }
37
37
  attr_accessor :metric_id
38
38
 
39
- # Filters to scope which prices are included in grouped cost alert evaluation.
40
- # Supports filtering by price_id, item_id, or price_type with includes/excludes
41
- # operators. Only applicable when grouping_keys is set.
39
+ # Filters to scope which prices are included in alert evaluation. Supports
40
+ # filtering by price_id, item_id, or price_type with includes/excludes operators.
41
+ # Only applicable to spend_exceeded alerts and to cost_exceeded alerts with
42
+ # grouping_keys set.
42
43
  sig do
43
44
  returns(
44
45
  T.nilable(
@@ -91,17 +92,18 @@ module Orb
91
92
  thresholds:,
92
93
  # The type of alert to create. This must be a valid alert type.
93
94
  type:,
94
- # The case sensitive currency or custom pricing unit to use for grouped cost
95
- # alerts. Required when grouping_keys is set.
95
+ # The case sensitive currency or custom pricing unit the alert is denominated in.
96
+ # Required for spend_exceeded alerts and when grouping_keys is set.
96
97
  currency: nil,
97
98
  # The property keys to group cost alerts by. Only applicable for cost_exceeded
98
99
  # alerts.
99
100
  grouping_keys: nil,
100
101
  # The metric to track usage for.
101
102
  metric_id: nil,
102
- # Filters to scope which prices are included in grouped cost alert evaluation.
103
- # Supports filtering by price_id, item_id, or price_type with includes/excludes
104
- # operators. Only applicable when grouping_keys is set.
103
+ # Filters to scope which prices are included in alert evaluation. Supports
104
+ # filtering by price_id, item_id, or price_type with includes/excludes operators.
105
+ # Only applicable to spend_exceeded alerts and to cost_exceeded alerts with
106
+ # grouping_keys set.
105
107
  price_filters: nil,
106
108
  # Per-group threshold overrides. Each override maps a specific combination of
107
109
  # grouping_keys values to a list of thresholds that fully replaces the default
@@ -159,6 +161,11 @@ module Orb
159
161
  :cost_exceeded,
160
162
  Orb::AlertCreateForSubscriptionParams::Type::TaggedSymbol
161
163
  )
164
+ SPEND_EXCEEDED =
165
+ T.let(
166
+ :spend_exceeded,
167
+ Orb::AlertCreateForSubscriptionParams::Type::TaggedSymbol
168
+ )
162
169
 
163
170
  sig do
164
171
  override.returns(
@@ -169,15 +169,18 @@ module Orb
169
169
 
170
170
  # This endpoint is used to create alerts at the subscription level.
171
171
  #
172
- # Subscription level alerts can be one of two types: `usage_exceeded` or
173
- # `cost_exceeded`. A `usage_exceeded` alert is scoped to a particular metric and
174
- # is triggered when the usage of that metric exceeds predefined thresholds during
175
- # the current billing cycle. A `cost_exceeded` alert is triggered when the total
176
- # amount due during the current billing cycle surpasses predefined thresholds.
177
- # `cost_exceeded` alerts do not include burndown of pre-purchase credits. Each
172
+ # Subscription level alerts can be one of three types: `usage_exceeded`,
173
+ # `cost_exceeded`, or `spend_exceeded`. A `usage_exceeded` alert is scoped to a
174
+ # particular metric and is triggered when the usage of that metric exceeds
175
+ # predefined thresholds during the current billing cycle. A `cost_exceeded` alert
176
+ # is triggered when the total amount due during the current billing cycle
177
+ # surpasses predefined thresholds. `cost_exceeded` alerts do not include burndown
178
+ # of pre-purchase credits. A `spend_exceeded` alert is triggered when the rated
179
+ # spend (the pricing subtotal, before invoice-level adjustments and credits)
180
+ # denominated in the alert's currency exceeds predefined thresholds during the
181
+ # current billing cycle; `price_filters` can scope which prices contribute. Each
178
182
  # subscription can have one `cost_exceeded` alert and one `usage_exceeded` alert
179
- # per metric that is a part of the subscription. Alerts are triggered based on
180
- # usage or cost conditions met during the current billing cycle.
183
+ # per metric that is a part of the subscription.
181
184
  sig do
182
185
  params(
183
186
  subscription_id: String,
@@ -207,17 +210,18 @@ module Orb
207
210
  thresholds:,
208
211
  # The type of alert to create. This must be a valid alert type.
209
212
  type:,
210
- # The case sensitive currency or custom pricing unit to use for grouped cost
211
- # alerts. Required when grouping_keys is set.
213
+ # The case sensitive currency or custom pricing unit the alert is denominated in.
214
+ # Required for spend_exceeded alerts and when grouping_keys is set.
212
215
  currency: nil,
213
216
  # The property keys to group cost alerts by. Only applicable for cost_exceeded
214
217
  # alerts.
215
218
  grouping_keys: nil,
216
219
  # The metric to track usage for.
217
220
  metric_id: nil,
218
- # Filters to scope which prices are included in grouped cost alert evaluation.
219
- # Supports filtering by price_id, item_id, or price_type with includes/excludes
220
- # operators. Only applicable when grouping_keys is set.
221
+ # Filters to scope which prices are included in alert evaluation. Supports
222
+ # filtering by price_id, item_id, or price_type with includes/excludes operators.
223
+ # Only applicable to spend_exceeded alerts and to cost_exceeded alerts with
224
+ # grouping_keys set.
221
225
  price_filters: nil,
222
226
  # Per-group threshold overrides. Each override maps a specific combination of
223
227
  # grouping_keys values to a list of thresholds that fully replaces the default
@@ -134,6 +134,7 @@ module Orb
134
134
  | :credit_balance_recovered
135
135
  | :usage_exceeded
136
136
  | :cost_exceeded
137
+ | :spend_exceeded
137
138
  | :license_balance_threshold_reached
138
139
 
139
140
  module Type
@@ -144,6 +145,7 @@ module Orb
144
145
  CREDIT_BALANCE_RECOVERED: :credit_balance_recovered
145
146
  USAGE_EXCEEDED: :usage_exceeded
146
147
  COST_EXCEEDED: :cost_exceeded
148
+ SPEND_EXCEEDED: :spend_exceeded
147
149
  LICENSE_BALANCE_THRESHOLD_REACHED: :license_balance_threshold_reached
148
150
 
149
151
  def self?.values: -> ::Array[Orb::Models::Alert::type_]
@@ -57,13 +57,14 @@ module Orb
57
57
  request_options: Orb::RequestOptions
58
58
  }
59
59
 
60
- type type_ = :usage_exceeded | :cost_exceeded
60
+ type type_ = :usage_exceeded | :cost_exceeded | :spend_exceeded
61
61
 
62
62
  module Type
63
63
  extend Orb::Internal::Type::Enum
64
64
 
65
65
  USAGE_EXCEEDED: :usage_exceeded
66
66
  COST_EXCEEDED: :cost_exceeded
67
+ SPEND_EXCEEDED: :spend_exceeded
67
68
 
68
69
  def self?.values: -> ::Array[Orb::Models::AlertCreateForSubscriptionParams::type_]
69
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orb-billing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.0
4
+ version: 1.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orb