lark-billing 0.5.0 → 0.7.0
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/CHANGELOG.md +25 -0
- package/LICENSE +1 -1
- package/README.md +9 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/rate-cards.d.mts +29 -0
- package/resources/rate-cards.d.mts.map +1 -1
- package/resources/rate-cards.d.ts +29 -0
- package/resources/rate-cards.d.ts.map +1 -1
- package/resources/rate-cards.js +2 -0
- package/resources/rate-cards.js.map +1 -1
- package/resources/rate-cards.mjs +2 -0
- package/resources/rate-cards.mjs.map +1 -1
- package/resources/rate-catalogs.d.mts +416 -0
- package/resources/rate-catalogs.d.mts.map +1 -0
- package/resources/rate-catalogs.d.ts +416 -0
- package/resources/rate-catalogs.d.ts.map +1 -0
- package/resources/rate-catalogs.js +75 -0
- package/resources/rate-catalogs.js.map +1 -0
- package/resources/rate-catalogs.mjs +71 -0
- package/resources/rate-catalogs.mjs.map +1 -0
- package/resources/subjects.d.mts +3 -3
- package/resources/subjects.d.mts.map +1 -1
- package/resources/subjects.d.ts +3 -3
- package/resources/subjects.d.ts.map +1 -1
- package/resources/subscriptions.d.mts +34 -0
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +34 -0
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +2 -0
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +2 -0
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/usage-events.d.mts +2 -2
- package/resources/usage-events.d.ts +2 -2
- package/resources/usage-events.js +2 -2
- package/resources/usage-events.mjs +2 -2
- package/src/client.ts +27 -0
- package/src/resources/index.ts +12 -0
- package/src/resources/rate-cards.ts +37 -0
- package/src/resources/rate-catalogs.ts +597 -0
- package/src/resources/subjects.ts +3 -3
- package/src/resources/subscriptions.ts +30 -0
- package/src/resources/usage-events.ts +2 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as InvoicesAPI from './invoices';
|
|
5
|
+
import * as RateCardsAPI from './rate-cards';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class RateCatalogs extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Create Rate Catalog
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const rateCatalog = await client.rateCatalogs.create({
|
|
17
|
+
* description: 'My Catalog Description',
|
|
18
|
+
* name: 'My Catalog',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
create(body: RateCatalogCreateParams, options?: RequestOptions): APIPromise<RateCatalogCreateResponse> {
|
|
23
|
+
return this._client.post('/rate-catalogs', { body, ...options });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get Rate Catalog
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const rateCatalog = await client.rateCatalogs.retrieve(
|
|
32
|
+
* 'rate_catalog_id',
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
retrieve(rateCatalogID: string, options?: RequestOptions): APIPromise<RateCatalogRetrieveResponse> {
|
|
37
|
+
return this._client.get(path`/rate-catalogs/${rateCatalogID}`, options);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* List Rate Catalogs
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const rateCatalogs = await client.rateCatalogs.list();
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
list(
|
|
49
|
+
query: RateCatalogListParams | null | undefined = {},
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<RateCatalogListResponse> {
|
|
52
|
+
return this._client.get('/rate-catalogs', { query, ...options });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Add Rates To Rate Catalog
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const response = await client.rateCatalogs.addRates(
|
|
61
|
+
* 'rate_catalog_id',
|
|
62
|
+
* { billing_interval: 'monthly' },
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
addRates(
|
|
67
|
+
rateCatalogID: string,
|
|
68
|
+
body: RateCatalogAddRatesParams,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): APIPromise<RateCatalogAddRatesResponse> {
|
|
71
|
+
return this._client.post(path`/rate-catalogs/${rateCatalogID}/add_rates`, { body, ...options });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* List Rates In Catalog
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const response = await client.rateCatalogs.listRates(
|
|
80
|
+
* 'rate_catalog_id',
|
|
81
|
+
* );
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
listRates(
|
|
85
|
+
rateCatalogID: string,
|
|
86
|
+
query: RateCatalogListRatesParams | null | undefined = {},
|
|
87
|
+
options?: RequestOptions,
|
|
88
|
+
): APIPromise<RateCatalogListRatesResponse> {
|
|
89
|
+
return this._client.get(path`/rate-catalogs/${rateCatalogID}/rates`, { query, ...options });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface RateCatalogCreateResponse {
|
|
94
|
+
id: string;
|
|
95
|
+
|
|
96
|
+
description: string;
|
|
97
|
+
|
|
98
|
+
name: string;
|
|
99
|
+
|
|
100
|
+
rate_count: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface RateCatalogRetrieveResponse {
|
|
104
|
+
id: string;
|
|
105
|
+
|
|
106
|
+
description: string;
|
|
107
|
+
|
|
108
|
+
name: string;
|
|
109
|
+
|
|
110
|
+
rate_count: number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface RateCatalogListResponse {
|
|
114
|
+
has_more: boolean;
|
|
115
|
+
|
|
116
|
+
rate_catalogs: Array<RateCatalogListResponse.RateCatalog>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export namespace RateCatalogListResponse {
|
|
120
|
+
export interface RateCatalog {
|
|
121
|
+
id: string;
|
|
122
|
+
|
|
123
|
+
description: string;
|
|
124
|
+
|
|
125
|
+
name: string;
|
|
126
|
+
|
|
127
|
+
rate_count: number;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface RateCatalogAddRatesResponse {
|
|
132
|
+
id: string;
|
|
133
|
+
|
|
134
|
+
description: string;
|
|
135
|
+
|
|
136
|
+
name: string;
|
|
137
|
+
|
|
138
|
+
rate_count: number;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface RateCatalogListRatesResponse {
|
|
142
|
+
has_more: boolean;
|
|
143
|
+
|
|
144
|
+
rates: Array<RateCatalogListRatesResponse.Rate>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export namespace RateCatalogListRatesResponse {
|
|
148
|
+
export interface Rate {
|
|
149
|
+
id: string;
|
|
150
|
+
|
|
151
|
+
interval: 'monthly' | 'yearly';
|
|
152
|
+
|
|
153
|
+
rate_catalog_id: string;
|
|
154
|
+
|
|
155
|
+
type: 'fixed' | 'usage_based';
|
|
156
|
+
|
|
157
|
+
fixed?: Rate.Fixed | null;
|
|
158
|
+
|
|
159
|
+
usage_based?: Rate.SimpleUsageBasedRateTypedDict | Rate.DimensionalUsageBasedRateTypedDict | null;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export namespace Rate {
|
|
163
|
+
export interface Fixed {
|
|
164
|
+
id: string;
|
|
165
|
+
|
|
166
|
+
code: string | null;
|
|
167
|
+
|
|
168
|
+
credit_grants: Array<Fixed.CreditGrant>;
|
|
169
|
+
|
|
170
|
+
description: string | null;
|
|
171
|
+
|
|
172
|
+
name: string;
|
|
173
|
+
|
|
174
|
+
price: Fixed.FlatPriceTypedDict | Fixed.PackagePriceTypedDict;
|
|
175
|
+
|
|
176
|
+
quantity_code: string | null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export namespace Fixed {
|
|
180
|
+
export interface CreditGrant {
|
|
181
|
+
amount: InvoicesAPI.AmountOutput;
|
|
182
|
+
|
|
183
|
+
expiration:
|
|
184
|
+
| CreditGrant.CreditGrantDurationExpirationModel
|
|
185
|
+
| CreditGrant.CreditGrantDateTimeExpirationModel
|
|
186
|
+
| null;
|
|
187
|
+
|
|
188
|
+
metadata: { [key: string]: string };
|
|
189
|
+
|
|
190
|
+
name: string;
|
|
191
|
+
|
|
192
|
+
schedule:
|
|
193
|
+
| CreditGrant.CreditGrantScheduleOneTimeModel
|
|
194
|
+
| CreditGrant.CreditGrantScheduleRateCycleStartModel
|
|
195
|
+
| null;
|
|
196
|
+
|
|
197
|
+
subject_granting_config: CreditGrant.SubjectGrantingConfig | null;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export namespace CreditGrant {
|
|
201
|
+
export interface CreditGrantDurationExpirationModel {
|
|
202
|
+
duration: number;
|
|
203
|
+
|
|
204
|
+
unit: 'hours' | 'days' | 'weeks' | 'months' | 'years';
|
|
205
|
+
|
|
206
|
+
expiration_type?: 'duration';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface CreditGrantDateTimeExpirationModel {
|
|
210
|
+
date: string;
|
|
211
|
+
|
|
212
|
+
expiration_type?: 'date';
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface CreditGrantScheduleOneTimeModel {
|
|
216
|
+
scheduled_at: string;
|
|
217
|
+
|
|
218
|
+
schedule_type?: 'one_time';
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface CreditGrantScheduleRateCycleStartModel {
|
|
222
|
+
rate_cycle_start_at: string;
|
|
223
|
+
|
|
224
|
+
schedule_type?: 'rate_cycle_start';
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface SubjectGrantingConfig {
|
|
228
|
+
apply_to_children: boolean;
|
|
229
|
+
|
|
230
|
+
apply_to_self: boolean;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface FlatPriceTypedDict {
|
|
235
|
+
amount: FlatPriceTypedDict.Amount;
|
|
236
|
+
|
|
237
|
+
price_type: 'flat';
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export namespace FlatPriceTypedDict {
|
|
241
|
+
export interface Amount {
|
|
242
|
+
currency_code: string;
|
|
243
|
+
|
|
244
|
+
value: string;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface PackagePriceTypedDict {
|
|
249
|
+
amount: PackagePriceTypedDict.Amount;
|
|
250
|
+
|
|
251
|
+
package_units: number;
|
|
252
|
+
|
|
253
|
+
price_type: 'package';
|
|
254
|
+
|
|
255
|
+
rounding_behavior: 'round_up' | 'round_down';
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export namespace PackagePriceTypedDict {
|
|
259
|
+
export interface Amount {
|
|
260
|
+
currency_code: string;
|
|
261
|
+
|
|
262
|
+
value: string;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface SimpleUsageBasedRateTypedDict {
|
|
268
|
+
id: string;
|
|
269
|
+
|
|
270
|
+
code: string;
|
|
271
|
+
|
|
272
|
+
description: string | null;
|
|
273
|
+
|
|
274
|
+
included_units: number;
|
|
275
|
+
|
|
276
|
+
name: string;
|
|
277
|
+
|
|
278
|
+
price:
|
|
279
|
+
| SimpleUsageBasedRateTypedDict.FlatPriceTypedDict
|
|
280
|
+
| SimpleUsageBasedRateTypedDict.PackagePriceTypedDict;
|
|
281
|
+
|
|
282
|
+
pricing_metric_id: string;
|
|
283
|
+
|
|
284
|
+
usage_based_rate_type: 'simple';
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export namespace SimpleUsageBasedRateTypedDict {
|
|
288
|
+
export interface FlatPriceTypedDict {
|
|
289
|
+
amount: FlatPriceTypedDict.Amount;
|
|
290
|
+
|
|
291
|
+
price_type: 'flat';
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export namespace FlatPriceTypedDict {
|
|
295
|
+
export interface Amount {
|
|
296
|
+
currency_code: string;
|
|
297
|
+
|
|
298
|
+
value: string;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface PackagePriceTypedDict {
|
|
303
|
+
amount: PackagePriceTypedDict.Amount;
|
|
304
|
+
|
|
305
|
+
package_units: number;
|
|
306
|
+
|
|
307
|
+
price_type: 'package';
|
|
308
|
+
|
|
309
|
+
rounding_behavior: 'round_up' | 'round_down';
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export namespace PackagePriceTypedDict {
|
|
313
|
+
export interface Amount {
|
|
314
|
+
currency_code: string;
|
|
315
|
+
|
|
316
|
+
value: string;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface DimensionalUsageBasedRateTypedDict {
|
|
322
|
+
id: string;
|
|
323
|
+
|
|
324
|
+
code: string;
|
|
325
|
+
|
|
326
|
+
description: string | null;
|
|
327
|
+
|
|
328
|
+
dimensions: Array<DimensionalUsageBasedRateTypedDict.Dimension>;
|
|
329
|
+
|
|
330
|
+
included_units: number;
|
|
331
|
+
|
|
332
|
+
name: string;
|
|
333
|
+
|
|
334
|
+
pricing_matrix: DimensionalUsageBasedRateTypedDict.PricingMatrix;
|
|
335
|
+
|
|
336
|
+
pricing_metric_id: string;
|
|
337
|
+
|
|
338
|
+
usage_based_rate_type: 'dimensional';
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export namespace DimensionalUsageBasedRateTypedDict {
|
|
342
|
+
export interface Dimension {
|
|
343
|
+
description: string | null;
|
|
344
|
+
|
|
345
|
+
key: string;
|
|
346
|
+
|
|
347
|
+
values: Array<string>;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface PricingMatrix {
|
|
351
|
+
cells: Array<PricingMatrix.Cell>;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export namespace PricingMatrix {
|
|
355
|
+
export interface Cell {
|
|
356
|
+
dimension_coordinates: { [key: string]: string };
|
|
357
|
+
|
|
358
|
+
price: Cell.FlatPriceTypedDict | Cell.PackagePriceTypedDict;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export namespace Cell {
|
|
362
|
+
export interface FlatPriceTypedDict {
|
|
363
|
+
amount: FlatPriceTypedDict.Amount;
|
|
364
|
+
|
|
365
|
+
price_type: 'flat';
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export namespace FlatPriceTypedDict {
|
|
369
|
+
export interface Amount {
|
|
370
|
+
currency_code: string;
|
|
371
|
+
|
|
372
|
+
value: string;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export interface PackagePriceTypedDict {
|
|
377
|
+
amount: PackagePriceTypedDict.Amount;
|
|
378
|
+
|
|
379
|
+
package_units: number;
|
|
380
|
+
|
|
381
|
+
price_type: 'package';
|
|
382
|
+
|
|
383
|
+
rounding_behavior: 'round_up' | 'round_down';
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export namespace PackagePriceTypedDict {
|
|
387
|
+
export interface Amount {
|
|
388
|
+
currency_code: string;
|
|
389
|
+
|
|
390
|
+
value: string;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export interface RateCatalogCreateParams {
|
|
400
|
+
/**
|
|
401
|
+
* The description of the catalog.
|
|
402
|
+
*/
|
|
403
|
+
description: string;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* The name of the catalog.
|
|
407
|
+
*/
|
|
408
|
+
name: string;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface RateCatalogListParams {
|
|
412
|
+
limit?: number;
|
|
413
|
+
|
|
414
|
+
offset?: number;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface RateCatalogAddRatesParams {
|
|
418
|
+
/**
|
|
419
|
+
* How often the customer will be billed for these rates.
|
|
420
|
+
*/
|
|
421
|
+
billing_interval: 'monthly' | 'yearly';
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* The fixed rate to create in the catalog.
|
|
425
|
+
*/
|
|
426
|
+
fixed_rates?: Array<RateCatalogAddRatesParams.FixedRate>;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* The usage based rates to create in the catalog.
|
|
430
|
+
*/
|
|
431
|
+
usage_based_rates?: Array<
|
|
432
|
+
| RateCatalogAddRatesParams.CreateSimpleUsageBasedRateRequest
|
|
433
|
+
| RateCatalogAddRatesParams.CreateDimensionalUsageBasedRateRequest
|
|
434
|
+
>;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export namespace RateCatalogAddRatesParams {
|
|
438
|
+
export interface FixedRate {
|
|
439
|
+
/**
|
|
440
|
+
* Code of this rate to be used for setting quantity and price multipliers. This
|
|
441
|
+
* code must be unique within the rate card.
|
|
442
|
+
*/
|
|
443
|
+
code: string;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* The name of the rate displayed to the customer.
|
|
447
|
+
*/
|
|
448
|
+
name: string;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Flat price is a price that linearly scales with the quantity.
|
|
452
|
+
*/
|
|
453
|
+
price: RateCardsAPI.FlatPriceInput | RateCardsAPI.PackagePriceInput;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* The description of the rate displayed to the customer.
|
|
457
|
+
*/
|
|
458
|
+
description?: string | null;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export interface CreateSimpleUsageBasedRateRequest {
|
|
462
|
+
/**
|
|
463
|
+
* Code of this rate to be used for price multipliers. This code must be unique
|
|
464
|
+
* within the rate card.
|
|
465
|
+
*/
|
|
466
|
+
code: string;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* The name of the rate displayed to the customer.
|
|
470
|
+
*/
|
|
471
|
+
name: string;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Flat price is a price that linearly scales with the quantity.
|
|
475
|
+
*/
|
|
476
|
+
price: RateCardsAPI.FlatPriceInput | RateCardsAPI.PackagePriceInput;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* The ID of the pricing metric to use for this rate.
|
|
480
|
+
*/
|
|
481
|
+
pricing_metric_id: string;
|
|
482
|
+
|
|
483
|
+
usage_based_rate_type: 'simple';
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* The description of the rate displayed to the customer.
|
|
487
|
+
*/
|
|
488
|
+
description?: string | null;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* The number of units included in the rate before the price is applied.
|
|
492
|
+
*/
|
|
493
|
+
included_units?: number;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export interface CreateDimensionalUsageBasedRateRequest {
|
|
497
|
+
/**
|
|
498
|
+
* Code of this rate to be used for price multipliers. This code must be unique
|
|
499
|
+
* within the rate card.
|
|
500
|
+
*/
|
|
501
|
+
code: string;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* The dimensions of the rate.
|
|
505
|
+
*/
|
|
506
|
+
dimensions: Array<CreateDimensionalUsageBasedRateRequest.Dimension>;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* The name of the rate displayed to the customer.
|
|
510
|
+
*/
|
|
511
|
+
name: string;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* The pricing matrix of the rate.
|
|
515
|
+
*/
|
|
516
|
+
pricing_matrix: CreateDimensionalUsageBasedRateRequest.PricingMatrix;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* The ID of the pricing metric to use for this rate.
|
|
520
|
+
*/
|
|
521
|
+
pricing_metric_id: string;
|
|
522
|
+
|
|
523
|
+
usage_based_rate_type: 'dimensional';
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* The description of the rate displayed to the customer.
|
|
527
|
+
*/
|
|
528
|
+
description?: string | null;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* The number of units included in the rate before the price is applied.
|
|
532
|
+
*/
|
|
533
|
+
included_units?: number;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export namespace CreateDimensionalUsageBasedRateRequest {
|
|
537
|
+
export interface Dimension {
|
|
538
|
+
/**
|
|
539
|
+
* The name of the dimension. This is used to identify the dimension in the pricing
|
|
540
|
+
* matrix.
|
|
541
|
+
*/
|
|
542
|
+
key: string;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* A list of possible values for the dimension.
|
|
546
|
+
*/
|
|
547
|
+
values: Array<string>;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* The description of the dimension.
|
|
551
|
+
*/
|
|
552
|
+
description?: string | null;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* The pricing matrix of the rate.
|
|
557
|
+
*/
|
|
558
|
+
export interface PricingMatrix {
|
|
559
|
+
cells: Array<PricingMatrix.Cell>;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export namespace PricingMatrix {
|
|
563
|
+
export interface Cell {
|
|
564
|
+
/**
|
|
565
|
+
* A key-value mapping of dimension keys and values to identify the price for a
|
|
566
|
+
* given set of dimension values.
|
|
567
|
+
*/
|
|
568
|
+
dimension_coordinates: { [key: string]: string };
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* The price for the cell.
|
|
572
|
+
*/
|
|
573
|
+
price: RateCardsAPI.FlatPriceInput | RateCardsAPI.PackagePriceInput;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export interface RateCatalogListRatesParams {
|
|
580
|
+
limit?: number;
|
|
581
|
+
|
|
582
|
+
offset?: number;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export declare namespace RateCatalogs {
|
|
586
|
+
export {
|
|
587
|
+
type RateCatalogCreateResponse as RateCatalogCreateResponse,
|
|
588
|
+
type RateCatalogRetrieveResponse as RateCatalogRetrieveResponse,
|
|
589
|
+
type RateCatalogListResponse as RateCatalogListResponse,
|
|
590
|
+
type RateCatalogAddRatesResponse as RateCatalogAddRatesResponse,
|
|
591
|
+
type RateCatalogListRatesResponse as RateCatalogListRatesResponse,
|
|
592
|
+
type RateCatalogCreateParams as RateCatalogCreateParams,
|
|
593
|
+
type RateCatalogListParams as RateCatalogListParams,
|
|
594
|
+
type RateCatalogAddRatesParams as RateCatalogAddRatesParams,
|
|
595
|
+
type RateCatalogListRatesParams as RateCatalogListRatesParams,
|
|
596
|
+
};
|
|
597
|
+
}
|
|
@@ -192,18 +192,18 @@ export interface SubjectUpdateParams {
|
|
|
192
192
|
/**
|
|
193
193
|
* The email of the subject. Must be a valid email address.
|
|
194
194
|
*/
|
|
195
|
-
email
|
|
195
|
+
email?: string | null;
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
198
|
* Additional metadata about the subject. You may use this to store any custom data
|
|
199
199
|
* about the subject.
|
|
200
200
|
*/
|
|
201
|
-
metadata
|
|
201
|
+
metadata?: { [key: string]: string } | null;
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* The name of the subject. Used for display in the dashboard.
|
|
205
205
|
*/
|
|
206
|
-
name
|
|
206
|
+
name?: string | null;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
export interface SubjectListParams {
|
|
@@ -19,7 +19,9 @@ export class Subscriptions extends APIResource {
|
|
|
19
19
|
* cancelled_url: 'https://example.com/try-again',
|
|
20
20
|
* success_url: 'https://example.com/welcome',
|
|
21
21
|
* },
|
|
22
|
+
* fixed_rate_quantities: { seats: '2', addon_storage: '0' },
|
|
22
23
|
* metadata: {},
|
|
24
|
+
* rate_price_multipliers: { seats: '0.5' },
|
|
23
25
|
* });
|
|
24
26
|
* ```
|
|
25
27
|
*/
|
|
@@ -139,6 +141,11 @@ export interface SubscriptionResource {
|
|
|
139
141
|
*/
|
|
140
142
|
effective_at: string;
|
|
141
143
|
|
|
144
|
+
/**
|
|
145
|
+
* The quantities of the fixed rates of the subscription.
|
|
146
|
+
*/
|
|
147
|
+
fixed_rate_quantities: { [key: string]: string };
|
|
148
|
+
|
|
142
149
|
metadata: { [key: string]: string };
|
|
143
150
|
|
|
144
151
|
/**
|
|
@@ -146,6 +153,11 @@ export interface SubscriptionResource {
|
|
|
146
153
|
*/
|
|
147
154
|
rate_card_id: string;
|
|
148
155
|
|
|
156
|
+
/**
|
|
157
|
+
* The price multipliers of the rates of the subscription.
|
|
158
|
+
*/
|
|
159
|
+
rate_price_multipliers: { [key: string]: string };
|
|
160
|
+
|
|
149
161
|
/**
|
|
150
162
|
* The status of the subscription.
|
|
151
163
|
*/
|
|
@@ -293,11 +305,29 @@ export interface SubscriptionCreateParams {
|
|
|
293
305
|
*/
|
|
294
306
|
create_checkout_session?: 'when_required' | 'always';
|
|
295
307
|
|
|
308
|
+
/**
|
|
309
|
+
* The quantities of the fixed rates to use for the subscription. Each quantity
|
|
310
|
+
* should be specified as a key-value pair, where the key is the `code` of the
|
|
311
|
+
* fixed rate and the value is the quantity. All fixed rates must have a quantity
|
|
312
|
+
* specified.
|
|
313
|
+
*/
|
|
314
|
+
fixed_rate_quantities?: { [key: string]: number | string };
|
|
315
|
+
|
|
296
316
|
/**
|
|
297
317
|
* Additional metadata about the subscription. You may use this to store any custom
|
|
298
318
|
* data about the subscription.
|
|
299
319
|
*/
|
|
300
320
|
metadata?: { [key: string]: string };
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Pricing multipliers to apply to the rate amounts. Each price multiplier should
|
|
324
|
+
* be specified as a key-value pair, where the key is the `code` of the rate and
|
|
325
|
+
* the value is the price multiplier. Typically, pricing multipliers are used to
|
|
326
|
+
* apply a discount to a rate. For example, if a rate is $10 per seat and the price
|
|
327
|
+
* multiplier for the `seats` rate is 0.5, the discounted rate amount will be $5
|
|
328
|
+
* per seat.
|
|
329
|
+
*/
|
|
330
|
+
rate_price_multipliers?: { [key: string]: number | string };
|
|
301
331
|
}
|
|
302
332
|
|
|
303
333
|
export interface SubscriptionListParams {
|
|
@@ -17,9 +17,9 @@ export class UsageEvents extends APIResource {
|
|
|
17
17
|
* region: 'us-east-1',
|
|
18
18
|
* },
|
|
19
19
|
* event_name: 'job_completed',
|
|
20
|
-
* idempotency_key: '
|
|
20
|
+
* idempotency_key: '5ee29f5a-ff4d-4265-8029-bf29e465f5dc',
|
|
21
21
|
* subject_id: 'subj_VyX6Q96h5avMho8O7QWlKeXE',
|
|
22
|
-
* timestamp: '
|
|
22
|
+
* timestamp: '2026-01-13T22:50:12.390246+00:00',
|
|
23
23
|
* });
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.7.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.7.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.7.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED