Skip to content
Merged
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
1,336 changes: 673 additions & 663 deletions api/api.gen.go

Large diffs are not rendered by default.

1,394 changes: 702 additions & 692 deletions api/client/go/client.gen.go

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions api/client/javascript/src/client/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7604,16 +7604,26 @@ export interface components {
value: number
/**
* @description Type of the threshold.
* @example NUMBER
* @example usage_value
*/
type: components['schemas']['NotificationRuleBalanceThresholdValueType']
}
/**
* Notification balance threshold type
* @description Type of the rule in the balance threshold specification.
* @description Type of the rule in the balance threshold specification:
* * `balance_value`: threshold defined by the remaining balance value based on usage and the total of grants in the current usage period
* * `usage_percentage`: threshold defined by the usage percentage compared to the total of grants in the current usage period
* * `usage_value`: threshold defined by the usage value in the current usage period
* * `NUMBER` (**deprecated**): see `usage_value`
* * `PERCENT` (**deprecated**): see `usage_percentage`
* @enum {string}
*/
NotificationRuleBalanceThresholdValueType: 'PERCENT' | 'NUMBER'
NotificationRuleBalanceThresholdValueType:
| 'PERCENT'
| 'NUMBER'
| 'balance_value'
| 'usage_percentage'
| 'usage_value'
/** @description Union type for requests creating new notification rule with certain type. */
NotificationRuleCreateRequest:
| components['schemas']['NotificationRuleBalanceThresholdCreateRequest']
Expand Down
20 changes: 16 additions & 4 deletions api/client/javascript/src/zod/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9851,9 +9851,15 @@ export const createNotificationRuleBody = zod
zod
.object({
type: zod
.enum(['PERCENT', 'NUMBER'])
.enum([
'PERCENT',
'NUMBER',
'balance_value',
'usage_percentage',
'usage_value',
])
.describe(
'Type of the rule in the balance threshold specification.'
'Type of the rule in the balance threshold specification:\n* `balance_value`: threshold defined by the remaining balance value based on usage and the total of grants in the current usage period\n* `usage_percentage`: threshold defined by the usage percentage compared to the total of grants in the current usage period\n* `usage_value`: threshold defined by the usage value in the current usage period\n* `NUMBER` (**deprecated**): see `usage_value`\n* `PERCENT` (**deprecated**): see `usage_percentage`'
)
.describe('Type of the threshold.'),
value: zod.coerce.number().describe('Value of the threshold.'),
Expand Down Expand Up @@ -10047,9 +10053,15 @@ export const updateNotificationRuleBody = zod
zod
.object({
type: zod
.enum(['PERCENT', 'NUMBER'])
.enum([
'PERCENT',
'NUMBER',
'balance_value',
'usage_percentage',
'usage_value',
])
.describe(
'Type of the rule in the balance threshold specification.'
'Type of the rule in the balance threshold specification:\n* `balance_value`: threshold defined by the remaining balance value based on usage and the total of grants in the current usage period\n* `usage_percentage`: threshold defined by the usage percentage compared to the total of grants in the current usage period\n* `usage_value`: threshold defined by the usage value in the current usage period\n* `NUMBER` (**deprecated**): see `usage_value`\n* `PERCENT` (**deprecated**): see `usage_percentage`'
)
.describe('Type of the threshold.'),
value: zod.coerce.number().describe('Value of the threshold.'),
Expand Down
16 changes: 14 additions & 2 deletions api/openapi.cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19454,18 +19454,30 @@ components:
allOf:
- $ref: '#/components/schemas/NotificationRuleBalanceThresholdValueType'
description: Type of the threshold.
example: NUMBER
example: usage_value
description: Threshold value with multiple supported types.
NotificationRuleBalanceThresholdValueType:
type: string
enum:
- PERCENT
- NUMBER
description: Type of the rule in the balance threshold specification.
- balance_value
- usage_percentage
- usage_value
description: |-
Type of the rule in the balance threshold specification:
* `balance_value`: threshold defined by the remaining balance value based on usage and the total of grants in the current usage period
* `usage_percentage`: threshold defined by the usage percentage compared to the total of grants in the current usage period
* `usage_value`: threshold defined by the usage value in the current usage period
* `NUMBER` (**deprecated**): see `usage_value`
* `PERCENT` (**deprecated**): see `usage_percentage`
title: Notification balance threshold type
x-enum-varnames:
- Percent
- Number
- BalanceValue
- UsagePercentage
- UsageValue
NotificationRuleCreateRequest:
type: object
oneOf:
Expand Down
16 changes: 14 additions & 2 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20035,18 +20035,30 @@ components:
allOf:
- $ref: '#/components/schemas/NotificationRuleBalanceThresholdValueType'
description: Type of the threshold.
example: NUMBER
example: usage_value
description: Threshold value with multiple supported types.
NotificationRuleBalanceThresholdValueType:
type: string
enum:
- PERCENT
- NUMBER
description: Type of the rule in the balance threshold specification.
- balance_value
- usage_percentage
- usage_value
description: |-
Type of the rule in the balance threshold specification:
* `balance_value`: threshold defined by the remaining balance value based on usage and the total of grants in the current usage period
* `usage_percentage`: threshold defined by the usage percentage compared to the total of grants in the current usage period
* `usage_value`: threshold defined by the usage value in the current usage period
* `NUMBER` (**deprecated**): see `usage_value`
* `PERCENT` (**deprecated**): see `usage_percentage`
title: Notification balance threshold type
x-enum-varnames:
- Percent
- Number
- BalanceValue
- UsagePercentage
- UsageValue
NotificationRuleCreateRequest:
type: object
oneOf:
Expand Down
17 changes: 14 additions & 3 deletions api/spec/src/notification/entitlements.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,30 @@ model NotificationRuleBalanceThresholdValue {
* Type of the threshold.
*/
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@example(NotificationRuleBalanceThresholdValueType.NUMBER)
@example(NotificationRuleBalanceThresholdValueType.usage_value)
type: NotificationRuleBalanceThresholdValueType;
}

/**
* Type of the rule in the balance threshold specification.
* Type of the rule in the balance threshold specification:
* * `balance_value`: threshold defined by the remaining balance value based on usage and the total of grants in the current usage period
* * `usage_percentage`: threshold defined by the usage percentage compared to the total of grants in the current usage period
* * `usage_value`: threshold defined by the usage value in the current usage period
* * `NUMBER` (**deprecated**): see `usage_value`
* * `PERCENT` (**deprecated**): see `usage_percentage`
*/
@summary("Notification balance threshold type")
@friendlyName("NotificationRuleBalanceThresholdValueType")
@extension("x-enum-varnames", #["Percent", "Number"])
@extension(
"x-enum-varnames",
#["Percent", "Number", "BalanceValue", "UsagePercentage", "UsageValue"]
)
enum NotificationRuleBalanceThresholdValueType {
PERCENT,
NUMBER,
balance_value,
usage_percentage,
usage_value,
}

/**
Expand Down
162 changes: 0 additions & 162 deletions openmeter/notification/consumer/balancethreshold_test.go

This file was deleted.

Loading