Skip to content

Commit 751628a

Browse files
feat(api): api update
1 parent eb40fda commit 751628a

File tree

11 files changed

+106
-6
lines changed

11 files changed

+106
-6
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 139
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-87e16688d40cde735bc36efd40d8c12a7918919b18268d9c40b46d0cdf2f6251.yml
3-
openapi_spec_hash: 83f1f5a6fa7a07db4af09426232d0786
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d6a851f21804170f796637f1911c3382f1c57f5ed6b9b77cd7d0c6f74c06e174.yml
3+
openapi_spec_hash: 82df33badf54d0c7087a61145d379f58
44
config_hash: 3279841440b02d4e8303c961d6983492

lib/orb/models/alert.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,20 @@ class Alert < Orb::Internal::Type::BaseModel
7474
-> { Orb::Internal::Type::ArrayOf[Orb::Alert::BalanceAlertStatus] },
7575
nil?: true
7676

77+
# @!attribute grouping_keys
78+
# The property keys to group cost alerts by. Only present for cost alerts with
79+
# grouping enabled.
80+
#
81+
# @return [Array<String>, nil]
82+
optional :grouping_keys, Orb::Internal::Type::ArrayOf[String], nil?: true
83+
7784
# @!attribute license_type
7885
# Minified license type for alert serialization.
7986
#
8087
# @return [Orb::Models::Alert::LicenseType, nil]
8188
optional :license_type, -> { Orb::Alert::LicenseType }, nil?: true
8289

83-
# @!method initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:, balance_alert_status: nil, license_type: nil)
90+
# @!method initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:, balance_alert_status: nil, grouping_keys: nil, license_type: nil)
8491
# Some parameter documentations has been truncated, see {Orb::Models::Alert} for
8592
# more details.
8693
#
@@ -112,6 +119,8 @@ class Alert < Orb::Internal::Type::BaseModel
112119
#
113120
# @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
114121
#
122+
# @param grouping_keys [Array<String>, nil] The property keys to group cost alerts by. Only present for cost alerts with gro
123+
#
115124
# @param license_type [Orb::Models::Alert::LicenseType, nil] Minified license type for alert serialization.
116125

117126
# @see Orb::Models::Alert#metric

lib/orb/models/alert_create_for_subscription_params.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,42 @@ class AlertCreateForSubscriptionParams < Orb::Internal::Type::BaseModel
2424
# @return [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type]
2525
required :type, enum: -> { Orb::AlertCreateForSubscriptionParams::Type }
2626

27+
# @!attribute grouping_keys
28+
# The property keys to group cost alerts by. Only applicable for cost_exceeded
29+
# alerts.
30+
#
31+
# @return [Array<String>, nil]
32+
optional :grouping_keys, Orb::Internal::Type::ArrayOf[String], nil?: true
33+
2734
# @!attribute metric_id
2835
# The metric to track usage for.
2936
#
3037
# @return [String, nil]
3138
optional :metric_id, String, nil?: true
3239

33-
# @!method initialize(subscription_id:, thresholds:, type:, metric_id: nil, request_options: {})
40+
# @!attribute pricing_unit_id
41+
# The pricing unit to use for grouped cost alerts. Required when grouping_keys is
42+
# set.
43+
#
44+
# @return [String, nil]
45+
optional :pricing_unit_id, String, nil?: true
46+
47+
# @!method initialize(subscription_id:, thresholds:, type:, grouping_keys: nil, metric_id: nil, pricing_unit_id: nil, request_options: {})
48+
# Some parameter documentations has been truncated, see
49+
# {Orb::Models::AlertCreateForSubscriptionParams} for more details.
50+
#
3451
# @param subscription_id [String]
3552
#
3653
# @param thresholds [Array<Orb::Models::Threshold>] The thresholds that define the values at which the alert will be triggered.
3754
#
3855
# @param type [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] The type of alert to create. This must be a valid alert type.
3956
#
57+
# @param grouping_keys [Array<String>, nil] The property keys to group cost alerts by. Only applicable for cost_exceeded ale
58+
#
4059
# @param metric_id [String, nil] The metric to track usage for.
4160
#
61+
# @param pricing_unit_id [String, nil] The pricing unit to use for grouped cost alerts. Required when grouping_keys is
62+
#
4263
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
4364

4465
# The type of alert to create. This must be a valid alert type.

lib/orb/resources/alerts.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ def create_for_external_customer(external_customer_id, params)
179179
)
180180
end
181181

