@openmeter/client 1.0.0-beta-ff701a7f5839 → 1.0.0-beta-e00163c4b8a0

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.
@@ -1062,6 +1062,10 @@ export interface ChargeReference {
1062
1062
  export interface UpdateResourceReference {
1063
1063
  id: string;
1064
1064
  }
1065
+ /** NotificationChannel reference. */
1066
+ export interface NotificationChannelReference {
1067
+ id: string;
1068
+ }
1065
1069
  /** A reference to the feature of an entitlement notification event. */
1066
1070
  export interface NotificationEventFeatureReference {
1067
1071
  /** The unique identifier of the feature. */
@@ -2484,6 +2488,16 @@ export interface UpdateBillingNotificationChannelRequest {
2484
2488
  */
2485
2489
  signingSecret?: string;
2486
2490
  }
2491
+ /**
2492
+ * A balance threshold of a notification rule. Crossing it generates an
2493
+ * `entitlements.balance.threshold` event.
2494
+ */
2495
+ export interface NotificationBalanceThreshold {
2496
+ /** What the threshold value is measured against. */
2497
+ type: 'balance_value' | 'usage_percentage' | 'usage_value';
2498
+ /** The threshold value. */
2499
+ value: number;
2500
+ }
2487
2501
  /** A reference to the notification rule that generated an event. */
2488
2502
  export interface NotificationRuleReference {
2489
2503
  /** The unique identifier of the rule. */
@@ -2502,16 +2516,6 @@ export interface NotificationEventDeliveryAttempt {
2502
2516
  /** When the attempt was made. */
2503
2517
  timestamp: Date;
2504
2518
  }
2505
- /**
2506
- * A balance threshold of a notification rule. Crossing it generates an
2507
- * `entitlements.balance.threshold` event.
2508
- */
2509
- export interface NotificationBalanceThreshold {
2510
- /** What the threshold value is measured against. */
2511
- type: 'balance_value' | 'usage_percentage' | 'usage_value';
2512
- /** The threshold value. */
2513
- value: number;
2514
- }
2515
2519
  /** App customer data. */
2516
2520
  export interface AppCustomerData {
2517
2521
  /**
@@ -3144,6 +3148,157 @@ export interface UpdateTaxCodeConfig {
3144
3148
  /** Tax code applied to the invoice line item. */
3145
3149
  code?: UpdateResourceReference;
3146
3150
  }
3151
+ /** A rule that generates an event when an entitlement usage period is reset. */
3152
+ export interface NotificationRuleEntitlementReset {
3153
+ id: string;
3154
+ /**
3155
+ * Display name of the resource.
3156
+ *
3157
+ * Between 1 and 256 characters.
3158
+ */
3159
+ name: string;
3160
+ labels?: Labels;
3161
+ /** An ISO-8601 timestamp representation of entity creation date. */
3162
+ createdAt: Date;
3163
+ /** An ISO-8601 timestamp representation of entity last update date. */
3164
+ updatedAt: Date;
3165
+ /** An ISO-8601 timestamp representation of entity deletion date. */
3166
+ deletedAt?: Date;
3167
+ /** The type of event the rule generates. Immutable after creation. */
3168
+ type: 'entitlements.reset';
3169
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
3170
+ disabled: boolean;
3171
+ /**
3172
+ * The channels the rule delivers its events to. At least one and at most five
3173
+ * channels are required. Responses omit channels that have since been disabled or
3174
+ * deleted.
3175
+ */
3176
+ channels: NotificationChannelReference[];
3177
+ /**
3178
+ * The features the rule applies to. When omitted, the rule applies to every
3179
+ * feature.
3180
+ */
3181
+ features?: FeatureReference[];
3182
+ }
3183
+ /** A rule that generates an event when an invoice is created. */
3184
+ export interface NotificationRuleInvoiceCreated {
3185
+ id: string;
3186
+ /**
3187
+ * Display name of the resource.
3188
+ *
3189
+ * Between 1 and 256 characters.
3190
+ */
3191
+ name: string;
3192
+ labels?: Labels;
3193
+ /** An ISO-8601 timestamp representation of entity creation date. */
3194
+ createdAt: Date;
3195
+ /** An ISO-8601 timestamp representation of entity last update date. */
3196
+ updatedAt: Date;
3197
+ /** An ISO-8601 timestamp representation of entity deletion date. */
3198
+ deletedAt?: Date;
3199
+ /** The type of event the rule generates. Immutable after creation. */
3200
+ type: 'invoice.created';
3201
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
3202
+ disabled: boolean;
3203
+ /**
3204
+ * The channels the rule delivers its events to. At least one and at most five
3205
+ * channels are required. Responses omit channels that have since been disabled or
3206
+ * deleted.
3207
+ */
3208
+ channels: NotificationChannelReference[];
3209
+ }
3210
+ /** A rule that generates an event when an invoice is updated. */
3211
+ export interface NotificationRuleInvoiceUpdated {
3212
+ id: string;
3213
+ /**
3214
+ * Display name of the resource.
3215
+ *
3216
+ * Between 1 and 256 characters.
3217
+ */
3218
+ name: string;
3219
+ labels?: Labels;
3220
+ /** An ISO-8601 timestamp representation of entity creation date. */
3221
+ createdAt: Date;
3222
+ /** An ISO-8601 timestamp representation of entity last update date. */
3223
+ updatedAt: Date;
3224
+ /** An ISO-8601 timestamp representation of entity deletion date. */
3225
+ deletedAt?: Date;
3226
+ /** The type of event the rule generates. Immutable after creation. */
3227
+ type: 'invoice.updated';
3228
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
3229
+ disabled: boolean;
3230
+ /**
3231
+ * The channels the rule delivers its events to. At least one and at most five
3232
+ * channels are required. Responses omit channels that have since been disabled or
3233
+ * deleted.
3234
+ */
3235
+ channels: NotificationChannelReference[];
3236
+ }
3237
+ /** Request body for an entitlement reset rule. */
3238
+ export interface NotificationRuleEntitlementResetRequest {
3239
+ /**
3240
+ * Display name of the resource.
3241
+ *
3242
+ * Between 1 and 256 characters.
3243
+ */
3244
+ name: string;
3245
+ labels?: Labels;
3246
+ /** The type of event the rule generates. Immutable after creation. */
3247
+ type: 'entitlements.reset';
3248
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
3249
+ disabled: boolean;
3250
+ /**
3251
+ * The channels the rule delivers its events to. At least one and at most five
3252
+ * channels are required. Responses omit channels that have since been disabled or
3253
+ * deleted.
3254
+ */
3255
+ channels: NotificationChannelReference[];
3256
+ /**
3257
+ * The features the rule applies to. When omitted, the rule applies to every
3258
+ * feature.
3259
+ */
3260
+ features?: FeatureReference[];
3261
+ }
3262
+ /** Request body for an invoice created rule. */
3263
+ export interface NotificationRuleInvoiceCreatedRequest {
3264
+ /**
3265
+ * Display name of the resource.
3266
+ *
3267
+ * Between 1 and 256 characters.
3268
+ */
3269
+ name: string;
3270
+ labels?: Labels;
3271
+ /** The type of event the rule generates. Immutable after creation. */
3272
+ type: 'invoice.created';
3273
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
3274
+ disabled: boolean;
3275
+ /**
3276
+ * The channels the rule delivers its events to. At least one and at most five
3277
+ * channels are required. Responses omit channels that have since been disabled or
3278
+ * deleted.
3279
+ */
3280
+ channels: NotificationChannelReference[];
3281
+ }
3282
+ /** Request body for an invoice updated rule. */
3283
+ export interface NotificationRuleInvoiceUpdatedRequest {
3284
+ /**
3285
+ * Display name of the resource.
3286
+ *
3287
+ * Between 1 and 256 characters.
3288
+ */
3289
+ name: string;
3290
+ labels?: Labels;
3291
+ /** The type of event the rule generates. Immutable after creation. */
3292
+ type: 'invoice.updated';
3293
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
3294
+ disabled: boolean;
3295
+ /**
3296
+ * The channels the rule delivers its events to. At least one and at most five
3297
+ * channels are required. Responses omit channels that have since been disabled or
3298
+ * deleted.
3299
+ */
3300
+ channels: NotificationChannelReference[];
3301
+ }
3147
3302
  /** The invoice an invoice notification event refers to. */
3148
3303
  export interface NotificationEventInvoiceData {
3149
3304
  /** The invoice the event was generated for. */
@@ -3248,6 +3403,20 @@ export interface ListNotificationChannelsParamsFilter {
3248
3403
  createdAt?: DateTimeFieldFilter;
3249
3404
  updatedAt?: DateTimeFieldFilter;
3250
3405
  }
3406
+ /** Filter options for listing notification rules. */
3407
+ export interface ListNotificationRulesParamsFilter {
3408
+ id?: UlidFieldFilter;
3409
+ name?: StringFieldFilter;
3410
+ type?: StringFieldFilterExact;
3411
+ disabled?: BooleanFieldFilter;
3412
+ createdAt?: DateTimeFieldFilter;
3413
+ updatedAt?: DateTimeFieldFilter;
3414
+ /**
3415
+ * Filter by an assigned channel. Matches rules that deliver to at least one of the
3416
+ * given channels. Only `eq` and `oeq` are supported.
3417
+ */
3418
+ channelId?: UlidFieldFilter;
3419
+ }
3251
3420
  /** Filter options for listing notification events. */
3252
3421
  export interface ListNotificationEventsParamsFilter {
3253
3422
  id?: UlidFieldFilter;
@@ -4229,6 +4398,70 @@ export interface NotificationChannelPagePaginatedResponse {
4229
4398
  data: NotificationChannel[];
4230
4399
  meta: PaginatedMeta;
4231
4400
  }
4401
+ /**
4402
+ * A rule that generates an event when an entitlement balance crosses one of its
4403
+ * thresholds.
4404
+ */
4405
+ export interface NotificationRuleBalanceThreshold {
4406
+ id: string;
4407
+ /**
4408
+ * Display name of the resource.
4409
+ *
4410
+ * Between 1 and 256 characters.
4411
+ */
4412
+ name: string;
4413
+ labels?: Labels;
4414
+ /** An ISO-8601 timestamp representation of entity creation date. */
4415
+ createdAt: Date;
4416
+ /** An ISO-8601 timestamp representation of entity last update date. */
4417
+ updatedAt: Date;
4418
+ /** An ISO-8601 timestamp representation of entity deletion date. */
4419
+ deletedAt?: Date;
4420
+ /** The type of event the rule generates. Immutable after creation. */
4421
+ type: 'entitlements.balance.threshold';
4422
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
4423
+ disabled: boolean;
4424
+ /**
4425
+ * The channels the rule delivers its events to. At least one and at most five
4426
+ * channels are required. Responses omit channels that have since been disabled or
4427
+ * deleted.
4428
+ */
4429
+ channels: NotificationChannelReference[];
4430
+ /** The thresholds that generate an event when crossed. */
4431
+ thresholds: NotificationBalanceThreshold[];
4432
+ /**
4433
+ * The features the rule applies to. When omitted, the rule applies to every
4434
+ * feature.
4435
+ */
4436
+ features?: FeatureReference[];
4437
+ }
4438
+ /** Request body for a balance threshold rule. */
4439
+ export interface NotificationRuleBalanceThresholdRequest {
4440
+ /**
4441
+ * Display name of the resource.
4442
+ *
4443
+ * Between 1 and 256 characters.
4444
+ */
4445
+ name: string;
4446
+ labels?: Labels;
4447
+ /** The type of event the rule generates. Immutable after creation. */
4448
+ type: 'entitlements.balance.threshold';
4449
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
4450
+ disabled: boolean;
4451
+ /**
4452
+ * The channels the rule delivers its events to. At least one and at most five
4453
+ * channels are required. Responses omit channels that have since been disabled or
4454
+ * deleted.
4455
+ */
4456
+ channels: NotificationChannelReference[];
4457
+ /** The thresholds that generate an event when crossed. */
4458
+ thresholds: NotificationBalanceThreshold[];
4459
+ /**
4460
+ * The features the rule applies to. When omitted, the rule applies to every
4461
+ * feature.
4462
+ */
4463
+ features?: FeatureReference[];
4464
+ }
4232
4465
  /**
4233
4466
  * The delivery status of a notification event for one channel of the generating
4234
4467
  * rule.
@@ -5670,6 +5903,11 @@ export interface EntitlementAccessQueryResponse {
5670
5903
  */
5671
5904
  meta: CursorMeta;
5672
5905
  }
5906
+ /** Page paginated response. */
5907
+ export interface NotificationRulePagePaginatedResponse {
5908
+ data: NotificationRule[];
5909
+ meta: PaginatedMeta;
5910
+ }
5673
5911
  /** A rate card defines the pricing and entitlement of a feature or service. */
5674
5912
  export interface RateCard {
5675
5913
  /**
@@ -7395,6 +7633,17 @@ export type Entitlement = EntitlementMetered | EntitlementStatic | EntitlementBo
7395
7633
  * arrears items).
7396
7634
  */
7397
7635
  export type WorkflowCollectionAlignment = WorkflowCollectionAlignmentSubscription | WorkflowCollectionAlignmentAnchored;
7636
+ /**
7637
+ * A notification rule selects the type of event to generate, the conditions
7638
+ * specific to that type, and the channels to deliver the events to.
7639
+ */
7640
+ export type NotificationRule = NotificationRuleBalanceThreshold | NotificationRuleEntitlementReset | NotificationRuleInvoiceCreated | NotificationRuleInvoiceUpdated;
7641
+ /**
7642
+ * Request body for creating or updating a notification rule. Updates replace the
7643
+ * rule's mutable state: omitting `disabled`, `labels`, or `features` resets them
7644
+ * to their defaults. The `type` must match the existing rule on update.
7645
+ */
7646
+ export type NotificationRuleRequest = NotificationRuleBalanceThresholdRequest | NotificationRuleEntitlementResetRequest | NotificationRuleInvoiceCreatedRequest | NotificationRuleInvoiceUpdatedRequest;
7398
7647
  /** Price. */
7399
7648
  export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
7400
7649
  /**
@@ -7899,6 +8148,157 @@ export interface UpdateBillingNotificationChannelRequestInput {
7899
8148
  */
7900
8149
  signingSecret?: string;
7901
8150
  }
8151
+ /** A rule that generates an event when an entitlement usage period is reset. */
8152
+ export interface NotificationRuleEntitlementResetInput {
8153
+ id: string;
8154
+ /**
8155
+ * Display name of the resource.
8156
+ *
8157
+ * Between 1 and 256 characters.
8158
+ */
8159
+ name: string;
8160
+ labels?: Labels;
8161
+ /** An ISO-8601 timestamp representation of entity creation date. */
8162
+ createdAt: Date;
8163
+ /** An ISO-8601 timestamp representation of entity last update date. */
8164
+ updatedAt: Date;
8165
+ /** An ISO-8601 timestamp representation of entity deletion date. */
8166
+ deletedAt?: Date;
8167
+ /** The type of event the rule generates. Immutable after creation. */
8168
+ type: 'entitlements.reset';
8169
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
8170
+ disabled?: boolean;
8171
+ /**
8172
+ * The channels the rule delivers its events to. At least one and at most five
8173
+ * channels are required. Responses omit channels that have since been disabled or
8174
+ * deleted.
8175
+ */
8176
+ channels: NotificationChannelReference[];
8177
+ /**
8178
+ * The features the rule applies to. When omitted, the rule applies to every
8179
+ * feature.
8180
+ */
8181
+ features?: FeatureReference[];
8182
+ }
8183
+ /** A rule that generates an event when an invoice is created. */
8184
+ export interface NotificationRuleInvoiceCreatedInput {
8185
+ id: string;
8186
+ /**
8187
+ * Display name of the resource.
8188
+ *
8189
+ * Between 1 and 256 characters.
8190
+ */
8191
+ name: string;
8192
+ labels?: Labels;
8193
+ /** An ISO-8601 timestamp representation of entity creation date. */
8194
+ createdAt: Date;
8195
+ /** An ISO-8601 timestamp representation of entity last update date. */
8196
+ updatedAt: Date;
8197
+ /** An ISO-8601 timestamp representation of entity deletion date. */
8198
+ deletedAt?: Date;
8199
+ /** The type of event the rule generates. Immutable after creation. */
8200
+ type: 'invoice.created';
8201
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
8202
+ disabled?: boolean;
8203
+ /**
8204
+ * The channels the rule delivers its events to. At least one and at most five
8205
+ * channels are required. Responses omit channels that have since been disabled or
8206
+ * deleted.
8207
+ */
8208
+ channels: NotificationChannelReference[];
8209
+ }
8210
+ /** A rule that generates an event when an invoice is updated. */
8211
+ export interface NotificationRuleInvoiceUpdatedInput {
8212
+ id: string;
8213
+ /**
8214
+ * Display name of the resource.
8215
+ *
8216
+ * Between 1 and 256 characters.
8217
+ */
8218
+ name: string;
8219
+ labels?: Labels;
8220
+ /** An ISO-8601 timestamp representation of entity creation date. */
8221
+ createdAt: Date;
8222
+ /** An ISO-8601 timestamp representation of entity last update date. */
8223
+ updatedAt: Date;
8224
+ /** An ISO-8601 timestamp representation of entity deletion date. */
8225
+ deletedAt?: Date;
8226
+ /** The type of event the rule generates. Immutable after creation. */
8227
+ type: 'invoice.updated';
8228
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
8229
+ disabled?: boolean;
8230
+ /**
8231
+ * The channels the rule delivers its events to. At least one and at most five
8232
+ * channels are required. Responses omit channels that have since been disabled or
8233
+ * deleted.
8234
+ */
8235
+ channels: NotificationChannelReference[];
8236
+ }
8237
+ /** Request body for an entitlement reset rule. */
8238
+ export interface NotificationRuleEntitlementResetRequestInput {
8239
+ /**
8240
+ * Display name of the resource.
8241
+ *
8242
+ * Between 1 and 256 characters.
8243
+ */
8244
+ name: string;
8245
+ labels?: Labels;
8246
+ /** The type of event the rule generates. Immutable after creation. */
8247
+ type: 'entitlements.reset';
8248
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
8249
+ disabled?: boolean;
8250
+ /**
8251
+ * The channels the rule delivers its events to. At least one and at most five
8252
+ * channels are required. Responses omit channels that have since been disabled or
8253
+ * deleted.
8254
+ */
8255
+ channels: NotificationChannelReference[];
8256
+ /**
8257
+ * The features the rule applies to. When omitted, the rule applies to every
8258
+ * feature.
8259
+ */
8260
+ features?: FeatureReference[];
8261
+ }
8262
+ /** Request body for an invoice created rule. */
8263
+ export interface NotificationRuleInvoiceCreatedRequestInput {
8264
+ /**
8265
+ * Display name of the resource.
8266
+ *
8267
+ * Between 1 and 256 characters.
8268
+ */
8269
+ name: string;
8270
+ labels?: Labels;
8271
+ /** The type of event the rule generates. Immutable after creation. */
8272
+ type: 'invoice.created';
8273
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
8274
+ disabled?: boolean;
8275
+ /**
8276
+ * The channels the rule delivers its events to. At least one and at most five
8277
+ * channels are required. Responses omit channels that have since been disabled or
8278
+ * deleted.
8279
+ */
8280
+ channels: NotificationChannelReference[];
8281
+ }
8282
+ /** Request body for an invoice updated rule. */
8283
+ export interface NotificationRuleInvoiceUpdatedRequestInput {
8284
+ /**
8285
+ * Display name of the resource.
8286
+ *
8287
+ * Between 1 and 256 characters.
8288
+ */
8289
+ name: string;
8290
+ labels?: Labels;
8291
+ /** The type of event the rule generates. Immutable after creation. */
8292
+ type: 'invoice.updated';
8293
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
8294
+ disabled?: boolean;
8295
+ /**
8296
+ * The channels the rule delivers its events to. At least one and at most five
8297
+ * channels are required. Responses omit channels that have since been disabled or
8298
+ * deleted.
8299
+ */
8300
+ channels: NotificationChannelReference[];
8301
+ }
7902
8302
  /** An ingested metering event with ingestion metadata. */
7903
8303
  export interface IngestedEventInput {
7904
8304
  /** The original event ingested. */
@@ -8100,6 +8500,70 @@ export interface NotificationChannelPagePaginatedResponseInput {
8100
8500
  data: NotificationChannelInput[];
8101
8501
  meta: PaginatedMeta;
8102
8502
  }
8503
+ /**
8504
+ * A rule that generates an event when an entitlement balance crosses one of its
8505
+ * thresholds.
8506
+ */
8507
+ export interface NotificationRuleBalanceThresholdInput {
8508
+ id: string;
8509
+ /**
8510
+ * Display name of the resource.
8511
+ *
8512
+ * Between 1 and 256 characters.
8513
+ */
8514
+ name: string;
8515
+ labels?: Labels;
8516
+ /** An ISO-8601 timestamp representation of entity creation date. */
8517
+ createdAt: Date;
8518
+ /** An ISO-8601 timestamp representation of entity last update date. */
8519
+ updatedAt: Date;
8520
+ /** An ISO-8601 timestamp representation of entity deletion date. */
8521
+ deletedAt?: Date;
8522
+ /** The type of event the rule generates. Immutable after creation. */
8523
+ type: 'entitlements.balance.threshold';
8524
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
8525
+ disabled?: boolean;
8526
+ /**
8527
+ * The channels the rule delivers its events to. At least one and at most five
8528
+ * channels are required. Responses omit channels that have since been disabled or
8529
+ * deleted.
8530
+ */
8531
+ channels: NotificationChannelReference[];
8532
+ /** The thresholds that generate an event when crossed. */
8533
+ thresholds: NotificationBalanceThreshold[];
8534
+ /**
8535
+ * The features the rule applies to. When omitted, the rule applies to every
8536
+ * feature.
8537
+ */
8538
+ features?: FeatureReference[];
8539
+ }
8540
+ /** Request body for a balance threshold rule. */
8541
+ export interface NotificationRuleBalanceThresholdRequestInput {
8542
+ /**
8543
+ * Display name of the resource.
8544
+ *
8545
+ * Between 1 and 256 characters.
8546
+ */
8547
+ name: string;
8548
+ labels?: Labels;
8549
+ /** The type of event the rule generates. Immutable after creation. */
8550
+ type: 'entitlements.balance.threshold';
8551
+ /** Whether the rule is disabled. Disabled rules do not generate events. */
8552
+ disabled?: boolean;
8553
+ /**
8554
+ * The channels the rule delivers its events to. At least one and at most five
8555
+ * channels are required. Responses omit channels that have since been disabled or
8556
+ * deleted.
8557
+ */
8558
+ channels: NotificationChannelReference[];
8559
+ /** The thresholds that generate an event when crossed. */
8560
+ thresholds: NotificationBalanceThreshold[];
8561
+ /**
8562
+ * The features the rule applies to. When omitted, the rule applies to every
8563
+ * feature.
8564
+ */
8565
+ features?: FeatureReference[];
8566
+ }
8103
8567
  /** Purchase and payment terms of the grant. */
8104
8568
  export interface CreateCreditGrantPurchaseInput {
8105
8569
  /**
@@ -8695,6 +9159,11 @@ export interface ChargeRealizationInvoiceInput {
8695
9159
  /** Workflow configuration snapshot captured at invoice creation time. */
8696
9160
  workflow: InvoiceWorkflowSettingsInput;
8697
9161
  }
9162
+ /** Page paginated response. */
9163
+ export interface NotificationRulePagePaginatedResponseInput {
9164
+ data: NotificationRuleInput[];
9165
+ meta: PaginatedMeta;
9166
+ }
8698
9167
  /** A rate card defines the pricing and entitlement of a feature or service. */
8699
9168
  export interface RateCardInput {
8700
9169
  /**
@@ -10199,6 +10668,17 @@ export type UpdateBillingWorkflowPaymentSettingsInput = UpdateBillingWorkflowPay
10199
10668
  export type RateCardEntitlementInput = RateCardMeteredEntitlementInput | RateCardStaticEntitlement | RateCardBooleanEntitlement;
10200
10669
  /** An entitlement grants a customer access to a feature. */
10201
10670
  export type EntitlementInput = EntitlementMeteredInput | EntitlementStatic | EntitlementBoolean;
10671
+ /**
10672
+ * A notification rule selects the type of event to generate, the conditions
10673
+ * specific to that type, and the channels to deliver the events to.
10674
+ */
10675
+ export type NotificationRuleInput = NotificationRuleBalanceThresholdInput | NotificationRuleEntitlementResetInput | NotificationRuleInvoiceCreatedInput | NotificationRuleInvoiceUpdatedInput;
10676
+ /**
10677
+ * Request body for creating or updating a notification rule. Updates replace the
10678
+ * rule's mutable state: omitting `disabled`, `labels`, or `features` resets them
10679
+ * to their defaults. The `type` must match the existing rule on update.
10680
+ */
10681
+ export type NotificationRuleRequestInput = NotificationRuleBalanceThresholdRequestInput | NotificationRuleEntitlementResetRequestInput | NotificationRuleInvoiceCreatedRequestInput | NotificationRuleInvoiceUpdatedRequestInput;
10202
10682
  /** Entitlement create request. */
10203
10683
  export type CreateEntitlementRequestInput = CreateEntitlementMeteredRequestInput | CreateEntitlementStaticRequest | CreateEntitlementBooleanRequest;
10204
10684
  /** ChargeRealizationInvoice or reference. */
@@ -2,8 +2,8 @@ import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
3
  import type { CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
4
4
  import type { ExecuteAppActionRequest, ExecuteAppActionResponse } from '../models/operations/apps.js';
5
- import type { ListNotificationEventsRequest, ListNotificationEventsResponse, GetNotificationEventRequest, GetNotificationEventResponse, ResendNotificationEventRequest, ResendNotificationEventResponse } from '../models/operations/notifications.js';
6
- import type { NotificationEvent } from '../models/types.js';
5
+ import type { ListNotificationRulesRequest, ListNotificationRulesResponse, CreateNotificationRuleRequest, CreateNotificationRuleResponse, GetNotificationRuleRequest, GetNotificationRuleResponse, UpdateNotificationRuleRequest, UpdateNotificationRuleResponse, DeleteNotificationRuleRequest, DeleteNotificationRuleResponse, TestNotificationRuleRequest, TestNotificationRuleResponse, ListNotificationEventsRequest, ListNotificationEventsResponse, GetNotificationEventRequest, GetNotificationEventResponse, ResendNotificationEventRequest, ResendNotificationEventResponse } from '../models/operations/notifications.js';
6
+ import type { NotificationEvent, NotificationRule } from '../models/types.js';
7
7
  /**
8
8
  * Operations marked internal in the API definition. They are not part of
9
9
  * the customer surface: they may require additional permissions, and they
@@ -57,6 +57,66 @@ export declare class InternalApps {
57
57
  export declare class InternalNotifications {
58
58
  private readonly _client;
59
59
  constructor(_client: Client);
60
+ /**
61
+ * List notification rules
62
+ *
63
+ * List all notification rules.
64
+ *
65
+ * GET /openmeter/notification/rules
66
+ */
67
+ listRules(request?: ListNotificationRulesRequest, options?: RequestOptions): Promise<ListNotificationRulesResponse>;
68
+ /**
69
+ * List notification rules
70
+ *
71
+ * List all notification rules.
72
+ *
73
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
74
+ *
75
+ * GET /openmeter/notification/rules
76
+ */
77
+ listRulesAll(request?: ListNotificationRulesRequest, options?: RequestOptions): AsyncIterable<NotificationRule>;
78
+ /**
79
+ * Create notification rule
80
+ *
81
+ * Create a notification rule.
82
+ *
83
+ * POST /openmeter/notification/rules
84
+ */
85
+ createRule(request: CreateNotificationRuleRequest, options?: RequestOptions): Promise<CreateNotificationRuleResponse>;
86
+ /**
87
+ * Get notification rule
88
+ *
89
+ * Get a notification rule by id.
90
+ *
91
+ * GET /openmeter/notification/rules/{notificationRuleId}
92
+ */
93
+ getRule(request: GetNotificationRuleRequest, options?: RequestOptions): Promise<GetNotificationRuleResponse>;
94
+ /**
95
+ * Update notification rule
96
+ *
97
+ * Update a notification rule by id.
98
+ *
99
+ * PUT /openmeter/notification/rules/{notificationRuleId}
100
+ */
101
+ updateRule(request: UpdateNotificationRuleRequest, options?: RequestOptions): Promise<UpdateNotificationRuleResponse>;
102
+ /**
103
+ * Delete notification rule
104
+ *
105
+ * Delete a notification rule by id.
106
+ *
107
+ * DELETE /openmeter/notification/rules/{notificationRuleId}
108
+ */
109
+ deleteRule(request: DeleteNotificationRuleRequest, options?: RequestOptions): Promise<DeleteNotificationRuleResponse>;
110
+ /**
111
+ * Test notification rule
112
+ *
113
+ * Test a notification rule by generating an event with sample data and delivering
114
+ * it to the rule's channels. The test event is persisted and listed like any other
115
+ * event.
116
+ *
117
+ * POST /openmeter/notification/rules/{notificationRuleId}/test
118
+ */
119
+ testRule(request: TestNotificationRuleRequest, options?: RequestOptions): Promise<TestNotificationRuleResponse>;
60
120
  /**
61
121
  * List notification events
62
122
  *