orb-billing 4.33.0 → 4.47.2

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 (255) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/LICENSE +1 -1
  3. package/README.md +10 -1
  4. package/core.d.ts +4 -5
  5. package/core.d.ts.map +1 -1
  6. package/core.js +16 -11
  7. package/core.js.map +1 -1
  8. package/core.mjs +16 -11
  9. package/core.mjs.map +1 -1
  10. package/error.d.ts +30 -36
  11. package/error.d.ts.map +1 -1
  12. package/error.js +24 -43
  13. package/error.js.map +1 -1
  14. package/error.mjs +24 -43
  15. package/error.mjs.map +1 -1
  16. package/index.d.mts +43 -109
  17. package/index.d.ts +43 -109
  18. package/index.d.ts.map +1 -1
  19. package/index.js +71 -33
  20. package/index.js.map +1 -1
  21. package/index.mjs +43 -32
  22. package/index.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/resources/alerts.d.ts +58 -19
  25. package/resources/alerts.d.ts.map +1 -1
  26. package/resources/alerts.js +19 -37
  27. package/resources/alerts.js.map +1 -1
  28. package/resources/alerts.mjs +19 -14
  29. package/resources/alerts.mjs.map +1 -1
  30. package/resources/coupons/coupons.d.ts +3 -7
  31. package/resources/coupons/coupons.d.ts.map +1 -1
  32. package/resources/coupons/coupons.js +3 -5
  33. package/resources/coupons/coupons.js.map +1 -1
  34. package/resources/coupons/coupons.mjs +3 -5
  35. package/resources/coupons/coupons.mjs.map +1 -1
  36. package/resources/coupons/index.d.ts +2 -2
  37. package/resources/coupons/index.d.ts.map +1 -1
  38. package/resources/coupons/index.js.map +1 -1
  39. package/resources/coupons/index.mjs.map +1 -1
  40. package/resources/coupons/subscriptions.d.ts +1 -2
  41. package/resources/coupons/subscriptions.d.ts.map +1 -1
  42. package/resources/coupons/subscriptions.js +0 -2
  43. package/resources/coupons/subscriptions.js.map +1 -1
  44. package/resources/coupons/subscriptions.mjs +0 -2
  45. package/resources/coupons/subscriptions.mjs.map +1 -1
  46. package/resources/credit-notes.d.ts +29 -4
  47. package/resources/credit-notes.d.ts.map +1 -1
  48. package/resources/credit-notes.js +8 -27
  49. package/resources/credit-notes.js.map +1 -1
  50. package/resources/credit-notes.mjs +8 -4
  51. package/resources/credit-notes.mjs.map +1 -1
  52. package/resources/customers/balance-transactions.d.ts +1 -6
  53. package/resources/customers/balance-transactions.d.ts.map +1 -1
  54. package/resources/customers/balance-transactions.js +1 -27
  55. package/resources/customers/balance-transactions.js.map +1 -1
  56. package/resources/customers/balance-transactions.mjs +1 -4
  57. package/resources/customers/balance-transactions.mjs.map +1 -1
  58. package/resources/customers/costs.d.ts +1 -5
  59. package/resources/customers/costs.d.ts.map +1 -1
  60. package/resources/customers/costs.js +0 -2
  61. package/resources/customers/costs.js.map +1 -1
  62. package/resources/customers/costs.mjs +0 -2
  63. package/resources/customers/costs.mjs.map +1 -1
  64. package/resources/customers/credits/credits.d.ts +15 -31
  65. package/resources/customers/credits/credits.d.ts.map +1 -1
  66. package/resources/customers/credits/credits.js +10 -11
  67. package/resources/customers/credits/credits.js.map +1 -1
  68. package/resources/customers/credits/credits.mjs +10 -11
  69. package/resources/customers/credits/credits.mjs.map +1 -1
  70. package/resources/customers/credits/index.d.ts +3 -3
  71. package/resources/customers/credits/index.d.ts.map +1 -1
  72. package/resources/customers/credits/index.js.map +1 -1
  73. package/resources/customers/credits/index.mjs.map +1 -1
  74. package/resources/customers/credits/ledger.d.ts +15 -23
  75. package/resources/customers/credits/ledger.d.ts.map +1 -1
  76. package/resources/customers/credits/ledger.js +12 -36
  77. package/resources/customers/credits/ledger.js.map +1 -1
  78. package/resources/customers/credits/ledger.mjs +12 -13
  79. package/resources/customers/credits/ledger.mjs.map +1 -1
  80. package/resources/customers/credits/top-ups.d.ts +1 -11
  81. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  82. package/resources/customers/credits/top-ups.js +2 -28
  83. package/resources/customers/credits/top-ups.js.map +1 -1
  84. package/resources/customers/credits/top-ups.mjs +2 -5
  85. package/resources/customers/credits/top-ups.mjs.map +1 -1
  86. package/resources/customers/customers.d.ts +7 -25
  87. package/resources/customers/customers.d.ts.map +1 -1
  88. package/resources/customers/customers.js +10 -10
  89. package/resources/customers/customers.js.map +1 -1
  90. package/resources/customers/customers.mjs +10 -10
  91. package/resources/customers/customers.mjs.map +1 -1
  92. package/resources/customers/index.d.ts +4 -4
  93. package/resources/customers/index.d.ts.map +1 -1
  94. package/resources/customers/index.js.map +1 -1
  95. package/resources/customers/index.mjs.map +1 -1
  96. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +90 -0
  97. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -0
  98. package/resources/dimensional-price-groups/dimensional-price-groups.js +73 -0
  99. package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -0
  100. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +45 -0
  101. package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -0
  102. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +10 -0
  103. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -0
  104. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +15 -0
  105. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -0
  106. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +11 -0
  107. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -0
  108. package/resources/dimensional-price-groups/index.d.ts +3 -0
  109. package/resources/dimensional-price-groups/index.d.ts.map +1 -0
  110. package/resources/dimensional-price-groups/index.js +9 -0
  111. package/resources/dimensional-price-groups/index.js.map +1 -0
  112. package/resources/dimensional-price-groups/index.mjs +4 -0
  113. package/resources/dimensional-price-groups/index.mjs.map +1 -0
  114. package/resources/events/backfills.d.ts +5 -11
  115. package/resources/events/backfills.d.ts.map +1 -1
  116. package/resources/events/backfills.js +5 -29
  117. package/resources/events/backfills.js.map +1 -1
  118. package/resources/events/backfills.mjs +5 -6
  119. package/resources/events/backfills.mjs.map +1 -1
  120. package/resources/events/events.d.ts +7 -22
  121. package/resources/events/events.d.ts.map +1 -1
  122. package/resources/events/events.js +7 -7
  123. package/resources/events/events.js.map +1 -1
  124. package/resources/events/events.mjs +7 -7
  125. package/resources/events/events.mjs.map +1 -1
  126. package/resources/events/index.d.ts +3 -3
  127. package/resources/events/index.d.ts.map +1 -1
  128. package/resources/events/index.js.map +1 -1
  129. package/resources/events/index.mjs.map +1 -1
  130. package/resources/events/volume.d.ts +1 -3
  131. package/resources/events/volume.d.ts.map +1 -1
  132. package/resources/events/volume.js +0 -2
  133. package/resources/events/volume.js.map +1 -1
  134. package/resources/events/volume.mjs +0 -2
  135. package/resources/events/volume.mjs.map +1 -1
  136. package/resources/index.d.ts +14 -13
  137. package/resources/index.d.ts.map +1 -1
  138. package/resources/index.js +10 -7
  139. package/resources/index.js.map +1 -1
  140. package/resources/index.mjs +8 -7
  141. package/resources/index.mjs.map +1 -1
  142. package/resources/invoice-line-items.d.ts +1 -3
  143. package/resources/invoice-line-items.d.ts.map +1 -1
  144. package/resources/invoice-line-items.js +0 -2
  145. package/resources/invoice-line-items.js.map +1 -1
  146. package/resources/invoice-line-items.mjs +0 -2
  147. package/resources/invoice-line-items.mjs.map +1 -1
  148. package/resources/invoices.d.ts +78 -13
  149. package/resources/invoices.d.ts.map +1 -1
  150. package/resources/invoices.js +8 -27
  151. package/resources/invoices.js.map +1 -1
  152. package/resources/invoices.mjs +8 -4
  153. package/resources/invoices.mjs.map +1 -1
  154. package/resources/items.d.ts +1 -6
  155. package/resources/items.d.ts.map +1 -1
  156. package/resources/items.js +1 -27
  157. package/resources/items.js.map +1 -1
  158. package/resources/items.mjs +1 -4
  159. package/resources/items.mjs.map +1 -1
  160. package/resources/metrics.d.ts +1 -6
  161. package/resources/metrics.d.ts.map +1 -1
  162. package/resources/metrics.js +1 -27
  163. package/resources/metrics.js.map +1 -1
  164. package/resources/metrics.mjs +1 -4
  165. package/resources/metrics.mjs.map +1 -1
  166. package/resources/plans/external-plan-id.d.ts +1 -2
  167. package/resources/plans/external-plan-id.d.ts.map +1 -1
  168. package/resources/plans/external-plan-id.js +0 -2
  169. package/resources/plans/external-plan-id.js.map +1 -1
  170. package/resources/plans/external-plan-id.mjs +0 -2
  171. package/resources/plans/external-plan-id.mjs.map +1 -1
  172. package/resources/plans/index.d.ts +2 -2
  173. package/resources/plans/index.d.ts.map +1 -1
  174. package/resources/plans/index.js.map +1 -1
  175. package/resources/plans/index.mjs +1 -1
  176. package/resources/plans/index.mjs.map +1 -1
  177. package/resources/plans/plans.d.ts +331 -9
  178. package/resources/plans/plans.d.ts.map +1 -1
  179. package/resources/plans/plans.js +3 -5
  180. package/resources/plans/plans.js.map +1 -1
  181. package/resources/plans/plans.mjs +3 -5
  182. package/resources/plans/plans.mjs.map +1 -1
  183. package/resources/prices/external-price-id.d.ts +1 -2
  184. package/resources/prices/external-price-id.d.ts.map +1 -1
  185. package/resources/prices/external-price-id.js +0 -2
  186. package/resources/prices/external-price-id.js.map +1 -1
  187. package/resources/prices/external-price-id.mjs +0 -2
  188. package/resources/prices/external-price-id.mjs.map +1 -1
  189. package/resources/prices/index.d.ts +2 -2
  190. package/resources/prices/index.d.ts.map +1 -1
  191. package/resources/prices/index.js +3 -3
  192. package/resources/prices/index.js.map +1 -1
  193. package/resources/prices/index.mjs +1 -1
  194. package/resources/prices/index.mjs.map +1 -1
  195. package/resources/prices/prices.d.ts +339 -13
  196. package/resources/prices/prices.d.ts.map +1 -1
  197. package/resources/prices/prices.js +3 -5
  198. package/resources/prices/prices.js.map +1 -1
  199. package/resources/prices/prices.mjs +3 -5
  200. package/resources/prices/prices.mjs.map +1 -1
  201. package/resources/shared.d.ts +14 -16
  202. package/resources/shared.d.ts.map +1 -1
  203. package/resources/subscriptions.d.ts +7629 -191
  204. package/resources/subscriptions.d.ts.map +1 -1
  205. package/resources/subscriptions.js +2 -29
  206. package/resources/subscriptions.js.map +1 -1
  207. package/resources/subscriptions.mjs +2 -6
  208. package/resources/subscriptions.mjs.map +1 -1
  209. package/resources/top-level.d.ts +1 -2
  210. package/resources/top-level.d.ts.map +1 -1
  211. package/resources/top-level.js +0 -2
  212. package/resources/top-level.js.map +1 -1
  213. package/resources/top-level.mjs +0 -2
  214. package/resources/top-level.mjs.map +1 -1
  215. package/src/core.ts +23 -19
  216. package/src/error.ts +82 -125
  217. package/src/index.ts +334 -130
  218. package/src/resources/alerts.ts +117 -24
  219. package/src/resources/coupons/coupons.ts +13 -8
  220. package/src/resources/coupons/index.ts +2 -2
  221. package/src/resources/coupons/subscriptions.ts +2 -3
  222. package/src/resources/credit-notes.ts +45 -5
  223. package/src/resources/customers/balance-transactions.ts +10 -7
  224. package/src/resources/customers/costs.ts +7 -6
  225. package/src/resources/customers/credits/credits.ts +82 -32
  226. package/src/resources/customers/credits/index.ts +20 -20
  227. package/src/resources/customers/credits/ledger.ts +32 -26
  228. package/src/resources/customers/credits/top-ups.ts +16 -12
  229. package/src/resources/customers/customers.ts +68 -26
  230. package/src/resources/customers/index.ts +17 -17
  231. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +146 -0
  232. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +20 -0
  233. package/src/resources/dimensional-price-groups/index.ts +10 -0
  234. package/src/resources/events/backfills.ts +17 -12
  235. package/src/resources/events/events.ts +42 -23
  236. package/src/resources/events/index.ts +15 -15
  237. package/src/resources/events/volume.ts +2 -4
  238. package/src/resources/index.ts +113 -67
  239. package/src/resources/invoice-line-items.ts +5 -4
  240. package/src/resources/invoices.ts +108 -14
  241. package/src/resources/items.ts +10 -7
  242. package/src/resources/metrics.ts +10 -7
  243. package/src/resources/plans/external-plan-id.ts +2 -3
  244. package/src/resources/plans/index.ts +9 -2
  245. package/src/resources/plans/plans.ts +424 -9
  246. package/src/resources/prices/external-price-id.ts +2 -3
  247. package/src/resources/prices/index.ts +8 -8
  248. package/src/resources/prices/prices.ts +471 -15
  249. package/src/resources/shared.ts +18 -20
  250. package/src/resources/subscriptions.ts +9231 -400
  251. package/src/resources/top-level.ts +2 -3
  252. package/src/version.ts +1 -1
  253. package/version.d.ts +1 -1
  254. package/version.js +1 -1
  255. package/version.mjs +1 -1
