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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/orb/models/alert.rb +1 -0
- data/lib/orb/models/alert_create_for_subscription_params.rb +9 -7
- data/lib/orb/resources/alerts.rb +13 -10
- data/lib/orb/version.rb +1 -1
- data/rbi/orb/models/alert.rbi +1 -0
- data/rbi/orb/models/alert_create_for_subscription_params.rbi +17 -10
- data/rbi/orb/resources/alerts.rbi +17 -13
- data/sig/orb/models/alert.rbs +2 -0
- data/sig/orb/models/alert_create_for_subscription_params.rbs +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 19227e347dfaaa00a58f6ad54abae076fe861aee72c03197b0270a9e17423ed1
|
|
4
|
+
data.tar.gz: 129c2a00adaad2e94eec77ad9901c9bb18668218babfe5047c92e424a460cbdc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
data/lib/orb/models/alert.rb
CHANGED
|
@@ -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
|
|
29
|
-
# alerts
|
|
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
|
|
49
|
-
#
|
|
50
|
-
#
|
|
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
|
|
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
|
|
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>]
|
data/lib/orb/resources/alerts.rb
CHANGED
|
@@ -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
|
|
221
|
-
# `cost_exceeded`. A `usage_exceeded` alert is scoped to a
|
|
222
|
-
# is triggered when the usage of that metric exceeds
|
|
223
|
-
# the current billing cycle. A `cost_exceeded` alert
|
|
224
|
-
# amount due during the current billing cycle
|
|
225
|
-
# `cost_exceeded` alerts do not include burndown
|
|
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.
|
|
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
|
|
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
|
|
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
data/rbi/orb/models/alert.rbi
CHANGED
|
@@ -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
|
|
26
|
-
# alerts
|
|
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
|
|
40
|
-
#
|
|
41
|
-
#
|
|
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
|
|
95
|
-
# alerts
|
|
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
|
|
103
|
-
#
|
|
104
|
-
#
|
|
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
|
|
173
|
-
# `cost_exceeded`. A `usage_exceeded` alert is scoped to a
|
|
174
|
-
# is triggered when the usage of that metric exceeds
|
|
175
|
-
# the current billing cycle. A `cost_exceeded` alert
|
|
176
|
-
# amount due during the current billing cycle
|
|
177
|
-
# `cost_exceeded` alerts do not include burndown
|
|
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.
|
|
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
|
|
211
|
-
# alerts
|
|
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
|
|
219
|
-
#
|
|
220
|
-
#
|
|
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
|
data/sig/orb/models/alert.rbs
CHANGED
|
@@ -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
|