@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.
Files changed (284) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +201 -0
  3. package/README.md +313 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +90 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +237 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +868 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +837 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +53 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +143 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +127 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +210 -0
  87. package/index.d.ts +210 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +133 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +105 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +106 -0
  94. package/resource.d.ts +6 -0
  95. package/resource.d.ts.map +1 -0
  96. package/resource.js +11 -0
  97. package/resource.js.map +1 -0
  98. package/resource.mjs +7 -0
  99. package/resource.mjs.map +1 -0
  100. package/resources/alerts.d.ts +103 -0
  101. package/resources/alerts.d.ts.map +1 -0
  102. package/resources/alerts.js +23 -0
  103. package/resources/alerts.js.map +1 -0
  104. package/resources/alerts.mjs +19 -0
  105. package/resources/alerts.mjs.map +1 -0
  106. package/resources/audit-logs.d.ts +83 -0
  107. package/resources/audit-logs.d.ts.map +1 -0
  108. package/resources/audit-logs.js +18 -0
  109. package/resources/audit-logs.js.map +1 -0
  110. package/resources/audit-logs.mjs +14 -0
  111. package/resources/audit-logs.mjs.map +1 -0
  112. package/resources/billable-metrics.d.ts +236 -0
  113. package/resources/billable-metrics.d.ts.map +1 -0
  114. package/resources/billable-metrics.js +36 -0
  115. package/resources/billable-metrics.js.map +1 -0
  116. package/resources/billable-metrics.mjs +32 -0
  117. package/resources/billable-metrics.mjs.map +1 -0
  118. package/resources/credit-grants.d.ts +469 -0
  119. package/resources/credit-grants.d.ts.map +1 -0
  120. package/resources/credit-grants.js +50 -0
  121. package/resources/credit-grants.js.map +1 -0
  122. package/resources/credit-grants.mjs +46 -0
  123. package/resources/credit-grants.mjs.map +1 -0
  124. package/resources/custom-fields.d.ts +82 -0
  125. package/resources/custom-fields.d.ts.map +1 -0
  126. package/resources/custom-fields.js +66 -0
  127. package/resources/custom-fields.js.map +1 -0
  128. package/resources/custom-fields.mjs +62 -0
  129. package/resources/custom-fields.mjs.map +1 -0
  130. package/resources/customers/alerts.d.ts +146 -0
  131. package/resources/customers/alerts.d.ts.map +1 -0
  132. package/resources/customers/alerts.js +35 -0
  133. package/resources/customers/alerts.js.map +1 -0
  134. package/resources/customers/alerts.mjs +31 -0
  135. package/resources/customers/alerts.mjs.map +1 -0
  136. package/resources/customers/billing-config.d.ts +64 -0
  137. package/resources/customers/billing-config.d.ts.map +1 -0
  138. package/resources/customers/billing-config.js +37 -0
  139. package/resources/customers/billing-config.js.map +1 -0
  140. package/resources/customers/billing-config.mjs +33 -0
  141. package/resources/customers/billing-config.mjs.map +1 -0
  142. package/resources/customers/customers.d.ts +313 -0
  143. package/resources/customers/customers.d.ts.map +1 -0
  144. package/resources/customers/customers.js +116 -0
  145. package/resources/customers/customers.js.map +1 -0
  146. package/resources/customers/customers.mjs +89 -0
  147. package/resources/customers/customers.mjs.map +1 -0
  148. package/resources/customers/index.d.ts +6 -0
  149. package/resources/customers/index.d.ts.map +1 -0
  150. package/resources/customers/index.js +15 -0
  151. package/resources/customers/index.js.map +1 -0
  152. package/resources/customers/index.mjs +7 -0
  153. package/resources/customers/index.mjs.map +1 -0
  154. package/resources/customers/invoices.d.ts +331 -0
  155. package/resources/customers/invoices.d.ts.map +1 -0
  156. package/resources/customers/invoices.js +30 -0
  157. package/resources/customers/invoices.js.map +1 -0
  158. package/resources/customers/invoices.mjs +26 -0
  159. package/resources/customers/invoices.mjs.map +1 -0
  160. package/resources/customers/plans.d.ts +239 -0
  161. package/resources/customers/plans.d.ts.map +1 -0
  162. package/resources/customers/plans.js +41 -0
  163. package/resources/customers/plans.js.map +1 -0
  164. package/resources/customers/plans.mjs +37 -0
  165. package/resources/customers/plans.mjs.map +1 -0
  166. package/resources/dashboards.d.ts +61 -0
  167. package/resources/dashboards.d.ts.map +1 -0
  168. package/resources/dashboards.js +19 -0
  169. package/resources/dashboards.js.map +1 -0
  170. package/resources/dashboards.mjs +15 -0
  171. package/resources/dashboards.mjs.map +1 -0
  172. package/resources/index.d.ts +13 -0
  173. package/resources/index.d.ts.map +1 -0
  174. package/resources/index.js +42 -0
  175. package/resources/index.js.map +1 -0
  176. package/resources/index.mjs +14 -0
  177. package/resources/index.mjs.map +1 -0
  178. package/resources/plans.d.ts +217 -0
  179. package/resources/plans.d.ts.map +1 -0
  180. package/resources/plans.js +36 -0
  181. package/resources/plans.js.map +1 -0
  182. package/resources/plans.mjs +32 -0
  183. package/resources/plans.mjs.map +1 -0
  184. package/resources/services.d.ts +26 -0
  185. package/resources/services.d.ts.map +1 -0
  186. package/resources/services.js +20 -0
  187. package/resources/services.js.map +1 -0
  188. package/resources/services.mjs +16 -0
  189. package/resources/services.mjs.map +1 -0
  190. package/resources/shared.d.ts +540 -0
  191. package/resources/shared.d.ts.map +1 -0
  192. package/resources/shared.js +4 -0
  193. package/resources/shared.js.map +1 -0
  194. package/resources/shared.mjs +3 -0
  195. package/resources/shared.mjs.map +1 -0
  196. package/resources/usage.d.ts +182 -0
  197. package/resources/usage.d.ts.map +1 -0
  198. package/resources/usage.js +41 -0
  199. package/resources/usage.js.map +1 -0
  200. package/resources/usage.mjs +37 -0
  201. package/resources/usage.mjs.map +1 -0
  202. package/resources/webhooks.d.ts +22 -0
  203. package/resources/webhooks.d.ts.map +1 -0
  204. package/resources/webhooks.js +91 -0
  205. package/resources/webhooks.js.map +1 -0
  206. package/resources/webhooks.mjs +87 -0
  207. package/resources/webhooks.mjs.map +1 -0
  208. package/shims/node.d.ts +29 -0
  209. package/shims/node.d.ts.map +1 -0
  210. package/shims/node.js +31 -0
  211. package/shims/node.js.map +1 -0
  212. package/shims/node.mjs +5 -0
  213. package/shims/node.mjs.map +1 -0
  214. package/shims/web.d.ts +26 -0
  215. package/shims/web.d.ts.map +1 -0
  216. package/shims/web.js +31 -0
  217. package/shims/web.js.map +1 -0
  218. package/shims/web.mjs +5 -0
  219. package/shims/web.mjs.map +1 -0
  220. package/src/_shims/MultipartBody.ts +9 -0
  221. package/src/_shims/README.md +46 -0
  222. package/src/_shims/auto/runtime-bun.ts +4 -0
  223. package/src/_shims/auto/runtime-node.ts +4 -0
  224. package/src/_shims/auto/runtime.ts +4 -0
  225. package/src/_shims/auto/types-node.ts +4 -0
  226. package/src/_shims/auto/types.d.ts +101 -0
  227. package/src/_shims/auto/types.js +3 -0
  228. package/src/_shims/auto/types.mjs +3 -0
  229. package/src/_shims/bun-runtime.ts +14 -0
  230. package/src/_shims/index.d.ts +81 -0
  231. package/src/_shims/index.js +13 -0
  232. package/src/_shims/index.mjs +7 -0
  233. package/src/_shims/manual-types.d.ts +12 -0
  234. package/src/_shims/manual-types.js +3 -0
  235. package/src/_shims/manual-types.mjs +3 -0
  236. package/src/_shims/node-runtime.ts +83 -0
  237. package/src/_shims/node-types.d.ts +42 -0
  238. package/src/_shims/node-types.js +3 -0
  239. package/src/_shims/node-types.mjs +3 -0
  240. package/src/_shims/registry.ts +67 -0
  241. package/src/_shims/web-runtime.ts +103 -0
  242. package/src/_shims/web-types.d.ts +83 -0
  243. package/src/_shims/web-types.js +3 -0
  244. package/src/_shims/web-types.mjs +3 -0
  245. package/src/core.ts +1146 -0
  246. package/src/error.ts +146 -0
  247. package/src/index.ts +303 -0
  248. package/src/lib/.keep +4 -0
  249. package/src/resource.ts +11 -0
  250. package/src/resources/alerts.ts +144 -0
  251. package/src/resources/audit-logs.ts +116 -0
  252. package/src/resources/billable-metrics.ts +341 -0
  253. package/src/resources/credit-grants.ts +627 -0
  254. package/src/resources/custom-fields.ts +242 -0
  255. package/src/resources/customers/alerts.ts +214 -0
  256. package/src/resources/customers/billing-config.ts +183 -0
  257. package/src/resources/customers/customers.ts +500 -0
  258. package/src/resources/customers/index.ts +53 -0
  259. package/src/resources/customers/invoices.ts +533 -0
  260. package/src/resources/customers/plans.ts +363 -0
  261. package/src/resources/dashboards.ts +98 -0
  262. package/src/resources/index.ts +90 -0
  263. package/src/resources/plans.ts +333 -0
  264. package/src/resources/services.ts +35 -0
  265. package/src/resources/shared.ts +849 -0
  266. package/src/resources/usage.ts +245 -0
  267. package/src/resources/webhooks.ts +120 -0
  268. package/src/shims/node.ts +50 -0
  269. package/src/shims/web.ts +50 -0
  270. package/src/tsconfig.json +11 -0
  271. package/src/uploads.ts +248 -0
  272. package/src/version.ts +1 -0
  273. package/uploads.d.ts +75 -0
  274. package/uploads.d.ts.map +1 -0
  275. package/uploads.js +165 -0
  276. package/uploads.js.map +1 -0
  277. package/uploads.mjs +152 -0
  278. package/uploads.mjs.map +1 -0
  279. package/version.d.ts +2 -0
  280. package/version.d.ts.map +1 -0
  281. package/version.js +5 -0
  282. package/version.js.map +1 -0
  283. package/version.mjs +2 -0
  284. package/version.mjs.map +1 -0