@@ -3,10 +3,33 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
- import * as CustomersAPI from './customers';
7
6
  import * as BalanceTransactionsAPI from './balance-transactions';
7
+ import {
8
+ BalanceTransactionCreateParams,
9
+ BalanceTransactionCreateResponse,
10
+ BalanceTransactionListParams,
11
+ BalanceTransactionListResponse,
12
+ BalanceTransactionListResponsesPage,
13
+ BalanceTransactions,
14
+ } from './balance-transactions';
8
15
  import * as CostsAPI from './costs';
16
+ import {
17
+ CostListByExternalIDParams,
18
+ CostListByExternalIDResponse,
19
+ CostListParams,
20
+ CostListResponse,
21
+ Costs,
22
+ } from './costs';
9
23
  import * as CreditsAPI from './credits/credits';
24
+ import {
25
+ CreditListByExternalIDParams,
26
+ CreditListByExternalIDResponse,
27
+ CreditListByExternalIDResponsesPage,
28
+ CreditListParams,
29
+ CreditListResponse,
30
+ CreditListResponsesPage,
31
+ Credits,
32
+ } from './credits/credits';
10
33
  import { Page, type PageParams } from '../../pagination';
11
34
 
12
35
  export class Customers extends APIResource {
@@ -2200,29 +2223,48 @@ export namespace CustomerUpdateByExternalIDParams {
2200
2223
  }
2201
2224
  }