182+
# Some parameter documentations has been truncated, see
183+
# {Orb::Models::AlertCreateForSubscriptionParams} for more details.
184+
#
182185
# This endpoint is used to create alerts at the subscription level.
183186
#
184187
# Subscription level alerts can be one of two types: `usage_exceeded` or
@@ -191,16 +194,20 @@ def create_for_external_customer(external_customer_id, params)
191194
# per metric that is a part of the subscription. Alerts are triggered based on
192195
# usage or cost conditions met during the current billing cycle.
193196
#
194-
# @overload create_for_subscription(subscription_id, thresholds:, type:, metric_id: nil, request_options: {})
197+
# @overload create_for_subscription(subscription_id, thresholds:, type:, grouping_keys: nil, metric_id: nil, pricing_unit_id: nil, request_options: {})
195198
#
196199
# @param subscription_id [String]
197200
#
198201
# @param thresholds [Array<Orb::Models::Threshold>] The thresholds that define the values at which the alert will be triggered.
199202
#
200203
# @param type [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] The type of alert to create. This must be a valid alert type.
201204
#
205+
# @param grouping_keys [Array<String>, nil] The property keys to group cost alerts by. Only applicable for cost_exceeded ale
206+
#
202207
# @param metric_id [String, nil] The metric to track usage for.
203208
#
209+
# @param pricing_unit_id [String, nil] The pricing unit to use for grouped cost alerts. Required when grouping_keys is
210+
#
204211
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
205212
#
206213
# @return [Orb::Models::Alert]

rbi/orb/models/alert.rbi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ module Orb
6565
sig { returns(T.nilable(T::Array[Orb::Alert::BalanceAlertStatus])) }
6666
attr_accessor :balance_alert_status
6767

68+
# The property keys to group cost alerts by. Only present for cost alerts with
69+
# grouping enabled.
70+
sig { returns(T.nilable(T::Array[String])) }
71+
attr_accessor :grouping_keys
72+
6873
# Minified license type for alert serialization.
6974
sig { returns(T.nilable(Orb::Alert::LicenseType)) }
7075
attr_reader :license_type
@@ -93,6 +98,7 @@ module Orb
9398
type: Orb::Alert::Type::OrSymbol,
9499
balance_alert_status:
95100
T.nilable(T::Array[Orb::Alert::BalanceAlertStatus::OrHash]),
101+
grouping_keys: T.nilable(T::Array[String]),
96102
license_type: T.nilable(Orb::Alert::LicenseType::OrHash)
97103
).returns(T.attached_class)
98104
end
@@ -121,6 +127,9 @@ module Orb
121127
# The current status of the alert. This field is only present for credit balance
122128
# alerts.
123129
balance_alert_status: nil,
130+
# The property keys to group cost alerts by. Only present for cost alerts with
131+
# grouping enabled.
132+
grouping_keys: nil,
124133
# Minified license type for alert serialization.
125134
license_type: nil
126135
)
@@ -141,6 +150,7 @@ module Orb
141150
type: Orb::Alert::Type::TaggedSymbol,
142151
balance_alert_status:
143152
T.nilable(T::Array[Orb::Alert::BalanceAlertStatus]),
153+
grouping_keys: T.nilable(T::Array[String]),
144154
license_type: T.nilable(Orb::Alert::LicenseType)
145155
}
146156
)

rbi/orb/models/alert_create_for_subscription_params.rbi

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,28 @@ module Orb
2222
sig { returns(Orb::AlertCreateForSubscriptionParams::Type::OrSymbol) }
2323
attr_accessor :type
2424

25+
# The property keys to group cost alerts by. Only applicable for cost_exceeded
26+
# alerts.
27+
sig { returns(T.nilable(T::Array[String])) }
28+
attr_accessor :grouping_keys
29+
2530
# The metric to track usage for.
2631
sig { returns(T.nilable(String)) }
2732
attr_accessor :metric_id
2833

34+
# The pricing unit to use for grouped cost alerts. Required when grouping_keys is
35+
# set.
36+
sig { returns(T.nilable(String)) }
37+
attr_accessor :pricing_unit_id
38+
2939
sig do
3040
params(
3141
subscription_id: String,
3242
thresholds: T::Array[Orb::Threshold::OrHash],
3343
type: Orb::AlertCreateForSubscriptionParams::Type::OrSymbol,
44+
grouping_keys: T.nilable(T::Array[String]),
3445
metric_id: T.nilable(String),
46+
pricing_unit_id: T.nilable(String),
3547
request_options: Orb::RequestOptions::OrHash
3648
).returns(T.attached_class)
3749
end
@@ -41,8 +53,14 @@ module Orb
4153
thresholds:,
4254
# The type of alert to create. This must be a valid alert type.
4355
type:,
56+
# The property keys to group cost alerts by. Only applicable for cost_exceeded
57+
# alerts.
58+
grouping_keys: nil,
4459
# The metric to track usage for.
4560
metric_id: nil,
61+
# The pricing unit to use for grouped cost alerts. Required when grouping_keys is
62+
# set.
63+
pricing_unit_id: nil,
4664
request_options: {}
4765
)
4866
end
@@ -53,7 +71,9 @@ module Orb
5371
subscription_id: String,
5472
thresholds: T::Array[Orb::Threshold],
5573
type: Orb::AlertCreateForSubscriptionParams::Type::OrSymbol,
74+
grouping_keys: T.nilable(T::Array[String]),
5675
metric_id: T.nilable(String),
76+
pricing_unit_id: T.nilable(String),
5777
request_options: Orb::RequestOptions
5878
}
5979
)

