@metronome/sdk 0.1.0-alpha.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 +24 -0
- package/LICENSE +201 -0
- package/README.md +313 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +90 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +237 -0
- package/core.d.ts.map +1 -0
- package/core.js +868 -0
- package/core.js.map +1 -0
- package/core.mjs +837 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +53 -0
- package/error.d.ts.map +1 -0
- package/error.js +143 -0
- package/error.js.map +1 -0
- package/error.mjs +127 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +210 -0
- package/index.d.ts +210 -0
- package/index.d.ts.map +1 -0
- package/index.js +133 -0
- package/index.js.map +1 -0
- package/index.mjs +105 -0
- package/index.mjs.map +1 -0
- package/package.json +106 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/alerts.d.ts +103 -0
- package/resources/alerts.d.ts.map +1 -0
- package/resources/alerts.js +23 -0
- package/resources/alerts.js.map +1 -0
- package/resources/alerts.mjs +19 -0
- package/resources/alerts.mjs.map +1 -0
- package/resources/audit-logs.d.ts +83 -0
- package/resources/audit-logs.d.ts.map +1 -0
- package/resources/audit-logs.js +18 -0
- package/resources/audit-logs.js.map +1 -0
- package/resources/audit-logs.mjs +14 -0
- package/resources/audit-logs.mjs.map +1 -0
- package/resources/billable-metrics.d.ts +236 -0
- package/resources/billable-metrics.d.ts.map +1 -0
- package/resources/billable-metrics.js +36 -0
- package/resources/billable-metrics.js.map +1 -0
- package/resources/billable-metrics.mjs +32 -0
- package/resources/billable-metrics.mjs.map +1 -0
- package/resources/credit-grants.d.ts +469 -0
- package/resources/credit-grants.d.ts.map +1 -0
- package/resources/credit-grants.js +50 -0
- package/resources/credit-grants.js.map +1 -0
- package/resources/credit-grants.mjs +46 -0
- package/resources/credit-grants.mjs.map +1 -0
- package/resources/custom-fields.d.ts +82 -0
- package/resources/custom-fields.d.ts.map +1 -0
- package/resources/custom-fields.js +66 -0
- package/resources/custom-fields.js.map +1 -0
- package/resources/custom-fields.mjs +62 -0
- package/resources/custom-fields.mjs.map +1 -0
- package/resources/customers/alerts.d.ts +146 -0
- package/resources/customers/alerts.d.ts.map +1 -0
- package/resources/customers/alerts.js +35 -0
- package/resources/customers/alerts.js.map +1 -0
- package/resources/customers/alerts.mjs +31 -0
- package/resources/customers/alerts.mjs.map +1 -0
- package/resources/customers/billing-config.d.ts +64 -0
- package/resources/customers/billing-config.d.ts.map +1 -0
- package/resources/customers/billing-config.js +37 -0
- package/resources/customers/billing-config.js.map +1 -0
- package/resources/customers/billing-config.mjs +33 -0
- package/resources/customers/billing-config.mjs.map +1 -0
- package/resources/customers/customers.d.ts +313 -0
- package/resources/customers/customers.d.ts.map +1 -0
- package/resources/customers/customers.js +116 -0
- package/resources/customers/customers.js.map +1 -0
- package/resources/customers/customers.mjs +89 -0
- package/resources/customers/customers.mjs.map +1 -0
- package/resources/customers/index.d.ts +6 -0
- package/resources/customers/index.d.ts.map +1 -0
- package/resources/customers/index.js +15 -0
- package/resources/customers/index.js.map +1 -0
- package/resources/customers/index.mjs +7 -0
- package/resources/customers/index.mjs.map +1 -0
- package/resources/customers/invoices.d.ts +331 -0
- package/resources/customers/invoices.d.ts.map +1 -0
- package/resources/customers/invoices.js +30 -0
- package/resources/customers/invoices.js.map +1 -0
- package/resources/customers/invoices.mjs +26 -0
- package/resources/customers/invoices.mjs.map +1 -0
- package/resources/customers/plans.d.ts +239 -0
- package/resources/customers/plans.d.ts.map +1 -0
- package/resources/customers/plans.js +41 -0
- package/resources/customers/plans.js.map +1 -0
- package/resources/customers/plans.mjs +37 -0
- package/resources/customers/plans.mjs.map +1 -0
- package/resources/dashboards.d.ts +61 -0
- package/resources/dashboards.d.ts.map +1 -0
- package/resources/dashboards.js +19 -0
- package/resources/dashboards.js.map +1 -0
- package/resources/dashboards.mjs +15 -0
- package/resources/dashboards.mjs.map +1 -0
- package/resources/index.d.ts +13 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +42 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +14 -0
- package/resources/index.mjs.map +1 -0
- package/resources/plans.d.ts +217 -0
- package/resources/plans.d.ts.map +1 -0
- package/resources/plans.js +36 -0
- package/resources/plans.js.map +1 -0
- package/resources/plans.mjs +32 -0
- package/resources/plans.mjs.map +1 -0
- package/resources/services.d.ts +26 -0
- package/resources/services.d.ts.map +1 -0
- package/resources/services.js +20 -0
- package/resources/services.js.map +1 -0
- package/resources/services.mjs +16 -0
- package/resources/services.mjs.map +1 -0
- package/resources/shared.d.ts +540 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/usage.d.ts +182 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +41 -0
- package/resources/usage.js.map +1 -0
- package/resources/usage.mjs +37 -0
- package/resources/usage.mjs.map +1 -0
- package/resources/webhooks.d.ts +22 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +91 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +87 -0
- package/resources/webhooks.mjs.map +1 -0
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +83 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1146 -0
- package/src/error.ts +146 -0
- package/src/index.ts +303 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/alerts.ts +144 -0
- package/src/resources/audit-logs.ts +116 -0
- package/src/resources/billable-metrics.ts +341 -0
- package/src/resources/credit-grants.ts +627 -0
- package/src/resources/custom-fields.ts +242 -0
- package/src/resources/customers/alerts.ts +214 -0
- package/src/resources/customers/billing-config.ts +183 -0
- package/src/resources/customers/customers.ts +500 -0
- package/src/resources/customers/index.ts +53 -0
- package/src/resources/customers/invoices.ts +533 -0
- package/src/resources/customers/plans.ts +363 -0
- package/src/resources/dashboards.ts +98 -0
- package/src/resources/index.ts +90 -0
- package/src/resources/plans.ts +333 -0
- package/src/resources/services.ts +35 -0
- package/src/resources/shared.ts +849 -0
- package/src/resources/usage.ts +245 -0
- package/src/resources/webhooks.ts +120 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +248 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +165 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +152 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as Core from "../core";
|
|
4
|
+
import { APIResource } from "../resource";
|
|
5
|
+
import { isRequestOptions } from "../core";
|
|
6
|
+
import * as PlansAPI from "./plans";
|
|
7
|
+
import * as Shared from "./shared";
|
|
8
|
+
import * as CustomersAPI from "./customers/customers";
|
|
9
|
+
|
|
10
|
+
export class Plans extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* List all available plans.
|
|
13
|
+
*/
|
|
14
|
+
list(query?: PlanListParams, options?: Core.RequestOptions): Core.APIPromise<PlanListResponse>;
|
|
15
|
+
list(options?: Core.RequestOptions): Core.APIPromise<PlanListResponse>;
|
|
16
|
+
list(
|
|
17
|
+
query: PlanListParams | Core.RequestOptions = {},
|
|
18
|
+
options?: Core.RequestOptions,
|
|
19
|
+
): Core.APIPromise<PlanListResponse> {
|
|
20
|
+
if (isRequestOptions(query)) {
|
|
21
|
+
return this.list({}, query);
|
|
22
|
+
}
|
|
23
|
+
return this._client.get('/plans', { query, ...options });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Fetch high level details of a specific plan.
|
|
28
|
+
*/
|
|
29
|
+
getDetails(planId: string, options?: Core.RequestOptions): Core.APIPromise<PlanGetDetailsResponse> {
|
|
30
|
+
return this._client.get(`/planDetails/${planId}`, options);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Fetches a list of charges of a specific plan.
|
|
35
|
+
*/
|
|
36
|
+
listCharges(
|
|
37
|
+
planId: string,
|
|
38
|
+
query?: PlanListChargesParams,
|
|
39
|
+
options?: Core.RequestOptions,
|
|
40
|
+
): Core.APIPromise<PlanListChargesResponse>;
|
|
41
|
+
listCharges(planId: string, options?: Core.RequestOptions): Core.APIPromise<PlanListChargesResponse>;
|
|
42
|
+
listCharges(
|
|
43
|
+
planId: string,
|
|
44
|
+
query: PlanListChargesParams | Core.RequestOptions = {},
|
|
45
|
+
options?: Core.RequestOptions,
|
|
46
|
+
): Core.APIPromise<PlanListChargesResponse> {
|
|
47
|
+
if (isRequestOptions(query)) {
|
|
48
|
+
return this.listCharges(planId, {}, query);
|
|
49
|
+
}
|
|
50
|
+
return this._client.get(`/planDetails/${planId}/charges`, { query, ...options });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Fetches a list of customers on a specific plan (by default, only currently
|
|
55
|
+
* active plans are included)
|
|
56
|
+
*/
|
|
57
|
+
listCustomers(
|
|
58
|
+
planId: string,
|
|
59
|
+
query?: PlanListCustomersParams,
|
|
60
|
+
options?: Core.RequestOptions,
|
|
61
|
+
): Core.APIPromise<PlanListCustomersResponse>;
|
|
62
|
+
listCustomers(planId: string, options?: Core.RequestOptions): Core.APIPromise<PlanListCustomersResponse>;
|
|
63
|
+
listCustomers(
|
|
64
|
+
planId: string,
|
|
65
|
+
query: PlanListCustomersParams | Core.RequestOptions = {},
|
|
66
|
+
options?: Core.RequestOptions,
|
|
67
|
+
): Core.APIPromise<PlanListCustomersResponse> {
|
|
68
|
+
if (isRequestOptions(query)) {
|
|
69
|
+
return this.listCustomers(planId, {}, query);
|
|
70
|
+
}
|
|
71
|
+
return this._client.get(`/planDetails/${planId}/customers`, { query, ...options });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface PlanDetail {
|
|
76
|
+
id: string;
|
|
77
|
+
|
|
78
|
+
custom_fields: Record<string, string>;
|
|
79
|
+
|
|
80
|
+
name: string;
|
|
81
|
+
|
|
82
|
+
credit_grants?: Array<PlanDetail.CreditGrant>;
|
|
83
|
+
|
|
84
|
+
description?: string;
|
|
85
|
+
|
|
86
|
+
minimums?: Array<PlanDetail.Minimum>;
|
|
87
|
+
|
|
88
|
+
overage_rates?: Array<PlanDetail.OverageRate>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export namespace PlanDetail {
|
|
92
|
+
export interface CreditGrant {
|
|
93
|
+
amount_granted: number;
|
|
94
|
+
|
|
95
|
+
amount_granted_credit_type: Shared.CreditType;
|
|
96
|
+
|
|
97
|
+
amount_paid: number;
|
|
98
|
+
|
|
99
|
+
amount_paid_credit_type: Shared.CreditType;
|
|
100
|
+
|
|
101
|
+
effective_duration: number;
|
|
102
|
+
|
|
103
|
+
name: string;
|
|
104
|
+
|
|
105
|
+
priority: string;
|
|
106
|
+
|
|
107
|
+
send_invoice: boolean;
|
|
108
|
+
|
|
109
|
+
reason?: string;
|
|
110
|
+
|
|
111
|
+
recurrence_duration?: number;
|
|
112
|
+
|
|
113
|
+
recurrence_interval?: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface Minimum {
|
|
117
|
+
credit_type: Shared.CreditType;
|
|
118
|
+
|
|
119
|
+
name: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Used in price ramps. Indicates how many billing periods pass before the charge
|
|
123
|
+
* applies.
|
|
124
|
+
*/
|
|
125
|
+
start_period: number;
|
|
126
|
+
|
|
127
|
+
value: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface OverageRate {
|
|
131
|
+
credit_type: Shared.CreditType;
|
|
132
|
+
|
|
133
|
+
fiat_credit_type: Shared.CreditType;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Used in price ramps. Indicates how many billing periods pass before the charge
|
|
137
|
+
* applies.
|
|
138
|
+
*/
|
|
139
|
+
start_period: number;
|
|
140
|
+
|
|
141
|
+
to_fiat_conversion_factor: number;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface PlanListResponse {
|
|
146
|
+
data: Array<PlanListResponse.Data>;
|
|
147
|
+
|
|
148
|
+
next_page: string | null;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export namespace PlanListResponse {
|
|
152
|
+
export interface Data {
|
|
153
|
+
id: string;
|
|
154
|
+
|
|
155
|
+
description: string;
|
|
156
|
+
|
|
157
|
+
name: string;
|
|
158
|
+
|
|
159
|
+
custom_fields?: Record<string, string>;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface PlanGetDetailsResponse {
|
|
164
|
+
data: PlanDetail;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface PlanListChargesResponse {
|
|
168
|
+
data: Array<PlanListChargesResponse.Data>;
|
|
169
|
+
|
|
170
|
+
next_page: string | null;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export namespace PlanListChargesResponse {
|
|
174
|
+
export interface Data {
|
|
175
|
+
id: string;
|
|
176
|
+
|
|
177
|
+
charge_type: 'usage' | 'fixed' | 'composite' | 'minimum' | 'seat';
|
|
178
|
+
|
|
179
|
+
credit_type: Shared.CreditType;
|
|
180
|
+
|
|
181
|
+
custom_fields: Record<string, string>;
|
|
182
|
+
|
|
183
|
+
name: string;
|
|
184
|
+
|
|
185
|
+
prices: Array<Data.Price>;
|
|
186
|
+
|
|
187
|
+
product_id: string;
|
|
188
|
+
|
|
189
|
+
product_name: string;
|
|
190
|
+
|
|
191
|
+
quantity?: number;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Used in price ramps. Indicates how many billing periods pass before the charge
|
|
195
|
+
* applies.
|
|
196
|
+
*/
|
|
197
|
+
start_period?: number;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Specifies how quantities for usage based charges will be converted.
|
|
201
|
+
*/
|
|
202
|
+
unit_conversion?: Data.UnitConversion;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export namespace Data {
|
|
206
|
+
export interface Price {
|
|
207
|
+
/**
|
|
208
|
+
* Used in pricing tiers. Indicates at what metric value the price applies.
|
|
209
|
+
*/
|
|
210
|
+
tier: number;
|
|
211
|
+
|
|
212
|
+
value: number;
|
|
213
|
+
|
|
214
|
+
collection_interval?: number;
|
|
215
|
+
|
|
216
|
+
collection_schedule?: string;
|
|
217
|
+
|
|
218
|
+
quantity?: number;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Specifies how quantities for usage based charges will be converted.
|
|
223
|
+
*/
|
|
224
|
+
export interface UnitConversion {
|
|
225
|
+
/**
|
|
226
|
+
* The conversion factor
|
|
227
|
+
*/
|
|
228
|
+
division_factor: number;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Whether usage should be rounded down or up to the nearest whole number. If null,
|
|
232
|
+
* quantity will be rounded to 20 decimal places.
|
|
233
|
+
*/
|
|
234
|
+
rounding_behavior?: 'floor' | 'ceiling';
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface PlanListCustomersResponse {
|
|
240
|
+
data: Array<PlanListCustomersResponse.Data>;
|
|
241
|
+
|
|
242
|
+
next_page: string | null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export namespace PlanListCustomersResponse {
|
|
246
|
+
export interface Data {
|
|
247
|
+
customer_details: CustomersAPI.CustomerDetail;
|
|
248
|
+
|
|
249
|
+
plan_details: Data.PlanDetails;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export namespace Data {
|
|
253
|
+
export interface PlanDetails {
|
|
254
|
+
id: string;
|
|
255
|
+
|
|
256
|
+
custom_fields: Record<string, string>;
|
|
257
|
+
|
|
258
|
+
customer_plan_id: string;
|
|
259
|
+
|
|
260
|
+
name: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The start date of the plan
|
|
264
|
+
*/
|
|
265
|
+
starting_on: string;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The end date of the plan
|
|
269
|
+
*/
|
|
270
|
+
ending_before?: string | null;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface PlanListParams {
|
|
276
|
+
/**
|
|
277
|
+
* Max number of results that should be returned
|
|
278
|
+
*/
|
|
279
|
+
limit?: number;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Cursor that indicates where the next page of results should start.
|
|
283
|
+
*/
|
|
284
|
+
next_page?: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface PlanListChargesParams {
|
|
288
|
+
/**
|
|
289
|
+
* Max number of results that should be returned
|
|
290
|
+
*/
|
|
291
|
+
limit?: number;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Cursor that indicates where the next page of results should start.
|
|
295
|
+
*/
|
|
296
|
+
next_page?: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface PlanListCustomersParams {
|
|
300
|
+
/**
|
|
301
|
+
* Max number of results that should be returned
|
|
302
|
+
*/
|
|
303
|
+
limit?: number;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Cursor that indicates where the next page of results should start.
|
|
307
|
+
*/
|
|
308
|
+
next_page?: string;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Status of customers on a given plan. Defaults to `active`.
|
|
312
|
+
*
|
|
313
|
+
* - `all` - Return current, past, and upcoming customers of the plan.
|
|
314
|
+
* - `active` - Return current customers of the plan.
|
|
315
|
+
* - `ended` - Return past customers of the plan.
|
|
316
|
+
* - `upcoming` - Return upcoming customers of the plan.
|
|
317
|
+
*
|
|
318
|
+
* Multiple statuses can be OR'd together using commas, e.g. `active,ended`.
|
|
319
|
+
* **Note:** `ended,upcoming` combination is not yet supported.
|
|
320
|
+
*/
|
|
321
|
+
status?: 'all' | 'active' | 'ended' | 'upcoming';
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export namespace Plans {
|
|
325
|
+
export import PlanDetail = PlansAPI.PlanDetail;
|
|
326
|
+
export import PlanListResponse = PlansAPI.PlanListResponse;
|
|
327
|
+
export import PlanGetDetailsResponse = PlansAPI.PlanGetDetailsResponse;
|
|
328
|
+
export import PlanListChargesResponse = PlansAPI.PlanListChargesResponse;
|
|
329
|
+
export import PlanListCustomersResponse = PlansAPI.PlanListCustomersResponse;
|
|
330
|
+
export import PlanListParams = PlansAPI.PlanListParams;
|
|
331
|
+
export import PlanListChargesParams = PlansAPI.PlanListChargesParams;
|
|
332
|
+
export import PlanListCustomersParams = PlansAPI.PlanListCustomersParams;
|
|
333
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as Core from "../core";
|
|
4
|
+
import { APIResource } from "../resource";
|
|
5
|
+
import * as ServicesAPI from "./services";
|
|
6
|
+
|
|
7
|
+
export class Services extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Fetches a list of services used by Metronome and the associated IP addresses. IP
|
|
10
|
+
* addresses are not necessarily unique between services. In most cases, IP
|
|
11
|
+
* addresses will appear in the list at least 30 days before they are used for the
|
|
12
|
+
* first time.
|
|
13
|
+
*/
|
|
14
|
+
list(options?: Core.RequestOptions): Core.APIPromise<ServiceListResponse> {
|
|
15
|
+
return this._client.get('/services', options);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ServiceListResponse {
|
|
20
|
+
services: Array<ServiceListResponse.Service>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export namespace ServiceListResponse {
|
|
24
|
+
export interface Service {
|
|
25
|
+
ips: Array<string>;
|
|
26
|
+
|
|
27
|
+
name: string;
|
|
28
|
+
|
|
29
|
+
usage: 'makes_connections_from' | 'accepts_connections_at';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export namespace Services {
|
|
34
|
+
export import ServiceListResponse = ServicesAPI.ServiceListResponse;
|
|
35
|
+
}
|