2202
2225
 
2203
- export namespace Customers {
2204
- export import Customer = CustomersAPI.Customer;
2205
- export import CustomersPage = CustomersAPI.CustomersPage;
2206
- export import CustomerCreateParams = CustomersAPI.CustomerCreateParams;
2207
- export import CustomerUpdateParams = CustomersAPI.CustomerUpdateParams;
2208
- export import CustomerListParams = CustomersAPI.CustomerListParams;
2209
- export import CustomerUpdateByExternalIDParams = CustomersAPI.CustomerUpdateByExternalIDParams;
2210
- export import Costs = CostsAPI.Costs;
2211
- export import CostListResponse = CostsAPI.CostListResponse;
2212
- export import CostListByExternalIDResponse = CostsAPI.CostListByExternalIDResponse;
2213
- export import CostListParams = CostsAPI.CostListParams;
2214
- export import CostListByExternalIDParams = CostsAPI.CostListByExternalIDParams;
2215
- export import Credits = CreditsAPI.Credits;
2216
- export import CreditListResponse = CreditsAPI.CreditListResponse;
2217
- export import CreditListByExternalIDResponse = CreditsAPI.CreditListByExternalIDResponse;
2218
- export import CreditListResponsesPage = CreditsAPI.CreditListResponsesPage;
2219
- export import CreditListByExternalIDResponsesPage = CreditsAPI.CreditListByExternalIDResponsesPage;
2220
- export import CreditListParams = CreditsAPI.CreditListParams;
2221
- export import CreditListByExternalIDParams = CreditsAPI.CreditListByExternalIDParams;
2222
- export import BalanceTransactions = BalanceTransactionsAPI.BalanceTransactions;
2223
- export import BalanceTransactionCreateResponse = BalanceTransactionsAPI.BalanceTransactionCreateResponse;
2224
- export import BalanceTransactionListResponse = BalanceTransactionsAPI.BalanceTransactionListResponse;
2225
- export import BalanceTransactionListResponsesPage = BalanceTransactionsAPI.BalanceTransactionListResponsesPage;
2226
- export import BalanceTransactionCreateParams = BalanceTransactionsAPI.BalanceTransactionCreateParams;
2227
- export import BalanceTransactionListParams = BalanceTransactionsAPI.BalanceTransactionListParams;
2226
+ Customers.CustomersPage = CustomersPage;
2227
+ Customers.Costs = Costs;
2228
+ Customers.Credits = Credits;
2229
+ Customers.CreditListResponsesPage = CreditListResponsesPage;
2230
+ Customers.CreditListByExternalIDResponsesPage = CreditListByExternalIDResponsesPage;
2231
+ Customers.BalanceTransactions = BalanceTransactions;
2232
+ Customers.BalanceTransactionListResponsesPage = BalanceTransactionListResponsesPage;
2233
+
2234
+ export declare namespace Customers {
2235
+ export {
2236
+ type Customer as Customer,
2237
+ CustomersPage as CustomersPage,
2238
+ type CustomerCreateParams as CustomerCreateParams,
2239
+ type CustomerUpdateParams as CustomerUpdateParams,
2240
+ type CustomerListParams as CustomerListParams,
2241
+ type CustomerUpdateByExternalIDParams as CustomerUpdateByExternalIDParams,
2242
+ };
2243
+
2244
+ export {
2245
+ Costs as Costs,
2246
+ type CostListResponse as CostListResponse,
2247
+ type CostListByExternalIDResponse as CostListByExternalIDResponse,
2248
+ type CostListParams as CostListParams,
2249
+ type CostListByExternalIDParams as CostListByExternalIDParams,
2250
+ };
2251
+
2252
+ export {
2253
+ Credits as Credits,
2254
+ type CreditListResponse as CreditListResponse,
2255
+ type CreditListByExternalIDResponse as CreditListByExternalIDResponse,
2256
+ CreditListResponsesPage as CreditListResponsesPage,
2257
+ CreditListByExternalIDResponsesPage as CreditListByExternalIDResponsesPage,
2258
+ type CreditListParams as CreditListParams,
2259
+ type CreditListByExternalIDParams as CreditListByExternalIDParams,
2260
+ };
2261
+
2262
+ export {
2263
+ BalanceTransactions as BalanceTransactions,
2264
+ type BalanceTransactionCreateResponse as BalanceTransactionCreateResponse,
2265
+ type BalanceTransactionListResponse as BalanceTransactionListResponse,
2266
+ BalanceTransactionListResponsesPage as BalanceTransactionListResponsesPage,
2267
+ type BalanceTransactionCreateParams as BalanceTransactionCreateParams,
2268
+ type BalanceTransactionListParams as BalanceTransactionListParams,
2269
+ };
2228
2270
  }
@@ -1,35 +1,35 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export {
4
- BalanceTransactionCreateResponse,
5
- BalanceTransactionListResponse,
6
- BalanceTransactionCreateParams,
7
- BalanceTransactionListParams,
8
4
  BalanceTransactionListResponsesPage,
9
5
  BalanceTransactions,
6
+ type BalanceTransactionCreateResponse,
7
+ type BalanceTransactionListResponse,
8
+ type BalanceTransactionCreateParams,
9
+ type BalanceTransactionListParams,
10
10
  } from './balance-transactions';
11
11
  export {
12
- CostListResponse,
13
- CostListByExternalIDResponse,
14
- CostListParams,
15
- CostListByExternalIDParams,
16
12
  Costs,
13
+ type CostListResponse,
14
+ type CostListByExternalIDResponse,
15
+ type CostListParams,
16
+ type CostListByExternalIDParams,
17
17
  } from './costs';
18
18
  export {
19
- CreditListResponse,
20
- CreditListByExternalIDResponse,
21
- CreditListParams,
22
- CreditListByExternalIDParams,
23
19
  CreditListResponsesPage,
24
20
  CreditListByExternalIDResponsesPage,
25
21
  Credits,
22
+ type CreditListResponse,
23
+ type CreditListByExternalIDResponse,
24
+ type CreditListParams,
25
+ type CreditListByExternalIDParams,
26
26
  } from './credits/index';
27
27
  export {
28
- Customer,
29
- CustomerCreateParams,
30
- CustomerUpdateParams,
31
- CustomerListParams,
32
- CustomerUpdateByExternalIDParams,
33
28
  CustomersPage,
34
29
  Customers,
30
+ type Customer,
31
+ type CustomerCreateParams,
32
+ type CustomerUpdateParams,
33
+ type CustomerListParams,
34
+ type CustomerUpdateByExternalIDParams,
35
35
  } from './customers';
@@ -0,0 +1,146 @@
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
+ import * as ExternalDimensionalPriceGroupIDAPI from './external-dimensional-price-group-id';
8
+ import { ExternalDimensionalPriceGroupID } from './external-dimensional-price-group-id';
9
+ import { Page, type PageParams } from '../../pagination';
10
+
11
+ export class DimensionalPriceGroups extends APIResource {
12
+ externalDimensionalPriceGroupId: ExternalDimensionalPriceGroupIDAPI.ExternalDimensionalPriceGroupID =
13
+ new ExternalDimensionalPriceGroupIDAPI.ExternalDimensionalPriceGroupID(this._client);
14
+
15
+ /**
16
+ * A dimensional price group is used to partition the result of a billable metric
17
+ * by a set of dimensions. Prices in a price group must specify the parition used
18
+ * to derive their usage.
19
+ *
20
+ * For example, suppose we have a billable metric that measures the number of
21
+ * widgets used and we want to charge differently depending on the color of the
22
+ * widget. We can create a price group with a dimension "color" and two prices: one
23
+ * that charges $10 per red widget and one that charges $20 per blue widget.
24
+ */
25
+ create(
26
+ body: DimensionalPriceGroupCreateParams,
27
+ options?: Core.RequestOptions,
28
+ ): Core.APIPromise<DimensionalPriceGroup> {
29
+ return this._client.post('/dimensional_price_groups', { body, ...options });
30
+ }
31
+
32
+ /**
33
+ * Fetch dimensional price group
34
+ */
35
+ retrieve(
36
+ dimensionalPriceGroupId: string,
37
+ options?: Core.RequestOptions,
38
+ ): Core.APIPromise<DimensionalPriceGroup> {
39
+ return this._client.get(`/dimensional_price_groups/${dimensionalPriceGroupId}`, options);
40
+ }
41
+
42
+ /**
43
+ * List dimensional price groups
44
+ */
45
+ list(
46
+ query?: DimensionalPriceGroupListParams,
47
+ options?: Core.RequestOptions,
48
+ ): Core.PagePromise<DimensionalPriceGroupsPage, DimensionalPriceGroup>;
49
+ list(options?: Core.RequestOptions): Core.PagePromise<DimensionalPriceGroupsPage, DimensionalPriceGroup>;
50
+ list(
51
+ query: DimensionalPriceGroupListParams | Core.RequestOptions = {},
52
+ options?: Core.RequestOptions,
53
+ ): Core.PagePromise<DimensionalPriceGroupsPage, DimensionalPriceGroup> {
54
+ if (isRequestOptions(query)) {
55
+ return this.list({}, query);
56
+ }
57
+ return this._client.getAPIList('/dimensional_price_groups', DimensionalPriceGroupsPage, {
58
+ query,
59
+ ...options,
60
+ });
61
+ }
62
+ }
63
+
64
+ export class DimensionalPriceGroupsPage extends Page<DimensionalPriceGroup> {}
65
+
66
+ /**
67
+ * A dimensional price group is used to partition the result of a billable metric
68
+ * by a set of dimensions. Prices in a price group must specify the parition used
69
+ * to derive their usage.
70
+ */
71
+ export interface DimensionalPriceGroup {
72
+ id: string;
73
+
74
+ /**
75
+ * The billable metric associated with this dimensional price group. All prices
76
+ * associated with this dimensional price group will be computed using this
77
+ * billable metric.
78
+ */
79
+ billable_metric_id: string;
80
+
81
+ /**
82
+ * The dimensions that this dimensional price group is defined over
83
+ */
84
+ dimensions: Array<string>;
85
+
86
+ /**
87
+ * An alias for the dimensional price group
88
+ */
89
+ external_dimensional_price_group_id: string | null;
90
+
91
+ /**
92
+ * User specified key-value pairs for the resource. If not present, this defaults
93
+ * to an empty dictionary. Individual keys can be removed by setting the value to
94
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
95
+ * `null`.
96
+ */
97
+ metadata: Record<string, string>;
98
+
99
+ /**
100
+ * The name of the dimensional price group
101
+ */
102
+ name: string;
103
+ }
104
+
105
+ export interface DimensionalPriceGroups {
106
+ data: Array<DimensionalPriceGroup>;
107
+
108
+ pagination_metadata: Shared.PaginationMetadata;
109
+ }
110
+
111
+ export interface DimensionalPriceGroupCreateParams {
112
+ billable_metric_id: string;
113
+
114
+ /**
115
+ * The set of keys (in order) used to disambiguate prices in the group.
116
+ */
117
+ dimensions: Array<string>;
118
+
119
+ name: string;
120
+
121
+ external_dimensional_price_group_id?: string | null;
122
+
123
+ /**
124
+ * User-specified key/value pairs for the resource. Individual keys can be removed
125
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
126
+ * by setting `metadata` to `null`.
127
+ */
128
+ metadata?: Record<string, string | null> | null;
129
+ }
130
+
131
+ export interface DimensionalPriceGroupListParams extends PageParams {}
132
+
133
+ DimensionalPriceGroups.DimensionalPriceGroupsPage = DimensionalPriceGroupsPage;
134
+ DimensionalPriceGroups.ExternalDimensionalPriceGroupID = ExternalDimensionalPriceGroupID;
135
+
136
+ export declare namespace DimensionalPriceGroups {
137
+ export {
138
+ type DimensionalPriceGroup as DimensionalPriceGroup,
139
+ type DimensionalPriceGroups as DimensionalPriceGroups,
140
+ DimensionalPriceGroupsPage as DimensionalPriceGroupsPage,
141
+ type DimensionalPriceGroupCreateParams as DimensionalPriceGroupCreateParams,
142
+ type DimensionalPriceGroupListParams as DimensionalPriceGroupListParams,
143
+ };
144
+
145
+ export { ExternalDimensionalPriceGroupID as ExternalDimensionalPriceGroupID };
146
+ }
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as DimensionalPriceGroupsAPI from './dimensional-price-groups';
6
+
7
+ export class ExternalDimensionalPriceGroupID extends APIResource {
8
+ /**
9
+ * Fetch dimensional price group by external ID
10
+ */
11
+ retrieve(
12
+ externalDimensionalPriceGroupId: string,
13
+ options?: Core.RequestOptions,
14
+ ): Core.APIPromise<DimensionalPriceGroupsAPI.DimensionalPriceGroup> {
15
+ return this._client.get(
16
+ `/dimensional_price_groups/external_dimensional_price_group_id/${externalDimensionalPriceGroupId}`,
17
+ options,
18
+ );
19
+ }
20
+ }
@@ -0,0 +1,10 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ DimensionalPriceGroupsPage,
5
+ type DimensionalPriceGroups,
6
+ type DimensionalPriceGroup,
7
+ type DimensionalPriceGroupCreateParams,
8
+ type DimensionalPriceGroupListParams,
9
+ } from './dimensional-price-groups';
10
+ export { ExternalDimensionalPriceGroupID } from './external-dimensional-price-group-id';
@@ -3,7 +3,6 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
- import * as BackfillsAPI from './backfills';
7
6
  import { Page, type PageParams } from '../../pagination';
