orb-billing 5.44.0 → 5.45.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 +39 -0
- package/core.d.ts +1 -1
- package/core.d.ts.map +1 -1
- package/core.js +8 -17
- package/core.js.map +1 -1
- package/core.mjs +8 -17
- package/core.mjs.map +1 -1
- package/index.d.mts +91 -5
- package/index.d.ts +91 -5
- package/index.d.ts.map +1 -1
- package/index.js +90 -2
- package/index.js.map +1 -1
- package/index.mjs +91 -3
- package/index.mjs.map +1 -1
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +33 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/alerts.d.ts +21 -0
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js +6 -0
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs +6 -0
- package/resources/alerts.mjs.map +1 -1
- package/resources/beta/beta.d.ts +8293 -140
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +5 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +5 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/external-plan-id.d.ts +8293 -140
- package/resources/beta/external-plan-id.d.ts.map +1 -1
- package/resources/beta/external-plan-id.js +5 -0
- package/resources/beta/external-plan-id.js.map +1 -1
- package/resources/beta/external-plan-id.mjs +5 -0
- package/resources/beta/external-plan-id.mjs.map +1 -1
- package/resources/coupons/coupons.d.ts +3 -0
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js +3 -0
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +3 -0
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.ts +3 -0
- package/resources/coupons/subscriptions.d.ts.map +1 -1
- package/resources/coupons/subscriptions.js +3 -0
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs +3 -0
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/credit-blocks.d.ts +85 -1
- package/resources/credit-blocks.d.ts.map +1 -1
- package/resources/credit-blocks.js +22 -0
- package/resources/credit-blocks.js.map +1 -1
- package/resources/credit-blocks.mjs +22 -0
- package/resources/credit-blocks.mjs.map +1 -1
- package/resources/credit-notes.d.ts +4 -0
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +4 -0
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +4 -0
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.d.ts +16 -0
- package/resources/customers/balance-transactions.d.ts.map +1 -1
- package/resources/customers/balance-transactions.js +16 -0
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs +16 -0
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.d.ts +16 -0
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js +16 -0
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs +16 -0
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.d.ts +39 -0
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js +3 -0
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs +3 -0
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +31 -4
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js +19 -2
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +19 -2
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.d.ts +3 -0
- package/resources/customers/credits/top-ups.d.ts.map +1 -1
- package/resources/customers/credits/top-ups.js +3 -0
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs +3 -0
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/customers.d.ts +33 -12
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +20 -3
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +20 -3
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
- package/resources/events/backfills.d.ts +5 -0
- package/resources/events/backfills.d.ts.map +1 -1
- package/resources/events/backfills.js +5 -0
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +5 -0
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.d.ts +5 -0
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +5 -0
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +5 -0
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/volume.d.ts +5 -0
- package/resources/events/volume.d.ts.map +1 -1
- package/resources/events/volume.js +5 -0
- package/resources/events/volume.js.map +1 -1
- package/resources/events/volume.mjs +5 -0
- package/resources/events/volume.mjs.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.d.ts +6 -0
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoice-line-items.js +6 -0
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +6 -0
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +432 -7
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +18 -5
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +18 -5
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.ts +6 -2
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +4 -0
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +4 -0
- package/resources/items.mjs.map +1 -1
- package/resources/license-types.d.ts +113 -0
- package/resources/license-types.d.ts.map +1 -0
- package/resources/license-types.js +44 -0
- package/resources/license-types.js.map +1 -0
- package/resources/license-types.mjs +39 -0
- package/resources/license-types.mjs.map +1 -0
- package/resources/licenses/external-licenses.d.ts +114 -0
- package/resources/licenses/external-licenses.d.ts.map +1 -0
- package/resources/licenses/external-licenses.js +18 -0
- package/resources/licenses/external-licenses.js.map +1 -0
- package/resources/licenses/external-licenses.mjs +14 -0
- package/resources/licenses/external-licenses.mjs.map +1 -0
- package/resources/licenses/index.d.ts +4 -0
- package/resources/licenses/index.d.ts.map +1 -0
- package/resources/licenses/index.js +12 -0
- package/resources/licenses/index.js.map +1 -0
- package/resources/licenses/index.mjs +5 -0
- package/resources/licenses/index.mjs.map +1 -0
- package/resources/licenses/licenses.d.ts +133 -0
- package/resources/licenses/licenses.d.ts.map +1 -0
- package/resources/licenses/licenses.js +86 -0
- package/resources/licenses/licenses.js.map +1 -0
- package/resources/licenses/licenses.mjs +58 -0
- package/resources/licenses/licenses.mjs.map +1 -0
- package/resources/licenses/usage.d.ts +211 -0
- package/resources/licenses/usage.d.ts.map +1 -0
- package/resources/licenses/usage.js +25 -0
- package/resources/licenses/usage.js.map +1 -0
- package/resources/licenses/usage.mjs +21 -0
- package/resources/licenses/usage.mjs.map +1 -0
- package/resources/licenses.d.ts +2 -0
- package/resources/licenses.d.ts.map +1 -0
- package/resources/licenses.js +19 -0
- package/resources/licenses.js.map +1 -0
- package/resources/licenses.mjs +3 -0
- package/resources/licenses.mjs.map +1 -0
- package/resources/metrics.d.ts +7 -0
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +4 -0
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +4 -0
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +5 -0
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +5 -0
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +5 -0
- package/resources/plans/external-plan-id.mjs.map +1 -1
- package/resources/plans/migrations.d.ts +5 -0
- package/resources/plans/migrations.d.ts.map +1 -1
- package/resources/plans/migrations.js +5 -0
- package/resources/plans/migrations.js.map +1 -1
- package/resources/plans/migrations.mjs +5 -0
- package/resources/plans/migrations.mjs.map +1 -1
- package/resources/plans/plans.d.ts +4200 -121
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +5 -0
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +5 -0
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +9 -0
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/external-price-id.js +9 -0
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +9 -0
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/prices.d.ts +198 -0
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +9 -0
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +9 -0
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +1040 -6
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/subscriptions.d.ts +262 -0
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/core.ts +10 -21
- package/src/index.ts +149 -5
- package/src/internal/utils/query.ts +7 -0
- package/src/resources/alerts.ts +24 -0
- package/src/resources/beta/beta.ts +9945 -194
- package/src/resources/beta/external-plan-id.ts +9945 -194
- package/src/resources/coupons/coupons.ts +3 -0
- package/src/resources/coupons/subscriptions.ts +3 -0
- package/src/resources/credit-blocks.ts +110 -1
- package/src/resources/credit-notes.ts +4 -0
- package/src/resources/customers/balance-transactions.ts +16 -0
- package/src/resources/customers/costs.ts +16 -0
- package/src/resources/customers/credits/credits.ts +45 -0
- package/src/resources/customers/credits/ledger.ts +33 -4
- package/src/resources/customers/credits/top-ups.ts +3 -0
- package/src/resources/customers/customers.ts +61 -12
- package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +1 -1
- package/src/resources/events/backfills.ts +5 -0
- package/src/resources/events/events.ts +5 -0
- package/src/resources/events/volume.ts +5 -0
- package/src/resources/index.ts +29 -1
- package/src/resources/invoice-line-items.ts +6 -0
- package/src/resources/invoices.ts +523 -6
- package/src/resources/items.ts +8 -2
- package/src/resources/license-types.ts +163 -0
- package/src/resources/licenses/external-licenses.ts +147 -0
- package/src/resources/licenses/index.ts +27 -0
- package/src/resources/licenses/licenses.ts +248 -0
- package/src/resources/licenses/usage.ts +280 -0
- package/src/resources/licenses.ts +3 -0
- package/src/resources/metrics.ts +6 -0
- package/src/resources/plans/external-plan-id.ts +5 -0
- package/src/resources/plans/migrations.ts +5 -0
- package/src/resources/plans/plans.ts +5004 -126
- package/src/resources/prices/external-price-id.ts +9 -0
- package/src/resources/prices/prices.ts +237 -0
- package/src/resources/shared.ts +1213 -0
- package/src/resources/subscriptions.ts +311 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
import * as Shared from '../shared';
|
|
7
|
+
|
|
8
|
+
export class Usage extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Returns usage and remaining credits for all licenses of a given type on a
|
|
11
|
+
* subscription.
|
|
12
|
+
*
|
|
13
|
+
* Date range defaults to the current billing period if not specified.
|
|
14
|
+
*/
|
|
15
|
+
getAllUsage(
|
|
16
|
+
query: UsageGetAllUsageParams,
|
|
17
|
+
options?: Core.RequestOptions,
|
|
18
|
+
): Core.APIPromise<UsageGetAllUsageResponse> {
|
|
19
|
+
return this._client.get('/licenses/usage', { query, ...options });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns usage and remaining credits for a specific license over a date range.
|
|
24
|
+
*
|
|
25
|
+
* Date range defaults to the current billing period if not specified.
|
|
26
|
+
*/
|
|
27
|
+
getUsage(
|
|
28
|
+
licenseId: string,
|
|
29
|
+
query?: UsageGetUsageParams,
|
|
30
|
+
options?: Core.RequestOptions,
|
|
31
|
+
): Core.APIPromise<UsageGetUsageResponse>;
|
|
32
|
+
getUsage(licenseId: string, options?: Core.RequestOptions): Core.APIPromise<UsageGetUsageResponse>;
|
|
33
|
+
getUsage(
|
|
34
|
+
licenseId: string,
|
|
35
|
+
query: UsageGetUsageParams | Core.RequestOptions = {},
|
|
36
|
+
options?: Core.RequestOptions,
|
|
37
|
+
): Core.APIPromise<UsageGetUsageResponse> {
|
|
38
|
+
if (isRequestOptions(query)) {
|
|
39
|
+
return this.getUsage(licenseId, {}, query);
|
|
40
|
+
}
|
|
41
|
+
return this._client.get(`/licenses/${licenseId}/usage`, { query, ...options });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface UsageGetAllUsageResponse {
|
|
46
|
+
data: Array<UsageGetAllUsageResponse.Data>;
|
|
47
|
+
|
|
48
|
+
pagination_metadata: Shared.PaginationMetadata;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export namespace UsageGetAllUsageResponse {
|
|
52
|
+
/**
|
|
53
|
+
* The LicenseUsage resource represents usage and remaining credits for a license
|
|
54
|
+
* over a date range.
|
|
55
|
+
*
|
|
56
|
+
* When grouped by 'day' only, license_id and external_license_id will be null as
|
|
57
|
+
* the data is aggregated across all licenses.
|
|
58
|
+
*/
|
|
59
|
+
export interface Data {
|
|
60
|
+
/**
|
|
61
|
+
* The total credits allocated to this license for the period.
|
|
62
|
+
*/
|
|
63
|
+
allocated_credits: number;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The credits consumed by this license for the period.
|
|
67
|
+
*/
|
|
68
|
+
consumed_credits: number;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The end date of the usage period.
|
|
72
|
+
*/
|
|
73
|
+
end_date: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The unique identifier for the license type.
|
|
77
|
+
*/
|
|
78
|
+
license_type_id: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The pricing unit for the credits (e.g., 'credits').
|
|
82
|
+
*/
|
|
83
|
+
pricing_unit: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The remaining credits available for this license (allocated - consumed).
|
|
87
|
+
*/
|
|
88
|
+
remaining_credits: number;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The start date of the usage period.
|
|
92
|
+
*/
|
|
93
|
+
start_date: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The unique identifier for the subscription.
|
|
97
|
+
*/
|
|
98
|
+
subscription_id: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Credits consumed while the license was active (eligible for individual
|
|
102
|
+
* allocation deduction).
|
|
103
|
+
*/
|
|
104
|
+
allocation_eligible_credits?: number | null;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The external identifier for the license. Null when grouped by day only.
|
|
108
|
+
*/
|
|
109
|
+
external_license_id?: string | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The unique identifier for the license. Null when grouped by day only.
|
|
113
|
+
*/
|
|
114
|
+
license_id?: string | null;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Credits consumed while the license was inactive (draws from shared pool, not
|
|
118
|
+
* individual allocation).
|
|
119
|
+
*/
|
|
120
|
+
shared_pool_credits?: number | null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface UsageGetUsageResponse {
|
|
125
|
+
data: Array<UsageGetUsageResponse.Data>;
|
|
126
|
+
|
|
127
|
+
pagination_metadata: Shared.PaginationMetadata;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export namespace UsageGetUsageResponse {
|
|
131
|
+
/**
|
|
132
|
+
* The LicenseUsage resource represents usage and remaining credits for a license
|
|
133
|
+
* over a date range.
|
|
134
|
+
*
|
|
135
|
+
* When grouped by 'day' only, license_id and external_license_id will be null as
|
|
136
|
+
* the data is aggregated across all licenses.
|
|
137
|
+
*/
|
|
138
|
+
export interface Data {
|
|
139
|
+
/**
|
|
140
|
+
* The total credits allocated to this license for the period.
|
|
141
|
+
*/
|
|
142
|
+
allocated_credits: number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The credits consumed by this license for the period.
|
|
146
|
+
*/
|
|
147
|
+
consumed_credits: number;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The end date of the usage period.
|
|
151
|
+
*/
|
|
152
|
+
end_date: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The unique identifier for the license type.
|
|
156
|
+
*/
|
|
157
|
+
license_type_id: string;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The pricing unit for the credits (e.g., 'credits').
|
|
161
|
+
*/
|
|
162
|
+
pricing_unit: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The remaining credits available for this license (allocated - consumed).
|
|
166
|
+
*/
|
|
167
|
+
remaining_credits: number;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The start date of the usage period.
|
|
171
|
+
*/
|
|
172
|
+
start_date: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The unique identifier for the subscription.
|
|
176
|
+
*/
|
|
177
|
+
subscription_id: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Credits consumed while the license was active (eligible for individual
|
|
181
|
+
* allocation deduction).
|
|
182
|
+
*/
|
|
183
|
+
allocation_eligible_credits?: number | null;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The external identifier for the license. Null when grouped by day only.
|
|
187
|
+
*/
|
|
188
|
+
external_license_id?: string | null;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The unique identifier for the license. Null when grouped by day only.
|
|
192
|
+
*/
|
|
193
|
+
license_id?: string | null;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Credits consumed while the license was inactive (draws from shared pool, not
|
|
197
|
+
* individual allocation).
|
|
198
|
+
*/
|
|
199
|
+
shared_pool_credits?: number | null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface UsageGetAllUsageParams {
|
|
204
|
+
/**
|
|
205
|
+
* The license type ID to filter licenses by.
|
|
206
|
+
*/
|
|
207
|
+
license_type_id: string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The subscription ID to get license usage for.
|
|
211
|
+
*/
|
|
212
|
+
subscription_id: string;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Pagination cursor from a previous request.
|
|
216
|
+
*/
|
|
217
|
+
cursor?: string | null;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* End date for the usage period (YYYY-MM-DD). Defaults to end of current billing
|
|
221
|
+
* period.
|
|
222
|
+
*/
|
|
223
|
+
end_date?: string | null;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* How to group the results. Valid values: 'license', 'day'. Can be combined (e.g.,
|
|
227
|
+
* 'license,day').
|
|
228
|
+
*/
|
|
229
|
+
group_by?: Array<string> | null;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Maximum number of rows in the response data (default 20, max 100).
|
|
233
|
+
*/
|
|
234
|
+
limit?: number;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Start date for the usage period (YYYY-MM-DD). Defaults to start of current
|
|
238
|
+
* billing period.
|
|
239
|
+
*/
|
|
240
|
+
start_date?: string | null;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface UsageGetUsageParams {
|
|
244
|
+
/**
|
|
245
|
+
* Pagination cursor from a previous request.
|
|
246
|
+
*/
|
|
247
|
+
cursor?: string | null;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* End date for the usage period (YYYY-MM-DD). Defaults to end of current billing
|
|
251
|
+
* period.
|
|
252
|
+
*/
|
|
253
|
+
end_date?: string | null;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* How to group the results. Valid values: 'license', 'day'. Can be combined (e.g.,
|
|
257
|
+
* 'license,day').
|
|
258
|
+
*/
|
|
259
|
+
group_by?: Array<string> | null;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Maximum number of rows in the response data (default 20, max 100).
|
|
263
|
+
*/
|
|
264
|
+
limit?: number;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Start date for the usage period (YYYY-MM-DD). Defaults to start of current
|
|
268
|
+
* billing period.
|
|
269
|
+
*/
|
|
270
|
+
start_date?: string | null;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export declare namespace Usage {
|
|
274
|
+
export {
|
|
275
|
+
type UsageGetAllUsageResponse as UsageGetAllUsageResponse,
|
|
276
|
+
type UsageGetUsageResponse as UsageGetUsageResponse,
|
|
277
|
+
type UsageGetAllUsageParams as UsageGetAllUsageParams,
|
|
278
|
+
type UsageGetUsageParams as UsageGetUsageParams,
|
|
279
|
+
};
|
|
280
|
+
}
|
package/src/resources/metrics.ts
CHANGED
|
@@ -6,6 +6,10 @@ import * as Core from '../core';
|
|
|
6
6
|
import * as ItemsAPI from './items';
|
|
7
7
|
import { Page, type PageParams } from '../pagination';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* The Metric resource represents a calculation of a quantity based on events.
|
|
11
|
+
* Metrics are defined by the query that transforms raw usage events into meaningful values for your customers.
|
|
12
|
+
*/
|
|
9
13
|
export class Metrics extends APIResource {
|
|
10
14
|
/**
|
|
11
15
|
* This endpoint is used to create a [metric](/core-concepts###metric) using a SQL
|
|
@@ -88,6 +92,8 @@ export interface BillableMetric {
|
|
|
88
92
|
name: string;
|
|
89
93
|
|
|
90
94
|
status: 'active' | 'draft' | 'archived';
|
|
95
|
+
|
|
96
|
+
parameter_definitions?: Array<{ [key: string]: unknown }> | null;
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
export interface MetricCreateParams {
|
|
@@ -4,6 +4,11 @@ import { APIResource } from '../../resource';
|
|
|
4
4
|
import * as Core from '../../core';
|
|
5
5
|
import * as PlansAPI from './plans';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a
|
|
9
|
+
* customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices
|
|
10
|
+
* in the [Price resource](/reference/price).
|
|
11
|
+
*/
|
|
7
12
|
export class ExternalPlanID extends APIResource {
|
|
8
13
|
/**
|
|
9
14
|
* This endpoint can be used to update the `external_plan_id`, and `metadata` of an
|
|
@@ -5,6 +5,11 @@ import { isRequestOptions } from '../../core';
|
|
|
5
5
|
import * as Core from '../../core';
|
|
6
6
|
import { Page, type PageParams } from '../../pagination';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a
|
|
10
|
+
* customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices
|
|
11
|
+
* in the [Price resource](/reference/price).
|
|
12
|
+
*/
|
|
8
13
|
export class Migrations extends APIResource {
|
|
9
14
|
/**
|
|
10
15
|
* Fetch migration
|