@openmeter/client 1.0.0-beta-93c878ce5648 → 1.0.0-beta-8239676745d4
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 +18 -18
- package/dist/funcs/notifications.d.ts +15 -15
- package/dist/funcs/notifications.js +73 -73
- package/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/notifications.d.ts +33 -33
- package/dist/models/schemas.d.ts +56 -56
- package/dist/models/schemas.js +56 -56
- package/dist/sdk/internal.d.ts +12 -12
- package/dist/sdk/internal.js +23 -23
- package/dist/sdk/notifications.d.ts +7 -7
- package/dist/sdk/notifications.js +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -483,13 +483,13 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
483
483
|
|
|
484
484
|
### Notifications
|
|
485
485
|
|
|
486
|
-
| Method
|
|
487
|
-
|
|
|
488
|
-
| `client.notifications.
|
|
489
|
-
| `client.notifications.
|
|
490
|
-
| `client.notifications.
|
|
491
|
-
| `client.notifications.
|
|
492
|
-
| `client.notifications.
|
|
486
|
+
| Method | HTTP | Description |
|
|
487
|
+
| ------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------ |
|
|
488
|
+
| `client.notifications.listBillingChannels` | `GET /openmeter/notification/channels` | List all notification channels. |
|
|
489
|
+
| `client.notifications.createBillingChannel` | `POST /openmeter/notification/channels` | Create a notification channel. |
|
|
490
|
+
| `client.notifications.getBillingChannel` | `GET /openmeter/notification/channels/{notificationChannelId}` | Get a notification channel by id. |
|
|
491
|
+
| `client.notifications.updateBillingChannel` | `PUT /openmeter/notification/channels/{notificationChannelId}` | Update a notification channel by id. |
|
|
492
|
+
| `client.notifications.deleteBillingChannel` | `DELETE /openmeter/notification/channels/{notificationChannelId}` | Delete a notification channel by id. |
|
|
493
493
|
|
|
494
494
|
## Internal Operations
|
|
495
495
|
|
|
@@ -513,17 +513,17 @@ they can change or be removed without notice or semver consideration.
|
|
|
513
513
|
|
|
514
514
|
### Internal Notifications
|
|
515
515
|
|
|
516
|
-
| Method
|
|
517
|
-
|
|
|
518
|
-
| `client.internal.notifications.
|
|
519
|
-
| `client.internal.notifications.
|
|
520
|
-
| `client.internal.notifications.
|
|
521
|
-
| `client.internal.notifications.
|
|
522
|
-
| `client.internal.notifications.
|
|
523
|
-
| `client.internal.notifications.
|
|
524
|
-
| `client.internal.notifications.
|
|
525
|
-
| `client.internal.notifications.
|
|
526
|
-
| `client.internal.notifications.
|
|
516
|
+
| Method | HTTP | Description |
|
|
517
|
+
| -------------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
518
|
+
| `client.internal.notifications.listBillingRules` | `GET /openmeter/notification/rules` | List all notification rules. |
|
|
519
|
+
| `client.internal.notifications.createBillingRule` | `POST /openmeter/notification/rules` | Create a notification rule. |
|
|
520
|
+
| `client.internal.notifications.getBillingRule` | `GET /openmeter/notification/rules/{notificationRuleId}` | Get a notification rule by id. |
|
|
521
|
+
| `client.internal.notifications.updateBillingRule` | `PUT /openmeter/notification/rules/{notificationRuleId}` | Update a notification rule by id. |
|
|
522
|
+
| `client.internal.notifications.deleteBillingRule` | `DELETE /openmeter/notification/rules/{notificationRuleId}` | Delete a notification rule by id. |
|
|
523
|
+
| `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. |
|
|
524
|
+
| `client.internal.notifications.listBillingEvents` | `GET /openmeter/notification/events` | List all notification events. |
|
|
525
|
+
| `client.internal.notifications.getBillingEvent` | `GET /openmeter/notification/events/{notificationEventId}` | Get a notification event by id. |
|
|
526
|
+
| `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. |
|
|
527
527
|
|
|
528
528
|
## Runtime Validation (validate option)
|
|
529
529
|
|
|
@@ -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 {
|
|
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
|
|
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
|
|
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
|
|
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
|
|
35
|
+
export declare function updateBillingNotificationChannel(client: Client, req: UpdateBillingNotificationChannelRequest, options?: RequestOptions): Promise<Result<UpdateBillingNotificationChannelResponse>>;
|
|
36
36
|
/**
|
|
37
37
|
* Delete notification channel
|
|
38
38
|
*
|
|
@@ -40,7 +40,7 @@ export declare function updateNotificationChannel(client: Client, req: UpdateNot
|
|
|
40
40
|
*
|
|
41
41
|
* DELETE /openmeter/notification/channels/{notificationChannelId}
|
|
42
42
|
*/
|
|
43
|
-
export declare function
|
|
43
|
+
export declare function deleteBillingNotificationChannel(client: Client, req: DeleteBillingNotificationChannelRequest, options?: RequestOptions): Promise<Result<DeleteBillingNotificationChannelResponse>>;
|
|
44
44
|
/**
|
|
45
45
|
* List notification rules
|
|
46
46
|
*
|
|
@@ -48,7 +48,7 @@ export declare function deleteNotificationChannel(client: Client, req: DeleteNot
|
|
|
48
48
|
*
|
|
49
49
|
* GET /openmeter/notification/rules
|
|
50
50
|
*/
|
|
51
|
-
export declare function
|
|
51
|
+
export declare function listBillingNotificationRules(client: Client, req?: ListBillingNotificationRulesRequest, options?: RequestOptions): Promise<Result<ListBillingNotificationRulesResponse>>;
|
|
52
52
|
/**
|
|
53
53
|
* Create notification rule
|
|
54
54
|
*
|
|
@@ -56,7 +56,7 @@ export declare function listNotificationRules(client: Client, req?: ListNotifica
|
|
|
56
56
|
*
|
|
57
57
|
* POST /openmeter/notification/rules
|
|
58
58
|
*/
|
|
59
|
-
export declare function
|
|
59
|
+
export declare function createBillingNotificationRule(client: Client, req: CreateBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<CreateBillingNotificationRuleResponse>>;
|
|
60
60
|
/**
|
|
61
61
|
* Get notification rule
|
|
62
62
|
*
|
|
@@ -64,7 +64,7 @@ export declare function createNotificationRule(client: Client, req: CreateNotifi
|
|
|
64
64
|
*
|
|
65
65
|
* GET /openmeter/notification/rules/{notificationRuleId}
|
|
66
66
|
*/
|
|
67
|
-
export declare function
|
|
67
|
+
export declare function getBillingNotificationRule(client: Client, req: GetBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<GetBillingNotificationRuleResponse>>;
|
|
68
68
|
/**
|
|
69
69
|
* Update notification rule
|
|
70
70
|
*
|
|
@@ -72,7 +72,7 @@ export declare function getNotificationRule(client: Client, req: GetNotification
|
|
|
72
72
|
*
|
|
73
73
|
* PUT /openmeter/notification/rules/{notificationRuleId}
|
|
74
74
|
*/
|
|
75
|
-
export declare function
|
|
75
|
+
export declare function updateBillingNotificationRule(client: Client, req: UpdateBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<UpdateBillingNotificationRuleResponse>>;
|
|
76
76
|
/**
|
|
77
77
|
* Delete notification rule
|
|
78
78
|
*
|
|
@@ -80,7 +80,7 @@ export declare function updateNotificationRule(client: Client, req: UpdateNotifi
|
|
|
80
80
|
*
|
|
81
81
|
* DELETE /openmeter/notification/rules/{notificationRuleId}
|
|
82
82
|
*/
|
|
83
|
-
export declare function
|
|
83
|
+
export declare function deleteBillingNotificationRule(client: Client, req: DeleteBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<DeleteBillingNotificationRuleResponse>>;
|
|
84
84
|
/**
|
|
85
85
|
* Test notification rule
|
|
86
86
|
*
|
|
@@ -90,7 +90,7 @@ export declare function deleteNotificationRule(client: Client, req: DeleteNotifi
|
|
|
90
90
|
*
|
|
91
91
|
* POST /openmeter/notification/rules/{notificationRuleId}/test
|
|
92
92
|
*/
|
|
93
|
-
export declare function
|
|
93
|
+
export declare function testBillingNotificationRule(client: Client, req: TestBillingNotificationRuleRequest, options?: RequestOptions): Promise<Result<TestBillingNotificationRuleResponse>>;
|
|
94
94
|
/**
|
|
95
95
|
* List notification events
|
|
96
96
|
*
|
|
@@ -98,7 +98,7 @@ export declare function testNotificationRule(client: Client, req: TestNotificati
|
|
|
98
98
|
*
|
|
99
99
|
* GET /openmeter/notification/events
|
|
100
100
|
*/
|
|
101
|
-
export declare function
|
|
101
|
+
export declare function listBillingNotificationEvents(client: Client, req?: ListBillingNotificationEventsRequest, options?: RequestOptions): Promise<Result<ListBillingNotificationEventsResponse>>;
|
|
102
102
|
/**
|
|
103
103
|
* Get notification event
|
|
104
104
|
*
|
|
@@ -106,7 +106,7 @@ export declare function listNotificationEvents(client: Client, req?: ListNotific
|
|
|
106
106
|
*
|
|
107
107
|
* GET /openmeter/notification/events/{notificationEventId}
|
|
108
108
|
*/
|
|
109
|
-
export declare function
|
|
109
|
+
export declare function getBillingNotificationEvent(client: Client, req: GetBillingNotificationEventRequest, options?: RequestOptions): Promise<Result<GetBillingNotificationEventResponse>>;
|
|
110
110
|
/**
|
|
111
111
|
* Resend notification event
|
|
112
112
|
*
|
|
@@ -118,4 +118,4 @@ export declare function getNotificationEvent(client: Client, req: GetNotificatio
|
|
|
118
118
|
*
|
|
119
119
|
* POST /openmeter/notification/events/{notificationEventId}/resend
|
|
120
120
|
*/
|
|
121
|
-
export declare function
|
|
121
|
+
export declare function resendBillingNotificationEvent(client: Client, req: ResendBillingNotificationEventRequest, options?: RequestOptions): Promise<Result<ResendBillingNotificationEventResponse>>;
|
|
@@ -11,18 +11,18 @@ import * as schemas from '../models/schemas.js';
|
|
|
11
11
|
*
|
|
12
12
|
* GET /openmeter/notification/channels
|
|
13
13
|
*/
|
|
14
|
-
export function
|
|
14
|
+
export function listBillingNotificationChannels(client, req = {}, options) {
|
|
15
15
|
return request(() => {
|
|
16
16
|
if (client._options.validate && req.sort !== undefined) {
|
|
17
|
-
assertValid(schemas.
|
|
17
|
+
assertValid(schemas.listBillingNotificationChannelsQueryParams.shape.sort, req.sort);
|
|
18
18
|
}
|
|
19
19
|
const query = toWire({
|
|
20
20
|
page: req.page,
|
|
21
21
|
sort: encodeSort(req.sort, toSnakeCase),
|
|
22
22
|
filter: req.filter,
|
|
23
|
-
}, schemas.
|
|
23
|
+
}, schemas.listBillingNotificationChannelsQueryParams);
|
|
24
24
|
if (client._options.validate) {
|
|
25
|
-
assertValid(schemas.
|
|
25
|
+
assertValid(schemas.listBillingNotificationChannelsQueryParamsWire, query);
|
|
26
26
|
}
|
|
27
27
|
const searchParams = toURLSearchParams(query);
|
|
28
28
|
return http(client)
|
|
@@ -30,9 +30,9 @@ export function listNotificationChannels(client, req = {}, options) {
|
|
|
30
30
|
.json()
|
|
31
31
|
.then((data) => {
|
|
32
32
|
if (client._options.validate) {
|
|
33
|
-
assertValid(schemas.
|
|
33
|
+
assertValid(schemas.listBillingNotificationChannelsResponseWire, data);
|
|
34
34
|
}
|
|
35
|
-
return fromWire(data, schemas.
|
|
35
|
+
return fromWire(data, schemas.listBillingNotificationChannelsResponse);
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
}
|
|
@@ -43,20 +43,20 @@ export function listNotificationChannels(client, req = {}, options) {
|
|
|
43
43
|
*
|
|
44
44
|
* POST /openmeter/notification/channels
|
|
45
45
|
*/
|
|
46
|
-
export function
|
|
46
|
+
export function createBillingNotificationChannel(client, req, options) {
|
|
47
47
|
return request(() => {
|
|
48
|
-
const body = toWire(req, schemas.
|
|
48
|
+
const body = toWire(req, schemas.createBillingNotificationChannelBody);
|
|
49
49
|
if (client._options.validate) {
|
|
50
|
-
assertValid(schemas.
|
|
50
|
+
assertValid(schemas.createBillingNotificationChannelBodyWire, body);
|
|
51
51
|
}
|
|
52
52
|
return http(client)
|
|
53
53
|
.post('openmeter/notification/channels', { ...options, json: body })
|
|
54
54
|
.json()
|
|
55
55
|
.then((data) => {
|
|
56
56
|
if (client._options.validate) {
|
|
57
|
-
assertValid(schemas.
|
|
57
|
+
assertValid(schemas.createBillingNotificationChannelResponseWire, data);
|
|
58
58
|
}
|
|
59
|
-
return fromWire(data, schemas.
|
|
59
|
+
return fromWire(data, schemas.createBillingNotificationChannelResponse);
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
}
|
|
@@ -67,16 +67,16 @@ export function createNotificationChannel(client, req, options) {
|
|
|
67
67
|
*
|
|
68
68
|
* GET /openmeter/notification/channels/{notificationChannelId}
|
|
69
69
|
*/
|
|
70
|
-
export function
|
|
70
|
+
export function getBillingNotificationChannel(client, req, options) {
|
|
71
71
|
return request(() => {
|
|
72
72
|
const pathParamsInput = {
|
|
73
73
|
notificationChannelId: req.notificationChannelId,
|
|
74
74
|
};
|
|
75
75
|
const pathParams = client._options.validate
|
|
76
|
-
? toPathWire(pathParamsInput, schemas.
|
|
76
|
+
? toPathWire(pathParamsInput, schemas.getBillingNotificationChannelPathParams)
|
|
77
77
|
: pathParamsInput;
|
|
78
78
|
if (client._options.validate) {
|
|
79
|
-
assertValid(schemas.
|
|
79
|
+
assertValid(schemas.getBillingNotificationChannelPathParamsWire, pathParams);
|
|
80
80
|
}
|
|
81
81
|
const path = `openmeter/notification/channels/${(() => {
|
|
82
82
|
if (pathParams.notificationChannelId === undefined) {
|
|
@@ -89,9 +89,9 @@ export function getNotificationChannel(client, req, options) {
|
|
|
89
89
|
.json()
|
|
90
90
|
.then((data) => {
|
|
91
91
|
if (client._options.validate) {
|
|
92
|
-
assertValid(schemas.
|
|
92
|
+
assertValid(schemas.getBillingNotificationChannelResponseWire, data);
|
|
93
93
|
}
|
|
94
|
-
return fromWire(data, schemas.
|
|
94
|
+
return fromWire(data, schemas.getBillingNotificationChannelResponse);
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -102,16 +102,16 @@ export function getNotificationChannel(client, req, options) {
|
|
|
102
102
|
*
|
|
103
103
|
* PUT /openmeter/notification/channels/{notificationChannelId}
|
|
104
104
|
*/
|
|
105
|
-
export function
|
|
105
|
+
export function updateBillingNotificationChannel(client, req, options) {
|
|
106
106
|
return request(() => {
|
|
107
107
|
const pathParamsInput = {
|
|
108
108
|
notificationChannelId: req.notificationChannelId,
|
|
109
109
|
};
|
|
110
110
|
const pathParams = client._options.validate
|
|
111
|
-
? toPathWire(pathParamsInput, schemas.
|
|
111
|
+
? toPathWire(pathParamsInput, schemas.updateBillingNotificationChannelPathParams)
|
|
112
112
|
: pathParamsInput;
|
|
113
113
|
if (client._options.validate) {
|
|
114
|
-
assertValid(schemas.
|
|
114
|
+
assertValid(schemas.updateBillingNotificationChannelPathParamsWire, pathParams);
|
|
115
115
|
}
|
|
116
116
|
const path = `openmeter/notification/channels/${(() => {
|
|
117
117
|
if (pathParams.notificationChannelId === undefined) {
|
|
@@ -119,18 +119,18 @@ export function updateNotificationChannel(client, req, options) {
|
|
|
119
119
|
}
|
|
120
120
|
return encodeURIComponent(String(pathParams.notificationChannelId));
|
|
121
121
|
})()}`;
|
|
122
|
-
const body = toWire(req.body, schemas.
|
|
122
|
+
const body = toWire(req.body, schemas.updateBillingNotificationChannelBody);
|
|
123
123
|
if (client._options.validate) {
|
|
124
|
-
assertValid(schemas.
|
|
124
|
+
assertValid(schemas.updateBillingNotificationChannelBodyWire, body);
|
|
125
125
|
}
|
|
126
126
|
return http(client)
|
|
127
127
|
.put(path, { ...options, json: body })
|
|
128
128
|
.json()
|
|
129
129
|
.then((data) => {
|
|
130
130
|
if (client._options.validate) {
|
|
131
|
-
assertValid(schemas.
|
|
131
|
+
assertValid(schemas.updateBillingNotificationChannelResponseWire, data);
|
|
132
132
|
}
|
|
133
|
-
return fromWire(data, schemas.
|
|
133
|
+
return fromWire(data, schemas.updateBillingNotificationChannelResponse);
|
|
134
134
|
});
|
|
135
135
|
});
|
|
136
136
|
}
|
|
@@ -141,16 +141,16 @@ export function updateNotificationChannel(client, req, options) {
|
|
|
141
141
|
*
|
|
142
142
|
* DELETE /openmeter/notification/channels/{notificationChannelId}
|
|
143
143
|
*/
|
|
144
|
-
export function
|
|
144
|
+
export function deleteBillingNotificationChannel(client, req, options) {
|
|
145
145
|
return request(async () => {
|
|
146
146
|
const pathParamsInput = {
|
|
147
147
|
notificationChannelId: req.notificationChannelId,
|
|
148
148
|
};
|
|
149
149
|
const pathParams = client._options.validate
|
|
150
|
-
? toPathWire(pathParamsInput, schemas.
|
|
150
|
+
? toPathWire(pathParamsInput, schemas.deleteBillingNotificationChannelPathParams)
|
|
151
151
|
: pathParamsInput;
|
|
152
152
|
if (client._options.validate) {
|
|
153
|
-
assertValid(schemas.
|
|
153
|
+
assertValid(schemas.deleteBillingNotificationChannelPathParamsWire, pathParams);
|
|
154
154
|
}
|
|
155
155
|
const path = `openmeter/notification/channels/${(() => {
|
|
156
156
|
if (pathParams.notificationChannelId === undefined) {
|
|
@@ -168,18 +168,18 @@ export function deleteNotificationChannel(client, req, options) {
|
|
|
168
168
|
*
|
|
169
169
|
* GET /openmeter/notification/rules
|
|
170
170
|
*/
|
|
171
|
-
export function
|
|
171
|
+
export function listBillingNotificationRules(client, req = {}, options) {
|
|
172
172
|
return request(() => {
|
|
173
173
|
if (client._options.validate && req.sort !== undefined) {
|
|
174
|
-
assertValid(schemas.
|
|
174
|
+
assertValid(schemas.listBillingNotificationRulesQueryParams.shape.sort, req.sort);
|
|
175
175
|
}
|
|
176
176
|
const query = toWire({
|
|
177
177
|
page: req.page,
|
|
178
178
|
sort: encodeSort(req.sort, toSnakeCase),
|
|
179
179
|
filter: req.filter,
|
|
180
|
-
}, schemas.
|
|
180
|
+
}, schemas.listBillingNotificationRulesQueryParams);
|
|
181
181
|
if (client._options.validate) {
|
|
182
|
-
assertValid(schemas.
|
|
182
|
+
assertValid(schemas.listBillingNotificationRulesQueryParamsWire, query);
|
|
183
183
|
}
|
|
184
184
|
const searchParams = toURLSearchParams(query);
|
|
185
185
|
return http(client)
|
|
@@ -187,9 +187,9 @@ export function listNotificationRules(client, req = {}, options) {
|
|
|
187
187
|
.json()
|
|
188
188
|
.then((data) => {
|
|
189
189
|
if (client._options.validate) {
|
|
190
|
-
assertValid(schemas.
|
|
190
|
+
assertValid(schemas.listBillingNotificationRulesResponseWire, data);
|
|
191
191
|
}
|
|
192
|
-
return fromWire(data, schemas.
|
|
192
|
+
return fromWire(data, schemas.listBillingNotificationRulesResponse);
|
|
193
193
|
});
|
|
194
194
|
});
|
|
195
195
|
}
|
|
@@ -200,20 +200,20 @@ export function listNotificationRules(client, req = {}, options) {
|
|
|
200
200
|
*
|
|
201
201
|
* POST /openmeter/notification/rules
|
|
202
202
|
*/
|
|
203
|
-
export function
|
|
203
|
+
export function createBillingNotificationRule(client, req, options) {
|
|
204
204
|
return request(() => {
|
|
205
|
-
const body = toWire(req, schemas.
|
|
205
|
+
const body = toWire(req, schemas.createBillingNotificationRuleBody);
|
|
206
206
|
if (client._options.validate) {
|
|
207
|
-
assertValid(schemas.
|
|
207
|
+
assertValid(schemas.createBillingNotificationRuleBodyWire, body);
|
|
208
208
|
}
|
|
209
209
|
return http(client)
|
|
210
210
|
.post('openmeter/notification/rules', { ...options, json: body })
|
|
211
211
|
.json()
|
|
212
212
|
.then((data) => {
|
|
213
213
|
if (client._options.validate) {
|
|
214
|
-
assertValid(schemas.
|
|
214
|
+
assertValid(schemas.createBillingNotificationRuleResponseWire, data);
|
|
215
215
|
}
|
|
216
|
-
return fromWire(data, schemas.
|
|
216
|
+
return fromWire(data, schemas.createBillingNotificationRuleResponse);
|
|
217
217
|
});
|
|
218
218
|
});
|
|
219
219
|
}
|
|
@@ -224,16 +224,16 @@ export function createNotificationRule(client, req, options) {
|
|
|
224
224
|
*
|
|
225
225
|
* GET /openmeter/notification/rules/{notificationRuleId}
|
|
226
226
|
*/
|
|
227
|
-
export function
|
|
227
|
+
export function getBillingNotificationRule(client, req, options) {
|
|
228
228
|
return request(() => {
|
|
229
229
|
const pathParamsInput = {
|
|
230
230
|
notificationRuleId: req.notificationRuleId,
|
|
231
231
|
};
|
|
232
232
|
const pathParams = client._options.validate
|
|
233
|
-
? toPathWire(pathParamsInput, schemas.
|
|
233
|
+
? toPathWire(pathParamsInput, schemas.getBillingNotificationRulePathParams)
|
|
234
234
|
: pathParamsInput;
|
|
235
235
|
if (client._options.validate) {
|
|
236
|
-
assertValid(schemas.
|
|
236
|
+
assertValid(schemas.getBillingNotificationRulePathParamsWire, pathParams);
|
|
237
237
|
}
|
|
238
238
|
const path = `openmeter/notification/rules/${(() => {
|
|
239
239
|
if (pathParams.notificationRuleId === undefined) {
|
|
@@ -246,9 +246,9 @@ export function getNotificationRule(client, req, options) {
|
|
|
246
246
|
.json()
|
|
247
247
|
.then((data) => {
|
|
248
248
|
if (client._options.validate) {
|
|
249
|
-
assertValid(schemas.
|
|
249
|
+
assertValid(schemas.getBillingNotificationRuleResponseWire, data);
|
|
250
250
|
}
|
|
251
|
-
return fromWire(data, schemas.
|
|
251
|
+
return fromWire(data, schemas.getBillingNotificationRuleResponse);
|
|
252
252
|
});
|
|
253
253
|
});
|
|
254
254
|
}
|
|
@@ -259,16 +259,16 @@ export function getNotificationRule(client, req, options) {
|
|
|
259
259
|
*
|
|
260
260
|
* PUT /openmeter/notification/rules/{notificationRuleId}
|
|
261
261
|
*/
|
|
262
|
-
export function
|
|
262
|
+
export function updateBillingNotificationRule(client, req, options) {
|
|
263
263
|
return request(() => {
|
|
264
264
|
const pathParamsInput = {
|
|
265
265
|
notificationRuleId: req.notificationRuleId,
|
|
266
266
|
};
|
|
267
267
|
const pathParams = client._options.validate
|
|
268
|
-
? toPathWire(pathParamsInput, schemas.
|
|
268
|
+
? toPathWire(pathParamsInput, schemas.updateBillingNotificationRulePathParams)
|
|
269
269
|
: pathParamsInput;
|
|
270
270
|
if (client._options.validate) {
|
|
271
|
-
assertValid(schemas.
|
|
271
|
+
assertValid(schemas.updateBillingNotificationRulePathParamsWire, pathParams);
|
|
272
272
|
}
|
|
273
273
|
const path = `openmeter/notification/rules/${(() => {
|
|
274
274
|
if (pathParams.notificationRuleId === undefined) {
|
|
@@ -276,18 +276,18 @@ export function updateNotificationRule(client, req, options) {
|
|
|
276
276
|
}
|
|
277
277
|
return encodeURIComponent(String(pathParams.notificationRuleId));
|
|
278
278
|
})()}`;
|
|
279
|
-
const body = toWire(req.body, schemas.
|
|
279
|
+
const body = toWire(req.body, schemas.updateBillingNotificationRuleBody);
|
|
280
280
|
if (client._options.validate) {
|
|
281
|
-
assertValid(schemas.
|
|
281
|
+
assertValid(schemas.updateBillingNotificationRuleBodyWire, body);
|
|
282
282
|
}
|
|
283
283
|
return http(client)
|
|
284
284
|
.put(path, { ...options, json: body })
|
|
285
285
|
.json()
|
|
286
286
|
.then((data) => {
|
|
287
287
|
if (client._options.validate) {
|
|
288
|
-
assertValid(schemas.
|
|
288
|
+
assertValid(schemas.updateBillingNotificationRuleResponseWire, data);
|
|
289
289
|
}
|
|
290
|
-
return fromWire(data, schemas.
|
|
290
|
+
return fromWire(data, schemas.updateBillingNotificationRuleResponse);
|
|
291
291
|
});
|
|
292
292
|
});
|
|
293
293
|
}
|
|
@@ -298,16 +298,16 @@ export function updateNotificationRule(client, req, options) {
|
|
|
298
298
|
*
|
|
299
299
|
* DELETE /openmeter/notification/rules/{notificationRuleId}
|
|
300
300
|
*/
|
|
301
|
-
export function
|
|
301
|
+
export function deleteBillingNotificationRule(client, req, options) {
|
|
302
302
|
return request(async () => {
|
|
303
303
|
const pathParamsInput = {
|
|
304
304
|
notificationRuleId: req.notificationRuleId,
|
|
305
305
|
};
|
|
306
306
|
const pathParams = client._options.validate
|
|
307
|
-
? toPathWire(pathParamsInput, schemas.
|
|
307
|
+
? toPathWire(pathParamsInput, schemas.deleteBillingNotificationRulePathParams)
|
|
308
308
|
: pathParamsInput;
|
|
309
309
|
if (client._options.validate) {
|
|
310
|
-
assertValid(schemas.
|
|
310
|
+
assertValid(schemas.deleteBillingNotificationRulePathParamsWire, pathParams);
|
|
311
311
|
}
|
|
312
312
|
const path = `openmeter/notification/rules/${(() => {
|
|
313
313
|
if (pathParams.notificationRuleId === undefined) {
|
|
@@ -327,16 +327,16 @@ export function deleteNotificationRule(client, req, options) {
|
|
|
327
327
|
*
|
|
328
328
|
* POST /openmeter/notification/rules/{notificationRuleId}/test
|
|
329
329
|
*/
|
|
330
|
-
export function
|
|
330
|
+
export function testBillingNotificationRule(client, req, options) {
|
|
331
331
|
return request(() => {
|
|
332
332
|
const pathParamsInput = {
|
|
333
333
|
notificationRuleId: req.notificationRuleId,
|
|
334
334
|
};
|
|
335
335
|
const pathParams = client._options.validate
|
|
336
|
-
? toPathWire(pathParamsInput, schemas.
|
|
336
|
+
? toPathWire(pathParamsInput, schemas.testBillingNotificationRulePathParams)
|
|
337
337
|
: pathParamsInput;
|
|
338
338
|
if (client._options.validate) {
|
|
339
|
-
assertValid(schemas.
|
|
339
|
+
assertValid(schemas.testBillingNotificationRulePathParamsWire, pathParams);
|
|
340
340
|
}
|
|
341
341
|
const path = `openmeter/notification/rules/${(() => {
|
|
342
342
|
if (pathParams.notificationRuleId === undefined) {
|
|
@@ -349,9 +349,9 @@ export function testNotificationRule(client, req, options) {
|
|
|
349
349
|
.json()
|
|
350
350
|
.then((data) => {
|
|
351
351
|
if (client._options.validate) {
|
|
352
|
-
assertValid(schemas.
|
|
352
|
+
assertValid(schemas.testBillingNotificationRuleResponseWire, data);
|
|
353
353
|
}
|
|
354
|
-
return fromWire(data, schemas.
|
|
354
|
+
return fromWire(data, schemas.testBillingNotificationRuleResponse);
|
|
355
355
|
});
|
|
356
356
|
});
|
|
357
357
|
}
|
|
@@ -362,18 +362,18 @@ export function testNotificationRule(client, req, options) {
|
|
|
362
362
|
*
|
|
363
363
|
* GET /openmeter/notification/events
|
|
364
364
|
*/
|
|
365
|
-
export function
|
|
365
|
+
export function listBillingNotificationEvents(client, req = {}, options) {
|
|
366
366
|
return request(() => {
|
|
367
367
|
if (client._options.validate && req.sort !== undefined) {
|
|
368
|
-
assertValid(schemas.
|
|
368
|
+
assertValid(schemas.listBillingNotificationEventsQueryParams.shape.sort, req.sort);
|
|
369
369
|
}
|
|
370
370
|
const query = toWire({
|
|
371
371
|
page: req.page,
|
|
372
372
|
sort: encodeSort(req.sort, toSnakeCase),
|
|
373
373
|
filter: req.filter,
|
|
374
|
-
}, schemas.
|
|
374
|
+
}, schemas.listBillingNotificationEventsQueryParams);
|
|
375
375
|
if (client._options.validate) {
|
|
376
|
-
assertValid(schemas.
|
|
376
|
+
assertValid(schemas.listBillingNotificationEventsQueryParamsWire, query);
|
|
377
377
|
}
|
|
378
378
|
const searchParams = toURLSearchParams(query);
|
|
379
379
|
return http(client)
|
|
@@ -381,9 +381,9 @@ export function listNotificationEvents(client, req = {}, options) {
|
|
|
381
381
|
.json()
|
|
382
382
|
.then((data) => {
|
|
383
383
|
if (client._options.validate) {
|
|
384
|
-
assertValid(schemas.
|
|
384
|
+
assertValid(schemas.listBillingNotificationEventsResponseWire, data);
|
|
385
385
|
}
|
|
386
|
-
return fromWire(data, schemas.
|
|
386
|
+
return fromWire(data, schemas.listBillingNotificationEventsResponse);
|
|
387
387
|
});
|
|
388
388
|
});
|
|
389
389
|
}
|
|
@@ -394,16 +394,16 @@ export function listNotificationEvents(client, req = {}, options) {
|
|
|
394
394
|
*
|
|
395
395
|
* GET /openmeter/notification/events/{notificationEventId}
|
|
396
396
|
*/
|
|
397
|
-
export function
|
|
397
|
+
export function getBillingNotificationEvent(client, req, options) {
|
|
398
398
|
return request(() => {
|
|
399
399
|
const pathParamsInput = {
|
|
400
400
|
notificationEventId: req.notificationEventId,
|
|
401
401
|
};
|
|
402
402
|
const pathParams = client._options.validate
|
|
403
|
-
? toPathWire(pathParamsInput, schemas.
|
|
403
|
+
? toPathWire(pathParamsInput, schemas.getBillingNotificationEventPathParams)
|
|
404
404
|
: pathParamsInput;
|
|
405
405
|
if (client._options.validate) {
|
|
406
|
-
assertValid(schemas.
|
|
406
|
+
assertValid(schemas.getBillingNotificationEventPathParamsWire, pathParams);
|
|
407
407
|
}
|
|
408
408
|
const path = `openmeter/notification/events/${(() => {
|
|
409
409
|
if (pathParams.notificationEventId === undefined) {
|
|
@@ -416,9 +416,9 @@ export function getNotificationEvent(client, req, options) {
|
|
|
416
416
|
.json()
|
|
417
417
|
.then((data) => {
|
|
418
418
|
if (client._options.validate) {
|
|
419
|
-
assertValid(schemas.
|
|
419
|
+
assertValid(schemas.getBillingNotificationEventResponseWire, data);
|
|
420
420
|
}
|
|
421
|
-
return fromWire(data, schemas.
|
|
421
|
+
return fromWire(data, schemas.getBillingNotificationEventResponse);
|
|
422
422
|
});
|
|
423
423
|
});
|
|
424
424
|
}
|
|
@@ -433,16 +433,16 @@ export function getNotificationEvent(client, req, options) {
|
|
|
433
433
|
*
|
|
434
434
|
* POST /openmeter/notification/events/{notificationEventId}/resend
|
|
435
435
|
*/
|
|
436
|
-
export function
|
|
436
|
+
export function resendBillingNotificationEvent(client, req, options) {
|
|
437
437
|
return request(async () => {
|
|
438
438
|
const pathParamsInput = {
|
|
439
439
|
notificationEventId: req.notificationEventId,
|
|
440
440
|
};
|
|
441
441
|
const pathParams = client._options.validate
|
|
442
|
-
? toPathWire(pathParamsInput, schemas.
|
|
442
|
+
? toPathWire(pathParamsInput, schemas.resendBillingNotificationEventPathParams)
|
|
443
443
|
: pathParamsInput;
|
|
444
444
|
if (client._options.validate) {
|
|
445
|
-
assertValid(schemas.
|
|
445
|
+
assertValid(schemas.resendBillingNotificationEventPathParamsWire, pathParams);
|
|
446
446
|
}
|
|
447
447
|
const path = `openmeter/notification/events/${(() => {
|
|
448
448
|
if (pathParams.notificationEventId === undefined) {
|
|
@@ -450,9 +450,9 @@ export function resendNotificationEvent(client, req, options) {
|
|
|
450
450
|
}
|
|
451
451
|
return encodeURIComponent(String(pathParams.notificationEventId));
|
|
452
452
|
})()}/resend`;
|
|
453
|
-
const body = toWire(req.body, schemas.
|
|
453
|
+
const body = toWire(req.body, schemas.resendBillingNotificationEventBody);
|
|
454
454
|
if (client._options.validate) {
|
|
455
|
-
assertValid(schemas.
|
|
455
|
+
assertValid(schemas.resendBillingNotificationEventBodyWire, body);
|
|
456
456
|
}
|
|
457
457
|
await http(client).post(path, { ...options, json: body });
|
|
458
458
|
});
|