@metronome/sdk 0.1.0-beta.9 → 0.2.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 +194 -0
- package/README.md +30 -46
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +19 -5
- package/core.d.ts.map +1 -1
- package/core.js +23 -14
- package/core.js.map +1 -1
- package/core.mjs +24 -15
- package/core.mjs.map +1 -1
- package/index.d.mts +3 -2
- package/index.d.ts +3 -2
- package/index.d.ts.map +1 -1
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/index.mjs +6 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -5
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -0
- package/pagination.js.map +1 -1
- package/pagination.mjs +3 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/shared.d.ts +521 -37
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.ts +30 -10
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +19 -0
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +19 -0
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.ts +8 -0
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.ts +58 -3
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +41 -0
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +41 -0
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +1556 -122
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +180 -3
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +180 -3
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.ts +2 -2
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.ts +21 -0
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +21 -0
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +21 -0
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.ts +51 -3
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +33 -0
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +33 -0
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.js.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +107 -10
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts +102 -14
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +68 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +68 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/credit-grants.d.ts +77 -2
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +39 -2
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +39 -2
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.ts +51 -7
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +35 -0
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +35 -0
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.ts +37 -0
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +23 -0
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +23 -0
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +31 -0
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +27 -0
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +27 -0
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.ts +94 -7
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +56 -1
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +56 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.ts +73 -3
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +41 -1
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +41 -1
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.ts +186 -9
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +106 -1
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +106 -1
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.ts +144 -52
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +49 -0
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +49 -0
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts +21 -0
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +21 -0
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +21 -0
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.ts +46 -1
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +43 -0
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +43 -0
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/dashboards.d.ts +31 -3
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +26 -0
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +26 -0
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.ts +3 -3
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.ts +14 -0
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +14 -0
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +14 -0
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/plans.d.ts +47 -4
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +27 -0
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +27 -0
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.ts +8 -0
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.ts +5 -0
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +5 -0
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +5 -0
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/usage.d.ts +161 -3
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +46 -0
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +46 -0
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.ts +6 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.ts +3241 -205
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +90 -2
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +90 -2
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/webhooks.js +5 -5
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -5
- package/resources/webhooks.mjs.map +1 -1
- package/src/_shims/auto/runtime-bun.ts +1 -1
- package/src/_shims/auto/runtime-node.ts +1 -1
- package/src/_shims/auto/runtime.ts +1 -1
- package/src/_shims/auto/types-node.ts +1 -1
- package/src/_shims/bun-runtime.ts +2 -2
- package/src/_shims/index.d.ts +5 -3
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +6 -2
- package/src/_shims/node-runtime.ts +3 -3
- package/src/_shims/registry.ts +1 -1
- package/src/_shims/web-runtime.ts +3 -3
- package/src/core.ts +46 -18
- package/src/error.ts +1 -1
- package/src/index.ts +22 -16
- package/src/internal/qs/formats.ts +1 -1
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +3 -3
- package/src/internal/qs/utils.ts +2 -2
- package/src/pagination.ts +5 -1
- package/src/resource.ts +2 -2
- package/src/resources/index.ts +4 -4
- package/src/resources/shared.ts +605 -40
- package/src/resources/v1/alerts.ts +33 -13
- package/src/resources/v1/audit-logs.ts +12 -4
- package/src/resources/v1/billable-metrics.ts +57 -8
- package/src/resources/v1/contracts/contracts.ts +1723 -135
- package/src/resources/v1/contracts/index.ts +8 -4
- package/src/resources/v1/contracts/named-schedules.ts +23 -2
- package/src/resources/v1/contracts/products.ts +53 -9
- package/src/resources/v1/contracts/rate-cards/index.ts +6 -4
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +27 -2
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +33 -3
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +113 -20
- package/src/resources/v1/contracts/rate-cards/rates.ts +86 -18
- package/src/resources/v1/contracts/rate-cards.ts +1 -1
- package/src/resources/v1/contracts.ts +1 -1
- package/src/resources/v1/credit-grants.ts +82 -10
- package/src/resources/v1/custom-fields.ts +57 -9
- package/src/resources/v1/customers/alerts.ts +44 -3
- package/src/resources/v1/customers/billing-config.ts +34 -2
- package/src/resources/v1/customers/commits.ts +97 -10
- package/src/resources/v1/customers/credits.ts +76 -6
- package/src/resources/v1/customers/customers.ts +208 -27
- package/src/resources/v1/customers/index.ts +10 -8
- package/src/resources/v1/customers/invoices.ts +123 -57
- package/src/resources/v1/customers/named-schedules.ts +23 -2
- package/src/resources/v1/customers/plans.ts +48 -5
- package/src/resources/v1/customers.ts +1 -1
- package/src/resources/v1/dashboards.ts +33 -5
- package/src/resources/v1/index.ts +20 -14
- package/src/resources/v1/invoices.ts +16 -2
- package/src/resources/v1/plans.ts +45 -10
- package/src/resources/v1/pricing-units.ts +12 -4
- package/src/resources/v1/services.ts +7 -2
- package/src/resources/v1/usage.ts +187 -6
- package/src/resources/v1/v1.ts +39 -27
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +3838 -261
- package/src/resources/v2/index.ts +2 -2
- package/src/resources/v2/v2.ts +3 -3
- package/src/resources/v2.ts +1 -1
- package/src/resources/webhooks.ts +7 -7
- package/src/resources.ts +1 -1
- package/src/shims/node.ts +3 -3
- package/src/shims/web.ts +3 -3
- package/src/uploads.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as Core from
|
|
5
|
-
import * as Shared from
|
|
6
|
-
import { CursorPage, type CursorPageParams } from
|
|
3
|
+
import { APIResource } from "../../../resource.js";
|
|
4
|
+
import * as Core from "../../../core.js";
|
|
5
|
+
import * as Shared from "../../shared.js";
|
|
6
|
+
import { CursorPage, type CursorPageParams } from "../../../pagination.js";
|
|
7
7
|
|
|
8
8
|
export class Invoices extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Fetch a specific invoice for a given customer.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const invoice = await client.v1.customers.invoices.retrieve(
|
|
15
|
+
* {
|
|
16
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
17
|
+
* invoice_id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
18
|
+
* },
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
11
21
|
*/
|
|
12
22
|
retrieve(
|
|
13
23
|
params: InvoiceRetrieveParams,
|
|
@@ -20,6 +30,16 @@ export class Invoices extends APIResource {
|
|
|
20
30
|
/**
|
|
21
31
|
* List all invoices for a given customer, optionally filtered by status, date
|
|
22
32
|
* range, and/or credit type.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // Automatically fetches more pages as needed.
|
|
37
|
+
* for await (const invoice of client.v1.customers.invoices.list(
|
|
38
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
39
|
+
* )) {
|
|
40
|
+
* // ...
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
23
43
|
*/
|
|
24
44
|
list(
|
|
25
45
|
params: InvoiceListParams,
|
|
@@ -34,6 +54,21 @@ export class Invoices extends APIResource {
|
|
|
34
54
|
|
|
35
55
|
/**
|
|
36
56
|
* Add a one time charge to the specified invoice
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const response =
|
|
61
|
+
* await client.v1.customers.invoices.addCharge({
|
|
62
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
63
|
+
* charge_id: '5ae4b726-1ebe-439c-9190-9831760ba195',
|
|
64
|
+
* customer_plan_id:
|
|
65
|
+
* 'a23b3cf4-47fb-4c3f-bb3d-9e64f7704015',
|
|
66
|
+
* description: 'One time charge',
|
|
67
|
+
* invoice_start_timestamp: '2024-01-01T00:00:00Z',
|
|
68
|
+
* price: 250,
|
|
69
|
+
* quantity: 1,
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
37
72
|
*/
|
|
38
73
|
addCharge(
|
|
39
74
|
params: InvoiceAddChargeParams,
|
|
@@ -49,6 +84,20 @@ export class Invoices extends APIResource {
|
|
|
49
84
|
*
|
|
50
85
|
* - If we receive backdated usage after an invoice has been finalized, the
|
|
51
86
|
* backdated usage will be included in the response and usage numbers may differ.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* // Automatically fetches more pages as needed.
|
|
91
|
+
* for await (const invoiceListBreakdownsResponse of client.v1.customers.invoices.listBreakdowns(
|
|
92
|
+
* {
|
|
93
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
94
|
+
* ending_before: '2019-12-27T18:11:19.117Z',
|
|
95
|
+
* starting_on: '2019-12-27T18:11:19.117Z',
|
|
96
|
+
* },
|
|
97
|
+
* )) {
|
|
98
|
+
* // ...
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
52
101
|
*/
|
|
53
102
|
listBreakdowns(
|
|
54
103
|
params: InvoiceListBreakdownsParams,
|
|
@@ -89,7 +138,7 @@ export interface Invoice {
|
|
|
89
138
|
*/
|
|
90
139
|
billable_status?: 'billable' | 'unbillable';
|
|
91
140
|
|
|
92
|
-
contract_custom_fields?:
|
|
141
|
+
contract_custom_fields?: { [key: string]: string };
|
|
93
142
|
|
|
94
143
|
contract_id?: string;
|
|
95
144
|
|
|
@@ -101,9 +150,9 @@ export interface Invoice {
|
|
|
101
150
|
*/
|
|
102
151
|
created_at?: string;
|
|
103
152
|
|
|
104
|
-
custom_fields?:
|
|
153
|
+
custom_fields?: { [key: string]: unknown };
|
|
105
154
|
|
|
106
|
-
customer_custom_fields?:
|
|
155
|
+
customer_custom_fields?: { [key: string]: string };
|
|
107
156
|
|
|
108
157
|
/**
|
|
109
158
|
* End of the usage period this invoice covers (UTC)
|
|
@@ -126,14 +175,14 @@ export interface Invoice {
|
|
|
126
175
|
*/
|
|
127
176
|
netsuite_sales_order_id?: string;
|
|
128
177
|
|
|
129
|
-
plan_custom_fields?:
|
|
178
|
+
plan_custom_fields?: { [key: string]: string };
|
|
130
179
|
|
|
131
180
|
plan_id?: string;
|
|
132
181
|
|
|
133
182
|
plan_name?: string;
|
|
134
183
|
|
|
135
184
|
/**
|
|
136
|
-
*
|
|
185
|
+
* Only present for contract invoices with reseller royalties.
|
|
137
186
|
*/
|
|
138
187
|
reseller_royalty?: Invoice.ResellerRoyalty;
|
|
139
188
|
|
|
@@ -159,46 +208,45 @@ export namespace Invoice {
|
|
|
159
208
|
total: number;
|
|
160
209
|
|
|
161
210
|
/**
|
|
162
|
-
*
|
|
211
|
+
* Details about the credit or commit that was applied to this line item. Only
|
|
212
|
+
* present on line items with product of `USAGE`, `SUBSCRIPTION` or `COMPOSITE`
|
|
213
|
+
* types.
|
|
163
214
|
*/
|
|
164
215
|
applied_commit_or_credit?: LineItem.AppliedCommitOrCredit;
|
|
165
216
|
|
|
166
|
-
|
|
167
|
-
* only present for beta contract invoices
|
|
168
|
-
*/
|
|
169
|
-
commit_custom_fields?: Record<string, string>;
|
|
217
|
+
commit_custom_fields?: { [key: string]: string };
|
|
170
218
|
|
|
171
219
|
/**
|
|
172
|
-
*
|
|
220
|
+
* For line items with product of `USAGE`, `SUBSCRIPTION`, or `COMPOSITE` types,
|
|
221
|
+
* the ID of the credit or commit that was applied to this line item. For line
|
|
222
|
+
* items with product type of `FIXED`, the ID of the prepaid or postpaid commit
|
|
223
|
+
* that is being paid for.
|
|
173
224
|
*/
|
|
174
225
|
commit_id?: string;
|
|
175
226
|
|
|
176
|
-
/**
|
|
177
|
-
* only present for beta contract invoices. This field's availability is dependent
|
|
178
|
-
* on your client's configuration.
|
|
179
|
-
*/
|
|
180
227
|
commit_netsuite_item_id?: string;
|
|
181
228
|
|
|
182
|
-
/**
|
|
183
|
-
* only present for beta contract invoices. This field's availability is dependent
|
|
184
|
-
* on your client's configuration.
|
|
185
|
-
*/
|
|
186
229
|
commit_netsuite_sales_order_id?: string;
|
|
187
230
|
|
|
188
|
-
/**
|
|
189
|
-
* only present for beta contract invoices
|
|
190
|
-
*/
|
|
191
231
|
commit_segment_id?: string;
|
|
192
232
|
|
|
193
233
|
/**
|
|
194
|
-
*
|
|
234
|
+
* `PrepaidCommit` (for commit types `PREPAID` and `CREDIT`) or `PostpaidCommit`
|
|
235
|
+
* (for commit type `POSTPAID`).
|
|
195
236
|
*/
|
|
196
237
|
commit_type?: string;
|
|
197
238
|
|
|
198
|
-
custom_fields?:
|
|
239
|
+
custom_fields?: { [key: string]: string };
|
|
240
|
+
|
|
241
|
+
discount_custom_fields?: { [key: string]: string };
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* ID of the discount applied to this line item.
|
|
245
|
+
*/
|
|
246
|
+
discount_id?: string;
|
|
199
247
|
|
|
200
248
|
/**
|
|
201
|
-
*
|
|
249
|
+
* The line item's end date (exclusive).
|
|
202
250
|
*/
|
|
203
251
|
ending_before?: string;
|
|
204
252
|
|
|
@@ -207,12 +255,12 @@ export namespace Invoice {
|
|
|
207
255
|
group_value?: string | null;
|
|
208
256
|
|
|
209
257
|
/**
|
|
210
|
-
*
|
|
258
|
+
* Indicates whether the line item is prorated for `SUBSCRIPTION` type product.
|
|
211
259
|
*/
|
|
212
260
|
is_prorated?: boolean;
|
|
213
261
|
|
|
214
262
|
/**
|
|
215
|
-
* Only present for contract invoices and when the include_list_prices query
|
|
263
|
+
* Only present for contract invoices and when the `include_list_prices` query
|
|
216
264
|
* parameter is set to true. This will include the list rate for the charge if
|
|
217
265
|
* applicable. Only present for usage and subscription line items.
|
|
218
266
|
*/
|
|
@@ -230,74 +278,89 @@ export namespace Invoice {
|
|
|
230
278
|
*/
|
|
231
279
|
netsuite_invoice_billing_start?: string;
|
|
232
280
|
|
|
233
|
-
/**
|
|
234
|
-
* only present for beta contract invoices. This field's availability is dependent
|
|
235
|
-
* on your client's configuration.
|
|
236
|
-
*/
|
|
237
281
|
netsuite_item_id?: string;
|
|
238
282
|
|
|
239
283
|
/**
|
|
240
|
-
*
|
|
284
|
+
* Only present for line items paying for a postpaid commit true-up.
|
|
241
285
|
*/
|
|
242
286
|
postpaid_commit?: LineItem.PostpaidCommit;
|
|
243
287
|
|
|
244
288
|
/**
|
|
245
|
-
*
|
|
246
|
-
*
|
|
289
|
+
* Includes the presentation group values associated with this line item if
|
|
290
|
+
* presentation group keys are used.
|
|
247
291
|
*/
|
|
248
|
-
presentation_group_values?:
|
|
292
|
+
presentation_group_values?: { [key: string]: string | null };
|
|
249
293
|
|
|
250
294
|
/**
|
|
251
|
-
*
|
|
252
|
-
*
|
|
295
|
+
* Includes the pricing group values associated with this line item if dimensional
|
|
296
|
+
* pricing is used.
|
|
253
297
|
*/
|
|
254
|
-
pricing_group_values?:
|
|
298
|
+
pricing_group_values?: { [key: string]: string };
|
|
255
299
|
|
|
256
|
-
product_custom_fields?:
|
|
300
|
+
product_custom_fields?: { [key: string]: string };
|
|
257
301
|
|
|
302
|
+
/**
|
|
303
|
+
* ID of the product associated with the line item.
|
|
304
|
+
*/
|
|
258
305
|
product_id?: string;
|
|
259
306
|
|
|
260
|
-
product_type?: string;
|
|
261
|
-
|
|
262
307
|
/**
|
|
263
|
-
*
|
|
308
|
+
* The current product tags associated with the line item's `product_id`.
|
|
264
309
|
*/
|
|
265
|
-
|
|
310
|
+
product_tags?: Array<string>;
|
|
266
311
|
|
|
267
312
|
/**
|
|
268
|
-
*
|
|
313
|
+
* The type of the line item's product. Possible values are `FixedProductListItem`
|
|
314
|
+
* (for `FIXED` type products), `UsageProductListItem` (for `USAGE` type products),
|
|
315
|
+
* `SubscriptionProductListItem` (for `SUBSCRIPTION` type products) or
|
|
316
|
+
* `CompositeProductListItem` (for `COMPOSITE` type products). For scheduled
|
|
317
|
+
* charges, commit and credit payments, the value is `FixedProductListItem`.
|
|
269
318
|
*/
|
|
319
|
+
product_type?: string;
|
|
320
|
+
|
|
321
|
+
professional_service_custom_fields?: { [key: string]: string };
|
|
322
|
+
|
|
270
323
|
professional_service_id?: string;
|
|
271
324
|
|
|
325
|
+
/**
|
|
326
|
+
* The quantity associated with the line item.
|
|
327
|
+
*/
|
|
272
328
|
quantity?: number;
|
|
273
329
|
|
|
274
330
|
reseller_type?: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
275
331
|
|
|
276
|
-
scheduled_charge_custom_fields?:
|
|
332
|
+
scheduled_charge_custom_fields?: { [key: string]: string };
|
|
277
333
|
|
|
278
334
|
/**
|
|
279
|
-
*
|
|
335
|
+
* ID of scheduled charge.
|
|
280
336
|
*/
|
|
281
337
|
scheduled_charge_id?: string;
|
|
282
338
|
|
|
283
339
|
/**
|
|
284
|
-
*
|
|
340
|
+
* The line item's start date (inclusive).
|
|
285
341
|
*/
|
|
286
342
|
starting_at?: string;
|
|
287
343
|
|
|
288
344
|
sub_line_items?: Array<LineItem.SubLineItem>;
|
|
289
345
|
|
|
346
|
+
subscription_custom_fields?: { [key: string]: string };
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Populated if the line item has a tiered price.
|
|
350
|
+
*/
|
|
290
351
|
tier?: LineItem.Tier;
|
|
291
352
|
|
|
292
353
|
/**
|
|
293
|
-
*
|
|
354
|
+
* The unit price associated with the line item.
|
|
294
355
|
*/
|
|
295
356
|
unit_price?: number;
|
|
296
357
|
}
|
|
297
358
|
|
|
298
359
|
export namespace LineItem {
|
|
299
360
|
/**
|
|
300
|
-
*
|
|
361
|
+
* Details about the credit or commit that was applied to this line item. Only
|
|
362
|
+
* present on line items with product of `USAGE`, `SUBSCRIPTION` or `COMPOSITE`
|
|
363
|
+
* types.
|
|
301
364
|
*/
|
|
302
365
|
export interface AppliedCommitOrCredit {
|
|
303
366
|
id: string;
|
|
@@ -306,14 +369,14 @@ export namespace Invoice {
|
|
|
306
369
|
}
|
|
307
370
|
|
|
308
371
|
/**
|
|
309
|
-
*
|
|
372
|
+
* Only present for line items paying for a postpaid commit true-up.
|
|
310
373
|
*/
|
|
311
374
|
export interface PostpaidCommit {
|
|
312
375
|
id: string;
|
|
313
376
|
}
|
|
314
377
|
|
|
315
378
|
export interface SubLineItem {
|
|
316
|
-
custom_fields:
|
|
379
|
+
custom_fields: { [key: string]: string };
|
|
317
380
|
|
|
318
381
|
name: string;
|
|
319
382
|
|
|
@@ -373,6 +436,9 @@ export namespace Invoice {
|
|
|
373
436
|
}
|
|
374
437
|
}
|
|
375
438
|
|
|
439
|
+
/**
|
|
440
|
+
* Populated if the line item has a tiered price.
|
|
441
|
+
*/
|
|
376
442
|
export interface Tier {
|
|
377
443
|
level: number;
|
|
378
444
|
|
|
@@ -459,13 +525,13 @@ export namespace Invoice {
|
|
|
459
525
|
|
|
460
526
|
total: number;
|
|
461
527
|
|
|
462
|
-
credit_grant_custom_fields?:
|
|
528
|
+
credit_grant_custom_fields?: { [key: string]: string };
|
|
463
529
|
|
|
464
530
|
credit_grant_id?: string;
|
|
465
531
|
}
|
|
466
532
|
|
|
467
533
|
/**
|
|
468
|
-
*
|
|
534
|
+
* Only present for contract invoices with reseller royalties.
|
|
469
535
|
*/
|
|
470
536
|
export interface ResellerRoyalty {
|
|
471
537
|
fraction: string;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as Core from
|
|
3
|
+
import { APIResource } from "../../../resource.js";
|
|
4
|
+
import * as Core from "../../../core.js";
|
|
5
5
|
|
|
6
6
|
export class NamedSchedules extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Get a named schedule for the given customer. This endpoint's availability is
|
|
9
9
|
* dependent on your client's configuration.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const namedSchedule =
|
|
14
|
+
* await client.v1.customers.namedSchedules.retrieve({
|
|
15
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
16
|
+
* schedule_name: 'my-schedule',
|
|
17
|
+
* covering_date: '2022-02-15T00:00:00Z',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
10
20
|
*/
|
|
11
21
|
retrieve(
|
|
12
22
|
body: NamedScheduleRetrieveParams,
|
|
@@ -18,6 +28,17 @@ export class NamedSchedules extends APIResource {
|
|
|
18
28
|
/**
|
|
19
29
|
* Update a named schedule for the given customer. This endpoint's availability is
|
|
20
30
|
* dependent on your client's configuration.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* await client.v1.customers.namedSchedules.update({
|
|
35
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
36
|
+
* schedule_name: 'my-schedule',
|
|
37
|
+
* starting_at: '2022-02-01T00:00:00Z',
|
|
38
|
+
* value: { my_key: 'my_value' },
|
|
39
|
+
* ending_before: '2022-02-15T00:00:00Z',
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
21
42
|
*/
|
|
22
43
|
update(body: NamedScheduleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
23
44
|
return this._client.post('/v1/customers/updateNamedSchedule', {
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as Core from
|
|
5
|
-
import * as Shared from
|
|
6
|
-
import { CursorPage, type CursorPageParams } from
|
|
3
|
+
import { APIResource } from "../../../resource.js";
|
|
4
|
+
import * as Core from "../../../core.js";
|
|
5
|
+
import * as Shared from "../../shared.js";
|
|
6
|
+
import { CursorPage, type CursorPageParams } from "../../../pagination.js";
|
|
7
7
|
|
|
8
8
|
export class Plans extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* List the given customer's plans in reverse-chronological order.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Automatically fetches more pages as needed.
|
|
15
|
+
* for await (const planListResponse of client.v1.customers.plans.list(
|
|
16
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
17
|
+
* )) {
|
|
18
|
+
* // ...
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
11
21
|
*/
|
|
12
22
|
list(
|
|
13
23
|
params: PlanListParams,
|
|
@@ -24,6 +34,16 @@ export class Plans extends APIResource {
|
|
|
24
34
|
* Associate an existing customer with a plan for a specified date range. See the
|
|
25
35
|
* [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
26
36
|
* for details on the price adjustments.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const response = await client.v1.customers.plans.add({
|
|
41
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
42
|
+
* plan_id: 'd2c06dae-9549-4d7d-bc04-b78dd3d241b8',
|
|
43
|
+
* starting_on: '2021-02-01T00:00:00Z',
|
|
44
|
+
* ending_before: '2022-02-01T00:00:00Z',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
27
47
|
*/
|
|
28
48
|
add(params: PlanAddParams, options?: Core.RequestOptions): Core.APIPromise<PlanAddResponse> {
|
|
29
49
|
const { customer_id, ...body } = params;
|
|
@@ -32,6 +52,15 @@ export class Plans extends APIResource {
|
|
|
32
52
|
|
|
33
53
|
/**
|
|
34
54
|
* Change the end date of a customer's plan.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const response = await client.v1.customers.plans.end({
|
|
59
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
60
|
+
* customer_plan_id: '7aa11640-0703-4600-8eb9-293f535a6b74',
|
|
61
|
+
* ending_before: '2021-02-01T00:00:00Z',
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
35
64
|
*/
|
|
36
65
|
end(params: PlanEndParams, options?: Core.RequestOptions): Core.APIPromise<PlanEndResponse> {
|
|
37
66
|
const { customer_id, customer_plan_id, ...body } = params;
|
|
@@ -45,6 +74,20 @@ export class Plans extends APIResource {
|
|
|
45
74
|
* Lists a customer plans adjustments. See the
|
|
46
75
|
* [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
47
76
|
* for details.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* // Automatically fetches more pages as needed.
|
|
81
|
+
* for await (const planListPriceAdjustmentsResponse of client.v1.customers.plans.listPriceAdjustments(
|
|
82
|
+
* {
|
|
83
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
84
|
+
* customer_plan_id:
|
|
85
|
+
* '7aa11640-0703-4600-8eb9-293f535a6b74',
|
|
86
|
+
* },
|
|
87
|
+
* )) {
|
|
88
|
+
* // ...
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
48
91
|
*/
|
|
49
92
|
listPriceAdjustments(
|
|
50
93
|
params: PlanListPriceAdjustmentsParams,
|
|
@@ -69,7 +112,7 @@ export interface PlanListResponse {
|
|
|
69
112
|
*/
|
|
70
113
|
id: string;
|
|
71
114
|
|
|
72
|
-
custom_fields:
|
|
115
|
+
custom_fields: { [key: string]: string };
|
|
73
116
|
|
|
74
117
|
plan_description: string;
|
|
75
118
|
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as Core from
|
|
3
|
+
import { APIResource } from "../../resource.js";
|
|
4
|
+
import * as Core from "../../core.js";
|
|
5
5
|
|
|
6
6
|
export class Dashboards extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Retrieve an embeddable dashboard url for a customer. The dashboard can be
|
|
9
9
|
* embedded using an iframe in a website. This will show information such as usage
|
|
10
10
|
* data and customer invoices.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response =
|
|
15
|
+
* await client.v1.dashboards.getEmbeddableURL({
|
|
16
|
+
* customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
|
|
17
|
+
* dashboard: 'invoices',
|
|
18
|
+
* bm_group_key_overrides: [
|
|
19
|
+
* {
|
|
20
|
+
* group_key_name: 'tenant_id',
|
|
21
|
+
* display_name: 'Org ID',
|
|
22
|
+
* value_display_names: {
|
|
23
|
+
* '48ecb18f358f': 'Cluster EU',
|
|
24
|
+
* e358f3ce242d: 'Cluster APAC',
|
|
25
|
+
* },
|
|
26
|
+
* },
|
|
27
|
+
* ],
|
|
28
|
+
* color_overrides: [
|
|
29
|
+
* { name: 'Gray_dark', value: '#ff0000' },
|
|
30
|
+
* ],
|
|
31
|
+
* dashboard_options: [
|
|
32
|
+
* { key: 'show_zero_usage_line_items', value: 'false' },
|
|
33
|
+
* { key: 'hide_voided_invoices', value: 'true' },
|
|
34
|
+
* ],
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
11
37
|
*/
|
|
12
38
|
getEmbeddableURL(
|
|
13
39
|
body: DashboardGetEmbeddableURLParams,
|
|
@@ -33,7 +59,7 @@ export interface DashboardGetEmbeddableURLParams {
|
|
|
33
59
|
/**
|
|
34
60
|
* The type of dashboard to retrieve.
|
|
35
61
|
*/
|
|
36
|
-
dashboard: 'invoices' | 'usage' | 'credits';
|
|
62
|
+
dashboard: 'invoices' | 'usage' | 'credits' | 'commits_and_credits';
|
|
37
63
|
|
|
38
64
|
/**
|
|
39
65
|
* Optional list of billable metric group key overrides
|
|
@@ -67,7 +93,7 @@ export namespace DashboardGetEmbeddableURLParams {
|
|
|
67
93
|
* <key, value> pairs of the billable metric group key values and their display
|
|
68
94
|
* names. e.g. {"a": "Asia", "b": "Euro"}
|
|
69
95
|
*/
|
|
70
|
-
value_display_names?:
|
|
96
|
+
value_display_names?: { [key: string]: unknown };
|
|
71
97
|
}
|
|
72
98
|
|
|
73
99
|
export interface ColorOverride {
|
|
@@ -93,7 +119,9 @@ export namespace DashboardGetEmbeddableURLParams {
|
|
|
93
119
|
| 'UsageLine_8'
|
|
94
120
|
| 'UsageLine_9'
|
|
95
121
|
| 'Primary_green'
|
|
96
|
-
| 'Primary_red'
|
|
122
|
+
| 'Primary_red'
|
|
123
|
+
| 'Progress_bar'
|
|
124
|
+
| 'Progress_bar_background';
|
|
97
125
|
|
|
98
126
|
/**
|
|
99
127
|
* Hex value representation of the color
|