@openmeter/client 1.0.0-beta.235 → 1.0.0-beta.237

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.
package/README.md CHANGED
@@ -41,7 +41,10 @@ TypeSpec definitions and ships fully-typed request and response models.
41
41
  - [EntitlementAccess](#entitlementaccess)
42
42
  - [Notifications](#notifications)
43
43
  - [Internal Operations](#internal-operations)
44
+ - [Internal Customers](#internal-customers)
44
45
  - [Internal Subscriptions](#internal-subscriptions)
46
+ - [Internal Apps](#internal-apps)
47
+ - [Internal Notifications](#internal-notifications)
45
48
  - [Runtime Validation (validate option)](#runtime-validation-validate-option)
46
49
  - [Zod Schemas (./zod export)](#zod-schemas-zod-export)
47
50
  - [Error Handling](#error-handling)
@@ -290,7 +293,8 @@ The full call path, HTTP route, and a short description are listed below.
290
293
  | `client.customers.upsert` | `PUT /openmeter/customers/{customerId}` | Upsert customer |
291
294
  | `client.customers.delete` | `DELETE /openmeter/customers/{customerId}` | Delete customer |
292
295
  | `client.customers.billing.get` | `GET /openmeter/customers/{customerId}/billing` | Get customer billing data |
293
- | `client.customers.billing.update` | `PUT /openmeter/customers/{customerId}/billing` | Update customer billing data |
296
+ | `client.customers.billing.update` | `PUT /openmeter/customers/{customerId}/billing` | Update billing data while preserving the current profile selection when billing_profile is omitted or null. Use the dedicated billing profile endpoint to remove the selection. |
297
+ | `client.customers.billing.updateProfile` | `PUT /openmeter/customers/{customerId}/billing/profile` | Set the customer's explicit billing profile selection. Omitting billing_profile or setting it to null removes the selection and uses the current namespace default. |
294
298
  | `client.customers.billing.updateAppData` | `PUT /openmeter/customers/{customerId}/billing/app-data` | Update customer billing app data |
295
299
  | `client.customers.billing.createStripeCheckoutSession` | `POST /openmeter/customers/{customerId}/billing/stripe/checkout-sessions` | Create a [Stripe Checkout Session](https://docs.stripe.com/payments/checkout) for the customer. Creates a Checkout Session for collecting payment method information from customers. The session operates in "setup" mode, which collects payment details without charging the customer immediately. The collected payment method can be used for future subscription billing. For hosted checkout sessions, redirect customers to the returned URL. For embedded sessions, use the client_secret to initialize Stripe.js in your application. |
296
300
  | `client.customers.billing.createStripePortalSession` | `POST /openmeter/customers/{customerId}/billing/stripe/portal-sessions` | Create Stripe Customer Portal Session. Useful to redirect the customer to the Stripe Customer Portal to manage their payment methods, change their billing address and access their invoice history. Only returns URL if the customer billing profile is linked to a stripe app and customer. |
@@ -480,13 +484,13 @@ The full call path, HTTP route, and a short description are listed below.
480
484
 
481
485
  ### Notifications
482
486
 
483
- | Method | HTTP | Description |
484
- | ------------------------------------ | ----------------------------------------------------------------- | ------------------------------------ |
485
- | `client.notifications.listChannels` | `GET /openmeter/notification/channels` | List all notification channels. |
486
- | `client.notifications.createChannel` | `POST /openmeter/notification/channels` | Create a notification channel. |
487
- | `client.notifications.getChannel` | `GET /openmeter/notification/channels/{notificationChannelId}` | Get a notification channel by id. |
488
- | `client.notifications.updateChannel` | `PUT /openmeter/notification/channels/{notificationChannelId}` | Update a notification channel by id. |
489
- | `client.notifications.deleteChannel` | `DELETE /openmeter/notification/channels/{notificationChannelId}` | Delete a notification channel by id. |
487
+ | Method | HTTP | Description |
488
+ | ------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------ |
489
+ | `client.notifications.listBillingChannels` | `GET /openmeter/notification/channels` | List all notification channels. |
490
+ | `client.notifications.createBillingChannel` | `POST /openmeter/notification/channels` | Create a notification channel. |
491
+ | `client.notifications.getBillingChannel` | `GET /openmeter/notification/channels/{notificationChannelId}` | Get a notification channel by id. |
492
+ | `client.notifications.updateBillingChannel` | `PUT /openmeter/notification/channels/{notificationChannelId}` | Update a notification channel by id. |
493
+ | `client.notifications.deleteBillingChannel` | `DELETE /openmeter/notification/channels/{notificationChannelId}` | Delete a notification channel by id. |
490
494
 
491
495
  ## Internal Operations
492
496
 
@@ -495,6 +499,12 @@ Operations marked internal in the API definition are exposed under
495
499
  intended for customer use: they may require additional permissions, and
496
500
  they can change or be removed without notice or semver consideration.
497
501
 
502
+ ### Internal Customers
503
+
504
+ | Method | HTTP | Description |
505
+ | ------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
506
+ | `client.internal.customers.charges.invoice` | `POST /openmeter/customers/{customerId}/charges/invoice` | Invoice a customer's charges outside the normal billing cycle. Collection alignment is bypassed. The customer's progressive billing setting applies unless explicitly overridden. All eligible pending lines are considered. Returns the created standard invoices, one per collected currency. Lines blocked by their owning engine remain pending. If all eligible lines are blocked or no lines are eligible, returns a validation error. |
507
+
498
508
  ### Internal Subscriptions
499
509
 
500
510
  | Method | HTTP | Description |
@@ -502,6 +512,26 @@ they can change or be removed without notice or semver consideration.
502
512
  | `client.internal.subscriptions.createAddon` | `POST /openmeter/subscriptions/{subscriptionId}/addons` | Add add-on to a subscription. |
503
513
  | `client.internal.subscriptions.updateAddon` | `PATCH /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}` | Update a subscription add-on. Only the quantity is mutable; the timing controls when the new quantity takes effect. A new entry is appended to the add-on's timeline. |
504
514
 
515
+ ### Internal Apps
516
+
517
+ | Method | HTTP | Description |
518
+ | ------------------------------------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
519
+ | `client.internal.apps.executeAction` | `POST /openmeter/apps/{appId}/action` | Execute an operator action on an installed app. The action must be listed in the app's `actions`; otherwise the request is rejected. |
520
+
521
+ ### Internal Notifications
522
+
523
+ | Method | HTTP | Description |
524
+ | -------------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
525
+ | `client.internal.notifications.listBillingRules` | `GET /openmeter/notification/rules` | List all notification rules. |
526
+ | `client.internal.notifications.createBillingRule` | `POST /openmeter/notification/rules` | Create a notification rule. |
527
+ | `client.internal.notifications.getBillingRule` | `GET /openmeter/notification/rules/{notificationRuleId}` | Get a notification rule by id. |
528
+ | `client.internal.notifications.updateBillingRule` | `PUT /openmeter/notification/rules/{notificationRuleId}` | Update a notification rule by id. |
529
+ | `client.internal.notifications.deleteBillingRule` | `DELETE /openmeter/notification/rules/{notificationRuleId}` | Delete a notification rule by id. |
530
+ | `client.internal.notifications.testBillingRule` | `POST /openmeter/notification/rules/{notificationRuleId}/test` | Test a notification rule by generating an event with sample data and delivering it to the rule's channels. The test event is persisted and listed like any other event. |
531
+ | `client.internal.notifications.listBillingEvents` | `GET /openmeter/notification/events` | List all notification events. |
532
+ | `client.internal.notifications.getBillingEvent` | `GET /openmeter/notification/events/{notificationEventId}` | Get a notification event by id. |
533
+ | `client.internal.notifications.resendBillingEvent` | `POST /openmeter/notification/events/{notificationEventId}/resend` | Resend a notification event to the channels of the rule that generated it. Delivery is asynchronous: the request marks the selected channels for redelivery and returns immediately. Channels whose delivery is still pending or already being resent are left untouched. |
534
+
505
535
  ## Runtime Validation (validate option)
506
536
 
507
537
  `validate` is off by default. The SDK's normal request/response mapping
@@ -1,6 +1,6 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse, UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
3
+ import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse, UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ExecuteAppActionRequest, ExecuteAppActionResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
4
4
  /**
5
5
  * List apps
6
6
  *
@@ -33,6 +33,15 @@ export declare function uninstallApp(client: Client, req: UninstallAppRequest, o
33
33
  * PUT /openmeter/apps/{appId}
34
34
  */
35
35
  export declare function updateApp(client: Client, req: UpdateAppRequest, options?: RequestOptions): Promise<Result<UpdateAppResponse>>;
36
+ /**
37
+ * Execute app action
38
+ *
39
+ * Execute an operator action on an installed app. The action must be listed in the
40
+ * app's `actions`; otherwise the request is rejected.
41
+ *
42
+ * POST /openmeter/apps/{appId}/action
43
+ */
44
+ export declare function executeAppAction(client: Client, req: ExecuteAppActionRequest, options?: RequestOptions): Promise<Result<ExecuteAppActionResponse>>;
36
45
  /**
37
46
  * List app catalog
38
47
  *
@@ -137,6 +137,46 @@ export function updateApp(client, req, options) {
137
137
  });
138
138
  });
139
139
  }
140
+ /**
141
+ * Execute app action
142
+ *
143
+ * Execute an operator action on an installed app. The action must be listed in the
144
+ * app's `actions`; otherwise the request is rejected.
145
+ *
146
+ * POST /openmeter/apps/{appId}/action
147
+ */
148
+ export function executeAppAction(client, req, options) {
149
+ return request(() => {
150
+ const pathParamsInput = {
151
+ appId: req.appId,
152
+ };
153
+ const pathParams = client._options.validate
154
+ ? toPathWire(pathParamsInput, schemas.executeAppActionPathParams)
155
+ : pathParamsInput;
156
+ if (client._options.validate) {
157
+ assertValid(schemas.executeAppActionPathParamsWire, pathParams);
158
+ }
159
+ const path = `openmeter/apps/${(() => {
160
+ if (pathParams.appId === undefined) {
161
+ throw new Error('missing path parameter: appId');
162
+ }
163
+ return encodeURIComponent(String(pathParams.appId));
164
+ })()}/action`;
165
+ const body = toWire(req.body, schemas.executeAppActionBody);
166
+ if (client._options.validate) {
167
+ assertValid(schemas.executeAppActionBodyWire, body);
168
+ }
169
+ return http(client)
170
+ .post(path, { ...options, json: body })
171
+ .json()
172
+ .then((data) => {
173
+ if (client._options.validate) {
174
+ assertValid(schemas.executeAppActionResponseWire, data);
175
+ }
176
+ return fromWire(data, schemas.executeAppActionResponse);
177
+ });
178
+ });
179
+ }
140
180
  /**
141
181
  * List app catalog
142
182
  *
@@ -1,6 +1,6 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, OverrideCustomerEntitlementRequest, OverrideCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCustomerEntitlementGrantRequest, CreateCustomerEntitlementGrantResponse, ListCustomerEntitlementGrantsRequest, ListCustomerEntitlementGrantsResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
3
+ import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingProfileRequest, UpdateCustomerBillingProfileResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, OverrideCustomerEntitlementRequest, OverrideCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCustomerEntitlementGrantRequest, CreateCustomerEntitlementGrantResponse, ListCustomerEntitlementGrantsRequest, ListCustomerEntitlementGrantsResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse, InvoiceCustomerChargesRequest, InvoiceCustomerChargesResponse } from '../models/operations/customers.js';
4
4
  /**
5
5
  * Create customer
6
6
  *
@@ -40,9 +40,23 @@ export declare function getCustomerBilling(client: Client, req: GetCustomerBilli
40
40
  /**
41
41
  * Update customer billing data
42
42
  *
43
+ * Update billing data while preserving the current profile selection when
44
+ * billing_profile is omitted or null. Use the dedicated billing profile endpoint
45
+ * to remove the selection.
46
+ *
43
47
  * PUT /openmeter/customers/{customerId}/billing
44
48
  */
45
49
  export declare function updateCustomerBilling(client: Client, req: UpdateCustomerBillingRequest, options?: RequestOptions): Promise<Result<UpdateCustomerBillingResponse>>;
50
+ /**
51
+ * Update customer billing profile
52
+ *
53
+ * Set the customer's explicit billing profile selection. Omitting billing_profile
54
+ * or setting it to null removes the selection and uses the current namespace
55
+ * default.
56
+ *
57
+ * PUT /openmeter/customers/{customerId}/billing/profile
58
+ */
59
+ export declare function updateCustomerBillingProfile(client: Client, req: UpdateCustomerBillingProfileRequest, options?: RequestOptions): Promise<Result<UpdateCustomerBillingProfileResponse>>;
46
60
  /**
47
61
  * Update customer billing app data
48
62
  *
@@ -295,3 +309,17 @@ export declare function listCustomerCharges(client: Client, req: ListCustomerCha
295
309
  * POST /openmeter/customers/{customerId}/charges
296
310
  */
297
311
  export declare function createCustomerCharges(client: Client, req: CreateCustomerChargesRequest, options?: RequestOptions): Promise<Result<CreateCustomerChargesResponse>>;
312
+ /**
313
+ * Invoice a customer's charges
314
+ *
315
+ * Invoice a customer's charges outside the normal billing cycle. Collection
316
+ * alignment is bypassed. The customer's progressive billing setting applies unless
317
+ * explicitly overridden. All eligible pending lines are considered.
318
+ *
319
+ * Returns the created standard invoices, one per collected currency. Lines blocked
320
+ * by their owning engine remain pending. If all eligible lines are blocked or no
321
+ * lines are eligible, returns a validation error.
322
+ *
323
+ * POST /openmeter/customers/{customerId}/charges/invoice
324
+ */
325
+ export declare function invoiceCustomerCharges(client: Client, req: InvoiceCustomerChargesRequest, options?: RequestOptions): Promise<Result<InvoiceCustomerChargesResponse>>;
@@ -187,6 +187,10 @@ export function getCustomerBilling(client, req, options) {
187
187
  /**
188
188
  * Update customer billing data
189
189
  *
190
+ * Update billing data while preserving the current profile selection when
191
+ * billing_profile is omitted or null. Use the dedicated billing profile endpoint
192
+ * to remove the selection.
193
+ *
190
194
  * PUT /openmeter/customers/{customerId}/billing
191
195
  */
192
196
  export function updateCustomerBilling(client, req, options) {
@@ -221,6 +225,47 @@ export function updateCustomerBilling(client, req, options) {
221
225
  });
222
226
  });
223
227
  }
228
+ /**
229
+ * Update customer billing profile
230
+ *
231
+ * Set the customer's explicit billing profile selection. Omitting billing_profile
232
+ * or setting it to null removes the selection and uses the current namespace
233
+ * default.
234
+ *
235
+ * PUT /openmeter/customers/{customerId}/billing/profile
236
+ */
237
+ export function updateCustomerBillingProfile(client, req, options) {
238
+ return request(() => {
239
+ const pathParamsInput = {
240
+ customerId: req.customerId,
241
+ };
242
+ const pathParams = client._options.validate
243
+ ? toPathWire(pathParamsInput, schemas.updateCustomerBillingProfilePathParams)
244
+ : pathParamsInput;
245
+ if (client._options.validate) {
246
+ assertValid(schemas.updateCustomerBillingProfilePathParamsWire, pathParams);
247
+ }
248
+ const path = `openmeter/customers/${(() => {
249
+ if (pathParams.customerId === undefined) {
250
+ throw new Error('missing path parameter: customerId');
251
+ }
252
+ return encodeURIComponent(String(pathParams.customerId));
253
+ })()}/billing/profile`;
254
+ const body = toWire(req.body, schemas.updateCustomerBillingProfileBody);
255
+ if (client._options.validate) {
256
+ assertValid(schemas.updateCustomerBillingProfileBodyWire, body);
257
+ }
258
+ return http(client)
259
+ .put(path, { ...options, json: body })
260
+ .json()
261
+ .then((data) => {
262
+ if (client._options.validate) {
263
+ assertValid(schemas.updateCustomerBillingProfileResponseWire, data);
264
+ }
265
+ return fromWire(data, schemas.updateCustomerBillingProfileResponse);
266
+ });
267
+ });
268
+ }
224
269
  /**
225
270
  * Update customer billing app data
226
271
  *
@@ -630,7 +675,7 @@ export function resetCustomerEntitlementUsage(client, req, options) {
630
675
  return encodeURIComponent(String(pathParams.entitlementId));
631
676
  })()}/reset`;
632
677
  const body = toWire(req.body, schemas.resetCustomerEntitlementUsageBody);
633
- if (client._options.validate) {
678
+ if (client._options.validate && body !== undefined) {
634
679
  assertValid(schemas.resetCustomerEntitlementUsageBodyWire, body);
635
680
  }
636
681
  await http(client).post(path, { ...options, json: body });
@@ -886,8 +931,12 @@ export function listCreditGrants(client, req, options) {
886
931
  }
887
932
  return encodeURIComponent(String(pathParams.customerId));
888
933
  })()}/credits/grants`;
934
+ if (client._options.validate && req.sort !== undefined) {
935
+ assertValid(schemas.listCreditGrantsQueryParams.shape.sort, req.sort);
936
+ }
889
937
  const query = toWire({
890
938
  page: req.page,
939
+ sort: encodeSort(req.sort, toSnakeCase),
891
940
  filter: req.filter,
892
941
  }, schemas.listCreditGrantsQueryParams);
893
942
  if (client._options.validate) {
@@ -1031,7 +1080,7 @@ export function voidCreditGrant(client, req, options) {
1031
1080
  return encodeURIComponent(String(pathParams.creditGrantId));
1032
1081
  })()}/void`;
1033
1082
  const body = toWire(req.body, schemas.voidCreditGrantBody);
1034
- if (client._options.validate) {
1083
+ if (client._options.validate && body !== undefined) {
1035
1084
  assertValid(schemas.voidCreditGrantBodyWire, body);
1036
1085
  }
1037
1086
  return http(client)
@@ -1230,3 +1279,48 @@ export function createCustomerCharges(client, req, options) {
1230
1279
  });
1231
1280
  });
1232
1281
  }
1282
+ /**
1283
+ * Invoice a customer's charges
1284
+ *
1285
+ * Invoice a customer's charges outside the normal billing cycle. Collection
1286
+ * alignment is bypassed. The customer's progressive billing setting applies unless
1287
+ * explicitly overridden. All eligible pending lines are considered.
1288
+ *
1289
+ * Returns the created standard invoices, one per collected currency. Lines blocked
1290
+ * by their owning engine remain pending. If all eligible lines are blocked or no
1291
+ * lines are eligible, returns a validation error.
1292
+ *
1293
+ * POST /openmeter/customers/{customerId}/charges/invoice
1294
+ */
1295
+ export function invoiceCustomerCharges(client, req, options) {
1296
+ return request(() => {
1297
+ const pathParamsInput = {
1298
+ customerId: req.customerId,
1299
+ };
1300
+ const pathParams = client._options.validate
1301
+ ? toPathWire(pathParamsInput, schemas.invoiceCustomerChargesPathParams)
1302
+ : pathParamsInput;
1303
+ if (client._options.validate) {
1304
+ assertValid(schemas.invoiceCustomerChargesPathParamsWire, pathParams);
1305
+ }
1306
+ const path = `openmeter/customers/${(() => {
1307
+ if (pathParams.customerId === undefined) {
1308
+ throw new Error('missing path parameter: customerId');
1309
+ }
1310
+ return encodeURIComponent(String(pathParams.customerId));
1311
+ })()}/charges/invoice`;
1312
+ const body = toWire(req.body, schemas.invoiceCustomerChargesBody);
1313
+ if (client._options.validate && body !== undefined) {
1314
+ assertValid(schemas.invoiceCustomerChargesBodyWire, body);
1315
+ }
1316
+ return http(client)
1317
+ .post(path, { ...options, json: body })
1318
+ .json()
1319
+ .then((data) => {
1320
+ if (client._options.validate) {
1321
+ assertValid(schemas.invoiceCustomerChargesResponseWire, data);
1322
+ }
1323
+ return fromWire(data, schemas.invoiceCustomerChargesResponse);
1324
+ });
1325
+ });
1326
+ }
@@ -186,7 +186,7 @@ export function queryFeatureCost(client, req, options) {
186
186
  return encodeURIComponent(String(pathParams.featureId));
187
187
  })()}/cost/query`;
188
188
  const body = toWire(req.body, schemas.queryFeatureCostBody);
189
- if (client._options.validate) {
189
+ if (client._options.validate && body !== undefined) {
190
190
  assertValid(schemas.queryFeatureCostBodyWire, body);
191
191
  }
192
192
  return http(client)
@@ -1,6 +1,6 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { ListNotificationChannelsRequest, ListNotificationChannelsResponse, CreateNotificationChannelRequest, CreateNotificationChannelResponse, GetNotificationChannelRequest, GetNotificationChannelResponse, UpdateNotificationChannelRequest, UpdateNotificationChannelResponse, DeleteNotificationChannelRequest, DeleteNotificationChannelResponse } from '../models/operations/notifications.js';
3
+ import type { ListBillingNotificationChannelsRequest, ListBillingNotificationChannelsResponse, CreateBillingNotificationChannelRequest, CreateBillingNotificationChannelResponse, GetBillingNotificationChannelRequest, GetBillingNotificationChannelResponse, UpdateBillingNotificationChannelRequest, UpdateBillingNotificationChannelResponse, DeleteBillingNotificationChannelRequest, DeleteBillingNotificationChannelResponse, ListBillingNotificationRulesRequest, ListBillingNotificationRulesResponse, CreateBillingNotificationRuleRequest, CreateBillingNotificationRuleResponse, GetBillingNotificationRuleRequest, GetBillingNotificationRuleResponse, UpdateBillingNotificationRuleRequest, UpdateBillingNotificationRuleResponse, DeleteBillingNotificationRuleRequest, DeleteBillingNotificationRuleResponse, TestBillingNotificationRuleRequest, TestBillingNotificationRuleResponse, ListBillingNotificationEventsRequest, ListBillingNotificationEventsResponse, GetBillingNotificationEventRequest, GetBillingNotificationEventResponse, ResendBillingNotificationEventRequest, ResendBillingNotificationEventResponse } from '../models/operations/notifications.js';
4
4
  /**
5
5
  * List notification channels
6
6
  *
@@ -8,7 +8,7 @@ import type { ListNotificationChannelsRequest, ListNotificationChannelsResponse,
8
8
  *
9
9
  * GET /openmeter/notification/channels
10
10
  */
11
- export declare function listNotificationChannels(client: Client, req?: ListNotificationChannelsRequest, options?: RequestOptions): Promise<Result<ListNotificationChannelsResponse>>;
11
+ export declare function listBillingNotificationChannels(client: Client, req?: ListBillingNotificationChannelsRequest, options?: RequestOptions): Promise<Result<ListBillingNotificationChannelsResponse>>;
12
12
  /**
13
13
  * Create notification channel
14
14
  *
@@ -16,7 +16,7 @@ export declare function listNotificationChannels(client: Client, req?: ListNotif
16
16
  *
17
17
  * POST /openmeter/notification/channels
18
18
  */
19
- export declare function createNotificationChannel(client: Client, req: CreateNotificationChannelRequest, options?: RequestOptions): Promise<Result<CreateNotificationChannelResponse>>;
19
+ export declare function createBillingNotificationChannel(client: Client, req: CreateBillingNotificationChannelRequest, options?: RequestOptions): Promise<Result<CreateBillingNotificationChannelResponse>>;
20
20
  /**
21
21
  * Get notification channel
22
22
  *
@@ -24,7 +24,7 @@ export declare function createNotificationChannel(client: Client, req: CreateNot
24
24
  *
25
25
  * GET /openmeter/notification/channels/{notificationChannelId}
26
26
  */
27
- export declare function getNotificationChannel(client: Client, req: GetNotificationChannelRequest, options?: RequestOptions): Promise<Result<GetNotificationChannelResponse>>;
27
+ export declare function getBillingNotificationChannel(client: Client, req: GetBillingNotificationChannelRequest, options?: RequestOptions): Promise<Result<GetBillingNotificationChannelResponse>>;
28
28
  /**
29
29
  * Update notification channel
30
30
  *
@@ -32,7 +32,7 @@ export declare function getNotificationChannel(client: Client, req: GetNotificat
32
32
  *
33
33
  * PUT /openmeter/notification/channels/{notificationChannelId}
34
34
  */
35
- export declare function updateNotificationChannel(client: Client, req: UpdateNotificationChannelRequest, options?: RequestOptions): Promise<Result<UpdateNotificationChannelResponse>>;
35
+ export declare function updateBillingNotificationChannel(client: Client, req: UpdateBillingNotificationChannelRequest, options?: RequestOptions): Promise<Result<UpdateBillingNotificationChannelResponse>>;
36
36
  /**
37
37
  * Delete notification channel
38
38
  *
@@ -40,4 +40,82 @@ export declare function updateNotificationChannel(client: Client, req: UpdateNot
40
40
  *
41
41
  * DELETE /openmeter/notification/channels/{notificationChannelId}
42
42
  */
43
- export declare function deleteNotificationChannel(client: Client, req: DeleteNotificationChannelRequest, options?: RequestOptions): Promise<Result<DeleteNotificationChannelResponse>>;
43
+ export declare function deleteBillingNotificationChannel(client: Client, req: DeleteBillingNotificationChannelRequest, options?: RequestOptions): Promise<Result<DeleteBillingNotificationChannelResponse>>;
44
+ /**
45
+ * List notification rules
46
+ *
47
+ * List all notification rules.
48
+ *
49
+ * GET /openmeter/notification/rules
50
+ */
51
+ export declare function listBillingNotificationRules(client: Client, req?: ListBillingNotificationRulesRequest, options?: RequestOptions): Promise<Result<ListBillingNotificationRulesResponse>>;
52
+ /**
53
+ * Create notification rule
54
+ *
55
+ * Create a notification rule.
56
+ *
57
+ * POST /openmeter/notification/rules
58
+ */
59
+ export declare function createBillingNotificationRule(client: Client, req: CreateBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<CreateBillingNotificationRuleResponse>>;
60
+ /**
61
+ * Get notification rule
62
+ *
63
+ * Get a notification rule by id.
64
+ *
65
+ * GET /openmeter/notification/rules/{notificationRuleId}
66
+ */
67
+ export declare function getBillingNotificationRule(client: Client, req: GetBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<GetBillingNotificationRuleResponse>>;
68
+ /**
69
+ * Update notification rule
70
+ *
71
+ * Update a notification rule by id.
72
+ *
73
+ * PUT /openmeter/notification/rules/{notificationRuleId}
74
+ */
75
+ export declare function updateBillingNotificationRule(client: Client, req: UpdateBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<UpdateBillingNotificationRuleResponse>>;
76
+ /**
77
+ * Delete notification rule
78
+ *
79
+ * Delete a notification rule by id.
80
+ *
81
+ * DELETE /openmeter/notification/rules/{notificationRuleId}
82
+ */
83
+ export declare function deleteBillingNotificationRule(client: Client, req: DeleteBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<DeleteBillingNotificationRuleResponse>>;
84
+ /**
85
+ * Test notification rule
86
+ *
87
+ * Test a notification rule by generating an event with sample data and delivering
88
+ * it to the rule's channels. The test event is persisted and listed like any other
89
+ * event.
90
+ *
91
+ * POST /openmeter/notification/rules/{notificationRuleId}/test
92
+ */
93
+ export declare function testBillingNotificationRule(client: Client, req: TestBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<TestBillingNotificationRuleResponse>>;
94
+ /**
95
+ * List notification events
96
+ *
97
+ * List all notification events.
98
+ *
99
+ * GET /openmeter/notification/events
100
+ */
101
+ export declare function listBillingNotificationEvents(client: Client, req?: ListBillingNotificationEventsRequest, options?: RequestOptions): Promise<Result<ListBillingNotificationEventsResponse>>;
102
+ /**
103
+ * Get notification event
104
+ *
105
+ * Get a notification event by id.
106
+ *
107
+ * GET /openmeter/notification/events/{notificationEventId}
108
+ */
109
+ export declare function getBillingNotificationEvent(client: Client, req: GetBillingNotificationEventRequest, options?: RequestOptions): Promise<Result<GetBillingNotificationEventResponse>>;
110
+ /**
111
+ * Resend notification event
112
+ *
113
+ * Resend a notification event to the channels of the rule that generated it.
114
+ *
115
+ * Delivery is asynchronous: the request marks the selected channels for redelivery
116
+ * and returns immediately. Channels whose delivery is still pending or already
117
+ * being resent are left untouched.
118
+ *
119
+ * POST /openmeter/notification/events/{notificationEventId}/resend
120
+ */
121
+ export declare function resendBillingNotificationEvent(client: Client, req: ResendBillingNotificationEventRequest, options?: RequestOptions): Promise<Result<ResendBillingNotificationEventResponse>>;