@metronome/sdk 0.1.0-beta.9 → 0.1.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 (286) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/README.md +30 -46
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +19 -5
  7. package/core.d.ts.map +1 -1
  8. package/core.js +23 -14
  9. package/core.js.map +1 -1
  10. package/core.mjs +24 -15
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +3 -2
  13. package/index.d.ts +3 -2
  14. package/index.d.ts.map +1 -1
  15. package/index.js +6 -3
  16. package/index.js.map +1 -1
  17. package/index.mjs +6 -3
  18. package/index.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/pagination.d.ts +1 -0
  21. package/pagination.d.ts.map +1 -1
  22. package/pagination.js +3 -0
  23. package/pagination.js.map +1 -1
  24. package/pagination.mjs +3 -0
  25. package/pagination.mjs.map +1 -1
  26. package/resource.d.ts +1 -1
  27. package/resource.d.ts.map +1 -1
  28. package/resource.js.map +1 -1
  29. package/resource.mjs.map +1 -1
  30. package/resources/shared.d.ts +473 -37
  31. package/resources/shared.d.ts.map +1 -1
  32. package/resources/v1/alerts.d.ts +26 -2
  33. package/resources/v1/alerts.d.ts.map +1 -1
  34. package/resources/v1/alerts.js +19 -0
  35. package/resources/v1/alerts.js.map +1 -1
  36. package/resources/v1/alerts.mjs +19 -0
  37. package/resources/v1/alerts.mjs.map +1 -1
  38. package/resources/v1/audit-logs.d.ts +8 -0
  39. package/resources/v1/audit-logs.d.ts.map +1 -1
  40. package/resources/v1/audit-logs.js.map +1 -1
  41. package/resources/v1/audit-logs.mjs.map +1 -1
  42. package/resources/v1/billable-metrics.d.ts +58 -3
  43. package/resources/v1/billable-metrics.d.ts.map +1 -1
  44. package/resources/v1/billable-metrics.js +41 -0
  45. package/resources/v1/billable-metrics.js.map +1 -1
  46. package/resources/v1/billable-metrics.mjs +41 -0
  47. package/resources/v1/billable-metrics.mjs.map +1 -1
  48. package/resources/v1/contracts/contracts.d.ts +1478 -102
  49. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  50. package/resources/v1/contracts/contracts.js +180 -3
  51. package/resources/v1/contracts/contracts.js.map +1 -1
  52. package/resources/v1/contracts/contracts.mjs +180 -3
  53. package/resources/v1/contracts/contracts.mjs.map +1 -1
  54. package/resources/v1/contracts/index.d.ts +2 -2
  55. package/resources/v1/contracts/index.d.ts.map +1 -1
  56. package/resources/v1/contracts/index.js.map +1 -1
  57. package/resources/v1/contracts/index.mjs.map +1 -1
  58. package/resources/v1/contracts/named-schedules.d.ts +21 -0
  59. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  60. package/resources/v1/contracts/named-schedules.js +21 -0
  61. package/resources/v1/contracts/named-schedules.js.map +1 -1
  62. package/resources/v1/contracts/named-schedules.mjs +21 -0
  63. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  64. package/resources/v1/contracts/products.d.ts +51 -3
  65. package/resources/v1/contracts/products.d.ts.map +1 -1
  66. package/resources/v1/contracts/products.js +33 -0
  67. package/resources/v1/contracts/products.js.map +1 -1
  68. package/resources/v1/contracts/products.mjs +33 -0
  69. package/resources/v1/contracts/products.mjs.map +1 -1
  70. package/resources/v1/contracts/rate-cards/index.d.ts +1 -1
  71. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  72. package/resources/v1/contracts/rate-cards/index.js.map +1 -1
  73. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  74. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +25 -0
  75. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  76. package/resources/v1/contracts/rate-cards/named-schedules.js +25 -0
  77. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  78. package/resources/v1/contracts/rate-cards/named-schedules.mjs +25 -0
  79. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  80. package/resources/v1/contracts/rate-cards/product-orders.d.ts +30 -0
  81. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  82. package/resources/v1/contracts/rate-cards/product-orders.js +30 -0
  83. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  84. package/resources/v1/contracts/rate-cards/product-orders.mjs +30 -0
  85. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  86. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +107 -10
  87. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  88. package/resources/v1/contracts/rate-cards/rate-cards.js +71 -0
  89. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  90. package/resources/v1/contracts/rate-cards/rate-cards.mjs +71 -0
  91. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  92. package/resources/v1/contracts/rate-cards/rates.d.ts +102 -14
  93. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  94. package/resources/v1/contracts/rate-cards/rates.js +68 -0
  95. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  96. package/resources/v1/contracts/rate-cards/rates.mjs +68 -0
  97. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  98. package/resources/v1/credit-grants.d.ts +77 -2
  99. package/resources/v1/credit-grants.d.ts.map +1 -1
  100. package/resources/v1/credit-grants.js +39 -2
  101. package/resources/v1/credit-grants.js.map +1 -1
  102. package/resources/v1/credit-grants.mjs +39 -2
  103. package/resources/v1/credit-grants.mjs.map +1 -1
  104. package/resources/v1/custom-fields.d.ts +51 -7
  105. package/resources/v1/custom-fields.d.ts.map +1 -1
  106. package/resources/v1/custom-fields.js +35 -0
  107. package/resources/v1/custom-fields.js.map +1 -1
  108. package/resources/v1/custom-fields.mjs +35 -0
  109. package/resources/v1/custom-fields.mjs.map +1 -1
  110. package/resources/v1/customers/alerts.d.ts +28 -0
  111. package/resources/v1/customers/alerts.d.ts.map +1 -1
  112. package/resources/v1/customers/alerts.js +23 -0
  113. package/resources/v1/customers/alerts.js.map +1 -1
  114. package/resources/v1/customers/alerts.mjs +23 -0
  115. package/resources/v1/customers/alerts.mjs.map +1 -1
  116. package/resources/v1/customers/billing-config.d.ts +31 -0
  117. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  118. package/resources/v1/customers/billing-config.js +27 -0
  119. package/resources/v1/customers/billing-config.js.map +1 -1
  120. package/resources/v1/customers/billing-config.mjs +27 -0
  121. package/resources/v1/customers/billing-config.mjs.map +1 -1
  122. package/resources/v1/customers/commits.d.ts +94 -7
  123. package/resources/v1/customers/commits.d.ts.map +1 -1
  124. package/resources/v1/customers/commits.js +56 -1
  125. package/resources/v1/customers/commits.js.map +1 -1
  126. package/resources/v1/customers/commits.mjs +56 -1
  127. package/resources/v1/customers/commits.mjs.map +1 -1
  128. package/resources/v1/customers/credits.d.ts +73 -3
  129. package/resources/v1/customers/credits.d.ts.map +1 -1
  130. package/resources/v1/customers/credits.js +41 -1
  131. package/resources/v1/customers/credits.js.map +1 -1
  132. package/resources/v1/customers/credits.mjs +41 -1
  133. package/resources/v1/customers/credits.mjs.map +1 -1
  134. package/resources/v1/customers/customers.d.ts +186 -9
  135. package/resources/v1/customers/customers.d.ts.map +1 -1
  136. package/resources/v1/customers/customers.js +106 -1
  137. package/resources/v1/customers/customers.js.map +1 -1
  138. package/resources/v1/customers/customers.mjs +106 -1
  139. package/resources/v1/customers/customers.mjs.map +1 -1
  140. package/resources/v1/customers/index.d.ts +1 -1
  141. package/resources/v1/customers/index.d.ts.map +1 -1
  142. package/resources/v1/customers/index.js.map +1 -1
  143. package/resources/v1/customers/index.mjs.map +1 -1
  144. package/resources/v1/customers/invoices.d.ts +144 -52
  145. package/resources/v1/customers/invoices.d.ts.map +1 -1
  146. package/resources/v1/customers/invoices.js +49 -0
  147. package/resources/v1/customers/invoices.js.map +1 -1
  148. package/resources/v1/customers/invoices.mjs +49 -0
  149. package/resources/v1/customers/invoices.mjs.map +1 -1
  150. package/resources/v1/customers/named-schedules.d.ts +21 -0
  151. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  152. package/resources/v1/customers/named-schedules.js +21 -0
  153. package/resources/v1/customers/named-schedules.js.map +1 -1
  154. package/resources/v1/customers/named-schedules.mjs +21 -0
  155. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  156. package/resources/v1/customers/plans.d.ts +46 -1
  157. package/resources/v1/customers/plans.d.ts.map +1 -1
  158. package/resources/v1/customers/plans.js +43 -0
  159. package/resources/v1/customers/plans.js.map +1 -1
  160. package/resources/v1/customers/plans.mjs +43 -0
  161. package/resources/v1/customers/plans.mjs.map +1 -1
  162. package/resources/v1/dashboards.d.ts +30 -2
  163. package/resources/v1/dashboards.d.ts.map +1 -1
  164. package/resources/v1/dashboards.js +26 -0
  165. package/resources/v1/dashboards.js.map +1 -1
  166. package/resources/v1/dashboards.mjs +26 -0
  167. package/resources/v1/dashboards.mjs.map +1 -1
  168. package/resources/v1/index.d.ts +3 -3
  169. package/resources/v1/index.d.ts.map +1 -1
  170. package/resources/v1/index.js.map +1 -1
  171. package/resources/v1/index.mjs.map +1 -1
  172. package/resources/v1/invoices.d.ts +14 -0
  173. package/resources/v1/invoices.d.ts.map +1 -1
  174. package/resources/v1/invoices.js +14 -0
  175. package/resources/v1/invoices.js.map +1 -1
  176. package/resources/v1/invoices.mjs +14 -0
  177. package/resources/v1/invoices.mjs.map +1 -1
  178. package/resources/v1/plans.d.ts +47 -4
  179. package/resources/v1/plans.d.ts.map +1 -1
  180. package/resources/v1/plans.js +27 -0
  181. package/resources/v1/plans.js.map +1 -1
  182. package/resources/v1/plans.mjs +27 -0
  183. package/resources/v1/plans.mjs.map +1 -1
  184. package/resources/v1/pricing-units.d.ts +8 -0
  185. package/resources/v1/pricing-units.d.ts.map +1 -1
  186. package/resources/v1/pricing-units.js.map +1 -1
  187. package/resources/v1/pricing-units.mjs.map +1 -1
  188. package/resources/v1/services.d.ts +5 -0
  189. package/resources/v1/services.d.ts.map +1 -1
  190. package/resources/v1/services.js +5 -0
  191. package/resources/v1/services.js.map +1 -1
  192. package/resources/v1/services.mjs +5 -0
  193. package/resources/v1/services.mjs.map +1 -1
  194. package/resources/v1/usage.d.ts +161 -3
  195. package/resources/v1/usage.d.ts.map +1 -1
  196. package/resources/v1/usage.js +46 -0
  197. package/resources/v1/usage.js.map +1 -1
  198. package/resources/v1/usage.mjs +46 -0
  199. package/resources/v1/usage.mjs.map +1 -1
  200. package/resources/v1/v1.d.ts +6 -6
  201. package/resources/v1/v1.d.ts.map +1 -1
  202. package/resources/v1/v1.js.map +1 -1
  203. package/resources/v1/v1.mjs.map +1 -1
  204. package/resources/v2/contracts.d.ts +2923 -207
  205. package/resources/v2/contracts.d.ts.map +1 -1
  206. package/resources/v2/contracts.js +90 -2
  207. package/resources/v2/contracts.js.map +1 -1
  208. package/resources/v2/contracts.mjs +90 -2
  209. package/resources/v2/contracts.mjs.map +1 -1
  210. package/resources/webhooks.js +5 -5
  211. package/resources/webhooks.js.map +1 -1
  212. package/resources/webhooks.mjs +5 -5
  213. package/resources/webhooks.mjs.map +1 -1
  214. package/src/_shims/auto/runtime-bun.ts +1 -1
  215. package/src/_shims/auto/runtime-node.ts +1 -1
  216. package/src/_shims/auto/runtime.ts +1 -1
  217. package/src/_shims/auto/types-node.ts +1 -1
  218. package/src/_shims/bun-runtime.ts +2 -2
  219. package/src/_shims/index.d.ts +5 -3
  220. package/src/_shims/index.js +5 -1
  221. package/src/_shims/index.mjs +6 -2
  222. package/src/_shims/node-runtime.ts +3 -3
  223. package/src/_shims/registry.ts +1 -1
  224. package/src/_shims/web-runtime.ts +3 -3
  225. package/src/core.ts +46 -18
  226. package/src/error.ts +1 -1
  227. package/src/index.ts +22 -16
  228. package/src/internal/qs/formats.ts +1 -1
  229. package/src/internal/qs/index.ts +3 -3
  230. package/src/internal/qs/stringify.ts +3 -3
  231. package/src/internal/qs/utils.ts +2 -2
  232. package/src/pagination.ts +5 -1
  233. package/src/resource.ts +2 -2
  234. package/src/resources/index.ts +4 -4
  235. package/src/resources/shared.ts +539 -40
  236. package/src/resources/v1/alerts.ts +29 -5
  237. package/src/resources/v1/audit-logs.ts +12 -4
  238. package/src/resources/v1/billable-metrics.ts +57 -8
  239. package/src/resources/v1/contracts/contracts.ts +1643 -124
  240. package/src/resources/v1/contracts/index.ts +8 -4
  241. package/src/resources/v1/contracts/named-schedules.ts +23 -2
  242. package/src/resources/v1/contracts/products.ts +53 -9
  243. package/src/resources/v1/contracts/rate-cards/index.ts +6 -4
  244. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +27 -2
  245. package/src/resources/v1/contracts/rate-cards/product-orders.ts +33 -3
  246. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +113 -20
  247. package/src/resources/v1/contracts/rate-cards/rates.ts +86 -18
  248. package/src/resources/v1/contracts/rate-cards.ts +1 -1
  249. package/src/resources/v1/contracts.ts +1 -1
  250. package/src/resources/v1/credit-grants.ts +82 -10
  251. package/src/resources/v1/custom-fields.ts +57 -9
  252. package/src/resources/v1/customers/alerts.ts +32 -3
  253. package/src/resources/v1/customers/billing-config.ts +34 -2
  254. package/src/resources/v1/customers/commits.ts +97 -10
  255. package/src/resources/v1/customers/credits.ts +76 -6
  256. package/src/resources/v1/customers/customers.ts +208 -27
  257. package/src/resources/v1/customers/index.ts +10 -8
  258. package/src/resources/v1/customers/invoices.ts +123 -57
  259. package/src/resources/v1/customers/named-schedules.ts +23 -2
  260. package/src/resources/v1/customers/plans.ts +48 -5
  261. package/src/resources/v1/customers.ts +1 -1
  262. package/src/resources/v1/dashboards.ts +30 -4
  263. package/src/resources/v1/index.ts +20 -14
  264. package/src/resources/v1/invoices.ts +16 -2
  265. package/src/resources/v1/plans.ts +45 -10
  266. package/src/resources/v1/pricing-units.ts +12 -4
  267. package/src/resources/v1/services.ts +7 -2
  268. package/src/resources/v1/usage.ts +187 -6
  269. package/src/resources/v1/v1.ts +39 -27
  270. package/src/resources/v1.ts +1 -1
  271. package/src/resources/v2/contracts.ts +3397 -235
  272. package/src/resources/v2/index.ts +2 -2
  273. package/src/resources/v2/v2.ts +3 -3
  274. package/src/resources/v2.ts +1 -1
  275. package/src/resources/webhooks.ts +7 -7
  276. package/src/resources.ts +1 -1
  277. package/src/shims/node.ts +3 -3
  278. package/src/shims/web.ts +3 -3
  279. package/src/uploads.ts +4 -4
  280. package/src/version.ts +1 -1
  281. package/version.d.ts +1 -1
  282. package/version.d.ts.map +1 -1
  283. package/version.js +1 -1
  284. package/version.js.map +1 -1
  285. package/version.mjs +1 -1
  286. package/version.mjs.map +1 -1