@@ -0,0 +1,500 @@
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 CustomersAPI from "./customers";
7
+ import * as Shared from "../shared";
8
+ import * as AlertsAPI from "./alerts";
9
+ import * as BillingConfigAPI from "./billing-config";
10
+ import * as InvoicesAPI from "./invoices";
11
+ import * as PlansAPI from "./plans";
12
+
13
+ export class Customers extends APIResource {
14
+ alerts: AlertsAPI.Alerts = new AlertsAPI.Alerts(this._client);
15
+ plans: PlansAPI.Plans = new PlansAPI.Plans(this._client);
16
+ invoices: InvoicesAPI.Invoices = new InvoicesAPI.Invoices(this._client);
17
+ billingConfig: BillingConfigAPI.BillingConfig = new BillingConfigAPI.BillingConfig(this._client);
18
+
19
+ /**
20
+ * Create a new customer
21
+ */
22
+ create(body: CustomerCreateParams, options?: Core.RequestOptions): Core.APIPromise<CustomerCreateResponse> {
23
+ return this._client.post('/customers', { body, ...options });
24
+ }
25
+
26
+ /**
27
+ * Get a customer by Metronome ID.
28
+ */
29
+ retrieve(customerId: string, options?: Core.RequestOptions): Core.APIPromise<CustomerRetrieveResponse> {
30
+ return this._client.get(`/customers/${customerId}`, options);
31
+ }
32
+
33
+ /**
34
+ * List all customers.
35
+ */
36
+ list(query?: CustomerListParams, options?: Core.RequestOptions): Core.APIPromise<CustomerListResponse>;
37
+ list(options?: Core.RequestOptions): Core.APIPromise<CustomerListResponse>;
38
+ list(
39
+ query: CustomerListParams | Core.RequestOptions = {},
40
+ options?: Core.RequestOptions,
41
+ ): Core.APIPromise<CustomerListResponse> {
42
+ if (isRequestOptions(query)) {
43
+ return this.list({}, query);
44
+ }
45
+ return this._client.get('/customers', { query, ...options });
46
+ }
47
+
48
+ /**
49
+ * Archive a customer
50
+ */
51
+ archive(
52
+ body: CustomerArchiveParams,
53
+ options?: Core.RequestOptions,
54
+ ): Core.APIPromise<CustomerArchiveResponse> {
55
+ return this._client.post('/customers/archive', { body, ...options });
56
+ }
57
+
58
+ /**
59
+ * List all billable metrics.
60
+ */
61
+ listBillableMetrics(
62
+ customerId: string,
63
+ query?: CustomerListBillableMetricsParams,
64
+ options?: Core.RequestOptions,
65
+ ): Core.APIPromise<CustomerListBillableMetricsResponse>;
66
+ listBillableMetrics(
67
+ customerId: string,
68
+ options?: Core.RequestOptions,
69
+ ): Core.APIPromise<CustomerListBillableMetricsResponse>;
70
+ listBillableMetrics(
71
+ customerId: string,
72
+ query: CustomerListBillableMetricsParams | Core.RequestOptions = {},
73
+ options?: Core.RequestOptions,
74
+ ): Core.APIPromise<CustomerListBillableMetricsResponse> {
75
+ if (isRequestOptions(query)) {
76
+ return this.listBillableMetrics(customerId, {}, query);
77
+ }
78
+ return this._client.get(`/customers/${customerId}/billable-metrics`, { query, ...options });
79
+ }
80
+
81
+ /**
82
+ * Fetch daily pending costs for the specified customer, broken down by credit type
83
+ * and line items. Note: this is not supported for customers whose plan includes a
84
+ * UNIQUE-type billable metric.
85
+ */
86
+ listCosts(
87
+ customerId: string,
88
+ query: CustomerListCostsParams,
89
+ options?: Core.RequestOptions,
90
+ ): Core.APIPromise<CustomerListCostsResponse> {
91
+ return this._client.get(`/customers/${customerId}/costs`, { query, ...options });
92
+ }
93
+
94
+ /**
95
+ * Sets the ingest aliases for a customer. Ingest aliases can be used in the
96
+ * `customer_id` field when sending usage events to Metronome. This call is
97
+ * idempotent. It fully replaces the set of ingest aliases for the given customer.
98
+ */
99
+ setIngestAliases(
100
+ customerId: string,
101
+ body: CustomerSetIngestAliasesParams,
102
+ options?: Core.RequestOptions,
103
+ ): Core.APIPromise<void> {
104
+ return this._client.post(`/customers/${customerId}/setIngestAliases`, {
105
+ body,
106
+ ...options,
107
+ headers: { Accept: '*/*', ...options?.headers },
108
+ });
109
+ }
110
+
111
+ /**
112
+ * Updates the specified customer's name.
113
+ */
114
+ setName(
115
+ customerId: string,
116
+ body: CustomerSetNameParams,
117
+ options?: Core.RequestOptions,
118
+ ): Core.APIPromise<CustomerSetNameResponse> {
119
+ return this._client.post(`/customers/${customerId}/setName`, { body, ...options });
120
+ }
121
+
122
+ /**
123
+ * Updates the specified customer's config.
124
+ */
125
+ updateConfig(
126
+ customerId: string,
127
+ body?: CustomerUpdateConfigParams,
128
+ options?: Core.RequestOptions,
129
+ ): Core.APIPromise<void>;
130
+ updateConfig(customerId: string, options?: Core.RequestOptions): Core.APIPromise<void>;
131
+ updateConfig(
132
+ customerId: string,
133
+ body: CustomerUpdateConfigParams | Core.RequestOptions = {},
134
+ options?: Core.RequestOptions,
135
+ ): Core.APIPromise<void> {
136
+ if (isRequestOptions(body)) {
137
+ return this.updateConfig(customerId, {}, body);
138
+ }
139
+ return this._client.post(`/customers/${customerId}/updateConfig`, {
140
+ body,
141
+ ...options,
142
+ headers: { Accept: '*/*', ...options?.headers },
143
+ });
144
+ }
145
+ }
146
+
147
+ export interface Customer {
148
+ /**
149
+ * the Metronome ID of the customer
150
+ */
151
+ id: string;
152
+
153
+ /**
154
+ * (deprecated, use ingest_aliases instead) the first ID (Metronome or ingest
155
+ * alias) that can be used in usage events
156
+ */
157
+ external_id: string;
158
+
159
+ /**
160
+ * aliases for this customer that can be used instead of the Metronome customer ID
161
+ * in usage events
162
+ */
163
+ ingest_aliases: Array<string>;
164
+
165
+ name: string;
166
+
167
+ custom_fields?: Record<string, string>;
168
+ }
169
+
170
+ export interface CustomerDetail {
171
+ /**
172
+ * the Metronome ID of the customer
173
+ */
174
+ id: string;
175
+
176
+ current_billable_status: CustomerDetail.CurrentBillableStatus;
177
+
178
+ custom_fields: Record<string, string>;
179
+
180
+ customer_config: CustomerDetail.CustomerConfig;
181
+
182
+ /**
183
+ * (deprecated, use ingest_aliases instead) the first ID (Metronome or ingest
184
+ * alias) that can be used in usage events
185
+ */
186
+ external_id: string;
187
+
188
+ /**
189
+ * aliases for this customer that can be used instead of the Metronome customer ID
190
+ * in usage events
191
+ */
192
+ ingest_aliases: Array<string>;
193
+
194
+ name: string;
195
+ }
196
+
197
+ export namespace CustomerDetail {
198
+ export interface CurrentBillableStatus {
199
+ value: 'billable' | 'unbillable';
200
+
201
+ effective_at?: string | null;
202
+ }
203
+
204
+ export interface CustomerConfig {
205
+ /**
206
+ * The Salesforce account ID for the customer
207
+ */
208
+ salesforce_account_id: string | null;
209
+ }
210
+ }
211
+
212
+ export interface CustomerCreateResponse {
213
+ data: Customer;
214
+ }
215
+
216
+ export interface CustomerRetrieveResponse {
217
+ data: CustomerDetail;
218
+ }
219
+
220
+ export interface CustomerListResponse {
221
+ data: Array<CustomerDetail>;
222
+
223
+ next_page: string | null;
224
+ }
225
+
226
+ export interface CustomerArchiveResponse {
227
+ data: Shared.ID;
228
+ }
229
+
230
+ export interface CustomerListBillableMetricsResponse {
231
+ data: Array<CustomerListBillableMetricsResponse.Data>;
232
+
233
+ next_page: string | null;
234
+ }
235
+
236
+ export namespace CustomerListBillableMetricsResponse {
237
+ export interface Data {
238
+ id: string;
239
+
240
+ name: string;
241
+
242
+ group_by?: Array<string>;
243
+ }
244
+ }
245
+
246
+ export interface CustomerListCostsResponse {
247
+ data: Array<CustomerListCostsResponse.Data>;
248
+
249
+ next_page: string | null;
250
+ }
251
+
252
+ export namespace CustomerListCostsResponse {
253
+ export interface Data {
254
+ credit_types: Record<string, Data.CreditTypes>;
255
+
256
+ end_timestamp: string;
257
+
258
+ start_timestamp: string;
259
+ }
260
+
261
+ export namespace Data {
262
+ export interface CreditTypes {
263
+ cost?: number;
264
+
265
+ line_item_breakdown?: Array<CreditTypes.LineItemBreakdown>;
266
+
267
+ name?: string;
268
+ }
269
+
270
+ export namespace CreditTypes {
271
+ export interface LineItemBreakdown {
272
+ cost: number;
273
+
274
+ name: string;
275
+
276
+ group_key?: string;
277
+
278
+ group_value?: string | null;
279
+ }
280
+ }
281
+ }
282
+ }
283
+
284
+ export interface CustomerSetNameResponse {
285
+ data: Customer;
286
+ }
287
+
288
+ export interface CustomerCreateParams {
289
+ name: string;
290
+
291
+ billing_config?: CustomerCreateParams.BillingConfig;
292
+
293
+ custom_fields?: Record<string, string>;
294
+
295
+ /**
296
+ * (deprecated, use ingest_aliases instead) the first ID (Metronome ID or ingest
297
+ * alias) that can be used in usage events
298
+ */
299
+ external_id?: string;
300
+
301
+ /**
302
+ * Aliases that can be used to refer to this customer in usage events
303
+ */
304
+ ingest_aliases?: Array<string>;
305
+ }
306
+
307
+ export namespace CustomerCreateParams {
308
+ export interface BillingConfig {
309
+ billing_provider_customer_id: string;
310
+
311
+ billing_provider_type:
312
+ | 'aws_marketplace'
313
+ | 'stripe'
314
+ | 'netsuite'
315
+ | 'custom'
316
+ | 'azure_marketplace'
317
+ | 'quickbooks_online'
318
+ | 'workday'
319
+ | 'gcp_marketplace';
320
+
321
+ aws_product_code?: string;
322
+
323
+ aws_region?:
324
+ | 'af-south-1'
325
+ | 'ap-east-1'
326
+ | 'ap-northeast-1'
327
+ | 'ap-northeast-2'
328
+ | 'ap-northeast-3'
329
+ | 'ap-south-1'
330
+ | 'ap-southeast-1'
331
+ | 'ap-southeast-2'
332
+ | 'ca-central-1'
333
+ | 'cn-north-1'
334
+ | 'cn-northwest-1'
335
+ | 'eu-central-1'
336
+ | 'eu-north-1'
337
+ | 'eu-south-1'
338
+ | 'eu-west-1'
339
+ | 'eu-west-2'
340
+ | 'eu-west-3'
341
+ | 'me-south-1'
342
+ | 'sa-east-1'
343
+ | 'us-east-1'
344
+ | 'us-east-2'
345
+ | 'us-gov-east-1'
346
+ | 'us-gov-west-1'
347
+ | 'us-west-1'
348
+ | 'us-west-2';
349
+
350
+ stripe_collection_method?: 'charge_automatically' | 'send_invoice';
351
+ }
352
+ }
353
+
354
+ export interface CustomerListParams {
355
+ /**
356
+ * Filter the customer list by customer_id. Up to 100 ids can be provided.
357
+ */
358
+ customer_ids?: Array<string>;
359
+
360
+ /**
361
+ * Filter the customer list by ingest_alias
362
+ */
363
+ ingest_alias?: string;
364
+
365
+ /**
366
+ * Max number of results that should be returned
367
+ */
368
+ limit?: number;
369
+
370
+ /**
371
+ * Cursor that indicates where the next page of results should start.
372
+ */
373
+ next_page?: string;
374
+
375
+ /**
376
+ * Filter the customer list by only archived customers.
377
+ */
378
+ only_archived?: boolean;
379
+
380
+ /**
381
+ * Filter the customer list by salesforce_account_id. Up to 100 ids can be
382
+ * provided.
383
+ */
384
+ salesforce_account_ids?: Array<string>;
385
+ }
386
+
387
+ export interface CustomerArchiveParams {
388
+ id: string;
389
+ }
390
+
391
+ export interface CustomerListBillableMetricsParams {
392
+ /**
393
+ * Max number of results that should be returned
394
+ */
395
+ limit?: number;
396
+
397
+ /**
398
+ * Cursor that indicates where the next page of results should start.
399
+ */
400
+ next_page?: string;
401
+
402
+ /**
403
+ * If true, the list of metrics will be filtered to just ones that are on the
404
+ * customer's current plan
405
+ */
406
+ on_current_plan?: boolean;
407
+ }
408
+
409
+ export interface CustomerListCostsParams {
410
+ /**
411
+ * RFC 3339 timestamp (exclusive)
412
+ */
413
+ ending_before: string;
414
+
415
+ /**
416
+ * RFC 3339 timestamp (inclusive)
417
+ */
418
+ starting_on: string;
419
+
420
+ /**
421
+ * Max number of results that should be returned
422
+ */
423
+ limit?: number;
424
+
425
+ /**
426
+ * Cursor that indicates where the next page of results should start.
427
+ */
428
+ next_page?: string;
429
+ }
430
+
431
+ export interface CustomerSetIngestAliasesParams {
432
+ ingest_aliases: Array<string>;
433
+ }
434
+
435
+ export interface CustomerSetNameParams {
436
+ /**
437
+ * The new name for the customer
438
+ */
439
+ name: string;
440
+ }
441
+
442
+ export interface CustomerUpdateConfigParams {
443
+ /**
444
+ * Leave in draft or set to auto-advance on invoices sent to Stripe. Falls back to
445
+ * the client-level config if unset, which defaults to true if unset.
446
+ */
447
+ leave_stripe_invoices_in_draft?: boolean | null;
448
+
449
+ /**
450
+ * The Salesforce account ID for the customer
451
+ */
452
+ salesforce_account_id?: string | null;
453
+ }
454
+
455
+ export namespace Customers {
456
+ export import Customer = CustomersAPI.Customer;
457
+ export import CustomerDetail = CustomersAPI.CustomerDetail;
458
+ export import CustomerCreateResponse = CustomersAPI.CustomerCreateResponse;
459
+ export import CustomerRetrieveResponse = CustomersAPI.CustomerRetrieveResponse;
460
+ export import CustomerListResponse = CustomersAPI.CustomerListResponse;
461
+ export import CustomerArchiveResponse = CustomersAPI.CustomerArchiveResponse;
462
+ export import CustomerListBillableMetricsResponse = CustomersAPI.CustomerListBillableMetricsResponse;
463
+ export import CustomerListCostsResponse = CustomersAPI.CustomerListCostsResponse;
464
+ export import CustomerSetNameResponse = CustomersAPI.CustomerSetNameResponse;
465
+ export import CustomerCreateParams = CustomersAPI.CustomerCreateParams;
466
+ export import CustomerListParams = CustomersAPI.CustomerListParams;
467
+ export import CustomerArchiveParams = CustomersAPI.CustomerArchiveParams;
468
+ export import CustomerListBillableMetricsParams = CustomersAPI.CustomerListBillableMetricsParams;
469
+ export import CustomerListCostsParams = CustomersAPI.CustomerListCostsParams;
470
+ export import CustomerSetIngestAliasesParams = CustomersAPI.CustomerSetIngestAliasesParams;
471
+ export import CustomerSetNameParams = CustomersAPI.CustomerSetNameParams;
472
+ export import CustomerUpdateConfigParams = CustomersAPI.CustomerUpdateConfigParams;
473
+ export import Alerts = AlertsAPI.Alerts;
474
+ export import CustomerAlert = AlertsAPI.CustomerAlert;
475
+ export import AlertRetrieveResponse = AlertsAPI.AlertRetrieveResponse;
476
+ export import AlertListResponse = AlertsAPI.AlertListResponse;
477
+ export import AlertRetrieveParams = AlertsAPI.AlertRetrieveParams;
478
+ export import AlertListParams = AlertsAPI.AlertListParams;
479
+ export import AlertResetParams = AlertsAPI.AlertResetParams;
480
+ export import Plans = PlansAPI.Plans;
481
+ export import PlanListResponse = PlansAPI.PlanListResponse;
482
+ export import PlanAddResponse = PlansAPI.PlanAddResponse;
483
+ export import PlanEndResponse = PlansAPI.PlanEndResponse;
484
+ export import PlanListPriceAdjustmentsResponse = PlansAPI.PlanListPriceAdjustmentsResponse;
485
+ export import PlanListParams = PlansAPI.PlanListParams;
486
+ export import PlanAddParams = PlansAPI.PlanAddParams;
487
+ export import PlanEndParams = PlansAPI.PlanEndParams;
488
+ export import PlanListPriceAdjustmentsParams = PlansAPI.PlanListPriceAdjustmentsParams;
489
+ export import Invoices = InvoicesAPI.Invoices;
490
+ export import Invoice = InvoicesAPI.Invoice;
491
+ export import InvoiceRetrieveResponse = InvoicesAPI.InvoiceRetrieveResponse;
492
+ export import InvoiceListResponse = InvoicesAPI.InvoiceListResponse;
493
+ export import InvoiceAddChargeResponse = InvoicesAPI.InvoiceAddChargeResponse;
494
+ export import InvoiceRetrieveParams = InvoicesAPI.InvoiceRetrieveParams;
495
+ export import InvoiceListParams = InvoicesAPI.InvoiceListParams;
496
+ export import InvoiceAddChargeParams = InvoicesAPI.InvoiceAddChargeParams;
497
+ export import BillingConfig = BillingConfigAPI.BillingConfig;
498
+ export import BillingConfigRetrieveResponse = BillingConfigAPI.BillingConfigRetrieveResponse;
499
+ export import BillingConfigCreateParams = BillingConfigAPI.BillingConfigCreateParams;
500
+ }
@@ -0,0 +1,53 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { BillingConfigRetrieveResponse, BillingConfigCreateParams, BillingConfig } from './billing-config';
4
+ export {
5
+ Customer,
6
+ CustomerDetail,
7
+ CustomerCreateResponse,
8
+ CustomerRetrieveResponse,
9
+ CustomerListResponse,
10
+ CustomerArchiveResponse,
11
+ CustomerListBillableMetricsResponse,
12
+ CustomerListCostsResponse,
13
+ CustomerSetNameResponse,
14
+ CustomerCreateParams,
15
+ CustomerListParams,
16
+ CustomerArchiveParams,
17
+ CustomerListBillableMetricsParams,
18
+ CustomerListCostsParams,
19
+ CustomerSetIngestAliasesParams,
20
+ CustomerSetNameParams,
21
+ CustomerUpdateConfigParams,
22
+ Customers,
23
+ } from './customers';
24
+ export {
25
+ CustomerAlert,
26
+ AlertRetrieveResponse,
27
+ AlertListResponse,
28
+ AlertRetrieveParams,
29
+ AlertListParams,
30
+ AlertResetParams,
31
+ Alerts,
32
+ } from './alerts';
33
+ export {
34
+ Invoice,
35
+ InvoiceRetrieveResponse,
36
+ InvoiceListResponse,
37
+ InvoiceAddChargeResponse,
38
+ InvoiceRetrieveParams,
39
+ InvoiceListParams,
40
+ InvoiceAddChargeParams,
41
+ Invoices,
42
+ } from './invoices';
43
+ export {
44
+ PlanListResponse,
45
+ PlanAddResponse,
46
+ PlanEndResponse,
47
+ PlanListPriceAdjustmentsResponse,
48
+ PlanListParams,
49
+ PlanAddParams,
50
+ PlanEndParams,
51
+ PlanListPriceAdjustmentsParams,
52
+ Plans,
53
+ } from './plans';