8
7
 
9
8
  export class Backfills extends APIResource {
@@ -38,8 +37,10 @@ export class Backfills extends APIResource {
38
37
  * only affect events for that customer. If neither is specified, the backfill will
39
38
  * affect all customers.
40
39
  *
41
- * When `replace_existing_events` is `true`, the field `filter` can be optionally
42
- * added which enables filtering using
40
+ * When `replace_existing_events` is `true`, this indicates that existing events in
41
+ * the timeframe should no longer be counted towards invoiced usage. In this
42
+ * scenario, the parameter `filter` can be optionally added which enables filtering
43
+ * using
43
44
  * [computed properties](../guides/extensibility/advanced-metrics#computed-properties).
44
45
  * The expressiveness of computed properties allows you to deprecate existing
45
46
  * events based on both a period of time and specific property values.
@@ -391,13 +392,17 @@ export interface BackfillCreateParams {
391
392
 
392
393
  export interface BackfillListParams extends PageParams {}
393
394
 
394
- export namespace Backfills {
395
- export import BackfillCreateResponse = BackfillsAPI.BackfillCreateResponse;
396
- export import BackfillListResponse = BackfillsAPI.BackfillListResponse;
397
- export import BackfillCloseResponse = BackfillsAPI.BackfillCloseResponse;
398
- export import BackfillFetchResponse = BackfillsAPI.BackfillFetchResponse;
399
- export import BackfillRevertResponse = BackfillsAPI.BackfillRevertResponse;
400
- export import BackfillListResponsesPage = BackfillsAPI.BackfillListResponsesPage;
401
- export import BackfillCreateParams = BackfillsAPI.BackfillCreateParams;
402
- export import BackfillListParams = BackfillsAPI.BackfillListParams;
395
+ Backfills.BackfillListResponsesPage = BackfillListResponsesPage;
396
+
397
+ export declare namespace Backfills {
398
+ export {
399
+ type BackfillCreateResponse as BackfillCreateResponse,
400
+ type BackfillListResponse as BackfillListResponse,
401
+ type BackfillCloseResponse as BackfillCloseResponse,
402
+ type BackfillFetchResponse as BackfillFetchResponse,
403
+ type BackfillRevertResponse as BackfillRevertResponse,
404
+ BackfillListResponsesPage as BackfillListResponsesPage,
405
+ type BackfillCreateParams as BackfillCreateParams,
406
+ type BackfillListParams as BackfillListParams,
407
+ };
403
408
  }
@@ -2,9 +2,20 @@
2
2
 
3
3
  import { APIResource } from '../../resource';
4
4
  import * as Core from '../../core';
5
- import * as EventsAPI from './events';
6
5
  import * as BackfillsAPI from './backfills';
6
+ import {
7
+ BackfillCloseResponse,
8
+ BackfillCreateParams,
9
+ BackfillCreateResponse,
10
+ BackfillFetchResponse,
11
+ BackfillListParams,
12
+ BackfillListResponse,
13
+ BackfillListResponsesPage,
14
+ BackfillRevertResponse,
15
+ Backfills,
16
+ } from './backfills';
7
17
  import * as VolumeAPI from './volume';
18
+ import { EventVolumes, Volume, VolumeListParams } from './volume';
8
19
 
9
20
  export class Events extends APIResource {
10
21
  backfills: BackfillsAPI.Backfills = new BackfillsAPI.Backfills(this._client);
@@ -81,8 +92,8 @@ export class Events extends APIResource {
81
92
  * call to a payment gateway failed and the user should not be billed)
82
93
  *
83
94
  * If you want to only change specific properties of an event, but keep the event
84
- * as part of the billing calculation, use the [Amend single event](amend-event)
85
- * endpoint instead.
95
+ * as part of the billing calculation, use the [Amend event](amend-event) endpoint
96
+ * instead.
86
97
  *
87
98
  * This API is always audit-safe. The process will still retain the deprecated
88
99
  * event, though it will be ignored for billing calculations. For auditing and data
@@ -562,24 +573,32 @@ export interface EventSearchParams {
562
573
  timeframe_start?: string | null;
563
574
  }
564
575
 
565
- export namespace Events {
566
- export import EventUpdateResponse = EventsAPI.EventUpdateResponse;
567
- export import EventDeprecateResponse = EventsAPI.EventDeprecateResponse;
568
- export import EventIngestResponse = EventsAPI.EventIngestResponse;
569
- export import EventSearchResponse = EventsAPI.EventSearchResponse;
570
- export import EventUpdateParams = EventsAPI.EventUpdateParams;
571
- export import EventIngestParams = EventsAPI.EventIngestParams;
572
- export import EventSearchParams = EventsAPI.EventSearchParams;
573
- export import Backfills = BackfillsAPI.Backfills;
574
- export import BackfillCreateResponse = BackfillsAPI.BackfillCreateResponse;
575
- export import BackfillListResponse = BackfillsAPI.BackfillListResponse;
576
- export import BackfillCloseResponse = BackfillsAPI.BackfillCloseResponse;
577
- export import BackfillFetchResponse = BackfillsAPI.BackfillFetchResponse;
578
- export import BackfillRevertResponse = BackfillsAPI.BackfillRevertResponse;
579
- export import BackfillListResponsesPage = BackfillsAPI.BackfillListResponsesPage;
580
- export import BackfillCreateParams = BackfillsAPI.BackfillCreateParams;
581
- export import BackfillListParams = BackfillsAPI.BackfillListParams;
582
- export import Volume = VolumeAPI.Volume;
583
- export import EventVolumes = VolumeAPI.EventVolumes;
584
- export import VolumeListParams = VolumeAPI.VolumeListParams;
576
+ Events.Backfills = Backfills;
577
+ Events.BackfillListResponsesPage = BackfillListResponsesPage;
578
+ Events.Volume = Volume;
579
+
580
+ export declare namespace Events {
581
+ export {
582
+ type EventUpdateResponse as EventUpdateResponse,
583
+ type EventDeprecateResponse as EventDeprecateResponse,
584
+ type EventIngestResponse as EventIngestResponse,
585
+ type EventSearchResponse as EventSearchResponse,
586
+ type EventUpdateParams as EventUpdateParams,
587
+ type EventIngestParams as EventIngestParams,
588
+ type EventSearchParams as EventSearchParams,
589
+ };
590
+
591
+ export {
592
+ Backfills as Backfills,
593
+ type BackfillCreateResponse as BackfillCreateResponse,
594
+ type BackfillListResponse as BackfillListResponse,
595
+ type BackfillCloseResponse as BackfillCloseResponse,
596
+ type BackfillFetchResponse as BackfillFetchResponse,
597
+ type BackfillRevertResponse as BackfillRevertResponse,
598
+ BackfillListResponsesPage as BackfillListResponsesPage,
599
+ type BackfillCreateParams as BackfillCreateParams,
600
+ type BackfillListParams as BackfillListParams,
601
+ };
602
+
603
+ export { Volume as Volume, type EventVolumes as EventVolumes, type VolumeListParams as VolumeListParams };
585
604
  }
@@ -1,24 +1,24 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export {
4
- BackfillCreateResponse,
5
- BackfillListResponse,
6
- BackfillCloseResponse,
7
- BackfillFetchResponse,
8
- BackfillRevertResponse,
9
- BackfillCreateParams,
10
- BackfillListParams,
11
4
  BackfillListResponsesPage,
12
5
  Backfills,
6
+ type BackfillCreateResponse,
7
+ type BackfillListResponse,
8
+ type BackfillCloseResponse,
9
+ type BackfillFetchResponse,
10
+ type BackfillRevertResponse,
11
+ type BackfillCreateParams,
12
+ type BackfillListParams,
13
13
  } from './backfills';
14
14
  export {
15
- EventUpdateResponse,
16
- EventDeprecateResponse,
17
- EventIngestResponse,
18
- EventSearchResponse,
19
- EventUpdateParams,
20
- EventIngestParams,
21
- EventSearchParams,
22
15
  Events,
16
+ type EventUpdateResponse,
17
+ type EventDeprecateResponse,
18
+ type EventIngestResponse,
19
+ type EventSearchResponse,
20
+ type EventUpdateParams,
21
+ type EventIngestParams,
22
+ type EventSearchParams,
23
23
  } from './events';
24
- export { EventVolumes, VolumeListParams, Volume } from './volume';
24
+ export { Volume, type EventVolumes, type VolumeListParams } from './volume';
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { APIResource } from '../../resource';
4
4
  import * as Core from '../../core';
5
- import * as VolumeAPI from './volume';
6
5
 
7
6
  export class Volume extends APIResource {
8
7
  /**
@@ -75,7 +74,6 @@ export interface VolumeListParams {
75
74
  timeframe_end?: string;
76
75
  }
77
76
 
78
- export namespace Volume {
79
- export import EventVolumes = VolumeAPI.EventVolumes;
80
- export import VolumeListParams = VolumeAPI.VolumeListParams;
77
+ export declare namespace Volume {
78
+ export { type EventVolumes as EventVolumes, type VolumeListParams as VolumeListParams };
81
79
  }