Skip to content

Commit fc0292b

Browse files
feat(api): api update
1 parent 43c7ba8 commit fc0292b

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
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

src/resources/alerts.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ export interface Alert {
239239
*/
240240
balance_alert_status?: Array<Alert.BalanceAlertStatus> | null;
241241

242+
/**
243+
* The property keys to group cost alerts by. Only present for cost alerts with
244+
* grouping enabled.
245+
*/
246+
grouping_keys?: Array<string> | null;
247+
242248
/**
243249
* Minified license type for alert serialization.
244250
*/
@@ -384,10 +390,22 @@ export interface AlertCreateForSubscriptionParams {
384390
*/
385391
type: 'usage_exceeded' | 'cost_exceeded';
386392

393+
/**
394+
* The property keys to group cost alerts by. Only applicable for cost_exceeded
395+
* alerts.
396+
*/
397+
grouping_keys?: Array<string> | null;
398+
387399
/**
388400
* The metric to track usage for.
389401
*/
390402
metric_id?: string | null;
403+
404+
/**
405+
* The pricing unit to use for grouped cost alerts. Required when grouping_keys is
406+
* set.
407+
*/
408+
pricing_unit_id?: string | null;
391409
}
392410

393411
export interface AlertDisableParams {

tests/api-resources/alerts.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ describe('resource alerts', () => {
143143
const response = await client.alerts.createForSubscription('subscription_id', {
144144
thresholds: [{ value: 0 }],
145145
type: 'usage_exceeded',
146+
grouping_keys: ['string'],
146147
metric_id: 'metric_id',
148+
pricing_unit_id: 'pricing_unit_id',
147149
});
148150
});
149151

0 commit comments

Comments
 (0)