rbi/orb/resources/alerts.rbi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ module Orb
153153
subscription_id: String,
154154
thresholds: T::Array[Orb::Threshold::OrHash],
155155
type: Orb::AlertCreateForSubscriptionParams::Type::OrSymbol,
156+
grouping_keys: T.nilable(T::Array[String]),
156157
metric_id: T.nilable(String),
158+
pricing_unit_id: T.nilable(String),
157159
request_options: Orb::RequestOptions::OrHash
158160
).returns(Orb::Alert)
159161
end
@@ -163,8 +165,14 @@ module Orb
163165
thresholds:,
164166
# The type of alert to create. This must be a valid alert type.
165167
type:,
168+
# The property keys to group cost alerts by. Only applicable for cost_exceeded
169+
# alerts.
170+
grouping_keys: nil,
166171
# The metric to track usage for.
167172
metric_id: nil,
173+
# The pricing unit to use for grouped cost alerts. Required when grouping_keys is
174+
# set.
175+
pricing_unit_id: nil,
168176
request_options: {}
169177
)
170178
end

sig/orb/models/alert.rbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module Orb
1313
thresholds: ::Array[Orb::Threshold]?,
1414
type: Orb::Models::Alert::type_,
1515
balance_alert_status: ::Array[Orb::Alert::BalanceAlertStatus]?,
16+
grouping_keys: ::Array[String]?,
1617
license_type: Orb::Alert::LicenseType?
1718
}
1819

@@ -39,6 +40,8 @@ module Orb
3940

4041
attr_accessor balance_alert_status: ::Array[Orb::Alert::BalanceAlertStatus]?
4142

43+
attr_accessor grouping_keys: ::Array[String]?
44+
4245
attr_accessor license_type: Orb::Alert::LicenseType?
4346

4447
def initialize: (
@@ -53,6 +56,7 @@ module Orb
5356
thresholds: ::Array[Orb::Threshold]?,
5457
type: Orb::Models::Alert::type_,
5558
?balance_alert_status: ::Array[Orb::Alert::BalanceAlertStatus]?,
59+
?grouping_keys: ::Array[String]?,
5660
?license_type: Orb::Alert::LicenseType?
5761
) -> void
5862

@@ -68,6 +72,7 @@ module Orb
6872
thresholds: ::Array[Orb::Threshold]?,
6973
type: Orb::Models::Alert::type_,
7074
balance_alert_status: ::Array[Orb::Alert::BalanceAlertStatus]?,
75+
grouping_keys: ::Array[String]?,
7176
license_type: Orb::Alert::LicenseType?
7277
}
7378

sig/orb/models/alert_create_for_subscription_params.rbs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ module Orb
55
subscription_id: String,
66
thresholds: ::Array[Orb::Threshold],
77
type: Orb::Models::AlertCreateForSubscriptionParams::type_,
8-
metric_id: String?
8+
grouping_keys: ::Array[String]?,
9+
metric_id: String?,
10+
pricing_unit_id: String?
911
}
1012
& Orb::Internal::Type::request_parameters
1113

@@ -19,21 +21,29 @@ module Orb
1921

2022
attr_accessor type: Orb::Models::AlertCreateForSubscriptionParams::type_
2123

24+
attr_accessor grouping_keys: ::Array[String]?
25+
2226
attr_accessor metric_id: String?
2327

28+
attr_accessor pricing_unit_id: String?
29+
2430
def initialize: (
2531
subscription_id: String,
2632
thresholds: ::Array[Orb::Threshold],
2733
type: Orb::Models::AlertCreateForSubscriptionParams::type_,
34+
?grouping_keys: ::Array[String]?,
2835
?metric_id: String?,
36+
?pricing_unit_id: String?,
2937
?request_options: Orb::request_opts
3038
) -> void
3139

3240
def to_hash: -> {
3341
subscription_id: String,
3442
thresholds: ::Array[Orb::Threshold],
3543
type: Orb::Models::AlertCreateForSubscriptionParams::type_,
44+
grouping_keys: ::Array[String]?,
3645
metric_id: String?,
46+
pricing_unit_id: String?,
3747
request_options: Orb::RequestOptions
3848
}
3949

sig/orb/resources/alerts.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ module Orb
4545
String subscription_id,
4646
thresholds: ::Array[Orb::Threshold],
4747
type: Orb::Models::AlertCreateForSubscriptionParams::type_,
48+
?grouping_keys: ::Array[String]?,
4849
?metric_id: String?,
50+
?pricing_unit_id: String?,
4951
?request_options: Orb::request_opts
5052
) -> Orb::Alert
5153

0 commit comments

Comments
 (0)