@@ -7,12 +7,27 @@ class Alerts extends resource_1.APIResource {
7
7
  /**
8
8
  * Get the customer alert status and alert information for the specified customer
9
9
  * and alert
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const alert = await client.v1.customers.alerts.retrieve({
14
+ * alert_id: '8deed800-1b7a-495d-a207-6c52bac54dc9',
15
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
16
+ * });
17
+ * ```
10
18
  */
11
19
  retrieve(body, options) {
12
20
  return this._client.post('/v1/customer-alerts/get', { body, ...options });
13
21
  }
14
22
  /**
15
23
  * Fetch all customer alert statuses and alert information for a customer
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const alerts = await client.v1.customers.alerts.list({
28
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
29
+ * });
30
+ * ```
16
31
  */
17
32
  list(params, options) {
18
33
  const { next_page, ...body } = params;
@@ -20,6 +35,14 @@ class Alerts extends resource_1.APIResource {
20
35
  }
21
36
  /**
22
37
  * Reset state for an alert by customer id and force re-evaluation
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * await client.v1.customers.alerts.reset({
42
+ * alert_id: '5e8691bf-b22a-4672-922d-f80eee940f01',
43
+ * customer_id: '4c83caf3-8af4-44e2-9aeb-e290531726d9',
44
+ * });
45
+ * ```
23
46
  */
24
47
  reset(body, options) {
25
48
  return this._client.post('/v1/customer-alerts/reset', {
@@ -1 +1 @@
1
- {"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/alerts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAIhD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;OAGG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAA6B;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,MAAuB,EAAE,OAA6B;QACzD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAsB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE;YACpD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AA3BD,wBA2BC"}
1
+ {"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/alerts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAIhD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAA6B;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAuB,EAAE,OAA6B;QACzD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAsB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE;YACpD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAlDD,wBAkDC"}
@@ -4,12 +4,27 @@ export class Alerts extends APIResource {
4
4
  /**
5
5
  * Get the customer alert status and alert information for the specified customer
6
6
  * and alert
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const alert = await client.v1.customers.alerts.retrieve({
11
+ * alert_id: '8deed800-1b7a-495d-a207-6c52bac54dc9',
12
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
13
+ * });
14
+ * ```
7
15
  */
8
16
  retrieve(body, options) {
9
17
  return this._client.post('/v1/customer-alerts/get', { body, ...options });
10
18
  }
11
19
  /**
12
20
  * Fetch all customer alert statuses and alert information for a customer
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const alerts = await client.v1.customers.alerts.list({
25
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
26
+ * });
27
+ * ```
13
28
  */
14
29
  list(params, options) {
15
30
  const { next_page, ...body } = params;
@@ -17,6 +32,14 @@ export class Alerts extends APIResource {
17
32
  }
18
33
  /**
19
34
  * Reset state for an alert by customer id and force re-evaluation
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * await client.v1.customers.alerts.reset({
39
+ * alert_id: '5e8691bf-b22a-4672-922d-f80eee940f01',
40
+ * customer_id: '4c83caf3-8af4-44e2-9aeb-e290531726d9',
41
+ * });
42
+ * ```
20
43
  */
21
44
  reset(body, options) {
22
45
  return this._client.post('/v1/customer-alerts/reset', {
@@ -1 +1 @@
1
- {"version":3,"file":"alerts.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/alerts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAA6B;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,MAAuB,EAAE,OAA6B;QACzD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAsB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE;YACpD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"alerts.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/alerts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,IAAyB,EAAE,OAA6B;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAuB,EAAE,OAA6B;QACzD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAsB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE;YACpD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -3,15 +3,42 @@ import * as Core from "../../../core.js";
3
3
  export declare class BillingConfig extends APIResource {
4
4
  /**
5
5
  * Set the billing configuration for a given customer.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * await client.v1.customers.billingConfig.create({
10
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
11
+ * billing_provider_type: 'stripe',
12
+ * billing_provider_customer_id: 'cus_AJ6y20bjkOOayM',
13
+ * stripe_collection_method: 'charge_automatically',
14
+ * });
15
+ * ```
6
16
  */
7
17
  create(params: BillingConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise<void>;
8
18
  /**
9
19
  * Fetch the billing configuration for the given customer.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const billingConfig =
24
+ * await client.v1.customers.billingConfig.retrieve({
25
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
26
+ * billing_provider_type: 'stripe',
27
+ * });
28
+ * ```
10
29
  */
11
30
  retrieve(params: BillingConfigRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<BillingConfigRetrieveResponse>;
12
31
  /**
13
32
  * Delete the billing configuration for a given customer. Note: this is unsupported
14
33
  * for Azure and AWS Marketplace customers.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * await client.v1.customers.billingConfig.delete({
38
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
39
+ * billing_provider_type: 'stripe',
40
+ * });
41
+ * ```
15
42
  */
16
43
  delete(params: BillingConfigDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>;
17
44
  }
@@ -26,6 +53,10 @@ export declare namespace BillingConfigRetrieveResponse {
26
53
  * [AWS's GetEntitlements API](https://docs.aws.amazon.com/marketplaceentitlement/latest/APIReference/API_GetEntitlements.html).
27
54
  */
28
55
  aws_expiration_date?: string;
56
+ /**
57
+ * True if the aws_product_code is a SAAS subscription product, false otherwise.
58
+ */
59
+ aws_is_subscription_product?: boolean;
29
60
  aws_product_code?: string;
30
61
  aws_region?: 'af-south-1' | 'ap-east-1' | 'ap-northeast-1' | 'ap-northeast-2' | 'ap-northeast-3' | 'ap-south-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'ca-central-1' | 'cn-north-1' | 'cn-northwest-1' | 'eu-central-1' | 'eu-north-1' | 'eu-south-1' | 'eu-west-1' | 'eu-west-2' | 'eu-west-3' | 'me-south-1' | 'sa-east-1' | 'us-east-1' | 'us-east-2' | 'us-gov-east-1' | 'us-gov-west-1' | 'us-west-1' | 'us-west-2';
31
62
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"billing-config.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/customers/billing-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CA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;;OAEG;IACH,wBAAwB,CAAC,EAAE,sBAAsB,GAAG,cAAc,CAAC;CACpE;AAED,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,qBAAqB,EACjB,iBAAiB,GACjB,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,mBAAmB,GACnB,mBAAmB,GACnB,SAAS,GACT,iBAAiB,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,qBAAqB,EACjB,iBAAiB,GACjB,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,mBAAmB,GACnB,mBAAmB,GACnB,SAAS,GACT,iBAAiB,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -6,6 +6,16 @@ const resource_1 = require("../../../resource.js");
6
6
  class BillingConfig extends resource_1.APIResource {
7
7
  /**
8
8
  * Set the billing configuration for a given customer.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * await client.v1.customers.billingConfig.create({
13
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
14
+ * billing_provider_type: 'stripe',
15
+ * billing_provider_customer_id: 'cus_AJ6y20bjkOOayM',
16
+ * stripe_collection_method: 'charge_automatically',
17
+ * });
18
+ * ```
9
19
  */
10
20
  create(params, options) {
11
21
  const { customer_id, billing_provider_type, ...body } = params;
@@ -17,6 +27,15 @@ class BillingConfig extends resource_1.APIResource {
17
27
  }
18
28
  /**
19
29
  * Fetch the billing configuration for the given customer.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const billingConfig =
34
+ * await client.v1.customers.billingConfig.retrieve({
35
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
36
+ * billing_provider_type: 'stripe',
37
+ * });
38
+ * ```
20
39
  */
21
40
  retrieve(params, options) {
22
41
  const { customer_id, billing_provider_type } = params;
@@ -25,6 +44,14 @@ class BillingConfig extends resource_1.APIResource {
25
44
  /**
26
45
  * Delete the billing configuration for a given customer. Note: this is unsupported
27
46
  * for Azure and AWS Marketplace customers.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * await client.v1.customers.billingConfig.delete({
51
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
52
+ * billing_provider_type: 'stripe',
53
+ * });
54
+ * ```
28
55
  */
29
56
  delete(params, options) {
30
57
  const { customer_id, billing_provider_type } = params;
@@ -1 +1 @@
1
- {"version":3,"file":"billing-config.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/billing-config.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAGhD,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;OAEG;IACH,MAAM,CAAC,MAAiC,EAAE,OAA6B;QACrE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE;YAC/F,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,MAAmC,EACnC,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,MAAiC,EAAE,OAA6B;QACrE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE;YACjG,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAnCD,sCAmCC"}
1
+ {"version":3,"file":"billing-config.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/billing-config.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAGhD,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,MAAiC,EAAE,OAA6B;QACrE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE;YAC/F,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,MAAmC,EACnC,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3G,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAiC,EAAE,OAA6B;QACrE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE;YACjG,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AA9DD,sCA8DC"}
@@ -3,6 +3,16 @@ import { APIResource } from "../../../resource.mjs";
3
3
  export class BillingConfig extends APIResource {
4
4
  /**
5
5
  * Set the billing configuration for a given customer.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * await client.v1.customers.billingConfig.create({
10
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
11
+ * billing_provider_type: 'stripe',
12
+ * billing_provider_customer_id: 'cus_AJ6y20bjkOOayM',
13
+ * stripe_collection_method: 'charge_automatically',
14
+ * });
15
+ * ```
6
16
  */
7
17
  create(params, options) {
8
18
  const { customer_id, billing_provider_type, ...body } = params;
@@ -14,6 +24,15 @@ export class BillingConfig extends APIResource {
14
24
  }
15
25
  /**
16
26
  * Fetch the billing configuration for the given customer.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const billingConfig =
31
+ * await client.v1.customers.billingConfig.retrieve({
32
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
33
+ * billing_provider_type: 'stripe',
34
+ * });
35
+ * ```
17
36
  */
18
37
  retrieve(params, options) {
19
38
  const { customer_id, billing_provider_type } = params;
@@ -22,6 +41,14 @@ export class BillingConfig extends APIResource {
22
41
  /**
23
42
  * Delete the billing configuration for a given customer. Note: this is unsupported
24
43
  * for Azure and AWS Marketplace customers.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * await client.v1.customers.billingConfig.delete({
48
+ * customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
49
+ * billing_provider_type: 'stripe',
50
+ * });
51
+ * ```
25
52
  */
26
53
  delete(params, options) {
27
54
  const { customer_id, billing_provider_type } = params;
@@ -1 +1 @@
1
- {"version":3,"file":"billing-config.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/billing-config.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;OAEG;IACH,MAAM,CAAC,MAAiC,EAAE,OAA6B;QACrE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE;YAC/F,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,MAAmC,EACnC,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,MAAiC,EAAE,OAA6B;QACrE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE;YACjG,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"billing-config.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/billing-config.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,MAAiC,EAAE,OAA6B;QACrE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE;YAC/F,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,MAAmC,EACnC,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3G,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAiC,EAAE,OAA6B;QACrE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,WAAW,mBAAmB,qBAAqB,EAAE,EAAE;YACjG,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -4,14 +4,69 @@ import * as Shared from "../../shared.js";
4
4
  export declare class Commits extends APIResource {
5
5
  /**
6
6
  * Create a new commit at the customer level.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const commit = await client.v1.customers.commits.create({
11
+ * access_schedule: {
12
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
13
+ * schedule_items: [
14
+ * {
15
+ * amount: 1000,
16
+ * starting_at: '2020-01-01T00:00:00.000Z',
17
+ * ending_before: '2020-02-01T00:00:00.000Z',
18
+ * },
19
+ * ],
20
+ * },
21
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
22
+ * priority: 100,
23
+ * product_id: 'f14d6729-6a44-4b13-9908-9387f1918790',
24
+ * type: 'prepaid',
25
+ * invoice_contract_id:
26
+ * 'e57d6929-c2f1-4796-a9a8-63cedefe848d',
27
+ * invoice_schedule: {
28
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
29
+ * schedule_items: [
30
+ * {
31
+ * unit_price: 10000000,
32
+ * quantity: 1,
33
+ * timestamp: '2020-03-01T00:00:00.000Z',
34
+ * },
35
+ * ],
36
+ * },
37
+ * name: 'My Commit',
38
+ * });
39
+ * ```
7
40
  */
8
41
  create(body: CommitCreateParams, options?: Core.RequestOptions): Core.APIPromise<CommitCreateResponse>;
9
42
  /**
10
43
  * List commits.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const commits = await client.v1.customers.commits.list({
48
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
49
+ * commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
50
+ * include_ledgers: true,
51
+ * });
52
+ * ```
11
53
  */
12
54
  list(body: CommitListParams, options?: Core.RequestOptions): Core.APIPromise<CommitListResponse>;
13
55
  /**
14
- * Update the end date of a PREPAID commit
56
+ * Pull forward the end date of a prepaid commit. Use the "edit a commit" endpoint
57
+ * to extend the end date of a prepaid commit, or to make other edits to the
58
+ * commit.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const response =
63
+ * await client.v1.customers.commits.updateEndDate({
64
+ * commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
65
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
66
+ * access_ending_before: '2020-01-01T00:00:00.000Z',
67
+ * invoices_ending_before: '2020-01-01T00:00:00.000Z',
68
+ * });
69
+ * ```
15
70
  */
16
71
  updateEndDate(body: CommitUpdateEndDateParams, options?: Core.RequestOptions): Core.APIPromise<CommitUpdateEndDateResponse>;
17
72
  }
@@ -49,16 +104,20 @@ export interface CommitCreateParams {
49
104
  */
50
105
  applicable_contract_ids?: Array<string>;
51
106
  /**
52
- * Which products the commit applies to. If both applicable_product_ids and
53
- * applicable_product_tags are not provided, the commit applies to all products.
107
+ * Which products the commit applies to. If applicable_product_ids,
108
+ * applicable_product_tags or specifiers are not provided, the commit applies to
109
+ * all products.
54
110
  */
55
111
  applicable_product_ids?: Array<string>;
56
112
  /**
57
- * Which tags the commit applies to. If both applicable_product_ids and
58
- * applicable_product_tags are not provided, the commit applies to all products.
113
+ * Which tags the commit applies to. If applicable_product_ids,
114
+ * applicable_product_tags or specifiers are not provided, the commit applies to
115
+ * all products.
59
116
  */
60
117
  applicable_product_tags?: Array<string>;
61
- custom_fields?: Record<string, string>;
118
+ custom_fields?: {
119
+ [key: string]: string;
120
+ };
62
121
  /**
63
122
  * Used only in UI/API. It is not exposed to end customers.
64
123
  */
@@ -89,6 +148,13 @@ export interface CommitCreateParams {
89
148
  * This field's availability is dependent on your client's configuration.
90
149
  */
91
150
  salesforce_opportunity_id?: string;
151
+ /**
152
+ * List of filters that determine what kind of customer usage draws down a commit
153
+ * or credit. A customer's usage needs to meet the condition of at least one of the
154
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
155
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
156
+ */
157
+ specifiers?: Array<CommitCreateParams.Specifier>;
92
158
  /**
93
159
  * Prevents the creation of duplicates. If a request to create a commit or credit
94
160
  * is made with a uniqueness key that was previously used to create a commit or
@@ -205,6 +271,23 @@ export declare namespace CommitCreateParams {
205
271
  unit_price?: number;
206
272
  }
207
273
  }
274
+ interface Specifier {
275
+ presentation_group_values?: {
276
+ [key: string]: string;
277
+ };
278
+ pricing_group_values?: {
279
+ [key: string]: string;
280
+ };
281
+ /**
282
+ * If provided, the specifier will only apply to the product with the specified ID.
283
+ */
284
+ product_id?: string;
285
+ /**
286
+ * If provided, the specifier will only apply to products with all the specified
287
+ * tags.
288
+ */
289
+ product_tags?: Array<string>;
290
+ }
208
291
  }
209
292
  export interface CommitListParams {
210
293
  customer_id: string;
@@ -218,7 +301,7 @@ export interface CommitListParams {
218
301
  */
219
302
  effective_before?: string;
220
303
  /**
221
- * Include commits from archived contracts.
304
+ * Include archived commits and commits from archived contracts.
222
305
  */
223
306
  include_archived?: boolean;
224
307
  /**
@@ -235,6 +318,10 @@ export interface CommitListParams {
235
318
  * be slower.
236
319
  */
237
320
  include_ledgers?: boolean;
321
+ /**
322
+ * The maximum number of commits to return. Defaults to 25.
323
+ */
324
+ limit?: number;
238
325
  /**
239
326
  * The next page token from a previous response.
240
327
  */
@@ -1 +1 @@
1
- {"version":3,"file":"commits.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AAEvC,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;IAItG;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAIhG;;OAEG;IACH,aAAa,CACX,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;C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AC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
@@ -6,18 +6,73 @@ const resource_1 = require("../../../resource.js");
6
6
  class Commits extends resource_1.APIResource {
7
7
  /**
8
8
  * Create a new commit at the customer level.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const commit = await client.v1.customers.commits.create({
13
+ * access_schedule: {
14
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
15
+ * schedule_items: [
16
+ * {
17
+ * amount: 1000,
18
+ * starting_at: '2020-01-01T00:00:00.000Z',
19
+ * ending_before: '2020-02-01T00:00:00.000Z',
20
+ * },
21
+ * ],
22
+ * },
23
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
24
+ * priority: 100,
25
+ * product_id: 'f14d6729-6a44-4b13-9908-9387f1918790',
26
+ * type: 'prepaid',
27
+ * invoice_contract_id:
28
+ * 'e57d6929-c2f1-4796-a9a8-63cedefe848d',
29
+ * invoice_schedule: {
30
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
31
+ * schedule_items: [
32
+ * {
33
+ * unit_price: 10000000,
34
+ * quantity: 1,
35
+ * timestamp: '2020-03-01T00:00:00.000Z',
36
+ * },
37
+ * ],
38
+ * },
39
+ * name: 'My Commit',
40
+ * });
41
+ * ```
9
42
  */
10
43
  create(body, options) {
11
44
  return this._client.post('/v1/contracts/customerCommits/create', { body, ...options });
12
45
  }
13
46
  /**
14
47
  * List commits.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const commits = await client.v1.customers.commits.list({
52
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
53
+ * commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
54
+ * include_ledgers: true,
55
+ * });
56
+ * ```
15
57
  */
16
58
  list(body, options) {
17
59
  return this._client.post('/v1/contracts/customerCommits/list', { body, ...options });
18
60
  }
19
61
  /**
20
- * Update the end date of a PREPAID commit
62
+ * Pull forward the end date of a prepaid commit. Use the "edit a commit" endpoint
63
+ * to extend the end date of a prepaid commit, or to make other edits to the
64
+ * commit.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const response =
69
+ * await client.v1.customers.commits.updateEndDate({
70
+ * commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
71
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
72
+ * access_ending_before: '2020-01-01T00:00:00.000Z',
73
+ * invoices_ending_before: '2020-01-01T00:00:00.000Z',
74
+ * });
75
+ * ```
21
76
  */
22
77
  updateEndDate(body, options) {
23
78
  return this._client.post('/v1/contracts/customerCommits/updateEndDate', { body, ...options });
@@ -1 +1 @@
1
- {"version":3,"file":"commits.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAIhD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;OAEG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,IAAsB,EAAE,OAA6B;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oCAAoC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;OAEG;IACH,aAAa,CACX,IAA+B,EAC/B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;CACF;AAxBD,0BAwBC"}
1
+ {"version":3,"file":"commits.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAIhD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,IAAsB,EAAE,OAA6B;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oCAAoC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,aAAa,CACX,IAA+B,EAC/B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;CACF;AA/ED,0BA+EC"}
@@ -3,18 +3,73 @@ import { APIResource } from "../../../resource.mjs";
3
3
  export class Commits extends APIResource {
4
4
  /**
5
5
  * Create a new commit at the customer level.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const commit = await client.v1.customers.commits.create({
10
+ * access_schedule: {
11
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
12
+ * schedule_items: [
13
+ * {
14
+ * amount: 1000,
15
+ * starting_at: '2020-01-01T00:00:00.000Z',
16
+ * ending_before: '2020-02-01T00:00:00.000Z',
17
+ * },
18
+ * ],
19
+ * },
20
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
21
+ * priority: 100,
22
+ * product_id: 'f14d6729-6a44-4b13-9908-9387f1918790',
23
+ * type: 'prepaid',
24
+ * invoice_contract_id:
25
+ * 'e57d6929-c2f1-4796-a9a8-63cedefe848d',
26
+ * invoice_schedule: {
27
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
28
+ * schedule_items: [
29
+ * {
30
+ * unit_price: 10000000,
31
+ * quantity: 1,
32
+ * timestamp: '2020-03-01T00:00:00.000Z',
33
+ * },
34
+ * ],
35
+ * },
36
+ * name: 'My Commit',
37
+ * });
38
+ * ```
6
39
  */
7
40
  create(body, options) {
8
41
  return this._client.post('/v1/contracts/customerCommits/create', { body, ...options });
9
42
  }
10
43
  /**
11
44
  * List commits.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const commits = await client.v1.customers.commits.list({
49
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
50
+ * commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
51
+ * include_ledgers: true,
52
+ * });
53
+ * ```
12
54
  */
13
55
  list(body, options) {
14
56
  return this._client.post('/v1/contracts/customerCommits/list', { body, ...options });
15
57
  }
16
58
  /**
17
- * Update the end date of a PREPAID commit
59
+ * Pull forward the end date of a prepaid commit. Use the "edit a commit" endpoint
60
+ * to extend the end date of a prepaid commit, or to make other edits to the
61
+ * commit.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const response =
66
+ * await client.v1.customers.commits.updateEndDate({
67
+ * commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
68
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
69
+ * access_ending_before: '2020-01-01T00:00:00.000Z',
70
+ * invoices_ending_before: '2020-01-01T00:00:00.000Z',
71
+ * });
72
+ * ```
18
73
  */
19
74
  updateEndDate(body, options) {
20
75
  return this._client.post('/v1/contracts/customerCommits/updateEndDate', { body, ...options });
@@ -1 +1 @@
1
- {"version":3,"file":"commits.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,IAAsB,EAAE,OAA6B;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oCAAoC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;OAEG;IACH,aAAa,CACX,IAA+B,EAC/B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAA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